You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ba...@apache.org on 2007/02/06 23:26:52 UTC
svn commit: r504336 -
/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java
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