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 235471 - AssertionError: cdnjs-cdnjs-754b27a/ajax/libs/package.json
Summary: AssertionError: cdnjs-cdnjs-754b27a/ajax/libs/package.json
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Project (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords: 7.4_HR_FIX
: 235479 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-03 19:43 UTC by akozlov75
Modified: 2013-09-16 14:31 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 203478


Attachments
stacktrace (7.72 KB, text/plain)
2013-09-03 19:43 UTC, akozlov75
Details

Note You need to log in before you can comment on or make changes to this bug.
Description akozlov75 2013-09-03 19:43:51 UTC
Build: NetBeans IDE Dev (Build 201309020001)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_10-b18
OS: Mac OS X

User Comments:
GUEST: After cdnjs.com updated.

Keda87: error when create new project

akozlov75: On javascript list scanning

GUEST: Project Javascript libraries

Keda87: i dont know

Keda87: please fix this bugs




Stacktrace: 
java.lang.AssertionError: cdnjs-cdnjs-754b27a/ajax/libs/package.json
   at org.netbeans.modules.web.clientproject.libraries.CDNJSLibrariesProvider.readLibraries(CDNJSLibrariesProvider.java:141)
   at org.netbeans.modules.web.clientproject.libraries.CDNJSLibrariesProvider.getLibraries(CDNJSLibrariesProvider.java:118)
   at org.netbeans.modules.web.clientproject.api.WebClientLibraryManager.addLibraries(WebClientLibraryManager.java:311)
   at org.netbeans.modules.web.clientproject.api.WebClientLibraryManager.getLibraries(WebClientLibraryManager.java:219)
   at org.netbeans.modules.web.clientproject.api.jslibs.JavaScriptLibrarySelectionPanel$LibrariesTableModel$1.run(JavaScriptLibrarySelectionPanel.java:1255)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
Comment 1 akozlov75 2013-09-03 19:43:53 UTC
Created attachment 139628 [details]
stacktrace
Comment 2 David Konecny 2013-09-03 19:51:15 UTC
Tomas, do you mind having a look? Thanks.
Comment 3 Tomas Mysik 2013-09-04 05:34:05 UTC
Davide, from the code, it seems to me that we are searching for "/" in "package.json" - not sure what the correct fix is - to skip such entry? Not sure because later in the code, there is some code related to "package.json" entry name... Reassigning back, sorry. Also - could this be 7.4 FCS stopper?

Feel free to suggest the proper fix and assign back to me, I will do that (including the possible backport to 7.4 branch).

Thanks.
Comment 4 Tomas Mysik 2013-09-04 05:35:17 UTC
BTW it is "only" assertion but in the production build, StringIndexOutOfBoundsException will occur.
Comment 5 Vladimir Riha 2013-09-04 06:49:24 UTC
There is another likely duplicate, issue 235479. Do you know "how" this could happen? I was testing it several times during past weeks and recently after the URL change so I'm just wondering why it didn't happened to me
Comment 6 Vladimir Riha 2013-09-04 06:49:58 UTC
*** Bug 235479 has been marked as a duplicate of this bug. ***
Comment 7 Tomas Mysik 2013-09-04 07:06:51 UTC
No idea but I would guess that this happens if the CDNJS ZIP file is somehow "different" than we expect it; because we are downloading the current trunk/tip/head, it could easily happen. If there were some stable tags/branches, it would work better for us, of course.
Comment 8 David Konecny 2013-09-04 22:22:21 UTC
There is an unexpected file in package.json in folder cdnjs-cdnjs-754b27a/ajax/libs. The file is in the latest CDNJS snapshot but I think it is accidental and should have never been there. The content of the file confirms that - the right folder for this file is cdnjs-cdnjs-754b27a/ajax/libs/kartograph-js/.

The problem is that our code is not defensive enough. The assert should be replaced with

  if (i == -1) {continue;}

Could you do that Tomas please? I'm busy with bunch of other stuff. This should be integrated into FCS - any user who updates to latest CDNJS snapshot will hit this exception. Thanks!
Comment 9 Tomas Mysik 2013-09-05 04:51:27 UTC
Setting proper keyword and TM. Will do it.
Comment 10 Tomas Mysik 2013-09-05 05:17:24 UTC
Fixed, Láďo, please verify, I would transplant it to 7.4 release then.

Thanks.

http://hg.netbeans.org/web-main/rev/a746f00e37da
Comment 11 Tomas Mysik 2013-09-05 14:14:30 UTC
Davide, please review the fix. Thanks.
Comment 12 David Konecny 2013-09-05 21:10:20 UTC
Reviewed. It is good.
Comment 13 Quality Engineering 2013-09-06 01:36:16 UTC
Integrated into 'main-silver', will be available in build *201309060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a746f00e37da
User: Tomas Mysik <tmysik@netbeans.org>
Log: #235471 - AssertionError: cdnjs-cdnjs-754b27a/ajax/libs/package.json
Comment 14 Vladimir Riha 2013-09-09 08:24:09 UTC
I tried to update JS libs, new unexpected package.json was present. After IDE restart, I tried to create new project, try to search among JS files in JavaScript files step and then updated JS libraries and finished project creation. No AE, verified in trunk

Please continue with integration to release74 as described
in [1]. Thank you


[1] http://wiki.netbeans.org/NetBeans_74_HighResistance


Product Version: NetBeans IDE Dev (Build 201309090001)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 15 Tomas Mysik 2013-09-10 08:31:15 UTC
Fix transplanted to the releases repository, branch release74.

Thanks.

http://hg.netbeans.org/releases/rev/e17fa7347b70
Comment 16 Vladimir Riha 2013-09-16 14:31:15 UTC
Cannot reproduce, verified

Product Version: NetBeans IDE 7.4 RC1 (Build 201309152201)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b49
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b107
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)