Author: ssteiner Date: Wed Mar 8 15:15:06 2017 New Revision: 1785982 URL: http://svn.apache.org/viewvc?rev=1785982&view=rev Log: Fix findbugs 3 warnings
Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/FloatLayoutManager.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFunction.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/bitmap/DitherUtil.java Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java Wed Mar 8 15:15:06 2017 @@ -382,7 +382,7 @@ public final class UnicodeBidiAlgorithm if ((bcPrev == EN) || (bcNext == EN)) { wca [ i ] = EN; } - } else if ((bc != BN) && (bc != ET)) { + } else if (bc != BN) { bcPrev = bc; } } Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java Wed Mar 8 15:15:06 2017 @@ -927,6 +927,7 @@ public class GlyphProcessingState { al.add(igs.getAssociation(i)); } gb.flip(); + assert igs != null; if (igs.compareGlyphs(gb) != 0) { this.igs = new GlyphSequence(igs.getCharacters(), gb, al); this.indexLast = gb.limit(); Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/fonts/OTFAdvancedTypographicTableReader.java Wed Mar 8 15:15:06 2017 @@ -150,14 +150,12 @@ public final class OTFAdvancedTypographi log.debug(tableTag + " lang sys table non-required feature count: " + nf); } // read (non-required) feature indices - int[] fia = new int[nf]; List fl = new java.util.ArrayList(); for (int i = 0; i < nf; i++) { int fi = in.readTTFUShort(); if (log.isDebugEnabled()) { log.debug(tableTag + " lang sys table non-required feature index: " + fi); } - fia[i] = fi; fl.add("f" + fi); } if (seLanguages == null) { @@ -265,14 +263,12 @@ public final class OTFAdvancedTypographi log.debug(tableTag + " feature table lookup list index count: " + nl); } // read lookup table indices - int[] lia = new int[nl]; List lul = new java.util.ArrayList(); for (int i = 0; i < nl; i++) { int li = in.readTTFUShort(); if (log.isDebugEnabled()) { log.debug(tableTag + " feature table lookup index: " + li); } - lia[i] = li; lul.add("lu" + li); } seFeatures.put("f" + featureIndex, new Object[] { featureTag, lul }); @@ -710,13 +706,11 @@ public final class OTFAdvancedTypographi // read coverage table seMapping = readCoverageTable(tableTag + " single substitution coverage", subtableOffset + co); // read glyph substitutions - int[] gsa = new int[ng]; for (int i = 0, n = ng; i < n; i++) { int gs = in.readTTFUShort(); if (log.isDebugEnabled()) { log.debug(tableTag + " single substitution glyph[" + i + "]: " + gs); } - gsa[i] = gs; seEntries.add(gs); } } Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/complexscripts/util/NumberConverter.java Wed Mar 8 15:15:06 2017 @@ -1260,7 +1260,6 @@ public class NumberConverter { sl.add(0x05F3); } if (hundreds > 0) { - assert hundreds < 10; if (hundreds < 5) { sl.add(map [ 18 + (hundreds - 1) ]); } else if (hundreds < 9) { @@ -1273,6 +1272,7 @@ public class NumberConverter { sl.add(0x05F4); sl.add(map [ 18 + (hundreds - 9) ]); } + assert hundreds < 10; } if (number == 15) { sl.add(map [ 9 - 1]); Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/FloatLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/FloatLayoutManager.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/FloatLayoutManager.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/FloatLayoutManager.java Wed Mar 8 15:15:06 2017 @@ -78,13 +78,8 @@ public class FloatLayoutManager extends public void addAreas(PositionIterator posIter, LayoutContext context) { // "Unwrap" the NonLeafPositions stored in posIter - LinkedList positionList = new LinkedList(); - Position pos = null; while (posIter.hasNext()) { - pos = posIter.next(); - if (pos != null && pos.getPosition() != null) { - positionList.add(pos.getPosition()); - } + posIter.next(); } } Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java Wed Mar 8 15:15:06 2017 @@ -1347,7 +1347,7 @@ public class TextLayoutManager extends L // if a break occurs the content width increases, // otherwise nothing happens addElementsForAHyphen(baseList, alignment, hyphIPD, widthIfNoBreakOccurs, - mapping.breakOppAfter && mapping.isHyphenated); + mapping.breakOppAfter); } else if (suppressibleLetterSpace) { // the word fragment ends with a character that acts as a hyphen // if a break occurs the width does not increase, Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFunction.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFunction.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFunction.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFunction.java Wed Mar 8 15:15:06 2017 @@ -19,7 +19,6 @@ package org.apache.fop.pdf; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -109,10 +108,6 @@ public class PDFFunction extends PDFObje public byte[] toByteString() { - List<String> functionsStrings = new ArrayList<String>(function.getFunctions().size()); - for (PDFFunction f : pdfFunctions) { - functionsStrings.add(f.referencePDF()); - } SubFunctionRenderer subFunctionRenderer = new SubFunctionRenderer() { public void outputFunction(StringBuilder out, int functionIndex) { Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/render/rtf/RTFHandler.java Wed Mar 8 15:15:06 2017 @@ -601,9 +601,6 @@ public class RTFHandler extends FOEventH /** {@inheritDoc} */ public void endColumn(TableColumn tc) { - if (bDefer) { - return; - } } /** {@inheritDoc} */ @@ -1452,9 +1449,6 @@ public class RTFHandler extends FOEventH /** {@inheritDoc} */ public void endPageNumber(PageNumber pagenum) { - if (bDefer) { - return; - } } /** {@inheritDoc} */ Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/bitmap/DitherUtil.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/bitmap/DitherUtil.java?rev=1785982&r1=1785981&r2=1785982&view=diff ============================================================================== --- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/bitmap/DitherUtil.java (original) +++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/util/bitmap/DitherUtil.java Wed Mar 8 15:15:06 2017 @@ -113,7 +113,7 @@ public final class DitherUtil { throw new IllegalArgumentException("Unsupported dither matrix: " + matrix); } if (doubleMatrix) { - if (doubleMatrix && (matrix != DITHER_MATRIX_4X4)) { + if (matrix != DITHER_MATRIX_4X4) { throw new IllegalArgumentException("doubleMatrix=true is only allowed for 4x4"); } dither = new byte[bayer.length / 8 * 4]; --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org