Some more code cleanups thx to Dave Brosius
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3496 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -280,12 +280,9 @@ public class GUI implements CPDListener {
|
||||
long now = System.currentTimeMillis();
|
||||
long elapsedMillis = now - start;
|
||||
long elapsedSeconds = elapsedMillis / 1000;
|
||||
long hours = (long) Math.floor(elapsedSeconds / 3600);
|
||||
long minutes = (long) Math.floor((elapsedSeconds - (hours * 3600)) / 60);
|
||||
long seconds = elapsedSeconds - ((minutes * 60) + (hours * 3600));
|
||||
long minutes = (long) Math.floor(elapsedSeconds / 60);
|
||||
long seconds = elapsedSeconds - (minutes * 60);
|
||||
timeField.setText(""
|
||||
+ munge(String.valueOf(hours))
|
||||
+ ":"
|
||||
+ munge(String.valueOf(minutes))
|
||||
+ ":"
|
||||
+ munge(String.valueOf(seconds)));
|
||||
|
@ -13,7 +13,7 @@ import java.net.URL;
|
||||
|
||||
public class ResourceLoader {
|
||||
|
||||
// Single static method, so we shouldn't allow an instance to be created
|
||||
// Only static methods, so we shouldn't allow an instance to be created
|
||||
private ResourceLoader() {
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ public class ResourceLoader {
|
||||
* a URL, and then finally seeing if it is on the classpath.
|
||||
*/
|
||||
public static InputStream loadResourceAsStream(String name) throws RuleSetNotFoundException {
|
||||
InputStream stream = ResourceLoader.loadResourceAsStream(name, new ResourceLoader().getClass().getClassLoader());
|
||||
InputStream stream = ResourceLoader.loadResourceAsStream(name, ResourceLoader.class.getClassLoader());
|
||||
if (stream == null) {
|
||||
throw new RuleSetNotFoundException("Can't find resource " + name + ". Make sure the resource is a valid file or URL or is on the CLASSPATH");
|
||||
}
|
||||
|
Reference in New Issue
Block a user