Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 8bcb344

Browse files
committed
MJAVADOC-485 Upgrade to commons-lang3
Patch for https://issues.apache.org/jira/browse/MJAVADOC-485
1 parent cc9ae77 commit 8bcb344

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

maven-javadoc-plugin/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ under the License.
193193

194194
<!-- misc -->
195195
<dependency>
196-
<groupId>commons-lang</groupId>
197-
<artifactId>commons-lang</artifactId>
198-
<version>2.6</version>
196+
<groupId>org.apache.commons</groupId>
197+
<artifactId>commons-lang3</artifactId>
198+
<version>3.5</version>
199199
</dependency>
200200
<dependency>
201201
<groupId>commons-io</groupId>

maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractFixJavadocMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import com.thoughtworks.qdox.model.TypeVariable;
3333
import com.thoughtworks.qdox.parser.ParseException;
3434
import org.apache.commons.io.IOUtils;
35-
import org.apache.commons.lang.ClassUtils;
35+
import org.apache.commons.lang3.ClassUtils;
3636
import org.apache.maven.artifact.Artifact;
3737
import org.apache.maven.artifact.DependencyResolutionRequiredException;
3838
import org.apache.maven.artifact.repository.ArtifactRepository;

maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@
5353
import java.util.Set;
5454
import java.util.StringTokenizer;
5555

56-
import org.apache.commons.lang.ClassUtils;
57-
import org.apache.commons.lang.SystemUtils;
56+
import org.apache.commons.lang3.ClassUtils;
57+
import org.apache.commons.lang3.JavaVersion;
58+
import org.apache.commons.lang3.SystemUtils;
5859
import org.apache.maven.artifact.Artifact;
5960
import org.apache.maven.artifact.factory.ArtifactFactory;
6061
import org.apache.maven.artifact.handler.ArtifactHandler;
@@ -288,6 +289,8 @@ public abstract class AbstractJavadocMojo
288289
*/
289290
private static final float SINCE_JAVADOC_1_8 = 1.8f;
290291

292+
private static final float JAVA_VERSION_FLOAT = JavadocUtil.parseJavadocVersion(SystemUtils.JAVA_VERSION);
293+
291294
// ----------------------------------------------------------------------
292295
// Mojo components
293296
// ----------------------------------------------------------------------
@@ -3632,7 +3635,7 @@ private String getJavadocExecutable()
36323635
}
36333636
// For Apple's JDK 1.6.x (and older?) on Mac OSX
36343637
// CHECKSTYLE_OFF: MagicNumber
3635-
else if ( SystemUtils.IS_OS_MAC_OSX && SystemUtils.JAVA_VERSION_FLOAT < 1.7f )
3638+
else if ( SystemUtils.IS_OS_MAC_OSX && !SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7) )
36363639
// CHECKSTYLE_ON: MagicNumber
36373640
{
36383641
javadocExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", javadocCommand );
@@ -3693,27 +3696,27 @@ private void setFJavadocVersion( File jExecutable )
36933696
if ( getLog().isWarnEnabled() )
36943697
{
36953698
getLog().warn( "Unable to find the javadoc version: " + e.getMessage() );
3696-
getLog().warn( "Using the Java version instead of, i.e. " + SystemUtils.JAVA_VERSION_FLOAT );
3699+
getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION_FLOAT );
36973700
}
3698-
jVersion = SystemUtils.JAVA_VERSION_FLOAT;
3701+
jVersion = JAVA_VERSION_FLOAT;
36993702
}
37003703
catch ( CommandLineException e )
37013704
{
37023705
if ( getLog().isWarnEnabled() )
37033706
{
37043707
getLog().warn( "Unable to find the javadoc version: " + e.getMessage() );
3705-
getLog().warn( "Using the Java version instead of, i.e. " + SystemUtils.JAVA_VERSION_FLOAT );
3708+
getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION_FLOAT );
37063709
}
3707-
jVersion = SystemUtils.JAVA_VERSION_FLOAT;
3710+
jVersion = JAVA_VERSION_FLOAT;
37083711
}
37093712
catch ( IllegalArgumentException e )
37103713
{
37113714
if ( getLog().isWarnEnabled() )
37123715
{
37133716
getLog().warn( "Unable to find the javadoc version: " + e.getMessage() );
3714-
getLog().warn( "Using the Java version instead of, i.e. " + SystemUtils.JAVA_VERSION_FLOAT );
3717+
getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION_FLOAT );
37153718
}
3716-
jVersion = SystemUtils.JAVA_VERSION_FLOAT;
3719+
jVersion = JAVA_VERSION_FLOAT;
37173720
}
37183721

37193722
if ( StringUtils.isNotEmpty( javadocVersion ) )

maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* under the License.
2020
*/
2121

22-
import org.apache.commons.lang.SystemUtils;
22+
import org.apache.commons.lang3.SystemUtils;
2323
import org.apache.http.HttpHost;
2424
import org.apache.http.HttpResponse;
2525
import org.apache.http.HttpStatus;

maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import java.util.List;
3232
import java.util.Map;
3333

34-
import org.apache.commons.lang.SystemUtils;
34+
import org.apache.commons.lang3.SystemUtils;
3535
import org.apache.maven.execution.MavenSession;
3636
import org.apache.maven.model.Plugin;
3737
import org.apache.maven.plugin.LegacySupport;

maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocUtilTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import java.util.Map;
3131
import java.util.regex.PatternSyntaxException;
3232

33-
import org.apache.commons.lang.builder.EqualsBuilder;
33+
import org.apache.commons.lang3.builder.EqualsBuilder;
3434
import org.apache.maven.plugin.javadoc.ProxyServer.AuthAsyncProxyServlet;
3535
import org.apache.maven.settings.Proxy;
3636
import org.apache.maven.settings.Settings;

0 commit comments

Comments
 (0)