Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The compilation of static methods should be excluded when generating the proxy. #4647

Closed
CrazyHZM opened this issue Jul 24, 2019 · 0 comments
Assignees
Milestone

Comments

@CrazyHZM
Copy link
Member

CrazyHZM commented Jul 24, 2019

In jdk8 the interface supports static method.
The compilation of static methods should be excluded when generating the proxy.
If not excluded, the following exception will be thrown:

Caused by: compile error: not available in a static method: handler
	at javassist.compiler.MemberCodeGen.fieldAccess(MemberCodeGen.java:1037)
	at javassist.compiler.MemberCodeGen.atFieldRead(MemberCodeGen.java:867)
	at javassist.compiler.MemberCodeGen.atMember(MemberCodeGen.java:862)
	at javassist.compiler.JvstCodeGen.atMember(JvstCodeGen.java:112)
	at javassist.compiler.ast.Member.accept(Member.java:39)
	at javassist.compiler.MemberCodeGen.atCallExpr(MemberCodeGen.java:510)
	at javassist.compiler.JvstCodeGen.atCallExpr(JvstCodeGen.java:244)
	at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
	at javassist.compiler.CodeGen.atAssignCore(CodeGen.java:877)
	at javassist.compiler.CodeGen.atVariableAssign(CodeGen.java:810)
	at javassist.compiler.CodeGen.atDeclarator(CodeGen.java:744)
	at javassist.compiler.ast.Declarator.accept(Declarator.java:100)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
	at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
	at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
	at javassist.compiler.Javac.compileMethod(Javac.java:169)
	at javassist.compiler.Javac.compile(Javac.java:95)
	at javassist.CtNewMethod.make(CtNewMethod.java:74)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants