From 5eeb7821e5aa84267a980f945c472074b017f043 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Fri, 11 Feb 2011 17:49:16 +0000 Subject: [PATCH] A few minor nits... git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1069908 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/layoutmgr/AbstractBreaker.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java index 402161a92..253790623 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java @@ -429,7 +429,7 @@ public abstract class AbstractBreaker { effectiveList); blockListIndex = -1; } else { - log.debug("PLM> iOptPageCount= " + optimalPageCount + log.debug("PLM> optimalPageCount= " + optimalPageCount + " pageBreaks.size()= " + alg.getPageBreaks().size()); //*** Phase 3: Add areas *** @@ -455,11 +455,7 @@ public abstract class AbstractBreaker { return true; } else { Position subPosition = position.getPosition(); - if (subPosition == null) { - return false; - } else { - return containsNonRestartableLM(subPosition); - } + return subPosition != null && containsNonRestartableLM(subPosition); } } @@ -501,7 +497,7 @@ public abstract class AbstractBreaker { int endElementIndex = 0; int lastBreak = -1; for (int p = startPart; p < startPart + partCount; p++) { - PageBreakPosition pbp = (PageBreakPosition) alg.getPageBreaks().get(p); + PageBreakPosition pbp = alg.getPageBreaks().get(p); //Check the last break position for forced breaks int lastBreakClass; @@ -761,7 +757,7 @@ public abstract class AbstractBreaker { /* Retrieve the original position wrapped into this space position */ positionAtBreak = positionAtBreak.getPosition(); LayoutManager restartAtLM = null; - List firstElements = Collections.EMPTY_LIST; + List firstElements = Collections.emptyList(); if (containsNonRestartableLM(positionAtBreak)) { if (alg.getIPDdifference() > 0) { EventBroadcaster eventBroadcaster = getCurrentChildLM().getFObj() @@ -875,11 +871,11 @@ public abstract class AbstractBreaker { */ private BlockSequence justifyBoxes // CSOK: MethodLength (BlockSequence blockList, PageBreakingAlgorithm alg, int availableBPD) { - int iOptPageNumber; + int optimalPageCount; alg.setConstantLineWidth(availableBPD); - iOptPageNumber = alg.findBreakingPoints(blockList, /*availableBPD,*/ + optimalPageCount = alg.findBreakingPoints(blockList, /*availableBPD,*/ 1, true, BreakingAlgorithm.ALL_BREAKS); - log.debug("PLM> iOptPageNumber= " + iOptPageNumber); + log.debug("PLM> optimalPageCount= " + optimalPageCount); // ListIterator sequenceIterator = blockList.listIterator(); @@ -904,7 +900,7 @@ public abstract class AbstractBreaker { // inside the // while loop must be a box KnuthElement firstElement; - while ( sequenceIterator.hasNext() ) { + while (sequenceIterator.hasNext()) { firstElement = sequenceIterator.next(); if ( !firstElement.isBox() ) { log.debug("PLM> ignoring glue or penalty element " -- 2.39.5