Author: sebb
Date: Tue Oct 22 01:38:40 2013
New Revision: 1534457
URL: http://svn.apache.org/r1534457
Log:
Use getter instead of direct access to protected field
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageParser.java
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageParser.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageParser.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/ImageParser.java
Tue Oct 22 01:38:40 2013
@@ -258,7 +258,7 @@ public abstract class ImageParser extend
*/
public final IImageMetadata getMetadata(final File file, final
Map<String,Object> params)
throws ImageReadException, IOException {
- if (debug) {
+ if (getDebug()) {
System.out.println(getName() + ".getMetadata" + ": "
+ file.getName());
}
@@ -767,7 +767,7 @@ public abstract class ImageParser extend
return null;
}
- if (debug) {
+ if (getDebug()) {
System.out.println(getName() + ": " + file.getName());
}
@@ -827,7 +827,7 @@ public abstract class ImageParser extend
return null;
}
- if (debug) {
+ if (getDebug()) {
System.out.println(getName() + ": " + file.getName());
}
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
Tue Oct 22 01:38:40 2013
@@ -27,7 +27,7 @@ import org.apache.commons.imaging.ImageR
public class BinaryFileParser {
// default byte order for Java, many file formats.
private ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
- protected boolean debug = false;
+ private boolean debug = false;
public BinaryFileParser(final ByteOrder byteOrder) {
this.byteOrder = byteOrder;
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
Tue Oct 22 01:38:40 2013
@@ -101,7 +101,7 @@ public class GifImageParser extends Imag
formatCompliance.compare("version", 97, version3);
}
- if (debug) {
+ if (getDebug()) {
printCharQuad("identifier: ", ((identifier1 << 16)
| (identifier2 << 8) | (identifier3 << 0)));
printCharQuad("version: ",
@@ -127,24 +127,24 @@ public class GifImageParser extends Imag
final byte pixelAspectRatio = readByte("Pixel Aspect Ratio", is,
"Not a Valid GIF File");
- if (debug) {
+ if (getDebug()) {
printByteBits("PackedFields bits", packedFields);
}
final boolean globalColorTableFlag = ((packedFields & 128) > 0);
- if (debug) {
+ if (getDebug()) {
System.out.println("GlobalColorTableFlag: " +
globalColorTableFlag);
}
final byte colorResolution = (byte) ((packedFields >> 4) & 7);
- if (debug) {
+ if (getDebug()) {
System.out.println("ColorResolution: " + colorResolution);
}
final boolean sortFlag = ((packedFields & 8) > 0);
- if (debug) {
+ if (getDebug()) {
System.out.println("SortFlag: " + sortFlag);
}
final byte sizeofGlobalColorTable = (byte) (packedFields & 7);
- if (debug) {
+ if (getDebug()) {
System.out.println("SizeofGlobalColorTable: "
+ sizeofGlobalColorTable);
}
@@ -346,25 +346,25 @@ public class GifImageParser extends Imag
ghi.logicalScreenHeight - imageHeight, ImageTopPosition);
}
- if (debug) {
+ if (getDebug()) {
printByteBits("PackedFields bits", PackedFields);
}
final boolean LocalColorTableFlag = (((PackedFields >> 7) & 1) > 0);
- if (debug) {
+ if (getDebug()) {
System.out.println("LocalColorTableFlag: " + LocalColorTableFlag);
}
final boolean InterlaceFlag = (((PackedFields >> 6) & 1) > 0);
- if (debug) {
+ if (getDebug()) {
System.out.println("Interlace Flag: " + InterlaceFlag);
}
final boolean SortFlag = (((PackedFields >> 5) & 1) > 0);
- if (debug) {
+ if (getDebug()) {
System.out.println("Sort Flag: " + SortFlag);
}
final byte SizeofLocalColorTable = (byte) (PackedFields & 7);
- if (debug) {
+ if (getDebug()) {
System.out.println("SizeofLocalColorTable: "
+ SizeofLocalColorTable);
}
@@ -389,7 +389,7 @@ public class GifImageParser extends Imag
imageData = myLzwDecompressor.decompress(bais, size);
} else {
final int LZWMinimumCodeSize = is.read();
- if (debug) {
+ if (getDebug()) {
System.out.println("LZWMinimumCodeSize: " +
LZWMinimumCodeSize);
}
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
Tue Oct 22 01:38:40 2013
@@ -292,11 +292,11 @@ public class JpegImageParser extends Ima
final byte bytes[] = assembleSegments(filtered);
- if (debug) {
+ if (getDebug()) {
System.out.println("bytes" + ": " + bytes.length);
}
- if (debug) {
+ if (getDebug()) {
System.out.println("");
}
@@ -365,7 +365,7 @@ public class JpegImageParser extends Ima
}
final List<Segment> exifSegments = filterAPP1Segments(segments);
- if (debug) {
+ if (getDebug()) {
System.out.println("exif_segments.size" + ": "
+ exifSegments.size());
}
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/PngImageParser.java
Tue Oct 22 01:38:40 2013
@@ -160,14 +160,14 @@ public class PngImageParser extends Imag
final List<PngChunk> result = new ArrayList<PngChunk>();
while (true) {
- if (debug) {
+ if (getDebug()) {
System.out.println("");
}
final int length = read4Bytes("Length", is, "Not a Valid PNG
File");
final int chunkType = read4Bytes("ChunkType", is, "Not a Valid PNG
File");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ChunkType", chunkType);
debugNumber("Length", length, 4);
}
@@ -181,7 +181,7 @@ public class PngImageParser extends Imag
skipBytes(is, length, "Not a Valid PNG File");
}
- if (debug) {
+ if (getDebug()) {
if (bytes != null) {
debugNumber("bytes", bytes.length, 4);
}
@@ -726,11 +726,11 @@ public class PngImageParser extends Imag
if (sRGBs.size() == 1) {
// no color management neccesary.
- if (debug) {
+ if (getDebug()) {
System.out.println("sRGB, no color management neccesary.");
}
} else if (iCCPs.size() == 1) {
- if (debug) {
+ if (getDebug()) {
System.out.println("iCCP.");
}
@@ -842,7 +842,7 @@ public class PngImageParser extends Imag
final List<PngChunk> chunks = readChunks(byteSource, null, false);
final List<PngChunk> IHDRs = filterChunks(chunks, IHDR);
if (IHDRs.size() != 1) {
- if (debug) {
+ if (getDebug()) {
System.out.println("PNG contains more than one Header");
}
return false;
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java
Tue Oct 22 01:38:40 2013
@@ -96,7 +96,7 @@ public class TiffReader extends BinaryFi
skipBytes(is, offsetToFirstIFD - 8,
"Not a Valid TIFF File: couldn't find IFDs");
- if (debug) {
+ if (getDebug()) {
System.out.println("");
}
Modified:
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java?rev=1534457&r1=1534456&r2=1534457&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
(original)
+++
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/icc/IccProfileParser.java
Tue Oct 22 01:38:40 2013
@@ -99,7 +99,7 @@ public class IccProfileParser extends Bi
}
- if (debug) {
+ if (getDebug()) {
Debug.debug();
}
@@ -110,13 +110,13 @@ public class IccProfileParser extends Bi
final CachingInputStream cis = new CachingInputStream(is);
is = cis;
- if (debug) {
+ if (getDebug()) {
Debug.debug();
}
// setDebug(true);
- // if (debug)
+ // if (getDebug())
// Debug.debug("length: " + length);
try {
@@ -136,7 +136,7 @@ public class IccProfileParser extends Bi
final int CMMTypeSignature = read4Bytes("Signature", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("CMMTypeSignature", CMMTypeSignature);
}
@@ -146,20 +146,20 @@ public class IccProfileParser extends Bi
final int ProfileDeviceClassSignature = read4Bytes(
"ProfileDeviceClassSignature", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ProfileDeviceClassSignature",
ProfileDeviceClassSignature);
}
final int ColorSpace = read4Bytes("ColorSpace", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ColorSpace", ColorSpace);
}
final int ProfileConnectionSpace =
read4Bytes("ProfileConnectionSpace",
is, "Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ProfileConnectionSpace",
ProfileConnectionSpace);
}
@@ -167,32 +167,32 @@ public class IccProfileParser extends Bi
final int ProfileFileSignature =
read4Bytes("ProfileFileSignature", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ProfileFileSignature", ProfileFileSignature);
}
final int PrimaryPlatformSignature = read4Bytes(
"PrimaryPlatformSignature", is, "Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("PrimaryPlatformSignature",
PrimaryPlatformSignature);
}
final int VariousFlags = read4Bytes("ProfileFileSignature", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ProfileFileSignature", ProfileFileSignature);
}
final int DeviceManufacturer = read4Bytes("ProfileFileSignature",
is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("DeviceManufacturer", DeviceManufacturer);
}
final int DeviceModel = read4Bytes("DeviceModel", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("DeviceModel", DeviceModel);
}
@@ -200,7 +200,7 @@ public class IccProfileParser extends Bi
final int RenderingIntent = read4Bytes("RenderingIntent", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("RenderingIntent", RenderingIntent);
}
@@ -208,7 +208,7 @@ public class IccProfileParser extends Bi
final int ProfileCreatorSignature =
read4Bytes("ProfileCreatorSignature",
is, "Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("ProfileCreatorSignature",
ProfileCreatorSignature);
}
@@ -217,7 +217,7 @@ public class IccProfileParser extends Bi
skipBytes(is, 16, "Not a Valid ICC Profile");
// readByteArray("ProfileID", 16, is,
// "Not a Valid ICC Profile");
- // if (debug)
+ // if (getDebug())
// System.out
// .println("ProfileID: '" + new String(ProfileID) + "'");
@@ -282,7 +282,7 @@ public class IccProfileParser extends Bi
DeviceModel, RenderingIntent, ProfileCreatorSignature,
ProfileID, tags);
- if (debug) {
+ if (getDebug()) {
Debug.debug("issRGB: " + result.issRGB());
}
@@ -330,7 +330,7 @@ public class IccProfileParser extends Bi
public Boolean issRGB(final ByteSource byteSource) {
try {
- if (debug) {
+ if (getDebug()) {
Debug.debug();
}
@@ -338,7 +338,7 @@ public class IccProfileParser extends Bi
// long length = byteSource.getLength();
//
- // if (debug)
+ // if (getDebug())
// Debug.debug("length: " + length);
InputStream is = null;
@@ -358,13 +358,13 @@ public class IccProfileParser extends Bi
final int DeviceManufacturer =
read4Bytes("ProfileFileSignature", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("DeviceManufacturer", DeviceManufacturer);
}
final int DeviceModel = read4Bytes("DeviceModel", is,
"Not a Valid ICC Profile");
- if (debug) {
+ if (getDebug()) {
printCharQuad("DeviceModel", DeviceModel);
}