poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1700642 - in /poi/trunk/src: java/org/apache/poi/dev/ java/org/apache/poi/ss/format/ java/org/apache/poi/ss/formula/functions/ java/org/apache/poi/ss/util/ ooxml/java/org/apache/poi/xslf/usermodel/ ooxml/java/org/apache/poi/xssf/usermodel/...
Date Tue, 01 Sep 2015 19:01:36 GMT
Author: nick
Date: Tue Sep  1 19:01:36 2015
New Revision: 1700642

URL: http://svn.apache.org/r1700642
Log:
Fix some Forbidden APIs errors

Modified:
    poi/trunk/src/java/org/apache/poi/dev/RecordGenerator.java
    poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java
    poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
    poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java
    poi/trunk/src/java/org/apache/poi/ss/util/DateFormatConverter.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java

Modified: poi/trunk/src/java/org/apache/poi/dev/RecordGenerator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/dev/RecordGenerator.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/dev/RecordGenerator.java (original)
+++ poi/trunk/src/java/org/apache/poi/dev/RecordGenerator.java Tue Sep  1 19:01:36 2015
@@ -22,6 +22,7 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.Reader;
+import java.util.Locale;
 import java.util.Properties;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -92,7 +93,8 @@ public class RecordGenerator {
                 File destinationPathFile = new File(destinationPath);
                 destinationPathFile.mkdirs();
                 String destinationFilepath = destinationPath + "/" + recordName + suffix
+ ".java";
-                transform(file, new File(destinationFilepath), new File(recordStyleDir +
"/" + extendstg.toLowerCase() + ".xsl"));
+                transform(file, new File(destinationFilepath), 
+                          new File(recordStyleDir + "/" + extendstg.toLowerCase(Locale.ROOT)
+ ".xsl"));
                 System.out.println("Generated " + suffix + ": " + destinationFilepath);
 
                 // Generate test (if not already generated)
@@ -101,7 +103,7 @@ public class RecordGenerator {
                 destinationPathFile.mkdirs();
                 destinationFilepath = destinationPath + "/Test" + recordName + suffix + ".java";
                 if (new File(destinationFilepath).exists() == false) {
-                    String temp = (recordStyleDir + "/" + extendstg.toLowerCase() + "_test.xsl");
+                    String temp = (recordStyleDir + "/" + extendstg.toLowerCase(Locale.ROOT)
+ "_test.xsl");
                     transform(file, new File(destinationFilepath), new File(temp));
                     System.out.println("Generated test: " + destinationFilepath);
                 } else {

Modified: poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/format/CellElapsedFormatter.java Tue Sep  1 19:01:36
2015
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.Formatter;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Locale;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -85,7 +86,7 @@ public class CellElapsedFormatter extend
                 if (topmost != null)
                     throw new IllegalArgumentException(
                             "Duplicate '[' times in format");
-                part = part.toLowerCase();
+                part = part.toLowerCase(Locale.ROOT);
                 int specLen = part.length() - 2;
                 topmost = assignSpec(part.charAt(1), pos, specLen);
                 return part.substring(1, 1 + specLen);
@@ -94,7 +95,7 @@ public class CellElapsedFormatter extend
             case 'm':
             case 's':
             case '0':
-                part = part.toLowerCase();
+                part = part.toLowerCase(Locale.ROOT);
                 assignSpec(part.charAt(0), pos, part.length());
                 return part;
 
@@ -216,4 +217,4 @@ public class CellElapsedFormatter extend
     public void simpleValue(StringBuffer toAppendTo, Object value) {
         formatValue(toAppendTo, value);
     }
-}
\ No newline at end of file
+}

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java Tue Sep  1 19:01:36
2015
@@ -17,6 +17,7 @@
 
 package org.apache.poi.ss.formula.functions;
 
+import java.util.Locale;
 import java.util.regex.Pattern;
 
 import org.apache.poi.ss.formula.eval.BoolEval;
@@ -106,12 +107,12 @@ public abstract class TextFunction imple
 	};
 	public static final Function LOWER = new SingleArgTextFunc() {
 		protected ValueEval evaluate(String arg) {
-			return new StringEval(arg.toLowerCase());
+			return new StringEval(arg.toLowerCase(Locale.ROOT));
 		}
 	};
 	public static final Function UPPER = new SingleArgTextFunc() {
 		protected ValueEval evaluate(String arg) {
-			return new StringEval(arg.toUpperCase());
+			return new StringEval(arg.toUpperCase(Locale.ROOT));
 		}
 	};
 
