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 2025/11/03 06:32:21 UTC

(poi) branch trunk updated (25a2dd9227 -> b16a094bba)

This is an automated email from the ASF dual-hosted git repository.

centic pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git


    from 25a2dd9227 Adjust parsing XSSFBuiltinTableStyle
     new a371cba0be Apply IDE suggestions
     new b16a094bba Fix JavaDoc

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/poi/integration/TestXLSX2CSV.java   |  2 +-
 .../org/apache/poi/xssf/usermodel/XSSFTextRun.java |  6 +++---
 .../java/org/apache/poi/xssf/TestXSSFParser.java   |  3 ++-
 .../java/org/apache/poi/hssf/util/HSSFColor.java   | 20 ++++++++++----------
 .../main/java/org/apache/poi/ss/util/CellUtil.java | 22 +++++++++++-----------
 5 files changed, 27 insertions(+), 26 deletions(-)


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


(poi) 01/02: Apply IDE suggestions

Posted by ce...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

centic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git

commit a371cba0be6891f935be884d746f5c05f70f23cc
Author: Dominik Stadler <do...@gmx.at>
AuthorDate: Sat Oct 25 10:01:15 2025 +0200

    Apply IDE suggestions
---
 .../org/apache/poi/integration/TestXLSX2CSV.java     |  2 +-
 .../org/apache/poi/xssf/usermodel/XSSFTextRun.java   |  6 +++---
 .../java/org/apache/poi/xssf/TestXSSFParser.java     |  3 ++-
 .../java/org/apache/poi/hssf/util/HSSFColor.java     | 20 ++++++++++----------
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/poi-examples/src/test/java/org/apache/poi/integration/TestXLSX2CSV.java b/poi-examples/src/test/java/org/apache/poi/integration/TestXLSX2CSV.java
index 91a64f4601..652bf69097 100644
--- a/poi-examples/src/test/java/org/apache/poi/integration/TestXLSX2CSV.java
+++ b/poi-examples/src/test/java/org/apache/poi/integration/TestXLSX2CSV.java
@@ -201,7 +201,7 @@ public class TestXLSX2CSV {
 	}
 
     @Test
