Bug 423721 - SWT workspace is full of SWT tools errors (Fix SWT tools)
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java
index 9e6630e..301027d 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTClass.java
@@ -27,7 +27,6 @@
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.swt.tools.internal.ASTType.TypeResolver;
-@SuppressWarnings("deprecation")
public class ASTClass extends ASTItem implements JNIClass {
String sourcePath;
MetaData metaData;
@@ -78,7 +77,7 @@
this.metaData = metaData;
String source = JNIGenerator.loadFile(sourcePath);
- ASTParser parser = ASTParser.newParser(AST.JLS3);
+ ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(source.toCharArray());
CompilationUnit unit = (CompilationUnit)parser.createAST(null);
TypeDeclaration type = (TypeDeclaration)unit.types().get(0);
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java
index 4b76d50..baca28e 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java
@@ -35,14 +35,13 @@
this.sourcePath = sourcePath;
}
-@SuppressWarnings("deprecation")
void checkMembers() {
if (fields != null) return;
String source = null;
CompilationUnit unit = null;
if (JNIItem.GEN64) {
source = JNIGenerator.loadFile(sourcePath);
- ASTParser parser = ASTParser.newParser(AST.JLS3);
+ ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(source.toCharArray());
unit = (CompilationUnit)parser.createAST(null);
}
diff --git a/bundles/org.eclipse.swt.tools/src/org/eclipse/swt/tools/builders/Check64CompilationParticipant.java b/bundles/org.eclipse.swt.tools/src/org/eclipse/swt/tools/builders/Check64CompilationParticipant.java
index 75fefae..9db16d8 100644
--- a/bundles/org.eclipse.swt.tools/src/org/eclipse/swt/tools/builders/Check64CompilationParticipant.java
+++ b/bundles/org.eclipse.swt.tools/src/org/eclipse/swt/tools/builders/Check64CompilationParticipant.java
@@ -121,6 +121,7 @@
ArrayList<String> args = new ArrayList<String>();
args.addAll(Arrays.asList(new String[]{
"-nowarn",
+ "-1.5",
// "-verbose",
"-d", bin,
"-cp", cp.toString(),
@@ -223,12 +224,11 @@
return null;
}
-@SuppressWarnings("deprecation")
TypeDeclaration loadType(HashMap<String, TypeDeclaration> cache, String path) {
if (path == null) return null;
Object value = cache.get(path);
if (value != null) return (TypeDeclaration)value;
- ASTParser parser = ASTParser.newParser(AST.JLS3);
+ ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(loadFile(path).toCharArray());
CompilationUnit unit = (CompilationUnit)parser.createAST(null);
TypeDeclaration type = (TypeDeclaration)unit.types().get(0);