Disable deprecation warnings in modules where they are unavoidable (#263)

These two modules refer to "AST.JLS8".  If you have Java 9 installed,
then "AST.JLS8" is marked as deprecated, and we can a warning unless
we suppress or disable the deprecation warning wherever "AST.JLS8" is
used.  However, if you don't have Java 9 installed, then "AST.JLS8" is
not deprecated, and trying to suppress deprecation warnings where
"AST.JLS8" is used instead produces warnings about unnecessary warning
suppression.  Aagh!  Turning off the deprecation warnings entirely for
these two modules seems like the only sane compromise.
This commit is contained in:
Ben Liblit 2017-11-21 20:00:43 -06:00 committed by Manu Sridharan
parent 5faae993e9
commit e89c5c6562
6 changed files with 2 additions and 6 deletions

View File

@ -16,7 +16,7 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=error
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.deadCode=error
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error

View File

@ -1044,7 +1044,6 @@ public abstract class JDTJava2CAstTranslator<T extends Position> {
private Collection<CAstType> fExceptionTypes = null;
@Override
@SuppressWarnings("deprecation")
public CAstType getReturnType() {
if (fReturnType != null)
return fTypeDict.getCAstTypeFor(fReturnType);

View File

@ -184,7 +184,6 @@ public class ECJSourceModuleTranslator implements SourceModuleTranslator {
}
String[] sourceFiles = sources.toArray(new String[ sources.size() ]);
@SuppressWarnings("deprecation")
final ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setResolveBindings(true);
parser.setEnvironment(libs, this.sources, null, false);

View File

@ -23,7 +23,7 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.deadCode=error
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error

View File

@ -172,7 +172,6 @@ public class JDTSourceModuleTranslator implements SourceModuleTranslator {
projectsFiles.get(proj).put(JavaCore.createCompilationUnitFrom(entry.getIFile()), entry);
}
@SuppressWarnings("deprecation")
final ASTParser parser = ASTParser.newParser(AST.JLS8);
for (final Map.Entry<IProject,Map<ICompilationUnit,EclipseSourceFileModule>> proj : projectsFiles.entrySet()) {

View File

@ -578,7 +578,6 @@ public class JdtUtil {
}
public static ASTNode getAST(IFile javaSourceFile) {
@SuppressWarnings("deprecation")
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(JavaCore.createCompilationUnitFrom(javaSourceFile));
parser.setProject(JavaCore.create(javaSourceFile.getProject()));