author | ysuenaga |
Wed, 30 Mar 2016 21:05:13 +0900 | |
changeset 37218 | c7241bc368bf |
parent 36526 | 3b41f1c69604 |
child 37633 | d16d6d59446d |
permissions | -rw-r--r-- |
10 | 1 |
/** |
2 |
* @test |
|
3 |
* @bug 6589361 |
|
4 |
* @summary 6589361:Failing building ct.sym file as part of the control build |
|
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
3995
diff
changeset
|
5 |
* @modules jdk.compiler/com.sun.tools.javac.file |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
3995
diff
changeset
|
6 |
* jdk.compiler/com.sun.tools.javac.util |
10 | 7 |
*/ |
8 |
||
731
1dd22bdb9ca5
6714364: refactor javac File handling code into new javac.file package
jjg
parents:
657
diff
changeset
|
9 |
import com.sun.tools.javac.file.JavacFileManager; |
10 | 10 |
import com.sun.tools.javac.util.Context; |
11 |
import java.io.File; |
|
12 |
import javax.tools.FileObject; |
|
13 |
import javax.tools.JavaFileObject; |
|
14 |
import javax.tools.JavaFileObject.Kind; |
|
15 |
import javax.tools.StandardLocation; |
|
16 |
import java.util.Set; |
|
17 |
import java.util.HashSet; |
|
18 |
||
19 |
public class T6589361 { |
|
20 |
public static void main(String [] args) throws Exception { |
|
21 |
JavacFileManager fm = null; |
|
22 |
try { |
|
23 |
fm = new JavacFileManager(new Context(), false, null); |
|
24 |
Set<JavaFileObject.Kind> set = new HashSet<JavaFileObject.Kind>(); |
|
25 |
set.add(JavaFileObject.Kind.CLASS); |
|
26 |
Iterable<JavaFileObject> files = fm.list(StandardLocation.PLATFORM_CLASS_PATH, "java.lang", set, false); |
|
27 |
for (JavaFileObject file : files) { |
|
3774 | 28 |
// Note: Zip/Jar entry names use '/', not File.separator, but just to be sure, |
29 |
// we normalize the filename as well. |
|
3995
73af8b6fb8bc
6410637: Make decision on deprecated methods in DefaultFileManager and BaseFileObject.
jjg
parents:
3774
diff
changeset
|
30 |
if (file.getName().replace(File.separatorChar, '/').contains("java/lang/Object.class")) { |
36526 | 31 |
String str = fm.inferBinaryName(StandardLocation.PLATFORM_CLASS_PATH, file); |
10 | 32 |
if (!str.equals("java.lang.Object")) { |
36526 | 33 |
System.err.println("file object: " + file); |
34 |
System.err.println(" class: " + file.getClass()); |
|
35 |
System.err.println(" name: " + file.getName()); |
|
36 |
System.err.println("binary name: " + str); |
|
10 | 37 |
throw new AssertionError("Error in JavacFileManager.inferBinaryName method!"); |
38 |
} |
|
39 |
else { |
|
40 |
return; |
|
41 |
} |
|
42 |
} |
|
43 |
} |
|
44 |
} |
|
45 |
finally { |
|
46 |
if (fm != null) { |
|
47 |
fm.close(); |
|
48 |
} |
|
49 |
} |
|
3774 | 50 |
throw new AssertionError("Could not find java/lang/Object.class while compiling"); |
10 | 51 |
} |
52 |
||
53 |
} |