Community
Participate
Working Groups
Created attachment 255910 [details] Zip file to recreate issue Compiling an aspect that advises a default method (in JDK 8) with around advice results in an exception at run time. java.lang.ClassFormatError: Method defaultMethod_aroundBody0 in class IBase has illegal modifiers: 0x1A at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.privateGetMethodRecursive(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.validateMainClass(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) The attached zip file contains the artifacts needed to recreate this bug. 1. Unzip 2. Invoke the 'compile.bat' script (it works on both windows and unix) 3. Invoke the 'run.bat' script (it works on both windows and unix) 4. Note the exception
This would probably get addressed alongside the other issues (like bug 461323) when proper handling of default methods and advice is added.
Fixed. According to specs we aren't allowed FINAL modifiers on methods in interfaces and methods must be either PUBLIC or PRIVATE (other visibilities not allowed). With those changes made when recognizing we are adding a method to an interface, your test case gets further (it still fails but I think that is due to the class path not having aspectj on it).