From: Dominik Stadler Date: Thu, 26 Dec 2013 17:54:49 +0000 (+0000) Subject: Remove unnecessary separate length, an array already has one X-Git-Tag: REL_3_10_FINAL~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=95c628e04d70a74037a091d133df2a1c346dc18d;p=poi.git Remove unnecessary separate length, an array already has one git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1553522 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java index b6c56949d4..f38d7a26d8 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java @@ -44,11 +44,6 @@ public final class MemoryPackagePart extends PackagePart { */ protected byte[] data; - /** - * Size of data. - */ - protected int length; - /** * Constructor. * @@ -104,12 +99,11 @@ public final class MemoryPackagePart extends PackagePart { @Override public long getSize() { - return length; + return data == null ? 0 : data.length; } public void clear() { data = null; - length = 0; } @Override @@ -129,7 +123,6 @@ public final class MemoryPackagePart extends PackagePart { // Save it data = baos.toByteArray(); - length = data.length; // All done return true;