poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1700641 - in /poi/trunk/src/java/org/apache/poi: hssf/extractor/ hssf/record/ hssf/record/cf/ hssf/usermodel/ poifs/crypt/ ss/format/ ss/formula/ptg/ ss/usermodel/ ss/util/
Date Tue, 01 Sep 2015 18:56:45 GMT
Author: nick
Date: Tue Sep  1 18:56:44 2015
New Revision: 1700641

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

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
    poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java
    poi/trunk/src/java/org/apache/poi/hssf/record/UnknownRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewBegin.java
    poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewEnd.java
    poi/trunk/src/java/org/apache/poi/hssf/record/cf/FontFormatting.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
    poi/trunk/src/java/org/apache/poi/poifs/crypt/CryptoFunctions.java
    poi/trunk/src/java/org/apache/poi/ss/format/CellFormatPart.java
    poi/trunk/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java
    poi/trunk/src/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/ExtendedColor.java
    poi/trunk/src/java/org/apache/poi/ss/util/NumberComparer.java
    poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java Tue Sep  1 18:56:44
2015
@@ -22,6 +22,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
+import java.util.Locale;
 
 import org.apache.poi.POIOLE2TextExtractor;
 import org.apache.poi.hssf.usermodel.HSSFCell;
@@ -159,7 +160,7 @@ public class ExcelExtractor extends POIO
 			if (i >= args.length) {
 				throw new CommandParseException("Expected value after '" + args[i-1] + "'");
 			}
-			String value = args[i].toUpperCase();
+			String value = args[i].toUpperCase(Locale.ROOT);
 			if ("Y".equals(value) || "YES".equals(value) || "ON".equals(value) || "TRUE".equals(value))
{
 				return true;
 			}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java Tue Sep  1 18:56:44
2015
@@ -21,6 +21,7 @@ import org.apache.poi.util.HexDump;
 import org.apache.poi.util.LittleEndianOutput;
 
 import java.util.Arrays;
