poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r405755 - /jakarta/poi/trunk/src/java/org/apache/poi/util/StringUtil.java
Date Wed, 10 May 2006 13:23:51 GMT
Author: nick
Date: Wed May 10 06:23:48 2006
New Revision: 405755

URL: http://svn.apache.org/viewcvs?rev=405755&view=rev
Log:
If given an empty (but not null) byte array to get a whole string from, return an empty string
rather than an exception

Modified:
    jakarta/poi/trunk/src/java/org/apache/poi/util/StringUtil.java

Modified: jakarta/poi/trunk/src/java/org/apache/poi/util/StringUtil.java
URL: http://svn.apache.org/viewcvs/jakarta/poi/trunk/src/java/org/apache/poi/util/StringUtil.java?rev=405755&r1=405754&r2=405755&view=diff
==============================================================================
--- jakarta/poi/trunk/src/java/org/apache/poi/util/StringUtil.java (original)
+++ jakarta/poi/trunk/src/java/org/apache/poi/util/StringUtil.java Wed May 10 06:23:48 2006
@@ -88,6 +88,7 @@
 	 *@return         the converted string    
 	 */
 	public static String getFromUnicodeLE(final byte[] string) {
+		if(string.length == 0) { return ""; }
 		return getFromUnicodeLE(string, 0, string.length / 2);
 	}
 
@@ -140,6 +141,7 @@
 	 *@return         the converted string     
 	 */
 	public static String getFromUnicodeBE(final byte[] string) {
+		if(string.length == 0) { return ""; }
 		return getFromUnicodeBE(string, 0, string.length / 2);
 	}
 



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message