Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 565458

Summary: Refactor/rename: NullPointerException if "enable preview features" is on
Product: [Eclipse Project] JDT Reporter: Clovis Seragiotto <clovis.seragiotto>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: kalyan_prasad
Version: 4.16   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Clovis Seragiotto CLA 2020-07-23 00:56:46 EDT
If "enable preview features for Java 14" is on, trying to rename the interface Fleet2 in the example below (with Refactor/rename...) fails with a NullPointerException. 

class Foo {
    static void foo(String[] args)  {
        if (args.length == 3) {
            //
        }
    }

    interface Fleet2 { /**/ }
}

java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder.getAssociatedRecordComponentNode(LinkedNodeFinder.java:68)
	at org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder$BindingFinder.visit(LinkedNodeFinder.java:334)
	at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:198)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2971)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3019)
	at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:163)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2971)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3019)
Comment 1 Kalyan Prasad Tatavarthi CLA 2020-07-28 06:07:29 EDT

*** This bug has been marked as a duplicate of bug 564329 ***