Project: AspectJ
Bug 175039 ArrayIndexOutOfBoundException Bug with Nested Type in TypeParameters
Reported: 2007-02-21 16:02:15 | Status: resolved fixed

I debugged this stack trace from load-time weaving (ajcore files are also available). I found that the signature argument to TypeFactory.createTypeFromSignature(String) is Pjava/lang/Enum<Ljavax/jws/soap/SOAPBinding$ParameterStyle;>; but the method is erroneously using an empty array of parameters, because it thinks the $ relates to the generic type, not the parameter. It should be fairly easy to reproduce with a test case and to fix with a patch - I'll look at it some more tonight or this week. java.lang.ArrayIndexOutOfBoundsException at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:698) at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406) at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:182) at org.aspectj.weaver.patterns.TypePattern.matchesSubtypes(TypePattern.java:169) at org.aspectj.weaver.patterns.TypePattern.matchesStatically(TypePattern.java:119) at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.accept(ClassLoaderWeavingAdaptor.java:621) at org.aspectj.weaver.tools.WeavingAdaptor.weaveClass(WeavingAdaptor.java:253) at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:78) at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:52) at sun.instrument.TransformerManager.transform(TransformerManager.java:122) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155) at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.security.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown Source) at java.lang.Class.forName(Ljava.lang.String;ZLjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getClassFromFieldDesc(Ljava.lang.String;ILjava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source) at jrockit.reflect.MemberAccess.getReturnClassFromMethodDesc(Ljava.lang.String;Ljava.lang.ClassLoader;)Ljava.lang.Class;(Unknown Source)

Files changed in fix:
weaver/src/org/aspectj/weaver/TypeFactory.java weaver/testsrc/org/aspectj/weaver/TypeXTestCase.java