From 5b1b919ec8439126adec6502a70ac89d6e4dfaf5 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Tue, 3 Dec 2002 07:41:03 +0000 Subject: [PATCH] sparsePropsMap changed from HashMap to int[]. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195726 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/flow/FoBasicLink.java | 9 +++++---- src/org/apache/fop/fo/flow/FoBidiOverride.java | 9 +++++---- src/org/apache/fop/fo/flow/FoBlock.java | 9 +++++---- src/org/apache/fop/fo/flow/FoBlockContainer.java | 9 +++++---- src/org/apache/fop/fo/flow/FoCharacter.java | 9 +++++---- src/org/apache/fop/fo/flow/FoExternalGraphic.java | 9 +++++---- src/org/apache/fop/fo/flow/FoFloat.java | 9 +++++---- src/org/apache/fop/fo/flow/FoFlow.java | 9 +++++---- src/org/apache/fop/fo/flow/FoFootnote.java | 9 +++++---- src/org/apache/fop/fo/flow/FoFootnoteBody.java | 9 +++++---- src/org/apache/fop/fo/flow/FoInitialPropertySet.java | 9 +++++---- src/org/apache/fop/fo/flow/FoInline.java | 9 +++++---- src/org/apache/fop/fo/flow/FoInlineContainer.java | 9 +++++---- src/org/apache/fop/fo/flow/FoInstreamForeignObject.java | 9 +++++---- src/org/apache/fop/fo/flow/FoLeader.java | 9 +++++---- src/org/apache/fop/fo/flow/FoListBlock.java | 9 +++++---- src/org/apache/fop/fo/flow/FoListItem.java | 9 +++++---- src/org/apache/fop/fo/flow/FoListItemBody.java | 9 +++++---- src/org/apache/fop/fo/flow/FoListItemLabel.java | 9 +++++---- src/org/apache/fop/fo/flow/FoMarker.java | 9 +++++---- src/org/apache/fop/fo/flow/FoMultiCase.java | 9 +++++---- src/org/apache/fop/fo/flow/FoMultiProperties.java | 9 +++++---- src/org/apache/fop/fo/flow/FoMultiPropertySet.java | 9 +++++---- src/org/apache/fop/fo/flow/FoMultiSwitch.java | 9 +++++---- src/org/apache/fop/fo/flow/FoMultiToggle.java | 9 +++++---- src/org/apache/fop/fo/flow/FoNoFo.java | 7 ++++--- src/org/apache/fop/fo/flow/FoPageNumber.java | 9 +++++---- src/org/apache/fop/fo/flow/FoPageNumberCitation.java | 9 +++++---- src/org/apache/fop/fo/flow/FoPageSequence.java | 9 +++++---- src/org/apache/fop/fo/flow/FoPcdata.java | 9 +++++---- src/org/apache/fop/fo/flow/FoRetrieveMarker.java | 9 +++++---- src/org/apache/fop/fo/flow/FoStaticContent.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTable.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableAndCaption.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableBody.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableCaption.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableCell.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableColumn.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableFooter.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableHeader.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTableRow.java | 9 +++++---- src/org/apache/fop/fo/flow/FoTitle.java | 9 +++++---- src/org/apache/fop/fo/flow/FoWrapper.java | 9 +++++---- 43 files changed, 214 insertions(+), 171 deletions(-) diff --git a/src/org/apache/fop/fo/flow/FoBasicLink.java b/src/org/apache/fop/fo/flow/FoBasicLink.java index 7b25ff0ac..b8047687d 100644 --- a/src/org/apache/fop/fo/flow/FoBasicLink.java +++ b/src/org/apache/fop/fo/flow/FoBasicLink.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoBasicLink extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -83,7 +84,8 @@ public class FoBasicLink extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -91,8 +93,7 @@ public class FoBasicLink extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoBidiOverride.java b/src/org/apache/fop/fo/flow/FoBidiOverride.java index 393c396e1..b0e2783da 100644 --- a/src/org/apache/fop/fo/flow/FoBidiOverride.java +++ b/src/org/apache/fop/fo/flow/FoBidiOverride.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoBidiOverride extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -70,7 +71,8 @@ public class FoBidiOverride extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -78,8 +80,7 @@ public class FoBidiOverride extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoBlock.java b/src/org/apache/fop/fo/flow/FoBlock.java index dac8f2d62..e2bdd6b4b 100644 --- a/src/org/apache/fop/fo/flow/FoBlock.java +++ b/src/org/apache/fop/fo/flow/FoBlock.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoBlock extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -96,7 +97,8 @@ public class FoBlock extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -104,8 +106,7 @@ public class FoBlock extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoBlockContainer.java b/src/org/apache/fop/fo/flow/FoBlockContainer.java index 70643c7dc..f7ad4789b 100644 --- a/src/org/apache/fop/fo/flow/FoBlockContainer.java +++ b/src/org/apache/fop/fo/flow/FoBlockContainer.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoBlockContainer extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -82,7 +83,8 @@ public class FoBlockContainer extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -90,8 +92,7 @@ public class FoBlockContainer extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoCharacter.java b/src/org/apache/fop/fo/flow/FoCharacter.java index 84d6198b1..9af682fcd 100644 --- a/src/org/apache/fop/fo/flow/FoCharacter.java +++ b/src/org/apache/fop/fo/flow/FoCharacter.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoCharacter extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -87,7 +88,8 @@ public class FoCharacter extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -95,8 +97,7 @@ public class FoCharacter extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoExternalGraphic.java b/src/org/apache/fop/fo/flow/FoExternalGraphic.java index fa0df3121..de4c5d1e2 100644 --- a/src/org/apache/fop/fo/flow/FoExternalGraphic.java +++ b/src/org/apache/fop/fo/flow/FoExternalGraphic.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoExternalGraphic extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -85,7 +86,8 @@ public class FoExternalGraphic extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -93,8 +95,7 @@ public class FoExternalGraphic extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoFloat.java b/src/org/apache/fop/fo/flow/FoFloat.java index c81afb6b8..6ff415c26 100644 --- a/src/org/apache/fop/fo/flow/FoFloat.java +++ b/src/org/apache/fop/fo/flow/FoFloat.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoFloat extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -60,7 +61,8 @@ public class FoFloat extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -68,8 +70,7 @@ public class FoFloat extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoFlow.java b/src/org/apache/fop/fo/flow/FoFlow.java index 9fdaf0a87..4246e46c2 100644 --- a/src/org/apache/fop/fo/flow/FoFlow.java +++ b/src/org/apache/fop/fo/flow/FoFlow.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoFlow extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,10 +60,10 @@ public class FoFlow extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(1); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = 1; - sparsePropsMap.put - (Ints.consts.get(PropNames.FLOW_NAME), Ints.consts.get(0)); + sparsePropsMap[PropNames.FLOW_NAME] = 0; sparseIndices = new int[] { PropNames.FLOW_NAME }; } diff --git a/src/org/apache/fop/fo/flow/FoFootnote.java b/src/org/apache/fop/fo/flow/FoFootnote.java index 0cc295c7d..72152d486 100644 --- a/src/org/apache/fop/fo/flow/FoFootnote.java +++ b/src/org/apache/fop/fo/flow/FoFootnote.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -50,7 +51,7 @@ public class FoFootnote extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -69,7 +70,8 @@ public class FoFootnote extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -77,8 +79,7 @@ public class FoFootnote extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoFootnoteBody.java b/src/org/apache/fop/fo/flow/FoFootnoteBody.java index 7d8b24cbe..df6a438eb 100644 --- a/src/org/apache/fop/fo/flow/FoFootnoteBody.java +++ b/src/org/apache/fop/fo/flow/FoFootnoteBody.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoFootnoteBody extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,7 +60,8 @@ public class FoFootnoteBody extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -67,8 +69,7 @@ public class FoFootnoteBody extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoInitialPropertySet.java b/src/org/apache/fop/fo/flow/FoInitialPropertySet.java index a43e866d7..6d7ce3124 100644 --- a/src/org/apache/fop/fo/flow/FoInitialPropertySet.java +++ b/src/org/apache/fop/fo/flow/FoInitialPropertySet.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoInitialPropertySet extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -72,7 +73,8 @@ public class FoInitialPropertySet extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -80,8 +82,7 @@ public class FoInitialPropertySet extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoInline.java b/src/org/apache/fop/fo/flow/FoInline.java index ad5308eaf..3ac452318 100644 --- a/src/org/apache/fop/fo/flow/FoInline.java +++ b/src/org/apache/fop/fo/flow/FoInline.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoInline extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -85,7 +86,8 @@ public class FoInline extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -93,8 +95,7 @@ public class FoInline extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoInlineContainer.java b/src/org/apache/fop/fo/flow/FoInlineContainer.java index ba4609c1f..c8ba183f3 100644 --- a/src/org/apache/fop/fo/flow/FoInlineContainer.java +++ b/src/org/apache/fop/fo/flow/FoInlineContainer.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoInlineContainer extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -81,7 +82,8 @@ public class FoInlineContainer extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -89,8 +91,7 @@ public class FoInlineContainer extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoInstreamForeignObject.java b/src/org/apache/fop/fo/flow/FoInstreamForeignObject.java index e568a2535..7c5783fd2 100644 --- a/src/org/apache/fop/fo/flow/FoInstreamForeignObject.java +++ b/src/org/apache/fop/fo/flow/FoInstreamForeignObject.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoInstreamForeignObject extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -84,7 +85,8 @@ public class FoInstreamForeignObject extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -92,8 +94,7 @@ public class FoInstreamForeignObject extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoLeader.java b/src/org/apache/fop/fo/flow/FoLeader.java index 988bdb99c..e3b307b48 100644 --- a/src/org/apache/fop/fo/flow/FoLeader.java +++ b/src/org/apache/fop/fo/flow/FoLeader.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoLeader extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -88,7 +89,8 @@ public class FoLeader extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -96,8 +98,7 @@ public class FoLeader extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoListBlock.java b/src/org/apache/fop/fo/flow/FoListBlock.java index e346ea5e0..de5ee9266 100644 --- a/src/org/apache/fop/fo/flow/FoListBlock.java +++ b/src/org/apache/fop/fo/flow/FoListBlock.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoListBlock extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -73,7 +74,8 @@ public class FoListBlock extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -81,8 +83,7 @@ public class FoListBlock extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoListItem.java b/src/org/apache/fop/fo/flow/FoListItem.java index a7c178e3d..c9d752c3f 100644 --- a/src/org/apache/fop/fo/flow/FoListItem.java +++ b/src/org/apache/fop/fo/flow/FoListItem.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoListItem extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -72,7 +73,8 @@ public class FoListItem extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -80,8 +82,7 @@ public class FoListItem extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoListItemBody.java b/src/org/apache/fop/fo/flow/FoListItemBody.java index 5fb1e1130..433f4ed3a 100644 --- a/src/org/apache/fop/fo/flow/FoListItemBody.java +++ b/src/org/apache/fop/fo/flow/FoListItemBody.java @@ -25,6 +25,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoListItemBody extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -62,7 +63,8 @@ public class FoListItemBody extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -70,8 +72,7 @@ public class FoListItemBody extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoListItemLabel.java b/src/org/apache/fop/fo/flow/FoListItemLabel.java index 92c179cc2..f938e6051 100644 --- a/src/org/apache/fop/fo/flow/FoListItemLabel.java +++ b/src/org/apache/fop/fo/flow/FoListItemLabel.java @@ -25,6 +25,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoListItemLabel extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -62,7 +63,8 @@ public class FoListItemLabel extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -70,8 +72,7 @@ public class FoListItemLabel extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoMarker.java b/src/org/apache/fop/fo/flow/FoMarker.java index 964613110..d43a2cfc8 100644 --- a/src/org/apache/fop/fo/flow/FoMarker.java +++ b/src/org/apache/fop/fo/flow/FoMarker.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoMarker extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,11 +60,11 @@ public class FoMarker extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(1); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = 1; sparseIndices = new int[] { PropNames.MARKER_CLASS_NAME }; - sparsePropsMap.put - (Ints.consts.get(PropNames.MARKER_CLASS_NAME), Ints.consts.get(0)); + sparsePropsMap[PropNames.MARKER_CLASS_NAME] = 0; } /** diff --git a/src/org/apache/fop/fo/flow/FoMultiCase.java b/src/org/apache/fop/fo/flow/FoMultiCase.java index e204deefe..026f12f12 100644 --- a/src/org/apache/fop/fo/flow/FoMultiCase.java +++ b/src/org/apache/fop/fo/flow/FoMultiCase.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoMultiCase extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -64,7 +65,8 @@ public class FoMultiCase extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -72,8 +74,7 @@ public class FoMultiCase extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoMultiProperties.java b/src/org/apache/fop/fo/flow/FoMultiProperties.java index 3a98de9eb..f89407f8c 100644 --- a/src/org/apache/fop/fo/flow/FoMultiProperties.java +++ b/src/org/apache/fop/fo/flow/FoMultiProperties.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoMultiProperties extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,7 +60,8 @@ public class FoMultiProperties extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -67,8 +69,7 @@ public class FoMultiProperties extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoMultiPropertySet.java b/src/org/apache/fop/fo/flow/FoMultiPropertySet.java index 251b14cdd..5bc785549 100644 --- a/src/org/apache/fop/fo/flow/FoMultiPropertySet.java +++ b/src/org/apache/fop/fo/flow/FoMultiPropertySet.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoMultiPropertySet extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -58,7 +59,8 @@ public class FoMultiPropertySet extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -66,8 +68,7 @@ public class FoMultiPropertySet extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoMultiSwitch.java b/src/org/apache/fop/fo/flow/FoMultiSwitch.java index dadc06c8a..a73863f63 100644 --- a/src/org/apache/fop/fo/flow/FoMultiSwitch.java +++ b/src/org/apache/fop/fo/flow/FoMultiSwitch.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoMultiSwitch extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -60,7 +61,8 @@ public class FoMultiSwitch extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -68,8 +70,7 @@ public class FoMultiSwitch extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoMultiToggle.java b/src/org/apache/fop/fo/flow/FoMultiToggle.java index cbc50de89..60c31269f 100644 --- a/src/org/apache/fop/fo/flow/FoMultiToggle.java +++ b/src/org/apache/fop/fo/flow/FoMultiToggle.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoMultiToggle extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -62,7 +63,8 @@ public class FoMultiToggle extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -70,8 +72,7 @@ public class FoMultiToggle extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoNoFo.java b/src/org/apache/fop/fo/flow/FoNoFo.java index 2f8990ba4..c459fe732 100644 --- a/src/org/apache/fop/fo/flow/FoNoFo.java +++ b/src/org/apache/fop/fo/flow/FoNoFo.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoNoFo { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - //private static final HashMap sparsePropsMap; + //private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -58,10 +59,10 @@ public class FoNoFo { // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. sparsePropsMap = new HashMap(1); + Arrays.fill(sparsePropsMap, -1); numProps = 1; sparseIndices = new int[] { PropNames.NO_PROPERTY }; - sparsePropsMap.put - (Ints.consts.get(PropNames.NO_PROPERTY), Ints.consts.get(0)); + sparsePropsMap[PropNames.NO_PROPERTY] = 0; } */ diff --git a/src/org/apache/fop/fo/flow/FoPageNumber.java b/src/org/apache/fop/fo/flow/FoPageNumber.java index f268477e5..beaba9584 100644 --- a/src/org/apache/fop/fo/flow/FoPageNumber.java +++ b/src/org/apache/fop/fo/flow/FoPageNumber.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoPageNumber extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -83,7 +84,8 @@ public class FoPageNumber extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -91,8 +93,7 @@ public class FoPageNumber extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoPageNumberCitation.java b/src/org/apache/fop/fo/flow/FoPageNumberCitation.java index fa8d67b5c..282e948a5 100644 --- a/src/org/apache/fop/fo/flow/FoPageNumberCitation.java +++ b/src/org/apache/fop/fo/flow/FoPageNumberCitation.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoPageNumberCitation extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -84,7 +85,8 @@ public class FoPageNumberCitation extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -92,8 +94,7 @@ public class FoPageNumberCitation extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoPageSequence.java b/src/org/apache/fop/fo/flow/FoPageSequence.java index 15cd2d83c..9727a9c15 100644 --- a/src/org/apache/fop/fo/flow/FoPageSequence.java +++ b/src/org/apache/fop/fo/flow/FoPageSequence.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; import java.util.NoSuchElementException; @@ -40,7 +41,7 @@ public class FoPageSequence extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -68,7 +69,8 @@ public class FoPageSequence extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -76,8 +78,7 @@ public class FoPageSequence extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoPcdata.java b/src/org/apache/fop/fo/flow/FoPcdata.java index e1376fecd..72b5b8101 100644 --- a/src/org/apache/fop/fo/flow/FoPcdata.java +++ b/src/org/apache/fop/fo/flow/FoPcdata.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoPcdata extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -87,7 +88,8 @@ public class FoPcdata extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -95,8 +97,7 @@ public class FoPcdata extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoRetrieveMarker.java b/src/org/apache/fop/fo/flow/FoRetrieveMarker.java index d2880148e..735431f75 100644 --- a/src/org/apache/fop/fo/flow/FoRetrieveMarker.java +++ b/src/org/apache/fop/fo/flow/FoRetrieveMarker.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoRetrieveMarker extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,7 +60,8 @@ public class FoRetrieveMarker extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -67,8 +69,7 @@ public class FoRetrieveMarker extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoStaticContent.java b/src/org/apache/fop/fo/flow/FoStaticContent.java index 2496662f3..29840af95 100644 --- a/src/org/apache/fop/fo/flow/FoStaticContent.java +++ b/src/org/apache/fop/fo/flow/FoStaticContent.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoStaticContent extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,10 +60,10 @@ public class FoStaticContent extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(1); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = 1; - sparsePropsMap.put - (Ints.consts.get(PropNames.FLOW_NAME), Ints.consts.get(0)); + sparsePropsMap[PropNames.FLOW_NAME] = 0; sparseIndices = new int[] { PropNames.FLOW_NAME }; } diff --git a/src/org/apache/fop/fo/flow/FoTable.java b/src/org/apache/fop/fo/flow/FoTable.java index c8e6f38fc..367c1abea 100644 --- a/src/org/apache/fop/fo/flow/FoTable.java +++ b/src/org/apache/fop/fo/flow/FoTable.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoTable extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -85,7 +86,8 @@ public class FoTable extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -93,8 +95,7 @@ public class FoTable extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableAndCaption.java b/src/org/apache/fop/fo/flow/FoTableAndCaption.java index b057141a1..47d7e33ad 100644 --- a/src/org/apache/fop/fo/flow/FoTableAndCaption.java +++ b/src/org/apache/fop/fo/flow/FoTableAndCaption.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoTableAndCaption extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -73,7 +74,8 @@ public class FoTableAndCaption extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -81,8 +83,7 @@ public class FoTableAndCaption extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableBody.java b/src/org/apache/fop/fo/flow/FoTableBody.java index fcc2764fc..3fb45d5df 100644 --- a/src/org/apache/fop/fo/flow/FoTableBody.java +++ b/src/org/apache/fop/fo/flow/FoTableBody.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoTableBody extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -68,7 +69,8 @@ public class FoTableBody extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -76,8 +78,7 @@ public class FoTableBody extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableCaption.java b/src/org/apache/fop/fo/flow/FoTableCaption.java index 34f84db77..90c713834 100644 --- a/src/org/apache/fop/fo/flow/FoTableCaption.java +++ b/src/org/apache/fop/fo/flow/FoTableCaption.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoTableCaption extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -71,7 +72,8 @@ public class FoTableCaption extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -79,8 +81,7 @@ public class FoTableCaption extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableCell.java b/src/org/apache/fop/fo/flow/FoTableCell.java index 8f9dfa841..f9b91c28a 100644 --- a/src/org/apache/fop/fo/flow/FoTableCell.java +++ b/src/org/apache/fop/fo/flow/FoTableCell.java @@ -24,6 +24,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -40,7 +41,7 @@ public class FoTableCell extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -81,7 +82,8 @@ public class FoTableCell extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -89,8 +91,7 @@ public class FoTableCell extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableColumn.java b/src/org/apache/fop/fo/flow/FoTableColumn.java index da54a7d49..58d9a4779 100644 --- a/src/org/apache/fop/fo/flow/FoTableColumn.java +++ b/src/org/apache/fop/fo/flow/FoTableColumn.java @@ -22,6 +22,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -38,7 +39,7 @@ public class FoTableColumn extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -67,7 +68,8 @@ public class FoTableColumn extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -75,8 +77,7 @@ public class FoTableColumn extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableFooter.java b/src/org/apache/fop/fo/flow/FoTableFooter.java index a372baf1a..585774cc0 100644 --- a/src/org/apache/fop/fo/flow/FoTableFooter.java +++ b/src/org/apache/fop/fo/flow/FoTableFooter.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoTableFooter extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -68,7 +69,8 @@ public class FoTableFooter extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -76,8 +78,7 @@ public class FoTableFooter extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableHeader.java b/src/org/apache/fop/fo/flow/FoTableHeader.java index 840e95ab1..2c7203527 100644 --- a/src/org/apache/fop/fo/flow/FoTableHeader.java +++ b/src/org/apache/fop/fo/flow/FoTableHeader.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoTableHeader extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -68,7 +69,8 @@ public class FoTableHeader extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -76,8 +78,7 @@ public class FoTableHeader extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTableRow.java b/src/org/apache/fop/fo/flow/FoTableRow.java index 4c3b485dc..9b91776fe 100644 --- a/src/org/apache/fop/fo/flow/FoTableRow.java +++ b/src/org/apache/fop/fo/flow/FoTableRow.java @@ -23,6 +23,7 @@ import org.apache.fop.datastructs.TreeException; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -39,7 +40,7 @@ public class FoTableRow extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -75,7 +76,8 @@ public class FoTableRow extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -83,8 +85,7 @@ public class FoTableRow extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoTitle.java b/src/org/apache/fop/fo/flow/FoTitle.java index d6bd2fa1a..d8f0d0e5d 100644 --- a/src/org/apache/fop/fo/flow/FoTitle.java +++ b/src/org/apache/fop/fo/flow/FoTitle.java @@ -27,6 +27,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -43,7 +44,7 @@ public class FoTitle extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -71,7 +72,8 @@ public class FoTitle extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = propsets.cardinality(); sparseIndices = new int[numProps]; int propx = 0; @@ -79,8 +81,7 @@ public class FoTitle extends FONode { next >= 0; next = propsets.nextSetBit(next + 1)) { sparseIndices[propx] = next; - sparsePropsMap.put - (Ints.consts.get(next), Ints.consts.get(propx++)); + sparsePropsMap[next] = propx++; } } diff --git a/src/org/apache/fop/fo/flow/FoWrapper.java b/src/org/apache/fop/fo/flow/FoWrapper.java index 0d3635b23..4371ac5fe 100644 --- a/src/org/apache/fop/fo/flow/FoWrapper.java +++ b/src/org/apache/fop/fo/flow/FoWrapper.java @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.Ints; import org.apache.fop.messaging.MessageHandler; +import java.util.Arrays; import java.util.HashMap; import java.util.BitSet; @@ -41,7 +42,7 @@ public class FoWrapper extends FONode { position in the sparsePropsSet array. See {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}. */ - private static final HashMap sparsePropsMap; + private static final int[] sparsePropsMap; /** An int array of of the applicable property indices, in property index order. */ @@ -59,11 +60,11 @@ public class FoWrapper extends FONode { // sparsePropsSet is a HashMap containing the indicies of the // sparsePropsSet array, indexed by the FO index of the FO slot // in sparsePropsSet. - sparsePropsMap = new HashMap(1); + sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1]; + Arrays.fill(sparsePropsMap, -1); numProps = 1; sparseIndices = new int[] { PropNames.ID }; - sparsePropsMap.put - (Ints.consts.get(PropNames.ID), Ints.consts.get(0)); + sparsePropsMap[PropNames.MARKER_CLASS_NAME] = 0; } /** -- 2.39.5