diff --git a/src/java/org/apache/ivy/Main.java b/src/java/org/apache/ivy/Main.java index 5d89bfb1..516448ee 100644 --- a/src/java/org/apache/ivy/Main.java +++ b/src/java/org/apache/ivy/Main.java @@ -58,7 +58,6 @@ import org.apache.ivy.util.cli.ParseException; import org.apache.ivy.util.filter.FilterHelper; import org.apache.ivy.util.url.CredentialsStore; import org.apache.ivy.util.url.TimeoutConstrainedURLHandler; -import org.apache.ivy.util.url.URLHandler; import org.apache.ivy.util.url.URLHandlerDispatcher; import org.apache.ivy.util.url.URLHandlerRegistry; diff --git a/src/java/org/apache/ivy/ant/IvyAntSettings.java b/src/java/org/apache/ivy/ant/IvyAntSettings.java index 10929e8c..7842afb8 100644 --- a/src/java/org/apache/ivy/ant/IvyAntSettings.java +++ b/src/java/org/apache/ivy/ant/IvyAntSettings.java @@ -31,7 +31,6 @@ import org.apache.ivy.core.settings.IvyVariableContainer; import org.apache.ivy.util.Message; import org.apache.ivy.util.url.CredentialsStore; import org.apache.ivy.util.url.TimeoutConstrainedURLHandler; -import org.apache.ivy.util.url.URLHandler; import org.apache.ivy.util.url.URLHandlerDispatcher; import org.apache.ivy.util.url.URLHandlerRegistry; import org.apache.tools.ant.BuildException; diff --git a/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java b/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java index 3633a960..f55e38ca 100644 --- a/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java +++ b/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java @@ -47,7 +47,7 @@ import org.apache.ivy.util.Configurator; import org.apache.ivy.util.FileResolver; import org.apache.ivy.util.Message; import org.apache.ivy.util.url.CredentialsStore; -import org.apache.ivy.util.url.URLHandler; +import org.apache.ivy.util.url.TimeoutConstrainedURLHandler; import org.apache.ivy.util.url.URLHandlerRegistry; import org.xml.sax.Attributes; import org.xml.sax.InputSource; @@ -373,9 +373,9 @@ public class XmlSettingsParser extends DefaultHandler { String requestMethod = attributes.get("httpRequestMethod"); if ("head".equalsIgnoreCase(requestMethod)) { - URLHandlerRegistry.getHttp().setRequestMethod(URLHandler.REQUEST_METHOD_HEAD); + URLHandlerRegistry.getHttp().setRequestMethod(TimeoutConstrainedURLHandler.REQUEST_METHOD_HEAD); } else if ("get".equalsIgnoreCase(requestMethod)) { - URLHandlerRegistry.getHttp().setRequestMethod(URLHandler.REQUEST_METHOD_GET); + URLHandlerRegistry.getHttp().setRequestMethod(TimeoutConstrainedURLHandler.REQUEST_METHOD_GET); } else if (!isNullOrEmpty(requestMethod)) { throw new IllegalArgumentException( "Invalid httpRequestMethod specified, must be one of {'HEAD', 'GET'}"); diff --git a/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java b/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java index 405f877b..35ac55b2 100644 --- a/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java +++ b/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java @@ -32,7 +32,7 @@ import org.apache.oro.text.regex.Perl5Matcher; * *

* NOTE: this matcher is available only with - * Apache Jakarta Oro 2.0.8 + * Apache Jakarta ORO 2.0.8 * in your classpath. *

* diff --git a/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java b/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java index a3295601..5aba146f 100644 --- a/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java +++ b/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java @@ -131,11 +131,9 @@ public final class PomModuleDescriptorParser implements ModuleDescriptorParser { try { final IvyContext ivyContext = IvyContext.pushNewCopyContext(); - @SuppressWarnings("unchecked") - HashSet parents = (HashSet) ivyContext - .get(PARENT_MAP_KEY); + HashSet parents = ivyContext.get(PARENT_MAP_KEY); if (parents == null) { - parents = new LinkedHashSet(); + parents = new LinkedHashSet<>(); ivyContext.set(PARENT_MAP_KEY, parents); } diff --git a/src/java/org/apache/ivy/util/url/BasicURLHandler.java b/src/java/org/apache/ivy/util/url/BasicURLHandler.java index 1a1e8ee6..0ffd0a4c 100644 --- a/src/java/org/apache/ivy/util/url/BasicURLHandler.java +++ b/src/java/org/apache/ivy/util/url/BasicURLHandler.java @@ -92,7 +92,7 @@ public class BasicURLHandler extends AbstractURLHandler implements TimeoutConstr con.setRequestProperty("User-Agent", getUserAgent()); if (con instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) con; - if (getRequestMethod() == URLHandler.REQUEST_METHOD_HEAD) { + if (getRequestMethod() == TimeoutConstrainedURLHandler.REQUEST_METHOD_HEAD) { httpCon.setRequestMethod("HEAD"); } if (checkStatusCode(normalizedURL, httpCon)) { diff --git a/src/java/org/apache/ivy/util/url/HttpClientHandler.java b/src/java/org/apache/ivy/util/url/HttpClientHandler.java index 3ecbfb08..b8bff16f 100644 --- a/src/java/org/apache/ivy/util/url/HttpClientHandler.java +++ b/src/java/org/apache/ivy/util/url/HttpClientHandler.java @@ -223,7 +223,7 @@ public class HttpClientHandler extends AbstractURLHandler implements TimeoutCons CloseableHttpResponse response = null; try { final String httpMethod; - if (getRequestMethod() == URLHandler.REQUEST_METHOD_HEAD) { + if (getRequestMethod() == TimeoutConstrainedURLHandler.REQUEST_METHOD_HEAD) { httpMethod = HttpHead.METHOD_NAME; response = doHead(url, connectionTimeout, readTimeout); } else { diff --git a/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java b/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java index 9f195e05..5ade5c89 100644 --- a/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java +++ b/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java @@ -39,7 +39,7 @@ public final class URLHandlerRegistry { } /** - * This method is used to get appropriate http downloader depending on Jakarta Commons + * This method is used to get appropriate http downloader depending on HttpComponents * HttpClient availability in classpath, or simply use jdk url handling in other cases. * * @return most accurate http downloader diff --git a/test/java/org/apache/ivy/TestHelper.java b/test/java/org/apache/ivy/TestHelper.java index 6f0b0fb3..76846f9f 100644 --- a/test/java/org/apache/ivy/TestHelper.java +++ b/test/java/org/apache/ivy/TestHelper.java @@ -50,8 +50,6 @@ import org.apache.tools.ant.taskdefs.Delete; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.Field; -import java.net.Authenticator; import java.net.InetSocketAddress; import java.nio.file.Path; import java.util.ArrayList; diff --git a/test/java/org/apache/ivy/core/resolve/ResolveTest.java b/test/java/org/apache/ivy/core/resolve/ResolveTest.java index dce0ecd7..65870f75 100644 --- a/test/java/org/apache/ivy/core/resolve/ResolveTest.java +++ b/test/java/org/apache/ivy/core/resolve/ResolveTest.java @@ -6296,7 +6296,7 @@ public class ResolveTest { * Tests that if a pom.xml has multiple dependencies for the same module, but for different Maven classifiers, * then the resolution of such dependencies, preserves those multiple (Ivy) artifacts against the dependency * - * @throws Exception + * @throws Exception if something goes wrong * @see IVY-1576 for more details */ @Test diff --git a/test/java/org/apache/ivy/core/settings/OnlineXmlSettingsParserTest.java b/test/java/org/apache/ivy/core/settings/OnlineXmlSettingsParserTest.java index 93623fa7..1fd5603d 100644 --- a/test/java/org/apache/ivy/core/settings/OnlineXmlSettingsParserTest.java +++ b/test/java/org/apache/ivy/core/settings/OnlineXmlSettingsParserTest.java @@ -22,7 +22,7 @@ import java.net.URL; import org.apache.ivy.plugins.resolver.ChainResolver; import org.apache.ivy.plugins.resolver.DependencyResolver; import org.apache.ivy.plugins.resolver.IvyRepResolver; -import org.apache.ivy.util.url.URLHandler; +import org.apache.ivy.util.url.TimeoutConstrainedURLHandler; import org.apache.ivy.util.url.URLHandlerDispatcher; import org.apache.ivy.util.url.URLHandlerRegistry; @@ -95,7 +95,7 @@ public class OnlineXmlSettingsParserTest { private void configureURLHandler() { URLHandlerDispatcher dispatcher = new URLHandlerDispatcher(); - URLHandler httpHandler = URLHandlerRegistry.getHttp(); + TimeoutConstrainedURLHandler httpHandler = URLHandlerRegistry.getHttp(); dispatcher.setDownloader("http", httpHandler); dispatcher.setDownloader("https", httpHandler); URLHandlerRegistry.setDefault(dispatcher); diff --git a/test/java/org/apache/ivy/plugins/parser/m2/MavenVersionRangeParserTest.java b/test/java/org/apache/ivy/plugins/parser/m2/MavenVersionRangeParserTest.java index 1ac141ac..ed610b7d 100644 --- a/test/java/org/apache/ivy/plugins/parser/m2/MavenVersionRangeParserTest.java +++ b/test/java/org/apache/ivy/plugins/parser/m2/MavenVersionRangeParserTest.java @@ -31,7 +31,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when the range * and the value being compared are the same exact values * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testExactValue() throws Exception { @@ -44,7 +44,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code (,1.0]} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testLessThanEqualBoundRange() throws Exception { @@ -65,7 +65,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code (,1.0)} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testLessThanBoundRange() throws Exception { @@ -86,7 +86,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code [1.0]} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testEqualsBoundRange() throws Exception { @@ -99,7 +99,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code [1.0,)} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testGreaterThanEqualBoundRange() throws Exception { @@ -121,7 +121,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code (1.0,)} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testGreaterThanBoundRange() throws Exception { @@ -141,7 +141,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code (,1.0],[1.2,)} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testMultiRange() throws Exception { @@ -162,7 +162,7 @@ public class MavenVersionRangeParserTest { * Tests the {@link MavenVersionRangeParser#rangeAccepts(String, String)} works correctly when a range of the form * {@code (,1.1),(1.1,)} is used to compare against some value. * - * @throws Exception + * @throws Exception if something goes wrong */ @Test public void testMultiRangeSpecificValue() throws Exception { diff --git a/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java b/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java index 92b25b57..656b1549 100644 --- a/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java +++ b/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java @@ -1149,7 +1149,7 @@ public class PomModuleDescriptorParserTest extends AbstractModuleDescriptorParse * Tests that the {@code properties} setup in the Maven {@code profiles} that are conditionally activated, * become available to the module being parsed and such properties can be used as references within the pom * - * @throws Exception + * @throws Exception if something goes wrong * @see IVY-1577 for more details */ @Test diff --git a/test/java/org/apache/ivy/util/url/AbstractURLHandlerTest.java b/test/java/org/apache/ivy/util/url/AbstractURLHandlerTest.java index 2acdda9d..33644dcb 100644 --- a/test/java/org/apache/ivy/util/url/AbstractURLHandlerTest.java +++ b/test/java/org/apache/ivy/util/url/AbstractURLHandlerTest.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; -import org.apache.ivy.core.settings.TimeoutConstraint; import org.apache.ivy.util.CopyProgressListener; import org.junit.Test; diff --git a/test/java/org/apache/ivy/util/url/HttpclientURLHandlerTest.java b/test/java/org/apache/ivy/util/url/HttpclientURLHandlerTest.java index 0c0e2ccf..502eb6fa 100644 --- a/test/java/org/apache/ivy/util/url/HttpclientURLHandlerTest.java +++ b/test/java/org/apache/ivy/util/url/HttpclientURLHandlerTest.java @@ -102,7 +102,7 @@ public class HttpclientURLHandlerTest { URLInfo info = handler.getURLInfo(new URL(DEFAULT_M2_ROOT + "commons-lang/commons-lang/[1.0,3.0[/commons-lang-[1.0,3.0[.pom"), defaultTimeoutConstraint); - assertEquals(URLHandler.UNAVAILABLE, info); + assertEquals(TimeoutConstrainedURLHandler.UNAVAILABLE, info); } @Test diff --git a/test/java/org/apache/ivy/util/url/IvyAuthenticatorTest.java b/test/java/org/apache/ivy/util/url/IvyAuthenticatorTest.java index b27d6a07..4512b220 100644 --- a/test/java/org/apache/ivy/util/url/IvyAuthenticatorTest.java +++ b/test/java/org/apache/ivy/util/url/IvyAuthenticatorTest.java @@ -18,7 +18,6 @@ package org.apache.ivy.util.url; -import org.apache.ivy.TestHelper; import org.junit.After; import org.junit.Before; import org.junit.Test;