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

Commit b84c4de

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

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-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.6</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: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@
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.ArrayUtils;
57+
import org.apache.commons.lang3.ClassUtils;
58+
import org.apache.commons.lang3.JavaVersion;
59+
import org.apache.commons.lang3.SystemUtils;
5860
import org.apache.maven.artifact.Artifact;
5961
import org.apache.maven.artifact.factory.ArtifactFactory;
6062
import org.apache.maven.artifact.handler.ArtifactHandler;
@@ -288,6 +290,8 @@ public abstract class AbstractJavadocMojo
288290
*/
289291
private static final float SINCE_JAVADOC_1_8 = 1.8f;
290292

293+
private static final float JAVA_VERSION_FLOAT = JavadocUtil.parseJavadocVersion(SystemUtils.JAVA_VERSION);
294+
291295
// ----------------------------------------------------------------------
292296
// Mojo components
293297
// ----------------------------------------------------------------------
@@ -3632,7 +3636,7 @@ private String getJavadocExecutable()
36323636
}
36333637
// For Apple's JDK 1.6.x (and older?) on Mac OSX
36343638
// CHECKSTYLE_OFF: MagicNumber
3635-
else if ( SystemUtils.IS_OS_MAC_OSX && SystemUtils.JAVA_VERSION_FLOAT < 1.7f )
3639+
else if ( SystemUtils.IS_OS_MAC_OSX && !SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7) )
36363640
// CHECKSTYLE_ON: MagicNumber
36373641
{
36383642
javadocExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", javadocCommand );
@@ -3693,27 +3697,27 @@ private void setFJavadocVersion( File jExecutable )
36933697
if ( getLog().isWarnEnabled() )
36943698
{
36953699
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 );
3700+
getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION_FLOAT );
36973701
}
3698-
jVersion = SystemUtils.JAVA_VERSION_FLOAT;
3702+
jVersion = JAVA_VERSION_FLOAT;
36993703
}
37003704
catch ( CommandLineException e )
37013705
{
37023706
if ( getLog().isWarnEnabled() )
37033707
{
37043708
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 );
3709+
getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION_FLOAT );
37063710
}
3707-
jVersion = SystemUtils.JAVA_VERSION_FLOAT;
3711+
jVersion = JAVA_VERSION_FLOAT;
37083712
}
37093713
catch ( IllegalArgumentException e )
37103714
{
37113715
if ( getLog().isWarnEnabled() )
37123716
{
37133717
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 );
3718+
getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION_FLOAT );
37153719
}
3716-
jVersion = SystemUtils.JAVA_VERSION_FLOAT;
3720+
jVersion = JAVA_VERSION_FLOAT;
37173721
}
37183722

37193723
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)