-    public void testDeepFile() throws Exception {
+    public void testDeepFile() {
         // returns with some System.err
         try {
             assertThrows(IOException.class,
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java
index 3789335a16..58142dcbf3 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java
@@ -62,7 +62,7 @@ public class XSSFTextRun {
     }
 
     /**
-     * @param rgb
+     * @param rgb The RGB color value to set for the font
      * @since POI 5.5.0
      */
     public void setFontColor(byte[] rgb) {
@@ -272,7 +272,7 @@ public class XSSFTextRun {
 
     /**
      * Set whether the text in this run is formatted as superscript.
-     * Default base line offset is 30%
+     * Default base-line offset is 30%
      *
      * @see #setBaselineOffset(double)
      */
@@ -282,7 +282,7 @@ public class XSSFTextRun {
 
     /**
      * Set whether the text in this run is formatted as subscript.
-     * Default base line offset is -25%.
+     * Default base-line offset is -25%.
      *
      * @see #setBaselineOffset(double)
      */
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/TestXSSFParser.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/TestXSSFParser.java
index 8980782d11..856a651e2e 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xssf/TestXSSFParser.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/TestXSSFParser.java
@@ -46,8 +46,9 @@ public class TestXSSFParser {
     }
 
     @Test
-    void testFailOnXls() throws Exception {
+    void testFailOnXls() {
         final File file = HSSFTestDataSamples.getSampleFile("44010-SingleChart.xls");
+        //noinspection resource
         XSSFReadException xre = assertThrows(XSSFReadException.class, () -> XSSFParser.parse(file));
         assertInstanceOf(OLE2NotOfficeXmlFileException.class, xre.getCause());
     }
diff --git a/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java b/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java
index cc3d3ed796..761adedb53 100644
--- a/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java
+++ b/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java
@@ -35,7 +35,7 @@ import org.apache.poi.util.Removal;
  * Each color has an index (for the standard palette in Excel (tm) ),
  * native (RGB) triplet and string triplet.  The string triplet is as the
  * color would be represented by Gnumeric.  Having (string) this here is a bit of a
- * collision of function between HSSF and the HSSFSerializer but I think it's
+ * collision of function between HSSF and the HSSFSerializer, but I think it's
  * a reasonable one in this case.
  */
 public class HSSFColor implements Color {
@@ -165,8 +165,8 @@ public class HSSFColor implements Color {
      * </pre>
      * or specifying {@link #HSSFColor(int, int, int) RGB directly}.
      *
-     * @param index
-     * @param index2
+     * @param index Index to the standard color palette
+     * @param index2 Index to the alternate color palette
      * @param color color to extract RGB from
      * @deprecated use {@link #HSSFColor(int, int, int)} instead
      */
@@ -179,8 +179,8 @@ public class HSSFColor implements Color {
      * specifying RGB as an {@code int} value. Given {@code blue}, {@code green} and
      * {@code blue} being byte values between {@code 0x00 to 0xFF}, then
      * {@code rgb = blue + (green >> 8) + (red >> 16)}.
-     * @param index
-     * @param index2
+     * @param index Index to the standard color palette
+     * @param index2 Index to the alternate color palette
      * @param rgb combined value of RGB
      * @since POI 5.5.0
      */
@@ -218,11 +218,11 @@ public class HSSFColor implements Color {
         Map<Integer,HSSFColor> result = new HashMap<>(eList.size() * 3 / 2);
 
         for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) {
-            Integer index1 = Integer.valueOf(colorRef.getKey().getIndex());
+            Integer index1 = (int) colorRef.getKey().getIndex();
             if (!result.containsKey(index1)) {
                 result.put(index1, colorRef.getValue());
             }
-            Integer index2 = Integer.valueOf(colorRef.getKey().getIndex2());
+            Integer index2 = (int) colorRef.getKey().getIndex2();
             if (index2 != -1 && !result.containsKey(index2)) {
                 result.put(index2, colorRef.getValue());
             }
@@ -357,13 +357,13 @@ public class HSSFColor implements Color {
                Integer.toHexString(getBlue()*0x101)).toUpperCase(Locale.ROOT);
     }
 
-    private final short getBlue() {
+    private short getBlue() {
         return (short) (rgb & 0xFF);
     }
-    private final short getGreen() {
+    private short getGreen() {
         return (short) ((rgb >> 8) & 0xFF);
     }
-    private final short getRed() {
+    private short getRed() {
         return (short) ((rgb >> 16) & 0xFF);
     }
 


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


(poi) 02/02: Fix JavaDoc

Posted by ce...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

centic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git

commit b16a094bba9f8016c22400a7d7a4a1128f53f818
Author: Dominik Stadler <do...@gmx.at>
AuthorDate: Mon Nov 3 07:11:32 2025 +0100

    Fix JavaDoc
    
    Otherwise javadoc generation fails locally
---
 .../main/java/org/apache/poi/ss/util/CellUtil.java | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java b/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
index 8ee369755c..e1e758fd2a 100644
--- a/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
+++ b/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java
@@ -746,7 +746,7 @@ public final class CellUtil {
      * map will not modify the cell style. The returned map is mutable.
      *
      * @param style cell style
-     * @return map of format properties
+     * @return map of format properties (CellPropertyType -&gt; Object)
      * @see #setFormatProperties(CellStyle, Workbook, Map)
      * @since POI 5.5.0
      */
@@ -817,7 +817,7 @@ public final class CellUtil {
      *
      * @param style cell style
      * @param workbook parent workbook (can be null but some fomt info will not be copied if null is passed)
-     * @param properties map of format properties (CellPropertyType -> Object)
+     * @param properties map of format properties (CellPropertyType -&gt; Object)
      * @see #getFormatProperties(CellStyle)
      */
     private static void setFormatProperties(CellStyle style, Workbook workbook, Map<CellPropertyType, Object> properties) {
@@ -895,7 +895,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named short value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return zero if the property does not exist, or is not a {@link Short}
      *         otherwise the property value
@@ -922,7 +922,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named Color value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return null if the property does not exist, or is not a {@link Color}
      *         otherwise the property value
@@ -939,7 +939,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named int value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return zero if the property does not exist, or is not a {@link Integer}
      *         otherwise the property value
@@ -955,7 +955,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named BorderStyle value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return Border style if set, otherwise {@link BorderStyle#NONE}
      */
@@ -981,7 +981,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named FillPatternType value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return FillPatternType style if set, otherwise {@link FillPatternType#NO_FILL}
      * @since POI 3.15 beta 3
@@ -1008,7 +1008,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named HorizontalAlignment value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return HorizontalAlignment style if set, otherwise {@link HorizontalAlignment#GENERAL}
      * @since POI 3.15 beta 3
@@ -1035,7 +1035,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named VerticalAlignment value from the given map.
      *
-     * @param properties map of named properties (CellPropertyType -> Object)
+     * @param properties map of named properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return VerticalAlignment style if set, otherwise {@link VerticalAlignment#BOTTOM}
      * @since POI 3.15 beta 3
@@ -1062,7 +1062,7 @@ public final class CellUtil {
     /**
      * Utility method that returns the named boolean value from the given map.
      *
-     * @param properties map of properties (CellPropertyType -> Object)
+     * @param properties map of properties (CellPropertyType -&gt; Object)
      * @param property property
      * @return false if the property does not exist, or is not a {@link Boolean},
      *         true otherwise
@@ -1079,7 +1079,7 @@ public final class CellUtil {
     /**
      * Utility method that puts the given value to the given map.
      *
-     * @param properties map of properties (CellPropertyType -> Object)
+     * @param properties map of properties (CellPropertyType -&gt; Object)
      * @param property property
      * @param value property value
      */


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