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 254786 - [81cat]NullPointerException at org.netbeans.modules.refactoring.java.plugins.InlineRefactoringPlugin.preCheck
Summary: [81cat]NullPointerException at org.netbeans.modules.refactoring.java.plugins....
Status: RESOLVED WORKSFORME
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-27 14:48 UTC by -Silver-
Modified: 2016-08-12 20:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 219494


Attachments
stacktrace (2.58 KB, text/plain)
2015-08-27 14:48 UTC, -Silver-
Details

Note You need to log in before you can comment on or make changes to this bug.
Description -Silver- 2015-08-27 14:48:06 UTC
This bug was originally marked as duplicate of bug 198821, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201508260002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.66-b02, Java(TM) SE Runtime Environment, 1.8.0_66-ea-b02
OS: Windows 7

User Comments:
-Silver-: Follow the test http://services.netbeans.org/synergy/client/app/#/assignment/1495/v/1
Inline
Test I

After testing Undo/Redo I noticed that it didn't work well so I closed the file From.java and tried to test ClassA again. 
When I put the caret into from.m1()(true, 5) and selected Refactor > Inline.. this exception has been thrown.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.refactoring.java.plugins.InlineRefactoringPlugin.preCheck(InlineRefactoringPlugin.java:317)
   at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$WorkingTask.run(JavaRefactoringPlugin.java:402)
   at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin$WorkingTask.run(JavaRefactoringPlugin.java:378)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:480)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:609)
   at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:153)
Comment 1 -Silver- 2015-08-27 14:48:08 UTC
Created attachment 155691 [details]
stacktrace
Comment 2 Svata Dedic 2016-08-12 20:46:51 UTC
Sorry, could you please provide more details ? The link to the test is broken, but I managed to find some code like:

public class ClassA {

    int num = 5;

    public void m() {       
        From from = new From();
        from.m1(true, 5, "abcd");
        from.m2();
        from.m3();
        
    }

...
but inlining from.m1() worked OK.

Thanks.