You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Thomas Kellerer (JIRA)" <ji...@apache.org> on 2019/03/20 09:25:00 UTC

[jira] [Updated] (NETBEANS-2240) NPE thrown when refactoring a class

     [ https://issues.apache.org/jira/browse/NETBEANS-2240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Kellerer updated NETBEANS-2240:
--------------------------------------
    Attachment: RefactorTestProject.zip

I managed to create a sample project where this problem occurs.

This also happens when the project is opened in NetBeans 10

The ZIP file contains the Maven project where this happens (RefactorTest), as well as the logfiles (including the .dump) generated with NetBeans 10 and 11 (directories {{nb10-log}} and {{nb11-log}})

After opening the project, try to rename the method {{MyService.getAnswer()}} to something different.

I tried OpenJDK as provided by AdoptOpenJDK, as well as the JDK 11.0.2 that can be downloaded from the Oracle website.

It's pretty hard to debug (due to the dynamic nature of the visitors), but it seems the exception always occurs when inspecting the constructor for a test class that uses the method that is being renamed, and that test is not one for the class in question.

> NPE thrown when refactoring a class
> -----------------------------------
>
>                 Key: NETBEANS-2240
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2240
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Source
>    Affects Versions: 11.0
>            Reporter: Thomas Kellerer
>            Priority: Major
>         Attachments: CommentsTest.dump, RefactorTestProject.zip, messages.log
>
>
> Whenever I refactor a class (e.g rename, move), or public methods of a class NB 11 throws a NPE. 
> This is a multi-module Maven project.
> The Java source that is mentioned in the error message is always a test class using TestNG. I don't seem to get that error with projects that do not use TestNG.
> Doing the refactoring with NetBeans 10 on the same project works without problems.
> Due to legal reasons I can not attach the source code that is part of the dump file - I had to remove everything related to the "real" source and tried to replace some path names revealing private information. I hope the files are useful nevertheless



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists