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 216511

Summary: AssertionError at com.oracle.nashorn.parser.Lexer.scanRegEx
Product: javascript Reporter: Vladimir Riha <vriha>
Component: -- Other --Assignee: Petr Hejl <phejl>
Status: RESOLVED FIXED    
Severity: normal CC: fresler, Monomachus, NukemBy, schkovich, tboudreau, tmysik, tomjnsn, vriha
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 191366
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

Description Vladimir Riha 2012-08-08 08:52:16 UTC
Build: NetBeans IDE Dev (Build 201208080001)
VM: Java HotSpot(TM) Client VM, 23.2-b09, Java(TM) SE Runtime Environment, 1.7.0_06-b22
OS: Linux

User Comments:
vriha: closing project




Stacktrace: 
java.lang.AssertionError
   at com.oracle.nashorn.parser.Lexer.scanRegEx(Lexer.java:533)
   at com.oracle.nashorn.parser.Lexer.lexify(Lexer.java:1425)
   at com.oracle.nashorn.parser.AbstractParser.getToken(AbstractParser.java:128)
   at com.oracle.nashorn.parser.AbstractParser.nextOrEOL(AbstractParser.java:168)
   at com.oracle.nashorn.parser.AbstractParser.next(AbstractParser.java:149)
   at com.oracle.nashorn.parser.JsonParser.parse(JsonParser.java:85)
Comment 1 Vladimir Riha 2012-08-08 08:52:18 UTC
Created attachment 122850 [details]
stacktrace
Comment 2 NukemBy 2012-08-17 12:14:10 UTC
I've got this error during background scan of my project - so it may happen at any time.

I've debugged IDE a bit and it seems root cause for that problem is one of JSON files in my project which is not 100% sure JSON - it has at least comments inside it, what is successfully handled by Jackson parser with special configuration, but is not handled by nashorn library used in NetBeans 7.2.

Sample file to play with during debugging:

{
    "properties" : {
        // to be defined
    }
}
Comment 3 Vladimir Riha 2012-08-17 12:41:15 UTC
Yes, invalid json (like below) triggers this error


Sample file:
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

{
    "name": "vriha",
    "aasa":[1,1],
    "adresa":{
        
    }
}
Comment 4 NukemBy 2012-08-17 13:08:44 UTC
And one more strange thing - error report continues to pop up even after the project with the bogus json file is closed, i.e. I do "Project Context Menu -> Project Group -> (none)", create blank new project ... and, after some period, get the same error having only blank project being open in IDE. It looks like projects file cache is not cleaned correctly and obsolete items are being rescanned over and over again.

This is not the root cause for that particular problem, but can be a reason for performance and memory usage issues.
Comment 5 schkovich 2012-08-20 10:54:48 UTC
Created attachment 123303 [details]
stacktrace

scaning the project.
Comment 6 schkovich 2012-08-20 13:03:48 UTC
Created attachment 123310 [details]
stacktrace

scanning project.
Comment 7 schkovich 2012-08-22 11:50:25 UTC
Created attachment 123399 [details]
stacktrace

scanning project after svn commit
Comment 8 Vladimir Riha 2012-09-04 11:10:59 UTC
Created attachment 123868 [details]
stacktrace

I was creating new HTML5 project from sources. The "sources" was folder with extracted content downloaded from https://github.com/ladariha/humla/downloads
Comment 9 Tomas Mysik 2012-09-04 15:58:59 UTC
Created attachment 123900 [details]
stacktrace

my.json:

{
    "name": "TodoList",
    //"description": "TodoList application.",
    "authors": [
        {
            "name": "xy",
            "email": "xy@test.com"
        }
    ],
    "require": {

    }
}
Comment 10 _ tboudreau 2012-09-05 05:52:59 UTC
Created attachment 123916 [details]
stacktrace

Pasted bad json into a new empty json file:
404
? HMM.... {"type":"glanf","name":"godel","dependencies":[{"type":"phaseOne","name":"froods","data":{"b":"bear"}},{"type":"phaseTwo","name":"hoopies","data":{"c":"cashew"}},{"type":"index","name":"gerbils","data":{"d":"death"}}],"dataSource":{"sourceName":"stuff","indexOnFridays":true},"data":{"a":"apple"}}
PutJSON http://localhost:9082/jobs?autoConstrain=t
Comment 11 Vladimir Riha 2012-09-06 15:32:00 UTC
Created attachment 123990 [details]
stacktrace

formatting this json file:

// ahio
{
    "name":"vriha"
}
Comment 12 _ tboudreau 2012-09-18 16:47:09 UTC
Created attachment 124535 [details]
stacktrace

Compiling a project in a shell
Comment 13 Petr Hejl 2012-09-25 15:40:14 UTC
Fixed in nashorn.