fix findbugs issues

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748080 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-06-13 03:48:30 +00:00
parent 9d58a47e0c
commit 55b675a384
4 changed files with 14 additions and 3 deletions

View File

@ -106,7 +106,7 @@ public class EscherComplexProperty extends EscherProperty {
if (this == o) {
return true;
}
if (!(o instanceof EscherComplexProperty)) {
if (o == null || !(o instanceof EscherComplexProperty)) {
return false;
}

View File

@ -92,7 +92,9 @@ public class RecordGenerator {
// Generate record
String destinationPath = destSrcPathDir + "/" + packageName;
File destinationPathFile = new File(destinationPath);
destinationPathFile.mkdirs();
if (destinationPathFile.mkdirs()) {
System.out.println("Created destination directory: " + destinationPath);
}
String destinationFilepath = destinationPath + "/" + recordName + suffix + ".java";
transform(file, new File(destinationFilepath),
new File(recordStyleDir + "/" + extendstg.toLowerCase(Locale.ROOT) + ".xsl"));
@ -101,7 +103,9 @@ public class RecordGenerator {
// Generate test (if not already generated)
destinationPath = testSrcPathDir + "/" + packageName;
destinationPathFile = new File(destinationPath);
destinationPathFile.mkdirs();
if (destinationPathFile.mkdirs()) {
System.out.println("Created destination directory: " + destinationPath);
}
destinationFilepath = destinationPath + "/Test" + recordName + suffix + ".java";
if (new File(destinationFilepath).exists() == false) {
String temp = (recordStyleDir + "/" + extendstg.toLowerCase(Locale.ROOT) + "_test.xsl");

View File

@ -24,6 +24,9 @@ class Decimal
{
static final int SIZE = 16;
/**
* Findbugs: UNR_UNREAD_FIELD
*/
private short field_1_wReserved;
private byte field_2_scale;
private byte field_3_sign;

View File

@ -80,6 +80,10 @@
<Class name="org.apache.poi.xssf.model.IndexedUDFFinder"/>
<Bug code="Nm" />
</Match>
<Match>
<Class name="org.apache.poi.hpsf.Decimal"/>
<Bug pattern="URF_UNREAD_FIELD" />
</Match>
<!-- named this way on purpose -->
<Match>