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/30 04:58:37 UTC

[GitHub] [netbeans] mbien commented on issue #4054: Netbeans freezes due to "Organize Imports" on save and "Format" Tool if code contains specific syntax errors

mbien commented on issue #4054:
URL: https://github.com/apache/netbeans/issues/4054#issuecomment-1263103674

   can be reproduced with a short snippet:
   ```java
   package main;
   
   public class Test {
       void gs::KdTree::build(std::vector<Point*> &pointCloud, int start, int end, int sortOn) {
           if (end - start == 1) {
               __node = new Point(pointCloud[start]->pos[0], pointCloud[start]->pos[1], pointCloud[start]->pos[2]);
               return;
           }
       }
   }
   ```
   paste this into a java file and save while having "Organize Imports" on save enabled.
   
   it will then enter an endless while-loop in (set breakpoint to that line to safely reproduce):
   
   ```
   	at org.netbeans.modules.java.hints.spiimpl.batch.BatchSearch.getLocalVerifiedSpans(BatchSearch.java:233)
   	at org.netbeans.modules.java.hints.spiimpl.batch.BatchSearch.access$400(BatchSearch.java:76)
   	at org.netbeans.modules.java.hints.spiimpl.batch.BatchSearch$LocalIndexEnquirer.validateResource(BatchSearch.java:550)
   	at org.netbeans.modules.java.hints.spiimpl.batch.BatchSearch.getVerifiedSpans(BatchSearch.java:183)
   	at org.netbeans.modules.java.hints.spiimpl.batch.BatchUtilities.applyFixes(BatchUtilities.java:174)
   	at org.netbeans.modules.java.hints.onsave.RemoveUnusedAfterSave.performTask(RemoveUnusedAfterSave.java:85)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks$TaskRunnable$1.run(BeforeSaveTasks.java:148)
   	at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:333)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks$TaskRunnable.run(BeforeSaveTasks.java:131)
   	at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove.runLocked(TrailingWhitespaceRemove.java:77)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks$TaskRunnable.run(BeforeSaveTasks.java:128)
   	at org.netbeans.modules.editor.impl.ReformatBeforeSaveTask.runLocked(ReformatBeforeSaveTask.java:101)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks$TaskRunnable.run(BeforeSaveTasks.java:128)
   	at org.netbeans.modules.java.hints.onsave.RemoveUnusedAfterSave$1.run(RemoveUnusedAfterSave.java:98)
   	at org.netbeans.modules.java.hints.onsave.RemoveUnusedAfterSave$1.run(RemoveUnusedAfterSave.java:96)
   	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
   	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:132)
   	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:116)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
   	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
   	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
   	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
   	at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
   	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
   	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
   	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:83)
   	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
   	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
   	at org.netbeans.modules.java.hints.onsave.RemoveUnusedAfterSave.runLocked(RemoveUnusedAfterSave.java:96)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks$TaskRunnable.run(BeforeSaveTasks.java:128)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks.runTasks(BeforeSaveTasks.java:105)
   	at org.netbeans.modules.editor.lib.BeforeSaveTasks$2.run(BeforeSaveTasks.java:86)
   ... more....
   ```
   
   
   


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