Fix OperatorWrap
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/commons/branches/Temp_Checkstyle@1567287 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/java/org/apache/xmlgraphics/image/GraphicsUtil.java b/src/java/org/apache/xmlgraphics/image/GraphicsUtil.java
index 61f9237..07b8f02 100644
--- a/src/java/org/apache/xmlgraphics/image/GraphicsUtil.java
+++ b/src/java/org/apache/xmlgraphics/image/GraphicsUtil.java
@@ -260,8 +260,8 @@
DataBufferInt srcDB = (DataBufferInt)src.getDataBuffer();
final int [] srcPixels = srcDB.getBankData()[0];
final int srcBase =
- (srcDB.getOffset() +
- srcSPPSM.getOffset(x0 - src.getSampleModelTranslateX(),
+ (srcDB.getOffset()
+ + srcSPPSM.getOffset(x0 - src.getSampleModelTranslateX(),
y0 - src.getSampleModelTranslateY()));
@@ -272,12 +272,12 @@
DataBufferInt dstDB = (DataBufferInt)dst.getDataBuffer();
final int [] dstPixels = dstDB.getBankData()[0];
final int dstBase =
- (dstDB.getOffset() +
- dstSPPSM.getOffset(x0 - dst.getSampleModelTranslateX(),
+ (dstDB.getOffset()
+ + dstSPPSM.getOffset(x0 - dst.getSampleModelTranslateX(),
y0 - dst.getSampleModelTranslateY()));
- if ((srcScanStride == dstScanStride) &&
- (srcScanStride == width)) {
+ if ((srcScanStride == dstScanStride)
+ && (srcScanStride == width)) {
// System.out.println("VERY Fast copyData");
System.arraycopy(srcPixels, srcBase, dstPixels, dstBase,
@@ -342,8 +342,8 @@
* @param dst The destination for the data.
*/
public static void copyData(Raster src, WritableRaster dst) {
- if (is_INT_PACK_Data(src.getSampleModel(), false) &&
- is_INT_PACK_Data(dst.getSampleModel(), false)) {
+ if (is_INT_PACK_Data(src.getSampleModel(), false)
+ && is_INT_PACK_Data(dst.getSampleModel(), false)) {
copyData_INT_PACK(src, dst);
return;
}
@@ -668,8 +668,8 @@
// " is: " + dst.isAlphaPremultiplied());
if (srcAlpha == dstAlpha) {
- if (!srcAlpha ||
- src.isAlphaPremultiplied() == dst.isAlphaPremultiplied()) {
+ if (!srcAlpha
+ || src.isAlphaPremultiplied() == dst.isAlphaPremultiplied()) {
// They match one another so just copy everything...
copyData(src.getRaster(), dst.getRaster());
return;
@@ -915,8 +915,8 @@
if (masks[2] != 0x000000ff) {
return false;
}
- if ((masks.length == 4) &&
- (masks[3] != 0xff000000)) {
+ if ((masks.length == 4)
+ && (masks[3] != 0xff000000)) {
return false;
}
@@ -948,8 +948,8 @@
final int scanStride = sppsm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
final int base
- = (db.getOffset() +
- sppsm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
+ = (db.getOffset()
+ + sppsm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
wr.getMinY() - wr.getSampleModelTranslateY()));
// Access the pixel data array
@@ -965,10 +965,10 @@
} else if (a < 255) {
int aFP = (0x00FF0000 / a);
pixels[sp] =
- ((a << 24) |
- (((((pixel & 0xFF0000) >> 16) * aFP) & 0xFF0000)) |
- (((((pixel & 0x00FF00) >> 8) * aFP) & 0xFF0000) >> 8) |
- (((((pixel & 0x0000FF)) * aFP) & 0xFF0000) >> 16));
+ ((a << 24)
+ | (((((pixel & 0xFF0000) >> 16) * aFP) & 0xFF0000))
+ | (((((pixel & 0x00FF00) >> 8) * aFP) & 0xFF0000) >> 8)
+ | (((((pixel & 0x0000FF)) * aFP) & 0xFF0000) >> 16));
}
sp++;
}
@@ -986,8 +986,8 @@
final int scanStride = sppsm.getScanlineStride();
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
final int base
- = (db.getOffset() +
- sppsm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
+ = (db.getOffset()
+ + sppsm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
wr.getMinY() - wr.getSampleModelTranslateY()));
// Access the pixel data array
final int[] pixels = db.getBankData()[0];
@@ -998,10 +998,10 @@
int pixel = pixels[sp];
int a = pixel >>> 24;
if ((a >= 0) && (a < 255)) { // this does NOT include a == 255 (0xff) !
- pixels[sp] = ((a << 24) |
- ((((pixel & 0xFF0000) * a) >> 8) & 0xFF0000) |
- ((((pixel & 0x00FF00) * a) >> 8) & 0x00FF00) |
- ((((pixel & 0x0000FF) * a) >> 8) & 0x0000FF));
+ pixels[sp] = ((a << 24)
+ | ((((pixel & 0xFF0000) * a) >> 8) & 0xFF0000)
+ | ((((pixel & 0x00FF00) * a) >> 8) & 0x00FF00)
+ | ((((pixel & 0x0000FF) * a) >> 8) & 0x0000FF));
}
sp++;
}
@@ -1023,8 +1023,8 @@
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
final int base
- = (db.getOffset() +
- csm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
+ = (db.getOffset()
+ + csm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
wr.getMinY() - wr.getSampleModelTranslateY()));
int aOff = bandOff[bandOff.length - 1];
@@ -1067,8 +1067,8 @@
DataBufferByte db = (DataBufferByte)wr.getDataBuffer();
final int base
- = (db.getOffset() +
- csm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
+ = (db.getOffset()
+ + csm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
wr.getMinY() - wr.getSampleModelTranslateY()));
diff --git a/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java b/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
index 44887bd..a54d4d3 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/png/PNGEncodeParam.java
@@ -137,8 +137,8 @@
* <code>IllegalArgumentException</code> will be thrown.
*/
public void setBitDepth(int bitDepth) {
- if (bitDepth != 1 && bitDepth != 2 && bitDepth != 4 &&
- bitDepth != 8) {
+ if (bitDepth != 1 && bitDepth != 2 && bitDepth != 4
+ && bitDepth != 8) {
throw new IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam2"));
}
this.bitDepth = bitDepth;
@@ -312,8 +312,8 @@
* values will be shifted and left-filled with zeroes.
*/
public void setBitDepth(int bitDepth) {
- if (bitDepth != 1 && bitDepth != 2 && bitDepth != 4 &&
- bitDepth != 8 && bitDepth != 16) {
+ if (bitDepth != 1 && bitDepth != 2 && bitDepth != 4
+ && bitDepth != 8 && bitDepth != 16) {
throw new IllegalArgumentException(PropertyUtil.getString("PNGEncodeParam2"));
}
this.bitDepth = bitDepth;
diff --git a/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java b/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
index 309f78f..4a8c29f 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageDecoder.java
@@ -423,8 +423,8 @@
bitDepth = chunk.getInt1(8);
- if ((bitDepth != 1) && (bitDepth != 2) && (bitDepth != 4) &&
- (bitDepth != 8) && (bitDepth != 16)) {
+ if ((bitDepth != 1) && (bitDepth != 2) && (bitDepth != 4)
+ && (bitDepth != 8) && (bitDepth != 16)) {
// Error -- bad bit depth
String msg = PropertyUtil.getString("PNGImageDecoder3");
throw new RuntimeException(msg);
@@ -432,11 +432,11 @@
maxOpacity = (1 << bitDepth) - 1;
colorType = chunk.getInt1(9);
- if ((colorType != PNG_COLOR_GRAY) &&
- (colorType != PNG_COLOR_RGB) &&
- (colorType != PNG_COLOR_PALETTE) &&
- (colorType != PNG_COLOR_GRAY_ALPHA) &&
- (colorType != PNG_COLOR_RGB_ALPHA)) {
+ if ((colorType != PNG_COLOR_GRAY)
+ && (colorType != PNG_COLOR_RGB)
+ && (colorType != PNG_COLOR_PALETTE)
+ && (colorType != PNG_COLOR_GRAY_ALPHA)
+ && (colorType != PNG_COLOR_RGB_ALPHA)) {
System.out.println(PropertyUtil.getString("PNGImageDecoder4"));
}
@@ -471,8 +471,8 @@
if (generateEncodeParam) {
if (colorType == PNG_COLOR_PALETTE) {
encodeParam = new PNGEncodeParam.Palette();
- } else if (colorType == PNG_COLOR_GRAY ||
- colorType == PNG_COLOR_GRAY_ALPHA) {
+ } else if (colorType == PNG_COLOR_GRAY
+ || colorType == PNG_COLOR_GRAY_ALPHA) {
encodeParam = new PNGEncodeParam.Gray();
} else {
encodeParam = new PNGEncodeParam.RGB();
@@ -655,8 +655,8 @@
// Create an empty WritableRaster
int depth = bitDepth;
- if ((colorType == PNG_COLOR_GRAY) &&
- (bitDepth < 8) && output8BitGray) {
+ if ((colorType == PNG_COLOR_GRAY)
+ && (bitDepth < 8) && output8BitGray) {
depth = 8;
}
if ((colorType == PNG_COLOR_PALETTE) && expandPalette) {
@@ -673,9 +673,9 @@
if (performGammaCorrection && (gammaLut == null)) {
initGammaLut(bitDepth);
}
- if ((postProcess == POST_GRAY_LUT) ||
- (postProcess == POST_GRAY_LUT_ADD_TRANS) ||
- (postProcess == POST_GRAY_LUT_ADD_TRANS_EXP)) {
+ if ((postProcess == POST_GRAY_LUT)
+ || (postProcess == POST_GRAY_LUT_ADD_TRANS)
+ || (postProcess == POST_GRAY_LUT_ADD_TRANS_EXP)) {
initGrayLut(bitDepth);
}
@@ -697,8 +697,8 @@
greenPalette,
bluePalette);
}
- } else if ((colorType == PNG_COLOR_GRAY) &&
- (bitDepth < 8) && !output8BitGray) {
+ } else if ((colorType == PNG_COLOR_GRAY)
+ && (bitDepth < 8) && !output8BitGray) {
byte[] palette = expandBits[bitDepth];
colorModel = new IndexColorModel(bitDepth,
palette.length,
@@ -1225,8 +1225,8 @@
setTransparentRGB(rgbTrans);
}
}
- } else if (colorType == PNG_COLOR_GRAY_ALPHA ||
- colorType == PNG_COLOR_RGB_ALPHA) {
+ } else if (colorType == PNG_COLOR_GRAY_ALPHA
+ || colorType == PNG_COLOR_RGB_ALPHA) {
// Error -- GA or RGBA image can't have a tRNS chunk.
String msg = PropertyUtil.getString("PNGImageDecoder15");
throw new RuntimeException(msg);
@@ -1489,9 +1489,9 @@
pd[1] = g;
pd[2] = b;
}
- if ((r == redTransparentAlpha) &&
- (g == greenTransparentAlpha) &&
- (b == blueTransparentAlpha)) {
+ if ((r == redTransparentAlpha)
+ && (g == greenTransparentAlpha)
+ && (b == blueTransparentAlpha)) {
pd[3] = 0;
} else {
pd[3] = maxOpacity;
diff --git a/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java b/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
index b76faa9..cc3d5bd 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/png/PNGImageEncoder.java
@@ -669,9 +669,9 @@
}
private void writeTRNS() throws IOException {
- if (param.isTransparencySet() &&
- (colorType != PNG_COLOR_GRAY_ALPHA) &&
- (colorType != PNG_COLOR_RGB_ALPHA)) {
+ if (param.isTransparencySet()
+ && (colorType != PNG_COLOR_GRAY_ALPHA)
+ && (colorType != PNG_COLOR_RGB_ALPHA)) {
ChunkStream cs = new ChunkStream("tRNS");
if (param instanceof PNGEncodeParam.Palette) {
@@ -843,9 +843,9 @@
int entries = 1 << bitDepth;
for (int i = 0; i < entries; i++) {
byte red = redPalette[i];
- if ((red != i * grayFactor) ||
- (red != greenPalette[i]) ||
- (red != bluePalette[i])) {
+ if ((red != i * grayFactor)
+ || (red != greenPalette[i])
+ || (red != bluePalette[i])) {
return null;
}
diff --git a/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java b/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
index 907bff0..93cd2fb 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/png/PNGRed.java
@@ -115,15 +115,15 @@
}
public int getInt2(int offset) {
- return ((data[offset] & 0xff) << 8) |
- (data[offset + 1] & 0xff);
+ return ((data[offset] & 0xff) << 8)
+ | (data[offset + 1] & 0xff);
}
public int getInt4(int offset) {
- return ((data[offset] & 0xff) << 24) |
- ((data[offset + 1] & 0xff) << 16) |
- ((data[offset + 2] & 0xff) << 8) |
- (data[offset + 3] & 0xff);
+ return ((data[offset] & 0xff) << 24)
+ | ((data[offset + 1] & 0xff) << 16)
+ | ((data[offset + 2] & 0xff) << 8)
+ | (data[offset + 3] & 0xff);
}
public String getString4(int offset) {
@@ -542,11 +542,11 @@
maxOpacity = (1 << bitDepth) - 1;
colorType = chunk.getInt1(9);
- if ((colorType != PNG_COLOR_GRAY) &&
- (colorType != PNG_COLOR_RGB) &&
- (colorType != PNG_COLOR_PALETTE) &&
- (colorType != PNG_COLOR_GRAY_ALPHA) &&
- (colorType != PNG_COLOR_RGB_ALPHA)) {
+ if ((colorType != PNG_COLOR_GRAY)
+ && (colorType != PNG_COLOR_RGB)
+ && (colorType != PNG_COLOR_PALETTE)
+ && (colorType != PNG_COLOR_GRAY_ALPHA)
+ && (colorType != PNG_COLOR_RGB_ALPHA)) {
System.out.println(PropertyUtil.getString("PNGImageDecoder4"));
}
@@ -581,8 +581,8 @@
if (generateEncodeParam) {
if (colorType == PNG_COLOR_PALETTE) {
encodeParam = new PNGEncodeParam.Palette();
- } else if (colorType == PNG_COLOR_GRAY ||
- colorType == PNG_COLOR_GRAY_ALPHA) {
+ } else if (colorType == PNG_COLOR_GRAY
+ || colorType == PNG_COLOR_GRAY_ALPHA) {
encodeParam = new PNGEncodeParam.Gray();
} else {
encodeParam = new PNGEncodeParam.RGB();
@@ -765,8 +765,8 @@
// Create an empty WritableRaster
int depth = bitDepth;
- if ((colorType == PNG_COLOR_GRAY) &&
- (bitDepth < 8) && output8BitGray) {
+ if ((colorType == PNG_COLOR_GRAY)
+ && (bitDepth < 8) && output8BitGray) {
depth = 8;
}
if ((colorType == PNG_COLOR_PALETTE) && expandPalette) {
@@ -786,9 +786,9 @@
if (performGammaCorrection && (gammaLut == null)) {
initGammaLut(bitDepth);
}
- if ((postProcess == POST_GRAY_LUT) ||
- (postProcess == POST_GRAY_LUT_ADD_TRANS) ||
- (postProcess == POST_GRAY_LUT_ADD_TRANS_EXP)) {
+ if ((postProcess == POST_GRAY_LUT)
+ || (postProcess == POST_GRAY_LUT_ADD_TRANS)
+ || (postProcess == POST_GRAY_LUT_ADD_TRANS_EXP)) {
initGrayLut(bitDepth);
}
@@ -818,8 +818,8 @@
greenPalette,
bluePalette);
}
- } else if ((colorType == PNG_COLOR_GRAY) &&
- (bitDepth < 8) && !output8BitGray) {
+ } else if ((colorType == PNG_COLOR_GRAY)
+ && (bitDepth < 8) && !output8BitGray) {
byte[] palette = expandBits[bitDepth];
cm = new IndexColorModel(bitDepth,
palette.length,
@@ -1348,8 +1348,8 @@
setTransparentRGB(rgbTrans);
}
}
- } else if (colorType == PNG_COLOR_GRAY_ALPHA ||
- colorType == PNG_COLOR_RGB_ALPHA) {
+ } else if (colorType == PNG_COLOR_GRAY_ALPHA
+ || colorType == PNG_COLOR_RGB_ALPHA) {
// Error -- GA or RGBA image can't have a tRNS chunk.
String msg = PropertyUtil.getString("PNGImageDecoder15");
throw new RuntimeException(msg);
@@ -1627,9 +1627,9 @@
pd[1] = g;
pd[2] = b;
}
- if ((r == redTransparentAlpha) &&
- (g == greenTransparentAlpha) &&
- (b == blueTransparentAlpha)) {
+ if ((r == redTransparentAlpha)
+ && (g == greenTransparentAlpha)
+ && (b == blueTransparentAlpha)) {
pd[3] = 0;
} else {
pd[3] = maxOpacity;
diff --git a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java
index 55e3240..df7dfb8 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFFaxDecoder.java
@@ -1363,8 +1363,8 @@
int i3 = 0;
if (bitsFromNext2NextByte != 0) {
i2 <<= bitsFromNext2NextByte;
- i3 = (next2next & table2[bitsFromNext2NextByte]) >>>
- (8 - bitsFromNext2NextByte);
+ i3 = (next2next & table2[bitsFromNext2NextByte])
+ >>> (8 - bitsFromNext2NextByte);
i2 |= i3;
bytePointer++;
bitPointer = bitsFromNext2NextByte;
diff --git a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
index 74345a6..6568487 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImage.java
@@ -129,8 +129,8 @@
try {
inflater.inflate(inflated);
} catch (DataFormatException dfe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage17") + ": " +
- dfe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage17") + ": "
+ + dfe.getMessage());
}
inflater.reset();
}
@@ -190,9 +190,9 @@
decodePaletteAsShorts = param.getDecodePaletteAsShorts();
// Read the specified directory.
- TIFFDirectory dir = param.getIFDOffset() == null ?
- new TIFFDirectory(stream, directory) :
- new TIFFDirectory(stream, param.getIFDOffset().longValue(),
+ TIFFDirectory dir = param.getIFDOffset() == null
+ ? new TIFFDirectory(stream, directory)
+ : new TIFFDirectory(stream, param.getIFDOffset().longValue(),
directory);
// Get the number of samples per pixel
@@ -202,9 +202,9 @@
// Read the TIFF_PLANAR_CONFIGURATION field
TIFFField planarConfigurationField =
dir.getField(TIFFImageDecoder.TIFF_PLANAR_CONFIGURATION);
- char[] planarConfiguration = planarConfigurationField == null ?
- new char[] {1} :
- planarConfigurationField.getAsChars();
+ char[] planarConfiguration = planarConfigurationField == null
+ ? new char[] {1}
+ : planarConfigurationField.getAsChars();
// Support planar format (band sequential) only for 1 sample/pixel.
if (planarConfiguration[0] != 1 && samplesPerPixel != 1) {
@@ -263,8 +263,8 @@
break;
case 16:
if (sampleFormat[0] != 3) {
- dataType = sampleFormat[0] == 2 ?
- DataBuffer.TYPE_SHORT : DataBuffer.TYPE_USHORT;
+ dataType = sampleFormat[0] == 2
+ ? DataBuffer.TYPE_SHORT : DataBuffer.TYPE_USHORT;
isValidDataFormat = true;
}
break;
@@ -328,8 +328,8 @@
}
break;
case 3: // RGB Palette
- if (samplesPerPixel == 1 &&
- (sampleSize == 4 || sampleSize == 8 || sampleSize == 16)) {
+ if (samplesPerPixel == 1
+ && (sampleSize == 4 || sampleSize == 8 || sampleSize == 16)) {
imageType = TYPE_PALETTE;
}
break;
@@ -385,18 +385,18 @@
// instead of the tile offsets and byte counts. Therefore
// we default here to the tile dimensions if they are written.
tileWidth =
- dir.getField(TIFFImageDecoder.TIFF_TILE_WIDTH) != null ?
- (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_WIDTH) :
- bounds.width;
+ dir.getField(TIFFImageDecoder.TIFF_TILE_WIDTH) != null
+ ? (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_WIDTH)
+ : bounds.width;
TIFFField field =
dir.getField(TIFFImageDecoder.TIFF_ROWS_PER_STRIP);
if (field == null) {
// Default is infinity (2^32 -1), basically the entire image
tileHeight =
- dir.getField(TIFFImageDecoder.TIFF_TILE_LENGTH) != null ?
- (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_LENGTH) :
- bounds.height;
+ dir.getField(TIFFImageDecoder.TIFF_TILE_LENGTH) != null
+ ? (int)dir.getFieldAsLong(TIFFImageDecoder.TIFF_TILE_LENGTH)
+ : bounds.height;
} else {
long l = field.getAsLong(0);
long infinity = 1;
@@ -743,8 +743,8 @@
* Returns tile (tileX, tileY) as a Raster.
*/
public synchronized Raster getTile(int tileX, int tileY) {
- if ((tileX < 0) || (tileX >= tilesX) ||
- (tileY < 0) || (tileY >= tilesY)) {
+ if ((tileX < 0) || (tileX >= tilesX)
+ || (tileY < 0) || (tileY >= tilesY)) {
throw new IllegalArgumentException(PropertyUtil.getString("TIFFImage12"));
}
@@ -783,8 +783,8 @@
save_offset = stream.getFilePointer();
stream.seek(tileOffsets[tileY * tilesX + tileX]);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
// Number of bytes in this tile (strip) after compression.
@@ -802,8 +802,8 @@
int unitsInThisTile = newRect.width * newRect.height * numBands;
// Allocate read buffer if needed.
- byte[] data = compression != COMP_NONE || imageType == TYPE_PALETTE ?
- new byte[byteCount] : null;
+ byte[] data = compression != COMP_NONE || imageType == TYPE_PALETTE
+ ? new byte[byteCount] : null;
// Read the data, uncompressing as needed. There are four cases:
// bilevel, palette-RGB, 4-bit grayscale, and everything else.
@@ -845,8 +845,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
} else if (imageType == TYPE_PALETTE) { // palette-RGB
if (sampleSize == 16) {
@@ -913,8 +913,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
if (dataType == DataBuffer.TYPE_USHORT) {
@@ -1013,8 +1013,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
}
@@ -1063,8 +1063,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
// Expand the palette image into an rgb image with ushort
@@ -1119,8 +1119,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
}
@@ -1138,8 +1138,8 @@
stream.readFully(data, 0, byteCount);
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
// If compressed, decode the data.
@@ -1225,8 +1225,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
}
}
@@ -1242,8 +1242,8 @@
if ((newRect.width % 8) == 0) {
bytesInThisTile = (newRect.width / 2) * newRect.height;
} else {
- bytesInThisTile = (newRect.width / 2 + 1) *
- newRect.height;
+ bytesInThisTile = (newRect.width / 2 + 1)
+ * newRect.height;
}
decodePackbits(data, bytesInThisTile, bdata);
@@ -1265,8 +1265,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
} else { // everything else
try {
@@ -1340,8 +1340,8 @@
unitsInThisTile);
}
- } else if (sampleSize == 32 &&
- dataType == DataBuffer.TYPE_INT) { // redundant
+ } else if (sampleSize == 32
+ && dataType == DataBuffer.TYPE_INT) { // redundant
if (compression == COMP_NONE) {
readInts(byteCount / 4, idata);
@@ -1389,8 +1389,8 @@
stream.seek(save_offset);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
// Modify the data for certain special cases.
@@ -1401,8 +1401,8 @@
// Since we are using a ComponentColorModel with this
// image, we need to change the WhiteIsZero data to
// BlackIsZero data so it will display properly.
- if (dataType == DataBuffer.TYPE_BYTE &&
- !(getColorModel() instanceof IndexColorModel)) {
+ if (dataType == DataBuffer.TYPE_BYTE
+ && !(getColorModel() instanceof IndexColorModel)) {
for (int l = 0; l < bdata.length; l += numBands) {
bdata[l] = (byte)(255 - bdata[l]);
@@ -1421,8 +1421,8 @@
}
} else if (dataType == DataBuffer.TYPE_INT) {
- long uintMax = ((long)Integer.MAX_VALUE -
- (long)Integer.MIN_VALUE);
+ long uintMax = ((long)Integer.MAX_VALUE
+ - (long)Integer.MIN_VALUE);
for (int l = 0; l < idata.length; l += numBands) {
idata[l] = (int)(uintMax - idata[l]);
}
@@ -1550,8 +1550,8 @@
try {
stream.readFully(byteArray, 0, byteCount);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
interpretBytesAsShorts(byteArray, shortArray, shortCount);
@@ -1567,8 +1567,8 @@
try {
stream.readFully(byteArray, 0, byteCount);
} catch (IOException ioe) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": " +
- ioe.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage13") + ": "
+ + ioe.getMessage());
}
interpretBytesAsInts(byteArray, intArray, intCount);
@@ -1612,19 +1612,19 @@
if (isBigEndian) {
for (int i = 0; i < intCount; i++) {
- intArray[i] = (((byteArray[j++] & 0xff) << 24) |
- ((byteArray[j++] & 0xff) << 16) |
- ((byteArray[j++] & 0xff) << 8) |
- (byteArray[j++] & 0xff));
+ intArray[i] = (((byteArray[j++] & 0xff) << 24)
+ | ((byteArray[j++] & 0xff) << 16)
+ | ((byteArray[j++] & 0xff) << 8)
+ | (byteArray[j++] & 0xff));
}
} else {
for (int i = 0; i < intCount; i++) {
- intArray[i] = ((byteArray[j++] & 0xff) |
- ((byteArray[j++] & 0xff) << 8) |
- ((byteArray[j++] & 0xff) << 16) |
- ((byteArray[j++] & 0xff) << 24));
+ intArray[i] = ((byteArray[j++] & 0xff)
+ | ((byteArray[j++] & 0xff) << 8)
+ | ((byteArray[j++] & 0xff) << 16)
+ | ((byteArray[j++] & 0xff) << 24));
}
}
}
@@ -1666,8 +1666,8 @@
}
}
} catch (java.lang.ArrayIndexOutOfBoundsException ae) {
- throw new RuntimeException(PropertyUtil.getString("TIFFImage14") + ": " +
- ae.getMessage());
+ throw new RuntimeException(PropertyUtil.getString("TIFFImage14") + ": "
+ + ae.getMessage());
}
return dst;
@@ -1690,8 +1690,8 @@
cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
break;
default:
- throw new IllegalArgumentException(PropertyUtil.getString("TIFFImage19") + ": " +
- numBands);
+ throw new IllegalArgumentException(PropertyUtil.getString("TIFFImage19") + ": "
+ + numBands);
}
int componentSize = 0;
@@ -1707,8 +1707,8 @@
componentSize = 32;
break;
default:
- throw new IllegalArgumentException(PropertyUtil.getString("TIFFImage20") + ": " +
- dataType);
+ throw new IllegalArgumentException(PropertyUtil.getString("TIFFImage20") + ": "
+ + dataType);
}
RGBBits = new int[numBands];
diff --git a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImageEncoder.java b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImageEncoder.java
index 57b60fd..0d286be 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImageEncoder.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFImageEncoder.java
@@ -519,11 +519,11 @@
// Whether to test for contiguous data.
boolean checkContiguous =
- ((dataTypeSize == 1 &&
- sampleModel instanceof MultiPixelPackedSampleModel &&
- dataType == DataBuffer.TYPE_BYTE) ||
- (dataTypeSize == 8 &&
- sampleModel instanceof ComponentSampleModel));
+ ((dataTypeSize == 1
+ && sampleModel instanceof MultiPixelPackedSampleModel
+ && dataType == DataBuffer.TYPE_BYTE)
+ || (dataTypeSize == 8
+ && sampleModel instanceof ComponentSampleModel));
// Also create a buffer to hold tileHeight lines of the
// data to be written to the file, so we can use array writes.
@@ -533,8 +533,8 @@
bpixels = new byte[tileHeight * tileWidth * numBands];
} else if (dataTypeIsShort) {
bpixels = new byte[2 * tileHeight * tileWidth * numBands];
- } else if (dataType == DataBuffer.TYPE_INT ||
- dataType == DataBuffer.TYPE_FLOAT) {
+ } else if (dataType == DataBuffer.TYPE_INT
+ || dataType == DataBuffer.TYPE_FLOAT) {
bpixels = new byte[4 * tileHeight * tileWidth * numBands];
}
}
@@ -544,8 +544,8 @@
int lastCol = minX + width;
int tileNum = 0;
for (int row = minY; row < lastRow; row += tileHeight) {
- int rows = isTiled ?
- tileHeight : Math.min(tileHeight, lastRow - row);
+ int rows = isTiled
+ ? tileHeight : Math.min(tileHeight, lastRow - row);
int size = rows * tileWidth * numBands;
for (int col = minX; col < lastCol; col += tileWidth) {
@@ -564,16 +564,16 @@
int pixelStride = csm.getPixelStride();
int lineStride = csm.getScanlineStride();
- if (pixelStride != numBands ||
- lineStride != bytesPerRow) {
+ if (pixelStride != numBands
+ || lineStride != bytesPerRow) {
useDataBuffer = false;
} else {
useDataBuffer = true;
for (int i = 0;
useDataBuffer && i < numBands;
i++) {
- if (bankIndices[i] != 0 ||
- bandOffsets[i] != i) {
+ if (bankIndices[i] != 0
+ || bandOffsets[i] != i) {
useDataBuffer = false;
}
}
@@ -581,9 +581,9 @@
} else { // 1-bit
MultiPixelPackedSampleModel mpp =
(MultiPixelPackedSampleModel)src.getSampleModel();
- if (mpp.getNumBands() == 1 &&
- mpp.getDataBitOffset() == 0 &&
- mpp.getPixelBitStride() == 1) {
+ if (mpp.getNumBands() == 1
+ && mpp.getDataBitOffset() == 0
+ && mpp.getPixelBitStride() == 1) {
useDataBuffer = true;
}
}
@@ -615,10 +615,10 @@
(MultiPixelPackedSampleModel)src.getSampleModel();
int lineStride = mpp.getScanlineStride();
int inOffset =
- mpp.getOffset(col -
- src.getSampleModelTranslateX(),
- row -
- src.getSampleModelTranslateY());
+ mpp.getOffset(col
+ - src.getSampleModelTranslateX(),
+ row
+ - src.getSampleModelTranslateY());
if (lineStride == bytesPerRow) {
System.arraycopy(btmp, inOffset,
bpixels, 0,
@@ -643,14 +643,14 @@
for (int j = 0; j < tileWidth / 8; j++) {
pixel =
- (pixels[index++] << 7) |
- (pixels[index++] << 6) |
- (pixels[index++] << 5) |
- (pixels[index++] << 4) |
- (pixels[index++] << 3) |
- (pixels[index++] << 2) |
- (pixels[index++] << 1) |
- pixels[index++];
+ (pixels[index++] << 7)
+ | (pixels[index++] << 6)
+ | (pixels[index++] << 5)
+ | (pixels[index++] << 4)
+ | (pixels[index++] << 3)
+ | (pixels[index++] << 2)
+ | (pixels[index++] << 1)
+ | pixels[index++];
bpixels[k++] = (byte)pixel;
}
@@ -730,10 +730,10 @@
ComponentSampleModel csm =
(ComponentSampleModel)src.getSampleModel();
int inOffset =
- csm.getOffset(col -
- src.getSampleModelTranslateX(),
- row -
- src.getSampleModelTranslateY());
+ csm.getOffset(col
+ - src.getSampleModelTranslateX(),
+ row
+ - src.getSampleModelTranslateY());
int lineStride = csm.getScanlineStride();
if (lineStride == bytesPerRow) {
System.arraycopy(btmp,
@@ -856,8 +856,8 @@
}
totalBytes += (int)tileByteCounts[numTiles - 1];
- nextIFDOffset = isLast ?
- 0 : ifdOffset + dirSize + totalBytes;
+ nextIFDOffset = isLast
+ ? 0 : ifdOffset + dirSize + totalBytes;
if ((nextIFDOffset & 0x01) != 0) { // make it even
nextIFDOffset++;
skipByte = true;
@@ -1323,8 +1323,8 @@
while (inOffset <= inMax) {
int run = 1;
byte replicate = input[inOffset];
- while (run < 127 && inOffset < inMax &&
- input[inOffset] == input[inOffset + 1]) {
+ while (run < 127 && inOffset < inMax
+ && input[inOffset] == input[inOffset + 1]) {
run++;
inOffset++;
}
@@ -1336,11 +1336,11 @@
run = 0;
int saveOffset = outOffset;
- while (run < 128 &&
- ((inOffset < inMax &&
- input[inOffset] != input[inOffset + 1]) ||
- (inOffset < inMaxMinus1 &&
- input[inOffset] != input[inOffset + 2]))) {
+ while (run < 128
+ && ((inOffset < inMax
+ && input[inOffset] != input[inOffset + 1])
+ || (inOffset < inMaxMinus1
+ && input[inOffset] != input[inOffset + 2]))) {
run++;
output[++outOffset] = input[inOffset++];
}
diff --git a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java
index 3c356c1..50f53f9 100644
--- a/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java
+++ b/src/java/org/apache/xmlgraphics/image/codec/tiff/TIFFLZWDecoder.java
@@ -87,8 +87,8 @@
int code, oldCode = 0;
byte[] string;
- while ((code = getNextCode()) != 257 &&
- dstIndex != uncompData.length) {
+ while ((code = getNextCode()) != 257
+ && dstIndex != uncompData.length) {
if (code == 256) {
diff --git a/src/java/org/apache/xmlgraphics/image/rendered/Any2sRGBRed.java b/src/java/org/apache/xmlgraphics/image/rendered/Any2sRGBRed.java
index b9b4a71..9770b9b 100644
--- a/src/java/org/apache/xmlgraphics/image/rendered/Any2sRGBRed.java
+++ b/src/java/org/apache/xmlgraphics/image/rendered/Any2sRGBRed.java
@@ -103,8 +103,8 @@
if (masks[2] != 0x000000ff) {
return false;
}
- if ((masks.length == 4) &&
- (masks[3] != 0xff000000)) {
+ if ((masks.length == 4)
+ && (masks[3] != 0xff000000)) {
return false;
}
@@ -148,8 +148,8 @@
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
final int srcBase
- = (db.getOffset() +
- sm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
+ = (db.getOffset()
+ + sm.getOffset(wr.getMinX() - wr.getSampleModelTranslateX(),
wr.getMinY() - wr.getSampleModelTranslateY()));
// Access the pixel data array
final int[] pixels = db.getBankData()[0];
@@ -167,10 +167,10 @@
while (sp < end) {
pix = pixels[sp];
pixels[sp] =
- ((pix & 0xFF000000) |
- (lut[(pix >>> 16) & 0xFF] << 16) |
- (lut[(pix >>> 8) & 0xFF] << 8) |
- (lut[pix & 0xFF]));
+ ((pix & 0xFF000000)
+ | (lut[(pix >>> 16) & 0xFF] << 16)
+ | (lut[(pix >>> 8) & 0xFF] << 8)
+ | (lut[pix & 0xFF]));
sp++;
}
}
@@ -187,8 +187,8 @@
// Fast case, Linear SRGB source, INT Pack writable raster...
- if (srcIsLsRGB &&
- is_INT_PACK_COMP(wr.getSampleModel())) {
+ if (srcIsLsRGB
+ && is_INT_PACK_COMP(wr.getSampleModel())) {
src.copyData(wr);
if (srcCM.hasAlpha()) {
GraphicsUtil.coerceData(wr, srcCM, false);
@@ -236,8 +236,8 @@
return wr;
}
- if (srcCM.getColorSpace() ==
- ColorSpace.getInstance(ColorSpace.CS_GRAY)) {
+ if (srcCM.getColorSpace()
+ == ColorSpace.getInstance(ColorSpace.CS_GRAY)) {
// This is a little bit of a hack. There is only
// a linear grayscale ICC profile in the JDK so
diff --git a/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java b/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java
index cc22649..e0c38c6 100644
--- a/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java
+++ b/src/java/org/apache/xmlgraphics/java2d/GraphicContext.java
@@ -885,8 +885,8 @@
//
Object antialiasingHint = hints.get(RenderingHints.KEY_TEXT_ANTIALIASING);
boolean isAntialiased = true;
- if (antialiasingHint != RenderingHints.VALUE_TEXT_ANTIALIAS_ON &&
- antialiasingHint != RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT) {
+ if (antialiasingHint != RenderingHints.VALUE_TEXT_ANTIALIAS_ON
+ && antialiasingHint != RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT) {
// If antialias was not turned off, then use the general rendering
// hint.
@@ -894,8 +894,8 @@
antialiasingHint = hints.get(RenderingHints.KEY_ANTIALIASING);
// Test general hint
- if (antialiasingHint != RenderingHints.VALUE_ANTIALIAS_ON &&
- antialiasingHint != RenderingHints.VALUE_ANTIALIAS_DEFAULT) {
+ if (antialiasingHint != RenderingHints.VALUE_ANTIALIAS_ON
+ && antialiasingHint != RenderingHints.VALUE_ANTIALIAS_DEFAULT) {
// Antialiasing was not requested. However, if it was not turned
// off explicitly, use it.
if (antialiasingHint == RenderingHints.VALUE_ANTIALIAS_OFF) {
diff --git a/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java b/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java
index e20adb1..78b6f97 100644
--- a/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java
+++ b/src/java/org/apache/xmlgraphics/java2d/TransformStackElement.java
@@ -126,8 +126,8 @@
txf.getMatrix(matrix);
return new TransformStackElement(TransformType.GENERAL, matrix) {
boolean isIdentity(double[] m) {
- return (m[0] == 1 && m[2] == 0 && m[4] == 0 &&
- m[1] == 0 && m[3] == 1 && m[5] == 0);
+ return (m[0] == 1 && m[2] == 0 && m[4] == 0
+ && m[1] == 0 && m[3] == 1 && m[5] == 0);
}
};
}
diff --git a/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java b/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java
index 47409fc..1d27178 100644
--- a/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java
+++ b/src/java/org/apache/xmlgraphics/util/io/Base64DecodeStream.java
@@ -148,9 +148,9 @@
int in = off, out = off;
while (in < off + count) {
- if ((decode_buffer[in] != '\n') &&
- (decode_buffer[in] != '\r') &&
- (decode_buffer[in] != ' ')) {
+ if ((decode_buffer[in] != '\n')
+ && (decode_buffer[in] != '\r')
+ && (decode_buffer[in] != ' ')) {
decode_buffer[out++] = decode_buffer[in];
}
in++;