Bug 208919 - CCE in ParsingLayerCacheManager.startElement if file and folder collide
CCE in ParsingLayerCacheManager.startElement if file and folder collide
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Module System
7.2
PC Linux
: P3 (vote)
: 7.2
Assigned To: Jaroslav Tulach
issues@platform
http://statistics.netbeans.org/except...
:
Depends on:
Blocks: 214254
  Show dependency treegraph
 
Reported: 2012-02-27 17:40 UTC by Jesse Glick
Modified: 2014-01-09 02:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
Test case (10.92 KB, application/zip)
2012-04-09 23:32 UTC, Jesse Glick
Details
automatically converts files to folders (6.46 KB, patch)
2012-12-17 15:48 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2012-02-27 17:40:06 UTC
See exception report URL (miscategorized).

While parsing jar:file:/space/src/nb/main/nbbuild/netbeans/ide/modules/org-netbeans-modules-projectui.jar!/META-INF/generated-layer.xml
Caused: java.lang.ClassCastException: Stack: [MemFolder[null], MemFolder[Templates], MemFolder[Other], MemFolder[Folder]]
	at org.netbeans.core.startup.layers.ParsingLayerCacheManager.startElement(ParsingLayerCacheManager.java:226)

This after trying to override Templates/Other/Folder/ in favorites module (a folder) with a file of the same name in projectui.

Also caused an NPE later in LayerCacheManager$1Updater.flushCaches.
Comment 1 Jaroslav Tulach 2012-04-06 13:23:23 UTC
ergonomics#52e1b7cdc80b - improving the exception text
Comment 2 Jesse Glick 2012-04-09 23:32:06 UTC
Created attachment 118025 [details]
Test case
Comment 3 Jesse Glick 2012-04-09 23:32:25 UTC
Easily reproduced with the attached minimal test case.
Comment 4 Jaroslav Tulach 2012-04-18 15:11:01 UTC
OK, so the problem is that folder is defined first and then another module defines file of the same name. What should happen in this situation?
Comment 5 Jesse Glick 2012-04-18 15:37:39 UTC
Well in the originally reported exception I was trying to use the 'weight' attribute to make the (empty) file "win". This is presumably a rare situation, so it might be asking too much for 'weight' to be honored there - I managed to do what I needed by masking the folder, then creating a file with a different name. If MultiFileSystem has a well-defined way of handling this situation, I guess BinaryFS should copy it. Or it could log a graceful warning and skip one or both of the entries.
Comment 6 Quality Engineering 2012-04-19 10:01:57 UTC
Integrated into 'main-golden', will be available in build *201204190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/52e1b7cdc80b
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208919: More information about the instanceof check
Comment 7 Quality Engineering 2012-04-26 10:33:01 UTC
Integrated into 'main-golden', will be available in build *201204260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5e896460d1c7
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208919: Test to confirm behavior
Comment 8 Milos Kleint 2012-10-01 14:30:42 UTC
-> P3, another P3 depends on this
Comment 9 Jaroslav Tulach 2012-12-17 15:48:05 UTC
Created attachment 129465 [details]
automatically converts files to folders

ContentProviderTest and RepositoryTest in openide.filesystems seem to be failing however.
Comment 10 Jaroslav Tulach 2013-12-20 10:56:00 UTC
ergonomics#2fdbbb52075c
Comment 11 Quality Engineering 2014-01-09 02:55:33 UTC
Integrated into 'main-silver', will be available in build *201401090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2fdbbb52075c
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208919: Survive collisions between two modules defining the same resource as file and as a folder


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