-
Here is the link to the output on my continuous integration server. From there you can see the code and the output of FindBugs. This is using FindBugs 1.3.9 on Linux with Java 1.6.0 and the ant task.
http://mtu.net:8042/job/fll-sw/122/findbugsResult/package.-768334602/file.1131918378/type.-437889885/
The ant task entry looks like this:
2010-01-07 03:29:48 UTC by jpschewe
-
Hi,
source code:
public class X {
....
private static final Calendar cal = Calendar.getInstance();
private static final ReentrantLock lock = new ReentrantLock();
....
public static Date changeMonth(Date month, int value) {
lock.lock();
try {
cal.setTime(month);
cal.add(Calendar.MONTH, value);
return cal.getTime();
}
finally {
lock.unlock();
}
}
}
error...
2010-01-05 23:18:34 UTC by unwissender2009
-
This works for me without any problem. I got a report for each occurrence. See attached file
The issue is a low priority warning (which isn't reported by default). Also, if there are multiple such issues in one method, they are combined into a single issue that references multiple source lines.
2010-01-05 20:00:21 UTC by wpugh
-
FindBugs seems to be giving exactly the correct warning.
This code takes sections, multiplies it by 1000 (using int multiplication), converts the integer result of that multiplication to a long, and then multiplies that by 1000 using long multiplication.
If seconds is more than 2047 seconds, the condition will always be true, since seconds * 1000 * 1000 * 1000L will be negative.
2010-01-04 20:27:03 UTC by wpugh
-
thanks.
2010-01-04 20:16:44 UTC by wpugh
-
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).
2010-01-03 02:20:16 UTC by sf-robot
-
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).
2010-01-03 02:20:16 UTC by sf-robot
-
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).
2010-01-03 02:20:15 UTC by sf-robot
-
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).
2010-01-03 02:20:15 UTC by sf-robot
-
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).
2010-01-03 02:20:12 UTC by sf-robot