projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Declare potentially-static methods as static.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
core
/
UpdateChecker.java
diff --git
a/src/main/java/net/pterodactylus/sone/core/UpdateChecker.java
b/src/main/java/net/pterodactylus/sone/core/UpdateChecker.java
index
7f03b3a
..
003e276
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/UpdateChecker.java
+++ b/
src/main/java/net/pterodactylus/sone/core/UpdateChecker.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - UpdateChecker.java - Copyright © 2011 David Roden
+ * Sone - UpdateChecker.java - Copyright © 2011
–2012
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-49,7
+49,7
@@
public class UpdateChecker {
private static final String SONE_HOMEPAGE = "USK@nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI,DuQSUZiI~agF8c-6tjsFFGuZ8eICrzWCILB60nT8KKo,AQACAAE/sone/";
/** The current latest known edition. */
private static final String SONE_HOMEPAGE = "USK@nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI,DuQSUZiI~agF8c-6tjsFFGuZ8eICrzWCILB60nT8KKo,AQACAAE/sone/";
/** The current latest known edition. */
- private static final int LATEST_EDITION =
35
;
+ private static final int LATEST_EDITION =
49
;
/** The Freenet interface. */
private final FreenetInterface freenetInterface;
/** The Freenet interface. */
private final FreenetInterface freenetInterface;
@@
-166,11
+166,11
@@
public class UpdateChecker {
@Override
@SuppressWarnings("synthetic-access")
public void editionFound(FreenetURI uri, long edition, boolean newKnownGood, boolean newSlot) {
@Override
@SuppressWarnings("synthetic-access")
public void editionFound(FreenetURI uri, long edition, boolean newKnownGood, boolean newSlot) {
- logger.log(Level.FINEST,
"Found update for %s: %d, %s, %s", new Object[] { uri, edition, newKnownGood, newSlot }
);
+ logger.log(Level.FINEST,
String.format("Found update for %s: %d, %s, %s", uri, edition, newKnownGood, newSlot)
);
if (newKnownGood || newSlot) {
Pair<FreenetURI, FetchResult> uriResult = freenetInterface.fetchUri(uri.setMetaString(new String[] { "sone.properties" }));
if (uriResult == null) {
if (newKnownGood || newSlot) {
Pair<FreenetURI, FetchResult> uriResult = freenetInterface.fetchUri(uri.setMetaString(new String[] { "sone.properties" }));
if (uriResult == null) {
- logger.log(Level.WARNING,
"Could not fetch properties of latest homepage: %s", uri
);
+ logger.log(Level.WARNING,
String.format("Could not fetch properties of latest homepage: %s", uri)
);
return;
}
Bucket resultBucket = uriResult.getRight().asBucket();
return;
}
Bucket resultBucket = uriResult.getRight().asBucket();
@@
-178,7
+178,7
@@
public class UpdateChecker {
parseProperties(resultBucket.getInputStream(), edition);
latestEdition = edition;
} catch (IOException ioe1) {
parseProperties(resultBucket.getInputStream(), edition);
latestEdition = edition;
} catch (IOException ioe1) {
- logger.log(Level.WARNING,
"Could not parse sone.properties of " + uri
, ioe1);
+ logger.log(Level.WARNING,
String.format("Could not parse sone.properties of %s!", uri)
, ioe1);
} finally {
resultBucket.free();
}
} finally {
resultBucket.free();
}
@@
-240,7
+240,7
@@
public class UpdateChecker {
if (version.compareTo(currentLatestVersion) > 0) {
currentLatestVersion = version;
latestVersionDate = releaseTime;
if (version.compareTo(currentLatestVersion) > 0) {
currentLatestVersion = version;
latestVersionDate = releaseTime;
- logger.log(Level.INFO,
"Found new version: %s (%tc)", new Object[] { version, new Date(releaseTime) }
);
+ logger.log(Level.INFO,
String.format("Found new version: %s (%tc)", version, new Date(releaseTime))
);
updateListenerManager.fireUpdateFound(version, releaseTime, edition);
}
}
updateListenerManager.fireUpdateFound(version, releaseTime, edition);
}
}