Author: peter_firmstone Date: Mon Aug 6 10:26:25 2012 New Revision: 1369771
URL: http://svn.apache.org/viewvc?rev=1369771&view=rev Log: Reverse recent change to UriString. Modified: river/jtsk/trunk/src/org/apache/river/impl/net/UriString.java Modified: river/jtsk/trunk/src/org/apache/river/impl/net/UriString.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/impl/net/UriString.java?rev=1369771&r1=1369770&r2=1369771&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/impl/net/UriString.java (original) +++ river/jtsk/trunk/src/org/apache/river/impl/net/UriString.java Mon Aug 6 10:26:25 2012 @@ -374,39 +374,39 @@ public class UriString { /* First check if escape is an unreserved character, if so * decode it, otherwise, change escape sequence to upper case. */ -// if (hos[i] == escape){ -// // Although java.net.URI prohibits escape characters in -// // host, it may change in future if updated for compliance. -// esc[0] = hos[i]; -// esc[1] = hos[i+1]; -// esc[2] = hos[i+2]; -// String e = new String(esc).toUpperCase(); -// Character c = unreserved.get(e); -// if (c != null){ -// sb.append(c); -// i = i+2; -// continue; -// } -// sb.append(hos[i]); -// escIndex = i; -// continue; -// } -// if (escIndex > 0 && i > escIndex && i < escIndex + 3 ){ -// if (index(numeric, hos[i]) > 0) { -// sb.append(hos[i]); -// continue; -// } -// if (index(upalpha, hos[i]) > 0){ -// sb.append(hos[i]); -// continue; -// } -// int n = index(lowalpha, hos[i]); -// if (n > 0){ -// sb.append(upalpha[n]); -// continue; -// } -// throw new URISyntaxException(host, "host contains escaped sequence that has an illegal character at index " + i); -// } + if (hos[i] == escape){ + // Although java.net.URI prohibits escape characters in + // host, it may change in future if updated for compliance. + esc[0] = hos[i]; + esc[1] = hos[i+1]; + esc[2] = hos[i+2]; + String e = new String(esc).toUpperCase(); + Character c = unreserved.get(e); + if (c != null){ + sb.append(c); + i = i+2; + continue; + } + sb.append(hos[i]); + escIndex = i; + continue; + } + if (escIndex > 0 && i > escIndex && i < escIndex + 3 ){ + if (index(numeric, hos[i]) > 0) { + sb.append(hos[i]); + continue; + } + if (index(upalpha, hos[i]) > 0){ + sb.append(hos[i]); + continue; + } + int n = index(lowalpha, hos[i]); + if (n > 0){ + sb.append(upalpha[n]); + continue; + } + throw new URISyntaxException(host, "host contains escaped sequence that has an illegal character at index " + i); + } int n = index(upalpha, hos[i]); if (n > 0) { sb.append(lowalpha[n]);
