Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Had one too many next() calls string keyed maps

Signed-off-by: Nick Tolomiczenko <nick.tolomiczenko@gmail.com>
  • Loading branch information...
commit 64e89b3da65b11b527f1642516b0675e73e6533b 1 parent 89f9666
Nick Tolomiczenko authored
30 hyperclient/java/extra_src/ByteArray.java
View
@@ -88,30 +88,23 @@ public static String decode(ByteArray ba, String encoding) throws TypeError
return decode(ba.getBytes(), encoding);
}
- public String toString(String encoding)
+ public String toString(String encoding) throws TypeError
{
- String ret = "<could not decode bytes using java string encoding '"
- + encoding + "'>";
-
- try
- {
- ret = decode(encoding);
- }
- catch(TypeError e)
- {
- }
+ return decode(encoding);
+ }
- return ret;
+ public static String toString(byte[] bytes, String encoding) throws TypeError
+ {
+ return decode(bytes, encoding);
}
- public static String toString(byte[] bytes, String encoding)
+ public String toString()
{
- String ret = "<could not decode bytes using java string encoding '"
- + encoding + "'>";
+ String ret = "";
try
{
- ret = decode(bytes, encoding);
+ ret = toString(defaultEncoding);
}
catch(TypeError e)
{
@@ -120,11 +113,6 @@ public static String toString(byte[] bytes, String encoding)
return ret;
}
- public String toString()
- {
- return toString(defaultEncoding);
- }
-
public byte[] getBytes()
{
return bytes;
4 hyperclient/java/proxies/HyperClient.i
View
@@ -885,7 +885,7 @@
// Use C byte array sorting.
java.util.Iterator str_m_it=map.keySet().iterator();
- Object curKey = str_m_it.next();
+ Object curKey = null;
if ( str_m_it.hasNext()
&& ((curKey = str_m_it.next()) instanceof String) )
@@ -914,7 +914,7 @@
catch(Exception e)
{
// Try to box the byte[] keys with ByteArray
- // Throw an exception if not key are not all byte[]
+ // Throw an exception if not all keys are byte[]
java.util.TreeMap<ByteArray,Object> sorted_map
= new java.util.TreeMap<ByteArray,Object>();
Please sign in to comment.
Something went wrong with that request. Please try again.