commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1091096 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/LookupTranslator.java
Date Mon, 11 Apr 2011 15:07:30 GMT
Author: mbenson
Date: Mon Apr 11 15:07:29 2011
New Revision: 1091096

URL: http://svn.apache.org/viewvc?rev=1091096&view=rev
Log:
ws

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/LookupTranslator.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/LookupTranslator.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/LookupTranslator.java?rev=1091096&r1=1091095&r2=1091096&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/LookupTranslator.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/LookupTranslator.java
Mon Apr 11 15:07:29 2011
@@ -45,10 +45,10 @@ public class LookupTranslator extends Ch
             for (CharSequence[] seq : lookup) {
                 this.lookupMap.put(seq[0], seq[1]);
                 int sz = seq[0].length();
-                if(sz < _shortest) {
+                if (sz < _shortest) {
                     _shortest = sz;
                 }
-                if(sz > _longest) {
+                if (sz > _longest) {
                     _longest = sz;
                 }
             }
@@ -63,14 +63,14 @@ public class LookupTranslator extends Ch
     @Override
     public int translate(CharSequence input, int index, Writer out) throws IOException {
         int max = longest;
-        if(index + longest > input.length()) {
+        if (index + longest > input.length()) {
             max = input.length() - index;
         }
         // descend so as to get a greedy algorithm
-        for(int i=max; i >= shortest; i--) {
+        for (int i = max; i >= shortest; i--) {
             CharSequence subSeq = input.subSequence(index, index + i);
             CharSequence result = lookupMap.get(subSeq);
-            if(result != null) {
+            if (result != null) {
                 out.write(result.toString());
                 return i;
             }



Mime
View raw message