Hi,

Guys if you feel like, look around in sonar sometimes, it registers and
tracks tons of such issues (and the app is cool, nice and super-trendy)

https://analysis.apache.org/dashboard/index/100206

For incorrect use of == operator, sonar knows 14 more cases in ACS, There
are some that "not nice but works", but quite a few seem to be a positive.

https://analysis.apache.org/drilldown/issues/100206?&rule=pmd%3ACompareObjectsWithEquals&rule_sev=MAJOR&severity=MAJOR

Regards,
Laszlo


On Mon, Feb 24, 2014 at 5:14 PM, Hugo Trippaers <h...@trippaers.nl> wrote:

> Guys,
>
> Please pay attention to the code you are committing. Today i fixed a
> number of issues that were introduced in recent code, these are bugs that
> could have been prevented from entering master by either testing or running
> the findbugs checks. One was committed directly, the other one through a
> reviewed patch.
>
>
> @@ -116,7 +116,7 @@ public class Upgrade430to440 implements DbUpgrade {
>                          if (networkRs.next()) {
>                              String guesttype = networkRs.getString(1);
>
> -                            if (guesttype ==
> Network.GuestType.Shared.toString()) {
> +                            if
> (guesttype.equals(Network.GuestType.Shared.toString())) {
>                                  pstmtUpdate =
> conn.prepareStatement("UPDATE `cloud`.`user_ip_address` SET account_id = ?,
> domain_id= ? WHERE public_ip_address = ?");
>                                  pstmtUpdate.setLong(1,vmAccountId);
>                                  pstmtUpdate.setLong(2,vmDomainId);
>
>
>
> @@ -80,11 +80,11 @@ public class LibvirtStoragePoolXMLParser {
>                  String targetPath = getTagValue("path", target);
>
>                  String portValue = getAttrValue("host", "port", source);
> -                if (portValue != "")
> +                if (portValue != null && !portValue.isEmpty())
>                      port = Integer.parseInt(portValue);
>
>                  return new
> LibvirtStoragePoolDef(LibvirtStoragePoolDef.poolType.valueOf(format.toUpperCase()),
>
>
> To help, i've configured the slowbuild to alert if the number of high
> priority findings from findbugs differs from the previous run. It will
> notify all developers that had changes during this period (slowbuild runs
> every 4 hours).
>
> Cheers,
>
> Hugo




-- 

EOF

Reply via email to