Lines 12019-12022
Link Here
|
12019 |
"", |
12019 |
"", |
12020 |
false /* do not flush output directory */); |
12020 |
false /* do not flush output directory */); |
12021 |
} |
12021 |
} |
|
|
12022 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=330347 - Test retention of bridge methods. |
12023 |
public void testBridgeMethodRetention(){ |
12024 |
String currentWorkingDirectoryPath = System.getProperty("user.dir"); |
12025 |
if (currentWorkingDirectoryPath == null) { |
12026 |
fail("BatchCompilerTest#testBridgeMethodRetention could not access the current working directory " + currentWorkingDirectoryPath); |
12027 |
} else if (!new File(currentWorkingDirectoryPath).isDirectory()) { |
12028 |
fail("BatchCompilerTest#testBridgeMethodRetention current working directory is not a directory " + currentWorkingDirectoryPath); |
12029 |
} |
12030 |
String lib1Path = currentWorkingDirectoryPath + File.separator + "lib1.jar"; |
12031 |
try { |
12032 |
Util.createJar( |
12033 |
new String[] { |
12034 |
"Comparable.java", |
12035 |
"public interface Comparable<T> {\n" + |
12036 |
" public int compareTo(T o);\n" + |
12037 |
"}\n", |
12038 |
"Character.java", |
12039 |
"public class Character implements Comparable<Character> {\n" + |
12040 |
" public int compareTo(Character obj) {\n" + |
12041 |
" return 0;\n" + |
12042 |
" }\n" + |
12043 |
"}\n" |
12044 |
}, |
12045 |
null, |
12046 |
lib1Path, |
12047 |
JavaCore.VERSION_1_5); |
12048 |
this.runConformTest( |
12049 |
new String[] { |
12050 |
"src/X.java", |
12051 |
"public class X {\n" + |
12052 |
" Object fValue;\n" + |
12053 |
" public int compareTo(Object obj) {\n" + |
12054 |
" return ((Character)fValue).compareTo(obj);\n" + |
12055 |
" }\n" + |
12056 |
"}\n", |
12057 |
}, |
12058 |
"\"" + OUTPUT_DIR + File.separator + "src/X.java\"" |
12059 |
+ " -cp lib1.jar" // relative |
12060 |
+ " -sourcepath \"" + OUTPUT_DIR + File.separator + "src\"" |
12061 |
+ " -1.4 -g -preserveAllLocals" |
12062 |
+ " -proceedOnError -referenceInfo" |
12063 |
+ " -d \"" + OUTPUT_DIR + File.separator + "bin\" ", |
12064 |
"", |
12065 |
"", |
12066 |
true); |
12067 |
} catch (IOException e) { |
12068 |
System.err.println("BatchCompilerTest#testBridgeMethodRetention could not write to current working directory " + currentWorkingDirectoryPath); |
12069 |
} finally { |
12070 |
new File(lib1Path).delete(); |
12071 |
} |
12072 |
} |
12022 |
} |
12073 |
} |