This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270468 - Lombok - Refactoring - NullpointerException
Summary: Lombok - Refactoring - NullpointerException
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-23 16:00 UTC by gejzir
Modified: 2017-04-23 16:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Minimal project with the sources. Lombok library should be configured in the project. (13.18 KB, application/gzip)
2017-04-23 16:00 UTC, gejzir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gejzir 2017-04-23 16:00:41 UTC
Created attachment 164165 [details]
Minimal project with the sources. Lombok library should be configured in the project.

With:
  - Netbeans 8.2, 
  - Lombok 1.16.10, 
  - Enable Annotation Processing in Editor enabled

--------------------------------------------

Having a simple class, and interface:

public interface IRefactoringTest {
}

public class RefactoringTestImpl implements IRefactoringTest{
    @Getter @Setter private String testString;        
}

--------------------------------------------
When pulling the Lombok generated getter/setter methods to the interface:

Refactor -> Pull Up (Ctrl+Alt+Shift-U)

The Lombok generated functions are presented in the list, can be selected for refactoring, but refactoring generates the following Exception:

java.lang.NullPointerException
	at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.addAbstractMemberToTarget(PullUpTransformer.java:188)
	at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.addMembersToTarget(PullUpTransformer.java:133)
	at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.visitClass(PullUpTransformer.java:107)
	at org.netbeans.modules.refactoring.java.plugins.PullUpTransformer.visitClass(PullUpTransformer.java:82)
	at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:782)
	at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:72)
...