empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r742113 - /incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java
Date Sun, 08 Feb 2009 14:54:06 GMT
Author: francisdb
Date: Sun Feb  8 14:54:05 2009
New Revision: 742113

URL: http://svn.apache.org/viewvc?rev=742113&view=rev
Log:
make ErrorType immutable

Modified:
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java?rev=742113&r1=742112&r2=742113&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java
Sun Feb  8 14:54:05 2009
@@ -34,12 +34,11 @@
  */
 public class ErrorType
 {
-    // Logger
     private static final Log log = LogFactory.getLog(ErrorType.class);
 
-    private String key;
-    private String msgPattern;
-    private int    numParams;
+    private final String key;
+    private final String msgPattern;
+    private final int    numParams;
 
     /**
      * Defines an error type.
@@ -52,15 +51,16 @@
         this.key = errorKey;
         this.msgPattern = msgPattern;
         // Count number of params
-        numParams = 0;
+        int numParamCount = 0;
         while(true)
         {
-            String placeholder = "{" + String.valueOf(numParams) + "}";
+            String placeholder = "{" + String.valueOf(numParamCount) + "}";
             if (msgPattern.indexOf(placeholder)<0)
                 break;
             // Param found
-            numParams++;    
+            numParamCount++;    
         }
+        this.numParams = numParamCount;
         // Write error definition to log
         log.info("Error defined: " + key + "=" + msgPattern);
     }



Mime
View raw message