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