You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2015/05/22 16:54:06 UTC
svn commit: r1681137 - in /xmlgraphics/commons/trunk: ./
src/java/org/apache/xmlgraphics/image/codec/png/
src/java/org/apache/xmlgraphics/image/codec/tiff/
src/java/org/apache/xmlgraphics/image/loader/impl/
src/java/org/apache/xmlgraphics/image/loader/...
Author: ssteiner
Date: Fri May 22 14:54:05 2015
New Revision: 1681137
URL: http://svn.apache.org/r1681137
Log:
Revert using clone method for findbugs
Modified:
xmlgraphics/commons/trunk/findbugs-exclude.xml
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGChunk.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFEncodeParam.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/CompositeImageLoader.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryEPS.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryInternalTIFF.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryPNG.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRaw.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRawCCITTFax.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageRawStream.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java
Modified: xmlgraphics/commons/trunk/findbugs-exclude.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/findbugs-exclude.xml?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/findbugs-exclude.xml (original)
+++ xmlgraphics/commons/trunk/findbugs-exclude.xml Fri May 22 14:54:05 2015
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<FindBugsFilter>
<Match>
+ <Or>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Or>
+ </Match>
+ <Match>
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
</Match>
<Match>
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGChunk.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGChunk.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGChunk.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGChunk.java Fri May 22 14:54:05 2015
@@ -64,7 +64,7 @@ public class PNGChunk {
public PNGChunk(int length, int type, byte[] data, int crc) {
this.length = length;
this.type = type;
- this.data = data.clone();
+ this.data = data;
this.crc = crc;
this.typeString = typeIntToString(this.type);
}
@@ -82,7 +82,7 @@ public class PNGChunk {
}
public byte[] getData() {
- return data.clone();
+ return data;
}
public byte getByte(int offset) {
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java Fri May 22 14:54:05 2015
@@ -498,7 +498,7 @@ public abstract class PNGEncodeParam imp
if (rgb.length != 3) {
throw new IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam27"));
}
- backgroundRGB = rgb.clone();
+ backgroundRGB = rgb;
backgroundSet = true;
}
@@ -514,7 +514,7 @@ public abstract class PNGEncodeParam imp
if (!backgroundSet) {
throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam9"));
}
- return backgroundRGB.clone();
+ return backgroundRGB;
}
// tRNS chunk
@@ -783,7 +783,7 @@ public abstract class PNGEncodeParam imp
if (!paletteHistogramSet) {
throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam14"));
}
- return paletteHistogram.clone();
+ return paletteHistogram;
}
/**
@@ -1075,7 +1075,7 @@ public abstract class PNGEncodeParam imp
* <p> The 'tEXt' chunk will encode this information.
*/
public void setText(String[] text) {
- this.text = text.clone();
+ this.text = text;
textSet = true;
}
@@ -1092,7 +1092,7 @@ public abstract class PNGEncodeParam imp
if (!textSet) {
throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam20"));
}
- return text.clone();
+ return text;
}
/**
@@ -1124,7 +1124,7 @@ public abstract class PNGEncodeParam imp
* <p> The 'tIME' chunk will encode this information.
*/
public void setModificationTime(Date modificationTime) {
- this.modificationTime = (Date) modificationTime.clone();
+ this.modificationTime = modificationTime;
modificationTimeSet = true;
}
@@ -1140,7 +1140,7 @@ public abstract class PNGEncodeParam imp
if (!modificationTimeSet) {
throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam21"));
}
- return (Date) modificationTime.clone();
+ return modificationTime;
}
/**
@@ -1189,7 +1189,7 @@ public abstract class PNGEncodeParam imp
* <p> The 'zTXt' chunk will encode this information.
*/
public void setCompressedText(String[] text) {
- this.zText = text.clone();
+ this.zText = text;
zTextSet = true;
}
@@ -1208,7 +1208,7 @@ public abstract class PNGEncodeParam imp
if (!zTextSet) {
throw new IllegalStateException(PropertyUtil.getString("PNGEncodeParam22"));
}
- return zText.clone();
+ return zText;
}
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFDirectory.java Fri May 22 14:54:05 2015
@@ -405,7 +405,7 @@ public class TIFFDirectory implements Se
* in this directory.
*/
public TIFFField[] getFields() {
- return fields.clone();
+ return fields;
}
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFEncodeParam.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFEncodeParam.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFEncodeParam.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFEncodeParam.java Fri May 22 14:54:05 2015
@@ -240,7 +240,7 @@ public class TIFFEncodeParam implements
* copied by reference.
*/
public void setExtraFields(TIFFField[] extraFields) {
- this.extraFields = extraFields.clone();
+ this.extraFields = extraFields;
}
/**
@@ -250,6 +250,6 @@ public class TIFFEncodeParam implements
if (extraFields == null) {
return new TIFFField[0];
}
- return extraFields.clone();
+ return extraFields;
}
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java Fri May 22 14:54:05 2015
@@ -74,9 +74,9 @@ public class TIFFLZWDecoder {
initializeStringTable();
- this.data = data.clone();
+ this.data = data;
// this.h = h;
- this.uncompData = uncompData.clone();
+ this.uncompData = uncompData;
// Initialize pointers
bytePointer = 0;
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/CompositeImageLoader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/CompositeImageLoader.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/CompositeImageLoader.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/CompositeImageLoader.java Fri May 22 14:54:05 2015
@@ -57,7 +57,7 @@ public class CompositeImageLoader extend
"All ImageLoaders must produce the same target flavor");
}
}
- this.loaders = loaders.clone();
+ this.loaders = loaders;
}
/** {@inheritDoc} */
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryEPS.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryEPS.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryEPS.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryEPS.java Fri May 22 14:54:05 2015
@@ -37,13 +37,13 @@ public class ImageLoaderFactoryEPS exten
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
- return MIMES.clone();
+ return MIMES;
}
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
if (MimeConstants.MIME_EPS.equals(mime)) {
- return FLAVORS.clone();
+ return FLAVORS;
}
throw new IllegalArgumentException("Unsupported MIME type: " + mime);
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryInternalTIFF.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryInternalTIFF.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryInternalTIFF.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryInternalTIFF.java Fri May 22 14:54:05 2015
@@ -37,13 +37,13 @@ public class ImageLoaderFactoryInternalT
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
- return MIMES.clone();
+ return MIMES;
}
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
if (MimeConstants.MIME_TIFF.equals(mime)) {
- return FLAVORS.clone();
+ return FLAVORS;
}
throw new IllegalArgumentException("Unsupported MIME type: " + mime);
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryPNG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryPNG.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryPNG.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryPNG.java Fri May 22 14:54:05 2015
@@ -35,13 +35,13 @@ public class ImageLoaderFactoryPNG exten
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
- return MIMES.clone();
+ return MIMES;
}
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
if (MimeConstants.MIME_PNG.equals(mime)) {
- return FLAVORS.clone();
+ return FLAVORS;
}
throw new IllegalArgumentException("Unsupported MIME type: " + mime);
}
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRaw.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRaw.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRaw.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRaw.java Fri May 22 14:54:05 2015
@@ -64,14 +64,14 @@ public class ImageLoaderFactoryRaw exten
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
- return MIMES.clone();
+ return MIMES;
}
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
for (int i = 0, c = MIMES.length; i < c; i++) {
if (MIMES[i].equals(mime)) {
- return FLAVORS[i].clone();
+ return FLAVORS[i];
}
}
throw new IllegalArgumentException("Unsupported MIME type: " + mime);
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRawCCITTFax.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRawCCITTFax.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRawCCITTFax.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageLoaderFactoryRawCCITTFax.java Fri May 22 14:54:05 2015
@@ -63,14 +63,14 @@ public class ImageLoaderFactoryRawCCITTF
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
- return MIMES.clone();
+ return MIMES;
}
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
for (int i = 0, c = MIMES.length; i < c; i++) {
if (MIMES[i].equals(mime)) {
- return FLAVORS[i].clone();
+ return FLAVORS[i];
}
}
throw new IllegalArgumentException("Unsupported MIME type: " + mime);
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageRawStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageRawStream.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageRawStream.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/ImageRawStream.java Fri May 22 14:54:05 2015
@@ -193,7 +193,7 @@ public class ImageRawStream extends Abst
* @param data the byte array
*/
public ByteArrayStreamFactory(byte[] data) {
- this.data = data.clone();
+ this.data = data;
}
/** {@inheritDoc} */
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/impl/imageio/ImageLoaderFactoryImageIO.java Fri May 22 14:54:05 2015
@@ -41,7 +41,7 @@ public class ImageLoaderFactoryImageIO e
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
- return FLAVORS.clone();
+ return FLAVORS;
}
/** {@inheritDoc} */
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java Fri May 22 14:54:05 2015
@@ -149,7 +149,7 @@ public abstract class TransformStackElem
* @return array of values containing this transform element's parameters
*/
public double[] getTransformParameters() {
- return transformParameters.clone();
+ return transformParameters;
}
/**
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java?rev=1681137&r1=1681136&r2=1681137&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/color/profile/NamedColorProfile.java Fri May 22 14:54:05 2015
@@ -43,7 +43,7 @@ public class NamedColorProfile {
RenderingIntent intent) {
this.profileName = profileName;
this.copyright = copyright;
- this.namedColors = namedColors.clone();
+ this.namedColors = namedColors;
this.renderingIntent = intent;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org