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 239179 - NPE from Model.processWithExpressionOccurrences(Model.java:388)
Summary: NPE from Model.processWithExpressionOccurrences(Model.java:388)
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-06 07:59 UTC by Petr Pisl
Modified: 2013-12-06 13:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2013-12-06 07:59:32 UTC
Have two files:

filaA.js:
var MySpace = {};

MySpace.cls1 = {
    firstName: "test",
    foo: 2
};

MySapce.cls2 = {
    secondName: "baf"
};

and fileB.js:
with(MySpace.cls1) {
    console.log(firstName)
    
    with(MySpace.cls2) {
        console.log(foo);
        firstName;
        secondName;
    }
} 

The fileB.js is hard to edit due to NPE after every change.

java.lang.NullPointerException
	at org.netbeans.modules.javascript2.editor.model.Model.processWithExpressionOccurrences(Model.java:388)
	at org.netbeans.modules.javascript2.editor.model.Model.processWithObject(Model.java:302)
	at org.netbeans.modules.javascript2.editor.model.Model.processWithObjectIn(Model.java:204)
	at org.netbeans.modules.javascript2.editor.model.Model.getModelVisitor(Model.java:187)
	at org.netbeans.modules.javascript2.editor.model.Model.getGlobalObject(Model.java:448)
	at org.netbeans.modules.javascript2.editor.hints.GlobalIsNotDefined.computeHints(GlobalIsNotDefined.java:83)
	at org.netbeans.modules.javascript2.editor.hints.JsHintsProvider.invokeHint(JsHintsProvider.java:246)
	at org.netbeans.modules.javascript2.editor.hints.JsHintsProvider.computeSuggestions(JsHintsProvider.java:134)
	at org.netbeans.modules.csl.hints.infrastructure.SuggestionsTask$1.run(SuggestionsTask.java:154)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:593)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:155)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:139)
	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:206)
	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:203)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:74)
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:203)
Caused: org.netbeans.modules.parsing.spi.ParseException
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:211)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
[catch] at org.netbeans.modules.csl.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:120)
	at org.netbeans.modules.csl.hints.infrastructure.SuggestionsTask.run(SuggestionsTask.java:78)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:568)
	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:744)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Comment 1 Petr Pisl 2013-12-06 13:19:13 UTC
Fixed in web-main