]> source.dussan.org Git - aspectj.git/commitdiff
fall back logic when on 1.5 vm but necessary classes cant be found (test machine...
authoraclement <aclement>
Fri, 2 Jun 2006 15:17:58 +0000 (15:17 +0000)
committeraclement <aclement>
Fri, 2 Jun 2006 15:17:58 +0000 (15:17 +0000)
weaver/src/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateFactory.java

index 83cf4c20c9ae64a809fb62355b4b5e4f455b72c1..ab0c2eb6a2a12f0cbefaebc5ce7cc7827e0f7d19 100644 (file)
@@ -48,6 +48,7 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
                }
        }
        
+       // can return 'null' if we can't find the class
        private static ReflectionBasedReferenceTypeDelegate create15Delegate(ReferenceType forReferenceType, Class forClass, ClassLoader usingClassLoader, World inWorld) {
                try {
                        Class delegateClass = Class.forName("org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate");//,false,usingClassLoader);//ReflectionBasedReferenceTypeDelegate.class.getClassLoader()); 
@@ -55,7 +56,8 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
                        ret.initialize(forReferenceType,forClass,usingClassLoader,inWorld);
                        return ret;
                } catch (ClassNotFoundException cnfEx) {
-                       throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate was not found on classpath");
+                       return null;
+                       //throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate was not found on classpath");
                } catch (InstantiationException insEx) {
                        throw new IllegalStateException("Attempted to create Java 1.5 reflection based delegate but InstantiationException: " + insEx + " occured");
                } catch (IllegalAccessException illAccEx) {
@@ -71,7 +73,8 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
                                GenericSignatureInformationProvider ret = (GenericSignatureInformationProvider) cons.newInstance(new Object[] {inWorld});
                                return ret;                             
                        } catch (ClassNotFoundException cnfEx) {
-                               throw new IllegalStateException("Attempted to create Java 1.5 generic signature provider but org.aspectj.weaver.reflect.Java15GenericSignatureInformationProvider was not found on classpath");
+                               // drop through and create a 14 provider...
+                               // throw new IllegalStateException("Attempted to create Java 1.5 generic signature provider but org.aspectj.weaver.reflect.Java15GenericSignatureInformationProvider was not found on classpath");
                        } catch (NoSuchMethodException nsmEx) {
                                throw new IllegalStateException("Attempted to create Java 1.5 generic signature provider but: " + nsmEx + " occured");
                        } catch (InstantiationException insEx) {
@@ -81,9 +84,8 @@ public class ReflectionBasedReferenceTypeDelegateFactory {
                        } catch (IllegalAccessException illAcc) {
                                throw new IllegalStateException("Attempted to create Java 1.5 generic signature provider but: " + illAcc + " occured");                                                         
                        }
-               } else {
-                       return new Java14GenericSignatureInformationProvider();
                }
+               return new Java14GenericSignatureInformationProvider();
        }
        
        /**