You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/09/21 08:50:12 UTC

[GitHub] [netbeans] pedro-w opened a new issue, #4667: Navigate Hierarchy doesn't work (for class in try-with-resources block)

pedro-w opened a new issue, #4667:
URL: https://github.com/apache/netbeans/issues/4667

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   The Navigate | Inspect | Hierarchy menu (aka shift-alt-F12) does not always work. It seems to fail when the class under the cursor is in a `try()` block - it shows the hierarchy of the enclosing class instead. 
   
   ### How to reproduce
   
   Make a Java ant project with the following source
   
   ```
   package javaapplication150;
   
   import java.io.BufferedWriter;
   import java.io.IOException;
   import java.nio.file.Files;
   import java.nio.file.Path;
   
   public class JavaApplication150 {
   
       public static void main(String[] args) throws IOException {
           try ( BufferedWriter writer = Files.newBufferedWriter(Path.of("a"))) {
               writer.flush();
           }
       }
   
   }
   
   ```
   Move cursor to the `BufferedWriter` text on line 11. Press shift-alt-F12. Hierarchy window will show the results for `JavaApplication150`
   
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 11
   
   ### JDK
   
   11.0.9.1; OpenJDK 64-Bit Server VM 11.0.9.1+1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   Occurs every time the project is opened fresh. If the target class source is open in another tab it works (sometimes, I can't see a pattern to this)
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


[GitHub] [netbeans] neilcsmith-net commented on issue #4667: Navigate Hierarchy doesn't work (for class in try-with-resources block)

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #4667:
URL: https://github.com/apache/netbeans/issues/4667#issuecomment-1254884847

   Verified that `TreeUtilities` is returning `final` rather than `BufferedWriter` as the element at that position due to the overlapping positions discussed in #4648 
   
   I assume this might be fixed by upstream fix in https://bugs.openjdk.org/browse/JDK-8293897  However, that's unlikely to reach us until NB 18.  @jlahoda any thoughts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


[GitHub] [netbeans] pedro-w commented on issue #4667: Navigate Hierarchy doesn't work (for class in try-with-resources block)

Posted by GitBox <gi...@apache.org>.
pedro-w commented on issue #4667:
URL: https://github.com/apache/netbeans/issues/4667#issuecomment-1253404518

   IDE log attached 
   
   [ide-log.log](https://github.com/apache/netbeans/files/9614892/ide-log.log)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


[GitHub] [netbeans] pedro-w commented on issue #4667: Navigate Hierarchy doesn't work (for class in try-with-resources block)

Posted by GitBox <gi...@apache.org>.
pedro-w commented on issue #4667:
URL: https://github.com/apache/netbeans/issues/4667#issuecomment-1253409914

   Note that it does work if the cursor is on the text `writer` on line 11 or line 12.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


[GitHub] [netbeans] neilcsmith-net commented on issue #4667: Navigate Hierarchy doesn't work (for class in try-with-resources block)

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #4667:
URL: https://github.com/apache/netbeans/issues/4667#issuecomment-1253662023

   Confirmed.  Try adding `final` before the `BufferedWriter` - does that also fix it for you?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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


[GitHub] [netbeans] pedro-w commented on issue #4667: Navigate Hierarchy doesn't work (for class in try-with-resources block)

Posted by GitBox <gi...@apache.org>.
pedro-w commented on issue #4667:
URL: https://github.com/apache/netbeans/issues/4667#issuecomment-1253703907

   >  Try adding final before the BufferedWriter - does that also fix it for you?
   Yes, it does.
   Unfortunately I don't have any previous installations so I can't say if other versions are affected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

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