diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2008-05-13 09:58:01 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2008-05-13 09:58:01 +0000 |
commit | 2c493c4789790b291b7c0213c9e82c6b7e63cf80 (patch) | |
tree | 47ab22a995c51986a88a7fbcbdda9fdc4ce5f853 /src/java | |
parent | 1781e21b478c18a34a8050ad5a31b36292905ca6 (diff) | |
download | xmlgraphics-fop-2c493c4789790b291b7c0213c9e82c6b7e63cf80.tar.gz xmlgraphics-fop-2c493c4789790b291b7c0213c9e82c6b7e63cf80.zip |
Undo r655765, which was causing NPEs in the layout-tests
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@655791 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/fo/FOEventHandler.java | 13 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/FOPropertyMapping.java | 2 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/properties/StringProperty.java | 44 |
3 files changed, 2 insertions, 57 deletions
diff --git a/src/java/org/apache/fop/fo/FOEventHandler.java b/src/java/org/apache/fop/fo/FOEventHandler.java index 149e614d0..7521d398c 100644 --- a/src/java/org/apache/fop/fo/FOEventHandler.java +++ b/src/java/org/apache/fop/fo/FOEventHandler.java @@ -79,10 +79,6 @@ public abstract class FOEventHandler { * This is used so we know if the FO tree contains duplicates. */ private Set idReferences = new HashSet(); - /** - * Keeps track of the last automatically generated id in the current document - */ - private long lastGeneratedId = 1; /** * The property list maker. @@ -182,15 +178,6 @@ public abstract class FOEventHandler { } /** - * Return the next value for automatically generated ids - * - * @return the next value to append to automatically generated ids - */ - public long getNextId() { - return this.lastGeneratedId++; - } - - /** * This method is called to indicate the start of a new document run. * @throws SAXException In case of a problem */ diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index 96cbc5329..8fed90a35 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -2503,7 +2503,7 @@ public final class FOPropertyMapping implements Constants { addPropertyMaker("content-type", m); // id - m = new StringProperty.IdMaker(PR_ID); + m = new StringProperty.Maker(PR_ID); m.setInherited(false); m.setDefault(""); addPropertyMaker("id", m); diff --git a/src/java/org/apache/fop/fo/properties/StringProperty.java b/src/java/org/apache/fop/fo/properties/StringProperty.java index 8880921de..087feb350 100644 --- a/src/java/org/apache/fop/fo/properties/StringProperty.java +++ b/src/java/org/apache/fop/fo/properties/StringProperty.java @@ -81,49 +81,7 @@ public final class StringProperty extends Property { } } - - /** - * Inner class dedicated to the "id" property, which should provide a random - * unique identifier as an initial value. - * The values for "id" are never cached, as they're typically valid for one - * document. - */ - public static class IdMaker extends PropertyMaker { - - /** - * @param propId the id of the property for which the maker should be created - */ - public IdMaker(int propId) { - super(propId); - } - - /** {@inheritDoc} */ - public Property make(PropertyList propertyList) throws PropertyException { - String newId = "FO_"; - newId += propertyList.getFObj().getFOEventHandler().getNextId(); - return new StringProperty(newId); - } - - /** {@inheritDoc} */ - public Property make(PropertyList propertyList, - String value, - FObj fo) throws PropertyException { - - Property idProp; - - //no parsing necessary; just return a new StringProperty - //TODO: Should we move validation here? (see FObj#checkId()) - if ("".equals(value)) { - //if an empty string was specified, return the default - idProp = this.make(propertyList); - } else { - idProp = new StringProperty(value); - } - - return idProp; - } - } - + /** cache containing all canonical StringProperty instances */ private static final PropertyCache cache = new PropertyCache(StringProperty.class); |