cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1332379 - in /cxf/fediz/trunk: ./ examples/wsclientWebapp/webapp/src/main/java/org/apache/cxf/fediz/example/ examples/wsclientWebapp/webservice/service/src/main/java/org/apache/cxf/fediz/examples/service/ plugins/core/src/main/java/org/apa...
Date Mon, 30 Apr 2012 20:51:15 GMT
Author: owulff
Date: Mon Apr 30 20:51:14 2012
New Revision: 1332379

URL: http://svn.apache.org/viewvc?rev=1332379&view=rev
Log:
Maven PMD plugin enabled and fixed PMD violations

Modified:
    cxf/fediz/trunk/examples/wsclientWebapp/webapp/src/main/java/org/apache/cxf/fediz/example/ThreadLocalCallbackHandler.java
    cxf/fediz/trunk/examples/wsclientWebapp/webservice/service/src/main/java/org/apache/cxf/fediz/examples/service/GreeterImpl.java
    cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
    cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
    cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationWriterTest.java
    cxf/fediz/trunk/pom.xml
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpSTSClient.java
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpServlet.java

Modified: cxf/fediz/trunk/examples/wsclientWebapp/webapp/src/main/java/org/apache/cxf/fediz/example/ThreadLocalCallbackHandler.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/examples/wsclientWebapp/webapp/src/main/java/org/apache/cxf/fediz/example/ThreadLocalCallbackHandler.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/examples/wsclientWebapp/webapp/src/main/java/org/apache/cxf/fediz/example/ThreadLocalCallbackHandler.java
(original)
+++ cxf/fediz/trunk/examples/wsclientWebapp/webapp/src/main/java/org/apache/cxf/fediz/example/ThreadLocalCallbackHandler.java
Mon Apr 30 20:51:14 2012
@@ -39,7 +39,7 @@ import org.apache.ws.security.util.DOM2W
  */ 
 public class ThreadLocalCallbackHandler implements CallbackHandler {
 
-    private static Logger log = LoggerFactory.getLogger(ThreadLocalCallbackHandler.class);
+    private final static Logger log = LoggerFactory.getLogger(ThreadLocalCallbackHandler.class);
 
 
     public void handle(Callback[] callbacks)

Modified: cxf/fediz/trunk/examples/wsclientWebapp/webservice/service/src/main/java/org/apache/cxf/fediz/examples/service/GreeterImpl.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/examples/wsclientWebapp/webservice/service/src/main/java/org/apache/cxf/fediz/examples/service/GreeterImpl.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/examples/wsclientWebapp/webservice/service/src/main/java/org/apache/cxf/fediz/examples/service/GreeterImpl.java
(original)
+++ cxf/fediz/trunk/examples/wsclientWebapp/webservice/service/src/main/java/org/apache/cxf/fediz/examples/service/GreeterImpl.java
Mon Apr 30 20:51:14 2012
@@ -17,16 +17,18 @@
 
 package org.apache.cxf.fediz.examples.service;
 
-import java.util.logging.Logger;
 import java.security.Principal;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import javax.annotation.Resource;
 import javax.xml.ws.WebServiceContext;
 import org.apache.hello_world_soap_http.Greeter;
 
 public class GreeterImpl implements Greeter {
 
-    private static final Logger LOG = Logger.getLogger(GreeterImpl.class.getPackage().getName());
+    private final static Logger LOG = LoggerFactory.getLogger(GreeterImpl.class.getPackage().getName());
 
     @Resource
     WebServiceContext context = null;

Modified: cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
(original)
+++ cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationContext.java
Mon Apr 30 20:51:14 2012
@@ -101,27 +101,26 @@ public class FederationContext {
 
     public URI getRoleURI() {
         ProtocolType pt = config.getProtocol();
-        if (pt != null && pt instanceof FederationProtocolType) {
+        if (pt == null) {
+            throw new IllegalConfigurationException("Missing ProtocolType");
+        }
+        if (pt instanceof FederationProtocolType) {
             try {
                 return new URI(((FederationProtocolType) pt).getRoleURI());
             } catch (URISyntaxException e) {
                 throw new IllegalConfigurationException("Invalid Role URI", e);
             }
         }
-        if (pt != null && !(pt instanceof FederationProtocolType)) {
+        else {
             throw new IllegalConfigurationException(
                     "Unknown Protocoltype, only FederationProtocolType is currently suported");
         }
-        if (pt == null) {
-            throw new IllegalConfigurationException("Missing ProtocolType");
-        }
-        return null;
 
     }
 
     public String getRoleDelimiter() {
         ProtocolType pt = config.getProtocol();
-        if (pt != null && pt instanceof FederationProtocolType) {
+        if (pt != null && (pt instanceof FederationProtocolType)) {
             return ((FederationProtocolType) pt).getRoleDelimiter();
         }
         throw new IllegalConfigurationException(
@@ -150,8 +149,7 @@ public class FederationContext {
                     "Only one Trusted Issuer Keystore supported");
         }
         TrustManagersType trustManager = managers.get(0);
-        KeyStoreType storeType = trustManager.getKeyStore();
-        return storeType;
+        return trustManager.getKeyStore();
     }
 
     public void setRelativePath(String relativePath) {

Modified: cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
(original)
+++ cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationTest.java
Mon Apr 30 20:51:14 2012
@@ -15,7 +15,6 @@ public class FedizConfigurationTest {
 
     private static final String ISSUER = "http://url_to_the_issuer";
     private static final String PROTOCOL_VERSION = "1.0.0";
-    private static final String REQUEST = "request value";
     private static final String REPLY = "reply value";
     private static final String TARGET_REALM = "target realm";
     private static final String HOME_REALM_CLASS = "org.apache.fediz.realm.MyHomeRealm.class";
@@ -167,8 +166,7 @@ public class FedizConfigurationTest {
         jaxbContext.createMarshaller().marshal(configOut, writer);
 
         StringReader reader = new StringReader(writer.toString());
-        FedizConfig configIn = (FedizConfig) jaxbContext.createUnmarshaller()
-                .unmarshal(reader);
+        jaxbContext.createUnmarshaller().unmarshal(reader);
     }
 
     @org.junit.Test

Modified: cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationWriterTest.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationWriterTest.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationWriterTest.java
(original)
+++ cxf/fediz/trunk/plugins/core/src/test/java/org/apache/cxf/fediz/core/config/FedizConfigurationWriterTest.java
Mon Apr 30 20:51:14 2012
@@ -19,7 +19,6 @@ public class FedizConfigurationWriterTes
 
     private static final String ISSUER = "http://url_to_the_issuer";
     private static final String PROTOCOL_VERSION = "1.0.0";
-    private static final String REQUEST = "request value";
     private static final String REPLY = "reply value";
     private static final String TARGET_REALM = "target realm";
     private static final String HOME_REALM_CLASS = "org.apache.fediz.realm.MyHomeRealm.class";
@@ -30,7 +29,6 @@ public class FedizConfigurationWriterTes
     private static final String KEYSTORE_FILE = "stsstore.jks";
 
     private static final String FILE_TYPE = "file";
-    private static final String RESOURCE_TYPE = "resource";
 
     private static final String KEYSTORE_PASSWORD = "stsspass";
     private static final String AUDIENCE_URI_1 = "http://host_one:port/url";
@@ -132,8 +130,7 @@ public class FedizConfigurationWriterTes
         jaxbContext.createMarshaller().marshal(configOut, writer);
 
         StringReader reader = new StringReader(writer.toString());
-        FedizConfig configIn = (FedizConfig) jaxbContext.createUnmarshaller()
-                .unmarshal(reader);
+        jaxbContext.createUnmarshaller().unmarshal(reader);
     }
 
     @org.junit.Test

Modified: cxf/fediz/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/pom.xml?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/pom.xml (original)
+++ cxf/fediz/trunk/pom.xml Mon Apr 30 20:51:14 2012
@@ -48,8 +48,6 @@
       <fediz.checkstyle.extension />
       <fediz.downloadSources>true</fediz.downloadSources>
 
-      <fediz.pmd.eclipse.ruleset>cxf-pmd-ruleset.xml</fediz.pmd.eclipse.ruleset>
-
       <fediz.resources.base.path />
    </properties>
 
@@ -113,7 +111,7 @@
                     <version>2.8</version>
                     <configuration>
                         <attach>true</attach>
-                        <source>1.5</source>
+                        <source>${jdk.version}</source>
                         <quiet>true</quiet>
                         <bottom>Apache Fediz</bottom>
                         <javadocVersion>1.5</javadocVersion>
@@ -138,8 +136,8 @@
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>2.3.2</version>
                     <configuration>
-                        <source>1.5</source>
-                        <target>1.5</target>
+                        <source>${jdk.version}</source>
+                        <target>${jdk.version}</target>
                         <maxmem>256M</maxmem>
                         <fork>${cxf.compiler.fork}</fork>
                         <encoding>UTF-8</encoding>
@@ -316,6 +314,7 @@
                         </execution>
                     </executions>
                 </plugin>
+-->
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-pmd-plugin</artifactId>
@@ -333,7 +332,7 @@
                             <ruleset>${fediz.resources.base.path}cxf-pmd-custom.xml</ruleset>
                         </rulesets>
                         <sourceEncoding>UTF-8</sourceEncoding>
-                        <targetJdk>1.5</targetJdk>
+                        <targetJdk>${jdk.version}</targetJdk>
                         <linkXRef>false</linkXRef>
                         <includeTests>true</includeTests>
                         <verbose>true</verbose>
@@ -351,7 +350,6 @@
                         </execution>
                     </executions>
                 </plugin>
--->
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
@@ -408,7 +406,6 @@
                 </plugin>
                 -->
 
-<!-- TODO
                 <plugin>
                   <groupId>org.apache.rat</groupId>
                   <artifactId>apache-rat-plugin</artifactId>
@@ -421,7 +418,7 @@
                           <exclude>.gitignore</exclude>
                           <exclude>velocity.log</exclude>
                           <exclude>**/target/**</exclude>
-                          <exclude>distribution/**</exclude>
+                          <!--<exclude>distribution/**</exclude>-->
                           <exclude>**/jaxb.index</exclude>
                           <exclude>**/META-INF/MANIFEST</exclude>
                           <exclude>**/src/test/**/*.txt</exclude>
@@ -431,6 +428,7 @@
                       </excludes>
                   </configuration>
                 </plugin>
+                <!-- TODO commented out for now
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpSTSClient.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpSTSClient.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpSTSClient.java
(original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpSTSClient.java
Mon Apr 30 20:51:14 2012
@@ -26,7 +26,7 @@ import org.w3c.dom.Element;
 
 public class IdpSTSClient extends STSClient {
 
-    private static Logger LOG = LoggerFactory.getLogger(IdpSTSClient.class);
+    private final static Logger LOG = LoggerFactory.getLogger(IdpSTSClient.class);
 
     public IdpSTSClient(Bus b) {
         super(b);

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpServlet.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpServlet.java?rev=1332379&r1=1332378&r2=1332379&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpServlet.java
(original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/IdpServlet.java
Mon Apr 30 20:51:14 2012
@@ -44,7 +44,7 @@ import org.w3c.dom.Element;
 
 public class IdpServlet extends HttpServlet {
 
-    private static Logger LOG = LoggerFactory.getLogger(IdpServlet.class);
+    private final static Logger LOG = LoggerFactory.getLogger(IdpServlet.class);
 
     public static final String PARAM_ACTION = "wa";
 
@@ -255,8 +255,7 @@ public class IdpServlet extends HttpServ
             if (claims != null) {
                 sts.setClaims(claims);
             }
-            String rstr = sts.requestSecurityTokenResponse(wtrealm);
-            return rstr;
+            return sts.requestSecurityTokenResponse(wtrealm);
         } catch (org.apache.cxf.binding.soap.SoapFault ex) {
             QName faultCode = ex.getFaultCode();
             if (faultCode.equals(STSException.FAILED_AUTH)) {



Mime
View raw message