cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [cxf-fediz] 01/04: Upgrading PMD + Errorprone
Date Tue, 11 Dec 2018 14:58:15 GMT
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git

commit 2572410db364c6b24bcd4e41366d01feab68bb2e
Author: Colm O hEigeartaigh <coheigea@apache.org>
AuthorDate: Tue Dec 11 13:45:22 2018 +0000

    Upgrading PMD + Errorprone
---
 .../cxf/fediz/core/util/ClassLoaderUtils.java      |  2 +-
 .../fediz/core/federation/TestSigninHandler.java   |  4 +-
 pom.xml                                            | 46 +++++++++++-----------
 .../service/idp/beans/CommonsURLValidator.java     |  2 +-
 .../oidc/clients/ClientRegistrationService.java    |  2 +-
 5 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/ClassLoaderUtils.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/ClassLoaderUtils.java
index 1c1fbfe..9a42faa 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/ClassLoaderUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/ClassLoaderUtils.java
@@ -75,7 +75,7 @@ public final class ClassLoaderUtils {
     public static ClassLoader getURLClassLoader(
         final List<URL> urlList, final ClassLoader parent
     ) {
-        return getURLClassLoader(urlList.toArray(new URL[urlList.size()]), parent);
+        return getURLClassLoader(urlList.toArray(new URL[0]), parent);
     }
 
     /**
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
index b7a5802..60ba1a4 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
@@ -51,10 +51,8 @@ public class TestSigninHandler extends SigninHandler<FedizPrincipal>
{
         }
 
         // proceed creating the JAAS Subject
-        FedizPrincipal principal = new FederationPrincipalImpl(wfRes.getUsername(), roles,
+        return new FederationPrincipalImpl(wfRes.getUsername(), roles,
                                                                wfRes.getClaims(), wfRes.getToken());
-
-        return principal;
     }
 
     private static class FederationPrincipalImpl implements FedizPrincipal {
diff --git a/pom.xml b/pom.xml
index c89c072..b8d2f58 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,7 +44,7 @@
         <commons.text.version>1.6</commons.text.version>
         <commons.validator.version>1.6</commons.validator.version>
         <cxf.version>3.2.7</cxf.version>
-        <cxf.build-utils.version>3.4.0</cxf.build-utils.version>
+        <cxf.build-utils.version>3.4.1</cxf.build-utils.version>
         <dbcp.version>2.1.1</dbcp.version>
         <easymock.version>4.0.1</easymock.version>
         <ehcache.version>2.10.6</ehcache.version>
@@ -309,28 +309,18 @@
                     <configuration>
                         <source>${jdk.version}</source>
                         <target>${jdk.version}</target>
-                        <maxmem>256M</maxmem>
-                        <fork>${cxf.compiler.fork}</fork>
-                        <encoding>UTF-8</encoding>
-                        <showDeprecation>true</showDeprecation>
-                        <compilerArgument>${fediz.compile.flags}</compilerArgument>
-                        <compilerId>javac-with-errorprone</compilerId>
-                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
+                        <compilerArgs>
+                            <arg>-XDcompilePolicy=simple</arg>
+                            <arg>-Xplugin:ErrorProne</arg>
+                        </compilerArgs>
+                        <annotationProcessorPaths>
+                            <path>
+                                <groupId>com.google.errorprone</groupId>
+                                <artifactId>error_prone_core</artifactId>
+                                <version>2.3.2</version>
+                            </path>
+                        </annotationProcessorPaths>
                     </configuration>
-                    <dependencies>
-                        <dependency>
-                            <groupId>org.codehaus.plexus</groupId>
-                            <artifactId>plexus-compiler-javac-errorprone</artifactId>
-                            <version>2.8</version>
-                        </dependency>
-                        <!-- override plexus-compiler-javac-errorprone's dependency on
-                             Error Prone with the latest version -->
-                        <dependency>
-                            <groupId>com.google.errorprone</groupId>
-                            <artifactId>error_prone_core</artifactId>
-                            <version>2.1.1</version>
-                        </dependency>
-                    </dependencies>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -503,7 +493,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-pmd-plugin</artifactId>
-                    <version>3.5</version>
+                    <version>3.11.0</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>
@@ -721,6 +711,16 @@
                                 </additionalJOptions>
                             </configuration>
                         </plugin>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-compiler-plugin</artifactId>
+                            <configuration>
+                                <fork>true</fork>
+                                <compilerArgs combine.children="append">
+                                    <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar</arg>
+                                </compilerArgs>
+                            </configuration>
+                        </plugin>
                     </plugins>
                 </pluginManagement>
             </build>
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/CommonsURLValidator.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/CommonsURLValidator.java
index 2fca9f6..03f4859 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/CommonsURLValidator.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/CommonsURLValidator.java
@@ -56,7 +56,7 @@ public class CommonsURLValidator {
         // Support additional top level domains
         if (additionalTLDs != null && !additionalTLDs.isEmpty()) {
             try {
-                String[] tldsToAddArray = additionalTLDs.toArray(new String[additionalTLDs.size()]);
+                String[] tldsToAddArray = additionalTLDs.toArray(new String[0]);
                 LOG.info("Adding the following additional Top Level Domains: " + Arrays.toString(tldsToAddArray));
                 DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, tldsToAddArray);
             } catch (IllegalStateException ex) {
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
index 964143a..6539b4a 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
@@ -524,7 +524,7 @@ public class ClientRegistrationService {
         // Support additional top level domains
         if (additionalTLDs != null && !additionalTLDs.isEmpty()) {
             try {
-                String[] tldsToAddArray = additionalTLDs.toArray(new String[additionalTLDs.size()]);
+                String[] tldsToAddArray = additionalTLDs.toArray(new String[0]);
                 LOG.info("Adding the following additional Top Level Domains: " + Arrays.toString(tldsToAddArray));
                 DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, tldsToAddArray);
             } catch (IllegalStateException ex) {


Mime
View raw message