Community
Participate
Working Groups
package bug; @FunctionalInterface interface FI { int foo (int x); } class T { private void foo() { FI fi1 = a -> { // [1]-caret before 'a'. [2]-select 'a' int x = a; return a; }; FI fi2 = (int a) -> { // [3] int x = fi1.foo(0); return a; }; } private void bar(FI fi) {} } ------------------------------------------------------------------ In the above example, invoke "Convert local variable to field" via Refactor menu. [1] converts 'fi1' to field. [2] & [3] result in the following exception: java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:423) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:331) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:637) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:153) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:710) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:455) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:466) ... Caused by: org.eclipse.core.runtime.AssertionFailedException: assertion failed: at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110) at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96) at org.eclipse.jdt.internal.corext.refactoring.code.PromoteTempToFieldRefactoring.addLocalDeclarationRemoval(PromoteTempToFieldRefactoring.java:815) at org.eclipse.jdt.internal.corext.refactoring.code.PromoteTempToFieldRefactoring.createChange(PromoteTempToFieldRefactoring.java:541)
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.