diff --git a/src/java/org/apache/poi/hpsf/SpecialPropertySet.java b/src/java/org/apache/poi/hpsf/SpecialPropertySet.java index c40641aa9..993765f6a 100644 --- a/src/java/org/apache/poi/hpsf/SpecialPropertySet.java +++ b/src/java/org/apache/poi/hpsf/SpecialPropertySet.java @@ -51,17 +51,14 @@ import org.apache.poi.util.LittleEndian; * general {@link PropertySet}. However, the current implementation * went the other way round historically: the convenience classes came * only late to my mind.
- * - * @author Rainer Klute <klute@rainer-klute.de> */ public abstract class SpecialPropertySet extends MutablePropertySet { - /** - * The id to name mapping of the properties - * in this set. - */ - public abstract PropertyIDMap getPropertySetIDMap(); + /** + * The id to name mapping of the properties + * in this set. + */ + public abstract PropertyIDMap getPropertySetIDMap(); /** *The "real" property set SpecialPropertySet
@@ -332,15 +329,17 @@ public abstract class SpecialPropertySet extends MutablePropertySet
* @return The property as a String, or null if unavailable
*/
protected String getPropertyStringValue(final int propertyId) {
- Object o = getProperty(propertyId);
-
+ Object propertyValue = getProperty(propertyId);
+ return getPropertyStringValue(propertyValue);
+ }
+ protected static String getPropertyStringValue(final Object propertyValue) {
// Normal cases
- if (o == null) return null;
- if (o instanceof String) return (String)o;
+ if (propertyValue == null) return null;
+ if (propertyValue instanceof String) return (String)propertyValue;
// Do our best with some edge cases
- if (o instanceof byte[]) {
- byte[] b = (byte[])o;
+ if (propertyValue instanceof byte[]) {
+ byte[] b = (byte[])propertyValue;
if (b.length == 0) {
return "";
}
@@ -356,7 +355,7 @@ public abstract class SpecialPropertySet extends MutablePropertySet
// Maybe it's a string? who knows!
return new String(b);
}
- return o.toString();
+ return propertyValue.toString();
}
diff --git a/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java b/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java
index 7907408c0..7150b6c1c 100644
--- a/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java
+++ b/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java
@@ -32,7 +32,6 @@ import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hpsf.wellknown.PropertyIDMap;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-import org.apache.poi.util.LittleEndian;
/**
* Extracts all of the HPSF properties, both
@@ -66,7 +65,7 @@ public class HPSFPropertiesExtractor extends POITextExtractor {
Iterator