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/10/07 10:18:49 UTC

[GitHub] [netbeans] akronenw opened a new issue, #4745: Indexing stuck while indexing JavaScript file

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

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   I am working on a project that includes a bunch of JS files. When I open the project, the indexing always gets stuck at a random percentage and it is always while indexing the `paper-full.js` script (taken from https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.15/paper-full.js which is linked from https://cdnjs.com/libraries/paper.js).
   
   This is annoying as NB becomes slower and slower and finally freezes after a while.
   
   ### How to reproduce
   
   Create a new JS project with all default values. Paste the content of the linked `paper-full.js` into the `main.js` (or copy the entire file into the project). Reopen NB so the scanning/indexing begins. 
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   macOS Monterey Version 12.5.1, Apple M1
   
   ### JDK
   
   OpenJDK 64-Bit Server VM Zulu17.34+19-CA (build 17.0.3+7-LTS, mixed mode, sharing)
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   I dug a bit into the indexing code and added a bunch of logs.
   * In `JsObjectImpl#getFullyQualifiedName` the while loop runs endlessly because the `pObject` in there seems to have itself as parent (of which I am pretty sure is responsible for the slowness and ultimately the freeze). I did not yet understand how this situation can occur codewise.
   * The `DefineInterceptor#intercept` method, which (by javadoc, a rare thing there) is supposed to return a collection of the return types of a function, always returns an empty collection. I do not know how that affects anything. Also, there is a for loop/switch combination that possibly only handles one function argument.
   * A few other things, but that is probably because I have no clue about JS.
   
   In the paper-js.full script is the following code:
   
   ```
   var Base = new function() {
        // a lot of code
   
       function Base() {
           // some code
       }
   
       // more code
   }
   ```
   which I suppose is the problem, because the JS indexing somehow mixes up the inner and outer method names and eventually one gets itself as parent, causing the endless while loop. I might be completely wrong about this.
   
   Interestingly, the minified version is indexed without any problems. I believe this is because the minification process renames everything (uniquely?) and there are no nested functions with identical name. Again, I'm guessing. 
   
   ### Are you willing to submit a pull request?
   
   Yes
   
   ### 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] akronenw commented on issue #4745: Indexing stuck while indexing JavaScript file

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

   Hello @matthiasblaesing, 
   
   thanks for looking into this. I just tested the artifact from your link and the issue did not appear. I cross checked with NB 17, where the issue still exists.
   
   Thanks and kind regards
   Alex


-- 
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] akronenw commented on issue #4745: Indexing stuck while indexing JavaScript file

Posted by GitBox <gi...@apache.org>.
akronenw commented on issue #4745:
URL: https://github.com/apache/netbeans/issues/4745#issuecomment-1277204769

   If I rename the inner `Base()` function and all its occurrences, the indexing works.


-- 
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] matthiasblaesing closed issue #4745: Indexing stuck while indexing JavaScript file

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing closed issue #4745: Indexing stuck while indexing JavaScript file
URL: https://github.com/apache/netbeans/issues/4745


-- 
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] matthiasblaesing commented on issue #4745: Indexing stuck while indexing JavaScript file

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

   @akronenw could you please check the referenced PR?
   
   A nightly build is available from the CI/CD checks page:
   
   https://github.com/apache/netbeans/actions/runs/4636345036
   
   or directly via:
   
   https://github.com/apache/netbeans/suites/12089294369/artifacts/636601975


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