Commits

Artem Melentyev committed 10daad2

remove warnings

Comments (0)

Files changed (3)

core/src/main/java/juast/visit/GenVisitor.java

 class GenVisitor {
 	public static void main(String[] args) throws Exception {
 		//PrintStream out = System.out;
-		PrintStream outi = new PrintStream(new File("src/main/java/juast/visit/Visitor.java"));
-		PrintStream outd = new PrintStream(new File("src/main/java/juast/visit/DefaultVisitor.java"));
-		outi.format(
-				"package juast.visit;\n" +
-				"\n" +
-				"import javax.annotation.Generated;\n" +
-				"import juast.*;\n" +
-				"\n" +
-				"@Generated(value = { \"%s\" })\n" +
-				"public interface Visitor {\n",
-				GenVisitor.class.getName()
-		);
-		outd.format(
-				"package juast.visit;\n" +
-				"\n" +
-				"import javax.annotation.Generated;\n" +
-				"import juast.*;\n" +
-				"\n" +
-				"@Generated(value = { \"%s\" })\n" +
-				"public class DefaultVisitor implements Visitor {\n" +
-				"\tprivate boolean defaultEnter = true, defaultLeave = true, enter = true, leave = true;\n" +
-				"\tpublic DefaultVisitor(boolean defaultEnter, boolean defaultLeave, boolean enter, boolean leave) {\n" +
-				"\t\tthis.enter = enter;\n" +
-				"\t\tthis.leave = leave;\n" +
-				"\t\tthis.defaultEnter = defaultEnter;\n" +
-				"\t\tthis.defaultLeave = defaultLeave;\n" +
-				"\t}\n" +
-				"\tpublic DefaultVisitor() {}\n",
-				GenVisitor.class.getName()
-		);
-		File f = new File("src/main/java/juast");
-		for (String s :  f.list()) {
-			String s1 = s.substring(0, s.length()-5);
-			try {
-				Class<?> cl = Class.forName("juast."+s1);
-				if (cl.getAnnotation(Abstract.class) != null)
-					continue;
-				if (Node.class.isAssignableFrom(cl)) {
-					outi.format("\tboolean enter(%s node);\n", s1);
-					outi.format("\tboolean leave(%s node);\n", s1);
-					outd.format("\tpublic boolean enter(%s node) { return enter; }\n", s1);
-					outd.format("\tpublic boolean leave(%s node) { return leave; }\n", s1);
-				}
-			} catch (ClassNotFoundException e) {}
+		try (PrintStream outi = new PrintStream(new File("src/main/java/juast/visit/Visitor.java"));
+			PrintStream outd = new PrintStream(new File("src/main/java/juast/visit/DefaultVisitor.java"))) {
+			outi.format(
+					"package juast.visit;\n" +
+					"\n" +
+					"import javax.annotation.Generated;\n" +
+					"import juast.*;\n" +
+					"\n" +
+					"@Generated(value = { \"%s\" })\n" +
+					"public interface Visitor {\n",
+					GenVisitor.class.getName()
+			);
+			outd.format(
+					"package juast.visit;\n" +
+					"\n" +
+					"import javax.annotation.Generated;\n" +
+					"import juast.*;\n" +
+					"\n" +
+					"@Generated(value = { \"%s\" })\n" +
+					"public class DefaultVisitor implements Visitor {\n" +
+					"\tprivate boolean defaultEnter = true, defaultLeave = true, enter = true, leave = true;\n" +
+					"\tpublic DefaultVisitor(boolean defaultEnter, boolean defaultLeave, boolean enter, boolean leave) {\n" +
+					"\t\tthis.enter = enter;\n" +
+					"\t\tthis.leave = leave;\n" +
+					"\t\tthis.defaultEnter = defaultEnter;\n" +
+					"\t\tthis.defaultLeave = defaultLeave;\n" +
+					"\t}\n" +
+					"\tpublic DefaultVisitor() {}\n",
+					GenVisitor.class.getName()
+			);
+			File f = new File("src/main/java/juast");
+			for (String s :  f.list()) {
+				String s1 = s.substring(0, s.length()-5);
+				try {
+					Class<?> cl = Class.forName("juast."+s1);
+					if (cl.getAnnotation(Abstract.class) != null)
+						continue;
+					if (Node.class.isAssignableFrom(cl)) {
+						outi.format("\tboolean enter(%s node);\n", s1);
+						outi.format("\tboolean leave(%s node);\n", s1);
+						outd.format("\tpublic boolean enter(%s node) { return enter; }\n", s1);
+						outd.format("\tpublic boolean leave(%s node) { return leave; }\n", s1);
+					}
+				} catch (ClassNotFoundException e) {}
+			}
+			outi.println("\tboolean defaultEnter(Node node);");
+			outi.println("\tboolean defaultLeave(Node node);");
+			outi.println("}");
+			outd.println("\tpublic boolean defaultEnter(Node node) { return defaultEnter; }");
+			outd.println("\tpublic boolean defaultLeave(Node node) { return defaultLeave; } ");
+			outd.println("}");
+			
+			outi.flush();
+			outd.flush();
 		}
-		outi.println("\tboolean defaultEnter(Node node);");
-		outi.println("\tboolean defaultLeave(Node node);");
-		outi.println("}");
-		outd.println("\tpublic boolean defaultEnter(Node node) { return defaultEnter; }");
-		outd.println("\tpublic boolean defaultLeave(Node node) { return defaultLeave; } ");
-		outd.println("}");
-		
-		outi.flush();
-		outd.flush();
 	}
 }

ecj/src/test/java/test/EcjParcerProg.java

 	
 	
 
-	<T extends Number> void testVarArg(List<? extends T> lst, T ...args) {
+	<T extends Number> void testVarArg(List<? extends T> lst, @SuppressWarnings("unchecked") T ...args) {
 		
 	}
 

javac/src/test/java/test/JavacParserProg.java

 			@Provides Context getContext() {
 				return context;
 			}
-			@SuppressWarnings("unused")
 			public @Provides ProcessingEnvironment getProcessingEnvironment() {
 				return new JavacProcessingEnvironment(getContext(), null);
 			}