rtaneja1 commented on issue #1016: [NETBEANS-586]: NPE findUsages
URL: 
https://github.com/apache/incubator-netbeans/pull/1016#issuecomment-437053250
 
 
   Hi Jan, Modified code as suggested. Since issue is only reproducible using 
jdk, didn't add test as tests use nb-javac. Also not sure when addUsages on 
line 402 gets called. So here we are inside anonymous class 
constructor(generated), workingCopy.getTreeUtilities().isSynthetic(superCall) 
is always true. The exact reproducible code is below: Find usages for 
constructor A() fails with npe without this change: 
   
   public class Test {
       void m() {
           Runnable r = new Runnable() {
               public void run() {
                   B b = new B() {
                       void test() {
                           System.out.println("testB");
                       }
                   };
               }
           };
       }
       class A {
           public A() {
           }
           void test() {
           }
       }
       class B extends A {
       }
   }

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
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

Reply via email to