| @@ -613,7 +613,6 @@ public class DirectoryScanner | |||||
| * | * | ||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| public static void resetDefaultExcludes() { | public static void resetDefaultExcludes() { | ||||
| synchronized (defaultExcludes) { | synchronized (defaultExcludes) { | ||||
| defaultExcludes.clear(); | defaultExcludes.clear(); | ||||
| @@ -119,6 +119,7 @@ public class RuntimeConfigurable implements Serializable { | |||||
| } | } | ||||
| private static class EnableAttributeConsumer { | private static class EnableAttributeConsumer { | ||||
| @SuppressWarnings("unused") | |||||
| public void add(EnableAttribute b) { | public void add(EnableAttribute b) { | ||||
| // Ignore | // Ignore | ||||
| } | } | ||||
| @@ -176,7 +177,7 @@ public class RuntimeConfigurable implements Serializable { | |||||
| * false. | * false. | ||||
| * @since 1.9.1 | * @since 1.9.1 | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| @SuppressWarnings("deprecation") | |||||
| public boolean isEnabled(UnknownElement owner) { | public boolean isEnabled(UnknownElement owner) { | ||||
| if (!namespacedAttribute) { | if (!namespacedAttribute) { | ||||
| return true; | return true; | ||||
| @@ -38,6 +38,7 @@ public class SecureInputHandler extends DefaultInputHandler { | |||||
| * @param request the request to handle | * @param request the request to handle | ||||
| * @throws BuildException if not possible to read from console | * @throws BuildException if not possible to read from console | ||||
| */ | */ | ||||
| @SuppressWarnings("unused") | |||||
| public void handleInput(InputRequest request) throws BuildException { | public void handleInput(InputRequest request) throws BuildException { | ||||
| String prompt = getPrompt(request); | String prompt = getPrompt(request); | ||||
| do { | do { | ||||
| @@ -470,7 +470,6 @@ public final class Locator { | |||||
| * @exception MalformedURLException if the URLs for the files cannot be | * @exception MalformedURLException if the URLs for the files cannot be | ||||
| * formed. | * formed. | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| public static URL[] getLocationURLs(File location, | public static URL[] getLocationURLs(File location, | ||||
| final String... extensions) | final String... extensions) | ||||
| throws MalformedURLException { | throws MalformedURLException { | ||||
| @@ -44,6 +44,7 @@ public class Log4jListener implements BuildListener { | |||||
| */ | */ | ||||
| public Log4jListener() { | public Log4jListener() { | ||||
| // trigger the log4j initialization (if at all it's not yet initialized) | // trigger the log4j initialization (if at all it's not yet initialized) | ||||
| @SuppressWarnings("unused") | |||||
| final Logger log = Logger.getLogger(LOG_ANT); | final Logger log = Logger.getLogger(LOG_ANT); | ||||
| } | } | ||||
| @@ -601,7 +601,6 @@ public class Concat extends Task implements ResourceCollection { | |||||
| * input files. | * input files. | ||||
| * @since Ant 1.8.2 | * @since Ant 1.8.2 | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| public void setOverwrite(boolean forceOverwrite) { | public void setOverwrite(boolean forceOverwrite) { | ||||
| setForce(forceOverwrite); | setForce(forceOverwrite); | ||||
| } | } | ||||
| @@ -63,6 +63,7 @@ public class CopyPath extends Task { | |||||
| private File destDir; | private File destDir; | ||||
| // TODO not read, yet in a public setter | // TODO not read, yet in a public setter | ||||
| @SuppressWarnings("unused") | |||||
| private long granularity = FILE_UTILS.getFileTimestampGranularity(); | private long granularity = FILE_UTILS.getFileTimestampGranularity(); | ||||
| private boolean preserveLastModified = false; | private boolean preserveLastModified = false; | ||||
| @@ -706,7 +706,6 @@ public abstract class DefaultCompilerAdapter | |||||
| * @return true if JDK 9 | * @return true if JDK 9 | ||||
| * @since Ant 1.9.8 | * @since Ant 1.9.8 | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| protected boolean assumeJava9() { | protected boolean assumeJava9() { | ||||
| return assumeJava19(); | return assumeJava19(); | ||||
| } | } | ||||
| @@ -109,6 +109,7 @@ public class Message extends ProjectComponent { | |||||
| * @param ps The print stream to write to | * @param ps The print stream to write to | ||||
| * @throws IOException if an error occurs | * @throws IOException if an error occurs | ||||
| */ | */ | ||||
| @SuppressWarnings("resource") | |||||
| public void print(PrintStream ps) throws IOException { | public void print(PrintStream ps) throws IOException { | ||||
| // We need character encoding aware printing here. | // We need character encoding aware printing here. | ||||
| // So, using BufferedWriter over OutputStreamWriter instead of PrintStream | // So, using BufferedWriter over OutputStreamWriter instead of PrintStream | ||||
| @@ -375,7 +375,6 @@ public class XMLValidateTask extends Task { | |||||
| * we have created and wrapped a SAX1 parser. | * we have created and wrapped a SAX1 parser. | ||||
| * @return the new XMLReader. | * @return the new XMLReader. | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| protected XMLReader createXmlReader() { | protected XMLReader createXmlReader() { | ||||
| Object reader = null; | Object reader = null; | ||||
| if (readerClassName == null) { | if (readerClassName == null) { | ||||
| @@ -389,7 +389,6 @@ public class JDependTask extends Task { | |||||
| * @exception BuildException if an error occurs | * @exception BuildException if an error occurs | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| @SuppressWarnings("deprecated") | |||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| CommandlineJava commandline = new CommandlineJava(); | CommandlineJava commandline = new CommandlineJava(); | ||||
| @@ -628,7 +627,6 @@ public class JDependTask extends Task { | |||||
| return new ExecuteWatchdog(getTimeout()); | return new ExecuteWatchdog(getTimeout()); | ||||
| } | } | ||||
| @SuppressWarnings("deprecated") | |||||
| private Optional<Path> getWorkingPath() { | private Optional<Path> getWorkingPath() { | ||||
| Optional<Path> result = Optional.ofNullable(getClassespath()); | Optional<Path> result = Optional.ofNullable(getClassespath()); | ||||
| if (result.isPresent()) { | if (result.isPresent()) { | ||||
| @@ -1265,6 +1265,7 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| public void addFailure(final Test test, final AssertionFailedError t) { | public void addFailure(final Test test, final AssertionFailedError t) { | ||||
| testListener.addFailure(test, t); | testListener.addFailure(test, t); | ||||
| } | } | ||||
| @SuppressWarnings("unused") | |||||
| public void addFailure(final Test test, final Throwable t) { // pre-3.4 | public void addFailure(final Test test, final Throwable t) { // pre-3.4 | ||||
| if (t instanceof AssertionFailedError) { | if (t instanceof AssertionFailedError) { | ||||
| testListener.addFailure(test, (AssertionFailedError) t); | testListener.addFailure(test, (AssertionFailedError) t); | ||||
| @@ -295,6 +295,7 @@ public class JUnitLauncherTask extends Task { | |||||
| return new AntClassLoader(this.getClass().getClassLoader(), getProject(), this.classPath, true); | return new AntClassLoader(this.getClass().getClassLoader(), getProject(), this.classPath, true); | ||||
| } | } | ||||
| @SuppressWarnings("resource") | |||||
| private Optional<SwitchedStreamHandle> trySwitchSysOutErr(final TestRequest testRequest, final StreamType streamType) { | private Optional<SwitchedStreamHandle> trySwitchSysOutErr(final TestRequest testRequest, final StreamType streamType) { | ||||
| switch (streamType) { | switch (streamType) { | ||||
| case SYS_OUT: { | case SYS_OUT: { | ||||
| @@ -174,6 +174,7 @@ class LegacyPlainResultFormatter extends AbstractJUnitResultFormatter implements | |||||
| } | } | ||||
| } | } | ||||
| @SuppressWarnings("incomplete-switch") | |||||
| @Override | @Override | ||||
| public void executionFinished(final TestIdentifier testIdentifier, final TestExecutionResult testExecutionResult) { | public void executionFinished(final TestIdentifier testIdentifier, final TestExecutionResult testExecutionResult) { | ||||
| final long currentTime = System.currentTimeMillis(); | final long currentTime = System.currentTimeMillis(); | ||||
| @@ -272,6 +273,7 @@ class LegacyPlainResultFormatter extends AbstractJUnitResultFormatter implements | |||||
| } | } | ||||
| private final class Stats { | private final class Stats { | ||||
| @SuppressWarnings("unused") | |||||
| private final TestIdentifier testIdentifier; | private final TestIdentifier testIdentifier; | ||||
| private final AtomicLong numTestsRun = new AtomicLong(0); | private final AtomicLong numTestsRun = new AtomicLong(0); | ||||
| private final AtomicLong numTestsFailed = new AtomicLong(0); | private final AtomicLong numTestsFailed = new AtomicLong(0); | ||||
| @@ -124,6 +124,7 @@ class LegacyXmlResultFormatter extends AbstractJUnitResultFormatter implements T | |||||
| } | } | ||||
| private final class Stats { | private final class Stats { | ||||
| @SuppressWarnings("unused") | |||||
| private final TestIdentifier testIdentifier; | private final TestIdentifier testIdentifier; | ||||
| private final long startedAt; | private final long startedAt; | ||||
| private long endedAt; | private long endedAt; | ||||
| @@ -198,7 +198,6 @@ public class TarResource extends ArchiveResource { | |||||
| return (TarResource) super.getCheckedRef(); | return (TarResource) super.getCheckedRef(); | ||||
| } | } | ||||
| @SuppressWarnings("deprecated") | |||||
| private void setEntry(TarEntry e) { | private void setEntry(TarEntry e) { | ||||
| if (e == null) { | if (e == null) { | ||||
| setExists(false); | setExists(false); | ||||
| @@ -279,7 +279,6 @@ public final class JavaEnvUtils { | |||||
| * @return true if the version of Java is the same as the given version. | * @return true if the version of Java is the same as the given version. | ||||
| * @since Ant 1.5 | * @since Ant 1.5 | ||||
| */ | */ | ||||
| @SuppressWarnings("deprecated") | |||||
| public static boolean isJavaVersion(String version) { | public static boolean isJavaVersion(String version) { | ||||
| return javaVersion.equals(version) | return javaVersion.equals(version) | ||||
| || (javaVersion.equals(JAVA_9) && JAVA_1_9.equals(version)); | || (javaVersion.equals(JAVA_9) && JAVA_1_9.equals(version)); | ||||
| @@ -117,6 +117,7 @@ class BlockSort { | |||||
| private static final int FALLBACK_QSORT_STACK_SIZE = 100; | private static final int FALLBACK_QSORT_STACK_SIZE = 100; | ||||
| @SuppressWarnings("unused") | |||||
| private static final int STACK_SIZE = | private static final int STACK_SIZE = | ||||
| QSORT_STACK_SIZE < FALLBACK_QSORT_STACK_SIZE | QSORT_STACK_SIZE < FALLBACK_QSORT_STACK_SIZE | ||||
| ? FALLBACK_QSORT_STACK_SIZE : QSORT_STACK_SIZE; | ? FALLBACK_QSORT_STACK_SIZE : QSORT_STACK_SIZE; | ||||
| @@ -800,7 +800,7 @@ public class IntrospectionHelperTest { | |||||
| } | } | ||||
| } | } | ||||
| public List<Object> add(List l) { | |||||
| public List<Object> add(List<Object> l) { | |||||
| // INVALID extension point | // INVALID extension point | ||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -258,6 +258,7 @@ public class XmlPropertyTest { | |||||
| /** | /** | ||||
| * Debugging method to print the properties in the given hashtable | * Debugging method to print the properties in the given hashtable | ||||
| */ | */ | ||||
| @SuppressWarnings("unused") | |||||
| private static void printProperties(Hashtable<Object, Object> xmlproperties) { | private static void printProperties(Hashtable<Object, Object> xmlproperties) { | ||||
| xmlproperties.forEach((key, value) -> System.out.println(key + " = " + value)); | xmlproperties.forEach((key, value) -> System.out.println(key + " = " + value)); | ||||
| } | } | ||||
| @@ -127,7 +127,7 @@ public class JavaEnvUtilsTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| @SuppressWarnings("deprecated") | |||||
| @SuppressWarnings("deprecation") | |||||
| public void isJavaVersionSupportsBothVersionsOfJava9() { | public void isJavaVersionSupportsBothVersionsOfJava9() { | ||||
| assumeTrue(JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_9)); | assumeTrue(JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_9)); | ||||
| assertTrue("JAVA_1_9 is not considered equal to JAVA_9", | assertTrue("JAVA_1_9 is not considered equal to JAVA_9", | ||||
| @@ -135,7 +135,7 @@ public class JavaEnvUtilsTest { | |||||
| } | } | ||||
| @Test | @Test | ||||
| @SuppressWarnings("deprecated") | |||||
| @SuppressWarnings("deprecation") | |||||
| public void java10IsDetectedProperly() { | public void java10IsDetectedProperly() { | ||||
| assumeTrue("10".equals(System.getProperty("java.specification.version"))); | assumeTrue("10".equals(System.getProperty("java.specification.version"))); | ||||
| assertEquals("10", JavaEnvUtils.getJavaVersion()); | assertEquals("10", JavaEnvUtils.getJavaVersion()); | ||||