author | sogoel |
Thu, 05 Jun 2014 10:57:10 -0700 | |
changeset 24797 | 850ebd4d80a7 |
parent 3995 | 73af8b6fb8bc |
child 30730 | d3ce7619db2c |
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 |
|
5 |
*/ |
|
6 |
||
731
1dd22bdb9ca5
6714364: refactor javac File handling code into new javac.file package
jjg
parents:
657
diff
changeset
|
7 |
import com.sun.tools.javac.file.JavacFileManager; |
10 | 8 |
import com.sun.tools.javac.util.Context; |
9 |
import java.io.File; |
|
10 |
import javax.tools.FileObject; |
|
11 |
import javax.tools.JavaFileObject; |
|
12 |
import javax.tools.JavaFileObject.Kind; |
|
13 |
import javax.tools.StandardLocation; |
|
14 |
import java.util.Set; |
|
15 |
import java.util.HashSet; |
|
16 |
||
17 |
public class T6589361 { |
|
18 |
public static void main(String [] args) throws Exception { |
|
19 |
JavacFileManager fm = null; |
|
20 |
try { |
|
21 |
fm = new JavacFileManager(new Context(), false, null); |
|
22 |
Set<JavaFileObject.Kind> set = new HashSet<JavaFileObject.Kind>(); |
|
23 |
set.add(JavaFileObject.Kind.CLASS); |
|
24 |
Iterable<JavaFileObject> files = fm.list(StandardLocation.PLATFORM_CLASS_PATH, "java.lang", set, false); |
|
25 |
for (JavaFileObject file : files) { |
|
3774 | 26 |
// Note: Zip/Jar entry names use '/', not File.separator, but just to be sure, |
27 |
// we normalize the filename as well. |
|
3995
73af8b6fb8bc
6410637: Make decision on deprecated methods in DefaultFileManager and BaseFileObject.
jjg
parents:
3774
diff
changeset
|
28 |
if (file.getName().replace(File.separatorChar, '/').contains("java/lang/Object.class")) { |
10 | 29 |
String str = fm.inferBinaryName(StandardLocation.CLASS_PATH, file); |
30 |
if (!str.equals("java.lang.Object")) { |
|
31 |
throw new AssertionError("Error in JavacFileManager.inferBinaryName method!"); |
|
32 |
} |
|
33 |
else { |
|
34 |
return; |
|
35 |
} |
|
36 |
} |
|
37 |
} |
|
38 |
} |
|
39 |
finally { |
|
40 |
if (fm != null) { |
|
41 |
fm.close(); |
|
42 |
} |
|
43 |
} |
|
3774 | 44 |
throw new AssertionError("Could not find java/lang/Object.class while compiling"); |
10 | 45 |
} |
46 |
||
47 |
} |