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 178256 - FolderLookup strange behavior
Summary: FolderLookup strange behavior
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 177705
  Show dependency tree
 
Reported: 2009-12-07 09:53 UTC by Tomas Zezula
Modified: 2010-02-17 21:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test case (3.58 KB, patch)
2009-12-07 09:56 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2009-12-07 09:53:17 UTC
Run attached test, it fails.
Run it again with commented line 69. It passes.
Seems as a caching problem.
Comment 1 Tomas Zezula 2009-12-07 09:56:17 UTC
Created attachment 92233 [details]
Test case
Comment 2 Jaroslav Tulach 2010-02-12 08:48:52 UTC
The layer definition is wrong. It can be fixed in three ways:

1. instanceOf attribute shall enumeration all superclasses
2. instanceOf attribute shall be renamed to instanceClass
3. instanceOf attribute can be deleted

As instanceOf attribute exists only for like-to-be historical reasons I suggest to use #2.

diff -r 33c417bca73a java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/resources/layer.xml
--- a/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/resources/layer.xml  Fri Feb 12 18:10:41 2010 +0300
+++ b/java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/resources/layer.xml  Fri Feb 12 16:47:24 2010 +0100
@@ -57,7 +57,7 @@                                                                                                     
         <folder name="platform">                                                                                     
             <folder name="installers">                                                                               
                 <file name=".default.instance">                                                                      
-                    <attr name="instanceOf" stringvalue="org.netbeans.spi.java.platform.PlatformInstall"/>           
+                    <attr name="instanceClass" stringvalue="org.netbeans.spi.java.platform.PlatformInstall"/>        
                     <attr name="instanceCreate" methodvalue="org.netbeans.modules.java.j2seplatform.J2SEInstallImpl.create"/>
                     <attr name="position" intvalue="100"/>                                                                   
                 </file> 

I admit there is some inconsistency in InstanceDataObject vs. FolderLookup behavior, but the root cause is that InstanceDataObject provides incorrect answers (due to wrong instanceOf content). Fixing this in lookup seems like P4 to me.
Comment 3 Tomas Zezula 2010-02-17 03:24:22 UTC
fixed in jet-main e7190be706aa
Comment 4 Tomas Zezula 2010-02-17 03:24:40 UTC
Thanks Jardo.
Comment 5 Quality Engineering 2010-02-17 21:59:19 UTC
Integrated into 'main-golden', will be available in build *201002180200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e7190be706aa
User: Tomas Zezula <tzezula@netbeans.org>
Log: #178256:FolderLookup strange behavior