Buggy code:
public class ClassLoaderWeavingAdaptor extends WeavingAdaptor { private static final String AOP_XML = ( ( Constants . AOP_USER_XML ) + ";" ) + ( Constants . AOP_AJC_XML ) ; private boolean initialized ; private List m_dumpTypePattern = new ArrayList ( ) ; private boolean m_dumpBefore = false ; private List m_includeTypePattern = new ArrayList ( ) ; private List m_excludeTypePattern = new ArrayList ( ) ; private List m_includeStartsWith = new ArrayList ( ) ; private List m_excludeStartsWith = new ArrayList ( ) ; private List m_aspectExcludeTypePattern = new ArrayList ( ) ; private List m_aspectExcludeStartsWith = new ArrayList ( ) ; private List m_aspectIncludeTypePattern = new ArrayList ( ) ; private List m_aspectIncludeStartsWith = new ArrayList ( ) ; private StringBuffer namespace ; private IWeavingContext weavingContext ; private static Trace trace = TraceFactory . getTraceFactory ( ) . getTrace ( ClassLoaderWeavingAdaptor . class ) ; public ClassLoaderWeavingAdaptor ( ) { } public ClassLoaderWeavingAdaptor ( final ClassLoader deprecatedLoader , final IWeavingContext deprecatedContext ) { } protected void initialize ( final ClassLoader classLoader , IWeavingContext context ) { } private List parseDefinitions ( final ClassLoader loader ) { List definitions = new ArrayList ( ) ; try { info ( ( "register<seq2seq4repair_space>classloader<seq2seq4repair_space>" + ( getClassLoaderName ( loader ) ) ) ) ; <START_BUG> if ( ClassLoader . getSystemClassLoader ( ) . equals ( loader ) ) { <END_BUG> String file = System . getProperty ( "aj5.def" , null ) ; if ( file != null ) { info ( ( "using<seq2seq4repair_space>(-Daj5.def)<seq2seq4repair_space>" + file ) ) ; definitions . add ( DocumentParser . parse ( new File ( file ) . toURL ( ) ) ) ; } } String resourcePath = System . getProperty ( "org.aspectj.weaver.loadtime.configuration" , ClassLoaderWeavingAdaptor . AOP_XML ) ; ClassLoaderWeavingAdaptor . trace . event ( "parseDefinitions" , this , resourcePath ) ; StringTokenizer st = new StringTokenizer ( resourcePath , ";" ) ; while ( st . hasMoreTokens ( ) ) { Enumeration xmls = weavingContext . getResources ( st . nextToken ( ) ) ; Set seenBefore = new HashSet ( ) ; while ( xmls . hasMoreElements ( ) ) { URL xml = ( ( URL ) ( xmls . nextElement ( ) ) ) ; ClassLoaderWeavingAdaptor . trace . event ( "parseDefinitions" , this , xml ) ; if ( ! ( seenBefore . contains ( xml ) ) ) { info ( ( "using<seq2seq4repair_space>configuration<seq2seq4repair_space>" + ( weavingContext . getFile ( xml ) ) ) ) ; definitions . add ( DocumentParser . parse ( xml ) ) ; seenBefore . add ( xml ) ; } else { warn ( ( "ignoring<seq2seq4repair_space>duplicate<seq2seq4repair_space>definition:<seq2seq4repair_space>" + xml ) ) ; } } } if ( definitions . isEmpty ( ) ) { disable ( ) ; info ( ( "no<seq2seq4repair_space>configuration<seq2seq4repair_space>found.<seq2seq4repair_space>Disabling<seq2seq4repair_space>weaver<seq2seq4repair_space>for<seq2seq4repair_space>class<seq2seq4repair_space>loader<seq2seq4repair_space>" + ( getClassLoaderName ( loader ) ) ) ) ; } } catch ( Exception e ) { disable ( ) ; warn ( "parse<seq2seq4repair_space>definitions<seq2seq4repair_space>failed" , e ) ; } return definitions ; } private void registerDefinitions ( final BcelWeaver weaver , final ClassLoader loader , List definitions ) { } private String getClassLoaderName ( ClassLoader loader ) { } private void registerOptions ( final BcelWeaver weaver , final ClassLoader loader , final List definitions ) { } private void registerAspectExclude ( final BcelWeaver weaver , final ClassLoader loader , final List definitions ) { } private void registerAspectInclude ( final BcelWeaver weaver , final ClassLoader loader , final List definitions ) { } protected void lint ( String name , String [ ] infos ) { } public String getContextId ( ) { } private void registerAspects ( final BcelWeaver weaver , final ClassLoader loader , final List definitions ) { } private void registerIncludeExclude ( final BcelWeaver weaver , final ClassLoader loader , final List definitions ) { } private String looksLikeStartsWith ( String typePattern ) { } private void registerDump ( final BcelWeaver weaver , final ClassLoader loader , final List definitions ) { } protected boolean accept ( String className , byte [ ] bytes ) { } private boolean acceptAspect ( String aspectClassName ) { } protected boolean shouldDump ( String className , boolean before ) { } public String getNamespace ( ) { } public boolean generatedClassesExistFor ( String className ) { } public void flushGeneratedClasses ( ) { } private void defineClass ( ClassLoader loader , String name , byte [ ] bytes ) { } }

Fix:
if ( loader . equals ( ClassLoader . getSystemClassLoader ( ) ) ) {