diff options
author | Dominik Stadler <centic@apache.org> | 2013-08-23 10:44:39 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2013-08-23 10:44:39 +0000 |
commit | 5a067c6b972cbb2892ba676916622f9f179d220a (patch) | |
tree | 26be2b0d01ea33afd55413ccf60efd08023e54a0 /src/java | |
parent | cb6ca3554d19f4cef1e7807db50a4cceb935eed8 (diff) | |
download | poi-5a067c6b972cbb2892ba676916622f9f179d220a.tar.gz poi-5a067c6b972cbb2892ba676916622f9f179d220a.zip |
fix some Eclipse warnings, adjust some unit tests slightly
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1516818 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/hssf/record/StyleRecord.java | 16 | ||||
-rw-r--r-- | src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java | 6 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/java/org/apache/poi/hssf/record/StyleRecord.java b/src/java/org/apache/poi/hssf/record/StyleRecord.java index ef2f703617..77e677485d 100644 --- a/src/java/org/apache/poi/hssf/record/StyleRecord.java +++ b/src/java/org/apache/poi/hssf/record/StyleRecord.java @@ -61,7 +61,7 @@ public final class StyleRecord extends StandardRecord { field_3_outline_style_level = in.readByte(); } else { int field_2_name_length = in.readShort(); - + if(in.remaining() < 1) { // Some files from Crystal Reports lack the is16BitUnicode byte // the remaining fields, which is naughty @@ -71,7 +71,7 @@ public final class StyleRecord extends StandardRecord { // guess this is OK if the string length is zero field_4_name = ""; } else { - + field_3_stringHasMultibyte = in.readByte() != 0x00; if (field_3_stringHasMultibyte) { field_4_name = StringUtil.readUnicodeLE(in, field_2_name_length); @@ -92,7 +92,7 @@ public final class StyleRecord extends StandardRecord { /** * get the actual index of the style extended format record - * @see #getXFIndex() + * @see #getXFIndex() * @return index of the xf record */ public int getXFIndex() { @@ -138,6 +138,7 @@ public final class StyleRecord extends StandardRecord { return field_4_name; } + @Override public String toString() { StringBuffer sb = new StringBuffer(); @@ -155,16 +156,18 @@ public final class StyleRecord extends StandardRecord { return sb.toString(); } - + + @Override protected int getDataSize() { if (isBuiltin()) { return 4; // short, byte, byte } - return 2 // short xf index - + 3 // str len + flag + return 2 // short xf index + + 3 // str len + flag + field_4_name.length() * (field_3_stringHasMultibyte ? 2 : 1); } + @Override public void serialize(LittleEndianOutput out) { out.writeShort(field_1_xf_index); if (isBuiltin()) { @@ -181,6 +184,7 @@ public final class StyleRecord extends StandardRecord { } } + @Override public short getSid() { return sid; } diff --git a/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java b/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java index d73a31ee8e..551ff75474 100644 --- a/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java +++ b/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java @@ -21,7 +21,7 @@ import org.apache.poi.ss.formula.udf.UDFFinder; import java.util.*; /** - * Analysis Toolpack Function Definitions + * Analysis Toolpack Function Definitions */ public final class AnalysisToolPak implements UDFFinder { @@ -229,9 +229,9 @@ public final class AnalysisToolPak implements UDFFinder { if(metaData != null) { throw new IllegalArgumentException(name + " is a built-in Excel function. " + "Use FunctoinEval.registerFunction(String name, Function func) instead."); - } else { - throw new IllegalArgumentException(name + " is not a function from the Excel Analysis Toolpack."); } + + throw new IllegalArgumentException(name + " is not a function from the Excel Analysis Toolpack."); } FreeRefFunction f = inst.findFunction(name); if(f != null && !(f instanceof NotImplemented)) { |