Niklas Matthies created NETBEANS-3191:
-----------------------------------------
Summary: NPE on Find Usages and Call Hierarchy
Key: NETBEANS-3191
URL: https://issues.apache.org/jira/browse/NETBEANS-3191
Project: NetBeans
Issue Type: Bug
Components: java - Refactoring
Affects Versions: 11.1, 11.2
Environment: Java: 1.8.0_212; Java HotSpot(TM) 64-Bit Server VM
25.212-b10
Runtime: Java(TM) SE Runtime Environment 1.8.0_212-b10
System: Windows 10 version 10.0 running on amd64; utf-8; en_US (nb)
Reporter: Niklas Matthies
Please see the Maven project in the attached Example.zip. To reproduce the the
issue:
# Open the project in NetBeans
# Download the Guava dependency
# Wait until background scanning etc. has completed
# In Test1.java, perform Find Usages or Call Hierarchy on the getResult()
method
# In the case of Call Hierarchy, the processLine() node must be expanded to
trigger the error
# When performing Find Usages after Call Hierarchy, at least under NB 11.1 the
first execution triggers no error, but the results list remains empty, however
a second execution triggers the exception
=> An Unexpected Exception occurs, see the stacktraces in the attached
stacktraces.txt
The necessary condition for the error to occur is apparently that both the
method in question as well as its caller must be methods overridden from the
same interface, and that the interface must be defined in a separate jar for
which there is no NetBeans project present. (That's why I used the Guava
dependency for the reproducible example project.)
I first reproduced the issue in NetBeans 11.1 and then was able to reproduce it
in 11.2-beta1.
The error is also reproducible with a reset (deleted) cachedir/index.
I used 11.2-beta1 with the default settings (no imported settings), just with
nb-javac 1.71 installed.
Test2.java shows that the error also occurs when the caller and callee methods
are in different classes, but inherited from the same interface.
In Test3 and Test4, the calling method is overriden from the base class and
from a different interface (respectively), which causes the error to NOT happen
for Call Hierarchy, but it does STILL happen for Find Usages.
In the Find Usages dialog, "From: LineProcessor" must be selected. The error
doesn't occur with "From: Test1". The selected scope on the other hand doesn't
seem to make a difference.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists