You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by iv...@apache.org on 2012/06/28 19:32:27 UTC

svn commit: r1355083 - in /zookeeper/bookkeeper/trunk: ./ bookkeeper-server/ bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ bookkeeper-server/src/main/resources/ hedwig-protocol/ hedwig-protocol/src/main/resources/

Author: ivank
Date: Thu Jun 28 17:32:26 2012
New Revision: 1355083

URL: http://svn.apache.org/viewvc?rev=1355083&view=rev
Log:
BOOKKEEPER-322: New protobufs generates findbugs errors (ivank)

Added:
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/resources/findbugsExclude.xml
    zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/resources/
    zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/resources/findbugsExclude.xml
Modified:
    zookeeper/bookkeeper/trunk/CHANGES.txt
    zookeeper/bookkeeper/trunk/bookkeeper-server/pom.xml
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java
    zookeeper/bookkeeper/trunk/hedwig-protocol/pom.xml

Modified: zookeeper/bookkeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/CHANGES.txt?rev=1355083&r1=1355082&r2=1355083&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/CHANGES.txt (original)
+++ zookeeper/bookkeeper/trunk/CHANGES.txt Thu Jun 28 17:32:26 2012
@@ -26,6 +26,8 @@ Trunk (unreleased changes)
 
         BOOKKEEPER-307: BookieShell introduces 4 findbugs warnings (ivank via sijie)
 
+        BOOKKEEPER-322: New protobufs generates findbugs errors (ivank)
+
       hedwig-client:
 
         BOOKKEEPER-274: Hedwig cpp client library should not link to cppunit which is just used for test. (sijie via ivank)

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/pom.xml
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/pom.xml?rev=1355083&r1=1355082&r2=1355083&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/pom.xml (original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/pom.xml Thu Jun 28 17:32:26 2012
@@ -150,6 +150,24 @@
         </configuration>
       </plugin>
       <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <version>0.7</version>
+        <configuration>
+          <excludes>
+            <!-- exclude generated file //-->
+            <exclude>**/DataFormats.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <configuration>
+          <excludeFilterFile>${basedir}/src/main/resources/findbugsExclude.xml</excludeFilterFile>
+        </configuration>
+      </plugin>
+      <plugin>
 	<artifactId>maven-dependency-plugin</artifactId>
 	<executions>
 	  <execution>

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java?rev=1355083&r1=1355082&r2=1355083&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java (original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerMetadata.java Thu Jun 28 17:32:26 2012
@@ -251,7 +251,9 @@ public class LedgerMetadata {
         }
         BufferedReader reader = new BufferedReader(new StringReader(config));
         String versionLine = reader.readLine();
-
+        if (versionLine == null) {
+            throw new IOException("Invalid metadata. Content missing");
+        }
         int i = 0;
         if (versionLine.startsWith(VERSION_KEY)) {
             String parts[] = versionLine.split(tSplitter);

Added: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/resources/findbugsExclude.xml
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/resources/findbugsExclude.xml?rev=1355083&view=auto
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/resources/findbugsExclude.xml (added)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/resources/findbugsExclude.xml Thu Jun 28 17:32:26 2012
@@ -0,0 +1,23 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+//-->
+<FindBugsFilter>
+  <Match>
+    <!-- generated code, we can't be held responsible for findbugs in it //-->
+    <Class name="~org\.apache\.bookkeeper\.proto\.DataFormats.*" />
+  </Match>
+</FindBugsFilter>

Modified: zookeeper/bookkeeper/trunk/hedwig-protocol/pom.xml
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-protocol/pom.xml?rev=1355083&r1=1355082&r2=1355083&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-protocol/pom.xml (original)
+++ zookeeper/bookkeeper/trunk/hedwig-protocol/pom.xml Thu Jun 28 17:32:26 2012
@@ -65,6 +65,13 @@
 	  </excludes>
 	</configuration>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <configuration>
+          <excludeFilterFile>${basedir}/src/main/resources/findbugsExclude.xml</excludeFilterFile>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
   <profiles>

Added: zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/resources/findbugsExclude.xml
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/resources/findbugsExclude.xml?rev=1355083&view=auto
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/resources/findbugsExclude.xml (added)
+++ zookeeper/bookkeeper/trunk/hedwig-protocol/src/main/resources/findbugsExclude.xml Thu Jun 28 17:32:26 2012
@@ -0,0 +1,23 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+//-->
+<FindBugsFilter>
+  <Match>
+    <!-- generated code, we can't be held responsible for findbugs in it //-->
+    <Class name="~org\.apache\.hedwig\.protocol\.PubSubProtocol.*" />
+  </Match>
+</FindBugsFilter>