diff options
author | Jay Arthanareeswaran | 2020-09-23 02:52:11 +0000 |
---|---|---|
committer | Jay Arthanareeswaran | 2020-09-23 02:52:11 +0000 |
commit | e7fbffe57eba5cf25acd0a5514843b11cfe75c98 (patch) | |
tree | af0cb8225fb608fd74a81377bee8290531d4aca7 | |
parent | 6d6b8cebaca19dfc3cb6c41dd715ea9f85fa8652 (diff) | |
download | eclipse.jdt.core-e7fbffe57eba5cf25acd0a5514843b11cfe75c98.tar.gz eclipse.jdt.core-e7fbffe57eba5cf25acd0a5514843b11cfe75c98.tar.xz eclipse.jdt.core-e7fbffe57eba5cf25acd0a5514843b11cfe75c98.zip |
Fix warnings due to deprecate API and unused suppress warningsY20201025-1200Y20201024-1200Y20201023-1200Y20201021-1200Y20201020-1200Y20201019-1200Y20201018-1200Y20201017-1200Y20201016-1200Y20201015-1200Y20201014-1200Y20201013-1200Y20201012-1200Y20201011-1200Y20201010-1200Y20201009-1200Y20201008-1200Y20201006-1200Y20201002-1200Y20201001-1200Y20200930-1200Y20200929-1200Y20200929-0550Y20200928-1200Y20200928-0700Y20200928-0600
annotations
Change-Id: I19a9d2ce5c55eb568de6066a8ddbf98a55ddb31e
Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
5 files changed, 19 insertions, 7 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java index 5816ad808a..c6cdf92db7 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java @@ -138,7 +138,6 @@ public abstract class AbstractRegressionTest extends AbstractCompilerTest implem ASTVisitor visitor; - @SuppressWarnings("synthetic-access") protected void runConformTest() { runTest(this.shouldFlushOutputDirectory, this.testFiles, @@ -164,7 +163,6 @@ public abstract class AbstractRegressionTest extends AbstractCompilerTest implem this.skipJavac ? JavacTestOptions.SKIP : this.javacTestOptions); } - @SuppressWarnings("synthetic-access") protected void runNegativeTest() { runTest(this.shouldFlushOutputDirectory, this.testFiles, @@ -190,7 +188,6 @@ public abstract class AbstractRegressionTest extends AbstractCompilerTest implem this.skipJavac ? JavacTestOptions.SKIP : this.javacTestOptions); } - @SuppressWarnings("synthetic-access") protected void runWarningTest() { runTest(this.shouldFlushOutputDirectory, this.testFiles, diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalStaticsTest_15.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalStaticsTest_15.java index 848fb0ecfe..0f8744558c 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalStaticsTest_15.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LocalStaticsTest_15.java @@ -92,7 +92,6 @@ public class LocalStaticsTest_15 extends AbstractRegressionTest { runner.runWarningTest(); } - @SuppressWarnings("unused") private static void verifyClassFile(String expectedOutput, String classFileName, int mode) throws IOException, ClassFormatException { File f = new File(OUTPUT_DIR + File.separator + classFileName); diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java index 102ee6d844..0f292878e1 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/target/CodeSnippetRunner.java @@ -148,7 +148,7 @@ private String className(byte[] classDefinition) { Object createCodeSnippet(Class snippetClass) { Object object = null; try { - object = snippetClass.newInstance(); + object = snippetClass.getDeclaredConstructor().newInstance(); } catch (InstantiationException e) { e.printStackTrace(); this.ide.sendResult(void.class, null); @@ -157,6 +157,22 @@ Object createCodeSnippet(Class snippetClass) { e.printStackTrace(); this.ide.sendResult(void.class, null); return null; + } catch (IllegalArgumentException e) { + e.printStackTrace(); + this.ide.sendResult(void.class, null); + return null; + } catch (InvocationTargetException e) { + e.printStackTrace(); + this.ide.sendResult(void.class, null); + return null; + } catch (NoSuchMethodException e) { + e.printStackTrace(); + this.ide.sendResult(void.class, null); + return null; + } catch (SecurityException e) { + e.printStackTrace(); + this.ide.sendResult(void.class, null); + return null; } return object; } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java index 5da30c5524..2a3ac760ec 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/AbstractCompilerTest.java @@ -209,7 +209,7 @@ public class AbstractCompilerTest extends TestCase { TestSuite complianceSuite = null; try { Constructor constructor = setupClass.getConstructor(new Class[]{long.class}); - complianceSuite = (TestSuite)constructor.newInstance(new Object[]{new Long(complianceLevel)}); + complianceSuite = (TestSuite)constructor.newInstance(new Object[]{Long.valueOf(complianceLevel)}); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InstantiationException e) { diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java index 7f24beb499..eb8cd3aaf6 100644 --- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java +++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java @@ -53,7 +53,7 @@ import org.eclipse.text.edits.TextEdit; * @noinstantiate This class is not intended to be instantiated by clients. * @noextend This class is not intended to be subclassed by clients. */ -@SuppressWarnings({"rawtypes", "unchecked"}) +@SuppressWarnings({"rawtypes"}) public class CodeFormatterApplication implements IApplication { /** |