MCPcopy Index your code
hub / github.com/benfry/processing4 / getUpdateID

Method getUpdateID

app/src/processing/app/UpdateCheck.java:89–101  ·  view source on GitHub ↗

Turned into a separate method so that anyone needed "update.id" will get a legit answer. Had a problem with the contribs script where the id wouldn't be set so a null id would be sent to the contribs server.

()

Source from the content-addressed store, hash-verified

87 * wouldn't be set so a null id would be sent to the contribs server.
88 */
89 static public long getUpdateID() {
90 // generate a random id in case none exists yet
91 Random r = new Random();
92 long id = r.nextLong();
93
94 String idString = Preferences.get("update.id");
95 if (idString != null) {
96 id = Long.parseLong(idString);
97 } else {
98 Preferences.set("update.id", String.valueOf(id));
99 }
100 return id;
101 }
102
103
104 public void updateCheck() throws IOException {

Callers 2

updateCheckMethod · 0.95
makeContribsBlobMethod · 0.95

Calls 2

getMethod · 0.95
setMethod · 0.95

Tested by

no test coverage detected