You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "jglick (via GitHub)" <gi...@apache.org> on 2023/03/29 11:45:50 UTC

[GitHub] [netbeans] jglick opened a new issue, #5738: Disassembled `*.class` opened instead of `*.java` even when Maven `*-sources.jar` present

jglick opened a new issue, #5738:
URL: https://github.com/apache/netbeans/issues/5738

   ### Apache NetBeans version
   
   Apache NetBeans 17
   
   ### What happened
   
   When you have a Maven sources JAR present in the local repository, confirmed by `SourceForBinaryQuery` via `apisupport.projectinspector`¹, then visiting a type or member in the classpath should open the editor on a read-only source file. In NB 16 this used to work consistently. In 17 it sometimes works, but sometimes you get the disassembled bytecode instead. I am still working out the precise conditions for the bug, since it happens on some types in a single JAR file and not others.
   
   ----
   
   ¹Sadly abandoned in `contrib` Hg rather than donated, AFAICT, but I still have a personal copy.
   
   ### How to reproduce
   
   ```bash
   git clone https://github.com/jenkinsci/log-cli-plugin
   cd log-cli-plugin
   mvn -Pquick-build package dependency:sources
   ```
   
   Now open this project in NB and wait for classpath scanning to complete. At https://github.com/jenkinsci/log-cli-plugin/blob/3d86457a9f2b19567d90542074224416a9ca474c/src/main/java/org/jenkinsci/plugins/log_cli/TailLogCommand.java#L55 place the caret on the call to `get` and press Ctrl-B to visit the definition.
   
   Expected: you should see https://github.com/jenkinsci/jenkins/blob/jenkins-2.361.4/core/src/main/java/jenkins/model/Jenkins.java#L810
   
   Actual: you will see disassembled bytecode.
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 16
   
   ### Operating System
   
   Xubuntu 22.04.2
   
   ### JDK
   
   11.0.18; OpenJDK 64-Bit Server VM 11.0.18+10-post-Ubuntu-0ubuntu122.04; Ubuntu
   
   ### Apache NetBeans packaging
   
   Apache NetBeans Snap Package
   
   ### Anything else
   
   Using `git bisect` I was able to identify #5152 (@jtulach) as the cause of the regression. This does _not_ appear to be a duplicate of #5266, which apparently involved a visible exception (no error is printed in this case) and which was allegedly fixed in NB 17 in #5279 (@matthiasblaesing).
   
   I hope to find time to study the bug and offer a PR, since this affects everyday usage of the IDE for me and is the one noticeable regression in NB 17.
   
   ### Are you willing to submit a pull request?
   
   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] mbien closed issue #5738: Disassembled `*.class` opened instead of `*.java` when folder with name of class exists in sources JAR

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien closed issue #5738: Disassembled `*.class` opened instead of `*.java` when folder with name of class exists in sources JAR
URL: https://github.com/apache/netbeans/issues/5738


-- 
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] jglick commented on issue #5738: Disassembled `*.class` opened instead of `*.java` even when Maven `*-sources.jar` present

Posted by "jglick (via GitHub)" <gi...@apache.org>.
jglick commented on issue #5738:
URL: https://github.com/apache/netbeans/issues/5738#issuecomment-1488553315

   Also can be reproduced after opening the project just by browsing inside `jenkins-core-2.361.4.jar` in the **Projects** tab and clicking on different `*.class` entries. Some open sources, some do not. When it does not work, the log notes
   
   ```
   WARNING [org.netbeans.modules.java.ClassDataObject]: SourceFile: hudson/console/ExpandableDetailsNote in ~/.m2/repository/org/jenkins-ci/main/jenkins-core/2.361.4/jenkins-core-2.361.4.jar has no OpenCookie
   ```
   
   The lack of a `.java` extension on this resource leads me to suspect that https://github.com/apache/netbeans/blob/4182d7dc316df11561ed4858436325e3f05fdfc5/java/java.source/src/org/netbeans/modules/java/ClassDataObject.java#L115-L118 is receiving a bogus result. Indeed the problem seems to occur on classes which have associated resources (the naming convention here is specific to Jenkins and its github.com/jenkinsci/stapler framework):
   
   ```console
   $ jar tf ~/.m2/repository/org/jenkins-ci/main/jenkins-core/2.361.4/jenkins-core-2.361.4-sources.jar | fgrep ExpandableDetailsNote
   hudson/console/ExpandableDetailsNote/
   hudson/console/ExpandableDetailsNote.java
   hudson/console/ExpandableDetailsNote/style.css
   hudson/console/ExpandableDetailsNote/script.js
   ```


-- 
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 #5738: Disassembled `*.class` opened instead of `*.java` even when Maven `*-sources.jar` present

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #5738:
URL: https://github.com/apache/netbeans/issues/5738#issuecomment-1488718993

   Reminds me a little of #2115 Putting a milestone on this to track for NB18.


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