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 41506

Summary: API - FileUtil.fromFile, URLMapper.getFileObjects
Product: platform Reporter: rmatous <rmatous>
Component: FilesystemsAssignee: rmatous <rmatous>
Status: CLOSED FIXED    
Severity: blocker CC: apireviews, dkonecny, jglick
Priority: P3 Keywords: API_REVIEW_FAST
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 41993    
Bug Blocks: 41176    
Attachments: diff with proposed changes
This diff is more obvious (cvs diff -u)
I have just moved this method from FileUtil (last revision) to URLMapper and dind't change any line. So, reimplemented and diff attached.
Added tests. Slightly modified impl. of method URLMapper.findFileObject

Description rmatous 2004-03-30 14:54:38 UTC
Although #25661 (There should not be two
DataObject for the same java.io.File) was already
fixed there is inconsistence in filesystem API
that even in method signature negate it which
doesn't seem to be transparent for developers
enough. Methods FileUtil.fromFile and
URLMapper.getFileObjects return array of
FileObjects. This inconsistency cause that
filesystem API is polluted with such methods like
FileUtil.findFileObject that was recently added.
Comment 1 rmatous 2004-03-31 09:40:12 UTC
Created attachment 14220 [details]
diff with proposed changes
Comment 2 rmatous 2004-03-31 10:27:14 UTC
I think that this issue includes just tiny changes, so I believe this
is candidate for API_FAST_REVIEW.  

All necessary changes are obvious from attached diff including
apichanges.xml.  
Comment 3 rmatous 2004-03-31 10:35:16 UTC
Created attachment 14222 [details]
This diff is more obvious (cvs diff -u)
Comment 4 Jaroslav Tulach 2004-04-01 15:03:57 UTC
Pretty ugly, I would say. I do not mean the API, but the impl. First
of all you should document +            

if (fos[i].getClass().getName().indexOf("masterfs") != -1) {       
//NOI18N

in arch-answers and mention it as a mutual dependency between
filesystems and masterfs. Probably under question called about
reflections. And of course write a test. New diff would be nice.

Comment 5 rmatous 2004-04-01 16:20:33 UTC
Created attachment 14245 [details]
I have just moved this method from FileUtil (last revision)  to URLMapper and dind't change any line.  So, reimplemented and diff attached.
Comment 6 rmatous 2004-04-05 08:39:26 UTC
*** Issue 39415 has been marked as a duplicate of this issue. ***
Comment 7 rmatous 2004-04-05 17:47:18 UTC
Created attachment 14289 [details]
Added tests.  Slightly modified impl. of method URLMapper.findFileObject
Comment 8 rmatous 2004-04-13 14:21:32 UTC
I will commit announced changes into trunk.
Comment 9 rmatous 2004-04-13 14:38:02 UTC
Commited announed API changes into openide and all related calls:

/cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/UnprojectizedSourceForBinaryImpl.java,v
 <--  UnprojectizedSourceForBinaryImpl.java
new revision: 1.12; previous revision: 1.11

/cvs/core/test/unit/src/org/netbeans/core/filesystems/ArchiveURLMapperTest.java,v
 <--  ArchiveURLMapperTest.java
new revision: 1.3; previous revision: 1.2

/cvs/java/api/src/org/netbeans/api/java/classpath/ClassPath.java,v 
<--  ClassPath.java
new revision: 1.13; previous revision: 1.12

/cvs/javadoc/src/org/netbeans/modules/javadoc/search/JavadocRegistry.java,v
 <--  JavadocRegistry.java
new revision: 1.3; previous revision: 1.2

/cvs/openide/openide-spec-vers.properties,v  <-- 
openide-spec-vers.properties
new revision: 1.137; previous revision: 1.136

/cvs/openide/api/doc/changes/apichanges.xml,v  <--  apichanges.xml
new revision: 1.192; previous revision: 1.191

/cvs/projects/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java,v
 <--  SimpleFileOwnerQueryImplementation.java
new revision: 1.4; previous revision: 1.3

/cvs/ant/project/antsrc/org/netbeans/modules/project/ant/task/RegenerateFilesTask.java,v
 <--  RegenerateFilesTask.java
new revision: 1.3; previous revision: 1.2

/cvs/ant/project/src/org/netbeans/api/project/ant/AntArtifact.java,v 
<--  AntArtifact.java
new revision: 1.3; previous revision: 1.2

/cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java,v
 <--  ContextProviderImpl.java
new revision: 1.4; previous revision: 1.3

/cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/EngineContextProviderImpl.java,v
 <--  EngineContextProviderImpl.java
new revision: 1.4; previous revision: 1.3

/cvs/editor/src/org/netbeans/modules/editor/java/JCStorageElement.java,v
 <--  JCStorageElement.java
new revision: 1.17; previous revision: 1.16

/cvs/editor/src/org/netbeans/modules/editor/java/NbCompletionJavaDoc.java,v
 <--  NbCompletionJavaDoc.java
new revision: 1.34; previous revision: 1.33

/cvs/editor/src/org/netbeans/modules/editor/java/NbJavaSyntaxSupport.java,v
 <--  NbJavaSyntaxSupport.java
new revision: 1.51; previous revision: 1.50

/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibrarySourceForBinaryQuery.java,v
 <--  J2SELibrarySourceForBinaryQuery.java
new revision: 1.3; previous revision: 1.2

/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/ParserDBQueryLibraryImpl.java,v
 <--  ParserDBQueryLibraryImpl.java
new revision: 1.3; previous revision: 1.2

/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformImpl.java,v
 <--  J2SEPlatformImpl.java
new revision: 1.4; previous revision: 1.3

/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/ParserDBQueryImpl.java,v
 <--  ParserDBQueryImpl.java
new revision: 1.3; previous revision: 1.2

/cvs/openide/src/org/openide/filesystems/FileUtil.java,v  <-- 
FileUtil.java
new revision: 1.81; previous revision: 1.80

/cvs/openide/src/org/openide/filesystems/URLMapper.java,v  <-- 
URLMapper.java
new revision: 1.28; previous revision: 1.27

/cvs/openide/test/unit/src/org/openide/filesystems/FileUtilTestHidden.java,v
 <--  FileUtilTestHidden.java
new revision: 1.2; previous revision: 1.1

/cvs/openide/test/unit/src/org/openide/filesystems/URLMapperTestHidden.java,v
 <--  URLMapperTestHidden.java
new revision: 1.5; previous revision: 1.4
Comment 10 Jaromir Uhrik 2005-07-14 16:18:11 UTC
Verified.