You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/23 20:16:47 UTC

(commons-imaging) branch master updated (a6a9a9d5 -> cf67360e)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git


    from a6a9a9d5 Avoid NullPointerException in TiffImageParser.checkForSubImage(TiffImagingParameters) #304
     new 90dcacfa Sort members
     new 8c44dfd7 Format consistently
     new 886fde3e Manage SpotBugs configuration
     new 1b63210b Remove obsolete SpotBugs exclusions
     new 181b526f Better use of Objects.requireNonNull()
     new 2fb3075d Javadoc
     new fc286853 Remove obsolete SpotBugs exclusions
     new cf67360e Remove obsolete SpotBugs exclusions

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  10 +-
 src/conf/spotbugs-exclude-filter.xml               |  18 -
 .../commons/imaging/AbstractImageParser.java       | 671 ++++++++-------------
 .../org/apache/commons/imaging/ColorTools.java     |  71 +--
 .../apache/commons/imaging/FormatCompliance.java   |  31 +-
 .../org/apache/commons/imaging/ImageFormats.java   |  26 +-
 .../java/org/apache/commons/imaging/ImageInfo.java |  77 +--
 .../java/org/apache/commons/imaging/Imaging.java   | 421 ++++++-------
 .../apache/commons/imaging/ImagingConstants.java   |   7 +-
 .../commons/imaging/ImagingFormatException.java    |  11 +-
 .../apache/commons/imaging/ImagingParameters.java  |  18 +-
 .../commons/imaging/ImagingRuntimeException.java   |  14 +-
 .../org/apache/commons/imaging/PixelDensity.java   |   8 +-
 .../imaging/bytesource/InputStreamByteSource.java  |   4 +-
 .../commons/imaging/bytesource/package-info.java   |   1 -
 .../apache/commons/imaging/color/ColorCieLab.java  |  19 +-
 .../apache/commons/imaging/color/ColorCieLch.java  |  14 +-
 .../apache/commons/imaging/color/ColorCieLuv.java  |  16 +-
 .../org/apache/commons/imaging/color/ColorCmy.java |  19 +-
 .../apache/commons/imaging/color/ColorCmyk.java    |  21 +-
 .../commons/imaging/color/ColorConversions.java    | 146 +++--
 .../commons/imaging/color/ColorDin99Lab.java       |   5 +-
 .../org/apache/commons/imaging/color/ColorHsl.java |  16 +-
 .../org/apache/commons/imaging/color/ColorHsv.java |  16 +-
 .../commons/imaging/color/ColorHunterLab.java      |  16 +-
 .../org/apache/commons/imaging/color/ColorXyz.java |  19 +-
 .../apache/commons/imaging/common/Allocator.java   |  13 +-
 .../commons/imaging/common/BasicCParser.java       |  95 ++-
 .../common/BigEndianBinaryOutputStream.java        |  12 +-
 .../commons/imaging/common/BinaryFileParser.java   |   3 +-
 .../commons/imaging/common/BinaryFunctions.java    | 149 ++---
 .../imaging/common/BufferedImageFactory.java       |   6 +-
 .../commons/imaging/common/ByteConversions.java    | 177 +++---
 .../commons/imaging/common/ImageBuilder.java       | 168 ++----
 .../common/LittleEndianBinaryOutputStream.java     |  12 +-
 .../apache/commons/imaging/common/PackBits.java    |  17 +-
 .../commons/imaging/common/RationalNumber.java     |  87 ++-
 .../imaging/common/RgbBufferedImageFactory.java    |   6 +-
 .../imaging/common/SimpleBufferedImageFactory.java |   6 +-
 .../commons/imaging/common/XmpEmbeddable.java      |  19 +-
 .../apache/commons/imaging/common/ZlibDeflate.java |   8 +-
 .../commons/imaging/common/package-info.java       |   4 +-
 .../commons/imaging/formats/bmp/BmpHeaderInfo.java |  14 +-
 .../imaging/formats/bmp/BmpImageParser.java        | 102 ++--
 .../imaging/formats/bmp/BmpWriterPalette.java      |  12 +-
 .../commons/imaging/formats/bmp/BmpWriterRgb.java  |   8 +-
 .../imaging/formats/bmp/PixelParserBitFields.java  |  26 +-
 .../imaging/formats/bmp/PixelParserRgb.java        |  26 +-
 .../imaging/formats/bmp/PixelParserRle.java        |  26 +-
 .../commons/imaging/formats/bmp/package-info.java  |   1 -
 .../imaging/formats/dcx/DcxImageParser.java        |  34 +-
 .../commons/imaging/formats/dcx/package-info.java  |   1 -
 .../imaging/formats/gif/DisposalMethod.java        |   4 +-
 .../commons/imaging/formats/gif/GifHeaderInfo.java |   9 +-
 .../imaging/formats/gif/GifImageContents.java      |   3 +-
 .../imaging/formats/gif/GifImageParser.java        | 343 ++++-------
 .../formats/gif/GraphicControlExtension.java       |   4 +-
 .../imaging/formats/gif/ImageDescriptor.java       |   9 +-
 .../commons/imaging/formats/gif/package-info.java  |   1 -
 .../commons/imaging/formats/icns/IcnsDecoder.java  | 158 ++---
 .../imaging/formats/icns/IcnsImageParser.java      |  59 +-
 .../commons/imaging/formats/icns/IcnsType.java     | 130 ++--
 .../imaging/formats/icns/Rle24Compression.java     |   4 +-
 .../commons/imaging/formats/icns/package-info.java |   1 -
 .../imaging/formats/ico/IcoImageParser.java        | 234 ++++---
 .../commons/imaging/formats/ico/package-info.java  |   1 -
 .../imaging/formats/jpeg/JpegConstants.java        | 163 +++--
 .../imaging/formats/jpeg/JpegImageMetadata.java    |  19 +-
 .../imaging/formats/jpeg/JpegImageParser.java      | 196 ++----
 .../commons/imaging/formats/jpeg/JpegUtils.java    |  27 +-
 .../commons/imaging/formats/jpeg/decoder/Dct.java  |  95 +--
 .../imaging/formats/jpeg/decoder/JpegDecoder.java  | 147 ++---
 .../formats/jpeg/decoder/JpegInputStream.java      |  10 +-
 .../formats/jpeg/decoder/YCbCrConverter.java       |  25 +-
 .../imaging/formats/jpeg/decoder/ZigZag.java       |  12 +-
 .../imaging/formats/jpeg/exif/ExifRewriter.java    | 332 ++++------
 .../imaging/formats/jpeg/iptc/IptcBlock.java       |  10 +-
 .../imaging/formats/jpeg/iptc/IptcParser.java      |  91 +--
 .../imaging/formats/jpeg/iptc/IptcTypes.java       | 133 +---
 .../formats/jpeg/iptc/JpegIptcRewriter.java        | 278 +++------
 .../formats/jpeg/iptc/PhotoshopApp13Data.java      |   3 +-
 .../commons/imaging/formats/jpeg/package-info.java |   1 -
 .../formats/jpeg/segments/AbstractSegment.java     |  18 +-
 .../formats/jpeg/segments/App13Segment.java        |  14 +-
 .../imaging/formats/jpeg/segments/App2Segment.java |  14 +-
 .../imaging/formats/jpeg/segments/DhtSegment.java  |  14 +-
 .../imaging/formats/jpeg/segments/DqtSegment.java  |  25 +-
 .../formats/jpeg/segments/GenericSegment.java      |  13 +-
 .../imaging/formats/jpeg/segments/JfifSegment.java |  21 +-
 .../imaging/formats/jpeg/segments/SofnSegment.java |  29 +-
 .../imaging/formats/jpeg/segments/SosSegment.java  |  29 +-
 .../imaging/formats/jpeg/xmp/JpegRewriter.java     |  48 +-
 .../imaging/formats/jpeg/xmp/JpegXmpParser.java    |   3 +-
 .../imaging/formats/jpeg/xmp/JpegXmpRewriter.java  | 131 ++--
 .../imaging/formats/pcx/PcxImageParser.java        | 174 ++----
 .../imaging/formats/pcx/PcxImagingParameters.java  |   1 +
 .../commons/imaging/formats/pcx/PcxWriter.java     |  46 +-
 .../commons/imaging/formats/pcx/RleReader.java     |   3 +-
 .../commons/imaging/formats/pcx/RleWriter.java     |  19 +-
 .../commons/imaging/formats/pcx/package-info.java  |   1 -
 .../imaging/formats/png/AbstractPngText.java       |  13 +-
 .../imaging/formats/png/AbstractScanExpediter.java |  39 +-
 .../commons/imaging/formats/png/BitParser.java     |  10 +-
 .../commons/imaging/formats/png/ChunkType.java     |   2 +-
 .../commons/imaging/formats/png/FilterType.java    |   6 +-
 .../imaging/formats/png/GammaCorrection.java       |  12 +-
 .../imaging/formats/png/InterlaceMethod.java       |   3 +-
 .../commons/imaging/formats/png/PhysicalScale.java |  77 +--
 .../commons/imaging/formats/png/PngColorType.java  |  10 +-
 .../commons/imaging/formats/png/PngConstants.java  |  36 +-
 .../apache/commons/imaging/formats/png/PngCrc.java |  11 +-
 .../commons/imaging/formats/png/PngImageInfo.java  |  20 +-
 .../imaging/formats/png/PngImageParser.java        | 181 +++---
 .../imaging/formats/png/PngImagingParameters.java  |  27 +-
 .../commons/imaging/formats/png/PngWriter.java     | 240 +++-----
 .../formats/png/ScanExpediterInterlaced.java       |  17 +-
 .../imaging/formats/png/ScanExpediterSimple.java   |  11 +-
 .../imaging/formats/png/chunks/PngChunk.java       |  15 +-
 .../imaging/formats/png/chunks/PngChunkGama.java   |   3 +-
 .../imaging/formats/png/chunks/PngChunkIccp.java   |  13 +-
 .../imaging/formats/png/chunks/PngChunkItxt.java   |  14 +-
 .../imaging/formats/png/chunks/PngChunkPlte.java   |  22 +-
 .../commons/imaging/formats/png/package-info.java  |   1 -
 .../png/scanlinefilters/ScanlineFilter.java        |   3 +-
 .../png/scanlinefilters/ScanlineFilterAverage.java |   3 +-
 .../png/scanlinefilters/ScanlineFilterNone.java    |   3 +-
 .../png/scanlinefilters/ScanlineFilterPaeth.java   |   7 +-
 .../png/scanlinefilters/ScanlineFilterSub.java     |   5 +-
 .../png/scanlinefilters/ScanlineFilterUp.java      |   3 +-
 .../formats/png/scanlinefilters/package-info.java  |   1 -
 .../TransparencyFilterIndexedColor.java            |   7 +-
 .../TransparencyFilterTrueColor.java               |   7 +-
 .../png/transparencyfilters/package-info.java      |   1 -
 .../imaging/formats/pnm/AbstractFileInfo.java      |   5 +-
 .../commons/imaging/formats/pnm/PamFileInfo.java   |  50 +-
 .../commons/imaging/formats/pnm/PamWriter.java     |  19 +-
 .../commons/imaging/formats/pnm/PbmFileInfo.java   |   2 +-
 .../commons/imaging/formats/pnm/PbmWriter.java     |  19 +-
 .../commons/imaging/formats/pnm/PgmFileInfo.java   |  16 +-
 .../commons/imaging/formats/pnm/PgmWriter.java     |   9 +-
 .../commons/imaging/formats/pnm/PnmConstants.java  |   2 +-
 .../imaging/formats/pnm/PnmImageParser.java        |  70 +--
 .../imaging/formats/pnm/PnmImagingParameters.java  |   1 +
 .../commons/imaging/formats/pnm/PnmWriter.java     |   3 +-
 .../commons/imaging/formats/pnm/PpmFileInfo.java   |  10 +-
 .../commons/imaging/formats/pnm/PpmWriter.java     |  17 +-
 .../imaging/formats/pnm/WhiteSpaceReader.java      |   4 +-
 .../commons/imaging/formats/pnm/package-info.java  |   1 -
 .../imaging/formats/psd/ImageResourceType.java     | 111 ++--
 .../commons/imaging/formats/psd/PsdHeaderInfo.java |   3 +-
 .../imaging/formats/psd/PsdImageContents.java      |  18 +-
 .../imaging/formats/psd/PsdImageParser.java        | 178 ++----
 .../formats/psd/dataparsers/DataParser.java        |   3 +-
 .../formats/psd/dataparsers/DataParserBitmap.java  |   8 +-
 .../formats/psd/dataparsers/DataParserCmyk.java    |   3 +-
 .../psd/dataparsers/DataParserGrayscale.java       |   8 +-
 .../formats/psd/dataparsers/DataParserIndexed.java |   3 +-
 .../formats/psd/dataparsers/DataParserRgb.java     |   8 +-
 .../formats/psd/dataparsers/DataParserStub.java    |   3 +-
 .../formats/psd/dataparsers/package-info.java      |   1 -
 .../psd/datareaders/CompressedDataReader.java      |  10 +-
 .../formats/psd/datareaders/DataReader.java        |   6 +-
 .../psd/datareaders/UncompressedDataReader.java    |   6 +-
 .../formats/psd/datareaders/package-info.java      |   1 -
 .../commons/imaging/formats/psd/package-info.java  |   1 -
 .../imaging/formats/rgbe/RgbeImageParser.java      |  40 +-
 .../commons/imaging/formats/rgbe/RgbeInfo.java     |  16 +-
 .../commons/imaging/formats/rgbe/package-info.java |   1 -
 .../imaging/formats/tiff/AbstractTiffElement.java  |   5 +-
 .../formats/tiff/AbstractTiffImageData.java        |  58 +-
 .../commons/imaging/formats/tiff/TiffContents.java |   4 +-
 .../imaging/formats/tiff/TiffDirectory.java        | 407 +++++--------
 .../commons/imaging/formats/tiff/TiffField.java    | 119 ++--
 .../imaging/formats/tiff/TiffImageMetadata.java    |  86 +--
 .../imaging/formats/tiff/TiffImageParser.java      | 474 ++++++---------
 .../formats/tiff/TiffImagingParameters.java        |  93 ++-
 .../imaging/formats/tiff/TiffRasterData.java       | 119 ++--
 .../imaging/formats/tiff/TiffRasterDataFloat.java  | 124 ++--
 .../imaging/formats/tiff/TiffRasterDataInt.java    | 116 ++--
 .../imaging/formats/tiff/TiffRasterDataType.java   |  11 +-
 .../imaging/formats/tiff/TiffRasterStatistics.java |  20 +-
 .../commons/imaging/formats/tiff/TiffReader.java   | 131 ++--
 .../commons/imaging/formats/tiff/TiffTags.java     |  10 +-
 .../constants/AdobePageMaker6TagConstants.java     |  42 +-
 .../tiff/constants/AdobePhotoshopTagConstants.java |  17 +-
 .../constants/AliasSketchbookProTagConstants.java  |   7 +-
 .../formats/tiff/constants/DcfTagConstants.java    |  23 +-
 .../formats/tiff/constants/DngTagConstants.java    | 372 +++---------
 .../formats/tiff/constants/ExifTagConstants.java   | 618 ++++++-------------
 .../tiff/constants/GdalLibraryTagConstants.java    |   6 +-
 .../tiff/constants/GeoTiffTagConstants.java        |  33 +-
 .../formats/tiff/constants/GpsTagConstants.java    | 150 ++---
 .../tiff/constants/HylaFaxTagConstants.java        |  32 +-
 .../constants/MicrosoftHdPhotoTagConstants.java    | 259 +++-----
 .../tiff/constants/MicrosoftTagConstants.java      |  34 +-
 .../MolecularDynamicsGelTagConstants.java          |  45 +-
 .../tiff/constants/OceScanjobTagConstants.java     |  20 +-
 .../tiff/constants/Rfc2301TagConstants.java        |  67 +-
 .../formats/tiff/constants/Tiff4TagConstants.java  |   8 +-
 .../formats/tiff/constants/TiffConstants.java      |  15 +-
 .../formats/tiff/constants/TiffDirectoryType.java  |  28 +-
 .../formats/tiff/constants/TiffEpTagConstants.java |  94 +--
 .../tiff/constants/TiffPlanarConfiguration.java    |  25 +-
 .../formats/tiff/constants/TiffTagConstants.java   | 350 +++--------
 .../formats/tiff/constants/WangTagConstants.java   |  11 +-
 .../formats/tiff/constants/package-info.java       |   1 -
 .../formats/tiff/datareaders/BitInputStream.java   |  20 +-
 .../tiff/datareaders/DataInterpreterJpeg.java      |  70 +--
 .../formats/tiff/datareaders/DataReaderStrips.java | 177 ++----
 .../formats/tiff/datareaders/DataReaderTiled.java  | 128 ++--
 .../formats/tiff/datareaders/ImageDataReader.java  | 451 +++++---------
 .../formats/tiff/datareaders/package-info.java     |   1 -
 .../formats/tiff/fieldtypes/AbstractFieldType.java |  54 +-
 .../formats/tiff/fieldtypes/FieldTypeAscii.java    |  10 +-
 .../formats/tiff/fieldtypes/FieldTypeLong.java     |   3 +-
 .../formats/tiff/fieldtypes/FieldTypeLong8.java    |  10 +-
 .../formats/tiff/fieldtypes/FieldTypeRational.java |  11 +-
 .../formats/tiff/fieldtypes/package-info.java      |   1 -
 .../formats/tiff/itu_t4/BitArrayOutputStream.java  |   3 +-
 .../tiff/itu_t4/BitInputStreamFlexible.java        |  15 +-
 .../imaging/formats/tiff/itu_t4/HuffmanTree.java   |   7 +-
 .../formats/tiff/itu_t4/T4AndT6Compression.java    | 106 ++--
 .../imaging/formats/tiff/itu_t4/T4_T6_Tables.java  | 245 ++------
 .../imaging/formats/tiff/itu_t4/package-info.java  |   1 -
 .../commons/imaging/formats/tiff/package-info.java |   5 +-
 .../PhotometricInterpreter.java                    |  13 +-
 .../PhotometricInterpreterBiLevel.java             |  10 +-
 .../PhotometricInterpreterCieLab.java              |   6 +-
 .../PhotometricInterpreterCmyk.java                |   6 +-
 .../PhotometricInterpreterLogLuv.java              |  27 +-
 .../PhotometricInterpreterPalette.java             |  34 +-
 .../PhotometricInterpreterRgb.java                 |   8 +-
 .../PhotometricInterpreterYCbCr.java               |  37 +-
 .../floatingpoint/PaletteEntry.java                |  25 +-
 .../floatingpoint/PaletteEntryForRange.java        |  51 +-
 .../floatingpoint/PaletteEntryForValue.java        |   8 +-
 .../floatingpoint/PhotometricInterpreterFloat.java | 137 ++---
 .../floatingpoint/package-info.java                |   3 +-
 .../tiff/photometricinterpreters/package-info.java |   4 +-
 .../imaging/formats/tiff/taginfos/TagInfo.java     |  32 +-
 .../imaging/formats/tiff/taginfos/TagInfoAny.java  |   3 +-
 .../formats/tiff/taginfos/TagInfoAscii.java        |  12 +-
 .../formats/tiff/taginfos/TagInfoAsciiOrByte.java  |   6 +-
 .../tiff/taginfos/TagInfoAsciiOrRational.java      |   6 +-
 .../imaging/formats/tiff/taginfos/TagInfoByte.java |   6 +-
 .../formats/tiff/taginfos/TagInfoBytes.java        |   7 +-
 .../formats/tiff/taginfos/TagInfoDirectory.java    |   7 +-
 .../formats/tiff/taginfos/TagInfoGpsText.java      |  51 +-
 .../imaging/formats/tiff/taginfos/TagInfoLong.java |   4 +-
 .../formats/tiff/taginfos/TagInfoXpString.java     |   6 +-
 .../formats/tiff/taginfos/package-info.java        |   1 -
 .../tiff/write/AbstractTiffImageWriter.java        | 130 ++--
 .../formats/tiff/write/AbstractTiffOutputItem.java |   9 +-
 .../tiff/write/TiffImageWriterLossless.java        |  44 +-
 .../formats/tiff/write/TiffImageWriterLossy.java   |   7 +-
 .../formats/tiff/write/TiffOutputDirectory.java    | 384 ++++--------
 .../formats/tiff/write/TiffOutputField.java        |  23 +-
 .../imaging/formats/tiff/write/TiffOutputSet.java  |  61 +-
 .../formats/tiff/write/TiffOutputSummary.java      |  14 +-
 .../imaging/formats/tiff/write/package-info.java   |   1 -
 .../imaging/formats/wbmp/WbmpImageParser.java      |  84 +--
 .../commons/imaging/formats/wbmp/package-info.java |   1 -
 .../imaging/formats/webp/WebPChunkType.java        |  19 +-
 .../imaging/formats/webp/WebPConstants.java        |  10 +-
 .../imaging/formats/webp/WebPImageMetadata.java    |   8 +-
 .../imaging/formats/webp/WebPImageParser.java      |  91 ++-
 .../imaging/formats/webp/chunks/WebPChunk.java     |  24 +-
 .../imaging/formats/webp/chunks/WebPChunkAlph.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkAnim.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkAnmf.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkExif.java |   8 +-
 .../imaging/formats/webp/chunks/WebPChunkIccp.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkVp8.java  |  40 +-
 .../imaging/formats/webp/chunks/WebPChunkVp8l.java |  14 +-
 .../imaging/formats/webp/chunks/WebPChunkVp8x.java |   9 +-
 .../imaging/formats/webp/chunks/WebPChunkXml.java  |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkXyzw.java |   2 +-
 .../commons/imaging/formats/webp/package-info.java |   6 +-
 .../imaging/formats/xbm/XbmImageParser.java        | 110 ++--
 .../commons/imaging/formats/xbm/package-info.java  |   1 -
 .../imaging/formats/xpm/XpmImageParser.java        |  40 +-
 .../apache/commons/imaging/icc/IccConstants.java   |   6 +-
 .../apache/commons/imaging/icc/IccProfileInfo.java |  19 +-
 .../commons/imaging/icc/IccProfileParser.java      |  26 +-
 .../org/apache/commons/imaging/icc/IccTag.java     |  33 +-
 .../commons/imaging/icc/IccTagDataTypes.java       |  46 +-
 .../apache/commons/imaging/icc/IccTagTypes.java    | 398 ++++++------
 .../org/apache/commons/imaging/internal/Debug.java |  39 +-
 .../imaging/internal/ImageParserFactory.java       |   7 +-
 .../commons/imaging/internal/SafeOperations.java   |   2 +-
 .../imaging/mylzw/BitsToByteInputStream.java       |   4 +-
 .../commons/imaging/mylzw/MyBitInputStream.java    |   8 +-
 .../commons/imaging/mylzw/MyBitOutputStream.java   |  17 +-
 .../commons/imaging/mylzw/MyLzwCompressor.java     |  27 +-
 .../commons/imaging/mylzw/MyLzwDecompressor.java   |  15 +-
 .../apache/commons/imaging/mylzw/package-info.java |   1 -
 .../org/apache/commons/imaging/package-info.java   |   1 -
 .../commons/imaging/palette/ColorComponent.java    |   7 +-
 .../apache/commons/imaging/palette/ColorCount.java |   8 +-
 .../imaging/palette/ColorCountComparator.java      |  13 +-
 .../apache/commons/imaging/palette/ColorGroup.java |  19 +-
 .../commons/imaging/palette/ColorSpaceSubset.java  |  53 +-
 .../apache/commons/imaging/palette/Dithering.java  |  25 +-
 .../imaging/palette/LongestAxisMedianCut.java      |  49 +-
 .../apache/commons/imaging/palette/MedianCut.java  |   3 +-
 .../imaging/palette/MedianCutQuantizer.java        |  17 +-
 .../palette/MostPopulatedBoxesMedianCut.java       |  45 +-
 .../commons/imaging/palette/PaletteFactory.java    |  87 ++-
 .../commons/imaging/palette/QuantizedPalette.java  |  11 +-
 .../commons/imaging/AbstractImagingTest.java       |  18 +-
 .../commons/imaging/ImagingGuessFormatTest.java    |  16 +-
 .../org/apache/commons/imaging/TestImageInfo.java  |  74 +--
 .../imaging/bytesource/AbstractByteSourceTest.java |   9 +-
 .../imaging/bytesource/ByteSourceDataTest.java     |   3 +-
 .../imaging/bytesource/ByteSourceImageTest.java    |  30 +-
 .../bytesource/ByteSourceInputStreamTest.java      |   2 +-
 .../apache/commons/imaging/color/ColorCmyTest.java |   6 +-
 .../imaging/color/ColorConversionsTest.java        |  10 +-
 .../apache/commons/imaging/color/ColorHslTest.java |   4 +-
 .../commons/imaging/common/RationalNumberTest.java |   9 +-
 .../examples/ApacheImagingSpeedAndMemoryTest.java  |  25 +-
 .../commons/imaging/examples/ImageReadExample.java |  15 +-
 .../imaging/examples/ImageWriteExample.java        |   3 +-
 .../commons/imaging/examples/MetadataExample.java  |  68 +--
 .../imaging/examples/WriteExifMetadataExample.java |  48 +-
 .../tiff/ExampleReadFloatingPointData.java         |  64 +-
 .../examples/tiff/ReadAndRenderFloatingPoint.java  |  61 +-
 .../imaging/examples/tiff/ReadTagsAndImages.java   | 502 +++++++--------
 .../imaging/examples/tiff/SurveyTiffFile.java      | 184 +++---
 .../imaging/examples/tiff/SurveyTiffFolder.java    |  19 +-
 .../imaging/examples/tiff/package-info.java        |   3 +-
 .../imaging/formats/bmp/BmpImageParserTest.java    |   3 +
 .../commons/imaging/formats/bmp/BmpReadTest.java   |   6 +-
 .../imaging/formats/bmp/BmpRoundtripTest.java      |  10 +-
 .../imaging/formats/bmp/BmpWriterRgbTest.java      |   4 +-
 .../commons/imaging/formats/gif/GifReadTest.java   |  27 +-
 .../commons/imaging/formats/icns/IcnsReadTest.java |  23 +-
 .../imaging/formats/icns/IcnsRoundTripTest.java    |  68 +--
 .../imaging/formats/ico/AbstractIcoTest.java       |   3 +-
 .../imaging/formats/ico/IcoRoundtripTest.java      | 149 ++---
 .../commons/imaging/formats/jpeg/JpegReadTest.java |  19 +-
 .../jpeg/JpegWithInvalidDhtSegmentTest.java        |   3 +-
 .../imaging/formats/jpeg/decoder/DctTest.java      |  25 +-
 .../formats/jpeg/decoder/JpegInputStreamTest.java  |  29 +-
 .../formats/jpeg/exif/AbstractExifTest.java        |   6 +-
 .../jpeg/exif/AbstractSpecificExifTagTest.java     |   6 +-
 .../imaging/formats/jpeg/exif/AsciiFieldTest.java  |  15 +-
 .../imaging/formats/jpeg/exif/ExifRewriteTest.java |  35 +-
 .../jpeg/exif/ExifRewriterRoundtripTest.java       |  21 +-
 .../formats/jpeg/exif/MakerNoteFieldTest.java      |   3 +-
 .../formats/jpeg/exif/MicrosoftTagTest.java        |   4 +-
 .../imaging/formats/jpeg/exif/TextFieldTest.java   |   9 +-
 .../jpeg/exif/WriteExifMetadataExampleTest.java    |   1 +
 .../imaging/formats/jpeg/iptc/IptcAddTest.java     |  11 +-
 .../imaging/formats/jpeg/iptc/IptcBaseTest.java    |  21 +-
 .../imaging/formats/jpeg/iptc/IptcDumpTest.java    |   4 +-
 .../imaging/formats/jpeg/iptc/IptcParserTest.java  |  32 +-
 .../formats/jpeg/iptc/IptcTypeLookupTest.java      |   2 +-
 .../imaging/formats/jpeg/iptc/IptcUpdateTest.java  |  39 +-
 .../formats/jpeg/segments/App2SegmentTest.java     |  33 +-
 .../formats/jpeg/segments/AppnSegmentTest.java     |  14 +-
 .../formats/jpeg/segments/JfifSegmentTest.java     |  24 +-
 .../formats/jpeg/segments/SosSegmentTest.java      |  34 +-
 .../formats/jpeg/specific/JpegImageParserTest.java |   1 +
 .../formats/jpeg/xmp/AbstractJpegXmpTest.java      |  15 +-
 .../formats/jpeg/xmp/JpegXmpParserTest.java        |   2 +-
 .../formats/jpeg/xmp/JpegXmpRewriteTest.java       |  12 +-
 .../commons/imaging/formats/pcx/RleReaderTest.java |   4 +-
 .../imaging/formats/png/ConvertPngToGifTest.java   |   3 +-
 .../imaging/formats/png/PhysicalScaleTest.java     |  34 +-
 .../commons/imaging/formats/png/PngCrcTest.java    |   4 +-
 .../imaging/formats/png/PngImageParserTest.java    |  13 +-
 .../commons/imaging/formats/png/PngReadTest.java   |  42 +-
 .../commons/imaging/formats/png/PngTextTest.java   |   6 +-
 .../png/PngWithInvalidPngChunkSizeTest.java        |   6 +-
 .../imaging/formats/png/PngWritePredictorTest.java |   9 +-
 .../imaging/formats/png/PngWriteReadTest.java      |  22 +-
 .../commons/imaging/formats/png/PngWriterTest.java |  30 +-
 .../formats/png/chunks/PngChunkScalTest.java       |  74 ++-
 .../formats/png/chunks/PngChunkTextTest.java       |   2 +-
 .../scanlinefilters/ScanlineFilterAverageTest.java |  16 +-
 .../scanlinefilters/ScanlineFilterPaethTest.java   |  16 +-
 .../png/scanlinefilters/ScanlineFilterUpTest.java  |  14 +-
 .../TransparencyFilterIndexedColorTest.java        |   4 +-
 .../imaging/formats/pnm/PbmFileInfoTest.java       |  30 +-
 .../imaging/formats/pnm/PnmImageParserTest.java    |   6 +-
 .../imaging/formats/pnm/PpmFileInfoTest.java       |  17 +-
 .../imaging/formats/pnm/WhiteSpaceReaderTest.java  |  20 +-
 .../formats/psd/ImageResourceBlockTest.java        |   4 +-
 .../imaging/formats/psd/ImageResourceTypeTest.java |   2 +-
 .../psd/dataparsers/DataParserGrayscaleTest.java   |  12 +-
 .../psd/dataparsers/DataParserIndexedTest.java     |  24 +-
 .../formats/psd/dataparsers/DataParserLabTest.java |  12 +-
 .../imaging/formats/tiff/JpegImageDataTest.java    |   4 +-
 .../formats/tiff/TiffAlphaRoundTripTest.java       |  73 +--
 .../imaging/formats/tiff/TiffBigTiffTest.java      |  83 ++-
 .../imaging/formats/tiff/TiffCcittTest.java        |  57 +-
 .../tiff/TiffFloatingPointMultivariableTest.java   | 195 +++---
 .../formats/tiff/TiffFloatingPointReadTest.java    |  55 +-
 .../tiff/TiffFloatingPointRoundTripTest.java       | 161 ++---
 .../commons/imaging/formats/tiff/TiffJpegTest.java | 136 ++---
 .../commons/imaging/formats/tiff/TiffLzwTest.java  |  55 +-
 .../formats/tiff/TiffRasterDataIntTest.java        |  15 +-
 .../imaging/formats/tiff/TiffRasterDataTest.java   |   4 +-
 .../formats/tiff/TiffRasterStatisticsTest.java     |   3 +-
 .../imaging/formats/tiff/TiffReadAlphaTest.java    |  21 +-
 .../formats/tiff/TiffReadImageInfoTest.java        |  41 +-
 .../commons/imaging/formats/tiff/TiffReadTest.java |   8 +-
 .../formats/tiff/TiffRoundTripInt32Test.java       |  81 +--
 .../imaging/formats/tiff/TiffRoundtripTest.java    |   8 +-
 .../formats/tiff/TiffShortIntRoundTripTest.java    |  73 +--
 .../imaging/formats/tiff/TiffSubImageTest.java     |  34 +-
 .../imaging/formats/tiff/TiffTagIntegrityTest.java |  34 +-
 .../commons/imaging/formats/tiff/TiffTagsTest.java |   8 +-
 .../tiff/datareaders/DataReaderStripsTest.java     |  12 +-
 .../tiff/fieldtypes/FieldTypeAsciiTest.java        |  35 +-
 .../formats/tiff/fieldtypes/FieldTypeByteTest.java |  14 +-
 .../tiff/fieldtypes/FieldTypeRationalTest.java     |  31 +-
 .../formats/tiff/fieldtypes/FieldTypeTest.java     |  22 +-
 .../tiff/itu_t4/HuffmanTreeExceptionTest.java      |   2 +-
 .../PhotometricInterpreterLogLuvTest.java          |   9 +-
 .../PhotometricInterpreterRgbTest.java             |   9 +-
 .../floatingpoint/PaletteEntryForRangeTest.java    |  15 +-
 .../floatingpoint/PaletteEntryForValueTest.java    |   3 +-
 .../PhotometricInterpreterFloatTest.java           |   9 +-
 .../tiff/taginfos/TagInfoByteOrShortTest.java      |   2 +-
 .../formats/tiff/taginfos/TagInfoByteTest.java     |   2 +-
 .../formats/tiff/taginfos/TagInfoSByteTest.java    |  18 +-
 .../formats/tiff/taginfos/TagInfoSBytesTest.java   |  20 +-
 .../formats/tiff/taginfos/TagInfoSLongTest.java    |  16 +-
 .../formats/tiff/taginfos/TagInfoSShortTest.java   |  16 +-
 .../formats/tiff/taginfos/TagInfoSShortsTest.java  |  18 +-
 .../formats/tiff/taginfos/TagInfoUnknownTest.java  |  14 +-
 .../commons/imaging/formats/webp/WebPBaseTest.java |  11 +-
 .../commons/imaging/formats/webp/WebPDumpTest.java |  14 +-
 .../imaging/formats/webp/WebPMetadataTest.java     |  24 +-
 .../commons/imaging/formats/webp/WebPReadTest.java |  14 +-
 .../commons/imaging/formats/xmp/XmpUpdateTest.java |   6 +-
 .../commons/imaging/palette/DitheringTest.java     |  58 +-
 .../imaging/palette/PaletteQuantizationTest.java   |  11 +-
 .../commons/imaging/palette/SimplePaletteTest.java |   6 +-
 .../imaging/roundtrip/BitmapRoundtripTest.java     |   3 +-
 .../commons/imaging/roundtrip/FormatInfo.java      | 132 ++--
 .../imaging/roundtrip/FullColorRoundtrip.java      |   3 +-
 .../imaging/roundtrip/GrayscaleRountripTest.java   |   7 +-
 .../commons/imaging/roundtrip/ImageAsserts.java    |  19 +-
 .../roundtrip/LimitedColorRoundtripTest.java       |  21 +-
 .../imaging/roundtrip/PixelDensityRoundtrip.java   |   6 +-
 .../commons/imaging/roundtrip/RoundtripBase.java   |   5 +-
 .../commons/imaging/roundtrip/TestImages.java      |  40 +-
 .../commons/imaging/test/FileSystemTraversal.java  |  26 +-
 .../imaging/test/PrintShallowObjectSizes.java      |   6 +-
 .../apache/commons/imaging/test/TestResources.java |  10 +-
 453 files changed, 7273 insertions(+), 12186 deletions(-)


(commons-imaging) 03/08: Manage SpotBugs configuration

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 886fde3e38a546e08912ad46c2c84ce93c1d5b52
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:45:30 2023 -0500

    Manage SpotBugs configuration
---
 pom.xml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3cdf0bb2..f55191a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,9 +156,6 @@
       <plugin>
         <groupId>com.github.spotbugs</groupId>
         <artifactId>spotbugs-maven-plugin</artifactId>
-        <configuration>
-          <excludeFilterFile>${commons.conf.dir}/spotbugs-exclude-filter.xml</excludeFilterFile>
-        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -179,6 +176,13 @@
            <excludes>target/**</excludes>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>com.github.spotbugs</groupId>
+          <artifactId>spotbugs-maven-plugin</artifactId>
+          <configuration>
+            <excludeFilterFile>${commons.conf.dir}/spotbugs-exclude-filter.xml</excludeFilterFile>
+          </configuration>
+        </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-scm-publish-plugin</artifactId>


(commons-imaging) 08/08: Remove obsolete SpotBugs exclusions

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit cf67360ed5287b306d9c104dbe459bb840cb4b74
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:51:52 2023 -0500

    Remove obsolete SpotBugs exclusions
---
 src/conf/spotbugs-exclude-filter.xml | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index b522e4c4..ebefe41f 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -163,11 +163,6 @@
     <Method name="setOutputSet" />
     <Bug pattern="EI_EXPOSE_REP2" />
   </Match>
-  <!-- Reason: For code clarity, we could use a simple 'else', but instead keep a complete expression -->
-  <Match>
-    <Class name="org.apache.commons.imaging.formats.pnm.PnmImageParser" />
-    <Bug pattern="UC_USELESS_CONDITION" />
-  </Match>
   <Match>
     <Class name="org.apache.commons.imaging.formats.webp.WebPImageMetadata" />
     <Method name="getExif" />


(commons-imaging) 02/08: Format consistently

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 8c44dfd7114935bff3d2cb22d0588ab068fcaea7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:38:49 2023 -0500

    Format consistently
    
    - Use final
    - Merge if statements
---
 .../commons/imaging/AbstractImageParser.java       | 671 ++++++++-------------
 .../org/apache/commons/imaging/ColorTools.java     |  71 +--
 .../apache/commons/imaging/FormatCompliance.java   |  31 +-
 .../org/apache/commons/imaging/ImageFormats.java   |  26 +-
 .../java/org/apache/commons/imaging/ImageInfo.java |  77 +--
 .../java/org/apache/commons/imaging/Imaging.java   | 421 ++++++-------
 .../apache/commons/imaging/ImagingConstants.java   |   7 +-
 .../commons/imaging/ImagingFormatException.java    |  11 +-
 .../apache/commons/imaging/ImagingParameters.java  |  18 +-
 .../commons/imaging/ImagingRuntimeException.java   |  14 +-
 .../org/apache/commons/imaging/PixelDensity.java   |   8 +-
 .../imaging/bytesource/InputStreamByteSource.java  |   4 +-
 .../commons/imaging/bytesource/package-info.java   |   1 -
 .../apache/commons/imaging/color/ColorCieLab.java  |  19 +-
 .../apache/commons/imaging/color/ColorCieLch.java  |  14 +-
 .../apache/commons/imaging/color/ColorCieLuv.java  |  16 +-
 .../org/apache/commons/imaging/color/ColorCmy.java |  19 +-
 .../apache/commons/imaging/color/ColorCmyk.java    |  21 +-
 .../commons/imaging/color/ColorConversions.java    | 146 +++--
 .../commons/imaging/color/ColorDin99Lab.java       |   5 +-
 .../org/apache/commons/imaging/color/ColorHsl.java |  16 +-
 .../org/apache/commons/imaging/color/ColorHsv.java |  16 +-
 .../commons/imaging/color/ColorHunterLab.java      |  16 +-
 .../org/apache/commons/imaging/color/ColorXyz.java |  19 +-
 .../apache/commons/imaging/common/Allocator.java   |  13 +-
 .../commons/imaging/common/BasicCParser.java       |  95 ++-
 .../common/BigEndianBinaryOutputStream.java        |  12 +-
 .../commons/imaging/common/BinaryFileParser.java   |   3 +-
 .../commons/imaging/common/BinaryFunctions.java    | 149 ++---
 .../imaging/common/BufferedImageFactory.java       |   6 +-
 .../commons/imaging/common/ByteConversions.java    | 177 +++---
 .../commons/imaging/common/ImageBuilder.java       | 168 ++----
 .../common/LittleEndianBinaryOutputStream.java     |  12 +-
 .../apache/commons/imaging/common/PackBits.java    |  17 +-
 .../commons/imaging/common/RationalNumber.java     |  87 ++-
 .../imaging/common/RgbBufferedImageFactory.java    |   6 +-
 .../imaging/common/SimpleBufferedImageFactory.java |   6 +-
 .../commons/imaging/common/XmpEmbeddable.java      |  19 +-
 .../apache/commons/imaging/common/ZlibDeflate.java |   8 +-
 .../commons/imaging/common/package-info.java       |   4 +-
 .../commons/imaging/formats/bmp/BmpHeaderInfo.java |  14 +-
 .../imaging/formats/bmp/BmpImageParser.java        | 102 ++--
 .../imaging/formats/bmp/BmpWriterPalette.java      |  12 +-
 .../commons/imaging/formats/bmp/BmpWriterRgb.java  |   8 +-
 .../imaging/formats/bmp/PixelParserBitFields.java  |  26 +-
 .../imaging/formats/bmp/PixelParserRgb.java        |  26 +-
 .../imaging/formats/bmp/PixelParserRle.java        |  26 +-
 .../commons/imaging/formats/bmp/package-info.java  |   1 -
 .../imaging/formats/dcx/DcxImageParser.java        |  34 +-
 .../commons/imaging/formats/dcx/package-info.java  |   1 -
 .../imaging/formats/gif/DisposalMethod.java        |   4 +-
 .../commons/imaging/formats/gif/GifHeaderInfo.java |   9 +-
 .../imaging/formats/gif/GifImageContents.java      |   3 +-
 .../imaging/formats/gif/GifImageParser.java        | 343 ++++-------
 .../formats/gif/GraphicControlExtension.java       |   4 +-
 .../imaging/formats/gif/ImageDescriptor.java       |   9 +-
 .../commons/imaging/formats/gif/package-info.java  |   1 -
 .../commons/imaging/formats/icns/IcnsDecoder.java  | 158 ++---
 .../imaging/formats/icns/IcnsImageParser.java      |  59 +-
 .../commons/imaging/formats/icns/IcnsType.java     | 130 ++--
 .../imaging/formats/icns/Rle24Compression.java     |   4 +-
 .../commons/imaging/formats/icns/package-info.java |   1 -
 .../imaging/formats/ico/IcoImageParser.java        | 234 ++++---
 .../commons/imaging/formats/ico/package-info.java  |   1 -
 .../imaging/formats/jpeg/JpegConstants.java        | 163 +++--
 .../imaging/formats/jpeg/JpegImageMetadata.java    |  19 +-
 .../imaging/formats/jpeg/JpegImageParser.java      | 196 ++----
 .../commons/imaging/formats/jpeg/JpegUtils.java    |  27 +-
 .../commons/imaging/formats/jpeg/decoder/Dct.java  |  95 +--
 .../imaging/formats/jpeg/decoder/JpegDecoder.java  | 147 ++---
 .../formats/jpeg/decoder/JpegInputStream.java      |  10 +-
 .../formats/jpeg/decoder/YCbCrConverter.java       |  25 +-
 .../imaging/formats/jpeg/decoder/ZigZag.java       |  12 +-
 .../imaging/formats/jpeg/exif/ExifRewriter.java    | 332 ++++------
 .../imaging/formats/jpeg/iptc/IptcParser.java      |  91 +--
 .../imaging/formats/jpeg/iptc/IptcTypes.java       | 133 +---
 .../formats/jpeg/iptc/JpegIptcRewriter.java        | 278 +++------
 .../formats/jpeg/iptc/PhotoshopApp13Data.java      |   3 +-
 .../commons/imaging/formats/jpeg/package-info.java |   1 -
 .../formats/jpeg/segments/AbstractSegment.java     |  18 +-
 .../formats/jpeg/segments/App13Segment.java        |  14 +-
 .../imaging/formats/jpeg/segments/App2Segment.java |  14 +-
 .../imaging/formats/jpeg/segments/DhtSegment.java  |  14 +-
 .../imaging/formats/jpeg/segments/DqtSegment.java  |  25 +-
 .../formats/jpeg/segments/GenericSegment.java      |  13 +-
 .../imaging/formats/jpeg/segments/JfifSegment.java |  21 +-
 .../imaging/formats/jpeg/segments/SofnSegment.java |  29 +-
 .../imaging/formats/jpeg/segments/SosSegment.java  |  29 +-
 .../imaging/formats/jpeg/xmp/JpegRewriter.java     |  48 +-
 .../imaging/formats/jpeg/xmp/JpegXmpParser.java    |   3 +-
 .../imaging/formats/jpeg/xmp/JpegXmpRewriter.java  | 131 ++--
 .../imaging/formats/pcx/PcxImageParser.java        | 174 ++----
 .../imaging/formats/pcx/PcxImagingParameters.java  |   1 +
 .../commons/imaging/formats/pcx/PcxWriter.java     |  46 +-
 .../commons/imaging/formats/pcx/RleReader.java     |   3 +-
 .../commons/imaging/formats/pcx/RleWriter.java     |  19 +-
 .../commons/imaging/formats/pcx/package-info.java  |   1 -
 .../imaging/formats/png/AbstractPngText.java       |  13 +-
 .../imaging/formats/png/AbstractScanExpediter.java |  39 +-
 .../commons/imaging/formats/png/BitParser.java     |  10 +-
 .../commons/imaging/formats/png/ChunkType.java     |   2 +-
 .../commons/imaging/formats/png/FilterType.java    |   6 +-
 .../imaging/formats/png/GammaCorrection.java       |  12 +-
 .../imaging/formats/png/InterlaceMethod.java       |   3 +-
 .../commons/imaging/formats/png/PhysicalScale.java |  77 +--
 .../commons/imaging/formats/png/PngColorType.java  |  10 +-
 .../commons/imaging/formats/png/PngConstants.java  |  36 +-
 .../apache/commons/imaging/formats/png/PngCrc.java |  11 +-
 .../commons/imaging/formats/png/PngImageInfo.java  |  20 +-
 .../imaging/formats/png/PngImageParser.java        | 181 +++---
 .../imaging/formats/png/PngImagingParameters.java  |  27 +-
 .../commons/imaging/formats/png/PngWriter.java     | 240 +++-----
 .../formats/png/ScanExpediterInterlaced.java       |  17 +-
 .../imaging/formats/png/ScanExpediterSimple.java   |  11 +-
 .../imaging/formats/png/chunks/PngChunk.java       |  15 +-
 .../imaging/formats/png/chunks/PngChunkGama.java   |   3 +-
 .../imaging/formats/png/chunks/PngChunkIccp.java   |  13 +-
 .../imaging/formats/png/chunks/PngChunkItxt.java   |  14 +-
 .../imaging/formats/png/chunks/PngChunkPlte.java   |  22 +-
 .../commons/imaging/formats/png/package-info.java  |   1 -
 .../png/scanlinefilters/ScanlineFilter.java        |   3 +-
 .../png/scanlinefilters/ScanlineFilterAverage.java |   3 +-
 .../png/scanlinefilters/ScanlineFilterNone.java    |   3 +-
 .../png/scanlinefilters/ScanlineFilterPaeth.java   |   7 +-
 .../png/scanlinefilters/ScanlineFilterSub.java     |   5 +-
 .../png/scanlinefilters/ScanlineFilterUp.java      |   3 +-
 .../formats/png/scanlinefilters/package-info.java  |   1 -
 .../TransparencyFilterIndexedColor.java            |   7 +-
 .../TransparencyFilterTrueColor.java               |   7 +-
 .../png/transparencyfilters/package-info.java      |   1 -
 .../imaging/formats/pnm/AbstractFileInfo.java      |   5 +-
 .../commons/imaging/formats/pnm/PamFileInfo.java   |  50 +-
 .../commons/imaging/formats/pnm/PamWriter.java     |  19 +-
 .../commons/imaging/formats/pnm/PbmFileInfo.java   |   2 +-
 .../commons/imaging/formats/pnm/PbmWriter.java     |  19 +-
 .../commons/imaging/formats/pnm/PgmFileInfo.java   |  16 +-
 .../commons/imaging/formats/pnm/PgmWriter.java     |   9 +-
 .../commons/imaging/formats/pnm/PnmConstants.java  |   2 +-
 .../imaging/formats/pnm/PnmImageParser.java        |  70 +--
 .../imaging/formats/pnm/PnmImagingParameters.java  |   1 +
 .../commons/imaging/formats/pnm/PnmWriter.java     |   3 +-
 .../commons/imaging/formats/pnm/PpmFileInfo.java   |  10 +-
 .../commons/imaging/formats/pnm/PpmWriter.java     |  17 +-
 .../imaging/formats/pnm/WhiteSpaceReader.java      |   4 +-
 .../commons/imaging/formats/pnm/package-info.java  |   1 -
 .../imaging/formats/psd/ImageResourceType.java     | 111 ++--
 .../commons/imaging/formats/psd/PsdHeaderInfo.java |   3 +-
 .../imaging/formats/psd/PsdImageContents.java      |  18 +-
 .../imaging/formats/psd/PsdImageParser.java        | 178 ++----
 .../formats/psd/dataparsers/DataParser.java        |   3 +-
 .../formats/psd/dataparsers/DataParserBitmap.java  |   8 +-
 .../formats/psd/dataparsers/DataParserCmyk.java    |   3 +-
 .../psd/dataparsers/DataParserGrayscale.java       |   8 +-
 .../formats/psd/dataparsers/DataParserIndexed.java |   3 +-
 .../formats/psd/dataparsers/DataParserRgb.java     |   8 +-
 .../formats/psd/dataparsers/DataParserStub.java    |   3 +-
 .../formats/psd/dataparsers/package-info.java      |   1 -
 .../psd/datareaders/CompressedDataReader.java      |  10 +-
 .../formats/psd/datareaders/DataReader.java        |   6 +-
 .../psd/datareaders/UncompressedDataReader.java    |   6 +-
 .../formats/psd/datareaders/package-info.java      |   1 -
 .../commons/imaging/formats/psd/package-info.java  |   1 -
 .../imaging/formats/rgbe/RgbeImageParser.java      |  40 +-
 .../commons/imaging/formats/rgbe/RgbeInfo.java     |  16 +-
 .../commons/imaging/formats/rgbe/package-info.java |   1 -
 .../imaging/formats/tiff/AbstractTiffElement.java  |   5 +-
 .../formats/tiff/AbstractTiffImageData.java        |  58 +-
 .../commons/imaging/formats/tiff/TiffContents.java |   4 +-
 .../imaging/formats/tiff/TiffDirectory.java        | 407 +++++--------
 .../commons/imaging/formats/tiff/TiffField.java    | 119 ++--
 .../imaging/formats/tiff/TiffImageMetadata.java    |  86 +--
 .../imaging/formats/tiff/TiffImageParser.java      | 474 ++++++---------
 .../formats/tiff/TiffImagingParameters.java        |  93 ++-
 .../imaging/formats/tiff/TiffRasterData.java       | 119 ++--
 .../imaging/formats/tiff/TiffRasterDataFloat.java  | 124 ++--
 .../imaging/formats/tiff/TiffRasterDataInt.java    | 116 ++--
 .../imaging/formats/tiff/TiffRasterDataType.java   |  11 +-
 .../imaging/formats/tiff/TiffRasterStatistics.java |  20 +-
 .../commons/imaging/formats/tiff/TiffReader.java   | 131 ++--
 .../commons/imaging/formats/tiff/TiffTags.java     |  10 +-
 .../constants/AdobePageMaker6TagConstants.java     |  42 +-
 .../tiff/constants/AdobePhotoshopTagConstants.java |  17 +-
 .../constants/AliasSketchbookProTagConstants.java  |   7 +-
 .../formats/tiff/constants/DcfTagConstants.java    |  23 +-
 .../formats/tiff/constants/DngTagConstants.java    | 372 +++---------
 .../formats/tiff/constants/ExifTagConstants.java   | 618 ++++++-------------
 .../tiff/constants/GdalLibraryTagConstants.java    |   6 +-
 .../tiff/constants/GeoTiffTagConstants.java        |  33 +-
 .../formats/tiff/constants/GpsTagConstants.java    | 150 ++---
 .../tiff/constants/HylaFaxTagConstants.java        |  32 +-
 .../constants/MicrosoftHdPhotoTagConstants.java    | 259 +++-----
 .../tiff/constants/MicrosoftTagConstants.java      |  34 +-
 .../MolecularDynamicsGelTagConstants.java          |  45 +-
 .../tiff/constants/OceScanjobTagConstants.java     |  20 +-
 .../tiff/constants/Rfc2301TagConstants.java        |  67 +-
 .../formats/tiff/constants/Tiff4TagConstants.java  |   8 +-
 .../formats/tiff/constants/TiffConstants.java      |  15 +-
 .../formats/tiff/constants/TiffDirectoryType.java  |  28 +-
 .../formats/tiff/constants/TiffEpTagConstants.java |  94 +--
 .../tiff/constants/TiffPlanarConfiguration.java    |  25 +-
 .../formats/tiff/constants/TiffTagConstants.java   | 350 +++--------
 .../formats/tiff/constants/WangTagConstants.java   |  11 +-
 .../formats/tiff/constants/package-info.java       |   1 -
 .../formats/tiff/datareaders/BitInputStream.java   |  20 +-
 .../tiff/datareaders/DataInterpreterJpeg.java      |  70 +--
 .../formats/tiff/datareaders/DataReaderStrips.java | 177 ++----
 .../formats/tiff/datareaders/DataReaderTiled.java  | 128 ++--
 .../formats/tiff/datareaders/ImageDataReader.java  | 451 +++++---------
 .../formats/tiff/datareaders/package-info.java     |   1 -
 .../formats/tiff/fieldtypes/AbstractFieldType.java |  54 +-
 .../formats/tiff/fieldtypes/FieldTypeAscii.java    |  10 +-
 .../formats/tiff/fieldtypes/FieldTypeLong.java     |   3 +-
 .../formats/tiff/fieldtypes/FieldTypeLong8.java    |  10 +-
 .../formats/tiff/fieldtypes/FieldTypeRational.java |  11 +-
 .../formats/tiff/fieldtypes/package-info.java      |   1 -
 .../formats/tiff/itu_t4/BitArrayOutputStream.java  |   3 +-
 .../tiff/itu_t4/BitInputStreamFlexible.java        |  15 +-
 .../imaging/formats/tiff/itu_t4/HuffmanTree.java   |   7 +-
 .../formats/tiff/itu_t4/T4AndT6Compression.java    | 106 ++--
 .../imaging/formats/tiff/itu_t4/T4_T6_Tables.java  | 245 ++------
 .../imaging/formats/tiff/itu_t4/package-info.java  |   1 -
 .../commons/imaging/formats/tiff/package-info.java |   5 +-
 .../PhotometricInterpreter.java                    |  13 +-
 .../PhotometricInterpreterBiLevel.java             |  10 +-
 .../PhotometricInterpreterCieLab.java              |   6 +-
 .../PhotometricInterpreterCmyk.java                |   6 +-
 .../PhotometricInterpreterLogLuv.java              |  27 +-
 .../PhotometricInterpreterPalette.java             |  34 +-
 .../PhotometricInterpreterRgb.java                 |   8 +-
 .../PhotometricInterpreterYCbCr.java               |  37 +-
 .../floatingpoint/PaletteEntry.java                |  25 +-
 .../floatingpoint/PaletteEntryForRange.java        |  51 +-
 .../floatingpoint/PaletteEntryForValue.java        |   8 +-
 .../floatingpoint/PhotometricInterpreterFloat.java | 137 ++---
 .../floatingpoint/package-info.java                |   3 +-
 .../tiff/photometricinterpreters/package-info.java |   4 +-
 .../imaging/formats/tiff/taginfos/TagInfo.java     |  32 +-
 .../imaging/formats/tiff/taginfos/TagInfoAny.java  |   3 +-
 .../formats/tiff/taginfos/TagInfoAscii.java        |  12 +-
 .../formats/tiff/taginfos/TagInfoAsciiOrByte.java  |   6 +-
 .../tiff/taginfos/TagInfoAsciiOrRational.java      |   6 +-
 .../imaging/formats/tiff/taginfos/TagInfoByte.java |   6 +-
 .../formats/tiff/taginfos/TagInfoBytes.java        |   7 +-
 .../formats/tiff/taginfos/TagInfoDirectory.java    |   7 +-
 .../formats/tiff/taginfos/TagInfoGpsText.java      |  51 +-
 .../imaging/formats/tiff/taginfos/TagInfoLong.java |   4 +-
 .../formats/tiff/taginfos/TagInfoXpString.java     |   6 +-
 .../formats/tiff/taginfos/package-info.java        |   1 -
 .../tiff/write/AbstractTiffImageWriter.java        | 130 ++--
 .../formats/tiff/write/AbstractTiffOutputItem.java |   9 +-
 .../tiff/write/TiffImageWriterLossless.java        |  44 +-
 .../formats/tiff/write/TiffImageWriterLossy.java   |   7 +-
 .../formats/tiff/write/TiffOutputDirectory.java    | 384 ++++--------
 .../formats/tiff/write/TiffOutputField.java        |  23 +-
 .../imaging/formats/tiff/write/TiffOutputSet.java  |  61 +-
 .../formats/tiff/write/TiffOutputSummary.java      |  14 +-
 .../imaging/formats/tiff/write/package-info.java   |   1 -
 .../imaging/formats/wbmp/WbmpImageParser.java      |  84 +--
 .../commons/imaging/formats/wbmp/package-info.java |   1 -
 .../imaging/formats/webp/WebPChunkType.java        |  19 +-
 .../imaging/formats/webp/WebPConstants.java        |  10 +-
 .../imaging/formats/webp/WebPImageMetadata.java    |   8 +-
 .../imaging/formats/webp/WebPImageParser.java      |  91 ++-
 .../imaging/formats/webp/chunks/WebPChunk.java     |  24 +-
 .../imaging/formats/webp/chunks/WebPChunkAlph.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkAnim.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkAnmf.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkExif.java |   8 +-
 .../imaging/formats/webp/chunks/WebPChunkIccp.java |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkVp8.java  |  40 +-
 .../imaging/formats/webp/chunks/WebPChunkVp8l.java |  14 +-
 .../imaging/formats/webp/chunks/WebPChunkVp8x.java |   9 +-
 .../imaging/formats/webp/chunks/WebPChunkXml.java  |   2 +-
 .../imaging/formats/webp/chunks/WebPChunkXyzw.java |   2 +-
 .../commons/imaging/formats/webp/package-info.java |   6 +-
 .../imaging/formats/xbm/XbmImageParser.java        | 110 ++--
 .../commons/imaging/formats/xbm/package-info.java  |   1 -
 .../imaging/formats/xpm/XpmImageParser.java        |  40 +-
 .../apache/commons/imaging/icc/IccConstants.java   |   6 +-
 .../apache/commons/imaging/icc/IccProfileInfo.java |  19 +-
 .../commons/imaging/icc/IccProfileParser.java      |  26 +-
 .../org/apache/commons/imaging/icc/IccTag.java     |  33 +-
 .../commons/imaging/icc/IccTagDataTypes.java       |  46 +-
 .../apache/commons/imaging/icc/IccTagTypes.java    | 398 ++++++------
 .../org/apache/commons/imaging/internal/Debug.java |  39 +-
 .../imaging/internal/ImageParserFactory.java       |   7 +-
 .../commons/imaging/internal/SafeOperations.java   |   2 +-
 .../imaging/mylzw/BitsToByteInputStream.java       |   4 +-
 .../commons/imaging/mylzw/MyBitInputStream.java    |   8 +-
 .../commons/imaging/mylzw/MyBitOutputStream.java   |  17 +-
 .../commons/imaging/mylzw/MyLzwCompressor.java     |  27 +-
 .../commons/imaging/mylzw/MyLzwDecompressor.java   |  15 +-
 .../apache/commons/imaging/mylzw/package-info.java |   1 -
 .../org/apache/commons/imaging/package-info.java   |   1 -
 .../commons/imaging/palette/ColorComponent.java    |   7 +-
 .../apache/commons/imaging/palette/ColorCount.java |   8 +-
 .../imaging/palette/ColorCountComparator.java      |  13 +-
 .../apache/commons/imaging/palette/ColorGroup.java |  19 +-
 .../commons/imaging/palette/ColorSpaceSubset.java  |  53 +-
 .../apache/commons/imaging/palette/Dithering.java  |  25 +-
 .../imaging/palette/LongestAxisMedianCut.java      |  49 +-
 .../apache/commons/imaging/palette/MedianCut.java  |   3 +-
 .../imaging/palette/MedianCutQuantizer.java        |  17 +-
 .../palette/MostPopulatedBoxesMedianCut.java       |  45 +-
 .../commons/imaging/palette/PaletteFactory.java    |  87 ++-
 .../commons/imaging/palette/QuantizedPalette.java  |  11 +-
 .../commons/imaging/AbstractImagingTest.java       |  18 +-
 .../commons/imaging/ImagingGuessFormatTest.java    |  16 +-
 .../org/apache/commons/imaging/TestImageInfo.java  |  74 +--
 .../imaging/bytesource/AbstractByteSourceTest.java |   9 +-
 .../imaging/bytesource/ByteSourceDataTest.java     |   3 +-
 .../imaging/bytesource/ByteSourceImageTest.java    |  30 +-
 .../bytesource/ByteSourceInputStreamTest.java      |   2 +-
 .../apache/commons/imaging/color/ColorCmyTest.java |   6 +-
 .../imaging/color/ColorConversionsTest.java        |  10 +-
 .../apache/commons/imaging/color/ColorHslTest.java |   4 +-
 .../commons/imaging/common/RationalNumberTest.java |   9 +-
 .../examples/ApacheImagingSpeedAndMemoryTest.java  |  25 +-
 .../commons/imaging/examples/ImageReadExample.java |  15 +-
 .../imaging/examples/ImageWriteExample.java        |   3 +-
 .../commons/imaging/examples/MetadataExample.java  |  68 +--
 .../imaging/examples/WriteExifMetadataExample.java |  48 +-
 .../tiff/ExampleReadFloatingPointData.java         |  64 +-
 .../examples/tiff/ReadAndRenderFloatingPoint.java  |  61 +-
 .../imaging/examples/tiff/ReadTagsAndImages.java   | 502 +++++++--------
 .../imaging/examples/tiff/SurveyTiffFile.java      | 184 +++---
 .../imaging/examples/tiff/SurveyTiffFolder.java    |  19 +-
 .../imaging/examples/tiff/package-info.java        |   3 +-
 .../imaging/formats/bmp/BmpImageParserTest.java    |   3 +
 .../commons/imaging/formats/bmp/BmpReadTest.java   |   6 +-
 .../imaging/formats/bmp/BmpRoundtripTest.java      |  10 +-
 .../imaging/formats/bmp/BmpWriterRgbTest.java      |   4 +-
 .../commons/imaging/formats/gif/GifReadTest.java   |  27 +-
 .../commons/imaging/formats/icns/IcnsReadTest.java |  23 +-
 .../imaging/formats/icns/IcnsRoundTripTest.java    |  68 +--
 .../imaging/formats/ico/AbstractIcoTest.java       |   3 +-
 .../imaging/formats/ico/IcoRoundtripTest.java      | 149 ++---
 .../commons/imaging/formats/jpeg/JpegReadTest.java |  19 +-
 .../jpeg/JpegWithInvalidDhtSegmentTest.java        |   3 +-
 .../imaging/formats/jpeg/decoder/DctTest.java      |  25 +-
 .../formats/jpeg/decoder/JpegInputStreamTest.java  |  29 +-
 .../formats/jpeg/exif/AbstractExifTest.java        |   6 +-
 .../jpeg/exif/AbstractSpecificExifTagTest.java     |   6 +-
 .../imaging/formats/jpeg/exif/AsciiFieldTest.java  |  15 +-
 .../imaging/formats/jpeg/exif/ExifRewriteTest.java |  35 +-
 .../jpeg/exif/ExifRewriterRoundtripTest.java       |  21 +-
 .../formats/jpeg/exif/MakerNoteFieldTest.java      |   3 +-
 .../formats/jpeg/exif/MicrosoftTagTest.java        |   4 +-
 .../imaging/formats/jpeg/exif/TextFieldTest.java   |   9 +-
 .../jpeg/exif/WriteExifMetadataExampleTest.java    |   1 +
 .../imaging/formats/jpeg/iptc/IptcAddTest.java     |  11 +-
 .../imaging/formats/jpeg/iptc/IptcBaseTest.java    |  21 +-
 .../imaging/formats/jpeg/iptc/IptcDumpTest.java    |   4 +-
 .../imaging/formats/jpeg/iptc/IptcParserTest.java  |  32 +-
 .../formats/jpeg/iptc/IptcTypeLookupTest.java      |   2 +-
 .../imaging/formats/jpeg/iptc/IptcUpdateTest.java  |  39 +-
 .../formats/jpeg/segments/App2SegmentTest.java     |  33 +-
 .../formats/jpeg/segments/AppnSegmentTest.java     |  14 +-
 .../formats/jpeg/segments/JfifSegmentTest.java     |  24 +-
 .../formats/jpeg/segments/SosSegmentTest.java      |  34 +-
 .../formats/jpeg/specific/JpegImageParserTest.java |   1 +
 .../formats/jpeg/xmp/AbstractJpegXmpTest.java      |  15 +-
 .../formats/jpeg/xmp/JpegXmpParserTest.java        |   2 +-
 .../formats/jpeg/xmp/JpegXmpRewriteTest.java       |  12 +-
 .../commons/imaging/formats/pcx/RleReaderTest.java |   4 +-
 .../imaging/formats/png/ConvertPngToGifTest.java   |   3 +-
 .../imaging/formats/png/PhysicalScaleTest.java     |  34 +-
 .../commons/imaging/formats/png/PngCrcTest.java    |   4 +-
 .../imaging/formats/png/PngImageParserTest.java    |  13 +-
 .../commons/imaging/formats/png/PngReadTest.java   |  42 +-
 .../commons/imaging/formats/png/PngTextTest.java   |   6 +-
 .../png/PngWithInvalidPngChunkSizeTest.java        |   6 +-
 .../imaging/formats/png/PngWritePredictorTest.java |   9 +-
 .../imaging/formats/png/PngWriteReadTest.java      |  22 +-
 .../commons/imaging/formats/png/PngWriterTest.java |  26 +-
 .../formats/png/chunks/PngChunkScalTest.java       |  74 ++-
 .../formats/png/chunks/PngChunkTextTest.java       |   2 +-
 .../scanlinefilters/ScanlineFilterAverageTest.java |  16 +-
 .../scanlinefilters/ScanlineFilterPaethTest.java   |  16 +-
 .../png/scanlinefilters/ScanlineFilterUpTest.java  |  14 +-
 .../TransparencyFilterIndexedColorTest.java        |   4 +-
 .../imaging/formats/pnm/PbmFileInfoTest.java       |  30 +-
 .../imaging/formats/pnm/PnmImageParserTest.java    |   6 +-
 .../imaging/formats/pnm/PpmFileInfoTest.java       |  17 +-
 .../imaging/formats/pnm/WhiteSpaceReaderTest.java  |  20 +-
 .../formats/psd/ImageResourceBlockTest.java        |   4 +-
 .../imaging/formats/psd/ImageResourceTypeTest.java |   2 +-
 .../psd/dataparsers/DataParserGrayscaleTest.java   |  12 +-
 .../psd/dataparsers/DataParserIndexedTest.java     |  24 +-
 .../formats/psd/dataparsers/DataParserLabTest.java |  12 +-
 .../imaging/formats/tiff/JpegImageDataTest.java    |   4 +-
 .../formats/tiff/TiffAlphaRoundTripTest.java       |  73 +--
 .../imaging/formats/tiff/TiffBigTiffTest.java      |  83 ++-
 .../imaging/formats/tiff/TiffCcittTest.java        |  57 +-
 .../tiff/TiffFloatingPointMultivariableTest.java   | 195 +++---
 .../formats/tiff/TiffFloatingPointReadTest.java    |  55 +-
 .../tiff/TiffFloatingPointRoundTripTest.java       | 161 ++---
 .../commons/imaging/formats/tiff/TiffJpegTest.java | 136 ++---
 .../commons/imaging/formats/tiff/TiffLzwTest.java  |  55 +-
 .../formats/tiff/TiffRasterDataIntTest.java        |  15 +-
 .../imaging/formats/tiff/TiffRasterDataTest.java   |   4 +-
 .../formats/tiff/TiffRasterStatisticsTest.java     |   3 +-
 .../imaging/formats/tiff/TiffReadAlphaTest.java    |  21 +-
 .../formats/tiff/TiffReadImageInfoTest.java        |  41 +-
 .../commons/imaging/formats/tiff/TiffReadTest.java |   8 +-
 .../formats/tiff/TiffRoundTripInt32Test.java       |  81 +--
 .../imaging/formats/tiff/TiffRoundtripTest.java    |   8 +-
 .../formats/tiff/TiffShortIntRoundTripTest.java    |  73 +--
 .../imaging/formats/tiff/TiffSubImageTest.java     |  34 +-
 .../imaging/formats/tiff/TiffTagIntegrityTest.java |  34 +-
 .../commons/imaging/formats/tiff/TiffTagsTest.java |   8 +-
 .../tiff/datareaders/DataReaderStripsTest.java     |  12 +-
 .../tiff/fieldtypes/FieldTypeAsciiTest.java        |  35 +-
 .../formats/tiff/fieldtypes/FieldTypeByteTest.java |  14 +-
 .../tiff/fieldtypes/FieldTypeRationalTest.java     |  31 +-
 .../formats/tiff/fieldtypes/FieldTypeTest.java     |  22 +-
 .../tiff/itu_t4/HuffmanTreeExceptionTest.java      |   2 +-
 .../PhotometricInterpreterLogLuvTest.java          |   9 +-
 .../PhotometricInterpreterRgbTest.java             |   9 +-
 .../floatingpoint/PaletteEntryForRangeTest.java    |  15 +-
 .../floatingpoint/PaletteEntryForValueTest.java    |   3 +-
 .../PhotometricInterpreterFloatTest.java           |   9 +-
 .../tiff/taginfos/TagInfoByteOrShortTest.java      |   2 +-
 .../formats/tiff/taginfos/TagInfoByteTest.java     |   2 +-
 .../formats/tiff/taginfos/TagInfoSByteTest.java    |  18 +-
 .../formats/tiff/taginfos/TagInfoSBytesTest.java   |  20 +-
 .../formats/tiff/taginfos/TagInfoSLongTest.java    |  16 +-
 .../formats/tiff/taginfos/TagInfoSShortTest.java   |  16 +-
 .../formats/tiff/taginfos/TagInfoSShortsTest.java  |  18 +-
 .../formats/tiff/taginfos/TagInfoUnknownTest.java  |  14 +-
 .../commons/imaging/formats/webp/WebPBaseTest.java |  11 +-
 .../commons/imaging/formats/webp/WebPDumpTest.java |  14 +-
 .../imaging/formats/webp/WebPMetadataTest.java     |  24 +-
 .../commons/imaging/formats/webp/WebPReadTest.java |  14 +-
 .../commons/imaging/formats/xmp/XmpUpdateTest.java |   6 +-
 .../commons/imaging/palette/DitheringTest.java     |  58 +-
 .../imaging/palette/PaletteQuantizationTest.java   |  11 +-
 .../commons/imaging/palette/SimplePaletteTest.java |   6 +-
 .../imaging/roundtrip/BitmapRoundtripTest.java     |   3 +-
 .../commons/imaging/roundtrip/FormatInfo.java      | 132 ++--
 .../imaging/roundtrip/FullColorRoundtrip.java      |   3 +-
 .../imaging/roundtrip/GrayscaleRountripTest.java   |   7 +-
 .../commons/imaging/roundtrip/ImageAsserts.java    |  19 +-
 .../roundtrip/LimitedColorRoundtripTest.java       |  21 +-
 .../imaging/roundtrip/PixelDensityRoundtrip.java   |   6 +-
 .../commons/imaging/roundtrip/RoundtripBase.java   |   5 +-
 .../commons/imaging/roundtrip/TestImages.java      |  40 +-
 .../commons/imaging/test/FileSystemTraversal.java  |  26 +-
 .../imaging/test/PrintShallowObjectSizes.java      |   6 +-
 .../apache/commons/imaging/test/TestResources.java |  10 +-
 450 files changed, 7259 insertions(+), 12158 deletions(-)

diff --git a/src/main/java/org/apache/commons/imaging/AbstractImageParser.java b/src/main/java/org/apache/commons/imaging/AbstractImageParser.java
index b1faf727..57e93e1e 100644
--- a/src/main/java/org/apache/commons/imaging/AbstractImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/AbstractImageParser.java
@@ -54,39 +54,29 @@ import org.apache.commons.imaging.formats.xbm.XbmImageParser;
 import org.apache.commons.imaging.formats.xpm.XpmImageParser;
 
 /**
- * Provides the abstract base class for all image reading and writing
- * utilities.  ImageParser implementations are expected to extend this
- * class providing logic for identifying and processing data in their
- * own specific format.   Specific implementations are found
- * under the com.apache.commons.imaging.formats package.
+ * Provides the abstract base class for all image reading and writing utilities. ImageParser implementations are expected to extend this class providing logic
+ * for identifying and processing data in their own specific format. Specific implementations are found under the com.apache.commons.imaging.formats package.
  *
  * <h2>Application Notes</h2>
  *
  * <h3>Format support</h3>
  *
- * For the most recent information on format support for the
- * Apache Commons Imaging package, refer to
- * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
- * at the main project development web site.
+ * For the most recent information on format support for the Apache Commons Imaging package, refer to
+ * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a> at the main project development web site.
  *
  * <h3>On the accuracy of this Javadoc</h3>
  *
- * The original authors of this class did not supply documentation.
- * The Javadoc for this class is based on inspection of the
- * source code.  In some cases, the purpose and usage for particular
- * methods was deduced from the source and may not perfectly reflect
- * the intentions of the original. Therefore, you should not assume
- * that the documentation is perfect, especially in the more obscure
- * and specialized areas of implementation.
+ * The original authors of this class did not supply documentation. The Javadoc for this class is based on inspection of the source code. In some cases, the
+ * purpose and usage for particular methods was deduced from the source and may not perfectly reflect the intentions of the original. Therefore, you should not
+ * assume that the documentation is perfect, especially in the more obscure and specialized areas of implementation.
  *
  * <h3>The "params" argument</h3>
  *
- * <p>Many of the methods specified by this class accept an argument of
- * type {@code T} defining the parameters to be used when
- * processing an image. For example, some of the output formats permit
- * of different kinds of image compression or color models. Some of the
- * reading methods permit the calling application to require strict
- * format compliance.</p>
+ * <p>
+ * Many of the methods specified by this class accept an argument of type {@code T} defining the parameters to be used when processing an image. For example,
+ * some of the output formats permit of different kinds of image compression or color models. Some of the reading methods permit the calling application to
+ * require strict format compliance.
+ * </p>
  *
  * @param <T> type of parameters used by this image parser
  */
@@ -100,25 +90,11 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
      * @return A valid array of image parsers
      */
     public static List<AbstractImageParser<?>> getAllImageParsers() {
-        return Arrays.asList(
-                new BmpImageParser(),
-                new DcxImageParser(),
-                new GifImageParser(),
-                new IcnsImageParser(),
-                new IcoImageParser(),
-                new JpegImageParser(),
-                new PcxImageParser(),
-                new PngImageParser(),
-                new PnmImageParser(),
-                new PsdImageParser(),
-                new RgbeImageParser(),
-                new TiffImageParser(),
-                new WebPImageParser(),
-                new WbmpImageParser(),
-                new XbmImageParser(),
-                new XpmImageParser()
-                // new JBig2ImageParser(),
-                // new TgaImageParser(),
+        return Arrays.asList(new BmpImageParser(), new DcxImageParser(), new GifImageParser(), new IcnsImageParser(), new IcoImageParser(),
+                new JpegImageParser(), new PcxImageParser(), new PngImageParser(), new PnmImageParser(), new PsdImageParser(), new RgbeImageParser(),
+                new TiffImageParser(), new WebPImageParser(), new WbmpImageParser(), new XbmImageParser(), new XpmImageParser()
+        // new JBig2ImageParser(),
+        // new TgaImageParser(),
         );
     }
 
@@ -131,8 +107,7 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Indicates whether the ImageParser implementation can accept
-     * the specified file based on its extension.
+     * Indicates whether the ImageParser implementation can accept the specified file based on its extension.
      *
      * @param file An valid file reference.
      * @return If the parser can accept the format, true; otherwise, false.
@@ -142,8 +117,7 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Indicates whether the ImageParser implementation can accept
-     * the specified file name based on its extension.
+     * Indicates whether the ImageParser implementation can accept the specified file name based on its extension.
      *
      * @param fileName A valid string giving a file name or file path.
      * @return If the parser can accept the format, true; otherwise, false.
@@ -167,8 +141,7 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Indicates whether the ImageParser implementation can accept
-     * the specified format
+     * Indicates whether the ImageParser implementation can accept the specified format
      *
      * @param type An instance of ImageFormat.
      * @return If the parser can accept the format, true; otherwise, false.
@@ -185,33 +158,26 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Write the ImageInfo and format-specific information for the image
-     * content of the specified byte array to a string.
+     * Write the ImageInfo and format-specific information for the image content of the specified byte array to a string.
      *
      * @param bytes A valid array of bytes.
      * @return A valid string.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final String dumpImageFile(final byte[] bytes) throws ImagingException, IOException {
         return dumpImageFile(ByteSource.array(bytes));
     }
 
     /**
-     * Write the ImageInfo and format-specific information for the image
-     * content of the specified byte source to a string.
+     * Write the ImageInfo and format-specific information for the image content of the specified byte source to a string.
      *
      * @param byteSource A valid byte source.
      * @return A valid string.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final String dumpImageFile(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public final String dumpImageFile(final ByteSource byteSource) throws ImagingException, IOException {
         final StringWriter sw = new StringWriter();
         final PrintWriter pw = new PrintWriter(sw);
 
@@ -223,15 +189,12 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Write the ImageInfo and format-specific information for the image
-     * content of the specified file to a string.
+     * Write the ImageInfo and format-specific information for the image content of the specified file to a string.
      *
      * @param file A valid file reference.
      * @return A valid string.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final String dumpImageFile(final File file) throws ImagingException, IOException {
         if (!canAcceptExtension(file)) {
@@ -246,19 +209,15 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Write the ImageInfo and format-specific information for the image
-     * content of the specified byte source to a PrintWriter
+     * Write the ImageInfo and format-specific information for the image content of the specified byte source to a PrintWriter
      *
-     * @param pw print writer used for writing the ImageInfo
+     * @param pw         print writer used for writing the ImageInfo
      * @param byteSource A valid byte source.
      * @return A valid PrintWriter.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         return false;
     }
 
@@ -277,34 +236,26 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     protected abstract ImageFormat[] getAcceptedTypes();
 
     /**
-     * Gets all images specified by the byte array (some
-     * formats may include multiple images within a single data source).
+     * Gets all images specified by the byte array (some formats may include multiple images within a single data source).
      *
      * @param bytes A valid byte array
      * @return A valid (potentially empty) list of BufferedImage objects.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final List<BufferedImage> getAllBufferedImages(final byte[] bytes)
-            throws ImagingException, IOException {
+    public final List<BufferedImage> getAllBufferedImages(final byte[] bytes) throws ImagingException, IOException {
         return getAllBufferedImages(ByteSource.array(bytes));
     }
 
     /**
-     * Gets all images specified by the byte source (some
-     * formats may include multiple images within a single data source).
+     * Gets all images specified by the byte source (some formats may include multiple images within a single data source).
      *
      * @param byteSource A valid instance of ByteSource.
      * @return A valid (potentially empty) list of BufferedImage objects.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource) throws ImagingException, IOException {
         final BufferedImage bi = getBufferedImage(byteSource, null);
 
         final List<BufferedImage> result = new ArrayList<>();
@@ -316,15 +267,12 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets all images specified by indicated file (some
-     * formats may include multiple images within a single data source).
+     * Gets all images specified by indicated file (some formats may include multiple images within a single data source).
      *
      * @param file A valid reference to a file.
      * @return A valid (potentially empty) list of BufferedImage objects.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final List<BufferedImage> getAllBufferedImages(final File file) throws ImagingException, IOException {
         if (!canAcceptExtension(file)) {
@@ -335,60 +283,45 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets a buffered image specified by the byte array (for
-     * sources that specify multiple images, choice of which image
-     * is returned is implementation dependent).
+     * Gets a buffered image specified by the byte array (for sources that specify multiple images, choice of which image is returned is implementation
+     * dependent).
      *
      * @param bytes  A valid byte array
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data (null objects are permitted and
-     *               must be supported by implementations).
+     * @param params Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *               implementations).
      * @return A valid instance of BufferedImage.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final BufferedImage getBufferedImage(final byte[] bytes, final T params)
-            throws ImagingException, IOException {
+    public final BufferedImage getBufferedImage(final byte[] bytes, final T params) throws ImagingException, IOException {
         return getBufferedImage(ByteSource.array(bytes), params);
     }
 
     /**
-     * Gets a buffered image specified by the byte source (for
-     * sources that specify multiple images, choice of which image
-     * is returned is implementation dependent).
+     * Gets a buffered image specified by the byte source (for sources that specify multiple images, choice of which image is returned is implementation
+     * dependent).
      *
      * @param byteSource A valid instance of ByteSource
-     * @param params     Optional instructions for special-handling or
-     *                   interpretation of the input data (null objects are permitted and
-     *                   must be supported by implementations).
+     * @param params     Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *                   implementations).
      * @return A valid instance of BufferedImage.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public abstract BufferedImage getBufferedImage(ByteSource byteSource, T params)
-            throws ImagingException, IOException;
+    public abstract BufferedImage getBufferedImage(ByteSource byteSource, T params) throws ImagingException, IOException;
 
     /**
-     * Gets a buffered image specified by the indicated file  (for
-     * sources that specify multiple images, choice of which image
-     * is returned is implementation dependent).
+     * Gets a buffered image specified by the indicated file (for sources that specify multiple images, choice of which image is returned is implementation
+     * dependent).
      *
      * @param file   A valid file reference.
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data (null objects are permitted and
-     *               must be supported by implementations).
+     * @param params Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *               implementations).
      * @return A valid instance of BufferedImage.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final BufferedImage getBufferedImage(final File file, final T params)
-            throws ImagingException, IOException {
+    public final BufferedImage getBufferedImage(final File file, final T params) throws ImagingException, IOException {
         if (!canAcceptExtension(file)) {
             return null;
         }
@@ -397,9 +330,8 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets an instance of IBufferedImageFactory based on the presence
-     * of a specification for ImagingConstants.&#46;BUFFERED_IMAGE_FACTORY
-     * within the supplied params.
+     * Gets an instance of IBufferedImageFactory based on the presence of a specification for ImagingConstants.&#46;BUFFERED_IMAGE_FACTORY within the supplied
+     * params.
      *
      * @param params optional parameters.
      * @return A valid instance of an implementation of a IBufferedImageFactory.
@@ -419,9 +351,8 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets the default extension for the format specified by an implementation
-     * of ImageParser.  Some parsers can support more than one extension
-     * (i.e. .JPEG, .JPG;  .TIF, .TIFF, etc.).
+     * Gets the default extension for the format specified by an implementation of ImageParser. Some parsers can support more than one extension (i.e. .JPEG,
+     * .JPG; .TIF, .TIFF, etc.).
      *
      * @return A valid string.
      */
@@ -429,49 +360,44 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
 
     /**
      * Gets a default parameters instance for this parser.
+     *
      * @return default parameters instance
      */
     public abstract T getDefaultParameters();
 
     /**
-     * Determines the format compliance of the content of the supplied byte
-     * array based on rules provided by a specific implementation.
+     * Determines the format compliance of the content of the supplied byte array based on rules provided by a specific implementation.
      *
      * @param bytes A valid byte array.
      * @return A valid FormatCompliance object.
      * @throws ImagingException may be thrown by sub-classes
-     * @throws IOException        may be thrown by sub-classes
+     * @throws IOException      may be thrown by sub-classes
      */
-    public final FormatCompliance getFormatCompliance(final byte[] bytes)
-            throws ImagingException, IOException {
+    public final FormatCompliance getFormatCompliance(final byte[] bytes) throws ImagingException, IOException {
         return getFormatCompliance(ByteSource.array(bytes));
     }
 
     /**
-     * Determines the format compliance of the content of the supplied byte
-     * source based on rules provided by a specific implementation.
+     * Determines the format compliance of the content of the supplied byte source based on rules provided by a specific implementation.
      *
      * @param byteSource A valid instance of ByteSource
      * @return true if the content is format-compliant; otherwise, false
      * @throws ImagingException may be thrown by sub-classes
-     * @throws IOException        may be thrown by sub-classes
+     * @throws IOException      may be thrown by sub-classes
      */
-    public FormatCompliance getFormatCompliance(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public FormatCompliance getFormatCompliance(final ByteSource byteSource) throws ImagingException, IOException {
         return null;
     }
 
     /**
-     * Determines the format compliance of the specified file based on
-     * rules provided by a specific implementation.
+     * Determines the format compliance of the specified file based on rules provided by a specific implementation.
      *
      * @param file A valid reference to a file.
      * @return A valid format compliance object.
      * @throws ImagingException may be thrown by sub-classes
-     * @throws IOException        may be thrown by sub-classes
+     * @throws IOException      may be thrown by sub-classes
      */
-    public final FormatCompliance getFormatCompliance(final File file)
-            throws ImagingException, IOException {
+    public final FormatCompliance getFormatCompliance(final File file) throws ImagingException, IOException {
         if (!canAcceptExtension(file)) {
             return null;
         }
@@ -480,89 +406,68 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets an array of bytes describing the International Color Consortium (ICC)
-     * specification for the color space of the image contained in the
-     * input byte array. Not all formats support ICC profiles.
+     * Gets an array of bytes describing the International Color Consortium (ICC) specification for the color space of the image contained in the input byte
+     * array. Not all formats support ICC profiles.
      *
      * @param bytes A valid array of bytes.
      * @return If available, a valid array of bytes; otherwise, a null
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final byte[] getIccProfileBytes(final byte[] bytes) throws ImagingException, IOException {
         return getIccProfileBytes(bytes, null);
     }
 
     /**
-     * Gets an array of bytes describing the International Color Consortium (ICC)
-     * specification for the color space of the image contained in the
-     * input byte array. Not all formats support ICC profiles.
+     * Gets an array of bytes describing the International Color Consortium (ICC) specification for the color space of the image contained in the input byte
+     * array. Not all formats support ICC profiles.
      *
      * @param bytes  A valid array of bytes.
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data.
+     * @param params Optional instructions for special-handling or interpretation of the input data.
      * @return If available, a valid array of bytes; otherwise, a null
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final byte[] getIccProfileBytes(final byte[] bytes, final T params)
-            throws ImagingException, IOException {
+    public final byte[] getIccProfileBytes(final byte[] bytes, final T params) throws ImagingException, IOException {
         return getIccProfileBytes(ByteSource.array(bytes), params);
     }
 
     /**
-     * Gets an array of bytes describing the International Color Consortium (ICC)
-     * specification for the color space of the image contained in the
-     * input byteSource. Not all formats support ICC profiles.
+     * Gets an array of bytes describing the International Color Consortium (ICC) specification for the color space of the image contained in the input
+     * byteSource. Not all formats support ICC profiles.
      *
      * @param byteSource A valid ByteSource.
-     * @param params     Optional instructions for special-handling or
-     *                   interpretation of the input data.
+     * @param params     Optional instructions for special-handling or interpretation of the input data.
      * @return If available, a valid array of bytes; otherwise, a null
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public abstract byte[] getIccProfileBytes(ByteSource byteSource, T params)
-            throws ImagingException, IOException;
+    public abstract byte[] getIccProfileBytes(ByteSource byteSource, T params) throws ImagingException, IOException;
 
     /**
-     * Gets an array of bytes describing the International Color Consortium (ICC)
-     * specification for the color space of the image contained in the
-     * input file. Not all formats support ICC profiles.
+     * Gets an array of bytes describing the International Color Consortium (ICC) specification for the color space of the image contained in the input file.
+     * Not all formats support ICC profiles.
      *
      * @param file A valid file reference.
      * @return If available, a valid array of bytes; otherwise, a null
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final byte[] getIccProfileBytes(final File file) throws ImagingException, IOException {
         return getIccProfileBytes(file, null);
     }
 
     /**
-     * Gets an array of bytes describing the International Color Consortium (ICC)
-     * specification for the color space of the image contained in the
-     * input file. Not all formats support ICC profiles.
+     * Gets an array of bytes describing the International Color Consortium (ICC) specification for the color space of the image contained in the input file.
+     * Not all formats support ICC profiles.
      *
      * @param file   A valid file reference.
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data.
+     * @param params Optional instructions for special-handling or interpretation of the input data.
      * @return If available, a valid array of bytes; otherwise, a null
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final byte[] getIccProfileBytes(final File file, final T params)
-            throws ImagingException, IOException {
+    public final byte[] getIccProfileBytes(final File file, final T params) throws ImagingException, IOException {
         if (!canAcceptExtension(file)) {
             return null;
         }
@@ -575,106 +480,71 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets image information from the specified array of bytes.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * ImageInfo object or to throw an ImageReadException if unable
-     * to process the specified data.
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will require this capability.  Because the
-     * base class may call this method with a null params argument,
-     * implementations should <strong>always</strong> include logic
-     * for ignoring null input.
+     * Gets image information from the specified array of bytes. Format-specific ImageParser implementations are expected to return a valid ImageInfo object or
+     * to throw an ImageReadException if unable to process the specified data.
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will require this
+     * capability. Because the base class may call this method with a null params argument, implementations should <strong>always</strong> include logic for
+     * ignoring null input.
      *
      * @param bytes  A valid array of bytes
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data (null objects are permitted and
-     *               must be supported by implementations).
-     * @return A valid image information object describing the content extracted
-     *         from the specified data.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful data
-     *                            access operation.
-     */
-    public final ImageInfo getImageInfo(final byte[] bytes, final T params)
-            throws ImagingException, IOException {
+     * @param params Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *               implementations).
+     * @return A valid image information object describing the content extracted from the specified data.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data access operation.
+     */
+    public final ImageInfo getImageInfo(final byte[] bytes, final T params) throws ImagingException, IOException {
         return getImageInfo(ByteSource.array(bytes), params);
     }
 
     /**
-     * Gets image information from the specified ByteSource.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * ImageInfo object or to throw an ImageReadException if unable
-     * to process the specified data.
+     * Gets image information from the specified ByteSource. Format-specific ImageParser implementations are expected to return a valid ImageInfo object or to
+     * throw an ImageReadException if unable to process the specified data.
      *
      * @param byteSource A valid ByteSource object
-     * @return A valid image information object describing the content extracted
-     *         from the specified data.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful data
-     *                            access operation.
+     * @return A valid image information object describing the content extracted from the specified data.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data access operation.
      */
     public final ImageInfo getImageInfo(final ByteSource byteSource) throws ImagingException, IOException {
         return getImageInfo(byteSource, null);
     }
 
     /**
-     * Gets image information from the specified ByteSource. Format-specific
-     * ImageParser implementations are expected to return a valid
-     * ImageInfo object or to throw an ImageReadException if unable
-     * to process the specified data.
+     * Gets image information from the specified ByteSource. Format-specific ImageParser implementations are expected to return a valid ImageInfo object or to
+     * throw an ImageReadException if unable to process the specified data.
      *
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will require this capability.  Because the
-     * base class may call this method with a null params argument,
-     * implementations should <strong>always</strong> include logic
-     * for ignoring null input.
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will require this
+     * capability. Because the base class may call this method with a null params argument, implementations should <strong>always</strong> include logic for
+     * ignoring null input.
      *
      * @param byteSource A valid ByteSource object
-     * @param params     Optional instructions for special-handling or interpretation
-     *                   of the input data (null objects are permitted and
-     *                   must be supported by implementations).
-     * @return A valid image information object describing the content extracted
-     *         from the specified data.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful data access operation.
-     */
-    public abstract ImageInfo getImageInfo(ByteSource byteSource, T params)
-            throws ImagingException, IOException;
-
-    /**
-     * Gets image information from the specified file  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * ImageInfo object or to throw an ImageReadException if unable
-     * to process the specified data.
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will require this capability.  Because the
-     * base class may call this method with a null params argument,
-     * implementations should <strong>always</strong> include logic
-     * for ignoring null input.
+     * @param params     Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *                   implementations).
+     * @return A valid image information object describing the content extracted from the specified data.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data access operation.
+     */
+    public abstract ImageInfo getImageInfo(ByteSource byteSource, T params) throws ImagingException, IOException;
+
+    /**
+     * Gets image information from the specified file Format-specific ImageParser implementations are expected to return a valid ImageInfo object or to throw an
+     * ImageReadException if unable to process the specified data.
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will require this
+     * capability. Because the base class may call this method with a null params argument, implementations should <strong>always</strong> include logic for
+     * ignoring null input.
      *
      * @param file   A valid File object
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data (null objects are permitted and
-     *               must be supported by implementations).
-     * @return A valid image information object describing the content extracted
-     *         from the specified data.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful file read or
-     *                            access operation.
-     */
-    public final ImageInfo getImageInfo(final File file, final T params)
-            throws ImagingException, IOException {
+     * @param params Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *               implementations).
+     * @return A valid image information object describing the content extracted from the specified data.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful file read or access operation.
+     */
+    public final ImageInfo getImageInfo(final File file, final T params) throws ImagingException, IOException {
         if (!canAcceptExtension(file)) {
             return null;
         }
@@ -687,10 +557,8 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
      *
      * @param bytes A valid byte array.
      * @return A valid instance of Dimension.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final Dimension getImageSize(final byte[] bytes) throws ImagingException, IOException {
         return getImageSize(bytes, null);
@@ -700,16 +568,12 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
      * Gets the size of the image described by the specified byte array.
      *
      * @param bytes  A valid byte array.
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data.
+     * @param params Optional instructions for special-handling or interpretation of the input data.
      * @return A valid instance of Dimension.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final Dimension getImageSize(final byte[] bytes, final T params)
-            throws ImagingException, IOException {
+    public final Dimension getImageSize(final byte[] bytes, final T params) throws ImagingException, IOException {
         return getImageSize(ByteSource.array(bytes), params);
     }
 
@@ -717,26 +581,20 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
      * Gets the size of the image described by the specified ByteSource.
      *
      * @param byteSource A valid reference to a ByteSource.
-     * @param params     Optional instructions for special-handling or
-     *                   interpretation of the input data.
+     * @param params     Optional instructions for special-handling or interpretation of the input data.
      * @return A valid instance of Dimension.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public abstract Dimension getImageSize(ByteSource byteSource, T params)
-            throws ImagingException, IOException;
+    public abstract Dimension getImageSize(ByteSource byteSource, T params) throws ImagingException, IOException;
 
     /**
      * Gets the size of the image described by the specified file.
      *
      * @param file A valid reference to a file.
      * @return A valid instance of Dimension.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public final Dimension getImageSize(final File file) throws ImagingException, IOException {
         return getImageSize(file, null);
@@ -746,16 +604,12 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
      * Gets the size of the image described by the specified file.
      *
      * @param file   A valid reference to a file.
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data.
+     * @param params Optional instructions for special-handling or interpretation of the input data.
      * @return A valid instance of Dimension.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
-    public final Dimension getImageSize(final File file, final T params)
-            throws ImagingException, IOException {
+    public final Dimension getImageSize(final File file, final T params) throws ImagingException, IOException {
 
         if (!canAcceptExtension(file)) {
             return null;
@@ -765,146 +619,102 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     }
 
     /**
-     * Gets image metadata from the specified array of bytes.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * IImageMetadata object or to throw an ImageReadException if unable
-     * to process the specified data.
+     * Gets image metadata from the specified array of bytes. Format-specific ImageParser implementations are expected to return a valid IImageMetadata object
+     * or to throw an ImageReadException if unable to process the specified data.
      *
      * @param bytes A valid array of bytes
-     * @return A valid, potentially subject-matter-specific implementation of
-     *         the IImageMetadata interface describing the content extracted
-     *         from the source content.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful data read operation.
+     * @return A valid, potentially subject-matter-specific implementation of the IImageMetadata interface describing the content extracted from the source
+     *         content.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data read operation.
      */
     public final ImageMetadata getMetadata(final byte[] bytes) throws ImagingException, IOException {
         return getMetadata(bytes, null);
     }
 
     /**
-     * Gets image metadata from the specified array of bytes.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * IImageMetadata object or to throw an ImageReadException if unable
-     * to process the specified data.
+     * Gets image metadata from the specified array of bytes. Format-specific ImageParser implementations are expected to return a valid IImageMetadata object
+     * or to throw an ImageReadException if unable to process the specified data.
      *
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will require this capability.  Because the
-     * base class may call this method with a null params argument,
-     * implementations should <strong>always</strong> include logic
-     * for ignoring null input.
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will require this
+     * capability. Because the base class may call this method with a null params argument, implementations should <strong>always</strong> include logic for
+     * ignoring null input.
      *
      * @param bytes  A valid array of bytes
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data (null objects are permitted and
-     *               must be supported by implementations).
-     * @return A valid image metadata object describing the content extracted
-     *         from  the specified content.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful data read operation.
-     */
-    public final ImageMetadata getMetadata(final byte[] bytes, final T params)
-            throws ImagingException, IOException {
+     * @param params Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *               implementations).
+     * @return A valid image metadata object describing the content extracted from the specified content.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data read operation.
+     */
+    public final ImageMetadata getMetadata(final byte[] bytes, final T params) throws ImagingException, IOException {
         return getMetadata(ByteSource.array(bytes), params);
     }
 
     /**
-     * Gets image metadata from the specified byte source.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * IImageMetadata object or to throw an ImageReadException if unable
-     * to process the specified byte source.
+     * Gets image metadata from the specified byte source. Format-specific ImageParser implementations are expected to return a valid IImageMetadata object or
+     * to throw an ImageReadException if unable to process the specified byte source.
      *
      * @param byteSource A valid byte source.
-     * @return A valid, potentially subject-matter-specific implementation of
-     *         the IImageMetadata interface describing the content extracted
-     *         from the source content.
-     * @throws ImagingException In the event that the ByteSource
-     *                            content does not conform to the format of the specific parser
-     *                            implementation.
-     * @throws IOException        In the event of unsuccessful data read operation.
+     * @return A valid, potentially subject-matter-specific implementation of the IImageMetadata interface describing the content extracted from the source
+     *         content.
+     * @throws ImagingException In the event that the ByteSource content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data read operation.
      */
     public final ImageMetadata getMetadata(final ByteSource byteSource) throws ImagingException, IOException {
         return getMetadata(byteSource, null);
     }
 
     /**
-     * Gets image metadata from the specified byte source.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * IImageMetadata object or to throw an ImageReadException if unable
-     * to process the specified byte source.
+     * Gets image metadata from the specified byte source. Format-specific ImageParser implementations are expected to return a valid IImageMetadata object or
+     * to throw an ImageReadException if unable to process the specified byte source.
      *
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will require this capability.  Because the
-     * base class may call this method with a null params argument,
-     * implementations should <strong>always</strong> include logic
-     * for ignoring null input.
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will require this
+     * capability. Because the base class may call this method with a null params argument, implementations should <strong>always</strong> include logic for
+     * ignoring null input.
      *
      * @param byteSource A valid byte source.
-     * @param params     Optional instructions for special-handling or
-     *                   interpretation of the input data (null objects are permitted and
-     *                   must be supported by implementations).
-     * @return A valid, potentially subject-matter-specific implementation of
-     *         the IImageMetadata interface describing the content extracted
-     *         from the source content.
-     * @throws ImagingException In the event that the ByteSource
-     *                            content does not conform to the format of the specific parser
-     *                            implementation.
-     * @throws IOException        In the event of unsuccessful data read operation.
-     */
-    public abstract ImageMetadata getMetadata(ByteSource byteSource, T params)
-            throws ImagingException, IOException;
-
-    /**
-     * Gets image metadata from the specified file.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * IImageMetadata object or to throw an ImageReadException if unable
-     * to process the specified data.
+     * @param params     Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *                   implementations).
+     * @return A valid, potentially subject-matter-specific implementation of the IImageMetadata interface describing the content extracted from the source
+     *         content.
+     * @throws ImagingException In the event that the ByteSource content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful data read operation.
+     */
+    public abstract ImageMetadata getMetadata(ByteSource byteSource, T params) throws ImagingException, IOException;
+
+    /**
+     * Gets image metadata from the specified file. Format-specific ImageParser implementations are expected to return a valid IImageMetadata object or to throw
+     * an ImageReadException if unable to process the specified data.
      *
      * @param file A valid reference to a file.
-     * @return A valid image metadata object describing the content extracted
-     *         from  the specified content.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful file read or
-     *                            access operation.
+     * @return A valid image metadata object describing the content extracted from the specified content.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful file read or access operation.
      */
     public final ImageMetadata getMetadata(final File file) throws ImagingException, IOException {
         return getMetadata(file, null);
     }
 
     /**
-     * Gets image metadata from the specified file.  Format-specific
-     * ImageParser implementations are expected to return a valid
-     * IImageMetadata object or to throw an ImageReadException if unable
-     * to process the specified data.
+     * Gets image metadata from the specified file. Format-specific ImageParser implementations are expected to return a valid IImageMetadata object or to throw
+     * an ImageReadException if unable to process the specified data.
      *
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will require this capability.  Because the
-     * base class may call this method with a null params argument,
-     * implementations should <strong>always</strong> include logic
-     * for ignoring null input.
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will require this
+     * capability. Because the base class may call this method with a null params argument, implementations should <strong>always</strong> include logic for
+     * ignoring null input.
      *
      * @param file   A valid reference to a file.
-     * @param params Optional instructions for special-handling or
-     *               interpretation of the input data (null objects are permitted and
-     *               must be supported by implementations).
-     * @return A valid image metadata object describing the content extracted
-     *         from  the specified content.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful file read or
-     *                            access operation.
-     */
-    public final ImageMetadata getMetadata(final File file, final T params)
-            throws ImagingException, IOException {
+     * @param params Optional instructions for special-handling or interpretation of the input data (null objects are permitted and must be supported by
+     *               implementations).
+     * @return A valid image metadata object describing the content extracted from the specified content.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful file read or access operation.
+     */
+    public final ImageMetadata getMetadata(final File file, final T params) throws ImagingException, IOException {
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest(getName() + ".getMetadata" + ": " + file.getName());
         }
@@ -924,25 +734,20 @@ public abstract class AbstractImageParser<T extends ImagingParameters<T>> extend
     public abstract String getName();
 
     /**
-     * Writes the content of a BufferedImage to the specified output
-     * stream.
+     * Writes the content of a BufferedImage to the specified output stream.
      *
-     * <p>The params argument provides a mechanism for individual
-     * implementations to pass optional information into the parser.
-     * Not all formats will support this capability.  Currently,
-     * some of the parsers do not check for null arguments.</p>
+     * <p>
+     * The params argument provides a mechanism for individual implementations to pass optional information into the parser. Not all formats will support this
+     * capability. Currently, some of the parsers do not check for null arguments.
+     * </p>
      *
      * @param src    An image giving the source content for output
      * @param os     A valid output stream for storing the formatted image
-     * @param params optional parameters, defining format-specific instructions for output
-     *               (such as selections for data compression, color models, etc.)
-     * @throws ImagingException In the event that the output format
-     *                             cannot handle the input image or invalid params are specified.
-     * @throws IOException         In the event of an write error from
-     *                             the output stream.
-     */
-    public void writeImage(final BufferedImage src, final OutputStream os, final T params)
-            throws ImagingException, IOException {
+     * @param params optional parameters, defining format-specific instructions for output (such as selections for data compression, color models, etc.)
+     * @throws ImagingException In the event that the output format cannot handle the input image or invalid params are specified.
+     * @throws IOException      In the event of an write error from the output stream.
+     */
+    public void writeImage(final BufferedImage src, final OutputStream os, final T params) throws ImagingException, IOException {
         throw new ImagingException("This image format (" + getName() + ") cannot be written.");
     }
 }
diff --git a/src/main/java/org/apache/commons/imaging/ColorTools.java b/src/main/java/org/apache/commons/imaging/ColorTools.java
index d6535852..12dc7837 100644
--- a/src/main/java/org/apache/commons/imaging/ColorTools.java
+++ b/src/main/java/org/apache/commons/imaging/ColorTools.java
@@ -42,14 +42,10 @@ import java.io.IOException;
  */
 public class ColorTools {
 
-    public BufferedImage convertBetweenColorSpaces(BufferedImage bi,
-            final ColorSpace from, final ColorSpace to) {
-        final RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
-                RenderingHints.VALUE_RENDER_QUALITY);
-        hints.put(RenderingHints.KEY_COLOR_RENDERING,
-                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-        hints.put(RenderingHints.KEY_DITHERING,
-                RenderingHints.VALUE_DITHER_ENABLE);
+    public BufferedImage convertBetweenColorSpaces(BufferedImage bi, final ColorSpace from, final ColorSpace to) {
+        final RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
 
         final ColorConvertOp op = new ColorConvertOp(from, to, hints);
 
@@ -62,14 +58,10 @@ public class ColorTools {
         return result;
     }
 
-    public BufferedImage convertBetweenColorSpacesX2(BufferedImage bi,
-            final ColorSpace from, final ColorSpace to) {
-        final RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
-                RenderingHints.VALUE_RENDER_QUALITY);
-        hints.put(RenderingHints.KEY_COLOR_RENDERING,
-                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-        hints.put(RenderingHints.KEY_DITHERING,
-                RenderingHints.VALUE_DITHER_ENABLE);
+    public BufferedImage convertBetweenColorSpacesX2(BufferedImage bi, final ColorSpace from, final ColorSpace to) {
+        final RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
 
         // bi = relabelColorSpace(bi, cs);
         // dumpColorSpace("\tcs_sRGB", cs_sRGB);
@@ -105,12 +97,9 @@ public class ColorTools {
     public BufferedImage convertToColorSpace(final BufferedImage bi, final ColorSpace to) {
         final ColorSpace from = bi.getColorModel().getColorSpace();
 
-        final RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
-                RenderingHints.VALUE_RENDER_QUALITY);
-        hints.put(RenderingHints.KEY_COLOR_RENDERING,
-                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-        hints.put(RenderingHints.KEY_DITHERING,
-                RenderingHints.VALUE_DITHER_ENABLE);
+        final RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
 
         final ColorConvertOp op = new ColorConvertOp(from, to, hints);
 
@@ -131,8 +120,7 @@ public class ColorTools {
         return convertToColorSpace(bi, srgbCM.getColorSpace());
     }
 
-    public BufferedImage correctImage(final BufferedImage src, final File file)
-            throws ImagingException, IOException {
+    public BufferedImage correctImage(final BufferedImage src, final File file) throws ImagingException, IOException {
         final ICC_Profile icc = Imaging.getIccProfile(file);
         if (icc == null) {
             return src;
@@ -146,7 +134,7 @@ public class ColorTools {
     private int countBitsInMask(int i) {
         int count = 0;
         while (i != 0) {
-            count += (i & 1);
+            count += i & 1;
             // uses the unsigned version of java's right shift operator,
             // so that left hand bits are zeroed.
             i >>>= 1;
@@ -154,42 +142,34 @@ public class ColorTools {
         return count;
     }
 
-    public ColorModel deriveColorModel(final BufferedImage bi, final ColorSpace cs)
-            throws ImagingOpException {
+    public ColorModel deriveColorModel(final BufferedImage bi, final ColorSpace cs) throws ImagingOpException {
         // boolean hasAlpha = (bi.getAlphaRaster() != null);
         return deriveColorModel(bi, cs, false);
     }
 
-    public ColorModel deriveColorModel(final BufferedImage bi, final ColorSpace cs,
-            final boolean forceNoAlpha) throws ImagingOpException {
+    public ColorModel deriveColorModel(final BufferedImage bi, final ColorSpace cs, final boolean forceNoAlpha) throws ImagingOpException {
         return deriveColorModel(bi.getColorModel(), cs, forceNoAlpha);
     }
 
-    public ColorModel deriveColorModel(final ColorModel colorModel, final ColorSpace cs,
-            final boolean forceNoAlpha) throws ImagingOpException {
+    public ColorModel deriveColorModel(final ColorModel colorModel, final ColorSpace cs, final boolean forceNoAlpha) throws ImagingOpException {
 
         if (colorModel instanceof ComponentColorModel) {
             final ComponentColorModel ccm = (ComponentColorModel) colorModel;
             // ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
             if (forceNoAlpha) {
-                return new ComponentColorModel(cs, false, false,
-                        Transparency.OPAQUE, ccm.getTransferType());
+                return new ComponentColorModel(cs, false, false, Transparency.OPAQUE, ccm.getTransferType());
             }
-            return new ComponentColorModel(cs, ccm.hasAlpha(),
-                    ccm.isAlphaPremultiplied(), ccm.getTransparency(),
-                    ccm.getTransferType());
+            return new ComponentColorModel(cs, ccm.hasAlpha(), ccm.isAlphaPremultiplied(), ccm.getTransparency(), ccm.getTransferType());
         }
         if (colorModel instanceof DirectColorModel) {
             final DirectColorModel dcm = (DirectColorModel) colorModel;
 
-            final int oldMask = dcm.getRedMask() | dcm.getGreenMask()
-                    | dcm.getBlueMask() | dcm.getAlphaMask();
+            final int oldMask = dcm.getRedMask() | dcm.getGreenMask() | dcm.getBlueMask() | dcm.getAlphaMask();
 
             final int oldBits = countBitsInMask(oldMask);
 
-            return new DirectColorModel(cs, oldBits, dcm.getRedMask(),
-                    dcm.getGreenMask(), dcm.getBlueMask(), dcm.getAlphaMask(),
-                    dcm.isAlphaPremultiplied(), dcm.getTransferType());
+            return new DirectColorModel(cs, oldBits, dcm.getRedMask(), dcm.getGreenMask(), dcm.getBlueMask(), dcm.getAlphaMask(), dcm.isAlphaPremultiplied(),
+                    dcm.getTransferType());
         }
         // else if (old_cm instanceof PackedColorModel)
         // {
@@ -215,8 +195,7 @@ public class ColorTools {
         throw new ImagingOpException("Could not clone unknown ColorModel Type.");
     }
 
-    public BufferedImage relabelColorSpace(final BufferedImage bi, final ColorModel cm)
-            throws ImagingOpException {
+    public BufferedImage relabelColorSpace(final BufferedImage bi, final ColorModel cm) throws ImagingOpException {
         // This does not do the conversion. It tries to relabel the
         // BufferedImage
         // with its actual (presumably correct) Colorspace.
@@ -226,8 +205,7 @@ public class ColorTools {
         return new BufferedImage(cm, bi.getRaster(), false, null);
     }
 
-    public BufferedImage relabelColorSpace(final BufferedImage bi, final ColorSpace cs)
-            throws ImagingOpException {
+    public BufferedImage relabelColorSpace(final BufferedImage bi, final ColorSpace cs) throws ImagingOpException {
         // This does not do the conversion. It tries to relabel the
         // BufferedImage
         // with its actual (presumably correct) Colorspace.
@@ -240,8 +218,7 @@ public class ColorTools {
 
     }
 
-    public BufferedImage relabelColorSpace(final BufferedImage bi, final ICC_Profile profile)
-            throws ImagingOpException {
+    public BufferedImage relabelColorSpace(final BufferedImage bi, final ICC_Profile profile) throws ImagingOpException {
         final ICC_ColorSpace cs = new ICC_ColorSpace(profile);
 
         return relabelColorSpace(bi, cs);
diff --git a/src/main/java/org/apache/commons/imaging/FormatCompliance.java b/src/main/java/org/apache/commons/imaging/FormatCompliance.java
index 9546c396..6ccada46 100644
--- a/src/main/java/org/apache/commons/imaging/FormatCompliance.java
+++ b/src/main/java/org/apache/commons/imaging/FormatCompliance.java
@@ -25,8 +25,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 /**
- * Provides information about the compliance of a specified data
- * source (byte array, file, etc&#46;) to an image format.
+ * Provides information about the compliance of a specified data source (byte array, file, etc&#46;) to an image format.
  */
 public class FormatCompliance {
 
@@ -62,24 +61,20 @@ public class FormatCompliance {
         addComment(comment + ": " + getValueDescription(value));
     }
 
-    public boolean checkBounds(final String name, final int min, final int max, final int actual)
-            throws ImagingException {
-        if ((actual < min) || (actual > max)) {
-            addComment(name + ": " + "bounds check: " + min + " <= " + actual
-                    + " <= " + max + ": false");
+    public boolean checkBounds(final String name, final int min, final int max, final int actual) throws ImagingException {
+        if (actual < min || actual > max) {
+            addComment(name + ": " + "bounds check: " + min + " <= " + actual + " <= " + max + ": false");
             return false;
         }
 
         return true;
     }
 
-    public boolean compare(final String name, final int valid, final int actual)
-            throws ImagingException {
+    public boolean compare(final String name, final int valid, final int actual) throws ImagingException {
         return compare(name, new int[] { valid, }, actual);
     }
 
-    public boolean compare(final String name, final int[] valid, final int actual)
-            throws ImagingException {
+    public boolean compare(final String name, final int[] valid, final int actual) throws ImagingException {
         for (final int element : valid) {
             if (actual == element) {
                 return true;
@@ -106,11 +101,9 @@ public class FormatCompliance {
         return false;
     }
 
-    public boolean compareBytes(final String name, final byte[] expected, final byte[] actual)
-            throws ImagingException {
+    public boolean compareBytes(final String name, final byte[] expected, final byte[] actual) throws ImagingException {
         if (expected.length != actual.length) {
-            addComment(name + ": " + "Unexpected length: (expected: "
-                    + expected.length + ", actual: " + actual.length + ")");
+            addComment(name + ": " + "Unexpected length: (expected: " + expected.length + ", actual: " + actual.length + ")");
             return false;
         }
         for (int i = 0; i < expected.length; i++) {
@@ -118,9 +111,8 @@ public class FormatCompliance {
             // + getValueDescription(expected[i]) + ", actual: "
             // + getValueDescription(actual[i]) + ")");
             if (expected[i] != actual[i]) {
-                addComment(name + ": " + "Unexpected value: (expected: "
-                        + getValueDescription(expected[i]) + ", actual: "
-                        + getValueDescription(actual[i]) + ")");
+                addComment(
+                        name + ": " + "Unexpected value: (expected: " + getValueDescription(expected[i]) + ", actual: " + getValueDescription(actual[i]) + ")");
                 return false;
             }
         }
@@ -129,7 +121,8 @@ public class FormatCompliance {
     }
 
     public void dump() {
-        try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) {
+        try (StringWriter sw = new StringWriter();
+                PrintWriter pw = new PrintWriter(sw)) {
             dump(pw);
             pw.flush();
             sw.flush();
diff --git a/src/main/java/org/apache/commons/imaging/ImageFormats.java b/src/main/java/org/apache/commons/imaging/ImageFormats.java
index 85756f54..dbe462ba 100644
--- a/src/main/java/org/apache/commons/imaging/ImageFormats.java
+++ b/src/main/java/org/apache/commons/imaging/ImageFormats.java
@@ -20,33 +20,13 @@ package org.apache.commons.imaging;
  * Enum of known image formats.
  */
 public enum ImageFormats implements ImageFormat {
-    UNKNOWN(),
-    BMP("bmp", "dib"),
-    DCX("dcx"),
-    GIF("gif"),
-    ICNS("icns"),
-    ICO("ico"),
-    JBIG2(),
-    JPEG("jpg", "jpeg"),
-    PAM("pam"),
-    PSD("psd"),
-    PBM("pbm"),
-    PGM("pgm"),
-    PNM("pnm"),
-    PPM("ppm"),
-    PCX("pcx", "pcc"),
-    PNG("png"),
-    RGBE("hdr", "pic"),
-    TGA(),
-    TIFF("tif", "tiff"),
-    WBMP("wbmp"),
-    WEBP("webp"),
-    XBM("xbm"),
+    UNKNOWN(), BMP("bmp", "dib"), DCX("dcx"), GIF("gif"), ICNS("icns"), ICO("ico"), JBIG2(), JPEG("jpg", "jpeg"), PAM("pam"), PSD("psd"), PBM("pbm"),
+    PGM("pgm"), PNM("pnm"), PPM("ppm"), PCX("pcx", "pcc"), PNG("png"), RGBE("hdr", "pic"), TGA(), TIFF("tif", "tiff"), WBMP("wbmp"), WEBP("webp"), XBM("xbm"),
     XPM("xpm");
 
     private final String[] extensions;
 
-    ImageFormats(final String ...extensions) {
+    ImageFormats(final String... extensions) {
         this.extensions = extensions;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/ImageInfo.java b/src/main/java/org/apache/commons/imaging/ImageInfo.java
index d3e8f840..89c0a3c0 100644
--- a/src/main/java/org/apache/commons/imaging/ImageInfo.java
+++ b/src/main/java/org/apache/commons/imaging/ImageInfo.java
@@ -24,21 +24,12 @@ import java.util.List;
 import java.util.logging.Logger;
 
 /**
- * ImageInfo represents a collection of basic properties of an image, such as
- * width, height, format, bit depth, etc.
+ * ImageInfo represents a collection of basic properties of an image, such as width, height, format, bit depth, etc.
  */
 public class ImageInfo {
 
     public enum ColorType {
-        BW("Black and White"),
-        GRAYSCALE("Grayscale"),
-        RGB("RGB"),
-        CMYK("CMYK"),
-        YCbCr("YCbCr"),
-        YCCK("YCCK"),
-        YCC("YCC"),
-        OTHER("Other"),
-        UNKNOWN("Unknown");
+        BW("Black and White"), GRAYSCALE("Grayscale"), RGB("RGB"), CMYK("CMYK"), YCbCr("YCbCr"), YCCK("YCCK"), YCC("YCC"), OTHER("Other"), UNKNOWN("Unknown");
 
         private final String description;
 
@@ -53,19 +44,9 @@ public class ImageInfo {
     }
 
     public enum CompressionAlgorithm {
-        UNKNOWN("Unknown"),
-        NONE("None"),
-        LZW("LZW"),
-        PACKBITS("PackBits"),
-        JPEG_TIFF_OBSOLETE("JPEG Obsolete (TIFF only)"),
-        JPEG("JPEG"),
-        RLE("RLE: Run-Length Encoding"),
-        ADAPTIVE_RLE("Adaptive RLE"),
-        PSD("Photoshop"),
-        PNG_FILTER("PNG Filter"),
-        CCITT_GROUP_3("CCITT Group 3 1-Dimensional Modified Huffman run-length encoding."),
-        CCITT_GROUP_4("CCITT Group 4"),
-        CCITT_1D("CCITT 1D"),
+        UNKNOWN("Unknown"), NONE("None"), LZW("LZW"), PACKBITS("PackBits"), JPEG_TIFF_OBSOLETE("JPEG Obsolete (TIFF only)"), JPEG("JPEG"),
+        RLE("RLE: Run-Length Encoding"), ADAPTIVE_RLE("Adaptive RLE"), PSD("Photoshop"), PNG_FILTER("PNG Filter"),
+        CCITT_GROUP_3("CCITT Group 3 1-Dimensional Modified Huffman run-length encoding."), CCITT_GROUP_4("CCITT Group 4"), CCITT_1D("CCITT 1D"),
         DEFLATE("DEFLATE (ZIP)");
 
         private final String description;
@@ -107,13 +88,10 @@ public class ImageInfo {
 
     private final CompressionAlgorithm compressionAlgorithm;
 
-    public ImageInfo(final String formatDetails, final int bitsPerPixel,
-            final List<String> comments, final ImageFormat format, final String formatName,
-            final int height, final String mimeType, final int numberOfImages,
-            final int physicalHeightDpi, final float physicalHeightInch,
-            final int physicalWidthDpi, final float physicalWidthInch, final int width,
-            final boolean progressive, final boolean transparent, final boolean usesPalette,
-            final ColorType colorType, final CompressionAlgorithm compressionAlgorithm) {
+    public ImageInfo(final String formatDetails, final int bitsPerPixel, final List<String> comments, final ImageFormat format, final String formatName,
+            final int height, final String mimeType, final int numberOfImages, final int physicalHeightDpi, final float physicalHeightInch,
+            final int physicalWidthDpi, final float physicalWidthInch, final int width, final boolean progressive, final boolean transparent,
+            final boolean usesPalette, final ColorType colorType, final CompressionAlgorithm compressionAlgorithm) {
         this.formatDetails = formatDetails;
 
         this.bitsPerPixel = bitsPerPixel;
@@ -164,7 +142,9 @@ public class ImageInfo {
     /**
      * Returns a list of comments from the image file.
      *
-     * <p>This is mostly obsolete.</p>
+     * <p>
+     * This is mostly obsolete.
+     * </p>
      *
      * @return A list of comments.
      */
@@ -184,7 +164,9 @@ public class ImageInfo {
     /**
      * Returns the image file format, ie. ImageFormat.IMAGE_FORMAT_PNG.
      *
-     * <p>Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if format is unknown.</p>
+     * <p>
+     * Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if format is unknown.
+     * </p>
      *
      * @return a constant defined in ImageFormat.
      * @see ImageFormats
@@ -235,8 +217,9 @@ public class ImageInfo {
     /**
      * Returns the number of images in the file.
      *
-     * <p>Applies mostly to GIF and TIFF; reading PSD/Photoshop layers is not
-     * supported, and Jpeg/JFIF EXIF thumbnails are not included in this count.</p>
+     * <p>
+     * Applies mostly to GIF and TIFF; reading PSD/Photoshop layers is not supported, and Jpeg/JFIF EXIF thumbnails are not included in this count.
+     * </p>
      *
      * @return number of images in the file.
      */
@@ -247,9 +230,9 @@ public class ImageInfo {
     /**
      * Returns horizontal dpi of the image, if available.
      *
-     * <p>Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-     * 72).</p>
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: 72).
+     * </p>
      *
      * @return returns -1 if not present.
      */
@@ -260,9 +243,9 @@ public class ImageInfo {
     /**
      * Returns physical height of the image in inches, if available.
      *
-     * <p>Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-     * 72).</p>
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: 72).
+     * </p>
      *
      * @return returns -1 if not present.
      */
@@ -273,9 +256,9 @@ public class ImageInfo {
     /**
      * Returns vertical dpi of the image, if available.
      *
-     * <p>Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-     * 72).</p>
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: 72).
+     * </p>
      *
      * @return returns -1 if not present.
      */
@@ -286,9 +269,9 @@ public class ImageInfo {
     /**
      * Returns physical width of the image in inches, if available.
      *
-     * <p>Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-     * 72).</p>
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant: 72).
+     * </p>
      *
      * @return returns -1 if not present.
      */
diff --git a/src/main/java/org/apache/commons/imaging/Imaging.java b/src/main/java/org/apache/commons/imaging/Imaging.java
index 5e3d57b5..d9b1b360 100644
--- a/src/main/java/org/apache/commons/imaging/Imaging.java
+++ b/src/main/java/org/apache/commons/imaging/Imaging.java
@@ -46,36 +46,41 @@ import org.apache.commons.imaging.internal.ImageParserFactory;
  *
  * <h3>Using this class</h3>
  *
- * <p>Almost all of the Apache Commons Imaging library's core functionality can
- * be accessed through the methods provided by this class.
- * The use of the Imaging class is similar to the Java API's ImageIO class,
- * though Imaging supports formats not included in the standard Java API.</p>
+ * <p>
+ * Almost all of the Apache Commons Imaging library's core functionality can be accessed through the methods provided by this class. The use of the Imaging
+ * class is similar to the Java API's ImageIO class, though Imaging supports formats not included in the standard Java API.
+ * </p>
  *
- * <p>All of methods provided by the Imaging class are declared static.</p>
+ * <p>
+ * All of methods provided by the Imaging class are declared static.
+ * </p>
  *
- * <p>The Apache Commons Imaging package is a pure Java implementation.</p>
+ * <p>
+ * The Apache Commons Imaging package is a pure Java implementation.
+ * </p>
  *
  * <h3>Format support</h3>
  *
- * <p>While the Apache Commons Imaging package handles a number of different
- * graphics formats, support for some formats is not yet complete.
- * For the most recent information on support for specific formats, refer to
- * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
- * at the main project development web site.</p>
+ * <p>
+ * While the Apache Commons Imaging package handles a number of different graphics formats, support for some formats is not yet complete. For the most recent
+ * information on support for specific formats, refer to <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a> at the main project
+ * development web site.
+ * </p>
  *
  * <h3>Optional parameters for image reading and writing</h3>
  *
- * <p>Many of the operations provided in this class as static calls can be accessed directly
- * using format-specific {@link AbstractImageParser} instances. These static methods are provided
- * for convenience in simple use cases.</p>
+ * <p>
+ * Many of the operations provided in this class as static calls can be accessed directly using format-specific {@link AbstractImageParser} instances. These
+ * static methods are provided for convenience in simple use cases.
+ * </p>
  *
  * <h3>Example code</h3>
  *
- * <p>See the source of the SampleUsage class and other classes in the
- * org.apache.commons.imaging.examples package for examples.</p>
+ * <p>
+ * See the source of the SampleUsage class and other classes in the org.apache.commons.imaging.examples package for examples.
+ * </p>
  *
- * @see <a
- *      href="https://svn.apache.org/repos/asf/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java">
+ * @see <a href="https://svn.apache.org/repos/asf/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java">
  *      org.apache.commons.imaging.examples.SampleUsage</a>
  * @see <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
  */
@@ -108,7 +113,7 @@ public final class Imaging {
         if (a.length != 2 && b.length != 2) {
             throw new IllegalArgumentException("Invalid Byte Pair.");
         }
-        return (a[0] == b[0]) && (a[1] == b[1]);
+        return a[0] == b[0] && a[1] == b[1];
     }
 
     /**
@@ -117,7 +122,7 @@ public final class Imaging {
      * @param bytes A valid array of bytes.
      * @return A valid string.
      * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
-     * @throws IOException In the event of unsuccessful read or access operation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public static String dumpImageFile(final byte[] bytes) throws ImagingException, IOException {
         return dumpImageFile(ByteSource.array(bytes));
@@ -134,7 +139,7 @@ public final class Imaging {
      * @param file A valid file reference.
      * @return A valid string.
      * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
-     * @throws IOException In the event of unsuccessful read or access operation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public static String dumpImageFile(final File file) throws ImagingException, IOException {
         return dumpImageFile(ByteSource.file(file));
@@ -146,7 +151,7 @@ public final class Imaging {
      * @param bytes a valid array of bytes
      * @return A valid (potentially empty) list of BufferedImage objects.
      * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
-     * @throws IOException In the event of unsuccessful read or access operation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public static List<BufferedImage> getAllBufferedImages(final byte[] bytes) throws ImagingException, IOException {
         return getAllBufferedImages(ByteSource.array(bytes));
@@ -163,20 +168,20 @@ public final class Imaging {
      * @param file A reference to a valid data file.
      * @return A valid (potentially empty) list of BufferedImage objects.
      * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
-     * @throws IOException In the event of unsuccessful read or access operation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public static List<BufferedImage> getAllBufferedImages(final File file) throws ImagingException, IOException {
         return getAllBufferedImages(ByteSource.file(file));
     }
 
     /**
-     * Gets all images specified by the InputStream  (some formats may include multiple images within a single data source).
+     * Gets all images specified by the InputStream (some formats may include multiple images within a single data source).
      *
-     * @param is A valid InputStream
+     * @param is       A valid InputStream
      * @param fileName File name associated with image data (optional).
      * @return A valid (potentially empty) list of BufferedImage objects.
      * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
-     * @throws IOException In the event of unsuccessful read or access operation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     public static List<BufferedImage> getAllBufferedImages(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getAllBufferedImages(ByteSource.inputStream(is, fileName));
@@ -185,17 +190,16 @@ public final class Imaging {
     /**
      * Reads the first image from a byte array.
      *
-     * <p>For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * For the most recent information on support for specific formats, refer to <a href="https://commons.apache.org/imaging/formatsupport.html">Format
+     * Support</a> at the main project development web site. While the Apache Commons Imaging package does not fully support all formats, it can read image
+     * info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
      * @param bytes a valid array of bytes from which to read data.
      * @return if successful, a valid buffered image
      * @throws ImagingException in the event of a processing error while reading an image (i.e. a format violation, etc.).
-     * @throws IOException in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      */
     public static BufferedImage getBufferedImage(final byte[] bytes) throws ImagingException, IOException {
         return getBufferedImage(ByteSource.array(bytes));
@@ -209,17 +213,16 @@ public final class Imaging {
     /**
      * Reads the first image from a file.
      *
-     * <p>For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * For the most recent information on support for specific formats, refer to <a href="https://commons.apache.org/imaging/formatsupport.html">Format
+     * Support</a> at the main project development web site. While the Apache Commons Imaging package does not fully support all formats, it can read image
+     * info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
      * @param file a valid reference to a file containing image data.
      * @return if successful, a valid buffered image
      * @throws ImagingException in the event of a processing error while reading an image (i.e. a format violation, etc.).
-     * @throws IOException  in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      */
     public static BufferedImage getBufferedImage(final File file) throws ImagingException, IOException {
         return getBufferedImage(ByteSource.file(file));
@@ -228,17 +231,16 @@ public final class Imaging {
     /**
      * Reads the first image from an InputStream.
      *
-     * <p>For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * For the most recent information on support for specific formats, refer to <a href="https://commons.apache.org/imaging/formatsupport.html">Format
+     * Support</a> at the main project development web site. While the Apache Commons Imaging package does not fully support all formats, it can read image
+     * info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
      * @param is a valid ImageStream from which to read data.
      * @return if successful, a valid buffered image
      * @throws ImagingException in the event of a processing errorfileName while reading an image (i.e. a format violation, etc.).
-     * @throws IOException  in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      */
     public static BufferedImage getBufferedImage(final InputStream is) throws ImagingException, IOException {
         return getBufferedImage(is, null);
@@ -247,18 +249,17 @@ public final class Imaging {
     /**
      * Reads the first image from an InputStream.
      *
-     * <p>For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * For the most recent information on support for specific formats, refer to <a href="https://commons.apache.org/imaging/formatsupport.html">Format
+     * Support</a> at the main project development web site. While the Apache Commons Imaging package does not fully support all formats, it can read image
+     * info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
-     * @param is a valid ImageStream from which to read data.
+     * @param is       a valid ImageStream from which to read data.
      * @param fileName the image file name.
      * @return if successful, a valid buffered image
      * @throws ImagingException in the event of a processing error while reading an image (i.e. a format violation, etc.).
-     * @throws IOException  in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      */
     public static BufferedImage getBufferedImage(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getBufferedImage(ByteSource.inputStream(is, fileName));
@@ -267,12 +268,14 @@ public final class Imaging {
     /**
      * Attempts to determine the image format of the specified data and evaluates its format compliance.
      *
-     * <p>This method returns a FormatCompliance object which includes information about the data's compliance to a specific format.</p>
+     * <p>
+     * This method returns a FormatCompliance object which includes information about the data's compliance to a specific format.
+     * </p>
      *
      * @param bytes a valid array of bytes containing image data.
      * @return if successful, a valid FormatCompliance object.
      * @throws ImagingException in the event of unreadable data.
-     * @throws IOException in the event of an unrecoverable I/O condition.
+     * @throws IOException      in the event of an unrecoverable I/O condition.
      */
     public static FormatCompliance getFormatCompliance(final byte[] bytes) throws ImagingException, IOException {
         return getFormatCompliance(ByteSource.array(bytes));
@@ -284,15 +287,13 @@ public final class Imaging {
     }
 
     /**
-     * Attempts to determine the image format of the specified data and
-     * evaluates its format compliance.   This method
-     * returns a FormatCompliance object which includes information
-     * about the data's compliance to a specific format.
+     * Attempts to determine the image format of the specified data and evaluates its format compliance. This method returns a FormatCompliance object which
+     * includes information about the data's compliance to a specific format.
      *
      * @param file valid file containing image data
      * @return if successful, a valid FormatCompliance object.
      * @throws ImagingException in the event of unreadable data.
-     * @throws IOException in the event of an unrecoverable I/O condition.
+     * @throws IOException      in the event of an unrecoverable I/O condition.
      */
     public static FormatCompliance getFormatCompliance(final File file) throws ImagingException, IOException {
         return getFormatCompliance(ByteSource.file(file));
@@ -304,7 +305,7 @@ public final class Imaging {
      * @param bytes Byte array containing an image file.
      * @return An instance of ICC_Profile or null if the image contains no ICC profile.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ICC_Profile getIccProfile(final byte[] bytes) throws ImagingException, IOException {
         return getIccProfile(ByteSource.array(bytes));
@@ -334,7 +335,7 @@ public final class Imaging {
      * @param file File containing image data.
      * @return An instance of ICC_Profile or null if the image contains no ICC profile.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ICC_Profile getIccProfile(final File file) throws ImagingException, IOException {
         return getIccProfile(ByteSource.file(file));
@@ -343,30 +344,29 @@ public final class Imaging {
     /**
      * Extracts an ICC Profile (if present) from JPEG, PNG, PSD (Photoshop) and TIFF images.
      *
-     * @param is InputStream from which to read image data.
+     * @param is       InputStream from which to read image data.
      * @param fileName File name associated with image data (optional).
      * @return An instance of ICC_Profile or null if the image contains no ICC profile.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ICC_Profile getIccProfile(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getIccProfile(ByteSource.inputStream(is, fileName));
     }
 
     /**
-     * Extracts the raw bytes of an ICC Profile (if present) from JPEG, PNG, PSD
-     * (Photoshop) and TIFF images.
+     * Extracts the raw bytes of an ICC Profile (if present) from JPEG, PNG, PSD (Photoshop) and TIFF images.
      *
-     * <p>To parse the result use IccProfileParser or
-     * ICC_Profile.getInstance(bytes).</p>
+     * <p>
+     * To parse the result use IccProfileParser or ICC_Profile.getInstance(bytes).
+     * </p>
      *
-     * @param bytes
-     *            Byte array containing an image file.
+     * @param bytes Byte array containing an image file.
      * @return A byte array.
      * @see IccProfileParser
      * @see ICC_Profile
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static byte[] getIccProfileBytes(final byte[] bytes) throws ImagingException, IOException {
         return getIccProfileBytes(ByteSource.array(bytes));
@@ -378,19 +378,18 @@ public final class Imaging {
     }
 
     /**
-     * Extracts the raw bytes of an ICC Profile (if present) from JPEG, PNG, PSD
-     * (Photoshop) and TIFF images.
+     * Extracts the raw bytes of an ICC Profile (if present) from JPEG, PNG, PSD (Photoshop) and TIFF images.
      *
-     * <p>To parse the result use IccProfileParser or
-     * ICC_Profile.getInstance(bytes).</p>
+     * <p>
+     * To parse the result use IccProfileParser or ICC_Profile.getInstance(bytes).
+     * </p>
      *
-     * @param file
-     *            File containing image data.
+     * @param file File containing image data.
      * @return A byte array.
      * @see IccProfileParser
      * @see ICC_Profile
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static byte[] getIccProfileBytes(final File file) throws ImagingException, IOException {
         return getIccProfileBytes(ByteSource.file(file));
@@ -399,16 +398,19 @@ public final class Imaging {
     /**
      * Parses the "image info" of an image.
      *
-     * <p>"Image info" is a summary of basic information about the image such as:
-     * width, height, file format, bit depth, color type, etc.</p>
+     * <p>
+     * "Image info" is a summary of basic information about the image such as: width, height, file format, bit depth, color type, etc.
+     * </p>
      *
-     * <p>Not to be confused with "image metadata."</p>
+     * <p>
+     * Not to be confused with "image metadata."
+     * </p>
      *
      * @param bytes Byte array containing an image file.
      * @return An instance of ImageInfo.
      * @see ImageInfo
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageInfo getImageInfo(final byte[] bytes) throws ImagingException, IOException {
         return getImageInfo(ByteSource.array(bytes));
@@ -421,16 +423,19 @@ public final class Imaging {
     /**
      * Parses the "image info" of an image file.
      *
-     * <p>"Image info" is a summary of basic information about the image such as:
-     * width, height, file format, bit depth, color type, etc.</p>
+     * <p>
+     * "Image info" is a summary of basic information about the image such as: width, height, file format, bit depth, color type, etc.
+     * </p>
      *
-     * <p>Not to be confused with "image metadata."</p>
+     * <p>
+     * Not to be confused with "image metadata."
+     * </p>
      *
      * @param file File containing image data.
      * @return An instance of ImageInfo.
      * @see ImageInfo
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageInfo getImageInfo(final File file) throws ImagingException, IOException {
         return getImageInfo(ByteSource.file(file));
@@ -439,17 +444,20 @@ public final class Imaging {
     /**
      * Parses the "image info" of an image.
      *
-     * <p>"Image info" is a summary of basic information about the image such as:
-     * width, height, file format, bit depth, color type, etc.</p>
+     * <p>
+     * "Image info" is a summary of basic information about the image such as: width, height, file format, bit depth, color type, etc.
+     * </p>
      *
-     * <p>Not to be confused with "image metadata."</p>
+     * <p>
+     * Not to be confused with "image metadata."
+     * </p>
      *
-     * @param is InputStream from which to read image data.
+     * @param is       InputStream from which to read image data.
      * @param fileName File name associated with image data (optional).
      * @return An instance of ImageInfo.
      * @see ImageInfo
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageInfo getImageInfo(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getImageInfo(ByteSource.inputStream(is, fileName));
@@ -458,17 +466,20 @@ public final class Imaging {
     /**
      * Parses the "image info" of an image.
      *
-     * <p>"Image info" is a summary of basic information about the image such as:
-     * width, height, file format, bit depth, color type, etc.</p>
+     * <p>
+     * "Image info" is a summary of basic information about the image such as: width, height, file format, bit depth, color type, etc.
+     * </p>
      *
-     * <p>Not to be confused with "image metadata."</p>
+     * <p>
+     * Not to be confused with "image metadata."
+     * </p>
      *
      * @param fileName String.
-     * @param bytes Byte array containing an image file.
+     * @param bytes    Byte array containing an image file.
      * @return An instance of ImageInfo.
      * @see ImageInfo
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageInfo getImageInfo(final String fileName, final byte[] bytes) throws ImagingException, IOException {
         return getImageInfo(ByteSource.array(bytes, fileName));
@@ -480,7 +491,7 @@ public final class Imaging {
      * @param bytes Byte array containing an image file.
      * @return The width and height of the image.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static Dimension getImageSize(final byte[] bytes) throws ImagingException, IOException {
         return getImageSize(ByteSource.array(bytes));
@@ -492,7 +503,7 @@ public final class Imaging {
      * @param byteSource Byte source data.
      * @return The width and height of the image.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static Dimension getImageSize(final ByteSource byteSource) throws ImagingException, IOException {
         final AbstractImageParser<?> imageParser = ImageParserFactory.getImageParser(byteSource);
@@ -505,7 +516,7 @@ public final class Imaging {
      * @param file File containing image data.
      * @return The width and height of the image.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static Dimension getImageSize(final File file) throws ImagingException, IOException {
         return getImageSize(ByteSource.file(file));
@@ -514,11 +525,11 @@ public final class Imaging {
     /**
      * Determines the width and height of an image.
      *
-     * @param is InputStream from which to read image data.
+     * @param is       InputStream from which to read image data.
      * @param fileName File name associated with image data (optional).
      * @return The width and height of the image.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static Dimension getImageSize(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getImageSize(ByteSource.inputStream(is, fileName));
@@ -527,19 +538,23 @@ public final class Imaging {
     /**
      * Parses the metadata of an image. This metadata depends on the format of the image.
      *
-     * <p>JPEG/JFIF files may contain EXIF and/or IPTC metadata. PNG files may
-     * contain comments. TIFF files may contain metadata.</p>
+     * <p>
+     * JPEG/JFIF files may contain EXIF and/or IPTC metadata. PNG files may contain comments. TIFF files may contain metadata.
+     * </p>
      *
-     * <p>The instance of IImageMetadata returned by getMetadata() should be upcast
-     * (depending on image format).</p>
+     * <p>
+     * The instance of IImageMetadata returned by getMetadata() should be upcast (depending on image format).
+     * </p>
      *
-     * <p>Not to be confused with "image info."</p>
+     * <p>
+     * Not to be confused with "image info."
+     * </p>
      *
      * @param bytes Byte array containing an image file.
      * @return An instance of ImageMetadata.
      * @see org.apache.commons.imaging.common.ImageMetadata
      * @throws ImagingException if it fails to read the image metadata
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageMetadata getMetadata(final byte[] bytes) throws ImagingException, IOException {
         return getMetadata(ByteSource.array(bytes));
@@ -553,19 +568,23 @@ public final class Imaging {
     /**
      * Parses the metadata of an image file. This metadata depends on the format of the image.
      *
-     * <p>JPEG/JFIF files may contain EXIF and/or IPTC metadata. PNG files may
-     * contain comments. TIFF files may contain metadata.</p>
+     * <p>
+     * JPEG/JFIF files may contain EXIF and/or IPTC metadata. PNG files may contain comments. TIFF files may contain metadata.
+     * </p>
      *
-     * <p>The instance of IImageMetadata returned by getMetadata() should be upcast
-     * (depending on image format).</p>
+     * <p>
+     * The instance of IImageMetadata returned by getMetadata() should be upcast (depending on image format).
+     * </p>
      *
-     * <p>Not to be confused with "image info."</p>
+     * <p>
+     * Not to be confused with "image info."
+     * </p>
      *
      * @param file File containing image data.
      * @return An instance of IImageMetadata.
      * @see org.apache.commons.imaging.common.ImageMetadata
      * @throws ImagingException if it fails to read the image metadata
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageMetadata getMetadata(final File file) throws ImagingException, IOException {
         return getMetadata(ByteSource.file(file));
@@ -574,19 +593,24 @@ public final class Imaging {
     /**
      * Parses the metadata of an image file. This metadata depends on the format of the image.
      *
-     * <p>JPEG/JFIF files may contain EXIF and/or IPTC metadata. PNG files may
-     * contain comments. TIFF files may contain metadata.</p>
+     * <p>
+     * JPEG/JFIF files may contain EXIF and/or IPTC metadata. PNG files may contain comments. TIFF files may contain metadata.
+     * </p>
      *
-     * <p>The instance of IImageMetadata returned by getMetadata() should be upcast (depending on image format).</p>
+     * <p>
+     * The instance of IImageMetadata returned by getMetadata() should be upcast (depending on image format).
+     * </p>
      *
-     * <p>Not to be confused with "image info."</p>
+     * <p>
+     * Not to be confused with "image info."
+     * </p>
      *
-     * @param is InputStream from which to read image data.
+     * @param is       InputStream from which to read image data.
      * @param fileName File name associated with image data (optional).
      * @return An instance of IImageMetadata.
      * @see org.apache.commons.imaging.common.ImageMetadata
      * @throws ImagingException if it fails to read the image metadata
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static ImageMetadata getMetadata(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getMetadata(ByteSource.inputStream(is, fileName));
@@ -598,7 +622,7 @@ public final class Imaging {
      * @param bytes Byte array containing an image file.
      * @return Xmp Xml as String, if present. Otherwise, returns null.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static String getXmpXml(final byte[] bytes) throws ImagingException, IOException {
         return getXmpXml(ByteSource.array(bytes));
@@ -610,7 +634,7 @@ public final class Imaging {
      * @param byteSource File containing image data.
      * @return Xmp Xml as String, if present. Otherwise, returns null.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static String getXmpXml(final ByteSource byteSource) throws ImagingException, IOException {
         final AbstractImageParser<?> imageParser = ImageParserFactory.getImageParser(byteSource);
@@ -626,7 +650,7 @@ public final class Imaging {
      * @param file File containing image data.
      * @return Xmp Xml as String, if present. Otherwise, returns null.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static String getXmpXml(final File file) throws ImagingException, IOException {
         return getXmpXml(ByteSource.file(file));
@@ -635,11 +659,11 @@ public final class Imaging {
     /**
      * Extracts the embedded XML metadata as an XML string.
      *
-     * @param is InputStream from which to read image data.
+     * @param is       InputStream from which to read image data.
      * @param fileName File name associated with image data (optional).
      * @return Xmp Xml as String, if present. Otherwise, returns null.
      * @throws ImagingException if it fails to parse the image
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      */
     public static String getXmpXml(final InputStream is, final String fileName) throws ImagingException, IOException {
         return getXmpXml(ByteSource.inputStream(is, fileName));
@@ -648,14 +672,13 @@ public final class Imaging {
     /**
      * Attempts to determine the image format of a file based on its "magic numbers," the first bytes of the data.
      *
-     * <p>Many graphics format specify identifying byte
-     * values that appear at the beginning of the data file.  This method
-     * checks for such identifying elements and returns a ImageFormat
-     * enumeration indicating what it detects. Note that this
-     * method can return "false positives" in cases where non-image files
-     * begin with the specified byte values.</p>
+     * <p>
+     * Many graphics format specify identifying byte values that appear at the beginning of the data file. This method checks for such identifying elements and
+     * returns a ImageFormat enumeration indicating what it detects. Note that this method can return "false positives" in cases where non-image files begin
+     * with the specified byte values.
+     * </p>
      *
-     * @param bytes  Byte array containing an image file.
+     * @param bytes Byte array containing an image file.
      * @return An ImageFormat, such as ImageFormat.IMAGE_FORMAT_JPEG. Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if the image type cannot be determined.
      * @throws IOException in the event of an unrecoverable I/O condition.
      */
@@ -666,17 +689,16 @@ public final class Imaging {
     /**
      * Attempts to determine the image format of a file based on its "magic numbers," the first bytes of the data.
      *
-     * <p>Many graphics formats specify identifying byte
-     * values that appear at the beginning of the data file.  This method
-     * checks for such identifying elements and returns a ImageFormat
-     * enumeration indicating what it detects. Note that this
-     * method can return "false positives" in cases where non-image files
-     * begin with the specified byte values.</p>
+     * <p>
+     * Many graphics formats specify identifying byte values that appear at the beginning of the data file. This method checks for such identifying elements and
+     * returns a ImageFormat enumeration indicating what it detects. Note that this method can return "false positives" in cases where non-image files begin
+     * with the specified byte values.
+     * </p>
      *
      * @param byteSource a valid ByteSource object potentially supplying data for an image.
      * @return An ImageFormat, such as ImageFormat.IMAGE_FORMAT_JPEG. Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if the image type cannot be determined.
      * @throws IllegalArgumentException in the event of an unsuccessful attempt to read the image data
-     * @throws IOException in the event of an unrecoverable I/O condition.
+     * @throws IOException              in the event of an unrecoverable I/O condition.
      */
     public static ImageFormat guessFormat(final ByteSource byteSource) throws IOException {
         if (byteSource == null) {
@@ -686,7 +708,7 @@ public final class Imaging {
         try (InputStream is = byteSource.getInputStream()) {
             final int i1 = is.read();
             final int i2 = is.read();
-            if ((i1 < 0) || (i2 < 0)) {
+            if (i1 < 0 || i2 < 0) {
                 throw new IllegalArgumentException("Couldn't read magic numbers to guess format.");
             }
 
@@ -696,9 +718,9 @@ public final class Imaging {
 
             if (compareBytePair(MAGIC_NUMBERS_GIF, bytePair)) {
                 return ImageFormats.GIF;
-            // } else if (b1 == 0x00 && b2 == 0x00) // too similar to TGA
-            // {
-            // return ImageFormat.IMAGE_FORMAT_ICO;
+                // } else if (b1 == 0x00 && b2 == 0x00) // too similar to TGA
+                // {
+                // return ImageFormat.IMAGE_FORMAT_ICO;
             }
             if (compareBytePair(MAGIC_NUMBERS_PNG, bytePair)) {
                 return ImageFormats.PNG;
@@ -742,7 +764,7 @@ public final class Imaging {
             if (compareBytePair(MAGIC_NUMBERS_JBIG2_1, bytePair)) {
                 final int i3 = is.read();
                 final int i4 = is.read();
-                if ((i3 < 0) || (i4 < 0)) {
+                if (i3 < 0 || i4 < 0) {
                     throw new IllegalArgumentException("Couldn't read magic numbers to guess format.");
                 }
 
@@ -761,7 +783,7 @@ public final class Imaging {
             } else if (compareBytePair(MAGIC_NUMBERS_RIFF_1, bytePair)) {
                 final int i3 = is.read();
                 final int i4 = is.read();
-                if ((i3 < 0) || (i4 < 0)) {
+                if (i3 < 0 || i4 < 0) {
                     throw new IllegalArgumentException("Couldn't read magic numbers to guess format.");
                 }
 
@@ -769,7 +791,7 @@ public final class Imaging {
                 final int b4 = i4 & 0xff;
                 final int[] bytePair2 = { b3, b4, };
                 if (compareBytePair(MAGIC_NUMBERS_RIFF_2, bytePair2)) {
-                    byte[] bytes = new byte[4];
+                    final byte[] bytes = new byte[4];
                     if (is.read(bytes) < 4) { // Skip file size
                         throw new IllegalArgumentException("Couldn't read magic numbers to guess format.");
                     }
@@ -779,37 +801,27 @@ public final class Imaging {
                     }
                 }
             }
-            return Stream
-                .of(ImageFormats.values())
-                .filter(imageFormat -> Stream
-                    .of(imageFormat.getExtensions())
-                    .anyMatch(extension -> {
-                        final String fileName = byteSource.getFileName();
-                        if (fileName == null || fileName.trim().isEmpty()) {
-                            return false;
-                        }
-                        final String fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
-                        return extension != null
-                                && !extension.trim().isEmpty()
-                                && fileExtension.equalsIgnoreCase(extension);
-                    }))
-                .findFirst()
-                .orElse(ImageFormats.UNKNOWN)
-            ;
+            return Stream.of(ImageFormats.values()).filter(imageFormat -> Stream.of(imageFormat.getExtensions()).anyMatch(extension -> {
+                final String fileName = byteSource.getFileName();
+                if (fileName == null || fileName.trim().isEmpty()) {
+                    return false;
+                }
+                final String fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
+                return extension != null && !extension.trim().isEmpty() && fileExtension.equalsIgnoreCase(extension);
+            })).findFirst().orElse(ImageFormats.UNKNOWN);
         }
     }
 
     /**
      * Attempts to determine the image format of a file based on its "magic numbers," the first bytes of the data.
      *
-     * <p>Many graphics formats specify identifying byte
-     * values that appear at the beginning of the data file.  This method
-     * checks for such identifying elements and returns a ImageFormat
-     * enumeration indicating what it detects. Note that this
-     * method can return "false positives" in cases where non-image files
-     * begin with the specified byte values.</p>
+     * <p>
+     * Many graphics formats specify identifying byte values that appear at the beginning of the data file. This method checks for such identifying elements and
+     * returns a ImageFormat enumeration indicating what it detects. Note that this method can return "false positives" in cases where non-image files begin
+     * with the specified byte values.
+     * </p>
      *
-     * @param file  File containing image data.
+     * @param file File containing image data.
      * @return An ImageFormat, such as ImageFormat.IMAGE_FORMAT_JPEG. Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if the image type cannot be determined.
      * @throws IOException in the event of an unrecoverable I/O condition.
      */
@@ -818,9 +830,8 @@ public final class Imaging {
     }
 
     /**
-     * Attempts to determine if a file contains an image recorded in
-     * a supported graphics format based on its file-name extension
-     * (for example "&#46;jpg", "&#46;gif", "&#46;png", etc&#46;).
+     * Attempts to determine if a file contains an image recorded in a supported graphics format based on its file-name extension (for example "&#46;jpg",
+     * "&#46;gif", "&#46;png", etc&#46;).
      *
      * @param file A valid File object providing a reference to a file that may contain an image.
      * @return true if the file-name includes a supported image format file extension; otherwise, false.
@@ -833,11 +844,10 @@ public final class Imaging {
     }
 
     /**
-     * Attempts to determine if a file contains an image recorded in
-     * a supported graphics format based on its file-name extension
-     * (for example "&#46;jpg", "&#46;gif", "&#46;png", etc&#46;).
+     * Attempts to determine if a file contains an image recorded in a supported graphics format based on its file-name extension (for example "&#46;jpg",
+     * "&#46;gif", "&#46;png", etc&#46;).
      *
-     * @param fileName  A valid string representing name of file which may contain an image.
+     * @param fileName A valid string representing name of file which may contain an image.
      * @return true if the file name has an image format file extension.
      */
     public static boolean hasImageFileExtension(final String fileName) {
@@ -861,23 +871,22 @@ public final class Imaging {
     /**
      * Writes the content of a BufferedImage to a file using the specified image format.
      *
-     * <p>Image writing is not supported for all graphics formats.
-     * For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * Image writing is not supported for all graphics formats. For the most recent information on support for specific formats, refer to
+     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a> at the main project development web site. While the Apache Commons
+     * Imaging package does not fully support all formats, it can read image info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
-     * @param src a valid BufferedImage object
-     * @param file the file to which the output image is to be written
+     * @param src    a valid BufferedImage object
+     * @param file   the file to which the output image is to be written
      * @param format the format in which the output image is to be written
      * @throws ImagingException in the event of a format violation, unsupported image format, etc.
-     * @throws IOException in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      * @see ImagingConstants
      */
     public static void writeImage(final BufferedImage src, final File file, final ImageFormat format) throws ImagingException, IOException {
-        try (FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream os = new BufferedOutputStream(fos)) {
+        try (FileOutputStream fos = new FileOutputStream(file);
+                BufferedOutputStream os = new BufferedOutputStream(fos)) {
             writeImage(src, os, format);
         }
     }
@@ -885,19 +894,17 @@ public final class Imaging {
     /**
      * Writes the content of a BufferedImage to an OutputStream using the specified image format.
      *
-     * <p>Image writing is not supported for all graphics formats.
-     * For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * Image writing is not supported for all graphics formats. For the most recent information on support for specific formats, refer to
+     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a> at the main project development web site. While the Apache Commons
+     * Imaging package does not fully support all formats, it can read image info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
-     * @param src a valid BufferedImage object
+     * @param src          a valid BufferedImage object
      * @param outputStream the OutputStream to which the output image is to be written
-     * @param format the format in which the output image is to be written
+     * @param format       the format in which the output image is to be written
      * @throws ImagingException in the event of a format violation, unsupported image format, etc.
-     * @throws IOException in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      * @see ImagingConstants
      */
     public static void writeImage(final BufferedImage src, final OutputStream outputStream, final ImageFormat format) throws ImagingException, IOException {
@@ -912,19 +919,17 @@ public final class Imaging {
     /**
      * Writes the content of a BufferedImage to a byte array using the specified image format.
      *
-     * <p>Image writing is not supported for all graphics formats.
-     * For the most recent information on support for specific formats, refer to
-     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a>
-     * at the main project development web site.   While the Apache Commons
-     * Imaging package does not fully support all formats, it  can read
-     * image info, metadata and ICC profiles from all image formats that
-     * provide this data.</p>
+     * <p>
+     * Image writing is not supported for all graphics formats. For the most recent information on support for specific formats, refer to
+     * <a href="https://commons.apache.org/imaging/formatsupport.html">Format Support</a> at the main project development web site. While the Apache Commons
+     * Imaging package does not fully support all formats, it can read image info, metadata and ICC profiles from all image formats that provide this data.
+     * </p>
      *
-     * @param src a valid BufferedImage object
+     * @param src    a valid BufferedImage object
      * @param format the format in which the output image is to be written
      * @return if successful, a valid array of bytes.
      * @throws ImagingException in the event of a format violation, unsupported image format, etc.
-     * @throws IOException in the event of an unrecoverable I/O exception.
+     * @throws IOException      in the event of an unrecoverable I/O exception.
      * @see ImagingConstants
      */
     public static byte[] writeImageToBytes(final BufferedImage src, final ImageFormat format) throws ImagingException, IOException {
diff --git a/src/main/java/org/apache/commons/imaging/ImagingConstants.java b/src/main/java/org/apache/commons/imaging/ImagingConstants.java
index 4499850b..6a704b3c 100644
--- a/src/main/java/org/apache/commons/imaging/ImagingConstants.java
+++ b/src/main/java/org/apache/commons/imaging/ImagingConstants.java
@@ -17,11 +17,8 @@
 package org.apache.commons.imaging;
 
 /**
- * Defines constants that may be used in passing options to
- * ImageParser read/write implementations, the utility routines
- * implemented in the Imaging class, and throughout the
- * Apache Commons Imaging package.  Individual ImageParser
- * implementations may define their own format-specific options.
+ * Defines constants that may be used in passing options to ImageParser read/write implementations, the utility routines implemented in the Imaging class, and
+ * throughout the Apache Commons Imaging package. Individual ImageParser implementations may define their own format-specific options.
  */
 public final class ImagingConstants {
 
diff --git a/src/main/java/org/apache/commons/imaging/ImagingFormatException.java b/src/main/java/org/apache/commons/imaging/ImagingFormatException.java
index cd7351d8..23e10324 100644
--- a/src/main/java/org/apache/commons/imaging/ImagingFormatException.java
+++ b/src/main/java/org/apache/commons/imaging/ImagingFormatException.java
@@ -25,8 +25,8 @@ public class ImagingFormatException extends ImagingRuntimeException {
     private static final long serialVersionUID = 1L;
 
     /**
-     * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently
-     * be initialized by a call to {@link #initCause}.
+     * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to
+     * {@link #initCause}.
      *
      * @param format the detail message format per {@link String#format(String, Object...)}.
      * @param args   the detail message argument per {@link String#format(String, Object...)}.
@@ -38,13 +38,12 @@ public class ImagingFormatException extends ImagingRuntimeException {
     /**
      * Constructs a new exception with the specified detail message and cause.
      * <p>
-     * Note that the detail message associated with {@code cause} is <em>not</em> automatically incorporated in this
-     * exception's detail message.
+     * Note that the detail message associated with {@code cause} is <em>not</em> automatically incorporated in this exception's detail message.
      * </p>
      *
      * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
-     * @param cause   the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
-     *                value is permitted, and indicates that the cause is nonexistent or unknown.)
+     * @param cause   the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that
+     *                the cause is nonexistent or unknown.)
      */
     public ImagingFormatException(final String message, final Throwable cause) {
         super(message, cause);
diff --git a/src/main/java/org/apache/commons/imaging/ImagingParameters.java b/src/main/java/org/apache/commons/imaging/ImagingParameters.java
index c0e008a9..4cf57883 100644
--- a/src/main/java/org/apache/commons/imaging/ImagingParameters.java
+++ b/src/main/java/org/apache/commons/imaging/ImagingParameters.java
@@ -21,8 +21,9 @@ import org.apache.commons.imaging.common.BufferedImageFactory;
 /**
  * Imaging parameters.
  *
- * <p>Contains parameters that are common to all formats. Implementations must include
- * the specific parameters for each image format.</p>
+ * <p>
+ * Contains parameters that are common to all formats. Implementations must include the specific parameters for each image format.
+ * </p>
  *
  * @param <E> This type
  * @since 1.0-alpha3
@@ -30,15 +31,13 @@ import org.apache.commons.imaging.common.BufferedImageFactory;
 public class ImagingParameters<E extends ImagingParameters<E>> {
 
     /**
-     * Whether to throw an exception when any issue occurs during reading
-     * or writing a file format. Default is {@code false}.
+     * Whether to throw an exception when any issue occurs during reading or writing a file format. Default is {@code false}.
      */
     private boolean strict;
 
     /**
-     * An optional file name, used for the description of input streams
-     * where a file name would be hard (or not possible) to be identified.
-     * Default is {@code null}.
+     * An optional file name, used for the description of input streams where a file name would be hard (or not possible) to be identified. Default is
+     * {@code null}.
      */
     private String fileName;
 
@@ -48,8 +47,9 @@ public class ImagingParameters<E extends ImagingParameters<E>> {
     private BufferedImageFactory bufferedImageFactory;
 
     /**
-     * <p>Parameter key. Used in write operations to indicate the desired pixel
-     * density (DPI), and/or aspect ratio.</p>
+     * <p>
+     * Parameter key. Used in write operations to indicate the desired pixel density (DPI), and/or aspect ratio.
+     * </p>
      */
     private PixelDensity pixelDensity;
 
diff --git a/src/main/java/org/apache/commons/imaging/ImagingRuntimeException.java b/src/main/java/org/apache/commons/imaging/ImagingRuntimeException.java
index e60844fe..a68cc41e 100644
--- a/src/main/java/org/apache/commons/imaging/ImagingRuntimeException.java
+++ b/src/main/java/org/apache/commons/imaging/ImagingRuntimeException.java
@@ -25,11 +25,10 @@ public class ImagingRuntimeException extends RuntimeException {
     private static final long serialVersionUID = 1L;
 
     /**
-     * Constructs a new runtime exception with the specified detail message. The cause is not initialized, and may
-     * subsequently be initialized by a call to {@link #initCause}.
+     * Constructs a new runtime exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to
+     * {@link #initCause}.
      *
-     * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()}
-     *                method.
+     * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
      */
     public ImagingRuntimeException(final String message) {
         super(message);
@@ -38,13 +37,12 @@ public class ImagingRuntimeException extends RuntimeException {
     /**
      * Constructs a new exception with the specified detail message and cause.
      * <p>
-     * Note that the detail message associated with {@code cause} is <em>not</em> automatically incorporated in this
-     * exception's detail message.
+     * Note that the detail message associated with {@code cause} is <em>not</em> automatically incorporated in this exception's detail message.
      * </p>
      *
      * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
-     * @param cause   the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
-     *                value is permitted, and indicates that the cause is nonexistent or unknown.)
+     * @param cause   the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that
+     *                the cause is nonexistent or unknown.)
      */
     public ImagingRuntimeException(final String message, final Throwable cause) {
         super(message, cause);
diff --git a/src/main/java/org/apache/commons/imaging/PixelDensity.java b/src/main/java/org/apache/commons/imaging/PixelDensity.java
index 7e06b153..fa1009f3 100644
--- a/src/main/java/org/apache/commons/imaging/PixelDensity.java
+++ b/src/main/java/org/apache/commons/imaging/PixelDensity.java
@@ -17,8 +17,7 @@
 package org.apache.commons.imaging;
 
 /**
- * Used to specify pixel density and physical dimensions when reading or
- * storing image information.
+ * Used to specify pixel density and physical dimensions when reading or storing image information.
  */
 public final class PixelDensity {
     private static final int PIXEL_NO_UNIT = 0;
@@ -29,9 +28,11 @@ public final class PixelDensity {
     public static PixelDensity createFromPixelsPerCentimetre(final double x, final double y) {
         return new PixelDensity(x, y, PIXEL_PER_CENTIMETRE);
     }
+
     public static PixelDensity createFromPixelsPerInch(final double x, final double y) {
         return new PixelDensity(x, y, PIXEL_PER_INCH);
     }
+
     public static PixelDensity createFromPixelsPerMetre(final double x, final double y) {
         return new PixelDensity(x, y, PIXEL_PER_METRE);
     }
@@ -47,8 +48,7 @@ public final class PixelDensity {
     // / One-tenth of a millimetre units.
     private final int unitLength;
 
-    private PixelDensity(final double horizontalDensity, final double verticalDensity,
-            final int unitLength) {
+    private PixelDensity(final double horizontalDensity, final double verticalDensity, final int unitLength) {
         this.horizontalDensity = horizontalDensity;
         this.verticalDensity = verticalDensity;
         this.unitLength = unitLength;
diff --git a/src/main/java/org/apache/commons/imaging/bytesource/InputStreamByteSource.java b/src/main/java/org/apache/commons/imaging/bytesource/InputStreamByteSource.java
index 1a877868..046a8285 100644
--- a/src/main/java/org/apache/commons/imaging/bytesource/InputStreamByteSource.java
+++ b/src/main/java/org/apache/commons/imaging/bytesource/InputStreamByteSource.java
@@ -89,7 +89,7 @@ final class InputStreamByteSource extends ByteSource {
         public int read(final byte[] array, final int off, final int len) throws IOException {
             // first section copied verbatim from InputStream
             Objects.requireNonNull(array, "array");
-            if ((off < 0) || (off > array.length) || (len < 0) || ((off + len) > array.length) || ((off + len) < 0)) {
+            if (off < 0 || off > array.length || len < 0 || off + len > array.length || off + len < 0) {
                 throw new IndexOutOfBoundsException();
             }
             if (len == 0) {
@@ -183,7 +183,7 @@ final class InputStreamByteSource extends ByteSource {
     @Override
     public byte[] getByteArray(final long position, final int length) throws IOException {
         // We include a separate check for int overflow.
-        if ((position < 0) || (length < 0) || (position + length < 0) || (position + length > size())) {
+        if (position < 0 || length < 0 || position + length < 0 || position + length > size()) {
             throw new ImagingException(
                     "Could not read block (block start: " + position + ", block length: " + length + ", data length: " + streamLength + ").");
         }
diff --git a/src/main/java/org/apache/commons/imaging/bytesource/package-info.java b/src/main/java/org/apache/commons/imaging/bytesource/package-info.java
index 401fe9d5..dc33f5fb 100644
--- a/src/main/java/org/apache/commons/imaging/bytesource/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/bytesource/package-info.java
@@ -19,4 +19,3 @@
  * Encapsulates sources from which data may be read.
  */
 package org.apache.commons.imaging.bytesource;
-
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorCieLab.java b/src/main/java/org/apache/commons/imaging/color/ColorCieLab.java
index 960d0b78..7802c3db 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorCieLab.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorCieLab.java
@@ -17,11 +17,11 @@
 package org.apache.commons.imaging.color;
 
 /**
- * Represents a color in the CIELAB color space, also
- * known as LAB color space.
+ * Represents a color in the CIELAB color space, also known as LAB color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, and blue.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, and blue.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/CIELAB_color_space#CIELAB">https://en.wikipedia.org/wiki/CIELAB_color_space#CIELAB</a>
  * @since 1.0-alpha1
@@ -30,6 +30,7 @@ public final class ColorCieLab {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     L: 0
      *     a: 0
@@ -40,6 +41,7 @@ public final class ColorCieLab {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     L: 100
      *     a: 0
@@ -50,6 +52,7 @@ public final class ColorCieLab {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     L: 53
      *     a: 80
@@ -60,6 +63,7 @@ public final class ColorCieLab {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     L:  88
      *     a: -86
@@ -70,6 +74,7 @@ public final class ColorCieLab {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     L:   32
      *     a:   79
@@ -116,11 +121,11 @@ public final class ColorCieLab {
         int result;
         long temp;
         temp = Double.doubleToLongBits(l);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(a);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(b);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorCieLch.java b/src/main/java/org/apache/commons/imaging/color/ColorCieLch.java
index ac4134d4..923cf7a7 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorCieLch.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorCieLch.java
@@ -20,8 +20,7 @@ package org.apache.commons.imaging.color;
  * Represents a color in the CIELCH color space.
  *
  * <p>
- * Contains the constant values for black, white, red,
- * green, and blue.
+ * Contains the constant values for black, white, red, green, and blue.
  * </p>
  *
  * @see <a href=
@@ -32,6 +31,7 @@ public final class ColorCieLch {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     L: 0
      *     c: 0
@@ -42,6 +42,7 @@ public final class ColorCieLch {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     L: 100
      *     c:   0
@@ -52,6 +53,7 @@ public final class ColorCieLch {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     L: 53
      *     c: 80
@@ -62,6 +64,7 @@ public final class ColorCieLch {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     L:  88
      *     c: -86
@@ -72,6 +75,7 @@ public final class ColorCieLch {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     L:   32
      *     c:   79
@@ -118,11 +122,11 @@ public final class ColorCieLch {
         int result;
         long temp;
         temp = Double.doubleToLongBits(l);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(c);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(h);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorCieLuv.java b/src/main/java/org/apache/commons/imaging/color/ColorCieLuv.java
index a2ca1307..6c10a6a4 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorCieLuv.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorCieLuv.java
@@ -19,8 +19,9 @@ package org.apache.commons.imaging.color;
 /**
  * Represents a color in the CIELUV color space..
  *
- * <p>Contains the constant values for black, white, red,
- * green, and blue.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, and blue.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/CIELUV">https://en.wikipedia.org/wiki/CIELUV</a>
  * @since 1.0-alpha1
@@ -29,6 +30,7 @@ public final class ColorCieLuv {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     L: 0.000
      *     u: 0.000
@@ -39,6 +41,7 @@ public final class ColorCieLuv {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     L: 100.000
      *     u:   0.000
@@ -49,6 +52,7 @@ public final class ColorCieLuv {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     L:  53.233
      *     u: 175.053
@@ -59,6 +63,7 @@ public final class ColorCieLuv {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     L:  87.737
      *     u: -83.080
@@ -69,6 +74,7 @@ public final class ColorCieLuv {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     L:   32.303
      *     u:   -9.400
@@ -115,11 +121,11 @@ public final class ColorCieLuv {
         int result;
         long temp;
         temp = Double.doubleToLongBits(l);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(u);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(v);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorCmy.java b/src/main/java/org/apache/commons/imaging/color/ColorCmy.java
index a66bbf25..210cd0e0 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorCmy.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorCmy.java
@@ -19,8 +19,9 @@ package org.apache.commons.imaging.color;
 /**
  * Represents a color in the CMY color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, blue, cyan, magenta, and yellow.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, blue, cyan, magenta, and yellow.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/CMY_color_model">https://en.wikipedia.org/wiki/CMY_color_model</a>
  * @since 1.0-alpha1
@@ -29,6 +30,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color cyan. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 0
@@ -39,6 +41,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color magenta. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 100
@@ -49,6 +52,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color yellow. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 0
@@ -59,6 +63,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 100
@@ -69,6 +74,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 0
@@ -79,6 +85,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 100
@@ -89,6 +96,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 0
@@ -99,6 +107,7 @@ public final class ColorCmy {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 100
@@ -145,11 +154,11 @@ public final class ColorCmy {
         int result;
         long temp;
         temp = Double.doubleToLongBits(c);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(m);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(y);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java b/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
index aa07c611..f8bfd611 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
@@ -19,8 +19,9 @@ package org.apache.commons.imaging.color;
 /**
  * Represents a color in the CMYK color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, blue, cyan, magenta, and yellow.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, blue, cyan, magenta, and yellow.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/CMYK_color_model">https://en.wikipedia.org/wiki/CMYK_color_model</a>
  * @since 1.0-alpha1
@@ -29,6 +30,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color cyan. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 0
@@ -40,6 +42,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color magenta. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 100
@@ -51,6 +54,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color yellow. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 0
@@ -62,6 +66,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 0
@@ -73,6 +78,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 0
@@ -84,6 +90,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     cyan:    0
      *     magenta: 100
@@ -95,6 +102,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 0
@@ -106,6 +114,7 @@ public final class ColorCmyk {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     cyan:    100
      *     magenta: 100
@@ -158,13 +167,13 @@ public final class ColorCmyk {
         int result;
         long temp;
         temp = Double.doubleToLongBits(c);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(m);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(y);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(k);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorConversions.java b/src/main/java/org/apache/commons/imaging/color/ColorConversions.java
index 2588db72..2a1008c9 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorConversions.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorConversions.java
@@ -38,7 +38,7 @@ public final class ColorConversions {
         double x, y, z;
         {
 
-            double varY = ((cieL * 100.0 / 255.0) + 16.0) / 116.0;
+            double varY = (cieL * 100.0 / 255.0 + 16.0) / 116.0;
             double varX = cieA / 500.0 + varY;
             double varZ = varY - cieB / 200.0;
 
@@ -66,9 +66,9 @@ public final class ColorConversions {
             varG = pivotRgb(varG);
             varB = pivotRgb(varB);
 
-            r = (varR * 255);
-            g = (varG * 255);
-            b = (varB * 255);
+            r = varR * 255;
+            g = varG * 255;
+            b = varB * 255;
         }
 
         return convertRgbToRgb(r, g, b);
@@ -207,14 +207,14 @@ public final class ColorConversions {
         double varY = (l + 16) / 116.0;
         varY = unPivotXyz(varY);
 
-        final double refU = (4 * REF_X) / (REF_X + (15 * REF_Y) + (3 * REF_Z));
-        final double refV = (9 * REF_Y) / (REF_X + (15 * REF_Y) + (3 * REF_Z));
+        final double refU = 4 * REF_X / (REF_X + 15 * REF_Y + 3 * REF_Z);
+        final double refV = 9 * REF_Y / (REF_X + 15 * REF_Y + 3 * REF_Z);
         final double varU = u / (13 * l) + refU;
         final double varV = v / (13 * l) + refV;
 
         final double y = varY * 100;
         final double x = -(9 * y * varU) / ((varU - 4) * varV - varU * varV);
-        final double z = (9 * y - (15 * varV * y) - (varV * x)) / (3 * varV);
+        final double z = (9 * y - 15 * varV * y - varV * x) / (3 * varV);
 
         return new ColorXyz(x, y, z);
     }
@@ -223,13 +223,12 @@ public final class ColorConversions {
         return convertCmykToCmy(cmyk.c, cmyk.m, cmyk.y, cmyk.k);
     }
 
-    public static ColorCmy convertCmykToCmy(double c, double m, double y,
-            final double k) {
+    public static ColorCmy convertCmykToCmy(double c, double m, double y, final double k) {
         // Where CMYK and CMY values = 0 ÷ 1
 
-        c = (c * (1 - k) + k);
-        m = (m * (1 - k) + k);
-        y = (y * (1 - k) + k);
+        c = c * (1 - k) + k;
+        m = m * (1 - k) + k;
+        y = y * (1 - k) + k;
 
         return new ColorCmy(c, m, y);
     }
@@ -243,8 +242,7 @@ public final class ColorConversions {
         return convertCmyToRgb(convertCmykToCmy(C, M, Y, K));
     }
 
-    public static int convertCmykToRgbAdobe(final int sc, final int sm, final int sy,
-            final int sk) {
+    public static int convertCmykToRgbAdobe(final int sc, final int sm, final int sy, final int sk) {
         final int red = 255 - (sc + sk);
         final int green = 255 - (sm + sk);
         final int blue = 255 - (sy + sk);
@@ -384,14 +382,14 @@ public final class ColorConversions {
             if (l < 0.5) {
                 var2 = l * (1 + s);
             } else {
-                var2 = (l + s) - (s * l);
+                var2 = l + s - s * l;
             }
 
             final double var1 = 2 * l - var2;
 
-            r = 255 * convertHueToRgb(var1, var2, h + (1 / 3.0));
+            r = 255 * convertHueToRgb(var1, var2, h + 1 / 3.0);
             g = 255 * convertHueToRgb(var1, var2, h);
-            b = 255 * convertHueToRgb(var1, var2, h - (1 / 3.0));
+            b = 255 * convertHueToRgb(var1, var2, h - 1 / 3.0);
         }
 
         return convertRgbToRgb(r, g, b);
@@ -462,24 +460,23 @@ public final class ColorConversions {
         if (vH > 1) {
             vH -= 1;
         }
-        if ((6 * vH) < 1) {
-            return (v1 + (v2 - v1) * 6 * vH);
+        if (6 * vH < 1) {
+            return v1 + (v2 - v1) * 6 * vH;
         }
-        if ((2 * vH) < 1) {
-            return (v2);
+        if (2 * vH < 1) {
+            return v2;
         }
-        if ((3 * vH) < 2) {
-            return (v1 + (v2 - v1) * ((2 / 3.0) - vH) * 6);
+        if (3 * vH < 2) {
+            return v1 + (v2 - v1) * (2 / 3.0 - vH) * 6;
         }
-        return (v1);
+        return v1;
     }
 
     public static ColorXyz convertHunterLabToXyz(final ColorHunterLab cielab) {
         return convertHunterLabToXyz(cielab.l, cielab.a, cielab.b);
     }
 
-    public static ColorXyz convertHunterLabToXyz(final double l, final double a,
-            final double b) {
+    public static ColorXyz convertHunterLabToXyz(final double l, final double a, final double b) {
         final double varY = l / 10;
         final double varX = a / 17.5 * l / 10;
         final double varZ = b / 7 * l / 10;
@@ -492,32 +489,32 @@ public final class ColorConversions {
     }
 
     public static ColorCmy convertRgbToCmy(final int rgb) {
-        final int r = 0xff & (rgb >> 16);
-        final int g = 0xff & (rgb >> 8);
-        final int b = 0xff & (rgb >> 0);
+        final int r = 0xff & rgb >> 16;
+        final int g = 0xff & rgb >> 8;
+        final int b = 0xff & rgb >> 0;
 
         // RGB values = 0 ÷ 255
         // CMY values = 0 ÷ 1
 
-        final double c = 1 - (r / 255.0);
-        final double m = 1 - (g / 255.0);
-        final double y = 1 - (b / 255.0);
+        final double c = 1 - r / 255.0;
+        final double m = 1 - g / 255.0;
+        final double y = 1 - b / 255.0;
 
         return new ColorCmy(c, m, y);
     }
 
     public static ColorHsl convertRgbToHsl(final int rgb) {
 
-        final int r = 0xff & (rgb >> 16);
-        final int g = 0xff & (rgb >> 8);
-        final int b = 0xff & (rgb >> 0);
+        final int r = 0xff & rgb >> 16;
+        final int g = 0xff & rgb >> 8;
+        final int b = 0xff & rgb >> 0;
 
-        final double varR = (r / 255.0); // Where RGB values = 0 ÷ 255
-        final double varG = (g / 255.0);
-        final double varB = (b / 255.0);
+        final double varR = r / 255.0; // Where RGB values = 0 ÷ 255
+        final double varG = g / 255.0;
+        final double varB = b / 255.0;
 
         final double varMin = Math.min(varR, Math.min(varG, varB)); // Min. value
-                                                                  // of RGB
+                                                                    // of RGB
         double varMax;
         boolean maxIsR = false;
         boolean maxIsG = false;
@@ -542,7 +539,7 @@ public final class ColorConversions {
             h = 0; // HSL results = 0 ÷ 1
             s = 0;
         } else {
-        // Chromatic data...
+            // Chromatic data...
 
             // Debug.debug("L", L);
 
@@ -554,16 +551,16 @@ public final class ColorConversions {
 
             // Debug.debug("S", S);
 
-            final double delR = (((varMax - varR) / 6) + (delMax / 2)) / delMax;
-            final double delG = (((varMax - varG) / 6) + (delMax / 2)) / delMax;
-            final double delB = (((varMax - varB) / 6) + (delMax / 2)) / delMax;
+            final double delR = ((varMax - varR) / 6 + delMax / 2) / delMax;
+            final double delG = ((varMax - varG) / 6 + delMax / 2) / delMax;
+            final double delB = ((varMax - varB) / 6 + delMax / 2) / delMax;
 
             if (maxIsR) {
                 h = delB - delG;
             } else if (maxIsG) {
-                h = (1 / 3.0) + delR - delB;
+                h = 1 / 3.0 + delR - delB;
             } else {
-                h = (2 / 3.0) + delG - delR;
+                h = 2 / 3.0 + delG - delR;
             }
 
             // Debug.debug("H1", H);
@@ -582,16 +579,16 @@ public final class ColorConversions {
     }
 
     public static ColorHsv convertRgbToHsv(final int rgb) {
-        final int r = 0xff & (rgb >> 16);
-        final int g = 0xff & (rgb >> 8);
-        final int b = 0xff & (rgb >> 0);
+        final int r = 0xff & rgb >> 16;
+        final int g = 0xff & rgb >> 8;
+        final int b = 0xff & rgb >> 0;
 
-        final double varR = (r / 255.0); // RGB values = 0 ÷ 255
-        final double varG = (g / 255.0);
-        final double varB = (b / 255.0);
+        final double varR = r / 255.0; // RGB values = 0 ÷ 255
+        final double varG = g / 255.0;
+        final double varB = b / 255.0;
 
         final double varMin = Math.min(varR, Math.min(varG, varB)); // Min. value
-                                                                  // of RGB
+                                                                    // of RGB
         boolean maxIsR = false;
         boolean maxIsG = false;
         double varMax;
@@ -614,19 +611,19 @@ public final class ColorConversions {
             h = 0; // HSV results = 0 ÷ 1
             s = 0;
         } else {
-        // Chromatic data...
+            // Chromatic data...
             s = delMax / varMax;
 
-            final double delR = (((varMax - varR) / 6) + (delMax / 2)) / delMax;
-            final double delG = (((varMax - varG) / 6) + (delMax / 2)) / delMax;
-            final double delB = (((varMax - varB) / 6) + (delMax / 2)) / delMax;
+            final double delR = ((varMax - varR) / 6 + delMax / 2) / delMax;
+            final double delG = ((varMax - varG) / 6 + delMax / 2) / delMax;
+            final double delB = ((varMax - varB) / 6 + delMax / 2) / delMax;
 
             if (maxIsR) {
                 h = delB - delG;
             } else if (maxIsG) {
-                h = (1 / 3.0) + delR - delB;
+                h = 1 / 3.0 + delR - delB;
             } else {
-                h = (2 / 3.0) + delG - delR;
+                h = 2 / 3.0 + delG - delR;
             }
 
             if (h < 0) {
@@ -651,7 +648,7 @@ public final class ColorConversions {
 
         final int alpha = 0xff;
 
-        return (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+        return alpha << 24 | red << 16 | green << 8 | blue << 0;
     }
 
     private static int convertRgbToRgb(int red, int green, int blue) {
@@ -661,15 +658,15 @@ public final class ColorConversions {
 
         final int alpha = 0xff;
 
-        return (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+        return alpha << 24 | red << 16 | green << 8 | blue << 0;
     }
 
     // See also c# implementation:
     // https://github.com/muak/ColorMinePortable/blob/master/ColorMinePortable/ColorSpaces/Conversions/XyzConverter.cs
     public static ColorXyz convertRgbToXyz(final int rgb) {
-        final int r = 0xff & (rgb >> 16);
-        final int g = 0xff & (rgb >> 8);
-        final int b = 0xff & (rgb >> 0);
+        final int r = 0xff & rgb >> 16;
+        final int g = 0xff & rgb >> 8;
+        final int b = 0xff & rgb >> 0;
 
         double varR = r / 255.0; // Where R = 0 ÷ 255
         double varG = g / 255.0; // Where G = 0 ÷ 255
@@ -701,8 +698,8 @@ public final class ColorConversions {
     public static ColorCieLuv convertXuzToCieLuv(final double x, final double y, final double z) {
         // problems here with div by zero
 
-        final double varU = (4 * x) / (x + (15 * y) + (3 * z));
-        final double varV = (9 * y) / (x + (15 * y) + (3 * z));
+        final double varU = 4 * x / (x + 15 * y + 3 * z);
+        final double varV = 9 * y / (x + 15 * y + 3 * z);
 
         // Debug.debug("var_U", var_U);
         // Debug.debug("var_V", var_V);
@@ -714,13 +711,13 @@ public final class ColorConversions {
 
         // Debug.debug("var_Y", var_Y);
 
-        final double refU = (4 * REF_X) / (REF_X + (15 * REF_Y) + (3 * REF_Z));
-        final double refV = (9 * REF_Y) / (REF_X + (15 * REF_Y) + (3 * REF_Z));
+        final double refU = 4 * REF_X / (REF_X + 15 * REF_Y + 3 * REF_Z);
+        final double refV = 9 * REF_Y / (REF_X + 15 * REF_Y + 3 * REF_Z);
 
         // Debug.debug("ref_U", ref_U);
         // Debug.debug("ref_V", ref_V);
 
-        final double l = (116 * varY) - 16;
+        final double l = 116 * varY - 16;
         final double u = 13 * l * (varU - refU);
         final double v = 13 * l * (varV - refV);
 
@@ -757,11 +754,10 @@ public final class ColorConversions {
         return convertXyzToHunterLab(xyz.x, xyz.y, xyz.z);
     }
 
-    public static ColorHunterLab convertXyzToHunterLab(final double x,
-            final double y, final double z) {
+    public static ColorHunterLab convertXyzToHunterLab(final double x, final double y, final double z) {
         final double l = 10 * Math.sqrt(y);
-        final double a = y == 0.0 ? 0.0 : 17.5 * (((1.02 * x) - y) / Math.sqrt(y));
-        final double b = y == 0.0 ? 0.0 : 7 * ((y - (0.847 * z)) / Math.sqrt(y));
+        final double a = y == 0.0 ? 0.0 : 17.5 * ((1.02 * x - y) / Math.sqrt(y));
+        final double b = y == 0.0 ? 0.0 : 7 * ((y - 0.847 * z) / Math.sqrt(y));
 
         return new ColorHunterLab(l, a, b);
     }
@@ -790,9 +786,9 @@ public final class ColorConversions {
         varG = pivotRgb(varG);
         varB = pivotRgb(varB);
 
-        final double r = (varR * 255);
-        final double g = (varG * 255);
-        final double b = (varB * 255);
+        final double r = varR * 255;
+        final double g = varG * 255;
+        final double b = varB * 255;
         return convertRgbToRgb(r, g, b);
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorDin99Lab.java b/src/main/java/org/apache/commons/imaging/color/ColorDin99Lab.java
index c1193564..3a51d00f 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorDin99Lab.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorDin99Lab.java
@@ -18,9 +18,8 @@ package org.apache.commons.imaging.color;
  * Represents a color in the DIN99 color space, a derivation of the CIE LAB color space.
  *
  * @see <a href="de.wikipedia.org/wiki/DIN99-Farbraum">de.wikipedia.org/wiki/DIN99-Farbraum</a>
- * @see <a href=
- *      "https://pdfs.semanticscholar.org/647b/20bda458133ff2b883041746bc8cb75527fc.pdf">Comparison of the metrics between the CIELAB and the DIN99 uniform
- *      color spaces</a>
+ * @see <a href= "https://pdfs.semanticscholar.org/647b/20bda458133ff2b883041746bc8cb75527fc.pdf">Comparison of the metrics between the CIELAB and the DIN99
+ *      uniform color spaces</a>
  * @see <a href="https://www.researchgate.net/publication/229891006_Uniform_colour_spaces_based_on_the_DIN99_colour-difference_formula">DIN99b P.284:
  *      Uniform_colour_spaces_based_on_the_DIN99_colour-difference_formula</a>
  * @since 1.0-alpha3
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorHsl.java b/src/main/java/org/apache/commons/imaging/color/ColorHsl.java
index 4e9c2831..39e3c9d2 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorHsl.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorHsl.java
@@ -19,8 +19,9 @@ package org.apache.commons.imaging.color;
 /**
  * Represents a color in the HSL color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, blue, cyan, magenta, and yellow.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, blue, cyan, magenta, and yellow.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/HSL_and_HSV">https://en.wikipedia.org/wiki/HSL_and_HSV</a>
  * @since 1.0-alpha1
@@ -29,6 +30,7 @@ public final class ColorHsl {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     Hue:        0
      *     Saturation: 0
@@ -39,6 +41,7 @@ public final class ColorHsl {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     Hue:        0
      *     Saturation: 0
@@ -49,6 +52,7 @@ public final class ColorHsl {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     Hue:        0
      *     Saturation: 100
@@ -59,6 +63,7 @@ public final class ColorHsl {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     Hue:        120
      *     Saturation: 100
@@ -69,6 +74,7 @@ public final class ColorHsl {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     Hue:        240
      *     Saturation: 100
@@ -115,11 +121,11 @@ public final class ColorHsl {
         int result;
         long temp;
         temp = Double.doubleToLongBits(h);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(s);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(l);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorHsv.java b/src/main/java/org/apache/commons/imaging/color/ColorHsv.java
index 1b6974e7..5db41cf1 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorHsv.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorHsv.java
@@ -19,8 +19,9 @@ package org.apache.commons.imaging.color;
 /**
  * Represents a color in the HSV color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, blue, cyan, magenta, and yellow.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, blue, cyan, magenta, and yellow.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/HSL_and_HSV">https://en.wikipedia.org/wiki/HSL_and_HSV</a>
  * @since 1.0-alpha1
@@ -29,6 +30,7 @@ public final class ColorHsv {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     Hue:        0
      *     Saturation: 0
@@ -39,6 +41,7 @@ public final class ColorHsv {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     Hue:        0
      *     Saturation: 0
@@ -49,6 +52,7 @@ public final class ColorHsv {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     Hue:        0
      *     Saturation: 100
@@ -59,6 +63,7 @@ public final class ColorHsv {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     Hue:        120
      *     Saturation: 100
@@ -69,6 +74,7 @@ public final class ColorHsv {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     Hue:        240
      *     Saturation: 100
@@ -115,11 +121,11 @@ public final class ColorHsv {
         int result;
         long temp;
         temp = Double.doubleToLongBits(h);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(s);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(v);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorHunterLab.java b/src/main/java/org/apache/commons/imaging/color/ColorHunterLab.java
index ddf9e135..946a8dcb 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorHunterLab.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorHunterLab.java
@@ -19,8 +19,9 @@ package org.apache.commons.imaging.color;
 /**
  * Represents a color in the Hunter Lab color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, and blue.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, and blue.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/CIELAB_color_space#Hunter_Lab">https://en.wikipedia.org/wiki/CIELAB_color_space#Hunter_Lab</a>
  * @since 1.0-alpha1
@@ -29,6 +30,7 @@ public final class ColorHunterLab {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     L: 0
      *     a: 0
@@ -39,6 +41,7 @@ public final class ColorHunterLab {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     L: 100.000
      *     a:  -5.336
@@ -49,6 +52,7 @@ public final class ColorHunterLab {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     L: 46.109
      *     a: 78.962
@@ -59,6 +63,7 @@ public final class ColorHunterLab {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     L:  84.569
      *     a: -72.518
@@ -69,6 +74,7 @@ public final class ColorHunterLab {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     L:   26.870
      *     a:   72.885
@@ -115,11 +121,11 @@ public final class ColorHunterLab {
         int result;
         long temp;
         temp = Double.doubleToLongBits(l);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(a);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(b);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/color/ColorXyz.java b/src/main/java/org/apache/commons/imaging/color/ColorXyz.java
index 0a6f9d59..0f220646 100644
--- a/src/main/java/org/apache/commons/imaging/color/ColorXyz.java
+++ b/src/main/java/org/apache/commons/imaging/color/ColorXyz.java
@@ -17,11 +17,11 @@
 package org.apache.commons.imaging.color;
 
 /**
- * Represents a color in the CIE 1931 color space, also
- * known as XYZ color space.
+ * Represents a color in the CIE 1931 color space, also known as XYZ color space.
  *
- * <p>Contains the constant values for black, white, red,
- * green, and blue.</p>
+ * <p>
+ * Contains the constant values for black, white, red, green, and blue.
+ * </p>
  *
  * @see <a href="https://en.wikipedia.org/wiki/CIE_1931_color_space">https://en.wikipedia.org/wiki/CIE_1931_color_space</a>
  * @since 1.0-alpha1
@@ -30,6 +30,7 @@ public final class ColorXyz {
 
     /**
      * A constant for color black. Color components are:
+     *
      * <pre>
      *     X: 0
      *     Y: 0
@@ -40,6 +41,7 @@ public final class ColorXyz {
 
     /**
      * A constant for color white. Color components are:
+     *
      * <pre>
      *     X:  95.05
      *     Y: 100.00
@@ -50,6 +52,7 @@ public final class ColorXyz {
 
     /**
      * A constant for color red. Color components are:
+     *
      * <pre>
      *     X: 41.24
      *     Y: 21.26
@@ -60,6 +63,7 @@ public final class ColorXyz {
 
     /**
      * A constant for color green. Color components are:
+     *
      * <pre>
      *     X: 35.76
      *     Y: 71.52
@@ -70,6 +74,7 @@ public final class ColorXyz {
 
     /**
      * A constant for color blue. Color components are:
+     *
      * <pre>
      *     X: 18.05
      *     Y:  7.22
@@ -116,11 +121,11 @@ public final class ColorXyz {
         int result;
         long temp;
         temp = Double.doubleToLongBits(x);
-        result = (int) (temp ^ (temp >>> 32));
+        result = (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(y);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         temp = Double.doubleToLongBits(z);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (int) (temp ^ temp >>> 32);
         return result;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/common/Allocator.java b/src/main/java/org/apache/commons/imaging/common/Allocator.java
index e75640f4..ae51b9fc 100644
--- a/src/main/java/org/apache/commons/imaging/common/Allocator.java
+++ b/src/main/java/org/apache/commons/imaging/common/Allocator.java
@@ -119,8 +119,7 @@ public class Allocator {
     /**
      * Checks a request for meeting allocation limits.
      * <p>
-     * The default limit is {@value #DEFAULT}, override with the system property
-     * "org.apache.commons.imaging.common.mylzw.AllocationChecker".
+     * The default limit is {@value #DEFAULT}, override with the system property "org.apache.commons.imaging.common.mylzw.AllocationChecker".
      * </p>
      *
      * @param request an allocation request.
@@ -137,8 +136,7 @@ public class Allocator {
     /**
      * Checks a request for meeting allocation limits.
      * <p>
-     * The default limit is {@value #DEFAULT}, override with the system property
-     * "org.apache.commons.imaging.common.mylzw.AllocationChecker".
+     * The default limit is {@value #DEFAULT}, override with the system property "org.apache.commons.imaging.common.mylzw.AllocationChecker".
      * </p>
      *
      * @param request     an allocation request count.
@@ -150,7 +148,7 @@ public class Allocator {
         int multiplyExact;
         try {
             multiplyExact = Math.multiplyExact(request, elementSize);
-        } catch (ArithmeticException e) {
+        } catch (final ArithmeticException e) {
             throw new AllocationRequestException(LIMIT, BigInteger.valueOf(request).multiply(BigInteger.valueOf(elementSize)), e);
         }
         if (multiplyExact > LIMIT) {
@@ -162,8 +160,7 @@ public class Allocator {
     /**
      * Checks a request for meeting allocation limits.
      * <p>
-     * The default limit is {@value #DEFAULT}, override with the system property
-     * "org.apache.commons.imaging.common.mylzw.AllocationChecker".
+     * The default limit is {@value #DEFAULT}, override with the system property "org.apache.commons.imaging.common.mylzw.AllocationChecker".
      * </p>
      *
      * @param request     an allocation request count is cast down to an int.
@@ -174,7 +171,7 @@ public class Allocator {
     public static int check(final long request, final int elementSize) {
         try {
             return check(Math.toIntExact(request), elementSize);
-        } catch (ArithmeticException e) {
+        } catch (final ArithmeticException e) {
             throw new AllocationRequestException(LIMIT, request, e);
         }
     }
diff --git a/src/main/java/org/apache/commons/imaging/common/BasicCParser.java b/src/main/java/org/apache/commons/imaging/common/BasicCParser.java
index fa0cafd3..2e7c1261 100644
--- a/src/main/java/org/apache/commons/imaging/common/BasicCParser.java
+++ b/src/main/java/org/apache/commons/imaging/common/BasicCParser.java
@@ -26,8 +26,7 @@ import java.util.Map;
 import org.apache.commons.imaging.ImagingException;
 
 /**
- * A rudimentary preprocessor and parser for the C programming
- * language.
+ * A rudimentary preprocessor and parser for the C programming language.
  *
  * FIXME replace this by a parser generated via ANTLR (if we really need it?!)
  */
@@ -35,20 +34,19 @@ public class BasicCParser {
     /**
      * Parses the hexadecimal-base escape-sequence found at index {@code i} of {@code string}.
      *
-     * <p>Helper-function for {@code unescapeString()}.</p>
+     * <p>
+     * Helper-function for {@code unescapeString()}.
+     * </p>
      *
-     * @param i  the index of the escape-sequence in the string
+     * @param i             the index of the escape-sequence in the string
      * @param stringBuilder the stringBuilder to append the escape-char to
-     * @param string the string whose chars are parsed
+     * @param string        the string whose chars are parsed
      * @return the new index i
      * @since 1.0-alpha3
      */
-    private static int appendHex(int i, final StringBuilder stringBuilder, final String string)
-        throws ImagingException {
+    private static int appendHex(int i, final StringBuilder stringBuilder, final String string) throws ImagingException {
         if (i + 2 >= string.length()) {
-            throw new ImagingException(
-                    "Parsing XPM file failed, "
-                            + "hex constant in string too short");
+            throw new ImagingException("Parsing XPM file failed, " + "hex constant in string too short");
         }
         final char hex1 = string.charAt(i + 1);
         final char hex2 = string.charAt(i + 2);
@@ -57,9 +55,7 @@ public class BasicCParser {
         try {
             constant = Integer.parseInt(hex1 + Character.toString(hex2), 16);
         } catch (final NumberFormatException nfe) {
-            throw new ImagingException(
-                    "Parsing XPM file failed, "
-                            + "hex constant invalid", nfe);
+            throw new ImagingException("Parsing XPM file failed, " + "hex constant invalid", nfe);
         }
         stringBuilder.append((char) constant);
         return i;
@@ -68,28 +64,28 @@ public class BasicCParser {
     /**
      * Parses the octal-base escape-sequence found at index {@code i} of {@code string}.
      *
-     * <p>Helper-function for {@code unescapeString()}.</p>
+     * <p>
+     * Helper-function for {@code unescapeString()}.
+     * </p>
      *
-     * @param i  the index of the escape-sequence in the string
+     * @param i             the index of the escape-sequence in the string
      * @param stringBuilder the stringBuilder to append the escape-char to
-     * @param string the string whose chars are parsed
+     * @param string        the string whose chars are parsed
      * @return the new index i
      * @since 1.0-alpha3
      */
     private static int appendOct(int i, final StringBuilder stringBuilder, final String string) {
         int length = 1;
-        if (i + 1 < string.length() && '0' <= string.charAt(i + 1)
-                && string.charAt(i + 1) <= '7') {
+        if (i + 1 < string.length() && '0' <= string.charAt(i + 1) && string.charAt(i + 1) <= '7') {
             ++length;
         }
-        if (i + 2 < string.length() && '0' <= string.charAt(i + 2)
-                && string.charAt(i + 2) <= '7') {
+        if (i + 2 < string.length() && '0' <= string.charAt(i + 2) && string.charAt(i + 2) <= '7') {
             ++length;
         }
         int constant = 0;
         for (int j = 0; j < length; j++) {
             constant *= 8;
-            constant += (string.charAt(i + j) - '0');
+            constant += string.charAt(i + j) - '0';
         }
         i += length - 1;
         stringBuilder.append((char) constant);
@@ -99,16 +95,17 @@ public class BasicCParser {
     /**
      * Parses the {@code i:th} escape-char in the input {@code string} and appends it to {@code stringBuilder}.
      *
-     * <p>Helper-function for {@code unescapeString()}.</p>
+     * <p>
+     * Helper-function for {@code unescapeString()}.
+     * </p>
      *
-     * @param  i  the index of the escape-char in the string
-     * @param  stringBuilder the stringBuilder to append the escape-char to
-     * @param  string the string whose chars are parsed
+     * @param i             the index of the escape-char in the string
+     * @param stringBuilder the stringBuilder to append the escape-char to
+     * @param string        the string whose chars are parsed
      * @return the new index i
      * @since 1.0-alpha3
      */
-    private static int parseEscape(int i, final StringBuilder stringBuilder, final String string)
-        throws ImagingException {
+    private static int parseEscape(int i, final StringBuilder stringBuilder, final String string) throws ImagingException {
         final char c = string.charAt(i);
         switch (c) {
         case '\\':
@@ -155,15 +152,13 @@ public class BasicCParser {
             stringBuilder.append((char) 0x0b);
             break;
         default:
-            throw new ImagingException("Parsing XPM file failed, "
-                    + "invalid escape sequence");
+            throw new ImagingException("Parsing XPM file failed, " + "invalid escape sequence");
         }
         return i;
 
     }
 
-    public static ByteArrayOutputStream preprocess(final InputStream is,
-            final StringBuilder firstComment, final Map<String, String> defines)
+    public static ByteArrayOutputStream preprocess(final InputStream is, final StringBuilder firstComment, final Map<String, String> defines)
             throws IOException, ImagingException {
         boolean inSingleQuotes = false;
         boolean inString = false;
@@ -269,11 +264,9 @@ public class BasicCParser {
                         throw new ImagingException("Bad preprocessor directive");
                     }
                     if (!tokens[0].equals("define")) {
-                        throw new ImagingException("Invalid/unsupported "
-                                + "preprocessor directive '" + tokens[0] + "'");
+                        throw new ImagingException("Invalid/unsupported " + "preprocessor directive '" + tokens[0] + "'");
                     }
-                    defines.put(tokens[1], (tokens.length == 3) ? tokens[2]
-                            : null);
+                    defines.put(tokens[1], tokens.length == 3 ? tokens[2] : null);
                     directiveBuffer.setLength(0);
                 } else {
                     directiveBuffer.append((char) c);
@@ -363,19 +356,15 @@ public class BasicCParser {
         return liveTokens;
     }
 
-    public static void unescapeString(final StringBuilder stringBuilder, final String string)
-            throws ImagingException {
+    public static void unescapeString(final StringBuilder stringBuilder, final String string) throws ImagingException {
         if (string.length() < 2) {
-            throw new ImagingException("Parsing XPM file failed, "
-                    + "string is too short");
+            throw new ImagingException("Parsing XPM file failed, " + "string is too short");
         }
-        if (string.charAt(0) != '"'
-                || string.charAt(string.length() - 1) != '"') {
-            throw new ImagingException("Parsing XPM file failed, "
-                    + "string not surrounded by '\"'");
+        if (string.charAt(0) != '"' || string.charAt(string.length() - 1) != '"') {
+            throw new ImagingException("Parsing XPM file failed, " + "string not surrounded by '\"'");
         }
         boolean hadBackSlash = false;
-        for (int i = 1; i < (string.length() - 1); i++) {
+        for (int i = 1; i < string.length() - 1; i++) {
             final char c = string.charAt(i);
             if (hadBackSlash) {
                 i = parseEscape(i, stringBuilder, string);
@@ -383,15 +372,13 @@ public class BasicCParser {
             } else if (c == '\\') {
                 hadBackSlash = true;
             } else if (c == '"') {
-                throw new ImagingException("Parsing XPM file failed, "
-                        + "extra '\"' found in string");
+                throw new ImagingException("Parsing XPM file failed, " + "extra '\"' found in string");
             } else {
                 stringBuilder.append(c);
             }
         }
         if (hadBackSlash) {
-            throw new ImagingException("Parsing XPM file failed, "
-                    + "unterminated escape sequence found in string");
+            throw new ImagingException("Parsing XPM file failed, " + "unterminated escape sequence found in string");
         }
     }
 
@@ -425,15 +412,14 @@ public class BasicCParser {
                     break;
                 case '\r':
                 case '\n':
-                    throw new ImagingException(
-                            "Unterminated string in XPM file");
+                    throw new ImagingException("Unterminated string in XPM file");
                 default:
                     token.append((char) c);
                     hadBackSlash = false;
                     break;
                 }
             } else if (inIdentifier) {
-                if (!Character.isLetterOrDigit(c) && (c != '_')) {
+                if (!Character.isLetterOrDigit(c) && c != '_') {
                     is.unread(c);
                     return token.toString();
                 }
@@ -444,16 +430,13 @@ public class BasicCParser {
             } else if (Character.isLetterOrDigit(c) || c == '_') {
                 token.append((char) c);
                 inIdentifier = true;
-            } else if (c == '{' || c == '}' || c == '[' || c == ']'
-                    || c == '*' || c == ';' || c == '=' || c == ',') {
+            } else if (c == '{' || c == '}' || c == '[' || c == ']' || c == '*' || c == ';' || c == '=' || c == ',') {
                 token.append((char) c);
                 return token.toString();
             } else if (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
                 // ignore
             } else {
-                throw new ImagingException(
-                        "Unhandled/invalid character '" + ((char) c)
-                                + "' found in XPM file");
+                throw new ImagingException("Unhandled/invalid character '" + (char) c + "' found in XPM file");
             }
         }
 
diff --git a/src/main/java/org/apache/commons/imaging/common/BigEndianBinaryOutputStream.java b/src/main/java/org/apache/commons/imaging/common/BigEndianBinaryOutputStream.java
index 8d95ab71..9cff0d86 100644
--- a/src/main/java/org/apache/commons/imaging/common/BigEndianBinaryOutputStream.java
+++ b/src/main/java/org/apache/commons/imaging/common/BigEndianBinaryOutputStream.java
@@ -28,22 +28,22 @@ final class BigEndianBinaryOutputStream extends BinaryOutputStream {
 
     @Override
     public void write2Bytes(final int value) throws IOException {
-        write(0xff & (value >> 8));
+        write(0xff & value >> 8);
         write(0xff & value);
     }
 
     @Override
     public void write3Bytes(final int value) throws IOException {
-        write(0xff & (value >> 16));
-        write(0xff & (value >> 8));
+        write(0xff & value >> 16);
+        write(0xff & value >> 8);
         write(0xff & value);
     }
 
     @Override
     public void write4Bytes(final int value) throws IOException {
-        write(0xff & (value >> 24));
-        write(0xff & (value >> 16));
-        write(0xff & (value >> 8));
+        write(0xff & value >> 24);
+        write(0xff & value >> 16);
+        write(0xff & value >> 8);
         write(0xff & value);
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java b/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
index 007ad25a..2a817431 100644
--- a/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
+++ b/src/main/java/org/apache/commons/imaging/common/BinaryFileParser.java
@@ -59,7 +59,8 @@ public class BinaryFileParser {
     }
 
     protected final void debugNumber(final String msg, final int data, final int bytes) {
-        try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) {
+        try (StringWriter sw = new StringWriter();
+                PrintWriter pw = new PrintWriter(sw)) {
             debugNumber(pw, msg, data, bytes);
             pw.flush();
             sw.flush();
diff --git a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
index 37b7cb4e..b0ed58e7 100644
--- a/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
+++ b/src/main/java/org/apache/commons/imaging/common/BinaryFunctions.java
@@ -35,15 +35,14 @@ public final class BinaryFunctions {
     private static final Logger LOGGER = Logger.getLogger(BinaryFunctions.class.getName());
 
     public static int charsToQuad(final char c1, final char c2, final char c3, final char c4) {
-        return (((0xff & c1) << 24) | ((0xff & c2) << 16) | ((0xff & c3) << 8) | ((0xff & c4) << 0));
+        return (0xff & c1) << 24 | (0xff & c2) << 16 | (0xff & c3) << 8 | (0xff & c4) << 0;
     }
 
-    public static boolean compareBytes(final byte[] a, final int aStart, final byte[] b,
-            final int bStart, final int length) {
-        if (a.length < (aStart + length)) {
+    public static boolean compareBytes(final byte[] a, final int aStart, final byte[] b, final int bStart, final int length) {
+        if (a.length < aStart + length) {
             return false;
         }
-        if (b.length < (bStart + length)) {
+        if (b.length < bStart + length) {
             return false;
         }
 
@@ -69,8 +68,7 @@ public final class BinaryFunctions {
         return findNull(src, 0, message);
     }
 
-    public static byte[] getBytes(final RandomAccessFile raf, final long pos,
-            final int length, final String exception) throws IOException {
+    public static byte[] getBytes(final RandomAccessFile raf, final long pos, final int length, final String exception) throws IOException {
         if (length < 0) {
             throw new IOException(String.format("%s, invalid length: %d", exception, length));
         }
@@ -91,21 +89,18 @@ public final class BinaryFunctions {
     }
 
     public static void logCharQuad(final String msg, final int i) {
-        LOGGER.finest(msg + ": '" + (char) (0xff & (i >> 24))
-                + (char) (0xff & (i >> 16)) + (char) (0xff & (i >> 8))
-                + (char) (0xff & (i >> 0)) + "'");
+        LOGGER.finest(msg + ": '" + (char) (0xff & i >> 24) + (char) (0xff & i >> 16) + (char) (0xff & i >> 8) + (char) (0xff & i >> 0) + "'");
 
     }
 
     public static void printCharQuad(final PrintWriter pw, final String msg, final int i) {
-        pw.println(msg + ": '" + (char) (0xff & (i >> 24))
-                + (char) (0xff & (i >> 16)) + (char) (0xff & (i >> 8))
-                + (char) (0xff & (i >> 0)) + "'");
+        pw.println(msg + ": '" + (char) (0xff & i >> 24) + (char) (0xff & i >> 16) + (char) (0xff & i >> 8) + (char) (0xff & i >> 0) + "'");
 
     }
 
     /**
      * Convert a quad into a byte array.
+     *
      * @param quad quad
      * @return a byte array
      */
@@ -118,8 +113,7 @@ public final class BinaryFunctions {
         return arr;
     }
 
-    public static int read2Bytes(final String name, final InputStream is,
-            final String exception, final ByteOrder byteOrder) throws IOException {
+    public static int read2Bytes(final String name, final InputStream is, final String exception, final ByteOrder byteOrder) throws IOException {
         final int byte0 = is.read();
         final int byte1 = is.read();
         if ((byte0 | byte1) < 0) {
@@ -128,16 +122,15 @@ public final class BinaryFunctions {
 
         final int result;
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            result = (byte0 << 8) | byte1;
+            result = byte0 << 8 | byte1;
         } else {
-            result = (byte1 << 8) | byte0;
+            result = byte1 << 8 | byte0;
         }
 
         return result;
     }
 
-    public static int read3Bytes(final String name, final InputStream is,
-            final String exception, final ByteOrder byteOrder) throws IOException {
+    public static int read3Bytes(final String name, final InputStream is, final String exception, final ByteOrder byteOrder) throws IOException {
         final int byte0 = is.read();
         final int byte1 = is.read();
         final int byte2 = is.read();
@@ -147,16 +140,15 @@ public final class BinaryFunctions {
 
         final int result;
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            result = (byte0 << 16) | (byte1 << 8) | (byte2 << 0);
+            result = byte0 << 16 | byte1 << 8 | byte2 << 0;
         } else {
-            result = (byte2 << 16) | (byte1 << 8) | (byte0 << 0);
+            result = byte2 << 16 | byte1 << 8 | byte0 << 0;
         }
 
         return result;
     }
 
-    public static int read4Bytes(final String name, final InputStream is,
-            final String exception, final ByteOrder byteOrder) throws IOException {
+    public static int read4Bytes(final String name, final InputStream is, final String exception, final ByteOrder byteOrder) throws IOException {
         final int byte0 = is.read();
         final int byte1 = is.read();
         final int byte2 = is.read();
@@ -167,66 +159,50 @@ public final class BinaryFunctions {
 
         final int result;
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            result = (byte0 << 24) | (byte1 << 16)
-                    | (byte2 << 8) | (byte3 << 0);
+            result = byte0 << 24 | byte1 << 16 | byte2 << 8 | byte3 << 0;
         } else {
-            result = (byte3 << 24) | (byte2 << 16)
-                    | (byte1 << 8) | (byte0 << 0);
+            result = byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0 << 0;
         }
 
         return result;
     }
 
-   /**
-    * Read eight bytes from the specified input stream, adjust for
-    * byte order, and return a long integer.
-    * @param name a descriptive identifier used for diagnostic purposes
-    * @param is a valid input stream
-    * @param exception application-defined message to be used for constructing an exception
-    * if an error condition is triggered.
-    * @param byteOrder the order in which the InputStream marshals data
-    * @return a long integer interpreted from next 8 bytes in the InputStream
-    * @throws IOException in the event of a non-recoverable error, such
-    * as an attempt to read past the end of file.
-    */
-   public static long read8Bytes(final String name,
-    final InputStream is,
-    final String exception,
-    final ByteOrder byteOrder) throws IOException {
-
-    final long byte0 = is.read();
-    final long byte1 = is.read();
-    final long byte2 = is.read();
-    final long byte3 = is.read();
-    final long byte4 = is.read();
-    final long byte5 = is.read();
-    final long byte6 = is.read();
-    final long byte7 = is.read();
-
-    if ((byte0 | byte1 | byte2 | byte3
-      | byte4 | byte5 | byte6 | byte7) < 0) {
-      throw new IOException(exception);
-    }
+    /**
+     * Read eight bytes from the specified input stream, adjust for byte order, and return a long integer.
+     *
+     * @param name      a descriptive identifier used for diagnostic purposes
+     * @param is        a valid input stream
+     * @param exception application-defined message to be used for constructing an exception if an error condition is triggered.
+     * @param byteOrder the order in which the InputStream marshals data
+     * @return a long integer interpreted from next 8 bytes in the InputStream
+     * @throws IOException in the event of a non-recoverable error, such as an attempt to read past the end of file.
+     */
+    public static long read8Bytes(final String name, final InputStream is, final String exception, final ByteOrder byteOrder) throws IOException {
+
+        final long byte0 = is.read();
+        final long byte1 = is.read();
+        final long byte2 = is.read();
+        final long byte3 = is.read();
+        final long byte4 = is.read();
+        final long byte5 = is.read();
+        final long byte6 = is.read();
+        final long byte7 = is.read();
+
+        if ((byte0 | byte1 | byte2 | byte3 | byte4 | byte5 | byte6 | byte7) < 0) {
+            throw new IOException(exception);
+        }
 
-    final long result;
-    if (byteOrder == ByteOrder.BIG_ENDIAN) {
-      result =
-          (byte0 << 56) | (byte1 << 48) | (byte2 << 40)
-        | (byte3 << 32) | (byte4 << 24) | (byte5 << 16)
-        | (byte6 << 8) | (byte7 << 0);
-    } else {
-      result =
-          (byte7 << 56) | (byte6 << 48) | (byte5 << 40)
-        | (byte4 << 32) | (byte3 << 24) | (byte2 << 16)
-        | (byte1 << 8) | (byte0 << 0);
-    }
+        final long result;
+        if (byteOrder == ByteOrder.BIG_ENDIAN) {
+            result = byte0 << 56 | byte1 << 48 | byte2 << 40 | byte3 << 32 | byte4 << 24 | byte5 << 16 | byte6 << 8 | byte7 << 0;
+        } else {
+            result = byte7 << 56 | byte6 << 48 | byte5 << 40 | byte4 << 32 | byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0 << 0;
+        }
 
-    return result;
-  }
+        return result;
+    }
 
-    public static void readAndVerifyBytes(final InputStream is,
-            final BinaryConstant expected, final String exception)
-            throws ImagingException, IOException {
+    public static void readAndVerifyBytes(final InputStream is, final BinaryConstant expected, final String exception) throws ImagingException, IOException {
         for (int i = 0; i < expected.size(); i++) {
             final int data = is.read();
             final byte b = (byte) (0xff & data);
@@ -241,8 +217,7 @@ public final class BinaryFunctions {
         }
     }
 
-    public static void readAndVerifyBytes(final InputStream is, final byte[] expected,
-            final String exception) throws ImagingException, IOException {
+    public static void readAndVerifyBytes(final InputStream is, final byte[] expected, final String exception) throws ImagingException, IOException {
         for (final byte element : expected) {
             final int data = is.read();
             final byte b = (byte) (0xff & data);
@@ -257,8 +232,7 @@ public final class BinaryFunctions {
         }
     }
 
-    public static byte readByte(final String name, final InputStream is, final String exceptionMessage)
-            throws IOException {
+    public static byte readByte(final String name, final InputStream is, final String exceptionMessage) throws IOException {
         final int result = is.read();
         if (result < 0) {
             throw new IOException(exceptionMessage);
@@ -270,16 +244,14 @@ public final class BinaryFunctions {
         return readBytes("", is, count, "Unexpected EOF");
     }
 
-    public static byte[] readBytes(final String name, final InputStream is, final int length)
-            throws IOException {
+    public static byte[] readBytes(final String name, final InputStream is, final int length) throws IOException {
         return readBytes(name, is, length, name + " could not be read.");
     }
 
-    public static byte[] readBytes(final String name, final InputStream is, final int length,
-            final String exception) throws IOException {
+    public static byte[] readBytes(final String name, final InputStream is, final int length, final String exception) throws IOException {
         try {
             return IOUtils.toByteArray(is, Allocator.check(length));
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new IOException(exception + ", name: " + name + ", length: " + length);
         }
     }
@@ -289,13 +261,14 @@ public final class BinaryFunctions {
     }
 
     /**
-     * Consumes the {@code InputStream} (without closing it) searching for a quad. It will
-     * stop either when the quad is found, or when there are no more bytes in the input stream.
+     * Consumes the {@code InputStream} (without closing it) searching for a quad. It will stop either when the quad is found, or when there are no more bytes
+     * in the input stream.
      *
-     * <p>Returns {@code true} if it found the quad, and {@code false} otherwise.
+     * <p>
+     * Returns {@code true} if it found the quad, and {@code false} otherwise.
      *
      * @param quad a quad (the needle)
-     * @param bis an input stream (the haystack)
+     * @param bis  an input stream (the haystack)
      * @return {@code true} if it found the quad, and {@code false} otherwise
      * @throws IOException if it fails to read from the given input stream
      */
@@ -323,7 +296,7 @@ public final class BinaryFunctions {
     public static long skipBytes(final InputStream is, final long length, final String exception) throws IOException {
         try {
             return IOUtils.skip(is, length);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new IOException(exception, e);
         }
     }
diff --git a/src/main/java/org/apache/commons/imaging/common/BufferedImageFactory.java b/src/main/java/org/apache/commons/imaging/common/BufferedImageFactory.java
index 77302c09..b4f7cee3 100644
--- a/src/main/java/org/apache/commons/imaging/common/BufferedImageFactory.java
+++ b/src/main/java/org/apache/commons/imaging/common/BufferedImageFactory.java
@@ -20,9 +20,7 @@ package org.apache.commons.imaging.common;
 import java.awt.image.BufferedImage;
 
 public interface BufferedImageFactory {
-    BufferedImage getColorBufferedImage(int width, int height,
-            boolean hasAlpha);
+    BufferedImage getColorBufferedImage(int width, int height, boolean hasAlpha);
 
-    BufferedImage getGrayscaleBufferedImage(int width, int height,
-            boolean hasAlpha);
+    BufferedImage getGrayscaleBufferedImage(int width, int height, boolean hasAlpha);
 }
diff --git a/src/main/java/org/apache/commons/imaging/common/ByteConversions.java b/src/main/java/org/apache/commons/imaging/common/ByteConversions.java
index e81fabb6..b2847545 100644
--- a/src/main/java/org/apache/commons/imaging/common/ByteConversions.java
+++ b/src/main/java/org/apache/commons/imaging/common/ByteConversions.java
@@ -20,8 +20,7 @@ import java.nio.ByteOrder;
 import java.util.Arrays;
 
 /**
- * Convenience methods for converting data types to and from
- * byte arrays.
+ * Convenience methods for converting data types to and from byte arrays.
  */
 public final class ByteConversions {
     public static byte[] toBytes(final double value, final ByteOrder byteOrder) {
@@ -33,23 +32,23 @@ public final class ByteConversions {
     private static void toBytes(final double value, final ByteOrder byteOrder, final byte[] result, final int offset) {
         final long bits = Double.doubleToRawLongBits(value);
         if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
-            result[offset + 0] = (byte) (0xff & (bits >> 0));
-            result[offset + 1] = (byte) (0xff & (bits >> 8));
-            result[offset + 2] = (byte) (0xff & (bits >> 16));
-            result[offset + 3] = (byte) (0xff & (bits >> 24));
-            result[offset + 4] = (byte) (0xff & (bits >> 32));
-            result[offset + 5] = (byte) (0xff & (bits >> 40));
-            result[offset + 6] = (byte) (0xff & (bits >> 48));
-            result[offset + 7] = (byte) (0xff & (bits >> 56));
+            result[offset + 0] = (byte) (0xff & bits >> 0);
+            result[offset + 1] = (byte) (0xff & bits >> 8);
+            result[offset + 2] = (byte) (0xff & bits >> 16);
+            result[offset + 3] = (byte) (0xff & bits >> 24);
+            result[offset + 4] = (byte) (0xff & bits >> 32);
+            result[offset + 5] = (byte) (0xff & bits >> 40);
+            result[offset + 6] = (byte) (0xff & bits >> 48);
+            result[offset + 7] = (byte) (0xff & bits >> 56);
         } else {
-            result[offset + 7] = (byte) (0xff & (bits >> 0));
-            result[offset + 6] = (byte) (0xff & (bits >> 8));
-            result[offset + 5] = (byte) (0xff & (bits >> 16));
-            result[offset + 4] = (byte) (0xff & (bits >> 24));
-            result[offset + 3] = (byte) (0xff & (bits >> 32));
-            result[offset + 2] = (byte) (0xff & (bits >> 40));
-            result[offset + 1] = (byte) (0xff & (bits >> 48));
-            result[offset + 0] = (byte) (0xff & (bits >> 56));
+            result[offset + 7] = (byte) (0xff & bits >> 0);
+            result[offset + 6] = (byte) (0xff & bits >> 8);
+            result[offset + 5] = (byte) (0xff & bits >> 16);
+            result[offset + 4] = (byte) (0xff & bits >> 24);
+            result[offset + 3] = (byte) (0xff & bits >> 32);
+            result[offset + 2] = (byte) (0xff & bits >> 40);
+            result[offset + 1] = (byte) (0xff & bits >> 48);
+            result[offset + 0] = (byte) (0xff & bits >> 56);
         }
     }
 
@@ -57,8 +56,7 @@ public final class ByteConversions {
         return toBytes(values, 0, values.length, byteOrder);
     }
 
-    private static byte[] toBytes(final double[] values, final int offset,
-            final int length, final ByteOrder byteOrder) {
+    private static byte[] toBytes(final double[] values, final int offset, final int length, final ByteOrder byteOrder) {
         final byte[] result = Allocator.byteArray(length * 8);
         for (int i = 0; i < length; i++) {
             toBytes(values[offset + i], byteOrder, result, i * 8);
@@ -75,15 +73,15 @@ public final class ByteConversions {
     private static void toBytes(final float value, final ByteOrder byteOrder, final byte[] result, final int offset) {
         final int bits = Float.floatToRawIntBits(value);
         if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
-            result[offset + 0] = (byte) (0xff & (bits >> 0));
-            result[offset + 1] = (byte) (0xff & (bits >> 8));
-            result[offset + 2] = (byte) (0xff & (bits >> 16));
-            result[offset + 3] = (byte) (0xff & (bits >> 24));
+            result[offset + 0] = (byte) (0xff & bits >> 0);
+            result[offset + 1] = (byte) (0xff & bits >> 8);
+            result[offset + 2] = (byte) (0xff & bits >> 16);
+            result[offset + 3] = (byte) (0xff & bits >> 24);
         } else {
-            result[offset + 3] = (byte) (0xff & (bits >> 0));
-            result[offset + 2] = (byte) (0xff & (bits >> 8));
-            result[offset + 1] = (byte) (0xff & (bits >> 16));
-            result[offset + 0] = (byte) (0xff & (bits >> 24));
+            result[offset + 3] = (byte) (0xff & bits >> 0);
+            result[offset + 2] = (byte) (0xff & bits >> 8);
+            result[offset + 1] = (byte) (0xff & bits >> 16);
+            result[offset + 0] = (byte) (0xff & bits >> 24);
         }
     }
 
@@ -132,10 +130,9 @@ public final class ByteConversions {
     }
 
     /**
-     * Encodes an eight-byte (long) into an array of bytes based on
-     * the specified byte order.
+     * Encodes an eight-byte (long) into an array of bytes based on the specified byte order.
      *
-     * @param value a standard data primitive of type long
+     * @param value     a standard data primitive of type long
      * @param byteOrder the byte order to be used for encoding
      * @return an array of length 8
      */
@@ -173,8 +170,7 @@ public final class ByteConversions {
         return result;
     }
 
-    private static void toBytes(final RationalNumber value, final ByteOrder byteOrder,
-            final byte[] result, final int offset) {
+    private static void toBytes(final RationalNumber value, final ByteOrder byteOrder, final byte[] result, final int offset) {
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
             result[offset + 0] = (byte) (value.numerator >> 24);
             result[offset + 1] = (byte) (value.numerator >> 16);
@@ -200,8 +196,7 @@ public final class ByteConversions {
         return toBytes(values, 0, values.length, byteOrder);
     }
 
-    private static byte[] toBytes(final RationalNumber[] values, final int offset,
-            final int length, final ByteOrder byteOrder) {
+    private static byte[] toBytes(final RationalNumber[] values, final int offset, final int length, final ByteOrder byteOrder) {
         final byte[] result = Allocator.byteArray(length * 8);
         for (int i = 0; i < length; i++) {
             toBytes(values[offset + i], byteOrder, result, i * 8);
@@ -252,13 +247,9 @@ public final class ByteConversions {
         final long byte7 = 0xffL & bytes[offset + 7];
         final long bits;
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            bits = (byte0 << 56) | (byte1 << 48) | (byte2 << 40)
-                    | (byte3 << 32) | (byte4 << 24) | (byte5 << 16)
-                    | (byte6 << 8) | (byte7 << 0);
+            bits = byte0 << 56 | byte1 << 48 | byte2 << 40 | byte3 << 32 | byte4 << 24 | byte5 << 16 | byte6 << 8 | byte7 << 0;
         } else {
-            bits = (byte7 << 56) | (byte6 << 48) | (byte5 << 40)
-                    | (byte4 << 32) | (byte3 << 24) | (byte2 << 16)
-                    | (byte1 << 8) | (byte0 << 0);
+            bits = byte7 << 56 | byte6 << 48 | byte5 << 40 | byte4 << 32 | byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0 << 0;
         }
         return Double.longBitsToDouble(bits);
     }
@@ -267,8 +258,7 @@ public final class ByteConversions {
         return toDoubles(bytes, 0, bytes.length, byteOrder);
     }
 
-    private static double[] toDoubles(final byte[] bytes, final int offset,
-            final int length, final ByteOrder byteOrder) {
+    private static double[] toDoubles(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder) {
         final double[] result = Allocator.doubleArray(length / 8);
         Arrays.setAll(result, i -> toDouble(bytes, offset + 8 * i, byteOrder));
         return result;
@@ -285,9 +275,9 @@ public final class ByteConversions {
         final int byte3 = 0xff & bytes[offset + 3];
         final int bits;
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            bits = (byte0 << 24) | (byte1 << 16) | (byte2 << 8) | (byte3 << 0);
+            bits = byte0 << 24 | byte1 << 16 | byte2 << 8 | byte3 << 0;
         } else {
-            bits = (byte3 << 24) | (byte2 << 16) | (byte1 << 8) | (byte0 << 0);
+            bits = byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0 << 0;
         }
         return Float.intBitsToFloat(bits);
     }
@@ -296,8 +286,7 @@ public final class ByteConversions {
         return toFloats(bytes, 0, bytes.length, byteOrder);
     }
 
-    private static float[] toFloats(final byte[] bytes, final int offset,
-            final int length, final ByteOrder byteOrder) {
+    private static float[] toFloats(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder) {
         final float[] result = Allocator.floatArray(length / 4);
         for (int i = 0; i < result.length; i++) {
             result[i] = toFloat(bytes, offset + 4 * i, byteOrder);
@@ -315,27 +304,26 @@ public final class ByteConversions {
         final int byte2 = 0xff & bytes[offset + 2];
         final int byte3 = 0xff & bytes[offset + 3];
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            return (byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3;
+            return byte0 << 24 | byte1 << 16 | byte2 << 8 | byte3;
         }
-        return (byte3 << 24) | (byte2 << 16) | (byte1 << 8) | byte0;
+        return byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0;
     }
 
     public static int[] toInts(final byte[] bytes, final ByteOrder byteOrder) {
         return toInts(bytes, 0, bytes.length, byteOrder);
     }
 
-    private static int[] toInts(final byte[] bytes, final int offset, final int length,
-            final ByteOrder byteOrder) {
+    private static int[] toInts(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder) {
         final int[] result = Allocator.intArray(length / 4);
         Arrays.setAll(result, i -> toInt(bytes, offset + 4 * i, byteOrder));
         return result;
     }
 
     /**
-     * Extracts an eight-byte long integer from the specified byte array.
-     * This method assumes that the byte array is of sufficiently large size
-     * to encode a long integer.
-     * @param bytes an array of size at least 8
+     * Extracts an eight-byte long integer from the specified byte array. This method assumes that the byte array is of sufficiently large size to encode a long
+     * integer.
+     *
+     * @param bytes     an array of size at least 8
      * @param byteOrder the byte-order for interpreting the input bytes
      * @return an eight-byte signed integer
      */
@@ -354,55 +342,42 @@ public final class ByteConversions {
         final long byte7 = 0xffL & bytes[offset + 7];
 
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            return  (byte0 << 56) | (byte1 << 48) | (byte2 << 40)
-                    | (byte3 << 32) | (byte4 << 24) | (byte5 << 16)
-                    | (byte6 << 8) | byte7  ;
+            return byte0 << 56 | byte1 << 48 | byte2 << 40 | byte3 << 32 | byte4 << 24 | byte5 << 16 | byte6 << 8 | byte7;
         }
-        return (byte7 << 56) | (byte6 << 48) | (byte5 << 40)
-                    | (byte4 << 32) | (byte3 << 24) | (byte2 << 16)
-                    | (byte1 << 8) | byte0;
+        return byte7 << 56 | byte6 << 48 | byte5 << 40 | byte4 << 32 | byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0;
     }
 
     /**
-     * Extracts an array of eight-byte long integers from the specified array
-     * of bytes.  The size of the result array is computed based on the
-     * size of the input byte array.
-     * @param bytes a valid array
+     * Extracts an array of eight-byte long integers from the specified array of bytes. The size of the result array is computed based on the size of the input
+     * byte array.
+     *
+     * @param bytes     a valid array
      * @param byteOrder the byte-order for interpreting the input bytes
      * @return an array of zero or more eight-byte signed integers
      */
     public static long[] toLongs(final byte[] bytes, final ByteOrder byteOrder) {
-      return toLongs(bytes, 0, bytes.length, byteOrder);
+        return toLongs(bytes, 0, bytes.length, byteOrder);
     }
 
-    private static long[] toLongs(final byte[] bytes, final int offset, final int length,
-      final ByteOrder byteOrder) {
-      final long[] result = Allocator.longArray(length / 8);
-      Arrays.setAll(result, i -> toLong(bytes, offset + 8 * i, byteOrder));
-      return result;
+    private static long[] toLongs(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder) {
+        final long[] result = Allocator.longArray(length / 8);
+        Arrays.setAll(result, i -> toLong(bytes, offset + 8 * i, byteOrder));
+        return result;
     }
 
     /**
-     * Interprets the content of a specified bytes array to create
-     * an instance of the RationalNumber class.
-     * @param bytes a valid array dimensioned to at least 8.
-     * @param byteOrder the byte order for integer conversion
-     * @param unsignedType indicates whether the extracted value is
-     * an unsigned type.
+     * Interprets the content of a specified bytes array to create an instance of the RationalNumber class.
+     *
+     * @param bytes        a valid array dimensioned to at least 8.
+     * @param byteOrder    the byte order for integer conversion
+     * @param unsignedType indicates whether the extracted value is an unsigned type.
      * @return a valid instance
      */
-    public static RationalNumber toRational(
-            final byte[] bytes,
-            final ByteOrder byteOrder,
-            final boolean unsignedType) {
+    public static RationalNumber toRational(final byte[] bytes, final ByteOrder byteOrder, final boolean unsignedType) {
         return toRational(bytes, 0, byteOrder, unsignedType);
     }
 
-    private static RationalNumber toRational(
-            final byte[] bytes,
-            final int offset,
-            final ByteOrder byteOrder,
-            final boolean unsignedType) {
+    private static RationalNumber toRational(final byte[] bytes, final int offset, final ByteOrder byteOrder, final boolean unsignedType) {
         final int byte0 = 0xff & bytes[offset + 0];
         final int byte1 = 0xff & bytes[offset + 1];
         final int byte2 = 0xff & bytes[offset + 2];
@@ -414,28 +389,20 @@ public final class ByteConversions {
         final int numerator;
         final int divisor;
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            numerator = (byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3;
-            divisor = (byte4 << 24) | (byte5 << 16) | (byte6 << 8) | byte7;
+            numerator = byte0 << 24 | byte1 << 16 | byte2 << 8 | byte3;
+            divisor = byte4 << 24 | byte5 << 16 | byte6 << 8 | byte7;
         } else {
-            numerator = (byte3 << 24) | (byte2 << 16) | (byte1 << 8) | byte0;
-            divisor = (byte7 << 24) | (byte6 << 16) | (byte5 << 8) | byte4;
+            numerator = byte3 << 24 | byte2 << 16 | byte1 << 8 | byte0;
+            divisor = byte7 << 24 | byte6 << 16 | byte5 << 8 | byte4;
         }
         return new RationalNumber(numerator, divisor, unsignedType);
     }
 
-    public static RationalNumber[] toRationals(
-            final byte[] bytes,
-            final ByteOrder byteOrder,
-            final boolean unsignedType) {
+    public static RationalNumber[] toRationals(final byte[] bytes, final ByteOrder byteOrder, final boolean unsignedType) {
         return toRationals(bytes, 0, bytes.length, byteOrder, unsignedType);
     }
 
-    private static RationalNumber[] toRationals(
-            final byte[] bytes,
-            final int offset,
-            final int length,
-            final ByteOrder byteOrder,
-            final boolean unsignedType) {
+    private static RationalNumber[] toRationals(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder, final boolean unsignedType) {
         final RationalNumber[] result = new RationalNumber[length / 8];
         Arrays.setAll(result, i -> toRational(bytes, offset + 8 * i, byteOrder, unsignedType));
         return result;
@@ -453,8 +420,7 @@ public final class ByteConversions {
         return toShorts(bytes, 0, bytes.length, byteOrder);
     }
 
-    private static short[] toShorts(final byte[] bytes, final int offset,
-            final int length, final ByteOrder byteOrder) {
+    private static short[] toShorts(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder) {
         final short[] result = Allocator.shortArray(length / 2);
         for (int i = 0; i < result.length; i++) {
             result[i] = toShort(bytes, offset + 2 * i, byteOrder);
@@ -470,17 +436,16 @@ public final class ByteConversions {
         final int byte0 = 0xff & bytes[offset + 0];
         final int byte1 = 0xff & bytes[offset + 1];
         if (byteOrder == ByteOrder.BIG_ENDIAN) {
-            return ((byte0 << 8) | byte1);
+            return byte0 << 8 | byte1;
         }
-        return ((byte1 << 8) | byte0);
+        return byte1 << 8 | byte0;
     }
 
     public static int[] toUInt16s(final byte[] bytes, final ByteOrder byteOrder) {
         return toUInt16s(bytes, 0, bytes.length, byteOrder);
     }
 
-    private static int[] toUInt16s(final byte[] bytes, final int offset, final int length,
-            final ByteOrder byteOrder) {
+    private static int[] toUInt16s(final byte[] bytes, final int offset, final int length, final ByteOrder byteOrder) {
         final int[] result = Allocator.intArray(length / 2);
         Arrays.setAll(result, i -> toUInt16(bytes, offset + 2 * i, byteOrder));
         return result;
diff --git a/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java b/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
index ada9bbfe..7fcf4057 100644
--- a/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
+++ b/src/main/java/org/apache/commons/imaging/common/ImageBuilder.java
@@ -51,8 +51,7 @@ import java.util.Properties;
  */
 
 /**
- * A utility class primary intended for storing data obtained by reading
- * image files.
+ * A utility class primary intended for storing data obtained by reading image files.
  */
 public class ImageBuilder {
     private final int[] data;
@@ -64,11 +63,10 @@ public class ImageBuilder {
     /**
      * Constructs an ImageBuilder instance.
      *
-     * @param width the width of the image to be built
-     * @param height the height of the image to be built
-     * @param hasAlpha indicates whether the image has an alpha channel
-     * (the selection of alpha channel does not change the memory
-     * requirements for the ImageBuilder or resulting BufferedImage.
+     * @param width    the width of the image to be built
+     * @param height   the height of the image to be built
+     * @param hasAlpha indicates whether the image has an alpha channel (the selection of alpha channel does not change the memory requirements for the
+     *                 ImageBuilder or resulting BufferedImage.
      * @throws RasterFormatException if {@code width} or {@code height} are equal or less than zero
      */
     public ImageBuilder(final int width, final int height, final boolean hasAlpha) {
@@ -84,17 +82,14 @@ public class ImageBuilder {
     /**
      * Constructs an ImageBuilder instance.
      *
-     * @param width the width of the image to be built
-     * @param height the height of the image to be built
-     * @param hasAlpha indicates whether the image has an alpha channel
-     * (the selection of alpha channel does not change the memory
-     * requirements for the ImageBuilder or resulting BufferedImage.
-     * @param isAlphaPremultiplied indicates whether alpha values are
-     * pre-multiplied; this setting is relevant only if alpha is true.
+     * @param width                the width of the image to be built
+     * @param height               the height of the image to be built
+     * @param hasAlpha             indicates whether the image has an alpha channel (the selection of alpha channel does not change the memory requirements for
+     *                             the ImageBuilder or resulting BufferedImage.
+     * @param isAlphaPremultiplied indicates whether alpha values are pre-multiplied; this setting is relevant only if alpha is true.
      * @throws RasterFormatException if {@code width} or {@code height} are equal or less than zero
      */
-    public ImageBuilder(final int width, final int height,
-        final boolean hasAlpha, final boolean isAlphaPremultiplied) {
+    public ImageBuilder(final int width, final int height, final boolean hasAlpha, final boolean isAlphaPremultiplied) {
         checkDimensions(width, height);
         data = Allocator.intArray(width * height);
         this.width = width;
@@ -104,13 +99,10 @@ public class ImageBuilder {
     }
 
     /**
-     * Performs a check on the specified sub-region to verify
-     * that it is within the constraints of the ImageBuilder bounds.
+     * Performs a check on the specified sub-region to verify that it is within the constraints of the ImageBuilder bounds.
      *
-     * @param x the X coordinate of the upper-left corner of the
-     * specified rectangular region
-     * @param y the Y coordinate of the upper-left corner of the
-     * specified rectangular region
+     * @param x the X coordinate of the upper-left corner of the specified rectangular region
+     * @param y the Y coordinate of the upper-left corner of the specified rectangular region
      * @param w the width of the specified rectangular region
      * @param h the height of the specified rectangular region
      * @throws RasterFormatException if width or height are equal or less than zero, or if the subimage is outside raster (on x or y axis)
@@ -126,22 +118,20 @@ public class ImageBuilder {
             throw new RasterFormatException("subimage x is outside raster");
         }
         if (x + w > width) {
-            throw new RasterFormatException(
-                "subimage (x+width) is outside raster");
+            throw new RasterFormatException("subimage (x+width) is outside raster");
         }
         if (y < 0 || y >= height) {
             throw new RasterFormatException("subimage y is outside raster");
         }
         if (y + h > height) {
-            throw new RasterFormatException(
-                "subimage (y+height) is outside raster");
+            throw new RasterFormatException("subimage (y+height) is outside raster");
         }
     }
 
     /**
      * Checks for valid dimensions and throws {@link RasterFormatException} if the inputs are invalid.
      *
-     * @param width image width (must be greater than zero)
+     * @param width  image width (must be greater than zero)
      * @param height image height (must be greater than zero)
      * @throws RasterFormatException if {@code width} or {@code height} are equal or less than zero
      */
@@ -156,6 +146,7 @@ public class ImageBuilder {
 
     /**
      * Create a BufferedImage using the data stored in the ImageBuilder.
+     *
      * @return a valid BufferedImage.
      */
     public BufferedImage getBufferedImage() {
@@ -164,16 +155,17 @@ public class ImageBuilder {
 
     /**
      * Gets the height of the ImageBuilder pixel field
-     * @return  a positive integer
+     *
+     * @return a positive integer
      */
     public int getHeight() {
         return height;
     }
 
     /**
-     * Gets the RGB or ARGB value for the pixel at the position (x,y)
-     * within the image builder pixel field. For performance reasons
-     * no bounds checking is applied.
+     * Gets the RGB or ARGB value for the pixel at the position (x,y) within the image builder pixel field. For performance reasons no bounds checking is
+     * applied.
+     *
      * @param x the X coordinate of the pixel to be read
      * @param y the Y coordinate of the pixel to be read
      * @return the RGB or ARGB pixel value
@@ -184,22 +176,16 @@ public class ImageBuilder {
     }
 
     /**
-     * Gets a subimage from the ImageBuilder using the specified parameters.
-     * If the parameters specify a rectangular region that is not entirely
-     * contained within the bounds defined by the ImageBuilder, this method will
-     * throw a RasterFormatException.  This runtime-exception behavior
-     * is consistent with the behavior of the getSubimage method
-     * provided by BufferedImage.
-     * @param x the X coordinate of the upper-left corner of the
-     *          specified rectangular region
-     * @param y the Y coordinate of the upper-left corner of the
-     *          specified rectangular region
+     * Gets a subimage from the ImageBuilder using the specified parameters. If the parameters specify a rectangular region that is not entirely contained
+     * within the bounds defined by the ImageBuilder, this method will throw a RasterFormatException. This runtime-exception behavior is consistent with the
+     * behavior of the getSubimage method provided by BufferedImage.
+     *
+     * @param x the X coordinate of the upper-left corner of the specified rectangular region
+     * @param y the Y coordinate of the upper-left corner of the specified rectangular region
      * @param w the width of the specified rectangular region
      * @param h the height of the specified rectangular region
-     * @return a BufferedImage that constructed from the data within the
-     *           specified rectangular region
-     * @throws RasterFormatException f the specified area is not contained
-     *         within this ImageBuilder
+     * @return a BufferedImage that constructed from the data within the specified rectangular region
+     * @throws RasterFormatException f the specified area is not contained within this ImageBuilder
      */
     public BufferedImage getSubimage(final int x, final int y, final int w, final int h) {
         checkBounds(x, y, w, h);
@@ -219,85 +205,59 @@ public class ImageBuilder {
     }
 
     /**
-     * Gets a subset of the ImageBuilder content using the specified parameters
-     * to indicate an area of interest. If the parameters specify a rectangular
-     * region that is not entirely contained within the bounds defined
-     * by the ImageBuilder, this method will throw a RasterFormatException.
-     * This run- time exception is consistent with the behavior of the
-     * getSubimage method provided by BufferedImage.
-     * @param x the X coordinate of the upper-left corner of the
-     *          specified rectangular region
-     * @param y the Y coordinate of the upper-left corner of the
-     *          specified rectangular region
+     * Gets a subset of the ImageBuilder content using the specified parameters to indicate an area of interest. If the parameters specify a rectangular region
+     * that is not entirely contained within the bounds defined by the ImageBuilder, this method will throw a RasterFormatException. This run- time exception is
+     * consistent with the behavior of the getSubimage method provided by BufferedImage.
+     *
+     * @param x the X coordinate of the upper-left corner of the specified rectangular region
+     * @param y the Y coordinate of the upper-left corner of the specified rectangular region
      * @param w the width of the specified rectangular region
      * @param h the height of the specified rectangular region
      * @return a valid instance of the specified width and height.
-     * @throws RasterFormatException if the specified area is not contained
-     *         within this ImageBuilder
+     * @throws RasterFormatException if the specified area is not contained within this ImageBuilder
      */
-     public ImageBuilder getSubset(final int x, final int y, final int w, final int h) {
-         checkBounds(x, y, w, h);
-         final ImageBuilder b = new ImageBuilder(w, h, hasAlpha, isAlphaPremultiplied);
-         for (int i = 0; i < h; i++) {
-             final int srcDex = (i + y) * width + x;
-             final int outDex = i * w;
-             System.arraycopy(data, srcDex, b.data, outDex, w);
-         }
-         return b;
-     }
+    public ImageBuilder getSubset(final int x, final int y, final int w, final int h) {
+        checkBounds(x, y, w, h);
+        final ImageBuilder b = new ImageBuilder(w, h, hasAlpha, isAlphaPremultiplied);
+        for (int i = 0; i < h; i++) {
+            final int srcDex = (i + y) * width + x;
+            final int outDex = i * w;
+            System.arraycopy(data, srcDex, b.data, outDex, w);
+        }
+        return b;
+    }
 
-     /**
-      * Gets the width of the ImageBuilder pixel field
-      *
-      * @return a positive integer
-      */
-     public int getWidth() {
-         return width;
-     }
+    /**
+     * Gets the width of the ImageBuilder pixel field
+     *
+     * @return a positive integer
+     */
+    public int getWidth() {
+        return width;
+    }
 
-     private BufferedImage makeBufferedImage(
-            final int[] argb, final int w, final int h, final boolean useAlpha) {
+    private BufferedImage makeBufferedImage(final int[] argb, final int w, final int h, final boolean useAlpha) {
         ColorModel colorModel;
         WritableRaster raster;
         final DataBufferInt buffer = new DataBufferInt(argb, w * h);
         if (useAlpha) {
-            colorModel = new DirectColorModel(
-                    ColorSpace.getInstance(ColorSpace.CS_sRGB),
-                    32,
-                    0x00ff0000, 0x0000ff00,
-                    0x000000ff, 0xff000000,
+            colorModel = new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000,
                     isAlphaPremultiplied, DataBuffer.TYPE_INT);
-            raster = Raster.createPackedRaster(
-                    buffer, w, h, w,
-                    new int[]{
-                            0x00ff0000,
-                            0x0000ff00,
-                            0x000000ff,
-                            0xff000000},
-                    null);
+            raster = Raster.createPackedRaster(buffer, w, h, w, new int[] { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, null);
         } else {
-            colorModel = new DirectColorModel(24, 0x00ff0000, 0x0000ff00,
-                    0x000000ff);
-            raster = Raster.createPackedRaster(
-                    buffer, w, h, w,
-                    new int[]{
-                        0x00ff0000,
-                        0x0000ff00,
-                        0x000000ff},
-                    null);
+            colorModel = new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff);
+            raster = Raster.createPackedRaster(buffer, w, h, w, new int[] { 0x00ff0000, 0x0000ff00, 0x000000ff }, null);
         }
-        return new BufferedImage(colorModel, raster,
-                colorModel.isAlphaPremultiplied(), new Properties());
+        return new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), new Properties());
     }
 
     /**
-     * Sets the RGB or ARGB value for the pixel at position (x,y) within the image builder pixel field. For performance
-     * reasons, no bounds checking is applied.
+     * Sets the RGB or ARGB value for the pixel at position (x,y) within the image builder pixel field. For performance reasons, no bounds checking is applied.
      *
      * @param x    the X coordinate of the pixel to be set.
      * @param y    the Y coordinate of the pixel to be set.
      * @param argb the RGB or ARGB value to be stored.
-     * @throws ArithmeticException if the index computation overflows an int.
+     * @throws ArithmeticException      if the index computation overflows an int.
      * @throws IllegalArgumentException if the resulting index is illegal.
      */
     public void setRgb(final int x, final int y, final int argb) {
diff --git a/src/main/java/org/apache/commons/imaging/common/LittleEndianBinaryOutputStream.java b/src/main/java/org/apache/commons/imaging/common/LittleEndianBinaryOutputStream.java
index abdf84c3..026e275b 100644
--- a/src/main/java/org/apache/commons/imaging/common/LittleEndianBinaryOutputStream.java
+++ b/src/main/java/org/apache/commons/imaging/common/LittleEndianBinaryOutputStream.java
@@ -29,22 +29,22 @@ final class LittleEndianBinaryOutputStream extends BinaryOutputStream {
     @Override
     public void write2Bytes(final int value) throws IOException {
         write(0xff & value);
-        write(0xff & (value >> 8));
+        write(0xff & value >> 8);
     }
 
     @Override
     public void write3Bytes(final int value) throws IOException {
         write(0xff & value);
-        write(0xff & (value >> 8));
-        write(0xff & (value >> 16));
+        write(0xff & value >> 8);
+        write(0xff & value >> 16);
     }
 
     @Override
     public void write4Bytes(final int value) throws IOException {
         write(0xff & value);
-        write(0xff & (value >> 8));
-        write(0xff & (value >> 16));
-        write(0xff & (value >> 24));
+        write(0xff & value >> 8);
+        write(0xff & value >> 16);
+        write(0xff & value >> 24);
     }
 
 }
diff --git a/src/main/java/org/apache/commons/imaging/common/PackBits.java b/src/main/java/org/apache/commons/imaging/common/PackBits.java
index 20aaa956..3faaca22 100644
--- a/src/main/java/org/apache/commons/imaging/common/PackBits.java
+++ b/src/main/java/org/apache/commons/imaging/common/PackBits.java
@@ -26,8 +26,7 @@ public class PackBits {
 
     public byte[] compress(final byte[] bytes) throws IOException {
         // max length 1 extra byte for every 128
-        try (UnsynchronizedByteArrayOutputStream baos = UnsynchronizedByteArrayOutputStream.builder()
-                .setBufferSize(Allocator.checkByteArray(bytes.length * 2))
+        try (UnsynchronizedByteArrayOutputStream baos = UnsynchronizedByteArrayOutputStream.builder().setBufferSize(Allocator.checkByteArray(bytes.length * 2))
                 .get()) {
             int ptr = 0;
             while (ptr < bytes.length) {
@@ -74,8 +73,7 @@ public class PackBits {
         }
     }
 
-    public byte[] decompress(final byte[] bytes, final int expected)
-            throws ImagingException {
+    public byte[] decompress(final byte[] bytes, final int expected) throws ImagingException {
         int total = 0;
 
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -85,14 +83,11 @@ public class PackBits {
         while (total < expected) {
             // Read the next source byte into n.
             if (i >= bytes.length) {
-                throw new ImagingException(
-                        "Tiff: Unpack bits source exhausted: " + i
-                                + ", done + " + total + ", expected + "
-                                + expected);
+                throw new ImagingException("Tiff: Unpack bits source exhausted: " + i + ", done + " + total + ", expected + " + expected);
             }
 
             final int n = bytes[i++];
-            if ((n >= 0) && (n <= 127)) {
+            if (n >= 0 && n <= 127) {
                 // If n is between 0 and 127 inclusive, copy the next n+1 bytes
                 // literally.
                 final int count = n + 1;
@@ -101,7 +96,7 @@ public class PackBits {
                 for (int j = 0; j < count; j++) {
                     baos.write(bytes[i++]);
                 }
-            } else if ((n >= -127) && (n <= -1)) {
+            } else if (n >= -127 && n <= -1) {
                 // Else if n is between -127 and -1 inclusive, copy the next byte
                 // -n+1 times.
 
@@ -148,7 +143,7 @@ public class PackBits {
 
         int i;
 
-        for (i = start + 1; (i < bytes.length) && (bytes[i] == b); i++) {
+        for (i = start + 1; i < bytes.length && bytes[i] == b; i++) {
             // do nothing
         }
 
diff --git a/src/main/java/org/apache/commons/imaging/common/RationalNumber.java b/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
index 324952bd..2b9ebd53 100644
--- a/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
+++ b/src/main/java/org/apache/commons/imaging/common/RationalNumber.java
@@ -21,20 +21,17 @@ import java.text.NumberFormat;
 /**
  * Rational number, as used by the TIFF image format.
  * <p>
- * The TIFF format specifies two data types for rational numbers based on
- * a pair of 32-bit integers.  Rational is based on unsigned 32-bit integers
- * and SRational is based on signed 32-bit integers.  This treatment is
- * problematic in Java because Java does not support unsigned types.
- * To address this challenge, this class stores the numerator and divisor
- * in long (64-bit) integers, applying masks as necessary for the unsigned
- * type.
+ * The TIFF format specifies two data types for rational numbers based on a pair of 32-bit integers. Rational is based on unsigned 32-bit integers and SRational
+ * is based on signed 32-bit integers. This treatment is problematic in Java because Java does not support unsigned types. To address this challenge, this class
+ * stores the numerator and divisor in long (64-bit) integers, applying masks as necessary for the unsigned type.
  */
 public class RationalNumber extends Number {
 
     private static final class Option {
         public static Option factory(final RationalNumber rationalNumber, final double value) {
-            return new Option(rationalNumber, Math.abs(rationalNumber .doubleValue() - value));
+            return new Option(rationalNumber, Math.abs(rationalNumber.doubleValue() - value));
         }
+
         public final RationalNumber rationalNumber;
 
         public final double error;
@@ -55,15 +52,13 @@ public class RationalNumber extends Number {
     // int-precision tolerance
     private static final double TOLERANCE = 1E-8;
     public static final int SHALLOW_SIZE = 32;
+
     static RationalNumber factoryMethod(long n, long d) {
         // safer than constructor - handles values outside min/max range.
         // also does some simple finding of common denominators.
 
-        if (n > Integer.MAX_VALUE || n < Integer.MIN_VALUE
-                || d > Integer.MAX_VALUE || d < Integer.MIN_VALUE) {
-            while ((n > Integer.MAX_VALUE || n < Integer.MIN_VALUE
-                    || d > Integer.MAX_VALUE || d < Integer.MIN_VALUE)
-                    && (Math.abs(n) > 1) && (Math.abs(d) > 1)) {
+        if (n > Integer.MAX_VALUE || n < Integer.MIN_VALUE || d > Integer.MAX_VALUE || d < Integer.MIN_VALUE) {
+            while ((n > Integer.MAX_VALUE || n < Integer.MIN_VALUE || d > Integer.MAX_VALUE || d < Integer.MIN_VALUE) && Math.abs(n) > 1 && Math.abs(d) > 1) {
                 // brutal, imprecise truncation =(
                 // use the sign-preserving right shift operator.
                 n >>= 1;
@@ -129,7 +124,7 @@ public class RationalNumber extends Number {
             }
         } else {
             final int approx = (int) (1.0 / value);
-            if ((1.0 / approx) < value) {
+            if (1.0 / approx < value) {
                 l = new RationalNumber(1, approx);
                 h = new RationalNumber(1, approx - 1);
             } else {
@@ -140,14 +135,12 @@ public class RationalNumber extends Number {
         Option low = Option.factory(l, value);
         Option high = Option.factory(h, value);
 
-        Option bestOption = (low.error < high.error) ? low : high;
+        Option bestOption = low.error < high.error ? low : high;
 
         final int maxIterations = 100; // value is quite high, actually.
                                        // shouldn't matter.
-        for (int count = 0; bestOption.error > TOLERANCE
-                && count < maxIterations; count++) {
-            final RationalNumber mediant = RationalNumber.factoryMethod(
-                    low.rationalNumber.numerator + high.rationalNumber.numerator,
+        for (int count = 0; bestOption.error > TOLERANCE && count < maxIterations; count++) {
+            final RationalNumber mediant = RationalNumber.factoryMethod(low.rationalNumber.numerator + high.rationalNumber.numerator,
                     low.rationalNumber.divisor + high.rationalNumber.divisor);
             final Option mediantOption = Option.factory(mediant, value);
 
@@ -170,12 +163,11 @@ public class RationalNumber extends Number {
             }
         }
 
-        return negative ? bestOption.rationalNumber.negate()
-                : bestOption.rationalNumber;
+        return negative ? bestOption.rationalNumber.negate() : bestOption.rationalNumber;
     }
 
     // The TIFF and EXIF specifications call for the use
-    // of 32 bit unsigned integers.  Since Java does not have an
+    // of 32 bit unsigned integers. Since Java does not have an
     // unsigned type, this class widens the type to long in order
     // to avoid unintended negative numbers.
     public final long numerator;
@@ -186,8 +178,9 @@ public class RationalNumber extends Number {
 
     /**
      * Constructs an instance based on signed integers
+     *
      * @param numerator a 32-bit signed integer
-     * @param divisor a non-zero 32-bit signed integer
+     * @param divisor   a non-zero 32-bit signed integer
      */
     public RationalNumber(final int numerator, final int divisor) {
         this.numerator = numerator;
@@ -197,10 +190,10 @@ public class RationalNumber extends Number {
 
     /**
      * Constructs an instance supports either signed or unsigned integers.
-     * @param numerator a numerator in the indicated form (signed or unsigned)
-     * @param divisor a non-zero divisor in the indicated form (signed or unsigned)
-     * @param unsignedType indicates whether the input values are to be treated
-     * as unsigned.
+     *
+     * @param numerator    a numerator in the indicated form (signed or unsigned)
+     * @param divisor      a non-zero divisor in the indicated form (signed or unsigned)
+     * @param unsignedType indicates whether the input values are to be treated as unsigned.
      */
     public RationalNumber(final int numerator, final int divisor, final boolean unsignedType) {
         this.unsignedType = unsignedType;
@@ -214,12 +207,11 @@ public class RationalNumber extends Number {
     }
 
     /**
-     * A private constructor for methods such as negate() that create instances
-     * of this class using the content of the current instance.
-     * @param numerator a valid numerator
-     * @param divisor a valid denominator
-     * @param unsignedType indicates how numerator and divisor values
-     * are to be interpreted.
+     * A private constructor for methods such as negate() that create instances of this class using the content of the current instance.
+     *
+     * @param numerator    a valid numerator
+     * @param divisor      a valid denominator
+     * @param unsignedType indicates how numerator and divisor values are to be interpreted.
      */
     private RationalNumber(final long numerator, final long divisor, final boolean unsignedType) {
         this.numerator = numerator;
@@ -236,8 +228,8 @@ public class RationalNumber extends Number {
     public float floatValue() {
         // The computation uses double value in order to preserve
         // as much of the precision of the source numerator and denominator
-        // as possible.  Note that the expression
-        //    return (float)numerator/(float) denominator
+        // as possible. Note that the expression
+        // return (float)numerator/(float) denominator
         // could lose precision since a Java float only carries 24 bits
         // of precision while an integer carries 32.
         return (float) doubleValue();
@@ -254,14 +246,11 @@ public class RationalNumber extends Number {
     }
 
     /**
-     * Negates the value of the RationalNumber. If the numerator of this
-     * instance has its high-order bit set, then its value is too large
-     * to be treated as a Java 32-bit signed integer. In such a case, the
-     * only way that a RationalNumber instance can be negated is to
-     * divide both terms by a common divisor, if a non-zero common divisor exists.
-     * However, if no such divisor exists, there is no numerically correct
-     * way to perform the negation. When a negation cannot be performed correctly,
-     * this method throws an unchecked exception.
+     * Negates the value of the RationalNumber. If the numerator of this instance has its high-order bit set, then its value is too large to be treated as a
+     * Java 32-bit signed integer. In such a case, the only way that a RationalNumber instance can be negated is to divide both terms by a common divisor, if a
+     * non-zero common divisor exists. However, if no such divisor exists, there is no numerically correct way to perform the negation. When a negation cannot
+     * be performed correctly, this method throws an unchecked exception.
+     *
      * @return a valid instance with a negated value.
      */
     public RationalNumber negate() {
@@ -274,7 +263,7 @@ public class RationalNumber extends Number {
             // In such a case it is necessary to adjust the numerator and denominator
             // by their greatest common divisor (gcd), if one exists.
             // If no non-zero common divisor exists, an exception is thrown.
-            if ((n >> 31) == 1) {
+            if (n >> 31 == 1) {
                 // the unsigned value is so large that the high-order bit is set
                 // it cannot be converted to a negative number. Check to see
                 // whether there is an option to reduce its magnitude.
@@ -283,10 +272,8 @@ public class RationalNumber extends Number {
                     n /= g;
                     d /= g;
                 }
-                if ((n >> 31) == 1) {
-                    throw new NumberFormatException(
-                            "Unsigned numerator is too large to negate "
-                            + numerator);
+                if (n >> 31 == 1) {
+                    throw new NumberFormatException("Unsigned numerator is too large to negate " + numerator);
                 }
             }
         }
@@ -294,7 +281,7 @@ public class RationalNumber extends Number {
     }
 
     public String toDisplayString() {
-        if ((numerator % divisor) == 0) {
+        if (numerator % divisor == 0) {
             return Long.toString(numerator / divisor);
         }
         final NumberFormat nf = NumberFormat.getInstance();
@@ -309,7 +296,7 @@ public class RationalNumber extends Number {
         }
         final NumberFormat nf = NumberFormat.getInstance();
 
-        if ((numerator % divisor) == 0) {
+        if (numerator % divisor == 0) {
             return nf.format(numerator / divisor);
         }
         return numerator + "/" + divisor + " (" + nf.format((double) numerator / divisor) + ")";
diff --git a/src/main/java/org/apache/commons/imaging/common/RgbBufferedImageFactory.java b/src/main/java/org/apache/commons/imaging/common/RgbBufferedImageFactory.java
index 1358724d..8a46ed11 100644
--- a/src/main/java/org/apache/commons/imaging/common/RgbBufferedImageFactory.java
+++ b/src/main/java/org/apache/commons/imaging/common/RgbBufferedImageFactory.java
@@ -21,8 +21,7 @@ import java.awt.image.BufferedImage;
 
 public class RgbBufferedImageFactory implements BufferedImageFactory {
     @Override
-    public BufferedImage getColorBufferedImage(final int width, final int height,
-            final boolean hasAlpha) {
+    public BufferedImage getColorBufferedImage(final int width, final int height, final boolean hasAlpha) {
         if (hasAlpha) {
             return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
         }
@@ -30,8 +29,7 @@ public class RgbBufferedImageFactory implements BufferedImageFactory {
     }
 
     @Override
-    public BufferedImage getGrayscaleBufferedImage(final int width, final int height,
-            final boolean hasAlpha) {
+    public BufferedImage getGrayscaleBufferedImage(final int width, final int height, final boolean hasAlpha) {
         // always use color.
         return getColorBufferedImage(width, height, hasAlpha);
     }
diff --git a/src/main/java/org/apache/commons/imaging/common/SimpleBufferedImageFactory.java b/src/main/java/org/apache/commons/imaging/common/SimpleBufferedImageFactory.java
index 0a47343a..e6b5f5e0 100644
--- a/src/main/java/org/apache/commons/imaging/common/SimpleBufferedImageFactory.java
+++ b/src/main/java/org/apache/commons/imaging/common/SimpleBufferedImageFactory.java
@@ -21,8 +21,7 @@ import java.awt.image.BufferedImage;
 
 public class SimpleBufferedImageFactory implements BufferedImageFactory {
     @Override
-    public BufferedImage getColorBufferedImage(final int width, final int height,
-            final boolean hasAlpha) {
+    public BufferedImage getColorBufferedImage(final int width, final int height, final boolean hasAlpha) {
         if (hasAlpha) {
             return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
         }
@@ -30,8 +29,7 @@ public class SimpleBufferedImageFactory implements BufferedImageFactory {
     }
 
     @Override
-    public BufferedImage getGrayscaleBufferedImage(final int width, final int height,
-            final boolean hasAlpha) {
+    public BufferedImage getGrayscaleBufferedImage(final int width, final int height, final boolean hasAlpha) {
         if (hasAlpha) {
             return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
         }
diff --git a/src/main/java/org/apache/commons/imaging/common/XmpEmbeddable.java b/src/main/java/org/apache/commons/imaging/common/XmpEmbeddable.java
index aecbb17f..68828972 100644
--- a/src/main/java/org/apache/commons/imaging/common/XmpEmbeddable.java
+++ b/src/main/java/org/apache/commons/imaging/common/XmpEmbeddable.java
@@ -30,21 +30,14 @@ import org.apache.commons.imaging.bytesource.ByteSource;
 public interface XmpEmbeddable<E extends XmpImagingParameters<E>> {
 
     /**
-     * Gets a string containing XML conforming to the Extensible
-     * Metadata Platform (XMP) standard for representing information about
-     * image content.  Not all image formats support XMP information and
-     * even for those that do, there is no guarantee that such information
-     * will be present in an image.
+     * Gets a string containing XML conforming to the Extensible Metadata Platform (XMP) standard for representing information about image content. Not all
+     * image formats support XMP information and even for those that do, there is no guarantee that such information will be present in an image.
      *
      * @param byteSource A valid reference to a ByteSource.
-     * @param params     Optional instructions for special-handling or
-     *                   interpretation of the input data.
-     * @return If XMP metadata is present, a valid string;
-     *         if it is not present, a null.
-     * @throws ImagingException In the event that the specified content
-     *                            does not conform to the format of the specific
-     *                            parser implementation.
-     * @throws IOException        In the event of unsuccessful read or access operation.
+     * @param params     Optional instructions for special-handling or interpretation of the input data.
+     * @return If XMP metadata is present, a valid string; if it is not present, a null.
+     * @throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
+     * @throws IOException      In the event of unsuccessful read or access operation.
      */
     String getXmpXml(ByteSource byteSource, XmpImagingParameters<E> params) throws ImagingException, IOException;
 
diff --git a/src/main/java/org/apache/commons/imaging/common/ZlibDeflate.java b/src/main/java/org/apache/commons/imaging/common/ZlibDeflate.java
index cef6ace4..bbd86b43 100644
--- a/src/main/java/org/apache/commons/imaging/common/ZlibDeflate.java
+++ b/src/main/java/org/apache/commons/imaging/common/ZlibDeflate.java
@@ -26,13 +26,11 @@ import org.apache.commons.imaging.ImagingException;
 
 /**
  * <p>
- * Utility class to compress/decompress bytes using the ZLIB deflate/inflate
- * compression.
+ * Utility class to compress/decompress bytes using the ZLIB deflate/inflate compression.
  * </p>
  *
  * <p>
- * <a href="https://www.ietf.org/rfc/rfc1951.txt">RFC 1951 - DEFLATE Compressed
- * Data Format Specification version 1.3</a>
+ * <a href="https://www.ietf.org/rfc/rfc1951.txt">RFC 1951 - DEFLATE Compressed Data Format Specification version 1.3</a>
  * </p>
  */
 public class ZlibDeflate {
@@ -59,7 +57,7 @@ public class ZlibDeflate {
     /**
      * Compress the byte[] using ZLIB deflate decompression.
      *
-     * @param bytes The bytes to decompress
+     * @param bytes        The bytes to decompress
      * @param expectedSize The expected size of the decompressed byte[].
      *
      * @return The decompressed bytes.
diff --git a/src/main/java/org/apache/commons/imaging/common/package-info.java b/src/main/java/org/apache/commons/imaging/common/package-info.java
index b1b8471a..3b5caaa2 100644
--- a/src/main/java/org/apache/commons/imaging/common/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/common/package-info.java
@@ -16,8 +16,6 @@
  */
 
 /**
- * Provides utility classes that are employed across multiple
- * image formats and sub-packages.
+ * Provides utility classes that are employed across multiple image formats and sub-packages.
  */
 package org.apache.commons.imaging.common;
-
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
index 9ca76c30..012933a5 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpHeaderInfo.java
@@ -22,6 +22,7 @@ final class BmpHeaderInfo {
         ColorSpaceCoordinate green;
         ColorSpaceCoordinate blue;
     }
+
     static class ColorSpaceCoordinate {
         int x;
         int y;
@@ -69,14 +70,11 @@ final class BmpHeaderInfo {
 
     public final int reservedV5;
 
-    BmpHeaderInfo(final byte identifier1, final byte identifier2, final int fileSize,
-            final int reserved, final int bitmapDataOffset, final int bitmapHeaderSize,
-            final int width, final int height, final int planes, final int bitsPerPixel,
-            final int compression, final int bitmapDataSize, final int hResolution,
-            final int vResolution, final int colorsUsed, final int colorsImportant, final int redMask,
-            final int greenMask, final int blueMask, final int alphaMask, final int colorSpaceType,
-            final ColorSpace colorSpace, final int gammaRed, final int gammaGreen, final int gammaBlue,
-            final int intent, final int profileData, final int profileSize, final int reservedV5) {
+    BmpHeaderInfo(final byte identifier1, final byte identifier2, final int fileSize, final int reserved, final int bitmapDataOffset,
+            final int bitmapHeaderSize, final int width, final int height, final int planes, final int bitsPerPixel, final int compression,
+            final int bitmapDataSize, final int hResolution, final int vResolution, final int colorsUsed, final int colorsImportant, final int redMask,
+            final int greenMask, final int blueMask, final int alphaMask, final int colorSpaceType, final ColorSpace colorSpace, final int gammaRed,
+            final int gammaGreen, final int gammaBlue, final int intent, final int profileData, final int profileSize, final int reservedV5) {
         this.identifier1 = identifier1;
         this.identifier2 = identifier2;
         this.fileSize = fileSize;
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
index 23fca47d..54f7f114 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpImageParser.java
@@ -67,8 +67,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
     }
 
     @Override
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         pw.println("bmp.dumpImageFile");
 
         final ImageInfo imageData = getImageInfo(byteSource, null);
@@ -91,22 +90,22 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
     }
 
     private String getBmpTypeDescription(final int identifier1, final int identifier2) {
-        if ((identifier1 == 'B') && (identifier2 == 'M')) {
+        if (identifier1 == 'B' && identifier2 == 'M') {
             return "Windows 3.1x, 95, NT,";
         }
-        if ((identifier1 == 'B') && (identifier2 == 'A')) {
+        if (identifier1 == 'B' && identifier2 == 'A') {
             return "OS/2 Bitmap Array";
         }
-        if ((identifier1 == 'C') && (identifier2 == 'I')) {
+        if (identifier1 == 'C' && identifier2 == 'I') {
             return "OS/2 Color Icon";
         }
-        if ((identifier1 == 'C') && (identifier2 == 'P')) {
+        if (identifier1 == 'C' && identifier2 == 'P') {
             return "OS/2 Color Pointer";
         }
-        if ((identifier1 == 'I') && (identifier2 == 'C')) {
+        if (identifier1 == 'I' && identifier2 == 'C') {
             return "OS/2 Icon";
         }
-        if ((identifier1 == 'P') && (identifier2 == 'T')) {
+        if (identifier1 == 'P' && identifier2 == 'T') {
             return "OS/2 Pointer";
         }
 
@@ -114,15 +113,13 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
     }
 
     @Override
-    public BufferedImage getBufferedImage(final ByteSource byteSource, final BmpImagingParameters params)
-            throws ImagingException, IOException {
+    public BufferedImage getBufferedImage(final ByteSource byteSource, final BmpImagingParameters params) throws ImagingException, IOException {
         try (InputStream is = byteSource.getInputStream()) {
             return getBufferedImage(is, params);
         }
     }
 
-    public BufferedImage getBufferedImage(final InputStream inputStream, final BmpImagingParameters params)
-            throws ImagingException, IOException {
+    public BufferedImage getBufferedImage(final InputStream inputStream, final BmpImagingParameters params) throws ImagingException, IOException {
         final BmpImageContents ic = readImageContents(inputStream, FormatCompliance.getDefault());
 
         final BmpHeaderInfo bhi = ic.bhi;
@@ -174,8 +171,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
     }
 
     @Override
-    public ImageInfo getImageInfo(final ByteSource byteSource, final BmpImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageInfo getImageInfo(final ByteSource byteSource, final BmpImagingParameters params) throws ImagingException, IOException {
         BmpImageContents ic = null;
         try (InputStream is = byteSource.getInputStream()) {
             ic = readImageContents(is, FormatCompliance.getDefault());
@@ -211,9 +207,8 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         final int physicalHeightDpi = (int) Math.round(bhi.vResolution * .0254);
         final float physicalHeightInch = (float) ((double) height / (double) physicalHeightDpi);
 
-        final String formatDetails = "Bmp (" + (char) bhi.identifier1
-                + (char) bhi.identifier2 + ": "
-                + getBmpTypeDescription(bhi.identifier1, bhi.identifier2) + ")";
+        final String formatDetails = "Bmp (" + (char) bhi.identifier1 + (char) bhi.identifier2 + ": " + getBmpTypeDescription(bhi.identifier1, bhi.identifier2)
+                + ")";
 
         final boolean transparent = false;
 
@@ -221,16 +216,12 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         final ImageInfo.ColorType colorType = ImageInfo.ColorType.RGB;
         final ImageInfo.CompressionAlgorithm compressionAlgorithm = ImageInfo.CompressionAlgorithm.RLE;
 
-        return new ImageInfo(formatDetails, bitsPerPixel, comments,
-                format, name, height, mimeType, numberOfImages,
-                physicalHeightDpi, physicalHeightInch, physicalWidthDpi,
-                physicalWidthInch, width, progressive, transparent,
-                usesPalette, colorType, compressionAlgorithm);
+        return new ImageInfo(formatDetails, bitsPerPixel, comments, format, name, height, mimeType, numberOfImages, physicalHeightDpi, physicalHeightInch,
+                physicalWidthDpi, physicalWidthInch, width, progressive, transparent, usesPalette, colorType, compressionAlgorithm);
     }
 
     @Override
-    public Dimension getImageSize(final ByteSource byteSource, final BmpImagingParameters params)
-            throws ImagingException, IOException {
+    public Dimension getImageSize(final ByteSource byteSource, final BmpImagingParameters params) throws ImagingException, IOException {
         final BmpHeaderInfo bhi = readBmpHeaderInfo(byteSource);
 
         return new Dimension(bhi.width, bhi.height);
@@ -281,10 +272,10 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
                     break;
                 default: {
                     int size = b / rleSamplesPerByte;
-                    if ((b % rleSamplesPerByte) > 0) {
+                    if (b % rleSamplesPerByte > 0) {
                         size++;
                     }
-                    if ((size % 2) != 0) {
+                    if (size % 2 != 0) {
                         size++;
                     }
 
@@ -294,8 +285,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
                     // RLESamplesPerByte);
                     // System.out.println("xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                     // );
-                    final byte[] bytes = readBytes("bytes", is, size,
-                            "RLE: Absolute Mode");
+                    final byte[] bytes = readBytes("bytes", is, size, "RLE: Absolute Mode");
                     baos.write(bytes);
                 }
                     break;
@@ -313,9 +303,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         }
     }
 
-    private BmpHeaderInfo readBmpHeaderInfo(final InputStream is,
-            final FormatCompliance formatCompliance)
-            throws ImagingException, IOException {
+    private BmpHeaderInfo readBmpHeaderInfo(final InputStream is, final FormatCompliance formatCompliance) throws ImagingException, IOException {
         final byte identifier1 = readByte("Identifier1", is, "Not a Valid BMP File");
         final byte identifier2 = readByte("Identifier2", is, "Not a Valid BMP File");
 
@@ -454,23 +442,17 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
             }
         }
 
-        return new BmpHeaderInfo(identifier1, identifier2,
-                fileSize, reserved, bitmapDataOffset, bitmapHeaderSize, width,
-                height, planes, bitsPerPixel, compression, bitmapDataSize,
-                hResolution, vResolution, colorsUsed, colorsImportant, redMask,
-                greenMask, blueMask, alphaMask, colorSpaceType, colorSpace,
-                gammaRed, gammaGreen, gammaBlue, intent, profileData,
-                profileSize, reservedV5);
+        return new BmpHeaderInfo(identifier1, identifier2, fileSize, reserved, bitmapDataOffset, bitmapHeaderSize, width, height, planes, bitsPerPixel,
+                compression, bitmapDataSize, hResolution, vResolution, colorsUsed, colorsImportant, redMask, greenMask, blueMask, alphaMask, colorSpaceType,
+                colorSpace, gammaRed, gammaGreen, gammaBlue, intent, profileData, profileSize, reservedV5);
     }
 
-    private BmpImageContents readImageContents(final InputStream is,
-            final FormatCompliance formatCompliance)
-            throws ImagingException, IOException {
+    private BmpImageContents readImageContents(final InputStream is, final FormatCompliance formatCompliance) throws ImagingException, IOException {
         final BmpHeaderInfo bhi = readBmpHeaderInfo(is, formatCompliance);
 
         int colorTableSize = bhi.colorsUsed;
         if (colorTableSize == 0) {
-            colorTableSize = (1 << bhi.bitsPerPixel);
+            colorTableSize = 1 << bhi.bitsPerPixel;
         }
 
         if (LOGGER.isLoggable(Level.FINE)) {
@@ -542,8 +524,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
             break;
 
         default:
-            throw new ImagingException("BMP: Unknown Compression: "
-                    + bhi.compression);
+            throw new ImagingException("BMP: Unknown Compression: " + bhi.compression);
         }
 
         if (paletteLength < 0) {
@@ -552,17 +533,15 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
 
         byte[] colorTable = null;
         if (paletteLength > 0) {
-            colorTable = readBytes("ColorTable", is, paletteLength,
-                    "Not a Valid BMP File");
+            colorTable = readBytes("ColorTable", is, paletteLength, "Not a Valid BMP File");
         }
 
         if (LOGGER.isLoggable(Level.FINE)) {
             debugNumber("paletteLength", paletteLength, 4);
-            LOGGER.fine("ColorTable: "
-                    + ((colorTable == null) ? "null" : Integer.toString(colorTable.length)));
+            LOGGER.fine("ColorTable: " + (colorTable == null ? "null" : Integer.toString(colorTable.length)));
         }
 
-        int imageLineLength = (((bhi.bitsPerPixel) * bhi.width) + 7) / 8;
+        int imageLineLength = (bhi.bitsPerPixel * bhi.width + 7) / 8;
 
         if (LOGGER.isLoggable(Level.FINE)) {
             final int pixelCount = bhi.width * bhi.height;
@@ -578,14 +557,11 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
             debugNumber("PixelCount", pixelCount, 4);
         }
         // int ImageLineLength = BytesPerPixel * bhi.Width;
-        while ((imageLineLength % 4) != 0) {
+        while (imageLineLength % 4 != 0) {
             imageLineLength++;
         }
 
-        final int headerSize = BITMAP_FILE_HEADER_SIZE
-                + bhi.bitmapHeaderSize
-                + (bhi.bitmapHeaderSize == 40
-                        && bhi.compression == BI_BITFIELDS ? 3 * 4 : 0);
+        final int headerSize = BITMAP_FILE_HEADER_SIZE + bhi.bitmapHeaderSize + (bhi.bitmapHeaderSize == 40 && bhi.compression == BI_BITFIELDS ? 3 * 4 : 0);
         final int expectedDataOffset = headerSize + paletteLength;
 
         if (LOGGER.isLoggable(Level.FINE)) {
@@ -594,10 +570,8 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         }
         final int extraBytes = bhi.bitmapDataOffset - expectedDataOffset;
         if (extraBytes < 0) {
-            throw new ImagingException("BMP has invalid image data offset: "
-                    + bhi.bitmapDataOffset + " (expected: "
-                    + expectedDataOffset + ", paletteLength: " + paletteLength
-                    + ", headerSize: " + headerSize + ")");
+            throw new ImagingException("BMP has invalid image data offset: " + bhi.bitmapDataOffset + " (expected: " + expectedDataOffset + ", paletteLength: "
+                    + paletteLength + ", headerSize: " + headerSize + ")");
         }
         if (extraBytes > 0) {
             readBytes("BitmapDataOffset", is, extraBytes, "Not a Valid BMP File");
@@ -613,8 +587,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         if (rle) {
             imageData = getRleBytes(is, rleSamplesPerByte);
         } else {
-            imageData = readBytes("ImageData", is, imageDataSize,
-                    "Not a Valid BMP File");
+            imageData = readBytes("ImageData", is, imageDataSize, "Not a Valid BMP File");
         }
 
         if (LOGGER.isLoggable(Level.FINE)) {
@@ -635,8 +608,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
             abstractPixelParser = new PixelParserBitFields(bhi, colorTable, imageData);
             break;
         default:
-            throw new ImagingException("BMP: Unknown Compression: "
-                    + bhi.compression);
+            throw new ImagingException("BMP: Unknown Compression: " + bhi.compression);
         }
 
         return new BmpImageContents(bhi, colorTable, imageData, abstractPixelParser);
@@ -649,8 +621,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         }
         final PixelDensity pixelDensity = params.getPixelDensity();
 
-        final SimplePalette palette = new PaletteFactory().makeExactRgbPaletteSimple(
-                src, 256);
+        final SimplePalette palette = new PaletteFactory().makeExactRgbPaletteSimple(src, 256);
 
         BmpWriter writer;
         if (palette == null) {
@@ -672,8 +643,7 @@ public class BmpImageParser extends AbstractImageParser<BmpImagingParameters> {
         bos.write4Bytes(fileSize);
 
         bos.write4Bytes(0); // reserved
-        bos.write4Bytes(BITMAP_FILE_HEADER_SIZE + BITMAP_INFO_HEADER_SIZE
-                + 4 * writer.getPaletteSize()); // Bitmap Data Offset
+        bos.write4Bytes(BITMAP_FILE_HEADER_SIZE + BITMAP_INFO_HEADER_SIZE + 4 * writer.getPaletteSize()); // Bitmap Data Offset
 
         final int width = src.getWidth();
         final int height = src.getHeight();
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java
index 9a863a59..760e3595 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterPalette.java
@@ -68,7 +68,7 @@ final class BmpWriterPalette implements BmpWriter {
                     byteCount++;
                 } else {
                     // 4 or 1
-                    bitCache = (bitCache << bitsPerSample) | index;
+                    bitCache = bitCache << bitsPerSample | index;
                     bitsInCache += bitsPerSample;
                     if (bitsInCache >= 8) {
                         baos.write(0xff & bitCache);
@@ -80,7 +80,7 @@ final class BmpWriterPalette implements BmpWriter {
             }
 
             if (bitsInCache > 0) {
-                bitCache = (bitCache << (8 - bitsInCache));
+                bitCache = bitCache << 8 - bitsInCache;
 
                 baos.write(0xff & bitCache);
                 byteCount++;
@@ -88,7 +88,7 @@ final class BmpWriterPalette implements BmpWriter {
                 bitsInCache = 0;
             }
 
-            while ((byteCount % 4) != 0) {
+            while (byteCount % 4 != 0) {
                 baos.write(0);
                 byteCount++;
             }
@@ -107,9 +107,9 @@ final class BmpWriterPalette implements BmpWriter {
         for (int i = 0; i < palette.length(); i++) {
             final int rgb = palette.getEntry(i);
 
-            final int red = 0xff & (rgb >> 16);
-            final int green = 0xff & (rgb >> 8);
-            final int blue = 0xff & (rgb >> 0);
+            final int red = 0xff & rgb >> 16;
+            final int green = 0xff & rgb >> 8;
+            final int blue = 0xff & rgb >> 0;
 
             bos.write(blue);
             bos.write(green);
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java
index d8e513ec..e7119b19 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgb.java
@@ -52,16 +52,16 @@ final class BmpWriterRgb implements BmpWriter {
                 final int argb = src.getRGB(x, y);
                 final int rgb = 0xffffff & argb;
 
-                final int red = 0xff & (rgb >> 16);
-                final int green = 0xff & (rgb >> 8);
-                final int blue = 0xff & (rgb >> 0);
+                final int red = 0xff & rgb >> 16;
+                final int green = 0xff & rgb >> 8;
+                final int blue = 0xff & rgb >> 0;
 
                 baos.write(blue);
                 baos.write(green);
                 baos.write(red);
                 bytecount += 3;
             }
-            while ((bytecount % 4) != 0) {
+            while (bytecount % 4 != 0) {
                 baos.write(0);
                 bytecount++;
             }
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
index 233c5a7a..0c916ecc 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserBitFields.java
@@ -51,7 +51,7 @@ final class PixelParserBitFields extends AbstractPixelParserSimple {
         redShift = getMaskShift(redMask);
         greenShift = getMaskShift(greenMask);
         blueShift = getMaskShift(blueMask);
-        alphaShift = (alphaMask != 0 ? getMaskShift(alphaMask) : 0);
+        alphaShift = alphaMask != 0 ? getMaskShift(alphaMask) : 0;
     }
 
     private int getMaskShift(int mask) {
@@ -62,14 +62,14 @@ final class PixelParserBitFields extends AbstractPixelParserSimple {
         int trailingZeroes = 0;
 
         while ((0x1 & mask) == 0) {
-            mask = 0x7fffffff & (mask >> 1);
+            mask = 0x7fffffff & mask >> 1;
             trailingZeroes++;
         }
 
         int maskLength = 0;
 
         while ((0x1 & mask) == 1) {
-            mask = 0x7fffffff & (mask >> 1);
+            mask = 0x7fffffff & mask >> 1;
             maskLength++;
         }
 
@@ -101,22 +101,22 @@ final class PixelParserBitFields extends AbstractPixelParserSimple {
             throw new ImagingException("Unknown BitsPerPixel: " + bhi.bitsPerPixel);
         }
 
-        int red = (redMask & data);
-        int green = (greenMask & data);
-        int blue = (blueMask & data);
-        int alpha = (alphaMask != 0 ? alphaMask & data : 0xff);
+        int red = redMask & data;
+        int green = greenMask & data;
+        int blue = blueMask & data;
+        int alpha = alphaMask != 0 ? alphaMask & data : 0xff;
 
-        red = (redShift >= 0) ? red >> redShift : red << -redShift;
-        green = (greenShift >= 0) ? green >> greenShift : green << -greenShift;
-        blue = (blueShift >= 0) ? blue >> blueShift : blue << -blueShift;
-        alpha = (alphaShift >= 0) ? alpha >> alphaShift : alpha << -alphaShift;
+        red = redShift >= 0 ? red >> redShift : red << -redShift;
+        green = greenShift >= 0 ? green >> greenShift : green << -greenShift;
+        blue = blueShift >= 0 ? blue >> blueShift : blue << -blueShift;
+        alpha = alphaShift >= 0 ? alpha >> alphaShift : alpha << -alphaShift;
 
-        return (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+        return alpha << 24 | red << 16 | green << 8 | blue << 0;
     }
 
     @Override
     public void newline() throws ImagingException, IOException {
-        while ((byteCount % 4) != 0) {
+        while (byteCount % 4 != 0) {
             readByte("Pixel", is, "BMP Image Data");
             byteCount++;
         }
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
index 9646e431..4fc6f2c6 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRgb.java
@@ -42,17 +42,16 @@ final class PixelParserRgb extends AbstractPixelParserSimple {
         case 4: {
             if (cachedBitCount < bhi.bitsPerPixel) {
                 if (cachedBitCount != 0) {
-                    throw new ImagingException("Unexpected leftover bits: "
-                            + cachedBitCount + "/" + bhi.bitsPerPixel);
+                    throw new ImagingException("Unexpected leftover bits: " + cachedBitCount + "/" + bhi.bitsPerPixel);
                 }
 
                 cachedBitCount += 8;
-                cachedByte = (0xff & imageData[byteCount]);
+                cachedByte = 0xff & imageData[byteCount];
                 byteCount++;
             }
             final int cacheMask = (1 << bhi.bitsPerPixel) - 1;
-            final int sample = cacheMask & (cachedByte >> (8 - bhi.bitsPerPixel));
-            cachedByte = 0xff & (cachedByte << bhi.bitsPerPixel);
+            final int sample = cacheMask & cachedByte >> 8 - bhi.bitsPerPixel;
+            cachedByte = 0xff & cachedByte << bhi.bitsPerPixel;
             cachedBitCount -= bhi.bitsPerPixel;
             return getColorTableRgb(sample);
         }
@@ -64,11 +63,11 @@ final class PixelParserRgb extends AbstractPixelParserSimple {
         }
         case 16: {
             final int data = read2Bytes("Pixel", is, "BMP Image Data", ByteOrder.LITTLE_ENDIAN);
-            final int blue = (0x1f & (data >> 0)) << 3;
-            final int green = (0x1f & (data >> 5)) << 3;
-            final int red = (0x1f & (data >> 10)) << 3;
+            final int blue = (0x1f & data >> 0) << 3;
+            final int green = (0x1f & data >> 5) << 3;
+            final int red = (0x1f & data >> 10) << 3;
             final int alpha = 0xff;
-            final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+            final int rgb = alpha << 24 | red << 16 | green << 8 | blue << 0;
             byteCount += 2;
             return rgb;
         }
@@ -77,7 +76,7 @@ final class PixelParserRgb extends AbstractPixelParserSimple {
             final int green = 0xff & imageData[byteCount + 1];
             final int red = 0xff & imageData[byteCount + 2];
             final int alpha = 0xff;
-            final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+            final int rgb = alpha << 24 | red << 16 | green << 8 | blue << 0;
             byteCount += 3;
             return rgb;
         }
@@ -86,7 +85,7 @@ final class PixelParserRgb extends AbstractPixelParserSimple {
             final int green = 0xff & imageData[byteCount + 1];
             final int red = 0xff & imageData[byteCount + 2];
             final int alpha = 0xff;
-            final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+            final int rgb = alpha << 24 | red << 16 | green << 8 | blue << 0;
             byteCount += 4;
             return rgb;
         }
@@ -94,15 +93,14 @@ final class PixelParserRgb extends AbstractPixelParserSimple {
             break;
         }
 
-        throw new ImagingException("Unknown BitsPerPixel: "
-                + bhi.bitsPerPixel);
+        throw new ImagingException("Unknown BitsPerPixel: " + bhi.bitsPerPixel);
     }
 
     @Override
     public void newline() throws ImagingException, IOException {
         cachedBitCount = 0;
 
-        while (((byteCount) % 4) != 0) {
+        while (byteCount % 4 != 0) {
             readByte("Pixel", is, "BMP Image Data");
             byteCount++;
         }
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
index 6d03d144..b977645a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/PixelParserRle.java
@@ -45,8 +45,7 @@ final class PixelParserRle extends AbstractPixelParser {
             rgbs[1] = getColorTableRgb(sample2);
             // pixels_written = 2;
         } else {
-            throw new ImagingException("BMP RLE: bad BitsPerPixel: "
-                    + bhi.bitsPerPixel);
+            throw new ImagingException("BMP RLE: bad BitsPerPixel: " + bhi.bitsPerPixel);
         }
 
         return rgbs;
@@ -59,17 +58,15 @@ final class PixelParserRle extends AbstractPixelParser {
         if (bhi.bitsPerPixel == 4) {
             return 2;
         }
-        throw new ImagingException("BMP RLE: bad BitsPerPixel: "
-                + bhi.bitsPerPixel);
+        throw new ImagingException("BMP RLE: bad BitsPerPixel: " + bhi.bitsPerPixel);
     }
 
-    private int processByteOfData(final int[] rgbs, final int repeat, int x, final int y,
-            final int width, final int height, final ImageBuilder imageBuilder) {
+    private int processByteOfData(final int[] rgbs, final int repeat, int x, final int y, final int width, final int height, final ImageBuilder imageBuilder) {
         // int rbg
         int pixelsWritten = 0;
         for (int i = 0; i < repeat; i++) {
 
-            if ((x >= 0) && (x < width) && (y >= 0) && (y < height)) {
+            if (x >= 0 && x < width && y >= 0 && y < height) {
                 // int rgb = 0xff000000;
                 // rgb = getNextRGB();
                 final int rgb = rgbs[i % rgbs.length];
@@ -88,8 +85,7 @@ final class PixelParserRle extends AbstractPixelParser {
     }
 
     @Override
-    public void processImage(final ImageBuilder imageBuilder)
-            throws ImagingException, IOException {
+    public void processImage(final ImageBuilder imageBuilder) throws ImagingException, IOException {
         final int width = bhi.width;
         final int height = bhi.height;
         int x = 0;
@@ -122,10 +118,10 @@ final class PixelParserRle extends AbstractPixelParser {
                 default: {
                     final int samplesPerByte = getSamplesPerByte();
                     int size = b / samplesPerByte;
-                    if ((b % samplesPerByte) > 0) {
+                    if (b % samplesPerByte > 0) {
                         size++;
                     }
-                    if ((size % 2) != 0) {
+                    if (size % 2 != 0) {
                         size++;
                     }
 
@@ -138,15 +134,14 @@ final class PixelParserRle extends AbstractPixelParser {
                     int remaining = b;
 
                     for (int i = 0; remaining > 0; i++) {
-                    // for (int i = 0; i < bytes.length; i++)
+                        // for (int i = 0; i < bytes.length; i++)
                         final int[] samples = convertDataToSamples(0xff & bytes[i]);
                         final int towrite = Math.min(remaining, samplesPerByte);
                         // System.out.println("remaining: " + remaining);
                         // System.out.println("SamplesPerByte: "
                         // + SamplesPerByte);
                         // System.out.println("towrite: " + towrite);
-                        final int written = processByteOfData(samples, towrite, x, y,
-                                width, height, imageBuilder);
+                        final int written = processByteOfData(samples, towrite, x, y, width, height, imageBuilder);
                         // System.out.println("written: " + written);
                         // System.out.println("");
                         x += written;
@@ -158,8 +153,7 @@ final class PixelParserRle extends AbstractPixelParser {
             } else {
                 final int[] rgbs = convertDataToSamples(b);
 
-                x += processByteOfData(rgbs, a, x, y, width, height,
-                        imageBuilder);
+                x += processByteOfData(rgbs, a, x, y, width, height, imageBuilder);
             }
         }
     }
diff --git a/src/main/java/org/apache/commons/imaging/formats/bmp/package-info.java b/src/main/java/org/apache/commons/imaging/formats/bmp/package-info.java
index 138a8a4b..bcb99219 100644
--- a/src/main/java/org/apache/commons/imaging/formats/bmp/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/formats/bmp/package-info.java
@@ -19,4 +19,3 @@
  * The BMP image format.
  */
 package org.apache.commons.imaging.formats.bmp;
-
diff --git a/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java b/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
index 6b3090a1..326a241b 100644
--- a/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java
@@ -59,6 +59,7 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
             pw.println();
         }
     }
+
     // See [BROEKN URL] http://www.fileformat.fine/format/pcx/egff.htm for documentation
     private static final String DEFAULT_EXTENSION = ImageFormats.DCX.getDefaultExtension();
 
@@ -69,8 +70,7 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
     }
 
     @Override
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         readDcxHeader(byteSource).dump(pw);
         return true;
     }
@@ -86,17 +86,14 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
     }
 
     @Override
-    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource) throws ImagingException, IOException {
         final DcxHeader dcxHeader = readDcxHeader(byteSource);
         final List<BufferedImage> images = new ArrayList<>();
         final PcxImageParser pcxImageParser = new PcxImageParser();
         for (final long element : dcxHeader.pageTable) {
             try (InputStream stream = byteSource.getInputStream(element)) {
-                final ByteSource pcxSource = ByteSource.inputStream(
-                        stream, null);
-                final BufferedImage image = pcxImageParser.getBufferedImage(
-                        pcxSource, new PcxImagingParameters());
+                final ByteSource pcxSource = ByteSource.inputStream(stream, null);
+                final BufferedImage image = pcxImageParser.getBufferedImage(pcxSource, new PcxImagingParameters());
                 images.add(image);
             }
         }
@@ -104,8 +101,7 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
     }
 
     @Override
-    public final BufferedImage getBufferedImage(final ByteSource byteSource,
-            final PcxImagingParameters params) throws ImagingException, IOException {
+    public final BufferedImage getBufferedImage(final ByteSource byteSource, final PcxImagingParameters params) throws ImagingException, IOException {
         final List<BufferedImage> list = getAllBufferedImages(byteSource);
         return list.isEmpty() ? null : list.get(0);
     }
@@ -122,29 +118,25 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
 
     // FIXME should throw UOE
     @Override
-    public byte[] getIccProfileBytes(final ByteSource byteSource, final PcxImagingParameters params)
-            throws ImagingException, IOException {
+    public byte[] getIccProfileBytes(final ByteSource byteSource, final PcxImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     // FIXME should throw UOE
     @Override
-    public ImageInfo getImageInfo(final ByteSource byteSource, final PcxImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageInfo getImageInfo(final ByteSource byteSource, final PcxImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     // FIXME should throw UOE
     @Override
-    public Dimension getImageSize(final ByteSource byteSource, final PcxImagingParameters params)
-            throws ImagingException, IOException {
+    public Dimension getImageSize(final ByteSource byteSource, final PcxImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     // FIXME should throw UOE
     @Override
-    public ImageMetadata getMetadata(final ByteSource byteSource, final PcxImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageMetadata getMetadata(final ByteSource byteSource, final PcxImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
@@ -153,8 +145,7 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
         return "Dcx-Custom";
     }
 
-    private DcxHeader readDcxHeader(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    private DcxHeader readDcxHeader(final ByteSource byteSource) throws ImagingException, IOException {
         try (InputStream is = byteSource.getInputStream()) {
             final int id = read4Bytes("Id", is, "Not a Valid DCX File", getByteOrder());
             final int size = 1024;
@@ -180,8 +171,7 @@ public class DcxImageParser extends AbstractImageParser<PcxImagingParameters> {
     }
 
     @Override
-    public void writeImage(final BufferedImage src, final OutputStream os, final PcxImagingParameters params)
-            throws ImagingException, IOException {
+    public void writeImage(final BufferedImage src, final OutputStream os, final PcxImagingParameters params) throws ImagingException, IOException {
         final int headerSize = 4 + 1024 * 4;
 
         final BinaryOutputStream bos = BinaryOutputStream.littleEndian(os);
diff --git a/src/main/java/org/apache/commons/imaging/formats/dcx/package-info.java b/src/main/java/org/apache/commons/imaging/formats/dcx/package-info.java
index 9c4706c3..1e19aec8 100644
--- a/src/main/java/org/apache/commons/imaging/formats/dcx/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/formats/dcx/package-info.java
@@ -19,4 +19,3 @@
  * The DCX image format.
  */
 package org.apache.commons.imaging.formats.dcx;
-
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/DisposalMethod.java b/src/main/java/org/apache/commons/imaging/formats/gif/DisposalMethod.java
index b957560d..d8070581 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/DisposalMethod.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/DisposalMethod.java
@@ -17,8 +17,8 @@
 package org.apache.commons.imaging.formats.gif;
 
 /**
- * Describes the disposal of a GIF frame when rendering the animation. Frames that aren't disposed can show through
- * transparent pixels of coming frames. This allows new layers to contain just the part of the animation that changes.
+ * Describes the disposal of a GIF frame when rendering the animation. Frames that aren't disposed can show through transparent pixels of coming frames. This
+ * allows new layers to contain just the part of the animation that changes.
  */
 public enum DisposalMethod {
 
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/GifHeaderInfo.java b/src/main/java/org/apache/commons/imaging/formats/gif/GifHeaderInfo.java
index 90b67411..69fe115b 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/GifHeaderInfo.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/GifHeaderInfo.java
@@ -34,12 +34,9 @@ final class GifHeaderInfo {
     public final boolean sortFlag;
     public final byte sizeOfGlobalColorTable;
 
-    GifHeaderInfo(final byte identifier1, final byte identifier2, final byte identifier3,
-            final byte version1, final byte version2, final byte version3,
-            final int logicalScreenWidth, final int logicalScreenHeight, final byte packedFields,
-            final byte backgroundColorIndex, final byte pixelAspectRatio,
-            final boolean globalColorTableFlag, final byte colorResolution,
-            final boolean sortFlag, final byte sizeOfGlobalColorTable) {
+    GifHeaderInfo(final byte identifier1, final byte identifier2, final byte identifier3, final byte version1, final byte version2, final byte version3,
+            final int logicalScreenWidth, final int logicalScreenHeight, final byte packedFields, final byte backgroundColorIndex, final byte pixelAspectRatio,
+            final boolean globalColorTableFlag, final byte colorResolution, final boolean sortFlag, final byte sizeOfGlobalColorTable) {
         this.identifier1 = identifier1;
         this.identifier2 = identifier2;
         this.identifier3 = identifier3;
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/GifImageContents.java b/src/main/java/org/apache/commons/imaging/formats/gif/GifImageContents.java
index 88085af5..206c71bb 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/GifImageContents.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/GifImageContents.java
@@ -24,8 +24,7 @@ final class GifImageContents {
     final List<GifBlock> blocks;
     final byte[] globalColorTable;
 
-    GifImageContents(final GifHeaderInfo gifHeaderInfo, final byte[] globalColorTable,
-            final List<GifBlock> blocks) {
+    GifImageContents(final GifHeaderInfo gifHeaderInfo, final byte[] globalColorTable, final List<GifBlock> blocks) {
         this.gifHeaderInfo = gifHeaderInfo;
         this.globalColorTable = globalColorTable;
         this.blocks = blocks;
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java b/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
index 4d31aa37..f13a5e78 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java
@@ -64,51 +64,50 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     private static final byte[] GIF_HEADER_SIGNATURE = { 71, 73, 70 };
     private static final int EXTENSION_CODE = 0x21;
     private static final int IMAGE_SEPARATOR = 0x2C;
-    private static final int GRAPHIC_CONTROL_EXTENSION = (EXTENSION_CODE << 8) | 0xf9;
+    private static final int GRAPHIC_CONTROL_EXTENSION = EXTENSION_CODE << 8 | 0xf9;
     private static final int COMMENT_EXTENSION = 0xfe;
     private static final int PLAIN_TEXT_EXTENSION = 0x01;
     private static final int XMP_EXTENSION = 0xff;
     private static final int TERMINATOR_BYTE = 0x3b;
     private static final int APPLICATION_EXTENSION_LABEL = 0xff;
-    private static final int XMP_COMPLETE_CODE = (EXTENSION_CODE << 8) | XMP_EXTENSION;
+    private static final int XMP_COMPLETE_CODE = EXTENSION_CODE << 8 | XMP_EXTENSION;
     private static final int LOCAL_COLOR_TABLE_FLAG_MASK = 1 << 7;
     private static final int INTERLACE_FLAG_MASK = 1 << 6;
     private static final int SORT_FLAG_MASK = 1 << 5;
-    private static final byte[] XMP_APPLICATION_ID_AND_AUTH_CODE = {
-        0x58, // X
-        0x4D, // M
-        0x50, // P
-        0x20, //
-        0x44, // D
-        0x61, // a
-        0x74, // t
-        0x61, // a
-        0x58, // X
-        0x4D, // M
-        0x50, // P
+    private static final byte[] XMP_APPLICATION_ID_AND_AUTH_CODE = { 0x58, // X
+            0x4D, // M
+            0x50, // P
+            0x20, //
+            0x44, // D
+            0x61, // a
+            0x74, // t
+            0x61, // a
+            0x58, // X
+            0x4D, // M
+            0x50, // P
     };
 
     // Made internal for testability.
     static DisposalMethod createDisposalMethodFromIntValue(final int value) throws ImagingException {
         switch (value) {
-            case 0:
-                return DisposalMethod.UNSPECIFIED;
-            case 1:
-                return DisposalMethod.DO_NOT_DISPOSE;
-            case 2:
-                return DisposalMethod.RESTORE_TO_BACKGROUND;
-            case 3:
-                return DisposalMethod.RESTORE_TO_PREVIOUS;
-            case 4:
-                return DisposalMethod.TO_BE_DEFINED_1;
-            case 5:
-                return DisposalMethod.TO_BE_DEFINED_2;
-            case 6:
-                return DisposalMethod.TO_BE_DEFINED_3;
-            case 7:
-                return DisposalMethod.TO_BE_DEFINED_4;
-            default:
-                throw new ImagingException("GIF: Invalid parsing of disposal method");
+        case 0:
+            return DisposalMethod.UNSPECIFIED;
+        case 1:
+            return DisposalMethod.DO_NOT_DISPOSE;
+        case 2:
+            return DisposalMethod.RESTORE_TO_BACKGROUND;
+        case 3:
+            return DisposalMethod.RESTORE_TO_PREVIOUS;
+        case 4:
+            return DisposalMethod.TO_BE_DEFINED_1;
+        case 5:
+            return DisposalMethod.TO_BE_DEFINED_2;
+        case 6:
+            return DisposalMethod.TO_BE_DEFINED_3;
+        case 7:
+            return DisposalMethod.TO_BE_DEFINED_4;
+        default:
+            throw new ImagingException("GIF: Invalid parsing of disposal method");
         }
     }
 
@@ -121,8 +120,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     @Override
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         pw.println("gif.dumpImageFile");
 
         final ImageInfo imageData = getImageInfo(byteSource);
@@ -137,9 +135,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         pw.println("gif.blocks: " + blocks.blocks.size());
         for (int i = 0; i < blocks.blocks.size(); i++) {
             final GifBlock gifBlock = blocks.blocks.get(i);
-            this.debugNumber(pw, "\t" + i + " ("
-                    + gifBlock.getClass().getName() + ")",
-                    gifBlock.blockCode, 4);
+            this.debugNumber(pw, "\t" + i + " (" + gifBlock.getClass().getName() + ")", gifBlock.blockCode, 4);
         }
 
         pw.println("");
@@ -148,8 +144,8 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     /**
-     * See {@link GifImageParser#readBlocks} for reference how the blocks are created. They should match
-     * the code we are giving here, returning the correct class type. Internal only.
+     * See {@link GifImageParser#readBlocks} for reference how the blocks are created. They should match the code we are giving here, returning the correct
+     * class type. Internal only.
      */
     @SuppressWarnings("unchecked")
     private <T extends GifBlock> List<T> findAllBlocks(final List<GifBlock> blocks, final int code) {
@@ -200,15 +196,13 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     private GifImageData findFirstImageData(final GifImageContents imageContents) throws ImagingException {
-        final ImageDescriptor descriptor = (ImageDescriptor) findBlock(imageContents.blocks,
-                IMAGE_SEPARATOR);
+        final ImageDescriptor descriptor = (ImageDescriptor) findBlock(imageContents.blocks, IMAGE_SEPARATOR);
 
         if (descriptor == null) {
             throw new ImagingException("GIF: Couldn't read Image Descriptor");
         }
 
-        final GraphicControlExtension gce = (GraphicControlExtension) findBlock(
-                imageContents.blocks, GRAPHIC_CONTROL_EXTENSION);
+        final GraphicControlExtension gce = (GraphicControlExtension) findBlock(imageContents.blocks, GRAPHIC_CONTROL_EXTENSION);
 
         return new GifImageData(descriptor, gce);
     }
@@ -225,8 +219,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     @Override
-    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource) throws ImagingException, IOException {
         final GifImageContents imageContents = readFile(byteSource, false);
 
         final GifHeaderInfo ghi = imageContents.gifHeaderInfo;
@@ -243,8 +236,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     @Override
-    public BufferedImage getBufferedImage(final ByteSource byteSource, final GifImagingParameters params)
-            throws ImagingException, IOException {
+    public BufferedImage getBufferedImage(final ByteSource byteSource, final GifImagingParameters params) throws ImagingException, IOException {
         final GifImageContents imageContents = readFile(byteSource, false);
 
         final GifHeaderInfo ghi = imageContents.gifHeaderInfo;
@@ -291,7 +283,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         final int rowsInPass1 = (height + 7) / 8;
         final int rowsInPass2 = (height + 3) / 8;
         final int rowsInPass3 = (height + 1) / 4;
-        final int rowsInPass4 = (height) / 2;
+        final int rowsInPass4 = height / 2;
 
         for (int row = 0; row < height; row++) {
             int y;
@@ -301,18 +293,18 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                     y = theRow * 8;
                 } else {
                     theRow -= rowsInPass1;
-                    if (theRow < (rowsInPass2)) {
-                        y = 4 + (theRow * 8);
+                    if (theRow < rowsInPass2) {
+                        y = 4 + theRow * 8;
                     } else {
                         theRow -= rowsInPass2;
-                        if (theRow < (rowsInPass3)) {
-                            y = 2 + (theRow * 4);
+                        if (theRow < rowsInPass3) {
+                            y = 2 + theRow * 4;
                         } else {
                             theRow -= rowsInPass3;
-                            if (theRow >= (rowsInPass4)) {
+                            if (theRow >= rowsInPass4) {
                                 throw new ImagingException("Gif: Strange Row");
                             }
-                            y = 1 + (theRow * 2);
+                            y = 1 + theRow * 2;
                         }
                     }
                 }
@@ -343,22 +335,21 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     private int[] getColorTable(final byte[] bytes) throws ImagingException {
-        if ((bytes.length % 3) != 0) {
-            throw new ImagingException("Bad Color Table Length: "
-                    + bytes.length);
+        if (bytes.length % 3 != 0) {
+            throw new ImagingException("Bad Color Table Length: " + bytes.length);
         }
         final int length = bytes.length / 3;
 
         final int[] result = Allocator.intArray(length);
 
         for (int i = 0; i < length; i++) {
-            final int red = 0xff & bytes[(i * 3) + 0];
-            final int green = 0xff & bytes[(i * 3) + 1];
-            final int blue = 0xff & bytes[(i * 3) + 2];
+            final int red = 0xff & bytes[i * 3 + 0];
+            final int green = 0xff & bytes[i * 3 + 1];
+            final int blue = 0xff & bytes[i * 3 + 2];
 
             final int alpha = 0xff;
 
-            final int rgb = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+            final int rgb = alpha << 24 | red << 16 | green << 8 | blue << 0;
             result[i] = rgb;
         }
 
@@ -390,10 +381,8 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     @Override
-    public FormatCompliance getFormatCompliance(final ByteSource byteSource)
-            throws ImagingException, IOException {
-        final FormatCompliance result = new FormatCompliance(
-                byteSource.toString());
+    public FormatCompliance getFormatCompliance(final ByteSource byteSource) throws ImagingException, IOException {
+        final FormatCompliance result = new FormatCompliance(byteSource.toString());
 
         readFile(byteSource, false, result);
 
@@ -401,14 +390,12 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     @Override
-    public byte[] getIccProfileBytes(final ByteSource byteSource, final GifImagingParameters params)
-            throws ImagingException, IOException {
+    public byte[] getIccProfileBytes(final ByteSource byteSource, final GifImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     @Override
-    public ImageInfo getImageInfo(final ByteSource byteSource, final GifImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageInfo getImageInfo(final ByteSource byteSource, final GifImagingParameters params) throws ImagingException, IOException {
         final GifImageContents blocks = readFile(byteSource, GifImagingParameters.getStopReadingBeforeImageData(params));
 
         final GifHeaderInfo bhi = blocks.gifHeaderInfo;
@@ -416,20 +403,18 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
             throw new ImagingException("GIF: Couldn't read Header");
         }
 
-        final ImageDescriptor id = (ImageDescriptor) findBlock(blocks.blocks,
-                IMAGE_SEPARATOR);
+        final ImageDescriptor id = (ImageDescriptor) findBlock(blocks.blocks, IMAGE_SEPARATOR);
         if (id == null) {
             throw new ImagingException("GIF: Couldn't read ImageDescriptor");
         }
 
-        final GraphicControlExtension gce = (GraphicControlExtension) findBlock(
-                blocks.blocks, GRAPHIC_CONTROL_EXTENSION);
+        final GraphicControlExtension gce = (GraphicControlExtension) findBlock(blocks.blocks, GRAPHIC_CONTROL_EXTENSION);
 
         final int height = bhi.logicalScreenHeight;
         final int width = bhi.logicalScreenWidth;
 
         final List<String> comments = getComments(blocks.blocks);
-        final int bitsPerPixel = (bhi.colorResolution + 1);
+        final int bitsPerPixel = bhi.colorResolution + 1;
         final ImageFormat format = ImageFormats.GIF;
         final String formatName = "Graphics Interchange Format";
         final String mimeType = "image/gif";
@@ -443,9 +428,8 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         final int physicalHeightDpi = 72;
         final float physicalHeightInch = (float) ((double) height / (double) physicalHeightDpi);
 
-        final String formatDetails = "GIF " + ((char) blocks.gifHeaderInfo.version1)
-                + ((char) blocks.gifHeaderInfo.version2)
-                + ((char) blocks.gifHeaderInfo.version3);
+        final String formatDetails = "GIF " + (char) blocks.gifHeaderInfo.version1 + (char) blocks.gifHeaderInfo.version2
+                + (char) blocks.gifHeaderInfo.version3;
 
         boolean transparent = false;
         if (gce != null && gce.transparency) {
@@ -456,16 +440,12 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         final ImageInfo.ColorType colorType = ImageInfo.ColorType.RGB;
         final ImageInfo.CompressionAlgorithm compressionAlgorithm = ImageInfo.CompressionAlgorithm.LZW;
 
-        return new ImageInfo(formatDetails, bitsPerPixel, comments,
-                format, formatName, height, mimeType, numberOfImages,
-                physicalHeightDpi, physicalHeightInch, physicalWidthDpi,
-                physicalWidthInch, width, progressive, transparent,
-                usesPalette, colorType, compressionAlgorithm);
+        return new ImageInfo(formatDetails, bitsPerPixel, comments, format, formatName, height, mimeType, numberOfImages, physicalHeightDpi, physicalHeightInch,
+                physicalWidthDpi, physicalWidthInch, width, progressive, transparent, usesPalette, colorType, compressionAlgorithm);
     }
 
     @Override
-    public Dimension getImageSize(final ByteSource byteSource, final GifImagingParameters params)
-            throws ImagingException, IOException {
+    public Dimension getImageSize(final ByteSource byteSource, final GifImagingParameters params) throws ImagingException, IOException {
         final GifImageContents blocks = readFile(byteSource, false);
 
         final GifHeaderInfo bhi = blocks.gifHeaderInfo;
@@ -482,8 +462,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
     }
 
     @Override
-    public ImageMetadata getMetadata(final ByteSource byteSource, final GifImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageMetadata getMetadata(final ByteSource byteSource, final GifImagingParameters params) throws ImagingException, IOException {
         final GifImageContents imageContents = readFile(byteSource, GifImagingParameters.getStopReadingBeforeImageData(params));
 
         final GifHeaderInfo bhi = imageContents.gifHeaderInfo;
@@ -509,15 +488,12 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
      * Extracts embedded XML metadata as XML string.
      * <p>
      *
-     * @param byteSource
-     *            File containing image data.
-     * @param params
-     *            Map of optional parameters, defined in ImagingConstants.
+     * @param byteSource File containing image data.
+     * @param params     Map of optional parameters, defined in ImagingConstants.
      * @return Xmp Xml as String, if present. Otherwise, returns null.
      */
     @Override
-    public String getXmpXml(final ByteSource byteSource, final XmpImagingParameters<GifImagingParameters> params)
-            throws ImagingException, IOException {
+    public String getXmpXml(final ByteSource byteSource, final XmpImagingParameters<GifImagingParameters> params) throws ImagingException, IOException {
         try (InputStream is = byteSource.getInputStream()) {
             final GifHeaderInfo ghi = readHeader(is, null);
 
@@ -540,9 +516,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                     continue;
                 }
 
-                if (!compareBytes(blockBytes, 0,
-                        XMP_APPLICATION_ID_AND_AUTH_CODE, 0,
-                        XMP_APPLICATION_ID_AND_AUTH_CODE.length)) {
+                if (!compareBytes(blockBytes, 0, XMP_APPLICATION_ID_AND_AUTH_CODE, 0, XMP_APPLICATION_ID_AND_AUTH_CODE.length)) {
                     continue;
                 }
 
@@ -551,24 +525,16 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                     gifMagicTrailer[magic] = (byte) (0xff - magic);
                 }
 
-                if (blockBytes.length < XMP_APPLICATION_ID_AND_AUTH_CODE.length
-                        + gifMagicTrailer.length) {
+                if (blockBytes.length < XMP_APPLICATION_ID_AND_AUTH_CODE.length + gifMagicTrailer.length) {
                     continue;
                 }
-                if (!compareBytes(blockBytes, blockBytes.length
-                        - gifMagicTrailer.length, gifMagicTrailer, 0,
-                        gifMagicTrailer.length)) {
-                    throw new ImagingException(
-                            "XMP block in GIF missing magic trailer.");
+                if (!compareBytes(blockBytes, blockBytes.length - gifMagicTrailer.length, gifMagicTrailer, 0, gifMagicTrailer.length)) {
+                    throw new ImagingException("XMP block in GIF missing magic trailer.");
                 }
 
                 // XMP is UTF-8 encoded xml.
-                final String xml = new String(
-                        blockBytes,
-                        XMP_APPLICATION_ID_AND_AUTH_CODE.length,
-                        blockBytes.length
-                                - (XMP_APPLICATION_ID_AND_AUTH_CODE.length + gifMagicTrailer.length),
-                                StandardCharsets.UTF_8);
+                final String xml = new String(blockBytes, XMP_APPLICATION_ID_AND_AUTH_CODE.length,
+                        blockBytes.length - (XMP_APPLICATION_ID_AND_AUTH_CODE.length + gifMagicTrailer.length), StandardCharsets.UTF_8);
                 result.add(xml);
             }
 
@@ -582,8 +548,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         }
     }
 
-    private List<GifBlock> readBlocks(final GifHeaderInfo ghi, final InputStream is,
-            final boolean stopBeforeImageData, final FormatCompliance formatCompliance)
+    private List<GifBlock> readBlocks(final GifHeaderInfo ghi, final InputStream is, final boolean stopBeforeImageData, final FormatCompliance formatCompliance)
             throws ImagingException, IOException {
         final List<GifBlock> result = new ArrayList<>();
 
@@ -595,8 +560,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                 throw new ImagingException("GIF: unexpected end of data");
 
             case IMAGE_SEPARATOR:
-                final ImageDescriptor id = readImageDescriptor(ghi, code, is,
-                        stopBeforeImageData, formatCompliance);
+                final ImageDescriptor id = readImageDescriptor(ghi, code, is, stopBeforeImageData, formatCompliance);
                 result.add(id);
                 // if (stopBeforeImageData)
                 // return result;
@@ -605,20 +569,17 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
 
             case EXTENSION_CODE: {
                 final int extensionCode = is.read();
-                final int completeCode = ((0xff & code) << 8)
-                        | (0xff & extensionCode);
+                final int completeCode = (0xff & code) << 8 | 0xff & extensionCode;
 
                 switch (extensionCode) {
                 case 0xf9:
-                    final GraphicControlExtension gce = readGraphicControlExtension(
-                            completeCode, is);
+                    final GraphicControlExtension gce = readGraphicControlExtension(completeCode, is);
                     result.add(gce);
                     break;
 
                 case COMMENT_EXTENSION:
                 case PLAIN_TEXT_EXTENSION: {
-                    final GenericGifBlock block = readGenericGifBlock(is,
-                            completeCode);
+                    final GenericGifBlock block = readGenericGifBlock(is, completeCode);
                     result.add(block);
                     break;
                 }
@@ -629,15 +590,11 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                     final byte[] label = readSubBlock(is);
 
                     if (formatCompliance != null) {
-                        formatCompliance.addComment(
-                                "Unknown Application Extension ("
-                                        + new String(label, StandardCharsets.US_ASCII) + ")",
-                                completeCode);
+                        formatCompliance.addComment("Unknown Application Extension (" + new String(label, StandardCharsets.US_ASCII) + ")", completeCode);
                     }
 
                     if (label.length > 0) {
-                        final GenericGifBlock block = readGenericGifBlock(is,
-                                completeCode, label);
+                        final GenericGifBlock block = readGenericGifBlock(is, completeCode, label);
                         result.add(block);
                     }
                     break;
@@ -646,12 +603,10 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                 default: {
 
                     if (formatCompliance != null) {
-                        formatCompliance.addComment("Unknown block",
-                                completeCode);
+                        formatCompliance.addComment("Unknown block", completeCode);
                     }
 
-                    final GenericGifBlock block = readGenericGifBlock(is,
-                            completeCode);
+                    final GenericGifBlock block = readGenericGifBlock(is, completeCode);
                     result.add(block);
                     break;
                 }
@@ -677,39 +632,31 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         return readBytes("block", is, actualSize, "GIF: corrupt Color Table");
     }
 
-    private GifImageContents readFile(final ByteSource byteSource,
-            final boolean stopBeforeImageData) throws ImagingException, IOException {
-        return readFile(byteSource, stopBeforeImageData,
-                FormatCompliance.getDefault());
+    private GifImageContents readFile(final ByteSource byteSource, final boolean stopBeforeImageData) throws ImagingException, IOException {
+        return readFile(byteSource, stopBeforeImageData, FormatCompliance.getDefault());
     }
 
-    private GifImageContents readFile(final ByteSource byteSource,
-            final boolean stopBeforeImageData, final FormatCompliance formatCompliance)
+    private GifImageContents readFile(final ByteSource byteSource, final boolean stopBeforeImageData, final FormatCompliance formatCompliance)
             throws ImagingException, IOException {
         try (InputStream is = byteSource.getInputStream()) {
             final GifHeaderInfo ghi = readHeader(is, formatCompliance);
 
             byte[] globalColorTable = null;
             if (ghi.globalColorTableFlag) {
-                globalColorTable = readColorTable(is,
-                        ghi.sizeOfGlobalColorTable);
+                globalColorTable = readColorTable(is, ghi.sizeOfGlobalColorTable);
             }
 
-            final List<GifBlock> blocks = readBlocks(ghi, is, stopBeforeImageData,
-                    formatCompliance);
+            final List<GifBlock> blocks = readBlocks(ghi, is, stopBeforeImageData, formatCompliance);
 
-            return new GifImageContents(ghi, globalColorTable,
-                    blocks);
+            return new GifImageContents(ghi, globalColorTable, blocks);
         }
     }
 
-    private GenericGifBlock readGenericGifBlock(final InputStream is, final int code)
-            throws IOException {
+    private GenericGifBlock readGenericGifBlock(final InputStream is, final int code) throws IOException {
         return readGenericGifBlock(is, code, null);
     }
 
-    private GenericGifBlock readGenericGifBlock(final InputStream is, final int code,
-            final byte[] first) throws IOException {
+    private GenericGifBlock readGenericGifBlock(final InputStream is, final int code, final byte[] first) throws IOException {
         final List<byte[]> subBlocks = new ArrayList<>();
 
         if (first != null) {
@@ -727,27 +674,21 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         return new GenericGifBlock(code, subBlocks);
     }
 
-    private GraphicControlExtension readGraphicControlExtension(final int code,
-            final InputStream is) throws IOException {
+    private GraphicControlExtension readGraphicControlExtension(final int code, final InputStream is) throws IOException {
         readByte("block_size", is, "GIF: corrupt GraphicControlExt");
-        final int packed = readByte("packed fields", is,
-                "GIF: corrupt GraphicControlExt");
+        final int packed = readByte("packed fields", is, "GIF: corrupt GraphicControlExt");
 
         final int dispose = (packed & 0x1c) >> 2; // disposal method
         final boolean transparency = (packed & 1) != 0;
 
         final int delay = read2Bytes("delay in milliseconds", is, "GIF: corrupt GraphicControlExt", getByteOrder());
-        final int transparentColorIndex = 0xff & readByte("transparent color index",
-                is, "GIF: corrupt GraphicControlExt");
+        final int transparentColorIndex = 0xff & readByte("transparent color index", is, "GIF: corrupt GraphicControlExt");
         readByte("block terminator", is, "GIF: corrupt GraphicControlExt");
 
-        return new GraphicControlExtension(code, packed, dispose, transparency,
-                delay, transparentColorIndex);
+        return new GraphicControlExtension(code, packed, dispose, transparency, delay, transparentColorIndex);
     }
 
-    private GifHeaderInfo readHeader(final InputStream is,
-            final FormatCompliance formatCompliance) throws ImagingException,
-            IOException {
+    private GifHeaderInfo readHeader(final InputStream is, final FormatCompliance formatCompliance) throws ImagingException, IOException {
         final byte identifier1 = readByte("identifier1", is, "Not a Valid GIF File");
         final byte identifier2 = readByte("identifier2", is, "Not a Valid GIF File");
         final byte identifier3 = readByte("identifier3", is, "Not a Valid GIF File");
@@ -757,78 +698,62 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
         final byte version3 = readByte("version3", is, "Not a Valid GIF File");
 
         if (formatCompliance != null) {
-            formatCompliance.compareBytes("Signature", GIF_HEADER_SIGNATURE,
-                    new byte[] { identifier1, identifier2, identifier3 });
+            formatCompliance.compareBytes("Signature", GIF_HEADER_SIGNATURE, new byte[] { identifier1, identifier2, identifier3 });
             formatCompliance.compare("version", 56, version1);
             formatCompliance.compare("version", new int[] { 55, 57, }, version2);
             formatCompliance.compare("version", 97, version3);
         }
 
         if (LOGGER.isLoggable(Level.FINEST)) {
-            logCharQuad("identifier: ", ((identifier1 << 16)
-                    | (identifier2 << 8) | (identifier3 << 0)));
-            logCharQuad("version: ",
-                    ((version1 << 16) | (version2 << 8) | (version3 << 0)));
+            logCharQuad("identifier: ", identifier1 << 16 | identifier2 << 8 | identifier3 << 0);
+            logCharQuad("version: ", version1 << 16 | version2 << 8 | version3 << 0);
         }
 
         final int logicalScreenWidth = read2Bytes("Logical Screen Width", is, "Not a Valid GIF File", getByteOrder());
         final int logicalScreenHeight = read2Bytes("Logical Screen Height", is, "Not a Valid GIF File", getByteOrder());
 
         if (formatCompliance != null) {
-            formatCompliance.checkBounds("Width", 1, Integer.MAX_VALUE,
-                    logicalScreenWidth);
-            formatCompliance.checkBounds("Height", 1, Integer.MAX_VALUE,
-                    logicalScreenHeight);
+            formatCompliance.checkBounds("Width", 1, Integer.MAX_VALUE, logicalScreenWidth);
+            formatCompliance.checkBounds("Height", 1, Integer.MAX_VALUE, logicalScreenHeight);
         }
 
-        final byte packedFields = readByte("Packed Fields", is,
-                "Not a Valid GIF File");
-        final byte backgroundColorIndex = readByte("Background Color Index", is,
-                "Not a Valid GIF File");
-        final byte pixelAspectRatio = readByte("Pixel Aspect Ratio", is,
-                "Not a Valid GIF File");
+        final byte packedFields = readByte("Packed Fields", is, "Not a Valid GIF File");
+        final byte backgroundColorIndex = readByte("Background Color Index", is, "Not a Valid GIF File");
+        final byte pixelAspectRatio = readByte("Pixel Aspect Ratio", is, "Not a Valid GIF File");
 
         if (LOGGER.isLoggable(Level.FINEST)) {
             logByteBits("PackedFields bits", packedFields);
         }
 
-        final boolean globalColorTableFlag = ((packedFields & 128) > 0);
+        final boolean globalColorTableFlag = (packedFields & 128) > 0;
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest("GlobalColorTableFlag: " + globalColorTableFlag);
         }
-        final byte colorResolution = (byte) ((packedFields >> 4) & 7);
+        final byte colorResolution = (byte) (packedFields >> 4 & 7);
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest("ColorResolution: " + colorResolution);
         }
-        final boolean sortFlag = ((packedFields & 8) > 0);
+        final boolean sortFlag = (packedFields & 8) > 0;
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest("SortFlag: " + sortFlag);
         }
         final byte sizeofGlobalColorTable = (byte) (packedFields & 7);
         if (LOGGER.isLoggable(Level.FINEST)) {
-            LOGGER.finest("SizeofGlobalColorTable: "
-                    + sizeofGlobalColorTable);
+            LOGGER.finest("SizeofGlobalColorTable: " + sizeofGlobalColorTable);
         }
 
         if (formatCompliance != null) {
             if (globalColorTableFlag && backgroundColorIndex != -1) {
-                formatCompliance.checkBounds("Background Color Index", 0,
-                        convertColorTableSize(sizeofGlobalColorTable),
-                        backgroundColorIndex);
+                formatCompliance.checkBounds("Background Color Index", 0, convertColorTableSize(sizeofGlobalColorTable), backgroundColorIndex);
             }
         }
 
-        return new GifHeaderInfo(identifier1, identifier2, identifier3,
-                version1, version2, version3, logicalScreenWidth,
-                logicalScreenHeight, packedFields, backgroundColorIndex,
-                pixelAspectRatio, globalColorTableFlag, colorResolution,
-                sortFlag, sizeofGlobalColorTable);
+        return new GifHeaderInfo(identifier1, identifier2, identifier3, version1, version2, version3, logicalScreenWidth, logicalScreenHeight, packedFields,
+                backgroundColorIndex, pixelAspectRatio, globalColorTableFlag, colorResolution, sortFlag, sizeofGlobalColorTable);
     }
 
-    private ImageDescriptor readImageDescriptor(final GifHeaderInfo ghi,
-            final int blockCode, final InputStream is, final boolean stopBeforeImageData,
-            final FormatCompliance formatCompliance) throws ImagingException,
-            IOException {
+    private ImageDescriptor readImageDescriptor(final GifHeaderInfo ghi, final int blockCode, final InputStream is, final boolean stopBeforeImageData,
+            final FormatCompliance formatCompliance) throws ImagingException, IOException {
         final int imageLeftPosition = read2Bytes("Image Left Position", is, "Not a Valid GIF File", getByteOrder());
         final int imageTopPosition = read2Bytes("Image Top Position", is, "Not a Valid GIF File", getByteOrder());
         final int imageWidth = read2Bytes("Image Width", is, "Not a Valid GIF File", getByteOrder());
@@ -846,15 +771,15 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
             logByteBits("PackedFields bits", packedFields);
         }
 
-        final boolean localColorTableFlag = (((packedFields >> 7) & 1) > 0);
+        final boolean localColorTableFlag = (packedFields >> 7 & 1) > 0;
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest("LocalColorTableFlag: " + localColorTableFlag);
         }
-        final boolean interlaceFlag = (((packedFields >> 6) & 1) > 0);
+        final boolean interlaceFlag = (packedFields >> 6 & 1) > 0;
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest("Interlace Flag: " + interlaceFlag);
         }
-        final boolean sortFlag = (((packedFields >> 5) & 1) > 0);
+        final boolean sortFlag = (packedFields >> 5 & 1) > 0;
         if (LOGGER.isLoggable(Level.FINEST)) {
             LOGGER.finest("Sort Flag: " + sortFlag);
         }
@@ -878,8 +803,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
             final InputStream bais = new ByteArrayInputStream(bytes);
 
             final int size = imageWidth * imageHeight;
-            final MyLzwDecompressor myLzwDecompressor = new MyLzwDecompressor(
-                    lzwMinimumCodeSize, ByteOrder.LITTLE_ENDIAN, false);
+            final MyLzwDecompressor myLzwDecompressor = new MyLzwDecompressor(lzwMinimumCodeSize, ByteOrder.LITTLE_ENDIAN, false);
             imageData = myLzwDecompressor.decompress(bais, size);
         } else {
             final int LZWMinimumCodeSize = is.read();
@@ -890,10 +814,8 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
             readGenericGifBlock(is, -1);
         }
 
-        return new ImageDescriptor(blockCode,
-                imageLeftPosition, imageTopPosition, imageWidth, imageHeight,
-                packedFields, localColorTableFlag, interlaceFlag, sortFlag,
-                sizeOfLocalColorTable, localColorTable, imageData);
+        return new ImageDescriptor(blockCode, imageLeftPosition, imageTopPosition, imageWidth, imageHeight, packedFields, localColorTableFlag, interlaceFlag,
+                sortFlag, sizeOfLocalColorTable, localColorTable, imageData);
     }
 
     private byte[] readSubBlock(final InputStream is) throws IOException {
@@ -973,13 +895,10 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
             bos.write2Bytes(width);
             bos.write2Bytes(height);
 
-            final int colorTableScaleLessOne = (paletteSize > 128) ? 7
-                    : (paletteSize > 64) ? 6
-                            : (paletteSize > 32) ? 5
-                                    : (paletteSize > 16) ? 4
-                                            : (paletteSize > 8) ? 3 : (paletteSize > 4) ? 2 : (paletteSize > 2) ? 1 : 0;
+            final int colorTableScaleLessOne = paletteSize > 128 ? 7
+                    : paletteSize > 64 ? 6 : paletteSize > 32 ? 5 : paletteSize > 16 ? 4 : paletteSize > 8 ? 3 : paletteSize > 4 ? 2 : paletteSize > 2 ? 1 : 0;
 
-            final int colorTableSizeInFormat = 1 << (colorTableScaleLessOne + 1);
+            final int colorTableSizeInFormat = 1 << colorTableScaleLessOne + 1;
             {
                 final byte colorResolution = (byte) colorTableScaleLessOne; // TODO:
                 final int packedFields = (7 & colorResolution) * 16;
@@ -1053,11 +972,10 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
 
                     final int packedFields;
                     if (localColorTableFlag) {
-                        packedFields = (LOCAL_COLOR_TABLE_FLAG_MASK | (interlaceFlag ? INTERLACE_FLAG_MASK : 0)
-                                | (sortFlag ? SORT_FLAG_MASK : 0) | (7 & sizeOfLocalColorTable));
+                        packedFields = LOCAL_COLOR_TABLE_FLAG_MASK | (interlaceFlag ? INTERLACE_FLAG_MASK : 0) | (sortFlag ? SORT_FLAG_MASK : 0)
+                                | 7 & sizeOfLocalColorTable;
                     } else {
-                        packedFields = (0 | (interlaceFlag ? INTERLACE_FLAG_MASK : 0) | (sortFlag ? SORT_FLAG_MASK : 0)
-                                | (7 & sizeOfLocalColorTable));
+                        packedFields = 0 | (interlaceFlag ? INTERLACE_FLAG_MASK : 0) | (sortFlag ? SORT_FLAG_MASK : 0) | 7 & sizeOfLocalColorTable;
                     }
                     bos.write(packedFields); // one byte
                 }
@@ -1068,9 +986,9 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                     if (i < palette2.length()) {
                         final int rgb = palette2.getEntry(i);
 
-                        final int red = 0xff & (rgb >> 16);
-                        final int green = 0xff & (rgb >> 8);
-                        final int blue = 0xff & (rgb >> 0);
+                        final int red = 0xff & rgb >> 16;
+                        final int green = 0xff & rgb >> 8;
+                        final int blue = 0xff & rgb >> 0;
 
                         bos.write(red);
                         bos.write(green);
@@ -1099,8 +1017,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                 // here.
                 bos.write(lzwMinimumCodeSize);
 
-                final MyLzwCompressor compressor = new MyLzwCompressor(lzwMinimumCodeSize, ByteOrder.LITTLE_ENDIAN,
-                        false); // GIF
+                final MyLzwCompressor compressor = new MyLzwCompressor(lzwMinimumCodeSize, ByteOrder.LITTLE_ENDIAN, false); // GIF
                 // Mode);
 
                 final byte[] imageData = Allocator.byteArray(width * height);
@@ -1111,7 +1028,7 @@ public class GifImageParser extends AbstractImageParser<GifImagingParameters> im
                         int index;
 
                         if (hasAlpha) {
-                            final int alpha = 0xff & (argb >> 24);
+                            final int alpha = 0xff & argb >> 24;
                             final int alphaThreshold = 255;
                             if (alpha < alphaThreshold) {
                                 index = palette2.length(); // is transparent
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/GraphicControlExtension.java b/src/main/java/org/apache/commons/imaging/formats/gif/GraphicControlExtension.java
index fb14c80b..72182a08 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/GraphicControlExtension.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/GraphicControlExtension.java
@@ -24,8 +24,8 @@ final class GraphicControlExtension extends GifBlock {
     public final int delay;
     public final int transparentColorIndex;
 
-    GraphicControlExtension(final int blockCode, final int packed, final int dispose,
-            final boolean transparency, final int delay, final int transparentColorIndex) {
+    GraphicControlExtension(final int blockCode, final int packed, final int dispose, final boolean transparency, final int delay,
+            final int transparentColorIndex) {
         super(blockCode);
 
         this.packed = packed;
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/ImageDescriptor.java b/src/main/java/org/apache/commons/imaging/formats/gif/ImageDescriptor.java
index be236e74..bc2a79ec 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/ImageDescriptor.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/ImageDescriptor.java
@@ -31,12 +31,9 @@ final class ImageDescriptor extends GifBlock {
     final byte[] localColorTable;
     final byte[] imageData;
 
-    ImageDescriptor(final int blockCode, final int imageLeftPosition,
-            final int imageTopPosition, final int imageWidth, final int imageHeight,
-            final byte packedFields, final boolean localColorTableFlag,
-            final boolean interlaceFlag, final boolean sortFlag,
-            final byte sizeofLocalColorTable, final byte[] localColorTable,
-            final byte[] imageData) {
+    ImageDescriptor(final int blockCode, final int imageLeftPosition, final int imageTopPosition, final int imageWidth, final int imageHeight,
+            final byte packedFields, final boolean localColorTableFlag, final boolean interlaceFlag, final boolean sortFlag, final byte sizeofLocalColorTable,
+            final byte[] localColorTable, final byte[] imageData) {
         super(blockCode);
 
         this.imageLeftPosition = imageLeftPosition;
diff --git a/src/main/java/org/apache/commons/imaging/formats/gif/package-info.java b/src/main/java/org/apache/commons/imaging/formats/gif/package-info.java
index 1c7940d9..801e4275 100644
--- a/src/main/java/org/apache/commons/imaging/formats/gif/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/formats/gif/package-info.java
@@ -19,4 +19,3 @@
  * The GIF image format.
  */
 package org.apache.commons.imaging.formats.gif;
-
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java
index 4a5fb498..201c04be 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsDecoder.java
@@ -26,63 +26,31 @@ import org.apache.commons.imaging.common.ImageBuilder;
 import org.apache.commons.imaging.formats.icns.IcnsImageParser.IcnsElement;
 
 final class IcnsDecoder {
-    private static final int[] PALETTE_4BPP = { 0xffffffff, 0xfffcf305,
-            0xffff6402, 0xffdd0806, 0xfff20884, 0xff4600a5, 0xff0000d4,
-            0xff02abea, 0xff1fb714, 0xff006411, 0xff562c05, 0xff90713a,
-            0xffc0c0c0, 0xff808080, 0xff404040, 0xff000000 };
+    private static final int[] PALETTE_4BPP = { 0xffffffff, 0xfffcf305, 0xffff6402, 0xffdd0806, 0xfff20884, 0xff4600a5, 0xff0000d4, 0xff02abea, 0xff1fb714,
+            0xff006411, 0xff562c05, 0xff90713a, 0xffc0c0c0, 0xff808080, 0xff404040, 0xff000000 };
 
-    private static final int[] PALETTE_8BPP = { 0xFFFFFFFF, 0xFFFFFFCC,
-            0xFFFFFF99, 0xFFFFFF66, 0xFFFFFF33, 0xFFFFFF00, 0xFFFFCCFF,
-            0xFFFFCCCC, 0xFFFFCC99, 0xFFFFCC66, 0xFFFFCC33, 0xFFFFCC00,
-            0xFFFF99FF, 0xFFFF99CC, 0xFFFF9999, 0xFFFF9966, 0xFFFF9933,
-            0xFFFF9900, 0xFFFF66FF, 0xFFFF66CC, 0xFFFF6699, 0xFFFF6666,
-            0xFFFF6633, 0xFFFF6600, 0xFFFF33FF, 0xFFFF33CC, 0xFFFF3399,
-            0xFFFF3366, 0xFFFF3333, 0xFFFF3300, 0xFFFF00FF, 0xFFFF00CC,
-            0xFFFF0099, 0xFFFF0066, 0xFFFF0033, 0xFFFF0000, 0xFFCCFFFF,
-            0xFFCCFFCC, 0xFFCCFF99, 0xFFCCFF66, 0xFFCCFF33, 0xFFCCFF00,
-            0xFFCCCCFF, 0xFFCCCCCC, 0xFFCCCC99, 0xFFCCCC66, 0xFFCCCC33,
-            0xFFCCCC00, 0xFFCC99FF, 0xFFCC99CC, 0xFFCC9999, 0xFFCC9966,
-            0xFFCC9933, 0xFFCC9900, 0xFFCC66FF, 0xFFCC66CC, 0xFFCC6699,
-            0xFFCC6666, 0xFFCC6633, 0xFFCC6600, 0xFFCC33FF, 0xFFCC33CC,
-            0xFFCC3399, 0xFFCC3366, 0xFFCC3333, 0xFFCC3300, 0xFFCC00FF,
-            0xFFCC00CC, 0xFFCC0099, 0xFFCC0066, 0xFFCC0033, 0xFFCC0000,
-            0xFF99FFFF, 0xFF99FFCC, 0xFF99FF99, 0xFF99FF66, 0xFF99FF33,
-            0xFF99FF00, 0xFF99CCFF, 0xFF99CCCC, 0xFF99CC99, 0xFF99CC66,
-            0xFF99CC33, 0xFF99CC00, 0xFF9999FF, 0xFF9999CC, 0xFF999999,
-            0xFF999966, 0xFF999933, 0xFF999900, 0xFF9966FF, 0xFF9966CC,
-            0xFF996699, 0xFF996666, 0xFF996633, 0xFF996600, 0xFF9933FF,
-            0xFF9933CC, 0xFF993399, 0xFF993366, 0xFF993333, 0xFF993300,
-            0xFF9900FF, 0xFF9900CC, 0xFF990099, 0xFF990066, 0xFF990033,
-            0xFF990000, 0xFF66FFFF, 0xFF66FFCC, 0xFF66FF99, 0xFF66FF66,
-            0xFF66FF33, 0xFF66FF00, 0xFF66CCFF, 0xFF66CCCC, 0xFF66CC99,
-            0xFF66CC66, 0xFF66CC33, 0xFF66CC00, 0xFF6699FF, 0xFF6699CC,
-            0xFF669999, 0xFF669966, 0xFF669933, 0xFF669900, 0xFF6666FF,
-            0xFF6666CC, 0xFF666699, 0xFF666666, 0xFF666633, 0xFF666600,
-            0xFF6633FF, 0xFF6633CC, 0xFF663399, 0xFF663366, 0xFF663333,
-            0xFF663300, 0xFF6600FF, 0xFF6600CC, 0xFF660099, 0xFF660066,
-            0xFF660033, 0xFF660000, 0xFF33FFFF, 0xFF33FFCC, 0xFF33FF99,
-            0xFF33FF66, 0xFF33FF33, 0xFF33FF00, 0xFF33CCFF, 0xFF33CCCC,
-            0xFF33CC99, 0xFF33CC66, 0xFF33CC33, 0xFF33CC00, 0xFF3399FF,
-            0xFF3399CC, 0xFF339999, 0xFF339966, 0xFF339933, 0xFF339900,
-            0xFF3366FF, 0xFF3366CC, 0xFF336699, 0xFF336666, 0xFF336633,
-            0xFF336600, 0xFF3333FF, 0xFF3333CC, 0xFF333399, 0xFF333366,
-            0xFF333333, 0xFF333300, 0xFF3300FF, 0xFF3300CC, 0xFF330099,
-            0xFF330066, 0xFF330033, 0xFF330000, 0xFF00FFFF, 0xFF00FFCC,
-            0xFF00FF99, 0xFF00FF66, 0xFF00FF33, 0xFF00FF00, 0xFF00CCFF,
-            0xFF00CCCC, 0xFF00CC99, 0xFF00CC66, 0xFF00CC33, 0xFF00CC00,
-            0xFF0099FF, 0xFF0099CC, 0xFF009999, 0xFF009966, 0xFF009933,
-            0xFF009900, 0xFF0066FF, 0xFF0066CC, 0xFF006699, 0xFF006666,
-            0xFF006633, 0xFF006600, 0xFF0033FF, 0xFF0033CC, 0xFF003399,
-            0xFF003366, 0xFF003333, 0xFF003300, 0xFF0000FF, 0xFF0000CC,
-            0xFF000099, 0xFF000066, 0xFF000033, 0xFFEE0000, 0xFFDD0000,
-            0xFFBB0000, 0xFFAA0000, 0xFF880000, 0xFF770000, 0xFF550000,
-            0xFF440000, 0xFF220000, 0xFF110000, 0xFF00EE00, 0xFF00DD00,
-            0xFF00BB00, 0xFF00AA00, 0xFF008800, 0xFF007700, 0xFF005500,
-            0xFF004400, 0xFF002200, 0xFF001100, 0xFF0000EE, 0xFF0000DD,
-            0xFF0000BB, 0xFF0000AA, 0xFF000088, 0xFF000077, 0xFF000055,
-            0xFF000044, 0xFF000022, 0xFF000011, 0xFFEEEEEE, 0xFFDDDDDD,
-            0xFFBBBBBB, 0xFFAAAAAA, 0xFF888888, 0xFF777777, 0xFF555555,
-            0xFF444444, 0xFF222222, 0xFF111111, 0xFF000000 };
+    private static final int[] PALETTE_8BPP = { 0xFFFFFFFF, 0xFFFFFFCC, 0xFFFFFF99, 0xFFFFFF66, 0xFFFFFF33, 0xFFFFFF00, 0xFFFFCCFF, 0xFFFFCCCC, 0xFFFFCC99,
+            0xFFFFCC66, 0xFFFFCC33, 0xFFFFCC00, 0xFFFF99FF, 0xFFFF99CC, 0xFFFF9999, 0xFFFF9966, 0xFFFF9933, 0xFFFF9900, 0xFFFF66FF, 0xFFFF66CC, 0xFFFF6699,
+            0xFFFF6666, 0xFFFF6633, 0xFFFF6600, 0xFFFF33FF, 0xFFFF33CC, 0xFFFF3399, 0xFFFF3366, 0xFFFF3333, 0xFFFF3300, 0xFFFF00FF, 0xFFFF00CC, 0xFFFF0099,
+            0xFFFF0066, 0xFFFF0033, 0xFFFF0000, 0xFFCCFFFF, 0xFFCCFFCC, 0xFFCCFF99, 0xFFCCFF66, 0xFFCCFF33, 0xFFCCFF00, 0xFFCCCCFF, 0xFFCCCCCC, 0xFFCCCC99,
+            0xFFCCCC66, 0xFFCCCC33, 0xFFCCCC00, 0xFFCC99FF, 0xFFCC99CC, 0xFFCC9999, 0xFFCC9966, 0xFFCC9933, 0xFFCC9900, 0xFFCC66FF, 0xFFCC66CC, 0xFFCC6699,
+            0xFFCC6666, 0xFFCC6633, 0xFFCC6600, 0xFFCC33FF, 0xFFCC33CC, 0xFFCC3399, 0xFFCC3366, 0xFFCC3333, 0xFFCC3300, 0xFFCC00FF, 0xFFCC00CC, 0xFFCC0099,
+            0xFFCC0066, 0xFFCC0033, 0xFFCC0000, 0xFF99FFFF, 0xFF99FFCC, 0xFF99FF99, 0xFF99FF66, 0xFF99FF33, 0xFF99FF00, 0xFF99CCFF, 0xFF99CCCC, 0xFF99CC99,
+            0xFF99CC66, 0xFF99CC33, 0xFF99CC00, 0xFF9999FF, 0xFF9999CC, 0xFF999999, 0xFF999966, 0xFF999933, 0xFF999900, 0xFF9966FF, 0xFF9966CC, 0xFF996699,
+            0xFF996666, 0xFF996633, 0xFF996600, 0xFF9933FF, 0xFF9933CC, 0xFF993399, 0xFF993366, 0xFF993333, 0xFF993300, 0xFF9900FF, 0xFF9900CC, 0xFF990099,
+            0xFF990066, 0xFF990033, 0xFF990000, 0xFF66FFFF, 0xFF66FFCC, 0xFF66FF99, 0xFF66FF66, 0xFF66FF33, 0xFF66FF00, 0xFF66CCFF, 0xFF66CCCC, 0xFF66CC99,
+            0xFF66CC66, 0xFF66CC33, 0xFF66CC00, 0xFF6699FF, 0xFF6699CC, 0xFF669999, 0xFF669966, 0xFF669933, 0xFF669900, 0xFF6666FF, 0xFF6666CC, 0xFF666699,
+            0xFF666666, 0xFF666633, 0xFF666600, 0xFF6633FF, 0xFF6633CC, 0xFF663399, 0xFF663366, 0xFF663333, 0xFF663300, 0xFF6600FF, 0xFF6600CC, 0xFF660099,
+            0xFF660066, 0xFF660033, 0xFF660000, 0xFF33FFFF, 0xFF33FFCC, 0xFF33FF99, 0xFF33FF66, 0xFF33FF33, 0xFF33FF00, 0xFF33CCFF, 0xFF33CCCC, 0xFF33CC99,
+            0xFF33CC66, 0xFF33CC33, 0xFF33CC00, 0xFF3399FF, 0xFF3399CC, 0xFF339999, 0xFF339966, 0xFF339933, 0xFF339900, 0xFF3366FF, 0xFF3366CC, 0xFF336699,
+            0xFF336666, 0xFF336633, 0xFF336600, 0xFF3333FF, 0xFF3333CC, 0xFF333399, 0xFF333366, 0xFF333333, 0xFF333300, 0xFF3300FF, 0xFF3300CC, 0xFF330099,
+            0xFF330066, 0xFF330033, 0xFF330000, 0xFF00FFFF, 0xFF00FFCC, 0xFF00FF99, 0xFF00FF66, 0xFF00FF33, 0xFF00FF00, 0xFF00CCFF, 0xFF00CCCC, 0xFF00CC99,
+            0xFF00CC66, 0xFF00CC33, 0xFF00CC00, 0xFF0099FF, 0xFF0099CC, 0xFF009999, 0xFF009966, 0xFF009933, 0xFF009900, 0xFF0066FF, 0xFF0066CC, 0xFF006699,
+            0xFF006666, 0xFF006633, 0xFF006600, 0xFF0033FF, 0xFF0033CC, 0xFF003399, 0xFF003366, 0xFF003333, 0xFF003300, 0xFF0000FF, 0xFF0000CC, 0xFF000099,
+            0xFF000066, 0xFF000033, 0xFFEE0000, 0xFFDD0000, 0xFFBB0000, 0xFFAA0000, 0xFF880000, 0xFF770000, 0xFF550000, 0xFF440000, 0xFF220000, 0xFF110000,
+            0xFF00EE00, 0xFF00DD00, 0xFF00BB00, 0xFF00AA00, 0xFF008800, 0xFF007700, 0xFF005500, 0xFF004400, 0xFF002200, 0xFF001100, 0xFF0000EE, 0xFF0000DD,
+            0xFF0000BB, 0xFF0000AA, 0xFF000088, 0xFF000077, 0xFF000055, 0xFF000044, 0xFF000022, 0xFF000011, 0xFFEEEEEE, 0xFFDDDDDD, 0xFFBBBBBB, 0xFFAAAAAA,
+            0xFF888888, 0xFF777777, 0xFF555555, 0xFF444444, 0xFF222222, 0xFF111111, 0xFF000000 };
 
     private static void apply1BPPMask(final byte[] maskData, final ImageBuilder image) throws ImagingException {
         int position = 0;
@@ -111,7 +79,7 @@ final class IcnsDecoder {
                 }
                 value <<= 1;
                 bitsLeft--;
-                image.setRgb(x, y, (alpha << 24) | (0xffffff & image.getRgb(x, y)));
+                image.setRgb(x, y, alpha << 24 | 0xffffff & image.getRgb(x, y));
             }
         }
     }
@@ -120,8 +88,7 @@ final class IcnsDecoder {
         for (int y = 0; y < image.getHeight(); y++) {
             for (int x = 0; x < image.getWidth(); x++) {
                 final int alpha = 0xff & maskData[y * image.getWidth() + x];
-                image.setRgb(x, y,
-                        (alpha << 24) | (0xffffff & image.getRgb(x, y)));
+                image.setRgb(x, y, alpha << 24 | 0xffffff & image.getRgb(x, y));
             }
         }
     }
@@ -153,9 +120,8 @@ final class IcnsDecoder {
         for (int y = 0; y < imageType.getHeight(); y++) {
             for (int x = 0; x < imageType.getWidth(); x++) {
                 final int argb = 0xff000000 /* the "alpha" is ignored */
-                        | ((0xff & imageData[4 * (y * imageType.getWidth() + x) + 1]) << 16)
-                        | ((0xff & imageData[4 * (y * imageType.getWidth() + x) + 2]) << 8)
-                        | (0xff & imageData[4 * (y * imageType.getWidth() + x) + 3]);
+                        | (0xff & imageData[4 * (y * imageType.getWidth() + x) + 1]) << 16 | (0xff & imageData[4 * (y * imageType.getWidth() + x) + 2]) << 8
+                        | 0xff & imageData[4 * (y * imageType.getWidth() + x) + 3];
                 image.setRgb(x, y, argb);
             }
         }
@@ -168,7 +134,7 @@ final class IcnsDecoder {
             for (int x = 0; x < imageType.getWidth(); x++) {
                 int index;
                 if (!visited) {
-                    index = 0xf & (imageData[i] >> 4);
+                    index = 0xf & imageData[i] >> 4;
                 } else {
                     index = 0xf & imageData[i++];
                 }
@@ -187,8 +153,7 @@ final class IcnsDecoder {
         }
     }
 
-    public static List<BufferedImage> decodeAllImages(final IcnsImageParser.IcnsElement[] icnsElements)
-      throws ImagingException {
+    public static List<BufferedImage> decodeAllImages(final IcnsImageParser.IcnsElement[] icnsElements) throws ImagingException {
         final List<BufferedImage> result = new ArrayList<>();
         for (int i = 0; i < icnsElements.length; i++) {
             final BufferedImage image = decodeImage(icnsElements, i);
@@ -199,8 +164,7 @@ final class IcnsDecoder {
         return result;
     }
 
-    public static BufferedImage decodeImage(final IcnsImageParser.IcnsElement[] icnsElements, final int index)
-            throws ImagingException {
+    public static BufferedImage decodeImage(final IcnsImageParser.IcnsElement[] icnsElements, final int index) throws ImagingException {
         final IcnsImageParser.IcnsElement imageElement = icnsElements[index];
         final IcnsType imageType = IcnsType.findImageType(imageElement.type);
         if (imageType == null) {
@@ -208,17 +172,12 @@ final class IcnsDecoder {
         }
 
         // PNG or JPEG 2000
-        if (imageType == IcnsType.ICNS_16x16_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_32x32_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_64x64_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_128x128_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_256x256_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_512x512_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_1024x1024_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_32x32_2x_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_64x64_2x_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_256x256_2x_32BIT_ARGB_IMAGE
-            || imageType == IcnsType.ICNS_512x512_2x_32BIT_ARGB_IMAGE) {
+        if (imageType == IcnsType.ICNS_16x16_32BIT_ARGB_IMAGE || imageType == IcnsType.ICNS_32x32_32BIT_ARGB_IMAGE
+                || imageType == IcnsType.ICNS_64x64_32BIT_ARGB_IMAGE || imageType == IcnsType.ICNS_128x128_32BIT_ARGB_IMAGE
+                || imageType == IcnsType.ICNS_256x256_32BIT_ARGB_IMAGE || imageType == IcnsType.ICNS_512x512_32BIT_ARGB_IMAGE
+                || imageType == IcnsType.ICNS_1024x1024_32BIT_ARGB_IMAGE || imageType == IcnsType.ICNS_32x32_2x_32BIT_ARGB_IMAGE
+                || imageType == IcnsType.ICNS_64x64_2x_32BIT_ARGB_IMAGE || imageType == IcnsType.ICNS_256x256_2x_32BIT_ARGB_IMAGE
+                || imageType == IcnsType.ICNS_512x512_2x_32BIT_ARGB_IMAGE) {
             BufferedImage image = null;
             try {
                 image = Imaging.getBufferedImage(imageElement.data);
@@ -240,40 +199,35 @@ final class IcnsDecoder {
         return decodeImageImpl(imageType, imageElement, icnsElements);
     }
 
-    private static BufferedImage decodeImageImpl(final IcnsType imageType,
-                                                 final IcnsElement imageElement,
-                                                 final IcnsElement[] icnsElements) throws ImagingException {
-        final int expectedSize = (imageType.getWidth() * imageType.getHeight()
-                                  * imageType.getBitsPerPixel() + 7) / 8;
+    private static BufferedImage decodeImageImpl(final IcnsType imageType, final IcnsElement imageElement, final IcnsElement[] icnsElements)
+            throws ImagingException {
+        final int expectedSize = (imageType.getWidth() * imageType.getHeight() * imageType.getBitsPerPixel() + 7) / 8;
         byte[] imageData;
         if (imageElement.data.length < expectedSize) {
             if (imageType.getBitsPerPixel() != 32) {
                 throw new ImagingException("Short image data but not a 32 bit compressed type");
             }
-            imageData = Rle24Compression.decompress(
-              imageType.getWidth(), imageType.getHeight(),
-              imageElement.data);
+            imageData = Rle24Compression.decompress(imageType.getWidth(), imageType.getHeight(), imageElement.data);
         } else {
             imageData = imageElement.data;
         }
 
-        final ImageBuilder imageBuilder = new ImageBuilder(imageType.getWidth(),
-                                                           imageType.getHeight(), true);
+        final ImageBuilder imageBuilder = new ImageBuilder(imageType.getWidth(), imageType.getHeight(), true);
         switch (imageType.getBitsPerPixel()) {
-            case 1:
-                decode1BPPImage(imageType, imageData, imageBuilder);
-                break;
-            case 4:
-                decode4BPPImage(imageType, imageData, imageBuilder);
-                break;
-            case 8:
-                decode8BPPImage(imageType, imageData, imageBuilder);
-                break;
-            case 32:
-                decode32BPPImage(imageType, imageData, imageBuilder);
-                break;
-            default:
-                throw new ImagingException("Unsupported bit depth " + imageType.getBitsPerPixel());
+        case 1:
+            decode1BPPImage(imageType, imageData, imageBuilder);
+            break;
+        case 4:
+            decode4BPPImage(imageType, imageData, imageBuilder);
+            break;
+        case 8:
+            decode8BPPImage(imageType, imageData, imageBuilder);
+            break;
+        case 32:
+            decode32BPPImage(imageType, imageData, imageBuilder);
+            break;
+        default:
+            throw new ImagingException("Unsupported bit depth " + imageType.getBitsPerPixel());
         }
 
         IcnsType maskType;
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
index 0529ae78..6de40a35 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsImageParser.java
@@ -47,6 +47,7 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
             this.icnsElements = icnsElements;
         }
     }
+
     static class IcnsElement {
         static final IcnsElement[] EMPTY_ARRAY = {};
         public final int type;
@@ -68,12 +69,12 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
             } else {
                 typeDescription = " " + icnsType.toString();
             }
-            pw.println("Type: 0x" + Integer.toHexString(type) + " ("
-                    + IcnsType.describeType(type) + ")" + typeDescription);
+            pw.println("Type: 0x" + Integer.toHexString(type) + " (" + IcnsType.describeType(type) + ")" + typeDescription);
             pw.println("ElementSize: " + elementSize);
             pw.println("");
         }
     }
+
     private static final class IcnsHeader {
         public final int magic; // Magic literal (4 bytes), always "icns"
         public final int fileSize; // Length of file (4 bytes), in bytes.
@@ -85,8 +86,7 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
 
         public void dump(final PrintWriter pw) {
             pw.println("IcnsHeader");
-            pw.println("Magic: 0x" + Integer.toHexString(magic) + " ("
-                    + IcnsType.describeType(magic) + ")");
+            pw.println("Magic: 0x" + Integer.toHexString(magic) + " (" + IcnsType.describeType(magic) + ")");
             pw.println("FileSize: " + fileSize);
             pw.println("");
         }
@@ -99,8 +99,7 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
     private static final String[] ACCEPTED_EXTENSIONS = ImageFormats.ICNS.getExtensions();
 
     @Override
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         final IcnsContents icnsContents = readImage(byteSource);
         icnsContents.icnsHeader.dump(pw);
         for (final IcnsElement icnsElement : icnsContents.icnsElements) {
@@ -120,15 +119,13 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
     }
 
     @Override
-    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource) throws ImagingException, IOException {
         final IcnsContents icnsContents = readImage(byteSource);
         return IcnsDecoder.decodeAllImages(icnsContents.icnsElements);
     }
 
     @Override
-    public final BufferedImage getBufferedImage(final ByteSource byteSource,
-            final IcnsImagingParameters params) throws ImagingException, IOException {
+    public final BufferedImage getBufferedImage(final ByteSource byteSource, final IcnsImagingParameters params) throws ImagingException, IOException {
         final IcnsContents icnsContents = readImage(byteSource);
         final List<BufferedImage> result = IcnsDecoder.decodeAllImages(icnsContents.icnsElements);
         if (!result.isEmpty()) {
@@ -148,31 +145,24 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
     }
 
     @Override
-    public byte[] getIccProfileBytes(final ByteSource byteSource, final IcnsImagingParameters params)
-            throws ImagingException, IOException {
+    public byte[] getIccProfileBytes(final ByteSource byteSource, final IcnsImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     @Override
-    public ImageInfo getImageInfo(final ByteSource byteSource, final IcnsImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageInfo getImageInfo(final ByteSource byteSource, final IcnsImagingParameters params) throws ImagingException, IOException {
         final IcnsContents contents = readImage(byteSource);
         final List<BufferedImage> images = IcnsDecoder.decodeAllImages(contents.icnsElements);
         if (images.isEmpty()) {
             throw new ImagingException("No icons in ICNS file");
         }
         final BufferedImage image0 = images.get(0);
-        return new ImageInfo("Icns", 32, new ArrayList<>(),
-                ImageFormats.ICNS, "ICNS Apple Icon Image",
-                image0.getHeight(), "image/x-icns", images.size(), 0, 0, 0, 0,
-                image0.getWidth(), false, true, false,
-                ImageInfo.ColorType.RGB,
-                ImageInfo.CompressionAlgorithm.UNKNOWN);
+        return new ImageInfo("Icns", 32, new ArrayList<>(), ImageFormats.ICNS, "ICNS Apple Icon Image", image0.getHeight(), "image/x-icns", images.size(), 0, 0,
+                0, 0, image0.getWidth(), false, true, false, ImageInfo.ColorType.RGB, ImageInfo.CompressionAlgorithm.UNKNOWN);
     }
 
     @Override
-    public Dimension getImageSize(final ByteSource byteSource, final IcnsImagingParameters params)
-            throws ImagingException, IOException {
+    public Dimension getImageSize(final ByteSource byteSource, final IcnsImagingParameters params) throws ImagingException, IOException {
         final IcnsContents contents = readImage(byteSource);
         final List<BufferedImage> images = IcnsDecoder.decodeAllImages(contents.icnsElements);
         if (images.isEmpty()) {
@@ -184,8 +174,7 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
 
     // FIXME should throw UOE
     @Override
-    public ImageMetadata getMetadata(final ByteSource byteSource, final IcnsImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageMetadata getMetadata(final ByteSource byteSource, final IcnsImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
@@ -200,16 +189,14 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
         // Length of data (4 bytes), in bytes, including this header
         final int elementSize = read4Bytes("ElementSize", is, "Not a valid ICNS file", getByteOrder());
         if (elementSize > remainingSize) {
-            throw new IOException(String.format("Corrupted ICNS file: element size %d is greater than "
-                    + "remaining size %d", elementSize, remainingSize));
+            throw new IOException(String.format("Corrupted ICNS file: element size %d is greater than " + "remaining size %d", elementSize, remainingSize));
         }
         final byte[] data = readBytes("Data", is, elementSize - 8, "Not a valid ICNS file");
 
         return new IcnsElement(type, elementSize, data);
     }
 
-    private IcnsHeader readIcnsHeader(final InputStream is)
-            throws ImagingException, IOException {
+    private IcnsHeader readIcnsHeader(final InputStream is) throws ImagingException, IOException {
         final int magic = read4Bytes("Magic", is, "Not a Valid ICNS File", getByteOrder());
         final int fileSize = read4Bytes("FileSize", is, "Not a Valid ICNS File", getByteOrder());
 
@@ -220,8 +207,7 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
         return new IcnsHeader(magic, fileSize);
     }
 
-    private IcnsContents readImage(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    private IcnsContents readImage(final ByteSource byteSource) throws ImagingException, IOException {
         try (InputStream is = byteSource.getInputStream()) {
             final IcnsHeader icnsHeader = readIcnsHeader(is);
 
@@ -237,8 +223,7 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
     }
 
     @Override
-    public void writeImage(final BufferedImage src, final OutputStream os, final IcnsImagingParameters params)
-            throws ImagingException, IOException {
+    public void writeImage(final BufferedImage src, final OutputStream os, final IcnsImagingParameters params) throws ImagingException, IOException {
         IcnsType imageType;
         if (src.getWidth() == 16 && src.getHeight() == 16) {
             imageType = IcnsType.ICNS_16x16_32BIT_IMAGE;
@@ -249,19 +234,15 @@ public class IcnsImageParser extends AbstractImageParser<IcnsImagingParameters>
         } else if (src.getWidth() == 128 && src.getHeight() == 128) {
             imageType = IcnsType.ICNS_128x128_32BIT_IMAGE;
         } else {
-            throw new ImagingException("Invalid/unsupported source width "
-                    + src.getWidth() + " and height " + src.getHeight());
+            throw new ImagingException("Invalid/unsupported source width " + src.getWidth() + " and height " + src.getHeight());
         }
 
         try (BinaryOutputStream bos = BinaryOutputStream.bigEndian(os)) {
             bos.write4Bytes(ICNS_MAGIC);
-            bos.write4Bytes(4 + 4 + 4 + 4 + 4 * imageType.getWidth()
-            * imageType.getHeight() + 4 + 4 + imageType.getWidth()
-            * imageType.getHeight());
+            bos.write4Bytes(4 + 4 + 4 + 4 + 4 * imageType.getWidth() * imageType.getHeight() + 4 + 4 + imageType.getWidth() * imageType.getHeight());
 
             bos.write4Bytes(imageType.getType());
-            bos.write4Bytes(4 + 4 + 4 * imageType.getWidth()
-            * imageType.getHeight());
+            bos.write4Bytes(4 + 4 + 4 * imageType.getWidth() * imageType.getHeight());
             for (int y = 0; y < src.getHeight(); y++) {
                 for (int x = 0; x < src.getWidth(); x++) {
                     final int argb = src.getRGB(x, y);
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsType.java b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsType.java
index cfa533aa..3486b290 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/IcnsType.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/IcnsType.java
@@ -20,112 +20,64 @@ import java.nio.charset.StandardCharsets;
 
 enum IcnsType {
 
-    ICNS_16x12_1BIT_IMAGE_AND_MASK("icm#", 16, 12, 1, true),
-    ICNS_16x12_4BIT_IMAGE("icm4", 16, 12, 4, false),
-    ICNS_16x12_8BIT_IMAGE("icm8", 16, 12, 8, false),
-
-    ICNS_16x16_8BIT_MASK("s8mk", 16, 16, 8, true),
-    ICNS_16x16_1BIT_IMAGE_AND_MASK("ics#", 16, 16, 1, true),
-    ICNS_16x16_4BIT_IMAGE("ics4", 16, 16, 4, false),
-    ICNS_16x16_8BIT_IMAGE("ics8", 16, 16, 8, false),
-    ICNS_16x16_32BIT_IMAGE("is32", 16, 16, 32, false),
-
-    ICNS_32x32_8BIT_MASK("l8mk", 32, 32, 8, true),
-    ICNS_32x32_1BIT_IMAGE("ICON", 32, 32, 1, false),
-    ICNS_32x32_1BIT_IMAGE_AND_MASK("ICN#", 32, 32, 1, true),
-    ICNS_32x32_4BIT_IMAGE("icl4", 32, 32, 4, false),
-    ICNS_32x32_8BIT_IMAGE("icl8", 32, 32, 8, false),
-    ICNS_32x32_32BIT_IMAGE("il32", 32, 32, 32, false),
-
-    ICNS_48x48_8BIT_MASK("h8mk", 48, 48, 8, true),
-    ICNS_48x48_1BIT_IMAGE_AND_MASK("ich#", 48, 48, 1, true),
-    ICNS_48x48_4BIT_IMAGE("ich4", 48, 48, 4, false),
-    ICNS_48x48_8BIT_IMAGE("ich8", 48, 48, 8, false),
-    ICNS_48x48_32BIT_IMAGE("ih32", 48, 48, 32, false),
-
-    ICNS_128x128_8BIT_MASK("t8mk", 128, 128, 8, true),
-    ICNS_128x128_32BIT_IMAGE("it32", 128, 128, 32, false),
-
-    ICNS_16x16_32BIT_ARGB_IMAGE("icp4", 16, 16, 32, false),
-    ICNS_32x32_32BIT_ARGB_IMAGE("icp5", 32, 32, 32, false),
-    ICNS_64x64_32BIT_ARGB_IMAGE("icp6", 64, 64, 32, false),
-    ICNS_128x128_32BIT_ARGB_IMAGE("ic07", 128, 128, 32, false),
-    ICNS_256x256_32BIT_ARGB_IMAGE("ic08", 256, 256, 32, false),
-    ICNS_512x512_32BIT_ARGB_IMAGE("ic09", 512, 512, 32, false),
-    ICNS_1024x1024_32BIT_ARGB_IMAGE("ic10", 1024, 1024, 32, false),
-    ICNS_32x32_2x_32BIT_ARGB_IMAGE("ic11", 32, 32, 32, false),
-    ICNS_64x64_2x_32BIT_ARGB_IMAGE("ic12", 64, 64, 32, false),
-    ICNS_256x256_2x_32BIT_ARGB_IMAGE("ic13", 256, 256, 32, false),
+    ICNS_16x12_1BIT_IMAGE_AND_MASK("icm#", 16, 12, 1, true), ICNS_16x12_4BIT_IMAGE("icm4", 16, 12, 4, false), ICNS_16x12_8BIT_IMAGE("icm8", 16, 12, 8, false),
+
+    ICNS_16x16_8BIT_MASK("s8mk", 16, 16, 8, true), ICNS_16x16_1BIT_IMAGE_AND_MASK("ics#", 16, 16, 1, true), ICNS_16x16_4BIT_IMAGE("ics4", 16, 16, 4, false),
+    ICNS_16x16_8BIT_IMAGE("ics8", 16, 16, 8, false), ICNS_16x16_32BIT_IMAGE("is32", 16, 16, 32, false),
+
+    ICNS_32x32_8BIT_MASK("l8mk", 32, 32, 8, true), ICNS_32x32_1BIT_IMAGE("ICON", 32, 32, 1, false), ICNS_32x32_1BIT_IMAGE_AND_MASK("ICN#", 32, 32, 1, true),
+    ICNS_32x32_4BIT_IMAGE("icl4", 32, 32, 4, false), ICNS_32x32_8BIT_IMAGE("icl8", 32, 32, 8, false), ICNS_32x32_32BIT_IMAGE("il32", 32, 32, 32, false),
+
+    ICNS_48x48_8BIT_MASK("h8mk", 48, 48, 8, true), ICNS_48x48_1BIT_IMAGE_AND_MASK("ich#", 48, 48, 1, true), ICNS_48x48_4BIT_IMAGE("ich4", 48, 48, 4, false),
+    ICNS_48x48_8BIT_IMAGE("ich8", 48, 48, 8, false), ICNS_48x48_32BIT_IMAGE("ih32", 48, 48, 32, false),
+
+    ICNS_128x128_8BIT_MASK("t8mk", 128, 128, 8, true), ICNS_128x128_32BIT_IMAGE("it32", 128, 128, 32, false),
+
+    ICNS_16x16_32BIT_ARGB_IMAGE("icp4", 16, 16, 32, false), ICNS_32x32_32BIT_ARGB_IMAGE("icp5", 32, 32, 32, false),
+    ICNS_64x64_32BIT_ARGB_IMAGE("icp6", 64, 64, 32, false), ICNS_128x128_32BIT_ARGB_IMAGE("ic07", 128, 128, 32, false),
+    ICNS_256x256_32BIT_ARGB_IMAGE("ic08", 256, 256, 32, false), ICNS_512x512_32BIT_ARGB_IMAGE("ic09", 512, 512, 32, false),
+    ICNS_1024x1024_32BIT_ARGB_IMAGE("ic10", 1024, 1024, 32, false), ICNS_32x32_2x_32BIT_ARGB_IMAGE("ic11", 32, 32, 32, false),
+    ICNS_64x64_2x_32BIT_ARGB_IMAGE("ic12", 64, 64, 32, false), ICNS_256x256_2x_32BIT_ARGB_IMAGE("ic13", 256, 256, 32, false),
     ICNS_512x512_2x_32BIT_ARGB_IMAGE("ic14", 512, 512, 32, false);
 
-    private static final IcnsType[] ALL_IMAGE_TYPES = {
-            ICNS_16x12_1BIT_IMAGE_AND_MASK,
-            ICNS_16x12_4BIT_IMAGE,
-            ICNS_16x12_8BIT_IMAGE,
-            ICNS_16x16_1BIT_IMAGE_AND_MASK,
-            ICNS_16x16_4BIT_IMAGE,
-            ICNS_16x16_8BIT_IMAGE,
-            ICNS_16x16_32BIT_IMAGE,
-            ICNS_32x32_1BIT_IMAGE,
-            ICNS_32x32_1BIT_IMAGE_AND_MASK,
-            ICNS_32x32_4BIT_IMAGE,
-            ICNS_32x32_8BIT_IMAGE,
-            ICNS_32x32_32BIT_IMAGE,
-            ICNS_48x48_1BIT_IMAGE_AND_MASK,
-            ICNS_48x48_4BIT_IMAGE,
-            ICNS_48x48_8BIT_IMAGE,
-            ICNS_48x48_32BIT_IMAGE,
-            ICNS_128x128_32BIT_IMAGE,
-            ICNS_16x16_32BIT_ARGB_IMAGE,
-            ICNS_32x32_32BIT_ARGB_IMAGE,
-            ICNS_64x64_32BIT_ARGB_IMAGE,
-            ICNS_128x128_32BIT_ARGB_IMAGE,
-            ICNS_256x256_32BIT_ARGB_IMAGE,
-            ICNS_512x512_32BIT_ARGB_IMAGE,
-            ICNS_1024x1024_32BIT_ARGB_IMAGE,
-            ICNS_32x32_2x_32BIT_ARGB_IMAGE,
-            ICNS_64x64_2x_32BIT_ARGB_IMAGE,
-            ICNS_256x256_2x_32BIT_ARGB_IMAGE,
-            ICNS_512x512_2x_32BIT_ARGB_IMAGE};
-
-    private static final IcnsType[] ALL_MASK_TYPES = {
-            ICNS_16x12_1BIT_IMAGE_AND_MASK,
-            ICNS_16x16_1BIT_IMAGE_AND_MASK,
-            ICNS_16x16_8BIT_MASK,
-            ICNS_32x32_1BIT_IMAGE_AND_MASK,
-            ICNS_32x32_8BIT_MASK,
-            ICNS_48x48_1BIT_IMAGE_AND_MASK,
-            ICNS_48x48_8BIT_MASK,
-            ICNS_128x128_8BIT_MASK};
+    private static final IcnsType[] ALL_IMAGE_TYPES = { ICNS_16x12_1BIT_IMAGE_AND_MASK, ICNS_16x12_4BIT_IMAGE, ICNS_16x12_8BIT_IMAGE,
+            ICNS_16x16_1BIT_IMAGE_AND_MASK, ICNS_16x16_4BIT_IMAGE, ICNS_16x16_8BIT_IMAGE, ICNS_16x16_32BIT_IMAGE, ICNS_32x32_1BIT_IMAGE,
+            ICNS_32x32_1BIT_IMAGE_AND_MASK, ICNS_32x32_4BIT_IMAGE, ICNS_32x32_8BIT_IMAGE, ICNS_32x32_32BIT_IMAGE, ICNS_48x48_1BIT_IMAGE_AND_MASK,
+            ICNS_48x48_4BIT_IMAGE, ICNS_48x48_8BIT_IMAGE, ICNS_48x48_32BIT_IMAGE, ICNS_128x128_32BIT_IMAGE, ICNS_16x16_32BIT_ARGB_IMAGE,
+            ICNS_32x32_32BIT_ARGB_IMAGE, ICNS_64x64_32BIT_ARGB_IMAGE, ICNS_128x128_32BIT_ARGB_IMAGE, ICNS_256x256_32BIT_ARGB_IMAGE,
+            ICNS_512x512_32BIT_ARGB_IMAGE, ICNS_1024x1024_32BIT_ARGB_IMAGE, ICNS_32x32_2x_32BIT_ARGB_IMAGE, ICNS_64x64_2x_32BIT_ARGB_IMAGE,
+            ICNS_256x256_2x_32BIT_ARGB_IMAGE, ICNS_512x512_2x_32BIT_ARGB_IMAGE };
+
+    private static final IcnsType[] ALL_MASK_TYPES = { ICNS_16x12_1BIT_IMAGE_AND_MASK, ICNS_16x16_1BIT_IMAGE_AND_MASK, ICNS_16x16_8BIT_MASK,
+            ICNS_32x32_1BIT_IMAGE_AND_MASK, ICNS_32x32_8BIT_MASK, ICNS_48x48_1BIT_IMAGE_AND_MASK, ICNS_48x48_8BIT_MASK, ICNS_128x128_8BIT_MASK };
 
     public static String describeType(final int type) {
         final byte[] bytes = new byte[4];
-        bytes[0] = (byte) (0xff & (type >> 24));
-        bytes[1] = (byte) (0xff & (type >> 16));
-        bytes[2] = (byte) (0xff & (type >> 8));
+        bytes[0] = (byte) (0xff & type >> 24);
+        bytes[1] = (byte) (0xff & type >> 16);
+        bytes[2] = (byte) (0xff & type >> 8);
         bytes[3] = (byte) (0xff & type);
         return new String(bytes, StandardCharsets.US_ASCII);
     }
+
     public static IcnsType find1BPPMaskType(final IcnsType imageType) {
         for (final IcnsType allMaskType : ALL_MASK_TYPES) {
-            if (allMaskType.getBitsPerPixel() == 1
-                    && allMaskType.getWidth() == imageType.getWidth()
-                    && allMaskType.getHeight() == imageType.getHeight()) {
+            if (allMaskType.getBitsPerPixel() == 1 && allMaskType.getWidth() == imageType.getWidth() && allMaskType.getHeight() == imageType.getHeight()) {
                 return allMaskType;
             }
         }
         return null;
     }
+
     public static IcnsType find8BPPMaskType(final IcnsType imageType) {
         for (final IcnsType allMaskType : ALL_MASK_TYPES) {
-            if (allMaskType.getBitsPerPixel() == 8
-                    && allMaskType.getWidth() == imageType.getWidth()
-                    && allMaskType.getHeight() == imageType.getHeight()) {
+            if (allMaskType.getBitsPerPixel() == 8 && allMaskType.getWidth() == imageType.getWidth() && allMaskType.getHeight() == imageType.getHeight()) {
                 return allMaskType;
             }
         }
         return null;
     }
+
     public static IcnsType findAnyType(final int type) {
         for (final IcnsType allImageType : ALL_IMAGE_TYPES) {
             if (allImageType.getType() == type) {
@@ -139,6 +91,7 @@ enum IcnsType {
         }
         return null;
     }
+
     public static IcnsType findImageType(final int type) {
         for (final IcnsType allImageType : ALL_IMAGE_TYPES) {
             if (allImageType.getType() == type) {
@@ -153,10 +106,7 @@ enum IcnsType {
         if (bytes.length != 4) {
             throw new IllegalArgumentException("Invalid ICNS type");
         }
-        return ((0xff & bytes[0]) << 24)
-             | ((0xff & bytes[1]) << 16)
-             | ((0xff & bytes[2]) << 8)
-             | (0xff & bytes[3]);
+        return (0xff & bytes[0]) << 24 | (0xff & bytes[1]) << 16 | (0xff & bytes[2]) << 8 | 0xff & bytes[3];
     }
 
     private final int type;
@@ -199,8 +149,6 @@ enum IcnsType {
 
     @Override
     public String toString() {
-        return getClass().getName() + "[" + "width=" + width + "," + "height="
-                + height + "," + "bpp=" + bitsPerPixel + "," + "hasMask="
-                + hasMask + "]";
+        return getClass().getName() + "[" + "width=" + width + "," + "height=" + height + "," + "bpp=" + bitsPerPixel + "," + "hasMask=" + hasMask + "]";
     }
 }
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/Rle24Compression.java b/src/main/java/org/apache/commons/imaging/formats/icns/Rle24Compression.java
index 5d17344e..faa59d53 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/Rle24Compression.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/Rle24Compression.java
@@ -47,7 +47,7 @@ final class Rle24Compression {
                 if ((data[dataPos] & 0x80) != 0) {
                     final int count = (0xff & data[dataPos]) - 125;
                     for (int i = 0; i < count; i++) {
-                        result[band + 4 * (resultPos++)] = data[dataPos + 1];
+                        result[band + 4 * resultPos++] = data[dataPos + 1];
                     }
                     dataPos += 2;
                     remaining -= count;
@@ -55,7 +55,7 @@ final class Rle24Compression {
                     final int count = (0xff & data[dataPos]) + 1;
                     dataPos++;
                     for (int i = 0; i < count; i++) {
-                        result[band + 4 * (resultPos++)] = data[dataPos++];
+                        result[band + 4 * resultPos++] = data[dataPos++];
                     }
                     remaining -= count;
                 }
diff --git a/src/main/java/org/apache/commons/imaging/formats/icns/package-info.java b/src/main/java/org/apache/commons/imaging/formats/icns/package-info.java
index 771d436a..d4c10bbc 100644
--- a/src/main/java/org/apache/commons/imaging/formats/icns/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/formats/icns/package-info.java
@@ -19,4 +19,3 @@
  * The ICNS image format.
  */
 package org.apache.commons.imaging.formats.icns;
-
diff --git a/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java b/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
index 569f9888..a225fdf3 100644
--- a/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/ico/IcoImageParser.java
@@ -61,11 +61,8 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         public final int colorsUsed;
         public final int colorsImportant;
 
-        BitmapHeader(final int size, final int width, final int height,
-                final int planes, final int bitCount, final int compression,
-                final int sizeImage, final int pelsPerMeter,
-                final int pelsPerMeter2, final int colorsUsed,
-                final int colorsImportant) {
+        BitmapHeader(final int size, final int width, final int height, final int planes, final int bitCount, final int compression, final int sizeImage,
+                final int pelsPerMeter, final int pelsPerMeter2, final int colorsUsed, final int colorsImportant) {
             this.size = size;
             this.width = width;
             this.height = height;
@@ -95,12 +92,12 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
             pw.println("ColorsImportant: " + colorsImportant);
         }
     }
+
     private static final class BitmapIconData extends IconData {
         public final BitmapHeader header;
         public final BufferedImage bufferedImage;
 
-        BitmapIconData(final IconInfo iconInfo,
-                final BitmapHeader header, final BufferedImage bufferedImage) {
+        BitmapIconData(final IconInfo iconInfo, final BitmapHeader header, final BufferedImage bufferedImage) {
             super(iconInfo);
             this.header = header;
             this.bufferedImage = bufferedImage;
@@ -158,8 +155,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
 
         protected abstract void dumpSubclass(PrintWriter pw);
 
-        public abstract BufferedImage readBufferedImage()
-                throws ImagingException;
+        public abstract BufferedImage readBufferedImage() throws ImagingException;
     }
 
     static class IconInfo {
@@ -173,9 +169,8 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         public final int imageSize;
         public final int imageOffset;
 
-        IconInfo(final byte width, final byte height,
-                final byte colorCount, final byte reserved, final int planes,
-                final int bitCount, final int imageSize, final int imageOffset) {
+        IconInfo(final byte width, final byte height, final byte colorCount, final byte reserved, final int planes, final int bitCount, final int imageSize,
+                final int imageOffset) {
             this.width = width;
             this.height = height;
             this.colorCount = colorCount;
@@ -212,8 +207,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
     private static final class PngIconData extends IconData {
         public final BufferedImage bufferedImage;
 
-        PngIconData(final IconInfo iconInfo,
-                final BufferedImage bufferedImage) {
+        PngIconData(final IconInfo iconInfo, final BufferedImage bufferedImage) {
             super(iconInfo);
             this.bufferedImage = bufferedImage;
         }
@@ -239,8 +233,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
     }
 
     @Override
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         final ImageContents contents = readImage(byteSource);
         contents.fileHeader.dump(pw);
         for (final IconData iconData : contents.iconDatas) {
@@ -261,8 +254,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
     }
 
     @Override
-    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public List<BufferedImage> getAllBufferedImages(final ByteSource byteSource) throws ImagingException, IOException {
         final ImageContents contents = readImage(byteSource);
 
         final FileHeader fileHeader = contents.fileHeader;
@@ -275,8 +267,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
     }
 
     @Override
-    public final BufferedImage getBufferedImage(final ByteSource byteSource,
-            final IcoImagingParameters params) throws ImagingException, IOException {
+    public final BufferedImage getBufferedImage(final ByteSource byteSource, final IcoImagingParameters params) throws ImagingException, IOException {
         final ImageContents contents = readImage(byteSource);
         final FileHeader fileHeader = contents.fileHeader;
         if (fileHeader.iconCount > 0) {
@@ -297,29 +288,25 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
 
     // TODO should throw UOE
     @Override
-    public byte[] getIccProfileBytes(final ByteSource byteSource, final IcoImagingParameters params)
-            throws ImagingException, IOException {
+    public byte[] getIccProfileBytes(final ByteSource byteSource, final IcoImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     // TODO should throw UOE
     @Override
-    public ImageInfo getImageInfo(final ByteSource byteSource, final IcoImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageInfo getImageInfo(final ByteSource byteSource, final IcoImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     // TODO should throw UOE
     @Override
-    public Dimension getImageSize(final ByteSource byteSource, final IcoImagingParameters params)
-            throws ImagingException, IOException {
+    public Dimension getImageSize(final ByteSource byteSource, final IcoImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
     // TODO should throw UOE
     @Override
-    public ImageMetadata getMetadata(final ByteSource byteSource, final IcoImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageMetadata getMetadata(final ByteSource byteSource, final IcoImagingParameters params) throws ImagingException, IOException {
         return null;
     }
 
@@ -328,80 +315,76 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         return "ico-Custom";
     }
 
-    private IconData readBitmapIconData(final byte[] iconData, final IconInfo fIconInfo)
-            throws ImagingException, IOException {
+    private IconData readBitmapIconData(final byte[] iconData, final IconInfo fIconInfo) throws ImagingException, IOException {
         final ByteArrayInputStream is = new ByteArrayInputStream(iconData);
         final int size = read4Bytes("size", is, "Not a Valid ICO File", getByteOrder()); // Size (4
-                                                                   // bytes),
-                                                                   // size of
-                                                                   // this
-                                                                   // structure
-                                                                   // (always
-                                                                   // 40)
+        // bytes),
+        // size of
+        // this
+        // structure
+        // (always
+        // 40)
         final int width = read4Bytes("width", is, "Not a Valid ICO File", getByteOrder()); // Width (4
-                                                                     // bytes),
-                                                                     // width of
-                                                                     // the
-                                                                     // image
-                                                                     // (same as
-                                                                     // iconinfo.width)
+        // bytes),
+        // width of
+        // the
+        // image
+        // (same as
+        // iconinfo.width)
         final int height = read4Bytes("height", is, "Not a Valid ICO File", getByteOrder()); // Height
-                                                                       // (4
-                                                                       // bytes),
-                                                                       // scanlines
-                                                                       // in the
-                                                                       // color
-                                                                       // map +
-                                                                       // transparent
-                                                                       // map
-                                                                       // (iconinfo.height
-                                                                       // * 2)
+        // (4
+        // bytes),
+        // scanlines
+        // in the
+        // color
+        // map +
+        // transparent
+        // map
+        // (iconinfo.height
+        // * 2)
         final int planes = read2Bytes("planes", is, "Not a Valid ICO File", getByteOrder()); // Planes
-                                                                       // (2
-                                                                       // bytes),
-                                                                       // always
-                                                                       // 1
+        // (2
+        // bytes),
+        // always
+        // 1
         final int bitCount = read2Bytes("bitCount", is, "Not a Valid ICO File", getByteOrder()); // BitCount
-                                                                           // (2
-                                                                           // bytes),
-                                                                           // 1,4,8,16,24,32
-                                                                           // (see
-                                                                           // iconinfo
-                                                                           // for
-                                                                           // details)
+        // (2
+        // bytes),
+        // 1,4,8,16,24,32
+        // (see
+        // iconinfo
+        // for
+        // details)
         int compression = read4Bytes("compression", is, "Not a Valid ICO File", getByteOrder()); // Compression
-                                                                                 // (4
-                                                                                 // bytes),
-                                                                                 // we
-                                                                                 // don?t
-                                                                                 // use
-                                                                                 // this
-                                                                                 // (0)
+        // (4
+        // bytes),
+        // we
+        // don?t
+        // use
+        // this
+        // (0)
         final int sizeImage = read4Bytes("sizeImage", is, "Not a Valid ICO File", getByteOrder()); // SizeImage
-                                                                             // (4
-                                                                             // bytes),
-                                                                             // we
-                                                                             // don?t
-                                                                             // use
-                                                                             // this
-                                                                             // (0)
-        final int xPelsPerMeter = read4Bytes("xPelsPerMeter", is,
-                "Not a Valid ICO File", getByteOrder()); // XPelsPerMeter (4 bytes), we don?t
-                                         // use this (0)
-        final int yPelsPerMeter = read4Bytes("yPelsPerMeter", is,
-                "Not a Valid ICO File", getByteOrder()); // YPelsPerMeter (4 bytes), we don?t
-                                         // use this (0)
+        // (4
+        // bytes),
+        // we
+        // don?t
+        // use
+        // this
+        // (0)
+        final int xPelsPerMeter = read4Bytes("xPelsPerMeter", is, "Not a Valid ICO File", getByteOrder()); // XPelsPerMeter (4 bytes), we don?t
+        // use this (0)
+        final int yPelsPerMeter = read4Bytes("yPelsPerMeter", is, "Not a Valid ICO File", getByteOrder()); // YPelsPerMeter (4 bytes), we don?t
+        // use this (0)
         final int colorsUsed = read4Bytes("colorsUsed", is, "Not a Valid ICO File", getByteOrder()); // ColorsUsed
-                                                                               // (4
-                                                                               // bytes),
-                                                                               // we
-                                                                               // don?t
-                                                                               // use
-                                                                               // this
-                                                                               // (0)
-        final int colorsImportant = read4Bytes("ColorsImportant", is,
-                "Not a Valid ICO File", getByteOrder()); // ColorsImportant (4 bytes), we don?t
-                                         // use this (0)
+        // (4
+        // bytes),
+        // we
+        // don?t
+        // use
+        // this
+        // (0)
+        final int colorsImportant = read4Bytes("ColorsImportant", is, "Not a Valid ICO File", getByteOrder()); // ColorsImportant (4 bytes), we don?t
+        // use this (0)
         int redMask = 0;
         int greenMask = 0;
         int blueMask = 0;
@@ -430,12 +413,10 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
             alphaMask = 0xff000000;
         }
 
-        final BitmapHeader header = new BitmapHeader(size, width, height, planes,
-                bitCount, compression, sizeImage, xPelsPerMeter, yPelsPerMeter,
-                colorsUsed, colorsImportant);
+        final BitmapHeader header = new BitmapHeader(size, width, height, planes, bitCount, compression, sizeImage, xPelsPerMeter, yPelsPerMeter, colorsUsed,
+                colorsImportant);
 
-        final int bitmapPixelsOffset = 14 + 56 + 4 * ((colorsUsed == 0 && bitCount <= 8) ? (1 << bitCount)
-                : colorsUsed);
+        final int bitmapPixelsOffset = 14 + 56 + 4 * (colorsUsed == 0 && bitCount <= 8 ? 1 << bitCount : colorsUsed);
         final int bitmapSize = 14 + 56 + restOfFile.length;
 
         final ByteArrayOutputStream baos = new ByteArrayOutputStream(Allocator.checkByteArray(bitmapSize));
@@ -476,16 +457,14 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         // alpha
         // if the image would be completely transparent with alpha...
         int tScanlineSize = (width + 7) / 8;
-        if ((tScanlineSize % 4) != 0) {
-            tScanlineSize += 4 - (tScanlineSize % 4); // pad scanline to 4
-                                                          // byte size.
+        if (tScanlineSize % 4 != 0) {
+            tScanlineSize += 4 - tScanlineSize % 4; // pad scanline to 4
+                                                    // byte size.
         }
         final int colorMapSizeBytes = tScanlineSize * (height / 2);
         byte[] transparencyMap = null;
         try {
-            transparencyMap = readBytes("transparencyMap",
-                    bmpInputStream, colorMapSizeBytes,
-                    "Not a Valid ICO File");
+            transparencyMap = readBytes("transparencyMap", bmpInputStream, colorMapSizeBytes, "Not a Valid ICO File");
         } catch (final IOException ioEx) {
             if (bitCount != 32) {
                 throw ioEx;
@@ -505,19 +484,16 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         }
         BufferedImage resultImage;
         if (allAlphasZero) {
-            resultImage = new BufferedImage(bmpImage.getWidth(),
-                    bmpImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
+            resultImage = new BufferedImage(bmpImage.getWidth(), bmpImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
             for (int y = 0; y < resultImage.getHeight(); y++) {
                 for (int x = 0; x < resultImage.getWidth(); x++) {
                     int alpha = 0xff;
                     if (transparencyMap != null) {
-                        final int alphaByte = 0xff & transparencyMap[tScanlineSize
-                                * (bmpImage.getHeight() - y - 1) + (x / 8)];
-                        alpha = 0x01 & (alphaByte >> (7 - (x % 8)));
-                        alpha = (alpha == 0) ? 0xff : 0x00;
+                        final int alphaByte = 0xff & transparencyMap[tScanlineSize * (bmpImage.getHeight() - y - 1) + x / 8];
+                        alpha = 0x01 & alphaByte >> 7 - x % 8;
+                        alpha = alpha == 0 ? 0xff : 0x00;
                     }
-                    resultImage.setRGB(x, y, (alpha << 24)
-                            | (0xffffff & bmpImage.getRGB(x, y)));
+                    resultImage.setRGB(x, y, alpha << 24 | 0xffffff & bmpImage.getRGB(x, y));
                 }
             }
         } else {
@@ -542,8 +518,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
 
     }
 
-    private IconData readIconData(final byte[] iconData, final IconInfo fIconInfo)
-            throws ImagingException, IOException {
+    private IconData readIconData(final byte[] iconData, final IconInfo fIconInfo) throws ImagingException, IOException {
         final ImageFormat imageFormat = Imaging.guessFormat(iconData);
         if (imageFormat.equals(ImageFormats.PNG)) {
             final BufferedImage bufferedImage = Imaging.getBufferedImage(iconData);
@@ -577,8 +552,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         return new IconInfo(width, height, colorCount, reserved, planes, bitCount, imageSize, imageOffset);
     }
 
-    private ImageContents readImage(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    private ImageContents readImage(final ByteSource byteSource) throws ImagingException, IOException {
         try (InputStream is = byteSource.getInputStream()) {
             final FileHeader fileHeader = readFileHeader(is);
 
@@ -589,8 +563,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
 
             final IconData[] fIconDatas = Allocator.array(fileHeader.iconCount, IconData[]::new, IconData.SHALLOW_SIZE);
             for (int i = 0; i < fileHeader.iconCount; i++) {
-                final byte[] iconData = byteSource.getByteArray(
-                        fIconInfos[i].imageOffset, fIconInfos[i].imageSize);
+                final byte[] iconData = byteSource.getByteArray(fIconInfos[i].imageOffset, fIconInfos[i].imageSize);
                 fIconDatas[i] = readIconData(iconData, fIconInfos[i]);
             }
 
@@ -652,17 +625,16 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
         try (BinaryOutputStream bos = BinaryOutputStream.littleEndian(os)) {
 
             int scanlineSize = (bitCount * src.getWidth() + 7) / 8;
-            if ((scanlineSize % 4) != 0) {
-                scanlineSize += 4 - (scanlineSize % 4); // pad scanline to 4 byte
-                                                          // size.
+            if (scanlineSize % 4 != 0) {
+                scanlineSize += 4 - scanlineSize % 4; // pad scanline to 4 byte
+                                                      // size.
             }
             int tScanlineSize = (src.getWidth() + 7) / 8;
-            if ((tScanlineSize % 4) != 0) {
-                tScanlineSize += 4 - (tScanlineSize % 4); // pad scanline to 4
-                                                              // byte size.
+            if (tScanlineSize % 4 != 0) {
+                tScanlineSize += 4 - tScanlineSize % 4; // pad scanline to 4
+                                                        // byte size.
             }
-            final int imageSize = 40 + 4 * (bitCount <= 8 ? (1 << bitCount) : 0) + src.getHeight() * scanlineSize
-                    + src.getHeight() * tScanlineSize;
+            final int imageSize = 40 + 4 * (bitCount <= 8 ? 1 << bitCount : 0) + src.getHeight() * scanlineSize + src.getHeight() * tScanlineSize;
 
             // ICONDIR
             bos.write2Bytes(0); // reserved
@@ -678,7 +650,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
             }
             bos.write(iconDirEntryWidth);
             bos.write(iconDirEntryHeight);
-            bos.write((bitCount >= 8) ? 0 : (1 << bitCount));
+            bos.write(bitCount >= 8 ? 0 : 1 << bitCount);
             bos.write(0); // reserved
             bos.write2Bytes(1); // color planes
             bos.write2Bytes(bitCount);
@@ -705,7 +677,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
             bos.write4Bytes(0); // colors important
 
             if (palette != null) {
-                for (int i = 0; i < (1 << bitCount); i++) {
+                for (int i = 0; i < 1 << bitCount; i++) {
                     if (i < palette.length()) {
                         final int argb = palette.getEntry(i);
                         bos.write3Bytes(argb);
@@ -748,7 +720,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
                 }
 
                 if (bitsInCache > 0) {
-                    bitCache <<= (8 - bitsInCache);
+                    bitCache <<= 8 - bitsInCache;
                     bos.write(0xff & bitCache);
                     bitCache = 0;
                     bitsInCache = 0;
@@ -763,7 +735,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
             for (int y = src.getHeight() - 1; y >= 0; y--) {
                 for (int x = 0; x < src.getWidth(); x++) {
                     final int argb = src.getRGB(x, y);
-                    final int alpha = 0xff & (argb >> 24);
+                    final int alpha = 0xff & argb >> 24;
                     bitCache <<= 1;
                     if (alpha == 0) {
                         bitCache |= 1;
@@ -777,7 +749,7 @@ public class IcoImageParser extends AbstractImageParser<IcoImagingParameters> {
                 }
 
                 if (bitsInCache > 0) {
-                    bitCache <<= (8 - bitsInCache);
+                    bitCache <<= 8 - bitsInCache;
                     bos.write(0xff & bitCache);
                     bitCache = 0;
                     bitsInCache = 0;
diff --git a/src/main/java/org/apache/commons/imaging/formats/ico/package-info.java b/src/main/java/org/apache/commons/imaging/formats/ico/package-info.java
index b5a03b1d..7a93bb59 100644
--- a/src/main/java/org/apache/commons/imaging/formats/ico/package-info.java
+++ b/src/main/java/org/apache/commons/imaging/formats/ico/package-info.java
@@ -19,4 +19,3 @@
  * The ICO/CUR image formats.
  */
 package org.apache.commons.imaging.formats.ico;
-
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegConstants.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegConstants.java
index e071ac15..54b688ee 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegConstants.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegConstants.java
@@ -26,72 +26,66 @@ import org.apache.commons.imaging.common.BinaryFunctions;
 public final class JpegConstants {
     public static final int MAX_SEGMENT_SIZE = 0xffff;
 
-    public static final BinaryConstant JFIF0_SIGNATURE = new BinaryConstant(
-            new byte[] { 0x4a, // J
-                    0x46, // F
-                    0x49, // I
-                    0x46, // F
-                    0x0, //
-            });
-    public static final BinaryConstant JFIF0_SIGNATURE_ALTERNATIVE = new BinaryConstant(
-            new byte[] { 0x4a, // J
-                    0x46, // F
-                    0x49, // I
-                    0x46, // F
-                    0x20, //
-            });
+    public static final BinaryConstant JFIF0_SIGNATURE = new BinaryConstant(new byte[] { 0x4a, // J
+            0x46, // F
+            0x49, // I
+            0x46, // F
+            0x0, //
+    });
+    public static final BinaryConstant JFIF0_SIGNATURE_ALTERNATIVE = new BinaryConstant(new byte[] { 0x4a, // J
+            0x46, // F
+            0x49, // I
+            0x46, // F
+            0x20, //
+    });
 
-    public static final BinaryConstant EXIF_IDENTIFIER_CODE = new BinaryConstant(
-            new byte[] { 0x45, // E
-                    0x78, // x
-                    0x69, // i
-                    0x66, // f
-            });
+    public static final BinaryConstant EXIF_IDENTIFIER_CODE = new BinaryConstant(new byte[] { 0x45, // E
+            0x78, // x
+            0x69, // i
+            0x66, // f
+    });
 
-    public static final BinaryConstant XMP_IDENTIFIER = new BinaryConstant(
-            new byte[] { 0x68, // h
-                    0x74, // t
-                    0x74, // t
-                    0x70, // p
-                    0x3A, // :
-                    0x2F, // /
-                    0x2F, // /
-                    0x6E, // n
-                    0x73, // s
-                    0x2E, // .
-                    0x61, // a
-                    0x64, // d
-                    0x6F, // o
-                    0x62, // b
-                    0x65, // e
-                    0x2E, // .
-                    0x63, // c
-                    0x6F, // o
-                    0x6D, // m
-                    0x2F, // /
-                    0x78, // x
-                    0x61, // a
-                    0x70, // p
-                    0x2F, // /
-                    0x31, // 1
-                    0x2E, // .
-                    0x30, // 0
-                    0x2F, // /
-                    0, // 0-terminated us-ascii string.
-            });
+    public static final BinaryConstant XMP_IDENTIFIER = new BinaryConstant(new byte[] { 0x68, // h
+            0x74, // t
+            0x74, // t
+            0x70, // p
+            0x3A, // :
+            0x2F, // /
+            0x2F, // /
+            0x6E, // n
+            0x73, // s
+            0x2E, // .
+            0x61, // a
+            0x64, // d
+            0x6F, // o
+            0x62, // b
+            0x65, // e
+            0x2E, // .
+            0x63, // c
+            0x6F, // o
+            0x6D, // m
+            0x2F, // /
+            0x78, // x
+            0x61, // a
+            0x70, // p
+            0x2F, // /
+            0x31, // 1
+            0x2E, // .
+            0x30, // 0
+            0x2F, // /
+            0, // 0-terminated us-ascii string.
+    });
 
-    public static final BinaryConstant SOI = new BinaryConstant(new byte[] {
-            (byte) 0xff, (byte) 0xd8 });
-    public static final BinaryConstant EOI = new BinaryConstant(new byte[] {
-            (byte) 0xff, (byte) 0xd9 });
+    public static final BinaryConstant SOI = new BinaryConstant(new byte[] { (byte) 0xff, (byte) 0xd8 });
+    public static final BinaryConstant EOI = new BinaryConstant(new byte[] { (byte) 0xff, (byte) 0xd9 });
 
     public static final int JPEG_APP0 = 0xE0;
-    public static final int JPEG_APP0_MARKER = (0xff00) | (JPEG_APP0);
-    public static final int JPEG_APP1_MARKER = (0xff00) | (JPEG_APP0 + 1);
-    public static final int JPEG_APP2_MARKER = (0xff00) | (JPEG_APP0 + 2);
-    public static final int JPEG_APP13_MARKER = (0xff00) | (JPEG_APP0 + 13);
-    public static final int JPEG_APP14_MARKER = (0xff00) | (JPEG_APP0 + 14);
-    public static final int JPEG_APP15_MARKER = (0xff00) | (JPEG_APP0 + 15);
+    public static final int JPEG_APP0_MARKER = 0xff00 | JPEG_APP0;
+    public static final int JPEG_APP1_MARKER = 0xff00 | JPEG_APP0 + 1;
+    public static final int JPEG_APP2_MARKER = 0xff00 | JPEG_APP0 + 2;
+    public static final int JPEG_APP13_MARKER = 0xff00 | JPEG_APP0 + 13;
+    public static final int JPEG_APP14_MARKER = 0xff00 | JPEG_APP0 + 14;
+    public static final int JPEG_APP15_MARKER = 0xff00 | JPEG_APP0 + 15;
 
     public static final int JFIF_MARKER = 0xFFE0;
     public static final int SOF0_MARKER = 0xFFc0;
@@ -128,36 +122,29 @@ public final class JpegConstants {
     public static final int DNL_MARKER = 0xFFdc;
     public static final int COM_MARKER = 0xFFfe;
 
-    public static final List<Integer> MARKERS = Collections.unmodifiableList(Arrays.asList(
-            JPEG_APP0, JPEG_APP0_MARKER,
-            JPEG_APP1_MARKER, JPEG_APP2_MARKER, JPEG_APP13_MARKER,
-            JPEG_APP14_MARKER, JPEG_APP15_MARKER, JFIF_MARKER,
-            SOF0_MARKER, SOF1_MARKER, SOF2_MARKER, SOF3_MARKER, DHT_MARKER,
-            SOF5_MARKER, SOF6_MARKER, SOF7_MARKER, SOF8_MARKER, SOF9_MARKER,
-            SOF10_MARKER, SOF11_MARKER, DAC_MARKER, SOF13_MARKER,
-            SOF14_MARKER, SOF15_MARKER, EOI_MARKER, SOS_MARKER, DQT_MARKER,
-            DNL_MARKER, COM_MARKER, DRI_MARKER, RST0_MARKER, RST1_MARKER, RST2_MARKER,
-            RST3_MARKER, RST4_MARKER, RST5_MARKER, RST6_MARKER, RST7_MARKER ));
+    public static final List<Integer> MARKERS = Collections.unmodifiableList(
+            Arrays.asList(JPEG_APP0, JPEG_APP0_MARKER, JPEG_APP1_MARKER, JPEG_APP2_MARKER, JPEG_APP13_MARKER, JPEG_APP14_MARKER, JPEG_APP15_MARKER, JFIF_MARKER,
+                    SOF0_MARKER, SOF1_MARKER, SOF2_MARKER, SOF3_MARKER, DHT_MARKER, SOF5_MARKER, SOF6_MARKER, SOF7_MARKER, SOF8_MARKER, SOF9_MARKER,
+                    SOF10_MARKER, SOF11_MARKER, DAC_MARKER, SOF13_MARKER, SOF14_MARKER, SOF15_MARKER, EOI_MARKER, SOS_MARKER, DQT_MARKER, DNL_MARKER,
+                    COM_MARKER, DRI_MARKER, RST0_MARKER, RST1_MARKER, RST2_MARKER, RST3_MARKER, RST4_MARKER, RST5_MARKER, RST6_MARKER, RST7_MARKER));
 
     public static final BinaryConstant ICC_PROFILE_LABEL = new BinaryConstant(
-            new byte[] { 0x49, 0x43, 0x43, 0x5F, 0x50, 0x52, 0x4F, 0x46, 0x49,
-                    0x4C, 0x45, 0x0 });
+            new byte[] { 0x49, 0x43, 0x43, 0x5F, 0x50, 0x52, 0x4F, 0x46, 0x49, 0x4C, 0x45, 0x0 });
 
-    public static final BinaryConstant PHOTOSHOP_IDENTIFICATION_STRING = new BinaryConstant(
-            new byte[] { 0x50, // P
-                    0x68, // h
-                    0x6F, // o
-                    0x74, // t
-                    0x6F, // o
-                    0x73, // s
-                    0x68, // h
-                    0x6F, // o
-                    0x70, // p
-                    0x20, //
-                    0x33, // 3
-                    0x2E, // .
-                    0x30, // 0
-                    0, });
+    public static final BinaryConstant PHOTOSHOP_IDENTIFICATION_STRING = new BinaryConstant(new byte[] { 0x50, // P
+            0x68, // h
+            0x6F, // o
+            0x74, // t
+            0x6F, // o
+            0x73, // s
+            0x68, // h
+            0x6F, // o
+            0x70, // p
+            0x20, //
+            0x33, // 3
+            0x2E, // .
+            0x30, // 0
+            0, });
     public static final int CONST_8BIM = BinaryFunctions.charsToQuad('8', 'B', 'I', 'M');
 
     private JpegConstants() {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
index 3e1c35e5..c43a742e 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageMetadata.java
@@ -40,8 +40,7 @@ public class JpegImageMetadata implements ImageMetadata {
     private final JpegPhotoshopMetadata photoshop;
     private final TiffImageMetadata exif;
 
-    public JpegImageMetadata(final JpegPhotoshopMetadata photoshop,
-            final TiffImageMetadata exif) {
+    public JpegImageMetadata(final JpegPhotoshopMetadata photoshop, final TiffImageMetadata exif) {
         this.photoshop = photoshop;
         this.exif = exif;
     }
@@ -73,13 +72,11 @@ public class JpegImageMetadata implements ImageMetadata {
     /**
      * Gets the thumbnail image if available.
      *
-     * @return the thumbnail image. May be {@code null} if no image could
-     *         be found.
+     * @return the thumbnail image. May be {@code null} if no image could be found.
      * @throws ImagingException if it fails to read the image
-     * @throws IOException if it fails to get the thumbnail or to read the image data
+     * @throws IOException      if it fails to get the thumbnail or to read the image data
      */
-    public BufferedImage getExifThumbnail() throws ImagingException,
-            IOException {
+    public BufferedImage getExifThumbnail() throws ImagingException, IOException {
 
         if (exif == null) {
             return null;
@@ -106,8 +103,7 @@ public class JpegImageMetadata implements ImageMetadata {
                     // our JPEG reading is still a bit buggy -
                     // fall back to ImageIO on error
                     if (!imageSucceeded) {
-                        final ByteArrayInputStream input = new ByteArrayInputStream(
-                                jpegImageData.getData());
+                        final ByteArrayInputStream input = new ByteArrayInputStream(jpegImageData.getData());
                         image = ImageIO.read(input);
                     }
                 }
@@ -152,10 +148,9 @@ public class JpegImageMetadata implements ImageMetadata {
      *
      * @return Thumbnail width and height or null if no thumbnail.
      * @throws ImagingException if it fails to read the image
-     * @throws IOException if it fails to read the image size
+     * @throws IOException      if it fails to read the image size
      */
-    public Dimension getExifThumbnailSize() throws ImagingException,
-            IOException {
+    public Dimension getExifThumbnailSize() throws ImagingException, IOException {
         final byte[] data = getExifThumbnailData();
 
         if (data != null) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
index c6e41d62..bef6370a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
@@ -81,8 +81,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         }
     }
 
-    private byte[] assembleSegments(final List<App2Segment> segments, final boolean startWithZero)
-            throws ImagingException {
+    private byte[] assembleSegments(final List<App2Segment> segments, final boolean startWithZero) throws ImagingException {
         if (segments.isEmpty()) {
             throw new ImagingException("No App2 Segments Found.");
         }
@@ -90,8 +89,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         final int markerCount = segments.get(0).numMarkers;
 
         if (segments.size() != markerCount) {
-            throw new ImagingException("App2 Segments Missing.  Found: "
-                    + segments.size() + ", Expected: " + markerCount + ".");
+            throw new ImagingException("App2 Segments Missing.  Found: " + segments.size() + ", Expected: " + markerCount + ".");
         }
 
         segments.sort(null);
@@ -102,20 +100,15 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         for (int i = 0; i < segments.size(); i++) {
             final App2Segment segment = segments.get(i);
 
-            if ((i + offset) != segment.curMarker) {
+            if (i + offset != segment.curMarker) {
                 dumpSegments(segments);
-                throw new ImagingException(
-                        "Incoherent App2 Segment Ordering.  i: " + i
-                                + ", segment[" + i + "].curMarker: "
-                                + segment.curMarker + ".");
+                throw new ImagingException("Incoherent App2 Segment Ordering.  i: " + i + ", segment[" + i + "].curMarker: " + segment.curMarker + ".");
             }
 
             if (markerCount != segment.numMarkers) {
                 dumpSegments(segments);
                 throw new ImagingException(
-                        "Inconsistent App2 Segment Count info.  markerCount: "
-                                + markerCount + ", segment[" + i
-                                + "].numMarkers: " + segment.numMarkers + ".");
+                        "Inconsistent App2 Segment Count info.  markerCount: " + markerCount + ", segment[" + i + "].numMarkers: " + segment.numMarkers + ".");
             }
 
             if (segment.getIccBytes() != null) {
@@ -135,8 +128,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
     }
 
     @Override
-    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
         pw.println("jpeg.dumpImageFile");
 
         {
@@ -163,9 +155,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
                 final NumberFormat nf = NumberFormat.getIntegerInstance();
                 // this.debugNumber("found, marker: ", marker, 4);
-                pw.println(d + ": marker: "
-                        + Integer.toHexString(abstractSegment.marker) + ", "
-                        + abstractSegment.getDescription() + " (length: "
+                pw.println(d + ": marker: " + Integer.toHexString(abstractSegment.marker) + ", " + abstractSegment.getDescription() + " (length: "
                         + nf.format(abstractSegment.length) + ")");
                 abstractSegment.dump(pw);
             }
@@ -213,8 +203,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
     }
 
     @Override
-    public final BufferedImage getBufferedImage(final ByteSource byteSource,
-            final JpegImagingParameters params) throws ImagingException, IOException {
+    public final BufferedImage getBufferedImage(final ByteSource byteSource, final JpegImagingParameters params) throws ImagingException, IOException {
         final JpegDecoder jpegDecoder = new JpegDecoder();
         return jpegDecoder.decode(byteSource);
     }
@@ -229,8 +218,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         return new JpegImagingParameters();
     }
 
-    public TiffImageMetadata getExifMetadata(final ByteSource byteSource, TiffImagingParameters params)
-            throws ImagingException, IOException {
+    public TiffImageMetadata getExifMetadata(final ByteSource byteSource, TiffImagingParameters params) throws ImagingException, IOException {
         final byte[] bytes = getExifRawData(byteSource);
         if (null == bytes) {
             return null;
@@ -244,12 +232,10 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         return (TiffImageMetadata) new TiffImageParser().getMetadata(bytes, params);
     }
 
-    public byte[] getExifRawData(final ByteSource byteSource)
-            throws ImagingException, IOException {
-        final List<AbstractSegment> abstractSegments = readSegments(byteSource,
-                new int[] { JpegConstants.JPEG_APP1_MARKER, }, false);
+    public byte[] getExifRawData(final ByteSource byteSource) throws ImagingException, IOException {
+        final List<AbstractSegment> abstractSegments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP1_MARKER, }, false);
 
-        if ((abstractSegments == null) || (abstractSegments.isEmpty())) {
+        if (abstractSegments == null || abstractSegments.isEmpty()) {
             return null;
         }
 
@@ -267,8 +253,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         }
         if (exifSegments.size() > 1) {
             throw new ImagingException(
-                    "Imaging currently can't parse EXIF metadata split across multiple APP1 segments.  "
-                            + "Please send this image to the Imaging project.");
+                    "Imaging currently can't parse EXIF metadata split across multiple APP1 segments.  " + "Please send this image to the Imaging project.");
         }
 
         final GenericSegment segment = (GenericSegment) exifSegments.get(0);
@@ -282,10 +267,8 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
     }
 
     @Override
-    public byte[] getIccProfileBytes(final ByteSource byteSource, final JpegImagingParameters params)
-            throws ImagingException, IOException {
-        final List<AbstractSegment> abstractSegments = readSegments(byteSource,
-                new int[] { JpegConstants.JPEG_APP2_MARKER, }, false);
+    public byte[] getIccProfileBytes(final ByteSource byteSource, final JpegImagingParameters params) throws ImagingException, IOException {
+        final List<AbstractSegment> abstractSegments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP2_MARKER, }, false);
 
         final List<App2Segment> filtered = new ArrayList<>();
         if (abstractSegments != null) {
@@ -312,26 +295,15 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
     }
 
     @Override
-    public ImageInfo getImageInfo(final ByteSource byteSource, final JpegImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageInfo getImageInfo(final ByteSource byteSource, final JpegImagingParameters params) throws ImagingException, IOException {
         // List allSegments = readSegments(byteSource, null, false);
 
         final List<AbstractSegment> SOF_segments = readSegments(byteSource, new int[] {
                 // kJFIFMarker,
 
-                JpegConstants.SOF0_MARKER,
-                JpegConstants.SOF1_MARKER,
-                JpegConstants.SOF2_MARKER,
-                JpegConstants.SOF3_MARKER,
-                JpegConstants.SOF5_MARKER,
-                JpegConstants.SOF6_MARKER,
-                JpegConstants.SOF7_MARKER,
-                JpegConstants.SOF9_MARKER,
-                JpegConstants.SOF10_MARKER,
-                JpegConstants.SOF11_MARKER,
-                JpegConstants.SOF13_MARKER,
-                JpegConstants.SOF14_MARKER,
-                JpegConstants.SOF15_MARKER,
+                JpegConstants.SOF0_MARKER, JpegConstants.SOF1_MARKER, JpegConstants.SOF2_MARKER, JpegConstants.SOF3_MARKER, JpegConstants.SOF5_MARKER,
+                JpegConstants.SOF6_MARKER, JpegConstants.SOF7_MARKER, JpegConstants.SOF9_MARKER, JpegConstants.SOF10_MARKER, JpegConstants.SOF11_MARKER,
+                JpegConstants.SOF13_MARKER, JpegConstants.SOF14_MARKER, JpegConstants.SOF15_MARKER,
 
         }, false);
 
@@ -343,8 +315,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         // System.out.println("Incoherent SOFN Data Found: "
         // + SOF_segments.size());
 
-        final List<AbstractSegment> jfifSegments = readSegments(byteSource,
-                new int[] { JpegConstants.JFIF_MARKER, }, true);
+        final List<AbstractSegment> jfifSegments = readSegments(byteSource, new int[] { JpegConstants.JFIF_MARKER, }, true);
 
         final SofnSegment fSOFNSegment = (SofnSegment) SOF_segments.get(0);
         // SofnSegment fSOFNSegment = (SofnSegment) findSegment(segments,
@@ -359,11 +330,11 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
         JfifSegment jfifSegment = null;
 
-        if ((jfifSegments != null) && (!jfifSegments.isEmpty())) {
+        if (jfifSegments != null && !jfifSegments.isEmpty()) {
             jfifSegment = (JfifSegment) jfifSegments.get(0);
         }
 
-        final List<AbstractSegment> app14Segments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP14_MARKER}, true);
+        final List<AbstractSegment> app14Segments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP14_MARKER }, true);
         App14Segment app14Segment = null;
         if (app14Segments != null && !app14Segments.isEmpty()) {
             app14Segment = (App14Segment) app14Segments.get(0);
@@ -386,8 +357,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             // JFIF_major_version = fTheJFIFSegment.JFIF_major_version;
             // JFIF_minor_version = fTheJFIFSegment.JFIF_minor_version;
 
-            formatDetails = "Jpeg/JFIF v." + jfifSegment.jfifMajorVersion + "."
-                    + jfifSegment.jfifMinorVersion;
+            formatDetails = "Jpeg/JFIF v." + jfifSegment.jfifMajorVersion + "." + jfifSegment.jfifMinorVersion;
 
             switch (densityUnits) {
             case 0:
@@ -402,8 +372,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
                 break;
             }
         } else {
-            final JpegImageMetadata metadata = (JpegImageMetadata) getMetadata(
-                    byteSource, params);
+            final JpegImageMetadata metadata = (JpegImageMetadata) getMetadata(byteSource, params);
 
             if (metadata != null) {
                 {
@@ -456,8 +425,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             physicalHeightInch = (float) (height / (yDensity * unitsPerInch));
         }
 
-        final List<AbstractSegment> commentSegments = readSegments(byteSource,
-                new int[] { JpegConstants.COM_MARKER}, false);
+        final List<AbstractSegment> commentSegments = readSegments(byteSource, new int[] { JpegConstants.COM_MARKER }, false);
         final List<String> comments = Allocator.arrayList(commentSegments.size());
         for (final AbstractSegment commentSegment : commentSegments) {
             final ComSegment comSegment = (ComSegment) commentSegment;
@@ -614,8 +582,8 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
                                 maxVerticalSamplingFactor = component.verticalSamplingFactor;
                             }
                         }
-                        final boolean isSubsampled = (minHorizontalSamplingFactor != maxHorizontalSmaplingFactor)
-                                || (minVerticalSamplingFactor != maxVerticalSamplingFactor);
+                        final boolean isSubsampled = minHorizontalSamplingFactor != maxHorizontalSmaplingFactor
+                                || minVerticalSamplingFactor != maxVerticalSamplingFactor;
                         if (numberOfComponents == 3) {
                             if (isSubsampled) {
                                 colorType = ImageInfo.ColorType.YCbCr;
@@ -639,35 +607,21 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
         final ImageInfo.CompressionAlgorithm compressionAlgorithm = ImageInfo.CompressionAlgorithm.JPEG;
 
-        return new ImageInfo(formatDetails, bitsPerPixel, comments,
-                format, formatName, height, mimeType, numberOfImages,
-                physicalHeightDpi, physicalHeightInch, physicalWidthDpi,
-                physicalWidthInch, width, progressive, transparent,
-                usesPalette, colorType, compressionAlgorithm);
+        return new ImageInfo(formatDetails, bitsPerPixel, comments, format, formatName, height, mimeType, numberOfImages, physicalHeightDpi, physicalHeightInch,
+                physicalWidthDpi, physicalWidthInch, width, progressive, transparent, usesPalette, colorType, compressionAlgorithm);
     }
 
     @Override
-    public Dimension getImageSize(final ByteSource byteSource, final JpegImagingParameters params)
-            throws ImagingException, IOException {
+    public Dimension getImageSize(final ByteSource byteSource, final JpegImagingParameters params) throws ImagingException, IOException {
         final List<AbstractSegment> abstractSegments = readSegments(byteSource, new int[] {
                 // kJFIFMarker,
-                JpegConstants.SOF0_MARKER,
-                JpegConstants.SOF1_MARKER,
-                JpegConstants.SOF2_MARKER,
-                JpegConstants.SOF3_MARKER,
-                JpegConstants.SOF5_MARKER,
-                JpegConstants.SOF6_MARKER,
-                JpegConstants.SOF7_MARKER,
-                JpegConstants.SOF9_MARKER,
-                JpegConstants.SOF10_MARKER,
-                JpegConstants.SOF11_MARKER,
-                JpegConstants.SOF13_MARKER,
-                JpegConstants.SOF14_MARKER,
-                JpegConstants.SOF15_MARKER,
+                JpegConstants.SOF0_MARKER, JpegConstants.SOF1_MARKER, JpegConstants.SOF2_MARKER, JpegConstants.SOF3_MARKER, JpegConstants.SOF5_MARKER,
+                JpegConstants.SOF6_MARKER, JpegConstants.SOF7_MARKER, JpegConstants.SOF9_MARKER, JpegConstants.SOF10_MARKER, JpegConstants.SOF11_MARKER,
+                JpegConstants.SOF13_MARKER, JpegConstants.SOF14_MARKER, JpegConstants.SOF15_MARKER,
 
         }, true);
 
-        if ((abstractSegments == null) || (abstractSegments.isEmpty())) {
+        if (abstractSegments == null || abstractSegments.isEmpty()) {
             throw new ImagingException("No JFIF Data Found.");
         }
 
@@ -681,8 +635,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
     }
 
     @Override
-    public ImageMetadata getMetadata(final ByteSource byteSource, JpegImagingParameters params)
-            throws ImagingException, IOException {
+    public ImageMetadata getMetadata(final ByteSource byteSource, JpegImagingParameters params) throws ImagingException, IOException {
         if (params == null) {
             params = new JpegImagingParameters();
         }
@@ -702,12 +655,10 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         return "Jpeg-Custom";
     }
 
-    public JpegPhotoshopMetadata getPhotoshopMetadata(final ByteSource byteSource,
-            final JpegImagingParameters params) throws ImagingException, IOException {
-        final List<AbstractSegment> abstractSegments = readSegments(byteSource,
-                new int[] { JpegConstants.JPEG_APP13_MARKER, }, false);
+    public JpegPhotoshopMetadata getPhotoshopMetadata(final ByteSource byteSource, final JpegImagingParameters params) throws ImagingException, IOException {
+        final List<AbstractSegment> abstractSegments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP13_MARKER, }, false);
 
-        if ((abstractSegments == null) || (abstractSegments.isEmpty())) {
+        if (abstractSegments == null || abstractSegments.isEmpty()) {
             return null;
         }
 
@@ -735,15 +686,12 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
      * Extracts embedded XML metadata as XML string.
      * <p>
      *
-     * @param byteSource
-     *            File containing image data.
-     * @param params
-     *            Map of optional parameters, defined in ImagingConstants.
+     * @param byteSource File containing image data.
+     * @param params     Map of optional parameters, defined in ImagingConstants.
      * @return Xmp Xml as String, if present. Otherwise, returns null.
      */
     @Override
-    public String getXmpXml(final ByteSource byteSource, final XmpImagingParameters<JpegImagingParameters> params)
-            throws ImagingException, IOException {
+    public String getXmpXml(final ByteSource byteSource, final XmpImagingParameters<JpegImagingParameters> params) throws ImagingException, IOException {
 
         final List<String> result = new ArrayList<>();
 
@@ -756,8 +704,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int markerLength, final byte[] markerLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int markerLength, final byte[] markerLengthBytes,
                     final byte[] segmentData) throws ImagingException {
                 if (marker == 0xffd9) {
                     return false;
@@ -774,8 +721,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             }
 
             @Override
-            public void visitSos(final int marker, final byte[] markerBytes,
-                    final byte[] imageData) {
+            public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
                 // don't need image data
             }
         };
@@ -785,14 +731,12 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             return null;
         }
         if (result.size() > 1) {
-            throw new ImagingException(
-                    "JPEG file contains more than one XMP segment.");
+            throw new ImagingException("JPEG file contains more than one XMP segment.");
         }
         return result.get(0);
     }
 
-    public boolean hasExifSegment(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean hasExifSegment(final ByteSource byteSource) throws ImagingException, IOException {
         final boolean[] result = { false, };
 
         final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
@@ -804,8 +748,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int markerLength, final byte[] markerLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int markerLength, final byte[] markerLengthBytes,
                     final byte[] segmentData) {
                 if (marker == 0xffd9) {
                     return false;
@@ -822,8 +765,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             }
 
             @Override
-            public void visitSos(final int marker, final byte[] markerBytes,
-                    final byte[] imageData) {
+            public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
                 // don't need image data
             }
         };
@@ -833,8 +775,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         return result[0];
     }
 
-    public boolean hasIptcSegment(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean hasIptcSegment(final ByteSource byteSource) throws ImagingException, IOException {
         final boolean[] result = { false, };
 
         final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
@@ -846,8 +787,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int markerLength, final byte[] markerLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int markerLength, final byte[] markerLengthBytes,
                     final byte[] segmentData) {
                 if (marker == 0xffd9) {
                     return false;
@@ -864,8 +804,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             }
 
             @Override
-            public void visitSos(final int marker, final byte[] markerBytes,
-                    final byte[] imageData) {
+            public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
                 // don't need image data
             }
         };
@@ -875,8 +814,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         return result[0];
     }
 
-    public boolean hasXmpSegment(final ByteSource byteSource)
-            throws ImagingException, IOException {
+    public boolean hasXmpSegment(final ByteSource byteSource) throws ImagingException, IOException {
         final boolean[] result = { false, };
 
         final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
@@ -888,8 +826,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int markerLength, final byte[] markerLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int markerLength, final byte[] markerLengthBytes,
                     final byte[] segmentData) {
                 if (marker == 0xffd9) {
                     return false;
@@ -906,8 +843,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             }
 
             @Override
-            public void visitSos(final int marker, final byte[] markerBytes,
-                    final byte[] imageData) {
+            public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
                 // don't need image data
             }
         };
@@ -935,20 +871,9 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
         final List<AbstractSegment> result = new ArrayList<>();
         final int[] sofnSegments = {
                 // kJFIFMarker,
-                JpegConstants.SOF0_MARKER,
-                JpegConstants.SOF1_MARKER,
-                JpegConstants.SOF2_MARKER,
-                JpegConstants.SOF3_MARKER,
-                JpegConstants.SOF5_MARKER,
-                JpegConstants.SOF6_MARKER,
-                JpegConstants.SOF7_MARKER,
-                JpegConstants.SOF9_MARKER,
-                JpegConstants.SOF10_MARKER,
-                JpegConstants.SOF11_MARKER,
-                JpegConstants.SOF13_MARKER,
-                JpegConstants.SOF14_MARKER,
-                JpegConstants.SOF15_MARKER,
-        };
+                JpegConstants.SOF0_MARKER, JpegConstants.SOF1_MARKER, JpegConstants.SOF2_MARKER, JpegConstants.SOF3_MARKER, JpegConstants.SOF5_MARKER,
+                JpegConstants.SOF6_MARKER, JpegConstants.SOF7_MARKER, JpegConstants.SOF9_MARKER, JpegConstants.SOF10_MARKER, JpegConstants.SOF11_MARKER,
+                JpegConstants.SOF13_MARKER, JpegConstants.SOF14_MARKER, JpegConstants.SOF15_MARKER, };
 
         final JpegUtils.Visitor visitor = new JpegUtils.Visitor() {
             // return false to exit before reading image data.
@@ -959,8 +884,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int markerLength, final byte[] markerLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int markerLength, final byte[] markerLengthBytes,
                     final byte[] segmentData) throws ImagingException, IOException {
                 if (marker == JpegConstants.EOI_MARKER) {
                     return false;
@@ -995,8 +919,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
                         result.add(new SofnSegment(marker, segmentData));
                     } else if (marker == JpegConstants.DQT_MARKER) {
                         result.add(new DqtSegment(marker, segmentData));
-                    } else if ((marker >= JpegConstants.JPEG_APP1_MARKER)
-                            && (marker <= JpegConstants.JPEG_APP15_MARKER)) {
+                    } else if (marker >= JpegConstants.JPEG_APP1_MARKER && marker <= JpegConstants.JPEG_APP15_MARKER) {
                         result.add(new UnknownSegment(marker, segmentData));
                     } else if (marker == JpegConstants.COM_MARKER) {
                         result.add(new ComSegment(marker, segmentData));
@@ -1008,8 +931,7 @@ public class JpegImageParser extends AbstractImageParser<JpegImagingParameters>
             }
 
             @Override
-            public void visitSos(final int marker, final byte[] markerBytes,
-                    final byte[] imageData) {
+            public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
                 // don't need image data
             }
         };
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
index 5622a14e..3fdab9ea 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/JpegUtils.java
@@ -34,10 +34,8 @@ public class JpegUtils extends BinaryFileParser {
         boolean beginSos();
 
         // return false to exit traversal.
-        boolean visitSegment(int marker, byte[] markerBytes,
-                int segmentLength, byte[] segmentLengthBytes,
-                byte[] segmentData) throws ImagingException,
-                IOException;
+        boolean visitSegment(int marker, byte[] markerBytes, int segmentLength, byte[] segmentLengthBytes, byte[] segmentData)
+                throws ImagingException, IOException;
 
         void visitSos(int marker, byte[] markerBytes, byte[] imageData);
     }
@@ -46,10 +44,10 @@ public class JpegUtils extends BinaryFileParser {
         switch (marker) {
         case JpegConstants.SOS_MARKER:
             return "SOS_MARKER";
-            // case JPEG_APP0 :
-            // return "JPEG_APP0";
-            // case JPEG_APP0_MARKER :
-            // return "JPEG_APP0_MARKER";
+        // case JPEG_APP0 :
+        // return "JPEG_APP0";
+        // case JPEG_APP0_MARKER :
+        // return "JPEG_APP0_MARKER";
         case JpegConstants.JPEG_APP1_MARKER:
             return "JPEG_APP1_MARKER";
         case JpegConstants.JPEG_APP2_MARKER:
@@ -123,8 +121,7 @@ public class JpegUtils extends BinaryFileParser {
         super(ByteOrder.BIG_ENDIAN);
     }
 
-    public void dumpJfif(final ByteSource byteSource) throws ImagingException,
-            IOException {
+    public void dumpJfif(final ByteSource byteSource) throws ImagingException, IOException {
         final Visitor visitor = new Visitor() {
             // return false to exit before reading image data.
             @Override
@@ -134,12 +131,10 @@ public class JpegUtils extends BinaryFileParser {
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int segmentLength, final byte[] segmentLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int segmentLength, final byte[] segmentLengthBytes,
                     final byte[] segmentData) {
-                Debug.debug("Segment marker: " + Integer.toHexString(marker)
-                        + " (" + getMarkerName(marker) + "), "
-                        + segmentData.length + " bytes of segment data.");
+                Debug.debug("Segment marker: " + Integer.toHexString(marker) + " (" + getMarkerName(marker) + "), " + segmentData.length
+                        + " bytes of segment data.");
                 return true;
             }
 
@@ -164,7 +159,7 @@ public class JpegUtils extends BinaryFileParser {
                     markerBytes[0] = markerBytes[1];
                     markerBytes[1] = BinaryFunctions.readByte("marker", is, "Could not read marker");
                 } while ((0xff & markerBytes[0]) != 0xff || (0xff & markerBytes[1]) == 0xff);
-                final int marker = ((0xff & markerBytes[0]) << 8) | (0xff & markerBytes[1]);
+                final int marker = (0xff & markerBytes[0]) << 8 | 0xff & markerBytes[1];
 
                 if (marker == JpegConstants.EOI_MARKER || marker == JpegConstants.SOS_MARKER) {
                     if (!visitor.beginSos()) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java
index 13b63d37..56931249 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java
@@ -17,78 +17,47 @@ package org.apache.commons.imaging.formats.jpeg.decoder;
 
 final class Dct {
     /*
-     * The book "JPEG still image data compression standard", by Pennebaker and
-     * Mitchell, Chapter 4, discusses a number of approaches to the fast DCT.
-     * Here's the cost, excluding modified (de)quantization, for transforming an
-     * 8x8 block:
+     * The book "JPEG still image data compression standard", by Pennebaker and Mitchell, Chapter 4, discusses a number of approaches to the fast DCT. Here's
+     * the cost, excluding modified (de)quantization, for transforming an 8x8 block:
      *
-     * Algorithm                     Adds Multiplies RightShifts Total
-     * Naive                          896       1024           0  1920
-     * "Symmetries"                   448        224           0   672
-     * Vetterli and Ligtenberg        464        208           0   672
-     * Arai, Agui and Nakajima (AA&N) 464         80           0   544
-     * Feig 8x8                       462         54           6   522
-     * Fused mul/add (a pipe dream)                                416
+     * Algorithm Adds Multiplies RightShifts Total Naive 896 1024 0 1920 "Symmetries" 448 224 0 672 Vetterli and Ligtenberg 464 208 0 672 Arai, Agui and
+     * Nakajima (AA&N) 464 80 0 544 Feig 8x8 462 54 6 522 Fused mul/add (a pipe dream) 416
      *
      * IJG's libjpeg, FFmpeg, and a number of others use AA&N.
      *
-     * It would appear that Feig does 4-5% less operations, and multiplications
-     * are reduced from 80 in AA&N to only 54. But in practice:
+     * It would appear that Feig does 4-5% less operations, and multiplications are reduced from 80 in AA&N to only 54. But in practice:
      *
-     * Benchmarks, Intel Core i3 @ 2.93 GHz in long mode, 4 GB RAM Time taken to
-     * do 100 million IDCTs (less is better):
-     * Rene' Stöckel's Feig, int: 45.07 seconds
-     * My Feig, floating point: 36.252 seconds
-     * AA&N, unrolled loops, double[][] -> double[][]: 25.167 seconds
+     * Benchmarks, Intel Core i3 @ 2.93 GHz in long mode, 4 GB RAM Time taken to do 100 million IDCTs (less is better): Rene' Stöckel's Feig, int: 45.07
+     * seconds My Feig, floating point: 36.252 seconds AA&N, unrolled loops, double[][] -> double[][]: 25.167 seconds
      *
-     * Clearly Feig is hopeless. I suspect the performance killer is simply the
-     * weight of the algorithm: massive number of local variables, large code
-     * size, and lots of random array accesses.
+     * Clearly Feig is hopeless. I suspect the performance killer is simply the weight of the algorithm: massive number of local variables, large code size, and
+     * lots of random array accesses.
      *
-     * Also, AA&N can be optimized a lot:
-     * AA&N, rolled loops, double[][] -> double[][]: 21.162 seconds
-     * AA&N, rolled loops, float[][] -> float[][]: no improvement,
-     * but at some stage Hotspot might start doing SIMD, so let's
-     * use float AA&N, rolled loops, float[] -> float[][]: 19.979 seconds
-     * apparently 2D arrays are slow!
-     * AA&N, rolled loops, inlined 1D AA&N
-     * transform, float[] transformed in-place: 18.5 seconds
-     * AA&N, previous version rewritten in C and compiled with "gcc -O3"
-     * takes: 8.5 seconds
-     * (probably due to heavy use of SIMD)
+     * Also, AA&N can be optimized a lot: AA&N, rolled loops, double[][] -> double[][]: 21.162 seconds AA&N, rolled loops, float[][] -> float[][]: no
+     * improvement, but at some stage Hotspot might start doing SIMD, so let's use float AA&N, rolled loops, float[] -> float[][]: 19.979 seconds apparently 2D
+     * arrays are slow! AA&N, rolled loops, inlined 1D AA&N transform, float[] transformed in-place: 18.5 seconds AA&N, previous version rewritten in C and
+     * compiled with "gcc -O3" takes: 8.5 seconds (probably due to heavy use of SIMD)
      *
-     * Other brave attempts: AA&N, best float version converted to 16:16 fixed
-     * point: 23.923 seconds
+     * Other brave attempts: AA&N, best float version converted to 16:16 fixed point: 23.923 seconds
      *
-     * Anyway the best float version stays. 18.5 seconds = 5.4 million
-     * transforms per second per core :-)
+     * Anyway the best float version stays. 18.5 seconds = 5.4 million transforms per second per core :-)
      */
 
-    private static final float[] DCT_SCALING_FACTORS = {
-            (float) (0.5 / Math.sqrt(2.0)),
-            (float) (0.25 / Math.cos(Math.PI / 16.0)),
-            (float) (0.25 / Math.cos(2.0 * Math.PI / 16.0)),
-            (float) (0.25 / Math.cos(3.0 * Math.PI / 16.0)),
-            (float) (0.25 / Math.cos(4.0 * Math.PI / 16.0)),
-            (float) (0.25 / Math.cos(5.0 * Math.PI / 16.0)),
-            (float) (0.25 / Math.cos(6.0 * Math.PI / 16.0)),
+    private static final float[] DCT_SCALING_FACTORS = { (float) (0.5 / Math.sqrt(2.0)), (float) (0.25 / Math.cos(Math.PI / 16.0)),
+            (float) (0.25 / Math.cos(2.0 * Math.PI / 16.0)), (float) (0.25 / Math.cos(3.0 * Math.PI / 16.0)), (float) (0.25 / Math.cos(4.0 * Math.PI / 16.0)),
+            (float) (0.25 / Math.cos(5.0 * Math.PI / 16.0)), (float) (0.25 / Math.cos(6.0 * Math.PI / 16.0)),
             (float) (0.25 / Math.cos(7.0 * Math.PI / 16.0)), };
 
-    private static final float[] IDCT_SCALING_FACTORS = {
-            (float) (2.0 * 4.0 / Math.sqrt(2.0) * 0.0625),
-            (float) (4.0 * Math.cos(Math.PI / 16.0) * 0.125),
-            (float) (4.0 * Math.cos(2.0 * Math.PI / 16.0) * 0.125),
-            (float) (4.0 * Math.cos(3.0 * Math.PI / 16.0) * 0.125),
-            (float) (4.0 * Math.cos(4.0 * Math.PI / 16.0) * 0.125),
-            (float) (4.0 * Math.cos(5.0 * Math.PI / 16.0) * 0.125),
-            (float) (4.0 * Math.cos(6.0 * Math.PI / 16.0) * 0.125),
-            (float) (4.0 * Math.cos(7.0 * Math.PI / 16.0) * 0.125), };
+    private static final float[] IDCT_SCALING_FACTORS = { (float) (2.0 * 4.0 / Math.sqrt(2.0) * 0.0625), (float) (4.0 * Math.cos(Math.PI / 16.0) * 0.125),
+            (float) (4.0 * Math.cos(2.0 * Math.PI / 16.0) * 0.125), (float) (4.0 * Math.cos(3.0 * Math.PI / 16.0) * 0.125),
+            (float) (4.0 * Math.cos(4.0 * Math.PI / 16.0) * 0.125), (float) (4.0 * Math.cos(5.0 * Math.PI / 16.0) * 0.125),
+            (float) (4.0 * Math.cos(6.0 * Math.PI / 16.0) * 0.125), (float) (4.0 * Math.cos(7.0 * Math.PI / 16.0) * 0.125), };
 
-    private static final float A1 = (float) (Math.cos(2.0 * Math.PI / 8.0));
+    private static final float A1 = (float) Math.cos(2.0 * Math.PI / 8.0);
     private static final float A2 = (float) (Math.cos(Math.PI / 8.0) - Math.cos(3.0 * Math.PI / 8.0));
     private static final float A3 = A1;
     private static final float A4 = (float) (Math.cos(Math.PI / 8.0) + Math.cos(3.0 * Math.PI / 8.0));
-    private static final float A5 = (float) (Math.cos(3.0 * Math.PI / 8.0));
+    private static final float A5 = (float) Math.cos(3.0 * Math.PI / 8.0);
 
     private static final float C2 = (float) (2.0 * Math.cos(Math.PI / 8));
     private static final float C4 = (float) (2.0 * Math.cos(2 * Math.PI / 8));
@@ -97,9 +66,7 @@ final class Dct {
     private static final float R = C2 + C6;
 
     /**
-     * Fast forward Dct using AA&N. Taken from the book
-     * "JPEG still image data compression standard", by Pennebaker and Mitchell,
-     * chapter 4, figure "4-8".
+     * Fast forward Dct using AA&N. Taken from the book "JPEG still image data compression standard", by Pennebaker and Mitchell, chapter 4, figure "4-8".
      *
      * @param vector vector.
      */
@@ -220,10 +187,8 @@ final class Dct {
     }
 
     /**
-     * Fast inverse Dct using AA&N. This is taken from the beautiful
-     * [BROEKN URL] http://vsr.finermatik.tu-chemnitz.de/~jan/MPEG/HTML/IDCT.html which gives
-     * easy equations and properly explains constants and scaling factors. Terms
-     * have been inlined and the negation optimized out of existence.
+     * Fast inverse Dct using AA&N. This is taken from the beautiful [BROEKN URL] http://vsr.finermatik.tu-chemnitz.de/~jan/MPEG/HTML/IDCT.html which gives easy
+     * equations and properly explains constants and scaling factors. Terms have been inlined and the negation optimized out of existence.
      *
      * @param vector vector.
      */
@@ -354,8 +319,7 @@ final class Dct {
     public static void scaleDequantizationMatrix(final float[] matrix) {
         for (int y = 0; y < 8; y++) {
             for (int x = 0; x < 8; x++) {
-                matrix[8 * y + x] *= IDCT_SCALING_FACTORS[y]
-                        * IDCT_SCALING_FACTORS[x];
+                matrix[8 * y + x] *= IDCT_SCALING_FACTORS[y] * IDCT_SCALING_FACTORS[x];
             }
         }
     }
@@ -369,8 +333,7 @@ final class Dct {
     public static void scaleQuantizationMatrix(final float[] matrix) {
         for (int y = 0; y < 8; y++) {
             for (int x = 0; x < 8; x++) {
-                matrix[8 * y + x] *= DCT_SCALING_FACTORS[y]
-                        * DCT_SCALING_FACTORS[x];
+                matrix[8 * y + x] *= DCT_SCALING_FACTORS[y] * DCT_SCALING_FACTORS[x];
             }
         }
     }
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index 6df80f12..140f4a49 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -47,26 +47,22 @@ import org.apache.commons.imaging.formats.jpeg.segments.SosSegment;
 
 public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
 
-    private static final int [] BAND_MASK_ARGB = {0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000};
-    private static final int [] BAND_MASK_RGB = {0x00ff0000, 0x0000ff00, 0x000000ff};
+    private static final int[] BAND_MASK_ARGB = { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 };
+    private static final int[] BAND_MASK_RGB = { 0x00ff0000, 0x0000ff00, 0x000000ff };
 
     /*
-     * JPEG is an advanced image format that takes significant computation to
-     * decode. Keep decoding fast: - Don't allocate memory inside loops,
-     * allocate it once and reuse. - Minimize calculations per pixel and per
-     * block (using lookup tables for YCbCr->RGB conversion doubled
-     * performance). - Math.round() is slow, use (int)(x+0.5f) instead for
-     * positive numbers.
+     * JPEG is an advanced image format that takes significant computation to decode. Keep decoding fast: - Don't allocate memory inside loops, allocate it once
+     * and reuse. - Minimize calculations per pixel and per block (using lookup tables for YCbCr->RGB conversion doubled performance). - Math.round() is slow,
+     * use (int)(x+0.5f) instead for positive numbers.
      */
 
     private static int fastRound(final float x) {
         return (int) (x + 0.5f);
     }
+
     /**
-     * Returns the positions of where each interval in the provided array starts. The number
-     * of start positions is also the count of intervals while the number of restart markers
-     * found is equal to the number of start positions minus one (because restart markers
-     * are between intervals).
+     * Returns the positions of where each interval in the provided array starts. The number of start positions is also the count of intervals while the number
+     * of restart markers found is equal to the number of start positions minus one (because restart markers are between intervals).
      *
      * @param scanPayload array to examine
      * @return the start positions
@@ -80,8 +76,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         while (pos < scanPayload.length) {
             if (foundFF) {
                 // found 0xFF D0 .. 0xFF D7 => RST marker
-                if (scanPayload[pos] >= (0xff & JpegConstants.RST0_MARKER) &&
-                    scanPayload[pos] <= (0xff & JpegConstants.RST7_MARKER)) {
+                if (scanPayload[pos] >= (0xff & JpegConstants.RST0_MARKER) && scanPayload[pos] <= (0xff & JpegConstants.RST7_MARKER)) {
                     foundD0toD7 = true;
                 } else { // found 0xFF followed by something else => no RST marker
                     foundFF = false;
@@ -103,9 +98,10 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         }
         return intervalStarts;
     }
+
     /**
-     * Returns an array of JpegInputStream where each field contains the JpegInputStream
-     * for one interval.
+     * Returns an array of JpegInputStream where each field contains the JpegInputStream for one interval.
+     *
      * @param scanPayload array to read intervals from
      * @return JpegInputStreams for all intervals, at least one stream is always provided
      */
@@ -129,6 +125,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         }
         return streams;
     }
+
     private final DqtSegment.QuantizationTable[] quantizationTables = new DqtSegment.QuantizationTable[4];
     private final DhtSegment.HuffmanTable[] huffmanDCTables = new DhtSegment.HuffmanTable[4];
     private final DhtSegment.HuffmanTable[] huffmanACTables = new DhtSegment.HuffmanTable[4];
@@ -161,9 +158,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
             if (frameComponent == null) {
                 throw new ImagingException("Invalid component");
             }
-            final Block fullBlock = new Block(
-                    8 * frameComponent.horizontalSamplingFactor,
-                    8 * frameComponent.verticalSamplingFactor);
+            final Block fullBlock = new Block(8 * frameComponent.horizontalSamplingFactor, 8 * frameComponent.verticalSamplingFactor);
             mcu[i] = fullBlock;
         }
         return mcu;
@@ -174,8 +169,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         return true;
     }
 
-    public BufferedImage decode(final ByteSource byteSource) throws IOException,
-            ImagingException {
+    public BufferedImage decode(final ByteSource byteSource) throws IOException, ImagingException {
         final JpegUtils jpegUtils = new JpegUtils();
         jpegUtils.traverseJfif(byteSource, this);
         if (imageReadException != null) {
@@ -187,14 +181,13 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         return image;
     }
 
-    private int decode(final JpegInputStream is, final DhtSegment.HuffmanTable huffmanTable)
-            throws ImagingException {
+    private int decode(final JpegInputStream is, final DhtSegment.HuffmanTable huffmanTable) throws ImagingException {
         // "DECODE", section F.2.2.3, figure F.16, page 109 of T.81
         int i = 1;
         int code = is.nextBit();
         while (code > huffmanTable.getMaxCode(i)) {
             i++;
-            code = (code << 1) | is.nextBit();
+            code = code << 1 | is.nextBit();
         }
         int j = huffmanTable.getValPtr(i);
         j += code - huffmanTable.getMinCode(i);
@@ -203,7 +196,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
 
     private int extend(int v, final int t) {
         // "EXTEND", section F.2.2.1, figure F.12, page 105 of T.81
-        int vt = (1 << (t - 1));
+        int vt = 1 << t - 1;
         if (v < vt) {
             vt = (-1 << t) + 1;
             v += vt;
@@ -211,8 +204,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         return v;
     }
 
-    private void readMcu(final JpegInputStream is, final int[] preds, final Block[] mcu)
-            throws ImagingException {
+    private void readMcu(final JpegInputStream is, final int[] preds, final Block[] mcu) throws ImagingException {
         for (int i = 0; i < sosSegment.numberOfComponents; i++) {
             final SosSegment.Component scanComponent = sosSegment.getComponents(i);
             SofnSegment.Component frameComponent = null;
@@ -230,9 +222,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                 for (int x = 0; x < frameComponent.horizontalSamplingFactor; x++) {
                     Arrays.fill(zz, 0);
                     // page 104 of T.81
-                    final int t = decode(
-                            is,
-                            huffmanDCTables[scanComponent.dcCodingTableSelector]);
+                    final int t = decode(is, huffmanDCTables[scanComponent.dcCodingTableSelector]);
                     int diff = receive(t, is);
                     diff = extend(diff, t);
                     zz[0] = preds[i] + diff;
@@ -241,9 +231,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                     // "Decode_AC_coefficients", figure F.13, page 106 of T.81
                     int k = 1;
                     while (true) {
-                        final int rs = decode(
-                                is,
-                                huffmanACTables[scanComponent.acCodingTableSelector]);
+                        final int rs = decode(is, huffmanACTables[scanComponent.acCodingTableSelector]);
                         final int ssss = rs & 0xf;
                         final int rrrr = rs >> 4;
                         final int r = rrrr;
@@ -267,7 +255,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                         }
                     }
 
-                    final int shift = (1 << (sofnSegment.precision - 1));
+                    final int shift = 1 << sofnSegment.precision - 1;
                     final int max = (1 << sofnSegment.precision) - 1;
 
                     final float[] scaledQuantizationTable = scaledQuantizationTables[frameComponent.quantTabDestSelector];
@@ -277,8 +265,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                     }
                     Dct.inverseDct8x8(block);
 
-                    int dstRowOffset = 8 * y * 8
-                            * frameComponent.horizontalSamplingFactor + 8 * x;
+                    int dstRowOffset = 8 * y * 8 * frameComponent.horizontalSamplingFactor + 8 * x;
                     int srcNext = 0;
                     for (int yy = 0; yy < 8; yy++) {
                         for (int xx = 0; xx < 8; xx++) {
@@ -316,8 +303,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
         for (int i = 0; i < dataUnits.length; i++) {
             final Block dataUnit = dataUnits[i];
             if (dataUnit.width == hSize && dataUnit.height == vSize) {
-                System.arraycopy(dataUnit.samples, 0, ret[i].samples, 0, hSize
-                        * vSize);
+                System.arraycopy(dataUnit.samples, 0, ret[i].samples, 0, hSize * vSize);
             } else {
                 final int hScale = hSize / dataUnit.width;
                 final int vScale = vSize / dataUnit.height;
@@ -338,8 +324,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                     int dstRowOffset = 0;
                     for (int y = 0; y < vSize; y++) {
                         for (int x = 0; x < hSize; x++) {
-                            ret[i].samples[dstRowOffset + x] = dataUnit.samples[(y / vScale)
-                                    * dataUnit.width + (x / hScale)];
+                            ret[i].samples[dstRowOffset + x] = dataUnit.samples[y / vScale * dataUnit.width + x / hScale];
                         }
                         dstRowOffset += hSize;
                     }
@@ -349,48 +334,30 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
     }
 
     /**
-     * Sets the decoder to treat incoming data as using the RGB color model.
-     * This extension to the JPEG specification is intended to support
-     * TIFF files that use JPEG compression.
+     * Sets the decoder to treat incoming data as using the RGB color model. This extension to the JPEG specification is intended to support TIFF files that use
+     * JPEG compression.
      */
     public void setTiffRgb() {
         useTiffRgb = true;
     }
 
     @Override
-    public boolean visitSegment(final int marker, final byte[] markerBytes,
-            final int segmentLength, final byte[] segmentLengthBytes, final byte[] segmentData)
+    public boolean visitSegment(final int marker, final byte[] markerBytes, final int segmentLength, final byte[] segmentLengthBytes, final byte[] segmentData)
             throws ImagingException, IOException {
-        final int[] sofnSegments = {
-                JpegConstants.SOF0_MARKER,
-                JpegConstants.SOF1_MARKER,
-                JpegConstants.SOF2_MARKER,
-                JpegConstants.SOF3_MARKER,
-                JpegConstants.SOF5_MARKER,
-                JpegConstants.SOF6_MARKER,
-                JpegConstants.SOF7_MARKER,
-                JpegConstants.SOF9_MARKER,
-                JpegConstants.SOF10_MARKER,
-                JpegConstants.SOF11_MARKER,
-                JpegConstants.SOF13_MARKER,
-                JpegConstants.SOF14_MARKER,
-                JpegConstants.SOF15_MARKER,
-        };
+        final int[] sofnSegments = { JpegConstants.SOF0_MARKER, JpegConstants.SOF1_MARKER, JpegConstants.SOF2_MARKER, JpegConstants.SOF3_MARKER,
+                JpegConstants.SOF5_MARKER, JpegConstants.SOF6_MARKER, JpegConstants.SOF7_MARKER, JpegConstants.SOF9_MARKER, JpegConstants.SOF10_MARKER,
+                JpegConstants.SOF11_MARKER, JpegConstants.SOF13_MARKER, JpegConstants.SOF14_MARKER, JpegConstants.SOF15_MARKER, };
 
         if (Arrays.binarySearch(sofnSegments, marker) >= 0) {
             if (marker != JpegConstants.SOF0_MARKER) {
-                throw new ImagingException("Only sequential, baseline JPEGs "
-                        + "are supported at the moment");
+                throw new ImagingException("Only sequential, baseline JPEGs " + "are supported at the moment");
             }
             sofnSegment = new SofnSegment(marker, segmentData);
         } else if (marker == JpegConstants.DQT_MARKER) {
             final DqtSegment dqtSegment = new DqtSegment(marker, segmentData);
             for (final QuantizationTable table : dqtSegment.quantizationTables) {
-                if (0 > table.destinationIdentifier
-                        || table.destinationIdentifier >= quantizationTables.length) {
-                    throw new ImagingException(
-                            "Invalid quantization table identifier "
-                                    + table.destinationIdentifier);
+                if (0 > table.destinationIdentifier || table.destinationIdentifier >= quantizationTables.length) {
+                    throw new ImagingException("Invalid quantization table identifier " + table.destinationIdentifier);
                 }
                 quantizationTables[table.destinationIdentifier] = table;
                 final int mSize = 64;
@@ -412,14 +379,10 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                 } else if (table.tableClass == 1) {
                     tables = huffmanACTables;
                 } else {
-                    throw new ImagingException("Invalid huffman table class "
-                            + table.tableClass);
+                    throw new ImagingException("Invalid huffman table class " + table.tableClass);
                 }
-                if (0 > table.destinationIdentifier
-                        || table.destinationIdentifier >= tables.length) {
-                    throw new ImagingException(
-                            "Invalid huffman table identifier "
-                                    + table.destinationIdentifier);
+                if (0 > table.destinationIdentifier || table.destinationIdentifier >= tables.length) {
+                    throw new ImagingException("Invalid huffman table identifier " + table.destinationIdentifier);
                 }
                 tables[table.destinationIdentifier] = table;
             }
@@ -431,7 +394,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
     public void visitSos(final int marker, final byte[] markerBytes, final byte[] imageData) {
         try (ByteArrayInputStream is = new ByteArrayInputStream(imageData)) {
             // read the scan header
-            final int segmentLength = read2Bytes("segmentLength", is,"Not a Valid JPEG File", getByteOrder());
+            final int segmentLength = read2Bytes("segmentLength", is, "Not a Valid JPEG File", getByteOrder());
             final byte[] sosSegmentBytes = readBytes("SosSegment", is, segmentLength - 2, "Not a Valid JPEG File");
             sosSegment = new SosSegment(marker, sosSegmentBytes);
             // read the payload of the scan, this is the remainder of image data after the header
@@ -448,10 +411,8 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
             int hMax = 0;
             int vMax = 0;
             for (int i = 0; i < sofnSegment.numberOfComponents; i++) {
-                hMax = Math.max(hMax,
-                        sofnSegment.getComponents(i).horizontalSamplingFactor);
-                vMax = Math.max(vMax,
-                        sofnSegment.getComponents(i).verticalSamplingFactor);
+                hMax = Math.max(hMax, sofnSegment.getComponents(i).horizontalSamplingFactor);
+                vMax = Math.max(vMax, sofnSegment.getComponents(i).verticalSamplingFactor);
             }
             final int hSize = 8 * hMax;
             final int vSize = 8 * vMax;
@@ -467,8 +428,8 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
             Allocator.check(Integer.BYTES * sofnSegment.width * sofnSegment.height);
             switch (sofnSegment.numberOfComponents) {
             case 4:
-                // Special handling for the application-RGB case:  TIFF files with
-                // JPEG compression can support an alpha channel.  This extension
+                // Special handling for the application-RGB case: TIFF files with
+                // JPEG compression can support an alpha channel. This extension
                 // to the JPEG standard is implemented by specifying a color model
                 // with a fourth channel for alpha.
                 if (useTiffRgb) {
@@ -526,8 +487,8 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                     // and conditional checks were reorganized for efficiency
                     if (useTiffRgb && (scaledMCU.length == 3 || scaledMCU.length == 4)) {
                         // The original (legacy) coding for the x2 and y2 loop was:
-                        //    for(y2 = 0; y2 < vSize && y1 + y2 < sofnSegment.height; y2++)
-                        //    for(x2 = 0; x2 < hSize  && x1 + x2 < sofnSegment.width; x2++)
+                        // for(y2 = 0; y2 < vSize && y1 + y2 < sofnSegment.height; y2++)
+                        // for(x2 = 0; x2 < hSize && x1 + x2 < sofnSegment.width; x2++)
                         // Here, we pre-compute the limits of the loop to reduce the
                         // overhead for the loop conditional evaluation.
                         final int x2Limit;
@@ -546,12 +507,12 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                         if (scaledMCU.length == 4) {
                             // RGBA colorspace
                             // Although conventional JPEGs don't include an alpha channel
-                            // TIFF images that use JPEG encoding may do so.  For example,
+                            // TIFF images that use JPEG encoding may do so. For example,
                             // we have seen this variation in some false-color satellite images
                             // from the U.S. National Weather Service. Ordinary JPEG files
                             // may include an APP14 marker of type Unknowm indicating that
                             // the scaledMCU.length of 3 should be interpreted as the RGB colorspace
-                            // and the 4-channel variation is interpreted as CYMK.  But TIFF files
+                            // and the 4-channel variation is interpreted as CYMK. But TIFF files
                             // use their own tags to specify colorspace and do not include the APP14 marker.
                             for (int y2 = 0; y2 < y2Limit; y2++) {
                                 for (int x2 = 0; x2 < x2Limit; x2++) {
@@ -559,7 +520,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                                     final int g = scaledMCU[1].samples[srcRowOffset + x2];
                                     final int b = scaledMCU[2].samples[srcRowOffset + x2];
                                     final int a = scaledMCU[3].samples[srcRowOffset + x2];
-                                    final int rgb = (a << 24) | (r << 16) | (g << 8) | b;
+                                    final int rgb = a << 24 | r << 16 | g << 8 | b;
                                     dataBuffer.setElem(dstRowOffset + x2, rgb);
                                 }
                                 srcRowOffset += hSize;
@@ -572,7 +533,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                                     final int r = scaledMCU[0].samples[srcRowOffset + x2];
                                     final int g = scaledMCU[1].samples[srcRowOffset + x2];
                                     final int b = scaledMCU[2].samples[srcRowOffset + x2];
-                                    final int rgb = (r << 16) | (g << 8) | b;
+                                    final int rgb = r << 16 | g << 8 | b;
                                     dataBuffer.setElem(dstRowOffset + x2, rgb);
                                 }
                                 srcRowOffset += hSize;
@@ -581,8 +542,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                         }
                     } else {
                         for (int y2 = 0; y2 < vSize && y1 + y2 < sofnSegment.height; y2++) {
-                            for (int x2 = 0; x2 < hSize
-                              && x1 + x2 < sofnSegment.width; x2++) {
+                            for (int x2 = 0; x2 < hSize && x1 + x2 < sofnSegment.width; x2++) {
                                 if (scaledMCU.length == 4) {
                                     final int c = scaledMCU[0].samples[srcRowOffset + x2];
                                     final int m = scaledMCU[1].samples[srcRowOffset + x2];
@@ -598,11 +558,9 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                                     dataBuffer.setElem(dstRowOffset + x2, rgb);
                                 } else if (mcu.length == 1) {
                                     final int y = scaledMCU[0].samples[srcRowOffset + x2];
-                                    dataBuffer.setElem(dstRowOffset + x2, (y << 16) | (y << 8) | y);
+                                    dataBuffer.setElem(dstRowOffset + x2, y << 16 | y << 8 | y);
                                 } else {
-                                    throw new ImagingException(
-                                      "Unsupported JPEG with " + mcu.length
-                                      + " components");
+                                    throw new ImagingException("Unsupported JPEG with " + mcu.length + " components");
                                 }
                             }
                             srcRowOffset += hSize;
@@ -611,8 +569,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
                     }
                 }
             }
-            image = new BufferedImage(colorModel, raster,
-                    colorModel.isAlphaPremultiplied(), new Properties());
+            image = new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), new Properties());
             // byte[] remainder = super.getStreamBytes(is);
             // for (int i = 0; i < remainder.length; i++)
             // {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegInputStream.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegInputStream.java
index 121a3fd6..1bf6c404 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegInputStream.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegInputStream.java
@@ -36,6 +36,7 @@ final class JpegInputStream {
 
     /**
      * Returns {@code true} as long there are unread fields available, else {@code false}
+     *
      * @return {@code true} as long there are unread fields available, else {@code false}
      */
     public boolean hasNext() {
@@ -58,20 +59,19 @@ final class JpegInputStream {
                     if (b2 == (0xff & JpegConstants.DNL_MARKER)) {
                         throw new ImagingException("DNL not yet supported");
                     }
-                    throw new ImagingException("Invalid marker found "
-                        + "in entropy data: 0xFF " + Integer.toHexString(b2));
+                    throw new ImagingException("Invalid marker found " + "in entropy data: 0xFF " + Integer.toHexString(b2));
                 }
             }
         }
-        final int bit = (b >> 7) & 0x1;
+        final int bit = b >> 7 & 0x1;
         cnt--;
         b <<= 1;
         return bit;
     }
 
     /**
-     * Returns the value from current field (as {@code InputStream.read()} would do)
-     * and set the position of the pointer to the next field to read.
+     * Returns the value from current field (as {@code InputStream.read()} would do) and set the position of the pointer to the next field to read.
+     *
      * @return the value from current field (as {@code InputStream.read()} would do).
      * @throws IllegalStateException if the stream hasn't any other value.
      */
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java
index 99c977aa..0d71935c 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/YCbCrConverter.java
@@ -23,10 +23,8 @@ final class YCbCrConverter {
 
     static {
         /*
-         * Why use (Cr << 8) | Y and not (Y << 8) | Cr as the index? Y changes
-         * often, while Cb and Cr is usually subsampled less often and repeats
-         * itself between adjacent pixels, so using it as the high order byte
-         * gives higher locality of reference.
+         * Why use (Cr << 8) | Y and not (Y << 8) | Cr as the index? Y changes often, while Cb and Cr is usually subsampled less often and repeats itself
+         * between adjacent pixels, so using it as the high order byte gives higher locality of reference.
          */
         for (int y = 0; y < 256; y++) {
             for (int cr = 0; cr < 256; cr++) {
@@ -37,7 +35,7 @@ final class YCbCrConverter {
                 if (r > 255) {
                     r = 255;
                 }
-                REDS[(cr << 8) | y] = r << 16;
+                REDS[cr << 8 | y] = r << 16;
             }
         }
         for (int y = 0; y < 256; y++) {
@@ -49,7 +47,7 @@ final class YCbCrConverter {
                 if (b > 255) {
                     b = 255;
                 }
-                BLUES[(cb << 8) | y] = b;
+                BLUES[cb << 8 | y] = b;
             }
         }
         // green is the hardest
@@ -81,9 +79,8 @@ final class YCbCrConverter {
         // but is clamped to [0, 255]
         for (int cb = 0; cb < 256; cb++) {
             for (int cr = 0; cr < 256; cr++) {
-                final int value = fastRound(0.34414f * (cb - 128) + 0.71414f
-                        * (cr - 128));
-                GREENS1[(cb << 8) | cr] = value + 135;
+                final int value = fastRound(0.34414f * (cb - 128) + 0.71414f * (cr - 128));
+                GREENS1[cb << 8 | cr] = value + 135;
             }
         }
         for (int y = 0; y < 256; y++) {
@@ -94,16 +91,16 @@ final class YCbCrConverter {
                 } else if (green > 255) {
                     green = 255;
                 }
-                GREENS2[(value << 8) | y] = green << 8;
+                GREENS2[value << 8 | y] = green << 8;
             }
         }
     }
 
     public static int convertYCbCrToRgb(final int y, final int cb, final int cr) {
-        final int r = REDS[(cr << 8) | y];
-        final int g1 = GREENS1[(cb << 8) | cr];
-        final int g = GREENS2[(g1 << 8) | y];
-        final int b = BLUES[(cb << 8) | y];
+        final int r = REDS[cr << 8 | y];
+        final int g1 = GREENS1[cb << 8 | cr];
+        final int g = GREENS2[g1 << 8 | y];
+        final int b = BLUES[cb << 8 | y];
         return r | g | b;
     }
 
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/ZigZag.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/ZigZag.java
index 1b8755e2..cf5b641d 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/ZigZag.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/ZigZag.java
@@ -16,16 +16,8 @@
 package org.apache.commons.imaging.formats.jpeg.decoder;
 
 final class ZigZag {
-    private static final int[] ZIG_ZAG = {
-         0,  1,  5,  6, 14, 15, 27, 28,
-         2,  4,  7, 13, 16, 26, 29, 42,
-         3,  8, 12, 17, 25, 30, 41, 43,
-         9, 11, 18, 24, 31, 40, 44, 53,
-        10, 19, 23, 32, 39, 45, 52, 54,
-        20, 22, 33, 38, 46, 51, 55, 60,
-        21, 34, 37, 47, 50, 56, 59, 61,
-        35, 36, 48, 49, 57, 58, 62, 63
-    };
+    private static final int[] ZIG_ZAG = { 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53,
+            10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63 };
 
     public static void blockToZigZag(final int[] block, final int[] zz) {
         for (int i = 0; i < ZIG_ZAG.length; i++) {
diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
index bad0c6db..fba73310 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
@@ -78,8 +78,7 @@ public class ExifRewriter extends BinaryFileParser {
         public final List<JFIFPiece> pieces;
         public final List<JFIFPiece> exifPieces;
 
-        JFIFPieces(final List<JFIFPiece> pieces,
-                final List<JFIFPiece> exifPieces) {
+        JFIFPieces(final List<JFIFPiece> pieces, final List<JFIFPiece> exifPieces) {
             this.pieces = pieces;
             this.exifPieces = exifPieces;
         }
@@ -92,8 +91,7 @@ public class ExifRewriter extends BinaryFileParser {
         public final byte[] markerLengthBytes;
         public final byte[] segmentData;
 
-        JFIFPieceSegment(final int marker, final byte[] markerBytes,
-                final byte[] markerLengthBytes, final byte[] segmentData) {
+        JFIFPieceSegment(final int marker, final byte[] markerBytes, final byte[] markerLengthBytes, final byte[] segmentData) {
             this.marker = marker;
             this.markerBytes = markerBytes;
             this.markerLengthBytes = markerLengthBytes;
@@ -110,15 +108,13 @@ public class ExifRewriter extends BinaryFileParser {
 
     private static final class JFIFPieceSegmentExif extends JFIFPieceSegment {
 
-        JFIFPieceSegmentExif(final int marker, final byte[] markerBytes,
-                final byte[] markerLengthBytes, final byte[] segmentData) {
+        JFIFPieceSegmentExif(final int marker, final byte[] markerBytes, final byte[] markerLengthBytes, final byte[] segmentData) {
             super(marker, markerBytes, markerLengthBytes, segmentData);
         }
     }
 
     /**
-     * Constructs a new instance. to guess whether a file contains an image based on its file
-     * extension.
+     * Constructs a new instance. to guess whether a file contains an image based on its file extension.
      */
     public ExifRewriter() {
         this(ByteOrder.BIG_ENDIAN);
@@ -128,8 +124,7 @@ public class ExifRewriter extends BinaryFileParser {
      * Constructs a new instance.
      * <p>
      *
-     * @param byteOrder
-     *            byte order of EXIF segment.
+     * @param byteOrder byte order of EXIF segment.
      */
     public ExifRewriter(final ByteOrder byteOrder) {
         super(byteOrder);
@@ -148,25 +143,14 @@ public class ExifRewriter extends BinaryFileParser {
 
             // return false to exit traversal.
             @Override
-            public boolean visitSegment(final int marker, final byte[] markerBytes,
-                    final int markerLength, final byte[] markerLengthBytes,
+            public boolean visitSegment(final int marker, final byte[] markerBytes, final int markerLength, final byte[] markerLengthBytes,
                     final byte[] segmentData) throws
             // ImageWriteException,
-                    ImagingException, IOException {
-                if (marker != JpegConstants.JPEG_APP1_MARKER) {
-                    pieces.add(new JFIFPieceSegment(marker, markerBytes,
-                            markerLengthBytes, segmentData));
-                } else if (!startsWith(segmentData,
-                        JpegConstants.EXIF_IDENTIFIER_CODE)) {
-                    pieces.add(new JFIFPieceSegment(marker, markerBytes,
-                            markerLengthBytes, segmentData));
-                // } else if (exifSegmentArray[0] != null) {
-                // // TODO: add support for multiple segments
-                // throw new ImageReadException(
-                // "More than one APP1 EXIF segment.");
+            ImagingException, IOException {
+                if (marker != JpegConstants.JPEG_APP1_MARKER || !startsWith(segmentData, JpegConstants.EXIF_IDENTIFIER_CODE)) {
+                    pieces.add(new JFIFPieceSegment(marker, markerBytes, markerLengthBytes, segmentData));
                 } else {
-                    final JFIFPiece piece = new JFIFPieceSegmentExif(marker,
-                            markerBytes, markerLengthBytes, segmentData);
+                    final JFIFPiece piece = new JFIFPieceSegmentExif(marker, markerBytes, markerLengthBytes, segmentData);
                     pieces.add(piece);
                     exifPieces.add(piece);
                 }
@@ -192,37 +176,29 @@ public class ExifRewriter extends BinaryFileParser {
     }
 
     /**
-     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1
-     * segment), and writes the result to a stream.
+     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1 segment), and writes the result to a stream.
      *
-     * @param src
-     *            Byte array containing JPEG image data.
-     * @param os
-     *            OutputStream to write the image to.
+     * @param src Byte array containing JPEG image data.
+     * @param os  OutputStream to write the image to.
      * @throws ImagingException if it fails to read the JFIF segments
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      * @throws ImagingException if it fails to write the updated data
      */
-    public void removeExifMetadata(final byte[] src, final OutputStream os)
-            throws ImagingException, IOException, ImagingException {
+    public void removeExifMetadata(final byte[] src, final OutputStream os) throws ImagingException, IOException, ImagingException {
         final ByteSource byteSource = ByteSource.array(src);
         removeExifMetadata(byteSource, os);
     }
 
     /**
-     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1
-     * segment), and writes the result to a stream.
+     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1 segment), and writes the result to a stream.
      *
-     * @param byteSource
-     *            ByteSource containing JPEG image data.
-     * @param os
-     *            OutputStream to write the image to.
+     * @param byteSource ByteSource containing JPEG image data.
+     * @param os         OutputStream to write the image to.
      * @throws ImagingException if it fails to read the JFIF segments
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      * @throws ImagingException if it fails to write the updated data
      */
-    public void removeExifMetadata(final ByteSource byteSource, final OutputStream os)
-            throws ImagingException, IOException, ImagingException {
+    public void removeExifMetadata(final ByteSource byteSource, final OutputStream os) throws ImagingException, IOException, ImagingException {
         final JFIFPieces jfifPieces = analyzeJfif(byteSource);
         final List<JFIFPiece> pieces = jfifPieces.pieces;
 
@@ -236,98 +212,78 @@ public class ExifRewriter extends BinaryFileParser {
     }
 
     /**
-     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1
-     * segment), and writes the result to a stream.
+     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1 segment), and writes the result to a stream.
      * <p>
      *
-     * @param src
-     *            Image file.
-     * @param os
-     *            OutputStream to write the image to.
+     * @param src Image file.
+     * @param os  OutputStream to write the image to.
      *
      * @throws ImagingException if it fails to read the JFIF segments
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      * @throws ImagingException if it fails to write the updated data
      * @see java.io.File
      * @see java.io.OutputStream
      * @see java.io.File
      * @see java.io.OutputStream
      */
-    public void removeExifMetadata(final File src, final OutputStream os)
-            throws ImagingException, IOException, ImagingException {
+    public void removeExifMetadata(final File src, final OutputStream os) throws ImagingException, IOException, ImagingException {
         final ByteSource byteSource = ByteSource.file(src);
         removeExifMetadata(byteSource, os);
     }
 
     /**
-     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1
-     * segment), and writes the result to a stream.
+     * Reads a JPEG image, removes all EXIF metadata (by removing the APP1 segment), and writes the result to a stream.
      *
-     * @param src
-     *            InputStream containing JPEG image data.
-     * @param os
-     *            OutputStream to write the image to.
+     * @param src InputStream containing JPEG image data.
+     * @param os  OutputStream to write the image to.
      * @throws ImagingException if it fails to read the JFIF segments
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      * @throws ImagingException if it fails to write the updated data
      */
-    public void removeExifMetadata(final InputStream src, final OutputStream os)
-            throws ImagingException, IOException, ImagingException {
+    public void removeExifMetadata(final InputStream src, final OutputStream os) throws ImagingException, IOException, ImagingException {
         final ByteSource byteSource = ByteSource.inputStream(src, null);
         removeExifMetadata(byteSource, os);
     }
 
     /**
-     * Reads a JPEG image, replaces the EXIF metadata and writes the result to a
-     * stream.
+     * Reads a JPEG image, replaces the EXIF metadata and writes the result to a stream.
      *
-     * <p>Note that this uses the "Lossless" approach - in order to preserve data
-     * embedded in the EXIF segment that it can't parse (such as Maker Notes),
-     * this algorithm avoids overwriting any part of the original segment that
-     * it couldn't parse. This can cause the EXIF segment to grow with each
-     * update, which is a serious issue, since all EXIF data must fit in a
-     * single APP1 segment of the JPEG image.</p>
+     * <p>
+     * Note that this uses the "Lossless" approach - in order to preserve data embedded in the EXIF segment that it can't parse (such as Maker Notes), this
+     * algorithm avoids overwriting any part of the original segment that it couldn't parse. This can cause the EXIF segment to grow with each update, which is
+     * a serious issue, since all EXIF data must fit in a single APP1 segment of the JPEG image.
+     * </p>
      *
-     * @param src
-     *            Byte array containing JPEG image data.
-     * @param os
-     *            OutputStream to write the image to.
-     * @param outputSet
-     *            TiffOutputSet containing the EXIF data to write.
+     * @param src       Byte array containing JPEG image data.
+     * @param os        OutputStream to write the image to.
+     * @param outputSet TiffOutputSet containing the EXIF data to write.
      * @throws ImagingException if it fails to read the JFIF segments
-     * @throws IOException if it fails to read the image data
+     * @throws IOException      if it fails to read the image data
      * @throws ImagingException if it fails to write the updated data
      */
-    public void updateExifMetadataLossless(final byte[] src, final OutputStream os,
-            final TiffOutputSet outputSet) throws ImagingException, IOException,
-            ImagingException {
+    public void updateExifMetadataLossless(final byte[] src, final OutputStream os, final TiffOutputSet outputSet)
+            throws ImagingException, IOException, ImagingException {
         final ByteSource byteSource = ByteSource.array(src);
         updateExifMetadataLossless(byteSource, os, outputSet);
     }
 
     /**
... 29554 lines suppressed ...


(commons-imaging) 06/08: Javadoc

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 2fb3075d762077fc7faa8df8f5e590ea5e15960a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:49:38 2023 -0500

    Javadoc
---
 .../java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
index 06d38c79..d0544325 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
@@ -20,9 +20,11 @@ import java.util.Objects;
 
 /**
  * Represents an IPTC block, a set of key-value pairs of Photoshop IPTC data.
+ * <p>
+ * The class is used in public API parameter types.
+ * </p>
  */
 public class IptcBlock {
-    // N.B. The class is used in public API parameter types
 
     private final int blockType;
     private final byte[] blockNameBytes;


(commons-imaging) 07/08: Remove obsolete SpotBugs exclusions

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit fc286853b5b57b4cca9f09a41834c59eba45dca0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:49:45 2023 -0500

    Remove obsolete SpotBugs exclusions
---
 src/conf/spotbugs-exclude-filter.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index 826117a1..b522e4c4 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -26,10 +26,6 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
   <!-- Reason: Intentionally exposing an array -->
-  <Match>
-    <Class name="org.apache.commons.imaging.formats.jpeg.iptc.IptcBlock" />
-    <Bug pattern="EI_EXPOSE_REP2" />
-  </Match>
   <Match>
     <Class name="org.apache.commons.imaging.formats.jpeg.segments.DqtSegment$QuantizationTable" />
     <Method name="getElements" />


(commons-imaging) 01/08: Sort members

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 90dcacfa80d73f17f3aaa43a842d163b98262308
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 11:39:48 2023 -0500

    Sort members
---
 .../commons/imaging/formats/png/PngWriterTest.java | 34 +++++++++++-----------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngWriterTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngWriterTest.java
index dec62c57..3497c7a1 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngWriterTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngWriterTest.java
@@ -36,23 +36,6 @@ import org.junit.jupiter.api.Test;
  */
 public class PngWriterTest extends AbstractPngTest {
 
-    private static int countColors(final byte[] bytes) throws IOException {
-        final BufferedImage imageParsed = Imaging.getBufferedImage(bytes);
-        return new PaletteFactory().makeExactRgbPaletteSimple(imageParsed, Integer.MAX_VALUE).length();
-    }
-
-    private static byte[] getImageBytes(final BufferedImage image, final PngImagingParameters params, final PaletteFactory paletteFactory) throws IOException {
-        try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
-            new PngWriter().writeImage(image, os, params, paletteFactory);
-            return os.toByteArray();
-        }
-    }
-
-    private File getPngFile(String name) {
-        final File pngFolder = new File(ImagingTestConstants.TEST_IMAGE_FOLDER, "png");
-        return new File(pngFolder, name);
-    }
-
     // The form of the test set is
     //    0.   target file name
     //    1.   Expected colour count (as String) - for testPaletteFactory
@@ -70,6 +53,23 @@ public class PngWriterTest extends AbstractPngTest {
         {"5/trns-rgb.png", "26"},
     };
 
+    private static int countColors(final byte[] bytes) throws IOException {
+        final BufferedImage imageParsed = Imaging.getBufferedImage(bytes);
+        return new PaletteFactory().makeExactRgbPaletteSimple(imageParsed, Integer.MAX_VALUE).length();
+    }
+
+    private static byte[] getImageBytes(final BufferedImage image, final PngImagingParameters params, final PaletteFactory paletteFactory) throws IOException {
+        try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
+            new PngWriter().writeImage(image, os, params, paletteFactory);
+            return os.toByteArray();
+        }
+    }
+
+    private File getPngFile(String name) {
+        final File pngFolder = new File(ImagingTestConstants.TEST_IMAGE_FOLDER, "png");
+        return new File(pngFolder, name);
+    }
+
     @Test
     public void testNullParameters() throws IOException {
         for (String[] testTarget : testSet) {


(commons-imaging) 04/08: Remove obsolete SpotBugs exclusions

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 1b63210b54dead129f65f285878ea13327561c26
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:47:49 2023 -0500

    Remove obsolete SpotBugs exclusions
---
 src/conf/spotbugs-exclude-filter.xml | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index 5804374c..826117a1 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -26,15 +26,6 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
   <!-- Reason: Intentionally exposing an array -->
-  <Match>
-    <Class name="org.apache.commons.imaging.common.bytesource.ByteSourceArray" />
-    <Method name="getAll" />
-    <Bug pattern="EI_EXPOSE_REP" />
-  </Match>
-  <Match>
-    <Class name="org.apache.commons.imaging.common.bytesource.ByteSourceArray" />
-    <Bug pattern="EI_EXPOSE_REP2" />
-  </Match>
   <Match>
     <Class name="org.apache.commons.imaging.formats.jpeg.iptc.IptcBlock" />
     <Bug pattern="EI_EXPOSE_REP2" />


(commons-imaging) 05/08: Better use of Objects.requireNonNull()

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 181b526f6951e470b0cda11c7452572f5cd0b3d0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 23 14:49:31 2023 -0500

    Better use of Objects.requireNonNull()
---
 .../org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
index bea1d350..06d38c79 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcBlock.java
@@ -29,10 +29,8 @@ public class IptcBlock {
     private final byte[] blockData;
 
     public IptcBlock(final int blockType, final byte[] blockNameBytes, final byte[] blockData) {
-        Objects.requireNonNull(blockNameBytes, "blockNameBytes");
-        Objects.requireNonNull(blockData, "blockData");
-        this.blockData = blockData;
-        this.blockNameBytes = blockNameBytes;
+        this.blockData = Objects.requireNonNull(blockData, "blockData");
+        this.blockNameBytes = Objects.requireNonNull(blockNameBytes, "blockNameBytes");
         this.blockType = blockType;
     }