You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by jb...@apache.org on 2019/05/22 08:57:40 UTC

[beam] branch master updated: [BEAM-6888] Enable SpotBugs in JdbcIO

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new e754666  [BEAM-6888] Enable SpotBugs in JdbcIO
     new 67e0eaf  Merge pull request #8647 from iemejia/BEAM-6888-jdbc-enable-spotbugs
e754666 is described below

commit e7546662960550cdaf63990582ed16a5c527d1f6
Author: Ismaël Mejía <ie...@gmail.com>
AuthorDate: Wed May 22 10:24:32 2019 +0200

    [BEAM-6888] Enable SpotBugs in JdbcIO
---
 .../build-tools/src/main/resources/beam/spotbugs-filter.xml    | 10 ++++++++++
 sdks/java/io/jdbc/build.gradle                                 |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/sdks/java/build-tools/src/main/resources/beam/spotbugs-filter.xml b/sdks/java/build-tools/src/main/resources/beam/spotbugs-filter.xml
index d69c9d3..f46da65 100644
--- a/sdks/java/build-tools/src/main/resources/beam/spotbugs-filter.xml
+++ b/sdks/java/build-tools/src/main/resources/beam/spotbugs-filter.xml
@@ -411,4 +411,14 @@
     <Bug pattern="URF_UNREAD_FIELD"/>
     <!-- Fix build. -->
   </Match>
+
+  <Match>
+    <!--
+      This is a false positive. Spotbugs does not recognize the use of try-with-resources, so it thinks that
+      the connection is not correctly closed.
+    -->
+    <Class name="org.apache.beam.sdk.io.jdbc.JdbcIO$ReadFn"/>
+    <Method name="processElement"/>
+    <Bug pattern="OBL_UNSATISFIED_OBLIGATION"/>
+  </Match>
 </FindBugsFilter>
diff --git a/sdks/java/io/jdbc/build.gradle b/sdks/java/io/jdbc/build.gradle
index ca7bb2a..6942f16 100644
--- a/sdks/java/io/jdbc/build.gradle
+++ b/sdks/java/io/jdbc/build.gradle
@@ -17,7 +17,7 @@
  */
 
 plugins { id 'org.apache.beam.module' }
-applyJavaNature(enableSpotbugs: false)
+applyJavaNature()
 provideIntegrationTestingDependencies()
 enableJavaPerformanceTesting()