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

Lombok 1.16.4 breaks quickfix on eclipse mars RC3 #861

Closed
lombokissues opened this issue Jul 14, 2015 · 6 comments
Closed

Lombok 1.16.4 breaks quickfix on eclipse mars RC3 #861

lombokissues opened this issue Jul 14, 2015 · 6 comments

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 826)

@lombokissues
Copy link
Author

👤 [email protected]   🕗 Jun 20, 2015 at 05:22 UTC

What steps will reproduce the problem?

  1. Install eclipse-jee-mars-RC3
  2. Copy the installation and install lombok-1.16.4 within the copy
  3. Create a new eclipse project and within this, create the java class mentioned below (... it contains an error)
  4. Try to do a quickfix

What is the expected output? What do you see instead?

  • The list of potential fixes shows up in any case
  • Without lombok, you see a small preview window of the quickfix when hovering over the list
  • Without lombok, the quickfix is applied when clicking on the list item
  • With lombok, the preview is missing
  • With lombok, the quickfix isn't applied when clicking on the list item
  • Please note: There are some quickfixes which seem to work, for example "import class"

What version of the product are you using? On what operating system?

  • Linux, Ubuntu1404, 64 bit
  • Lombok-1.16.4 (latest version)
  • Eclipse-Jee-Mars-RC3, 64 bit

Please provide any additional information below.

  • Java class: QuickFix.java added as attachment

@lombokissues
Copy link
Author

👤 [email protected]   🕗 Jun 20, 2015 at 05:22 UTC

🔗 QuickFix.java View file

@lombokissues
Copy link
Author

👤 [email protected]   🕗 Jun 24, 2015 at 18:08 UTC

I checked against eclipse mars, the released version. Unfortunately, the same issue exists.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Jul 01, 2015 at 02:13 UTC

The fix for issue #398 is causing this. Specifically, the pos fixer for retrieveRightBrace, found in PatchFixes' fixRetrieveRightBraceOrSemiColonPosition, is being applied to 'fix' the positions of some imaginary code that the quickfix tool is trying to display to help in showing what's going to happen here, and this causes the crashes. Note that these occur even if zero lombok anything is in your source file.

The relevant stack trace for when fixRetrieveRightBraceOrSemiColonPosition kicks in but should not, is this:

at org.eclipse.jdt.core.dom.ASTConverter.fixRetrieveRightBraceOrSemiColonPosition(ASTConverter.java:473)
at org.eclipse.jdt.core.dom.ASTConverter.retrieveRightBrace(ASTConverter.java:4916)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:616)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1139)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateASTForKind(ASTParser.java:1415)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1101)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.parseSourceCode(DefaultCodeFormatter.java:314)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.parseSourceCode(DefaultCodeFormatter.java:291)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.prepareFormattedCode(DefaultCodeFormatter.java:186)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:155)
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.format(DefaultCodeFormatter.java:139)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatString(ASTRewriteFormatter.java:246)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.formatNode(ASTRewriteFormatter.java:376)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.getFormattedResult(ASTRewriteFormatter.java:187)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doTextInsert(ASTRewriteAnalyzer.java:1357)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteRequiredNode(ASTRewriteAnalyzer.java:824)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:3737)
at org.eclipse.jdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:260)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:302)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:291)
at org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal.addEdits(ASTRewriteCorrectionProposal.java:116)
at org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal.createTextChange(CUCorrectionProposal.java:234)
at org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal.createChange(CUCorrectionProposal.java:244)

and this stack trace is the 'top' either on hitting CTRL+1 or on trying to apply it.

We can disable this patch but that would re-break 325. We need to be smarter about when to fix and when to skip it, or alternatively we need to fix what this meant to fix (325, amongst other things) elsewhere.

@lombokissues
Copy link
Author

👤 [email protected]   🕗 Jul 12, 2015 at 05:29 UTC

Tried with latest git master containing 75647ee "Fixes for eclipse mars." but unfortunately the quickfixes still don't work.

@lombokissues
Copy link
Author

End of migration

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

1 participant