Bug 41506 - API - FileUtil.fromFile, URLMapper.getFileObjects
API - FileUtil.fromFile, URLMapper.getFileObjects
Status: CLOSED FIXED
Product: platform
Classification: Unclassified
Component: Filesystems
4.x
All All
: P3 (vote)
: 4.x
Assigned To: rmatous
issues@platform
: API_REVIEW_FAST
: 39415 (view as bug list)
Depends on: 41993
Blocks: 41176
  Show dependency treegraph
 
Reported: 2004-03-30 14:54 UTC by rmatous
Modified: 2008-12-22 17:48 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
diff with proposed changes (3.91 KB, patch)
2004-03-31 09:40 UTC, rmatous
Details | Diff
This diff is more obvious (cvs diff -u) (6.81 KB, patch)
2004-03-31 10:35 UTC, rmatous
Details | Diff
I have just moved this method from FileUtil (last revision) to URLMapper and dind't change any line. So, reimplemented and diff attached. (1.97 KB, patch)
2004-04-01 16:20 UTC, rmatous
Details | Diff
Added tests. Slightly modified impl. of method URLMapper.findFileObject (8.16 KB, patch)
2004-04-05 17:47 UTC, rmatous
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.


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