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

Quick Fix not working when creating local variable #2476

Open
gustavosdelgado opened this issue May 27, 2022 · 3 comments
Open

Quick Fix not working when creating local variable #2476

gustavosdelgado opened this issue May 27, 2022 · 3 comments

Comments

@gustavosdelgado
Copy link

Whenever I try to use the Quick Fix: create local variable feature, the extension doesn't respond and I get this error on my Language Support for Java Output Log:

[Error - 10:25:24] Request codeAction/resolve failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/eclipse/jdt/internal/corext/dom/LinkedNodeFinder.findByNode(Lorg/eclipse/jdt/core/dom/ASTNode;Lorg/eclipse/jdt/core/dom/Name;)[Lorg/eclipse/jdt/core/dom/Name; @11: invokestatic
  Reason:
    Type '[Lorg/eclipse/jdt/core/dom/Name;' (current frame, stack[0]) is not assignable to '[Lorg/eclipse/jdt/core/dom/SimpleName;'
  Current Frame:
    bci: @11
    flags: { }
    locals: { 'org/eclipse/jdt/core/dom/ASTNode', 'org/eclipse/jdt/core/dom/Name', '[Lorg/eclipse/jdt/core/dom/Name;' }
    stack: { '[Lorg/eclipse/jdt/core/dom/Name;' }
  Bytecode:
    0000000: 2a2b b801 044d 2cc6 0008 2cb8 016b b02b
    0000010: b601 06b6 00f6 3e1d 101e 9f00 0f1d 100a
    0000020: 9f00 091d 1012 a000 32bb 00d0 59b7 00d2
    0000030: 3a04 bb01 0959 2b19 04b7 010b 3a05 2a19
    0000040: 05b6 00d8 1904 1904 b600 dcbd 0107 b600
    0000050: dfc0 010e b801 6bb0 04bd 0107 5903 2b53
    0000060: b801 6bb0                              
  Stackmap Table:
    append_frame(@15,Object[#270])
    append_frame(@41,Integer)
    same_frame(@88)

	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/eclipse/jdt/internal/corext/dom/LinkedNodeFinder.findByNode(Lorg/eclipse/jdt/core/dom/ASTNode;Lorg/eclipse/jdt/core/dom/Name;)[Lorg/eclipse/jdt/core/dom/Name; @11: invokestatic
  Reason:
    Type '[Lorg/eclipse/jdt/core/dom/Name;' (current frame, stack[0]) is not assignable to '[Lorg/eclipse/jdt/core/dom/SimpleName;'
  Current Frame:
    bci: @11
    flags: { }
    locals: { 'org/eclipse/jdt/core/dom/ASTNode', 'org/eclipse/jdt/core/dom/Name', '[Lorg/eclipse/jdt/core/dom/Name;' }
    stack: { '[Lorg/eclipse/jdt/core/dom/Name;' }
  Bytecode:
    0000000: 2a2b b801 044d 2cc6 0008 2cb8 016b b02b
    0000010: b601 06b6 00f6 3e1d 101e 9f00 0f1d 100a
    0000020: 9f00 091d 1012 a000 32bb 00d0 59b7 00d2
    0000030: 3a04 bb01 0959 2b19 04b7 010b 3a05 2a19
    0000040: 05b6 00d8 1904 1904 b600 dcbd 0107 b600
    0000050: dfc0 010e b801 6bb0 04bd 0107 5903 2b53
    0000060: b801 6bb0                              
  Stackmap Table:
    append_frame(@15,Object[#270])
    append_frame(@41,Integer)
    same_frame(@88)

	at org.eclipse.jdt.ls.core.internal.corrections.proposals.NewVariableCorrectionProposal.getAllReferences(NewVariableCorrectionProposal.java:329)
	at org.eclipse.jdt.ls.core.internal.corrections.proposals.NewVariableCorrectionProposal.doAddLocal(NewVariableCorrectionProposal.java:219)
	at org.eclipse.jdt.ls.core.internal.corrections.proposals.NewVariableCorrectionProposal.getRewrite(NewVariableCorrectionProposal.java:113)
	at org.eclipse.jdt.ls.core.internal.corrections.proposals.ASTRewriteCorrectionProposal.addEdits(ASTRewriteCorrectionProposal.java:89)
	at org.eclipse.jdt.ls.core.internal.corrections.proposals.CUCorrectionProposal.createTextChange(CUCorrectionProposal.java:109)
	at org.eclipse.jdt.ls.core.internal.corrections.proposals.CUCorrectionProposal.createChange(CUCorrectionProposal.java:115)
	at org.eclipse.jdt.core.manipulation.ChangeCorrectionProposalCore.getChange(ChangeCorrectionProposalCore.java:150)
	at org.eclipse.jdt.ls.core.internal.handlers.CodeActionResolveHandler.resolve(CodeActionResolveHandler.java:46)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$16(JDTLanguageServer.java:683)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)
	... 7 more
Environment
  • Operating System: Remote access to Debian 9 on a Windows 10 host
  • JDK version: 11.0.13+8
  • Visual Studio Code version: 1.67.2
  • Java extension version: 1.6.0
Steps To Reproduce
  1. Just try to use Quick fix: create local variable
Additional Informations

The others features available on Quick Fix work just fine. This problem only occurs when trying to create local variables.

@snjeza
Copy link
Contributor

snjeza commented May 27, 2022

@gustavosdelgado Could you try to update your lombok version. See #2411 (comment)

@gustavosdelgado
Copy link
Author

@snjeza I'm really thankful for your response, but as I'm in an enterprise environment, I'm not allowed to use external unofficial JARs. I hope you understand me.

is there any other solutions that you by chance are aware of?

@snjeza
Copy link
Contributor

snjeza commented May 27, 2022

@gustavosdelgado you can try to update your lombok to https://projectlombok.org/downloads/lombok.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants