DataSpaceMapEntry entries[];\r
\r
public DataSpaceMap(DataSpaceMapEntry entries[]) {\r
- this.entries = entries;\r
+ this.entries = entries.clone();\r
}\r
\r
public DataSpaceMap(LittleEndianInput is) {\r
}\r
\r
public static class DataSpaceMapEntry implements EncryptionRecord {\r
- int referenceComponentType[];\r
- String referenceComponent[];\r
- String dataSpaceName;\r
+ final int referenceComponentType[];\r
+ final String referenceComponent[];\r
+ final String dataSpaceName;\r
\r
public DataSpaceMapEntry(int referenceComponentType[], String referenceComponent[], String dataSpaceName) {\r
- this.referenceComponentType = referenceComponentType;\r
- this.referenceComponent = referenceComponent;\r
+ this.referenceComponentType = referenceComponentType.clone();\r
+ this.referenceComponent = referenceComponent.clone();\r
this.dataSpaceName = dataSpaceName;\r
}\r
\r
String transformer[];\r
\r
public DataSpaceDefinition(String transformer[]) {\r
- this.transformer = transformer;\r
+ this.transformer = transformer.clone();\r
}\r
\r
public DataSpaceDefinition(LittleEndianInput is) {\r
}
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() {
}
protected void setKeySalt(byte salt[]) {
- this.keySalt = salt;
+ this.keySalt = (salt == null) ? null : salt.clone();
}
/**
}
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) {
}\r
\r
protected void setEncryptedHmacKey(byte[] encryptedHmacKey) {\r
- this.encryptedHmacKey = encryptedHmacKey;\r
+ this.encryptedHmacKey = (encryptedHmacKey == null) ? null : encryptedHmacKey.clone();\r
}\r
\r
public byte[] getEncryptedHmacValue() {\r
}\r
\r
protected void setEncryptedHmacValue(byte[] encryptedHmacValue) {\r
- this.encryptedHmacValue = encryptedHmacValue;\r
+ this.encryptedHmacValue = (encryptedHmacValue == null) ? null : encryptedHmacValue.clone();\r
}\r
}\r
* @param description\r
*/\r
public DigestInfo(byte[] digestValue, HashAlgorithm hashAlgo, String description) {\r
- this.digestValue = digestValue;\r
+ this.digestValue = digestValue.clone();\r
this.hashAlgo = hashAlgo;\r
this.description = description;\r
}\r
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];
* @param records the new child records
*/
public void setChildRecord(Record[] records) {
- this._children = records;
+ this._children = records.clone();
}
/* ===============================================================
/**
* 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
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;
try {
run.writeOut(bos);
} catch (IOException e) {
- throw new RuntimeException(e);
+ throw new HSLFException(e);
}
}
_data = bos.toByteArray();
* @param smartTagsBytes the unparsed smart tags, null to unset\r
*/\r
public void setSmartTagsBytes(byte[] smartTagsBytes) {\r
- this.smartTagsBytes = smartTagsBytes;\r
+ this.smartTagsBytes = (smartTagsBytes == null) ? null : smartTagsBytes.clone();\r
mask = smartTagFld.setBoolean(mask, smartTagsBytes != null);\r
}\r
\r
}
public void setRawData(byte[] data){
- rawdata = data;
+ rawdata = (data == null) ? null : data.clone();
}
/**