+import java.util.Locale;
 
 /**
  * The HEADERFOOTER record stores information added in Office Excel 2007 for headers/footers.
@@ -88,7 +89,7 @@ public final class HeaderFooterRecord ex
         StringBuffer sb = new StringBuffer();
 
         sb.append("[").append("HEADERFOOTER").append("] (0x");
-        sb.append(Integer.toHexString(sid).toUpperCase() + ")\n");
+        sb.append(Integer.toHexString(sid).toUpperCase(Locale.ROOT) + ")\n");
         sb.append("  rawData=").append(HexDump.toHex(_rawData)).append("\n");
         sb.append("[/").append("HEADERFOOTER").append("]\n");
         return sb.toString();
@@ -100,4 +101,4 @@ public final class HeaderFooterRecord ex
     }
     
  
-}
\ No newline at end of file
+}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java Tue Sep  1 18:56:44
2015
@@ -19,6 +19,7 @@ package org.apache.poi.hssf.record;
 
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.util.Locale;
 
 import org.apache.poi.hssf.dev.BiffViewer;
 import org.apache.poi.hssf.record.crypto.Biff8DecryptingStream;
@@ -51,7 +52,7 @@ public final class RecordInputStream imp
 	@SuppressWarnings("serial")
 	public static final class LeftoverDataException extends RuntimeException {
 		public LeftoverDataException(int sid, int remainingByteCount) {
-			super("Initialisation of record 0x" + Integer.toHexString(sid).toUpperCase()
+			super("Initialisation of record 0x" + Integer.toHexString(sid).toUpperCase(Locale.ROOT)
 					+ "(" + getRecordName(sid) + ") left " + remainingByteCount 
 					+ " bytes remaining still to be read.");
 		}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/UnknownRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/UnknownRecord.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/UnknownRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/UnknownRecord.java Tue Sep  1 18:56:44 2015
@@ -17,6 +17,8 @@
 
 package org.apache.poi.hssf.record;
 
+import java.util.Locale;
+
 import org.apache.poi.hssf.record.aggregates.PageSettingsBlock;
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.LittleEndianOutput;
@@ -85,7 +87,8 @@ public final class UnknownRecord extends
             // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord
             // those sids are in a different number space.
             // TODO - put unknown OBJ sub-records in a different class
-            System.out.println("Unknown record 0x" + Integer.toHexString(_sid).toUpperCase());
+            System.out.println("Unknown record 0x" + 
+                               Integer.toHexString(_sid).toUpperCase(Locale.ROOT));
         }
     }
 
@@ -114,7 +117,7 @@ public final class UnknownRecord extends
         StringBuffer sb = new StringBuffer();
 
         sb.append("[").append(biffName).append("] (0x");
-        sb.append(Integer.toHexString(_sid).toUpperCase() + ")\n");
+        sb.append(Integer.toHexString(_sid).toUpperCase(Locale.ROOT) + ")\n");
         if (_rawData.length > 0) {
             sb.append("  rawData=").append(HexDump.toHex(_rawData)).append("\n");
         }
@@ -213,7 +216,7 @@ public final class UnknownRecord extends
             case 0x1007: return "CHARTLINEFORMAT";
         }
         if (isObservedButUnknown(sid)) {
-            return "UNKNOWN-" + Integer.toHexString(sid).toUpperCase();
+            return "UNKNOWN-" + Integer.toHexString(sid).toUpperCase(Locale.ROOT);
         }
 
         return null;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewBegin.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewBegin.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewBegin.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewBegin.java Tue Sep  1 18:56:44
2015
@@ -17,10 +17,11 @@
 
 package org.apache.poi.hssf.record;
 
+import java.util.Locale;
+
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.LittleEndianOutput;
 
-
 /**
  * The UserSViewBegin record specifies settings for a custom view associated with the sheet.
  * This record also marks the start of custom view records, which save custom view settings.
@@ -76,7 +77,7 @@ public final class UserSViewBegin extend
         StringBuffer sb = new StringBuffer();
 
         sb.append("[").append("USERSVIEWBEGIN").append("] (0x");
-        sb.append(Integer.toHexString(sid).toUpperCase() + ")\n");
+        sb.append(Integer.toHexString(sid).toUpperCase(Locale.ROOT) + ")\n");
         sb.append("  rawData=").append(HexDump.toHex(_rawData)).append("\n");
         sb.append("[/").append("USERSVIEWBEGIN").append("]\n");
         return sb.toString();
@@ -87,4 +88,4 @@ public final class UserSViewBegin extend
         return cloneViaReserialise();
     }
  
-}
\ No newline at end of file
+}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewEnd.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewEnd.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewEnd.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/UserSViewEnd.java Tue Sep  1 18:56:44 2015
@@ -17,6 +17,8 @@
 
 package org.apache.poi.hssf.record;
 
+import java.util.Locale;
+
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.LittleEndianOutput;
 
@@ -61,7 +63,7 @@ public final class UserSViewEnd extends
         StringBuffer sb = new StringBuffer();
 
         sb.append("[").append("USERSVIEWEND").append("] (0x");
-        sb.append(Integer.toHexString(sid).toUpperCase() + ")\n");
+        sb.append(Integer.toHexString(sid).toUpperCase(Locale.ROOT) + ")\n");
         sb.append("  rawData=").append(HexDump.toHex(_rawData)).append("\n");
         sb.append("[/").append("USERSVIEWEND").append("]\n");
         return sb.toString();

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/cf/FontFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/cf/FontFormatting.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/cf/FontFormatting.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/cf/FontFormatting.java Tue Sep  1 18:56:44
2015
@@ -18,6 +18,8 @@
 
 package org.apache.poi.hssf.record.cf;
 
+import java.util.Locale;
+
 import org.apache.poi.hssf.record.RecordInputStream;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.BitFieldFactory;
@@ -533,7 +535,7 @@ public final class FontFormatting {
         {
             buffer.append("	.underline type is not modified\n");
         }
-        buffer.append("	.color index = ").append("0x"+Integer.toHexString(getFontColorIndex()).toUpperCase()).append("\n");
+        buffer.append("	.color index = ").append("0x"+Integer.toHexString(getFontColorIndex()).toUpperCase(Locale.ROOT)).append("\n");
 
         buffer.append("    [/Font Formatting]\n");
         return buffer.toString();

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java Tue Sep  1 18:56:44
2015
@@ -15,17 +15,12 @@
    limitations under the License.
 ==================================================================== */
 
-
-/*
- * HSSFDataFormat.java
- *
- * Created on December 18, 2001, 12:42 PM
- */
 package org.apache.poi.hssf.usermodel;
 
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Vector;
 
 import org.apache.poi.hssf.model.InternalWorkbook;
