-
Bug
-
Resolution: Fixed
-
P2
-
None
-
b28
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8269194 | 18 | Jan Lahoda | P2 | Resolved | Fixed | b03 |
JDK-8270615 | 17.0.1 | Jan Lahoda | P2 | Resolved | Fixed | b03 |
The following specifications
https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#getJavaFileObjectsFromPaths(java.lang.Iterable)
https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#getJavaFileObjectsFromPaths(java.util.Collection)
https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#setLocationFromPaths(javax.tools.JavaFileManager.Location,java.util.Collection)
say:
=================================
Implementation Requirements:
IllegalArgumentException will be thrown if any of the paths cannot be converted to a file.
=================================
Actually OpenJDK implementation performs a lazy conversion of the given paths to files
and IllegalArgumentException won't be thrown if some of the passed paths in not convertable to file
until and if the 'receiver' methods (setLocation() or getJavaFileObjectsFromFiles()) perform the actual iteration over Iterable<? extends File>.
Moreover if some implementation of getJavaFileObjectsFromFiles() creates another lazy Iterable<? extends JavaFileObject> then IAE would be thrown only when the user tries to iterate over the result.
Either the spec needs to be corrected to match the impl or implemenation(s) should be made non-lazy
https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#getJavaFileObjectsFromPaths(java.lang.Iterable)
https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#getJavaFileObjectsFromPaths(java.util.Collection)
https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#setLocationFromPaths(javax.tools.JavaFileManager.Location,java.util.Collection)
say:
=================================
Implementation Requirements:
IllegalArgumentException will be thrown if any of the paths cannot be converted to a file.
=================================
Actually OpenJDK implementation performs a lazy conversion of the given paths to files
and IllegalArgumentException won't be thrown if some of the passed paths in not convertable to file
until and if the 'receiver' methods (setLocation() or getJavaFileObjectsFromFiles()) perform the actual iteration over Iterable<? extends File>.
Moreover if some implementation of getJavaFileObjectsFromFiles() creates another lazy Iterable<? extends JavaFileObject> then IAE would be thrown only when the user tries to iterate over the result.
Either the spec needs to be corrected to match the impl or implemenation(s) should be made non-lazy
- backported by
-
JDK-8269194 StandardJavaFileManager: default impls of setLocationFromPaths(), getJavaFileObjectsFromPaths() methods don't throw IllegalArgumentException as specified
-
- Resolved
-
-
JDK-8270615 StandardJavaFileManager: default impls of setLocationFromPaths(), getJavaFileObjectsFromPaths() methods don't throw IllegalArgumentException as specified
-
- Resolved
-
- clones
-
JDK-8266591 StandardJavaFileManager::getJavaFileObjectsFromPaths() methods contain a typo in their spec
-
- Resolved
-
- is cloned by
-
JDK-8266631 StandardJavaFileManager: getJavaFileObjects() impl violates the spec
-
- Closed
-
(2 links to)