commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r504336 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java
Date Tue, 06 Feb 2007 22:26:52 GMT
Author: bayard
Date: Tue Feb  6 14:26:51 2007
New Revision: 504336

URL: http://svn.apache.org/viewvc?view=rev&rev=504336
Log:
Switching last two methods to use 'str' rather than 'string'

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java?view=diff&rev=504336&r1=504335&r2=504336
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java (original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java Tue Feb
 6 14:26:51 2007
@@ -887,7 +887,7 @@
      * 
      * @param writer
      *            The <code>Writer</code> to write the results to; assumed to
be non-null.
-     * @param string
+     * @param str
      *            The <code>String</code> to write the results to; assumed to
be non-null.
      * @throws IOException
      *             when <code>Writer</code> passed throws the exception from
calls to the {@link Writer#write(int)}
@@ -896,35 +896,35 @@
      * @see #escape(String)
      * @see Writer
      */
-    public void unescape(Writer writer, String string) throws IOException {
-        int firstAmp = string.indexOf('&');
+    public void unescape(Writer writer, String str) throws IOException {
+        int firstAmp = str.indexOf('&');
         if (firstAmp < 0) {
-            writer.write(string);
+            writer.write(str);
             return;
         } else {
-            doUnescape(writer, string, firstAmp);
+            doUnescape(writer, str, firstAmp);
         }
     }
 
-    private void doUnescape(Writer writer, String string, int firstAmp) throws IOException
{
-        writer.write(string, 0, firstAmp);
-        int len = string.length();
+    private void doUnescape(Writer writer, String str, int firstAmp) throws IOException {
+        writer.write(str, 0, firstAmp);
+        int len = str.length();
         for (int i = firstAmp; i < len; i++) {
-            char c = string.charAt(i);
+            char c = str.charAt(i);
             if (c == '&') {
                 int nextIdx = i + 1;
-                int semiColonIdx = string.indexOf(';', nextIdx);
+                int semiColonIdx = str.indexOf(';', nextIdx);
                 if (semiColonIdx == -1) {
                     writer.write(c);
                     continue;
                 }
-                int amphersandIdx = string.indexOf('&', i + 1);
+                int amphersandIdx = str.indexOf('&', i + 1);
                 if (amphersandIdx != -1 && amphersandIdx < semiColonIdx) {
                     // Then the text looks like &...&...;
                     writer.write(c);
                     continue;
                 }
-                String entityContent = string.substring(nextIdx, semiColonIdx);
+                String entityContent = str.substring(nextIdx, semiColonIdx);
                 int entityValue = -1;
                 int entityContentLen = entityContent.length();
                 if (entityContentLen > 0) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message