Bug 257203 - Token id must not be null.
Token id must not be null.
Status: RESOLVED FIXED
Product: javascript
Classification: Unclassified
Component: Editor
8.2
PC Linux
: P3 (vote)
: 8.2
Assigned To: Petr Pisl
issues@javascript
ecma6
:
Depends on:
Blocks: 242387
  Show dependency treegraph
 
Reported: 2015-12-18 09:32 UTC by Petr Pisl
Modified: 2015-12-21 17:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2015-12-18 09:32:47 UTC
get this exception On class file 
java.lang.IllegalArgumentException: Token id must not be null. Fix lexer org.netbeans.modules.javascript2.editor.lexer.JsLexer@80b484d

Based on a user comment #60 in issue #242387 ( https://netbeans.org/bugzilla/show_bug.cgi?id=242387#c60).
Comment 1 Petr Pisl 2015-12-18 09:33:53 UTC
Do you know, which from which file it comes?
Comment 2 jockeeriksson 2015-12-18 12:10:55 UTC
java.lang.IllegalArgumentException: Token id must not be null. Fix lexer org.netbeans.modules.javascript2.editor.lexer.JsLexer@bc46f59
	at org.netbeans.lib.lexer.LexerInputOperation.checkTokenIdNonNull(LexerInputOperation.java:308)
	at org.netbeans.lib.lexer.LexerInputOperation.createToken(LexerInputOperation.java:313)
	at org.netbeans.spi.lexer.TokenFactory.createToken(TokenFactory.java:105)
	at org.netbeans.spi.lexer.TokenFactory.createToken(TokenFactory.java:89)
	at org.netbeans.modules.javascript2.editor.lexer.JsLexer.nextToken(JsLexer.java:87)
	at org.netbeans.lib.lexer.LexerInputOperation.nextToken(LexerInputOperation.java:215)
	at org.netbeans.lib.lexer.inc.IncTokenList.tokenOrEmbeddingImpl(IncTokenList.java:195)
	at org.netbeans.lib.lexer.inc.IncTokenList.tokenOrEmbedding(IncTokenList.java:190)
	at org.netbeans.api.lexer.TokenSequence.moveNext(TokenSequence.java:488)
	at org.netbeans.modules.editor.lib2.highlighting.SyntaxHighlighting$TSInfo.moveNextToken(SyntaxHighlighting.java:771)
	at org.netbeans.modules.editor.lib2.highlighting.SyntaxHighlighting$HSImpl.moveTheSequence(SyntaxHighlighting.java:478)
	at org.netbeans.modules.editor.lib2.highlighting.SyntaxHighlighting$HSImpl.moveNext(SyntaxHighlighting.java:427)
	at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$Wrapper.fetchNextHighlight(DirectMergeContainer.java:453)
	at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$HlSequence.updateMergeVars(DirectMergeContainer.java:305)
	at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$HlSequence.nextMerge(DirectMergeContainer.java:277)
	at org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer$HlSequence.moveNext(DirectMergeContainer.java:224)
	at org.netbeans.modules.editor.lib2.highlighting.HighlightsReader.readUntil(HighlightsReader.java:77)
	at org.netbeans.modules.editor.lib2.view.HighlightsViewFactory.restart(HighlightsViewFactory.java:191)
	at org.netbeans.modules.editor.lib2.view.ViewBuilder$FactoryState.init(ViewBuilder.java:1324)
	at org.netbeans.modules.editor.lib2.view.ViewBuilder.createViews(ViewBuilder.java:724)
	at org.netbeans.modules.editor.lib2.view.ViewBuilder.createReplaceRepaintViews(ViewBuilder.java:685)
	at org.netbeans.modules.editor.lib2.view.ViewUpdates.reinitAllViews(ViewUpdates.java:214)
	at org.netbeans.modules.editor.lib2.view.DocumentViewOp.checkViewsInited(DocumentViewOp.java:640)
	at org.netbeans.modules.editor.lib2.view.DocumentView.getPreferredSpan(DocumentView.java:251)
	at javax.swing.plaf.basic.BasicTextUI$RootView.getPreferredSpan(BasicTextUI.java:1353)
	at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:919)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1662)
	at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1332)
	at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:791)
	at java.awt.Container.layout(Container.java:1510)
	at java.awt.Container.doLayout(Container.java:1499)
	at java.awt.Container.validateTree(Container.java:1695)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validate(Container.java:1630)
	at org.netbeans.core.windows.view.ui.DesktopImpl$LayeredLayout.layoutContainer(DesktopImpl.java:554)
	at java.awt.Container.layout(Container.java:1510)
	at java.awt.Container.doLayout(Container.java:1499)
	at java.awt.Container.validateTree(Container.java:1695)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validateTree(Container.java:1704)
	at java.awt.Container.validate(Container.java:1630)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:711)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:708)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1731)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Comment 3 jockeeriksson 2015-12-18 12:12:37 UTC
'use strict';

//Imports stripped of


const _map = Symbol("_map");

class Collection {

    constructor(model) {
        this._event = new Event();
        this._model = Model;
        this[_map] = new Map();
    }

    on(event, callback) {
        this._event.on(event, callback)
    }

    off(event, callback) {
        this._event.off(event, callback);
    }

    trigger(event, ...args) {
        log.trace("collection trigger  " + event);
        this._event.trigger(event, ...args);
    }


    once(event, callback) {
        this._event.once(event, callback)
    }

    add(model) {
        this[_map].set(model.id, model);
        this.trigger("add", model);
        model.on('*', function () {
            this._event.trigger.apply(this._event, arguments);
        }.bind(this));
    }

    get(id) {
        return this[_map].get(id);
    }

    remove(id) {
        return this[_map].delete(id);
    }

    clear() {
        this[_map].clear();
        this.trigger("clear", "all");
    }


    [Symbol.iterator]() {
        let set = this[_map].values();
        return {
            next: function () {
                return set.next();
            }
        }
    };

}
export default Collection;
Comment 4 jockeeriksson 2015-12-18 12:14:10 UTC
Ok full stack trace and a simple class. But this exception is generated almost all the time when I open a js file with es6 syntax
Comment 5 Petr Pisl 2015-12-21 12:00:14 UTC
The problematic line is in this case:

        let set = this[_map].values();
Comment 6 Petr Pisl 2015-12-21 13:03:05 UTC
Should be now fixed.
Comment 7 Petr Pisl 2015-12-21 17:26:49 UTC
The fix should be part of build #5 at http://deadlock.netbeans.org/job/ECMAScript6/


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo