]> source.dussan.org Git - jackcess.git/commitdiff
cleanup findbugs report
authorJames Ahlborn <jtahlborn@yahoo.com>
Sun, 1 Nov 2015 02:04:11 +0000 (02:04 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Sun, 1 Nov 2015 02:04:11 +0000 (02:04 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@961 f203690c-595d-4dc9-a70b-905162fa7fd2

pom.xml
src/main/java/com/healthmarketscience/jackcess/impl/OleUtil.java
src/site/pmd/custom-ruleset.xml [new file with mode: 0644]

diff --git a/pom.xml b/pom.xml
index b678c1d79bbd5e1c207a445ee6729a334e92da19..2d03ee1095f79322b4cb97299bfd56b06a924db3 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
   <parent>
     <groupId>com.healthmarketscience</groupId>
     <artifactId>openhms-parent</artifactId>
-    <version>1.1.2</version>
+    <version>1.1.3-SNAPSHOT</version>
   </parent>
   <groupId>com.healthmarketscience.jackcess</groupId>
   <artifactId>jackcess</artifactId>
   </dependencies>
   <reporting>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <configuration>
+          <rulesets>
+            <ruleset>${basedir}/src/site/pmd/custom-ruleset.xml</ruleset>
+          </rulesets>
+        </configuration>
+      </plugin>
       <plugin>
         <artifactId>maven-changes-plugin</artifactId>
         <configuration>
index b1dbdb11448c6b565d2e54d80b811230d50515fb..d8a2336371ec6744c417bd5c361f229c775620f7 100644 (file)
@@ -107,7 +107,7 @@ public class OleUtil
   /**
    * Creates a new OlBlob instance using the given information.
    */
-  public static OleBlob createBlob(OleBlob.Builder oleBuilder)
+  public static OleBlob createBlob(Builder oleBuilder)
     throws IOException
   {
     try {
@@ -183,7 +183,7 @@ public class OleUtil
     }
   }
 
-  private static byte[] writePackageHeader(OleBlob.Builder oleBuilder,
+  private static byte[] writePackageHeader(Builder oleBuilder,
                                            long contentLen) {
 
     byte[] prettyNameBytes = getZeroTermStrBytes(oleBuilder.getPrettyName());
@@ -229,7 +229,7 @@ public class OleUtil
     return headerBytes;
   }
 
-  private static byte[] writePackageStreamHeader(OleBlob.Builder oleBuilder) {
+  private static byte[] writePackageStreamHeader(Builder oleBuilder) {
 
     byte[] fileNameBytes = getZeroTermStrBytes(oleBuilder.getFileName());
     byte[] filePathBytes = getZeroTermStrBytes(oleBuilder.getFilePath());
@@ -264,7 +264,7 @@ public class OleUtil
     return headerBytes;
   }
 
-  private static byte[] writePackageStreamFooter(OleBlob.Builder oleBuilder) {
+  private static byte[] writePackageStreamFooter(Builder oleBuilder) {
 
     // note, these are _not_ zero terminated
     byte[] fileNameBytes = oleBuilder.getFileName().getBytes(OLE_UTF_CHARSET);
@@ -299,19 +299,19 @@ public class OleUtil
 
     // read outer package header
     int headerSize = bb.getShort();
-    int objType = bb.getInt();
+    /* int objType = */ bb.getInt();
     int prettyNameLen = bb.getShort();
     int classNameLen = bb.getShort();
     int prettyNameOff = bb.getShort();
     int classNameOff = bb.getShort();       
-    int objSize = bb.getInt();
+    /* int objSize = */ bb.getInt();
     String prettyName = readStr(bb, prettyNameOff, prettyNameLen);
     String className = readStr(bb, classNameOff, classNameLen);
     bb.position(headerSize);
 
     // read ole header
     int oleVer = bb.getInt();
-    int format = bb.getInt();
+    /* int format = */ bb.getInt();
 
     if(oleVer != OLE_VERSION) {
       return new UnknownContentImpl(blob);
diff --git a/src/site/pmd/custom-ruleset.xml b/src/site/pmd/custom-ruleset.xml
new file mode 100644 (file)
index 0000000..14cfd4f
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+
+<ruleset name="Custom"
+    xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
+  <description>
+Custom ruleset.
+  </description>
+
+  <rule ref="rulesets/java/basic.xml">
+    <exclude name="UselessParentheses"/>
+    <exclude name="CollapsibleIfStatements"/>
+  </rule>
+  <rule ref="rulesets/java/unusedcode.xml">
+    <exclude name="UnusedModifier"/>
+  </rule>
+  <rule ref="rulesets/java/imports.xml">
+    <exclude name="UnusedImports"/>
+  </rule>
+</ruleset>