poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1700063 - in /poi/trunk/src/java/org/apache/poi: sl/draw/DrawShape.java sl/usermodel/AutoNumberingScheme.java util/JvmBugs.java
Date Sat, 29 Aug 2015 18:01:26 GMT
Author: kiwiwings
Date: Sat Aug 29 18:01:26 2015
New Revision: 1700063

URL: http://svn.apache.org/r1700063
Log:
forbidden apis fixes

Modified:
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java
    poi/trunk/src/java/org/apache/poi/sl/usermodel/AutoNumberingScheme.java
    poi/trunk/src/java/org/apache/poi/util/JvmBugs.java

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java?rev=1700063&r1=1700062&r2=1700063&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawShape.java Sat Aug 29 18:01:26 2015
@@ -20,6 +20,7 @@ package org.apache.poi.sl.draw;
 import java.awt.Graphics2D;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
+import java.util.Locale;
 
 import org.apache.poi.sl.usermodel.PlaceableShape;
 import org.apache.poi.sl.usermodel.Shape;
@@ -72,7 +73,7 @@ public class DrawShape implements Drawab
                 // and later on, turn it around again to compare it with its original size
...
 
                 AffineTransform txs;
-                if (ps.getClass().getCanonicalName().toLowerCase().contains("hslf")) {
+                if (ps.getClass().getCanonicalName().toLowerCase(Locale.ROOT).contains("hslf"))
{
                     txs = new AffineTransform(tx);
                 } else {
                     // this handling is only based on try and error ... not sure why xslf
is handled differently.

Modified: poi/trunk/src/java/org/apache/poi/sl/usermodel/AutoNumberingScheme.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/AutoNumberingScheme.java?rev=1700063&r1=1700062&r2=1700063&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/usermodel/AutoNumberingScheme.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/usermodel/AutoNumberingScheme.java Sat Aug 29 18:01:26
2015
@@ -17,6 +17,8 @@
 
 package org.apache.poi.sl.usermodel;
 
+import java.util.Locale;
+
 public enum AutoNumberingScheme {
     /** Lowercase alphabetic character enclosed in parentheses. Example: (a), (b), (c), ...
*/
     alphaLcParenBoth(0x0008, 1),
@@ -177,7 +179,7 @@ public enum AutoNumberingScheme {
     }
 
     private String formatSeperator(String cased) {
-        String name = name().toLowerCase();
+        String name = name().toLowerCase(Locale.ROOT);
         if (name.contains("plain")) return cased;
         if (name.contains("parenright")) return cased+")";
         if (name.contains("parenboth")) return "("+cased+")";
@@ -187,9 +189,9 @@ public enum AutoNumberingScheme {
     }
 
     private String formatCase(String index) {
-        String name = name().toLowerCase();
-        if (name.contains("lc")) return index.toLowerCase();
-        if (name.contains("uc")) return index.toUpperCase();
+        String name = name().toLowerCase(Locale.ROOT);
+        if (name.contains("lc")) return index.toLowerCase(Locale.ROOT);
+        if (name.contains("uc")) return index.toUpperCase(Locale.ROOT);
         return index;
     }
 
@@ -203,7 +205,7 @@ public enum AutoNumberingScheme {
             "\u2776\u2777\u2778\u2779\u277A\u277B\u277C\u277D\u277E";
 
     private String formatIndex(int value) {
-        String name = name().toLowerCase();
+        String name = name().toLowerCase(Locale.ROOT);
         if (name.startsWith("roman")) {
             return formatRomanIndex(value);
         } else if (name.startsWith("arabic") && !name.contains("db")) {

Modified: poi/trunk/src/java/org/apache/poi/util/JvmBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/JvmBugs.java?rev=1700063&r1=1700062&r2=1700063&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/JvmBugs.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/JvmBugs.java Sat Aug 29 18:01:26 2015
@@ -16,6 +16,8 @@
 ==================================================================== */
 package org.apache.poi.util;
 
+import java.util.Locale;
+
 public class JvmBugs {
     private static final POILogger LOG = POILogFactory.getLogger(JvmBugs.class);
     
@@ -42,7 +44,7 @@ public class JvmBugs {
      */
     public static boolean hasLineBreakMeasurerBug() {
         String version = System.getProperty("java.version");
-        String os = System.getProperty("os.name").toLowerCase();
+        String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);
         boolean ignore = Boolean.getBoolean("org.apache.poi.JvmBugs.LineBreakMeasurer.ignore");
         boolean hasBug = (!ignore && (os.contains("win") && ("1.6.0_45".equals(version)
|| "1.7.0_21".equals(version))));
         if (hasBug) {



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


Mime
View raw message