Commits

Artem Melentyev committed 2f3bd1f

add CompAss test, java6 compatibility

  • Participants
  • Parent commits b1fb98e

Comments (0)

Files changed (4)

File javac-oo.iml

 <?xml version="1.0" encoding="UTF-8"?>
 <module type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/build/classes" />
+    <output-test url="file://$MODULE_DIR$/classes/test/javac-oo" />
     <exclude-output />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/share/classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
     </content>
+    <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
   </component>
 </module>
 

File showoodiff.sh

-hg diff -r default:oo src/share/classes
+hg diff -r default src/share/classes

File src/share/classes/com/sun/tools/javac/comp/Attr.java

     String sourceName;
 
     /** WeakHashMap to allow GC collect entries. Because we don't need them then they are gone */
-    public Map<JCTree, JCExpression> translateMap = new WeakHashMap<>();
+    public Map<JCTree, JCExpression> translateMap = new WeakHashMap<JCTree, JCExpression>();
 
     /** Check kind and type of given tree against protokind and prototype.
      *  If check succeeds, store type in tree and return it.

File src/test/JCOOTest.java

         compile("ListIndexGet");
         compile("ListIndexSet");
         compile("MapIndex");
+        compile("CompAss", "../tests");
     }
-    public static void compile(String clas) throws Exception {
-    	String file = "../examples/"+clas+".java";
+    public static void compile(String clas) throws  Exception {
+        compile(clas, "../examples");
+    }
+    public static void compile(String clas, String path) throws Exception {
+    	String file = path+"/"+clas+".java";
 		System.out.print("Compiling " + file + ": ");
 		boolean res = Main.compile(new String[]{file, "-d", "build/classes"})==0;
 		res &= (boolean)Class.forName(clas).getDeclaredMethod("test").invoke(null);