Return-Path: X-Original-To: apmail-poi-commits-archive@minotaur.apache.org Delivered-To: apmail-poi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B138418161 for ; Tue, 1 Dec 2015 00:23:38 +0000 (UTC) Received: (qmail 62438 invoked by uid 500); 1 Dec 2015 00:23:38 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 62398 invoked by uid 500); 1 Dec 2015 00:23:38 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 62382 invoked by uid 99); 1 Dec 2015 00:23:38 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Dec 2015 00:23:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 15EDA1A0C97 for ; Tue, 1 Dec 2015 00:23:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.246 X-Spam-Level: * X-Spam-Status: No, score=1.246 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Zuw_G7yzvBAU for ; Tue, 1 Dec 2015 00:23:22 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 8D48623299 for ; Tue, 1 Dec 2015 00:23:22 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2453DE02E7 for ; Tue, 1 Dec 2015 00:23:22 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 2571F3A0046 for ; Tue, 1 Dec 2015 00:23:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1717359 - in /poi/trunk/src: java/org/apache/poi/poifs/crypt/ ooxml/java/org/apache/poi/poifs/crypt/agile/ ooxml/java/org/apache/poi/poifs/crypt/dsig/ scratchpad/src/org/apache/poi/hslf/model/textproperties/ scratchpad/src/org/apache/poi/h... Date: Tue, 01 Dec 2015 00:23:22 -0000 To: commits@poi.apache.org From: kiwiwings@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151201002322.2571F3A0046@svn01-us-west.apache.org> Author: kiwiwings Date: Tue Dec 1 00:23:21 2015 New Revision: 1717359 URL: http://svn.apache.org/viewvc?rev=1717359&view=rev Log: Sonar fixes, direct array parameter Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java poi/trunk/src/java/org/apache/poi/poifs/crypt/Decryptor.java poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionVerifier.java poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/DigestInfo.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java (original) +++ poi/trunk/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java Tue Dec 1 00:23:21 2015 @@ -91,7 +91,7 @@ public class DataSpaceMapUtils { DataSpaceMapEntry entries[]; public DataSpaceMap(DataSpaceMapEntry entries[]) { - this.entries = entries; + this.entries = entries.clone(); } public DataSpaceMap(LittleEndianInput is) { @@ -113,13 +113,13 @@ public class DataSpaceMapUtils { } public static class DataSpaceMapEntry implements EncryptionRecord { - int referenceComponentType[]; - String referenceComponent[]; - String dataSpaceName; + final int referenceComponentType[]; + final String referenceComponent[]; + final String dataSpaceName; public DataSpaceMapEntry(int referenceComponentType[], String referenceComponent[], String dataSpaceName) { - this.referenceComponentType = referenceComponentType; - this.referenceComponent = referenceComponent; + this.referenceComponentType = referenceComponentType.clone(); + this.referenceComponent = referenceComponent.clone(); this.dataSpaceName = dataSpaceName; } @@ -152,7 +152,7 @@ public class DataSpaceMapUtils { String transformer[]; public DataSpaceDefinition(String transformer[]) { - this.transformer = transformer; + this.transformer = transformer.clone(); } public DataSpaceDefinition(LittleEndianInput is) { Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/Decryptor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/Decryptor.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/poifs/crypt/Decryptor.java (original) +++ poi/trunk/src/java/org/apache/poi/poifs/crypt/Decryptor.java Tue Dec 1 00:23:21 2015 @@ -114,15 +114,15 @@ public abstract class Decryptor { } protected void setVerifier(byte[] verifier) { - this.verifier = verifier; + this.verifier = (verifier == null) ? null : verifier.clone(); } protected void setIntegrityHmacKey(byte[] integrityHmacKey) { - this.integrityHmacKey = integrityHmacKey; + this.integrityHmacKey = (integrityHmacKey == null) ? null : integrityHmacKey.clone(); } protected void setIntegrityHmacValue(byte[] integrityHmacValue) { - this.integrityHmacValue = integrityHmacValue; + this.integrityHmacValue = (integrityHmacValue == null) ? null : integrityHmacValue.clone(); } protected int getBlockSizeInBytes() { Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java (original) +++ poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java Tue Dec 1 00:23:21 2015 @@ -135,7 +135,7 @@ public abstract class EncryptionHeader { } protected void setKeySalt(byte salt[]) { - this.keySalt = salt; + this.keySalt = (salt == null) ? null : salt.clone(); } /** Modified: poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionVerifier.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionVerifier.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionVerifier.java (original) +++ poi/trunk/src/java/org/apache/poi/poifs/crypt/EncryptionVerifier.java Tue Dec 1 00:23:21 2015 @@ -100,19 +100,19 @@ public abstract class EncryptionVerifier } protected void setSalt(byte[] salt) { - this.salt = salt; + this.salt = (salt == null) ? null : salt.clone(); } protected void setEncryptedVerifier(byte[] encryptedVerifier) { - this.encryptedVerifier = encryptedVerifier; + this.encryptedVerifier = (encryptedVerifier == null) ? null : encryptedVerifier.clone(); } protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash) { - this.encryptedVerifierHash = encryptedVerifierHash; + this.encryptedVerifierHash = (encryptedVerifierHash == null) ? null : encryptedVerifierHash.clone(); } protected void setEncryptedKey(byte[] encryptedKey) { - this.encryptedKey = encryptedKey; + this.encryptedKey = (encryptedKey == null) ? null : encryptedKey.clone(); } protected void setSpinCount(int spinCount) { Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java Tue Dec 1 00:23:21 2015 @@ -111,7 +111,7 @@ public class AgileEncryptionHeader exten } protected void setEncryptedHmacKey(byte[] encryptedHmacKey) { - this.encryptedHmacKey = encryptedHmacKey; + this.encryptedHmacKey = (encryptedHmacKey == null) ? null : encryptedHmacKey.clone(); } public byte[] getEncryptedHmacValue() { @@ -119,6 +119,6 @@ public class AgileEncryptionHeader exten } protected void setEncryptedHmacValue(byte[] encryptedHmacValue) { - this.encryptedHmacValue = encryptedHmacValue; + this.encryptedHmacValue = (encryptedHmacValue == null) ? null : encryptedHmacValue.clone(); } } Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/DigestInfo.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/DigestInfo.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/DigestInfo.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/DigestInfo.java Tue Dec 1 00:23:21 2015 @@ -43,7 +43,7 @@ public class DigestInfo implements Seria * @param description */ public DigestInfo(byte[] digestValue, HashAlgorithm hashAlgo, String description) { - this.digestValue = digestValue; + this.digestValue = digestValue.clone(); this.hashAlgo = hashAlgo; this.description = description; } Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPFException9.java Tue Dec 1 00:23:21 2015 @@ -46,7 +46,7 @@ public class TextPFException9 { private final Short autoNumberStartNumber; private final static Short DEFAULT_START_NUMBER = 1; private final int recordLength; - public TextPFException9(final byte[] source, final int startIndex) { + public TextPFException9(final byte[] source, final int startIndex) { // NOSONAR //this.mask1 = source[startIndex]; //this.mask2 = source[startIndex + 1]; this.mask3 = source[startIndex + 2]; Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/RecordContainer.java Tue Dec 1 00:23:21 2015 @@ -247,7 +247,7 @@ public abstract class RecordContainer ex * @param records the new child records */ public void setChildRecord(Record[] records) { - this._children = records; + this._children = records.clone(); } /* =============================================================== Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/SlideListWithText.java Tue Dec 1 00:23:21 2015 @@ -153,12 +153,16 @@ public final class SlideListWithText ext /** * Get access to the SlideAtomsSets of the children of this record */ - public SlideAtomsSet[] getSlideAtomsSets() { return slideAtomsSets; } + public SlideAtomsSet[] getSlideAtomsSets() { + return slideAtomsSets; + } /** * Get access to the SlideAtomsSets of the children of this record */ - public void setSlideAtomsSets( SlideAtomsSet[] sas ) { slideAtomsSets = sas; } + public void setSlideAtomsSets( SlideAtomsSet[] sas ) { + slideAtomsSets = sas.clone(); + } /** * Return the value we were given at creation Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java Tue Dec 1 00:23:21 2015 @@ -17,10 +17,13 @@ package org.apache.poi.hslf.record; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import org.apache.poi.hslf.exceptions.HSLFException; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndianByteArrayInputStream; @@ -136,7 +139,7 @@ public final class TextSpecInfoAtom exte try { run.writeOut(bos); } catch (IOException e) { - throw new RuntimeException(e); + throw new HSLFException(e); } } _data = bos.toByteArray(); Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java Tue Dec 1 00:23:21 2015 @@ -305,7 +305,7 @@ public class TextSpecInfoRun { * @param smartTagsBytes the unparsed smart tags, null to unset */ public void setSmartTagsBytes(byte[] smartTagsBytes) { - this.smartTagsBytes = smartTagsBytes; + this.smartTagsBytes = (smartTagsBytes == null) ? null : smartTagsBytes.clone(); mask = smartTagFld.setBoolean(mask, smartTagsBytes != null); } Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java?rev=1717359&r1=1717358&r2=1717359&view=diff ============================================================================== --- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java (original) +++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFPictureData.java Tue Dec 1 00:23:21 2015 @@ -84,7 +84,7 @@ public abstract class HSLFPictureData im } public void setRawData(byte[] data){ - rawdata = data; + rawdata = (data == null) ? null : data.clone(); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org