@@ -125,8 +126,8 @@ public abstract class TextFunction imple
 		protected ValueEval evaluate(String text) {
 			StringBuilder sb = new StringBuilder();
 			boolean shouldMakeUppercase = true;
-			String lowercaseText = text.toLowerCase();
-			String uppercaseText = text.toUpperCase();
+			String lowercaseText = text.toLowerCase(Locale.ROOT);
+			String uppercaseText = text.toUpperCase(Locale.ROOT);
 			for(int i = 0; i < text.length(); ++i) {
 				if (shouldMakeUppercase) {
 					sb.append(uppercaseText.charAt(i));

Modified: poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/CellUtil.java Tue Sep  1 19:01:36 2015
@@ -18,6 +18,7 @@
 package org.apache.poi.ss.util;
 
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.poi.ss.usermodel.Cell;
@@ -336,7 +337,7 @@ public final class CellUtil {
 
 		String s = cell.getRichStringCellValue().getString();
 		boolean foundUnicode = false;
-		String lowerCaseStr = s.toLowerCase();
+		String lowerCaseStr = s.toLowerCase(Locale.ROOT);
 
 		for (int i = 0; i < unicodeMappings.length; i++) {
 			UnicodeMapping entry = unicodeMappings[i];

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=1700642&r1=1700641&r2=1700642&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 Tue Sep  1 19:01:36
2015
@@ -331,7 +331,7 @@ public class DateFormatConverter  {
 	}
 	
 	public static String getPrefixForLocale( Locale locale ) {
-		String localeString = locale.toString().toLowerCase();
+		String localeString = locale.toString().toLowerCase(locale);
 		String result = localePrefixes.get( localeString );
 		if( result == null ) {
 			result = localePrefixes.get( localeString.substring( 0, 2 ) );

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java Tue Sep  1
19:01:36 2015
@@ -18,6 +18,7 @@ package org.apache.poi.xslf.usermodel;
 
 import java.io.IOException;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.poi.POIXMLDocumentPart;
@@ -94,7 +95,7 @@ import org.openxmlformats.schemas.presen
             for (POIXMLDocumentPart p : getRelations()) {
                 if (p instanceof XSLFSlideLayout){
                     XSLFSlideLayout layout = (XSLFSlideLayout)p;
-                    _layouts.put(layout.getName().toLowerCase(), layout);
+                    _layouts.put(layout.getName().toLowerCase(Locale.ROOT), layout);
                 }
             }
         }
@@ -133,7 +134,7 @@ import org.openxmlformats.schemas.presen
      * @return the layout found or null on failure
      */
     public XSLFSlideLayout getLayout(String name) {
-        return getLayouts().get(name.toLowerCase());
+        return getLayouts().get(name.toLowerCase(Locale.ROOT));
     }
 
 
@@ -198,4 +199,4 @@ import org.openxmlformats.schemas.presen
             return null;
         }
     }
-}
\ No newline at end of file
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java Tue Sep  1
19:01:36 2015
@@ -20,6 +20,7 @@ package org.apache.poi.xssf.usermodel;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.VerticalAlignment;
@@ -254,7 +255,7 @@ public class XSSFSimpleShape extends XSS
         case ALPHA_LC_PARENT_BOTH:
         case ALPHA_LC_PARENT_R:
             if(scheme == ListAutoNumber.ALPHA_LC_PARENT_BOTH) out.append('(');
-            out.append(valueToAlpha(value).toLowerCase());
+            out.append(valueToAlpha(value).toLowerCase(Locale.ROOT));
             out.append(')');
             break;
         case ALPHA_UC_PARENT_BOTH:
@@ -264,7 +265,7 @@ public class XSSFSimpleShape extends XSS
             out.append(')');
             break;        
         case ALPHA_LC_PERIOD:
-            out.append(valueToAlpha(value).toLowerCase());
+            out.append(valueToAlpha(value).toLowerCase(Locale.ROOT));
             out.append('.');
             break;
         case ALPHA_UC_PERIOD:
@@ -287,7 +288,7 @@ public class XSSFSimpleShape extends XSS
         case ROMAN_LC_PARENT_BOTH:
         case ROMAN_LC_PARENT_R:
             if(scheme == ListAutoNumber.ROMAN_LC_PARENT_BOTH) out.append('(');
-            out.append(valueToRoman(value).toLowerCase());
+            out.append(valueToRoman(value).toLowerCase(Locale.ROOT));
             out.append(')');
             break;
         case ROMAN_UC_PARENT_BOTH:
@@ -297,7 +298,7 @@ public class XSSFSimpleShape extends XSS
             out.append(')');
             break;        
         case ROMAN_LC_PERIOD:
-            out.append(valueToRoman(value).toLowerCase());
+            out.append(valueToRoman(value).toLowerCase(Locale.ROOT));
             out.append('.');
             break;
         case ROMAN_UC_PERIOD:

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java Tue
Sep  1 19:01:36 2015
@@ -20,6 +20,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
+import java.util.Locale;
 import java.util.TimeZone;
 
 import org.apache.poi.POIOLE2TextExtractor;
@@ -127,7 +128,7 @@ public class OutlookTextExtactor extends
             // Failing that try via the raw headers 
             String[] headers = msg.getHeaders();
             for(String header: headers) {
-               if(header.toLowerCase().startsWith("date:")) {
+               if(header.toLowerCase(Locale.ROOT).startsWith("date:")) {
                   s.append(
                         "Date:" + 
                         header.substring(header.indexOf(':')+1) +

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java Tue
Sep  1 19:01:36 2015
@@ -20,6 +20,7 @@ package org.apache.poi.hslf.extractor;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.util.List;
+import java.util.Locale;
 
 import org.apache.poi.POIDataSamples;
 import org.apache.poi.POITestCase;
@@ -314,7 +315,7 @@ public final class TestExtractor extends
        ppe = new PowerPointExtractor(hslf);
        
        text = ppe.getText();
-       assertContains(text.toLowerCase(), "master");
+       assertContains(text.toLowerCase(Locale.ROOT), "master");
        assertContains(text, masterText);
     }
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java?rev=1700642&r1=1700641&r2=1700642&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java Tue Sep  1
19:01:36 2015
@@ -23,6 +23,7 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Locale;
 
 import junit.framework.TestCase;
 import org.apache.poi.POIDataSamples;
@@ -62,7 +63,7 @@ public class TestSprms extends TestCase
         for ( int p = 0; p < range.numParagraphs(); p++ )
         {
             Paragraph paragraph = range.getParagraph( p );
-            char first = paragraph.text().toLowerCase().charAt( 0 );
+            char first = paragraph.text().toLowerCase(Locale.ROOT).charAt( 0 );
             if ( '1' <= first && first < '4' )
             {
                 assertTrue( paragraph.isInTable() );



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


Mime
View raw message