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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 8df560eed2 don't return inner bytes
8df560eed2 is described below

commit 8df560eed2dc223e140ac9e649a4523aab60248b
Author: PJ Fanning <[email protected]>
AuthorDate: Sun Aug 3 14:47:10 2025 +0100

    don't return inner bytes
---
 poi/src/main/java/org/apache/poi/hpsf/ClassID.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/poi/src/main/java/org/apache/poi/hpsf/ClassID.java 
b/poi/src/main/java/org/apache/poi/hpsf/ClassID.java
index 7e0ec5e2d8..7c99b1c4c3 100644
--- a/poi/src/main/java/org/apache/poi/hpsf/ClassID.java
+++ b/poi/src/main/java/org/apache/poi/hpsf/ClassID.java
@@ -109,11 +109,12 @@ public class ClassID implements Duplicatable, 
GenericRecord {
 
     /**
      * Gets the bytes making out the class ID. They are returned in correct 
order, i.e. big-endian.
+     * This no longer returns a reference to the internal byte array, but a 
copy of it.
      *
      * @return the bytes making out the class ID.
      */
     public byte[] getBytes() {
-        return bytes;
+        return bytes.clone();
     }
 
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to