You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2014/03/08 17:46:59 UTC

svn commit: r1575563 - in /poi/trunk/src: java/org/apache/poi/ss/util/DateFormatConverter.java testcases/org/apache/poi/ss/util/TestDateFormatConverter.java

Author: centic
Date: Sat Mar  8 16:46:59 2014
New Revision: 1575563

URL: http://svn.apache.org/r1575563
Log:
Adjust for JDK 8 where an empty locale is added to the array returned by DateFormat.getAvailableLocales()

Modified:
    poi/trunk/src/java/org/apache/poi/ss/util/DateFormatConverter.java
    poi/trunk/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java

Modified: poi/trunk/src/java/org/apache/poi/ss/util/DateFormatConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/DateFormatConverter.java?rev=1575563&r1=1575562&r2=1575563&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/DateFormatConverter.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/DateFormatConverter.java Sat Mar  8 16:46:59 2014
@@ -93,6 +93,7 @@ public class DateFormatConverter  {
 			return result.toArray(new String[0]);
 		}
 		
+		@Override
 		public String toString() {
 			StringBuilder result = new StringBuilder();
 			
@@ -323,6 +324,9 @@ public class DateFormatConverter  {
 		result.put( "in", "[$-0421]" );
 		result.put( "iw", "[$-40D]" );
 		
+		// JDK 8 adds an empty locale-string, see also https://issues.apache.org/jira/browse/LANG-941
+		result.put( "", "[$-0409]" );
+		
 		return result;
 	}
 	

Modified: poi/trunk/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java?rev=1575563&r1=1575562&r2=1575563&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/util/TestDateFormatConverter.java Sat Mar  8 16:46:59 2014
@@ -137,5 +137,11 @@ public final class TestDateFormatConvert
         outputLocaleDataFormats(date, false, true, DateFormat.LONG, "Long" );
         outputLocaleDataFormats(date, false, true, DateFormat.FULL, "Full" );
     }
+    
+    public void testJDK8EmptyLocale() {
+        // JDK 8 seems to add an empty locale-string to the list returned via DateFormat.getAvailableLocales()
+        // therefore we now cater for this special locale as well
+        DateFormatConverter.getPrefixForLocale(new Locale(""));
+    }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org