You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to generate the whole interface file at runtime and I need to add just 1 default method which calls other methods added to the CtClass before. The exception I get: Exception in thread "main" javassist.CannotCompileException: [source error] syntax error near "**default Object** get" at javassist.CtNewMethod.make(CtNewMethod.java:79) at javassist.CtNewMethod.make(CtNewMethod.java:45) Caused by: compile error: syntax error near "**default Object get**" at javassist.compiler.Parser.parseClassType(Parser.java:984) at javassist.compiler.Parser.parseFormalType(Parser.java:192) at javassist.compiler.Parser.parseMember1(Parser.java:52) at javassist.compiler.Javac.compile(Javac.java:90) at javassist.CtNewMethod.make(CtNewMethod.java:74)
Whats the correct way to add default methods to an interface. The interface was made using makeInterface, and I am adding the default as .addMethod(CtNewMethod.make("default ....", interface))
I am using 3.12.1.GA from maven repo. Thanks.
The text was updated successfully, but these errors were encountered:
I checked and I am using 3.20 now, so that does have Java8 support. Found another issue which seems to have been resolved but I am getting the exact same problem: #104
I am trying to generate the whole interface file at runtime and I need to add just 1 default method which calls other methods added to the CtClass before. The exception I get:
Exception in thread "main" javassist.CannotCompileException: [source error] syntax error near "**default Object** get" at javassist.CtNewMethod.make(CtNewMethod.java:79) at javassist.CtNewMethod.make(CtNewMethod.java:45) Caused by: compile error: syntax error near "**default Object get**" at javassist.compiler.Parser.parseClassType(Parser.java:984) at javassist.compiler.Parser.parseFormalType(Parser.java:192) at javassist.compiler.Parser.parseMember1(Parser.java:52) at javassist.compiler.Javac.compile(Javac.java:90) at javassist.CtNewMethod.make(CtNewMethod.java:74)
Whats the correct way to add default methods to an interface. The interface was made using makeInterface, and I am adding the default as .addMethod(CtNewMethod.make("default ....", interface))
I am using 3.12.1.GA from maven repo. Thanks.
The text was updated successfully, but these errors were encountered: