Browse Source

AMBARI-23773. Suppress FindBugs warnings for EclipseLink-generated code (#1189)

Doroszlai, Attila 7 years ago
parent
commit
ded5af32d5
2 changed files with 29 additions and 0 deletions
  1. 25 0
      ambari-server/findbugs.exclude.xml
  2. 4 0
      ambari-server/pom.xml

+ 25 - 0
ambari-server/findbugs.exclude.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!--
+  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>
+    <Class name="~.*Entity" />
+    <Method name="~_persistence_[gs]et" />
+    <Bug pattern="ES_COMPARING_PARAMETER_STRING_WITH_EQ" />
+  </Match>
+</FindBugsFilter>

+ 4 - 0
ambari-server/pom.xml

@@ -662,6 +662,7 @@
           <failOnError>false</failOnError>
           <threshold>Low</threshold>
           <findbugsXmlOutputDirectory>${project.basedir}/target/findbugs</findbugsXmlOutputDirectory>
+          <excludeFilterFile>${project.basedir}/findbugs.exclude.xml</excludeFilterFile>
         </configuration>
         <executions>
           <execution>
@@ -691,6 +692,9 @@
               <includes>
                 <include>*.xml</include>
               </includes>
+              <excludes>
+                <exclude>findbugs.exclude.xml</exclude>
+              </excludes>
               <outputDir>${project.basedir}/target/findbugs</outputDir>
               <stylesheet>fancy-hist.xsl</stylesheet>
               <fileMappers>