axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r469820 - in /webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart: policy/model/RampartConfig.java util/RampartUtil.java
Date Wed, 01 Nov 2006 08:38:13 GMT
Author: ruchithf
Date: Wed Nov  1 00:38:13 2006
New Revision: 469820

URL: http://svn.apache.org/viewvc?view=rev&rev=469820
Log:
Prevent NPEs

Modified:
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/policy/model/RampartConfig.java
    webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/RampartUtil.java

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/policy/model/RampartConfig.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/policy/model/RampartConfig.java?view=diff&rev=469820&r1=469819&r2=469820
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/policy/model/RampartConfig.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/policy/model/RampartConfig.java
Wed Nov  1 00:38:13 2006
@@ -18,7 +18,6 @@
 
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
-import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
 
 import javax.xml.namespace.QName;
@@ -59,7 +58,7 @@
  */
 public class RampartConfig implements Assertion {
 
-    private static final String DEFAULT_TIMESTAMP_TTL = "300000";
+    public static final int DEFAULT_TIMESTAMP_TTL = 300000;
 
     public final static String NS = "http://ws.apache.org/rampart/policy";
 
@@ -95,7 +94,7 @@
 
     private CryptoConfig decCryptoConfig;
 
-    private String timestampTTL = DEFAULT_TIMESTAMP_TTL;
+    private String timestampTTL = Integer.toString(DEFAULT_TIMESTAMP_TTL);
 
     private String tokenStoreClass;
 

Modified: webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/RampartUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/RampartUtil.java?view=diff&rev=469820&r1=469819&r2=469820
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/RampartUtil.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/security/src/org/apache/rampart/util/RampartUtil.java
Wed Nov  1 00:38:13 2006
@@ -297,7 +297,7 @@
     public static int getTimeToLive(RampartMessageData messageData) {
 
         RampartConfig rampartConfig = messageData.getPolicyData().getRampartConfig();
-        
+        if(rampartConfig != null) {
         String ttl = rampartConfig.getTimestampTTL();
         int ttl_i = 0;
         if (ttl != null) {
@@ -311,6 +311,9 @@
             ttl_i = messageData.getTimeToLive();
         }
         return ttl_i;
+        } else {
+            return RampartConfig.DEFAULT_TIMESTAMP_TTL;
+        }
     }
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message