You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Hugo Trippaers <hu...@trippaers.nl> on 2014/03/11 16:43:27 UTC

FindBugs

Hey,

Just a reminder, findbugs is now checking the code periodically via Jenkins. See http://jenkins.buildacloud.org/job/build-master-slowbuild/

If this job fails it means a checking caused additional warning above the 250+ high findings we already have. Over the last few weeks the total number is going down, but please keep focus on this.

Also if you prepare a commit or a merge request, please run findbugs first to see if there are additional findings. This will help you in improving the quality of the code and save you from being blamed by Jenkins when it is finally committed. For example see build http://jenkins.buildacloud.org/job/build-master-slowbuild/404/changes here 2 additional high importance findings where introduced by either Rajesh, Talluri or Sanjay.

One of them potentially interesting:
CreateServiceOfferingCmd.java:217, BC_IMPOSSIBLE_CAST, Priority: High
Impossible cast from String to java.util.HashMap in org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd.getDetails()


This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime.



This page might help a bit if you are not familiar with FindBugs. https://cwiki.apache.org/confluence/display/CLOUDSTACK/Using+FindBugs

Cheers,

Hugo

RE: FindBugs

Posted by Sanjay Tripathi <sa...@citrix.com>.
Hi Hugo,

I have fixed the bug reported by findbugs.

--Sanjay

-----Original Message-----
From: Trippie [mailto:trippie@gmail.com] On Behalf Of Hugo Trippaers
Sent: Tuesday, March 11, 2014 9:13 PM
To: <de...@cloudstack.apache.org>
Subject: FindBugs

Hey,

Just a reminder, findbugs is now checking the code periodically via Jenkins. See http://jenkins.buildacloud.org/job/build-master-slowbuild/

If this job fails it means a checking caused additional warning above the 250+ high findings we already have. Over the last few weeks the total number is going down, but please keep focus on this.

Also if you prepare a commit or a merge request, please run findbugs first to see if there are additional findings. This will help you in improving the quality of the code and save you from being blamed by Jenkins when it is finally committed. For example see build http://jenkins.buildacloud.org/job/build-master-slowbuild/404/changes here 2 additional high importance findings where introduced by either Rajesh, Talluri or Sanjay.

One of them potentially interesting:
CreateServiceOfferingCmd.java:217, BC_IMPOSSIBLE_CAST, Priority: High Impossible cast from String to java.util.HashMap in org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd.getDetails()


This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime.



This page might help a bit if you are not familiar with FindBugs. https://cwiki.apache.org/confluence/display/CLOUDSTACK/Using+FindBugs

Cheers,

Hugo

RE: FindBugs

Posted by Rajesh Battala <ra...@citrix.com>.
Hugo, 

I had fixed the issues reported by findbugs for Hyper-V.

Thanks
Rajesh Battala

-----Original Message-----
From: Rajesh Battala [mailto:rajesh.battala@citrix.com] 
Sent: Wednesday, March 12, 2014 6:56 AM
To: dev@cloudstack.apache.org
Subject: RE: FindBugs

Thanks Hugo. I had figured the issue reported from my commit. Will fix it.

Thanks
Rajesh Battala

-----Original Message-----
From: Trippie [mailto:trippie@gmail.com] On Behalf Of Hugo Trippaers
Sent: Tuesday, March 11, 2014 9:13 PM
To: <de...@cloudstack.apache.org>
Subject: FindBugs

Hey,

Just a reminder, findbugs is now checking the code periodically via Jenkins. See http://jenkins.buildacloud.org/job/build-master-slowbuild/

If this job fails it means a checking caused additional warning above the 250+ high findings we already have. Over the last few weeks the total number is going down, but please keep focus on this.

Also if you prepare a commit or a merge request, please run findbugs first to see if there are additional findings. This will help you in improving the quality of the code and save you from being blamed by Jenkins when it is finally committed. For example see build http://jenkins.buildacloud.org/job/build-master-slowbuild/404/changes here 2 additional high importance findings where introduced by either Rajesh, Talluri or Sanjay.

One of them potentially interesting:
CreateServiceOfferingCmd.java:217, BC_IMPOSSIBLE_CAST, Priority: High Impossible cast from String to java.util.HashMap in org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd.getDetails()


This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime.



This page might help a bit if you are not familiar with FindBugs. https://cwiki.apache.org/confluence/display/CLOUDSTACK/Using+FindBugs

Cheers,

Hugo

RE: FindBugs

Posted by Rajesh Battala <ra...@citrix.com>.
Thanks Hugo. I had figured the issue reported from my commit. Will fix it.

Thanks
Rajesh Battala

-----Original Message-----
From: Trippie [mailto:trippie@gmail.com] On Behalf Of Hugo Trippaers
Sent: Tuesday, March 11, 2014 9:13 PM
To: <de...@cloudstack.apache.org>
Subject: FindBugs

Hey,

Just a reminder, findbugs is now checking the code periodically via Jenkins. See http://jenkins.buildacloud.org/job/build-master-slowbuild/

If this job fails it means a checking caused additional warning above the 250+ high findings we already have. Over the last few weeks the total number is going down, but please keep focus on this.

Also if you prepare a commit or a merge request, please run findbugs first to see if there are additional findings. This will help you in improving the quality of the code and save you from being blamed by Jenkins when it is finally committed. For example see build http://jenkins.buildacloud.org/job/build-master-slowbuild/404/changes here 2 additional high importance findings where introduced by either Rajesh, Talluri or Sanjay.

One of them potentially interesting:
CreateServiceOfferingCmd.java:217, BC_IMPOSSIBLE_CAST, Priority: High Impossible cast from String to java.util.HashMap in org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd.getDetails()


This cast will always throw a ClassCastException. FindBugs tracks type information from instanceof checks, and also uses more precise information about the types of values returned from methods and loaded from fields. Thus, it may have more precise information that just the declared type of a variable, and can use this to determine that a cast will always throw an exception at runtime.



This page might help a bit if you are not familiar with FindBugs. https://cwiki.apache.org/confluence/display/CLOUDSTACK/Using+FindBugs

Cheers,

Hugo