This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213193 - Exception in schliemann
Summary: Exception in schliemann
Status: NEW
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@obsolete
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-29 19:08 UTC by scanti
Modified: 2012-10-26 13:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The patch to fix the problem (2.23 KB, text/plain)
2012-05-29 19:08 UTC, scanti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description scanti 2012-05-29 19:08:34 UTC
Created attachment 120018 [details]
The patch to fix the problem

A client of mine got this Exception while using Schliemann

java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
	at java.util.HashMap$EntryIterator.next(Unknown Source)
	at java.util.HashMap$EntryIterator.next(Unknown Source)
	at org.netbeans.modules.languages.FeatureList.collectFeatures(FeatureList.java:123)
	at org.netbeans.modules.languages.FeatureList.getFeatures(FeatureList.java:105)
	at org.netbeans.modules.languages.FeatureList.getFeature(FeatureList.java:110)
	at org.netbeans.modules.languages.ParserManagerImpl.parse(ParserManagerImpl.java:340)
	at org.netbeans.modules.languages.ParserManagerImpl.access$200(ParserManagerImpl.java:90)
	at org.netbeans.modules.languages.ParserManagerImpl$2.run(ParserManagerImpl.java:222)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)

I made a quick patch, unfortunately I had no chance to test it, but it is very simple and should work. I just added synchronized to the methods that modify the lists inside the FeatureList.
Comment 1 scanti 2012-07-31 15:01:09 UTC
basically I synchronized these methods:

void add (Feature feature)
Feature getFeature (String featureName)
void collectFeatures(List result, String featureName)
List<Feature> getFeatures (String featureName, String id)
void evaluate (
        State                           state,
        List<ASTItem>                   path,
        Map<String,Set<ASTEvaluator>>   evaluatorsMap                           
    )
Comment 2 scanti 2012-07-31 15:02:14 UTC
The problem is still present in 7.1