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/02/27 20:23:31 UTC
[GitHub] [netbeans] matthiasblaesing edited a comment on issue #3669: StackOverflowError on each startup, when indexing Javascript
matthiasblaesing edited a comment on issue #3669:
URL: https://github.com/apache/netbeans/issues/3669#issuecomment-1053669219
Putting the discussion about the indexer in general aside the issue here is that the indexer does not handle self referential structures well. A minimal reproducer is this:
```js
function mod(actions) {
return actions.map((action) => {
action = { action };
return action;
});
};
```
With that at least the occurrences finder:
```
java.lang.StackOverflowError
at org.netbeans.modules.javascript2.editor.navigation.OccurrencesSupport.findOccurrence(OccurrencesSupport.java:59)
at org.netbeans.modules.javascript2.editor.navigation.OccurrencesSupport.findOccurrence(OccurrencesSupport.java:80)
at org.netbeans.modules.javascript2.editor.navigation.OccurrencesSupport.findOccurrence(OccurrencesSupport.java:80)
at org.netbeans.modules.javascript2.editor.navigation.OccurrencesSupport.findOccurrence(OccurrencesSupport.java:80)
```
and the indexer are affected:
```
java.lang.StackOverflowError
at java.base/java.util.WeakHashMap.get(WeakHashMap.java:398)
at org.openide.util.lookup.InheritanceTree.searchInterface(InheritanceTree.java:846)
at org.openide.util.lookup.InheritanceTree.lookup(InheritanceTree.java:215)
at org.openide.util.lookup.DelegatingStorage.lookup(DelegatingStorage.java:149)
at org.openide.util.lookup.AbstractLookup.lookupItem(AbstractLookup.java:411)
at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:396)
at org.openide.util.lookup.ProxyLookup.lookup(ProxyLookup.java:281)
at org.netbeans.modules.javascript2.model.JsElementImpl.isInternalFile(JsElementImpl.java:194)
at org.netbeans.modules.javascript2.model.JsElementImpl.isPlatform(JsElementImpl.java:188)
at org.netbeans.modules.javascript2.model.api.IndexedElement$Flag.getFlag(IndexedElement.java:387)
at org.netbeans.modules.javascript2.editor.index.JsIndexer.createDocument(JsIndexer.java:122)
at org.netbeans.modules.javascript2.editor.index.JsIndexer.storeObject(JsIndexer.java:222)
at org.netbeans.modules.javascript2.editor.index.JsIndexer.storeObject(JsIndexer.java:230)
at org.netbeans.modules.javascript2.editor.index.JsIndexer.storeObject(JsIndexer.java:230)
at org.netbeans.modules.javascript2.editor.index.JsIndexer.storeObject(JsIndexer.java:230)
```
the immediate idea is using a Map/Set to store the visited maps would fix this, but that breaks intentional usages.
--
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