Shahar Havivi has uploaded a new change for review.

Change subject: findbugs: ignore: Unread public-protected fields
......................................................................

findbugs: ignore: Unread public-protected fields

We add to ignore list fields that we do use in reflection or GWT and
findbugs fail to recognize.

findbugs reason:
UrF: Unread public/protected field (URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)

Change-Id: I7e0a285d71bbed1a9201c6a919cb57e7a8c16406
Signed-off-by: Shahar Havivi <shav...@redhat.com>
---
M backend/manager/modules/compat/exclude-filters.xml
A exclude-filters.xml
M frontend/webadmin/modules/gwt-common/exclude-filters.xml
M frontend/webadmin/modules/uicompat/pom.xml
4 files changed, 64 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/92/15392/1

diff --git a/backend/manager/modules/compat/exclude-filters.xml 
b/backend/manager/modules/compat/exclude-filters.xml
index fe4155b..ac7b009 100644
--- a/backend/manager/modules/compat/exclude-filters.xml
+++ b/backend/manager/modules/compat/exclude-filters.xml
@@ -26,4 +26,30 @@
        <Method name="setValue"/>
        <Bug code="SF"/>
      </Match>
+
+       <!--
+        findbugs complains that we don't use innerText in XmlNode
+        We do use that code for reading/writing xml from legacy code
+
+        findbugs reason:
+        UrF: Unread public/protected field 
(URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
+       -->
+     <Match>
+       <Class name="org.ovirt.engine.core.compat.backendcompat.XmlNode" />
+       <Field name="InnerText"/>
+       <Bug code="UrF"/>
+     </Match>
+
+       <!--
+        findbugs complains that we don't use Attributes in XmlNode
+        We do use that code for reading/writing xml from legacy code
+
+        findbugs reason:
+        UrF: Unread public/protected field 
(URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
+       -->
+     <Match>
+       <Class name="org.ovirt.engine.core.compat.backendcompat.XmlNode" />
+       <Field name="Attributes"/>
+       <Bug code="UrF"/>
+     </Match>
 </FindBugsFilter>
diff --git a/exclude-filters.xml b/exclude-filters.xml
new file mode 100644
index 0000000..7cb96c2
--- /dev/null
+++ b/exclude-filters.xml
@@ -0,0 +1,14 @@
+<FindBugsFilter>
+       <!--
+        findbugs complains parseVersion is never read
+        it is used for generate GWT code
+
+        findbugs reason:
+        UrF: Unread public/protected field 
(URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
+       -->
+     <Match>
+       <Class name="org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs" />
+       <Field name="parseVersion"/>
+       <Bug code="UrF"/>
+     </Match>
+</FindBugsFilter>
diff --git a/frontend/webadmin/modules/gwt-common/exclude-filters.xml 
b/frontend/webadmin/modules/gwt-common/exclude-filters.xml
index 0ccbcc4..ff707fa 100644
--- a/frontend/webadmin/modules/gwt-common/exclude-filters.xml
+++ b/frontend/webadmin/modules/gwt-common/exclude-filters.xml
@@ -72,4 +72,17 @@
        <Method name="hashCode"/>
        <Bug code="DM"/>
      </Match>
+
+       <!--
+        findbugs complains that we don't use pathEditor in AbstractStorageView
+        We do use that code in inherited classes such as GlusterStorageView
+
+        findbugs reason:
+        UrF: Unread public/protected field 
(URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)
+       -->
+     <Match>
+       <Class 
name="org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractStorageView" />
+       <Field name="pathEditor"/>
+       <Bug code="UrF"/>
+     </Match>
  </FindBugsFilter>
diff --git a/frontend/webadmin/modules/uicompat/pom.xml 
b/frontend/webadmin/modules/uicompat/pom.xml
index 2dbe499..52b5284 100644
--- a/frontend/webadmin/modules/uicompat/pom.xml
+++ b/frontend/webadmin/modules/uicompat/pom.xml
@@ -66,6 +66,17 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+         <groupId>org.codehaus.mojo</groupId>
+         <artifactId>findbugs-maven-plugin</artifactId>
+         <version>${findbugs.version}</version>
+         <configuration>
+           <xmlOutput>true</xmlOutput>
+           <!-- Optional directory to put findbugs xdoc xml report -->
+           <excludeFilterFile>exclude-filters.xml</excludeFilterFile>
+           <xmlOutputDirectory>target/site</xmlOutputDirectory>
+         </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>


--
To view, visit http://gerrit.ovirt.org/15392
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e0a285d71bbed1a9201c6a919cb57e7a8c16406
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shav...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to