@@ -95,7 +90,7 @@ public final class HSSFDataFormat implem
 	public short getFormat(String pFormat) {
 	   // Normalise the format string
 		String format;
-		if (pFormat.toUpperCase().equals("TEXT")) {
+		if (pFormat.toUpperCase(Locale.ROOT).equals("TEXT")) {
 			format = "@";
 		} else {
 			format = pFormat;

Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/CryptoFunctions.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/CryptoFunctions.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/crypt/CryptoFunctions.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/crypt/CryptoFunctions.java Tue Sep  1 18:56:44
2015
@@ -25,6 +25,7 @@ import java.security.Provider;
 import java.security.Security;
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.Arrays;
+import java.util.Locale;
 
 import javax.crypto.Cipher;
 import javax.crypto.Mac;
@@ -424,7 +425,7 @@ public class CryptoFunctions {
      */
     public static String xorHashPassword(String password) {
         int hashedPassword = createXorVerifier2(password);
-        return String.format("%1$08X", hashedPassword);
+        return String.format(Locale.ROOT, "%1$08X", hashedPassword);
     }
     
     /**
@@ -434,7 +435,7 @@ public class CryptoFunctions {
     public static String xorHashPasswordReversed(String password) {
         int hashedPassword = createXorVerifier2(password);
         
-        return String.format("%1$02X%2$02X%3$02X%4$02X"
+        return String.format(Locale.ROOT, "%1$02X%2$02X%3$02X%4$02X"
             , ( hashedPassword >>> 0 ) & 0xFF
             , ( hashedPassword >>> 8 ) & 0xFF
             , ( hashedPassword >>> 16 ) & 0xFF

Modified: poi/trunk/src/java/org/apache/poi/ss/format/CellFormatPart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellFormatPart.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/format/CellFormatPart.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/format/CellFormatPart.java Tue Sep  1 18:56:44 2015
@@ -20,6 +20,7 @@ import org.apache.poi.hssf.util.HSSFColo
 
 import javax.swing.*;
 import java.awt.*;
+import java.util.Locale;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.regex.Matcher;
@@ -60,7 +61,7 @@ public class CellFormatPart {
         for (HSSFColor color : colors.values()) {
             Class<? extends HSSFColor> type = color.getClass();
             String name = type.getSimpleName();
-            if (name.equals(name.toUpperCase())) {
+            if (name.equals(name.toUpperCase(Locale.ROOT))) {
                 short[] rgb = color.getTriplet();
                 Color c = new Color(rgb[0], rgb[1], rgb[2]);
                 NAMED_COLORS.put(name, c);

Modified: poi/trunk/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/format/CellGeneralFormatter.java Tue Sep  1 18:56:44
2015
@@ -17,6 +17,7 @@
 package org.apache.poi.ss.format;
 
 import java.util.Formatter;
+import java.util.Locale;
 
 /**
  * A formatter for the default "General" cell format.
@@ -77,7 +78,7 @@ public class CellGeneralFormatter extend
                 }
             }
         } else if (value instanceof Boolean) {
-            toAppendTo.append(value.toString().toUpperCase());
+            toAppendTo.append(value.toString().toUpperCase(Locale.ROOT));
         } else {
             toAppendTo.append(value.toString());
         }

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java Tue Sep  1 18:56:44
2015
@@ -17,10 +17,11 @@
 
 package org.apache.poi.ss.formula.ptg;
 
+import java.util.Locale;
+
 import org.apache.poi.ss.formula.function.FunctionMetadata;
 import org.apache.poi.ss.formula.function.FunctionMetadataRegistry;
 
-
 /**
  * This class provides the base functionality for Excel sheet functions
  * There are two kinds of function Ptgs - tFunc and tFuncVar
@@ -119,7 +120,7 @@ public abstract class AbstractFunctionPt
      *  <code>false</code> if the name should be assumed to be an external function.
      */
     public static final boolean isBuiltInFunctionName(String name) {
-        short ix = FunctionMetadataRegistry.lookupIndexByName(name.toUpperCase());
+        short ix = FunctionMetadataRegistry.lookupIndexByName(name.toUpperCase(Locale.ROOT));
         return ix >= 0;
     }
 

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/ExtendedColor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/ExtendedColor.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/ExtendedColor.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/ExtendedColor.java Tue Sep  1 18:56:44
2015
@@ -16,6 +16,8 @@
 ==================================================================== */
 package org.apache.poi.ss.usermodel;
 
+import java.util.Locale;
+
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.Color;
 
@@ -136,7 +138,7 @@ public abstract class ExtendedColor impl
           }
           sb.append(cs);
        }
-       return sb.toString().toUpperCase();
+       return sb.toString().toUpperCase(Locale.ROOT);
     }
     
     /**

Modified: poi/trunk/src/java/org/apache/poi/ss/util/NumberComparer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/NumberComparer.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/NumberComparer.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/NumberComparer.java Tue Sep  1 18:56:44 2015
@@ -17,6 +17,8 @@
 
 package org.apache.poi.ss.util;
 
+import java.util.Locale;
+
 import static org.apache.poi.ss.util.IEEEDouble.*;
 
 /**
@@ -168,6 +170,6 @@ public final class NumberComparer {
 	 * for formatting double values in error messages
 	 */
 	private static String toHex(double a) {
-		return "0x" + Long.toHexString(Double.doubleToLongBits(a)).toUpperCase();
+		return "0x" + Long.toHexString(Double.doubleToLongBits(a)).toUpperCase(Locale.ROOT);
 	}
 }

Modified: poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java?rev=1700641&r1=1700640&r2=1700641&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/SheetUtil.java Tue Sep  1 18:56:44 2015
@@ -22,6 +22,7 @@ import java.awt.font.TextAttribute;
 import java.awt.font.TextLayout;
 import java.awt.geom.AffineTransform;
 import java.text.AttributedString;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.poi.ss.usermodel.Cell;
@@ -148,7 +149,7 @@ public class SheetUtil {
                     sval = String.valueOf(cell.getNumericCellValue());
                 }
             } else if (cellType == Cell.CELL_TYPE_BOOLEAN) {
-                sval = String.valueOf(cell.getBooleanCellValue()).toUpperCase();
+                sval = String.valueOf(cell.getBooleanCellValue()).toUpperCase(Locale.ROOT);
             }
             if(sval != null) {
                 String txt = sval + defaultChar;
@@ -315,4 +316,4 @@ public class SheetUtil {
         //  live within any merged regions
         return null;
     }
-}
\ No newline at end of file
+}



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


Mime
View raw message