diff --git a/src/org/openstreetmap/josm/gui/GettingStarted.java b/src/org/openstreetmap/josm/gui/GettingStarted.java
index 6fbdaca..648e433 100644
a
|
b
|
public class GettingStarted extends JPanel {
|
90 | 90 | * Additionally check if JOSM has been updated and refresh MOTD |
91 | 91 | */ |
92 | 92 | @Override |
93 | | protected boolean isCacheValid() { |
| 93 | protected boolean isCacheValid(byte[] data) { |
94 | 94 | // We assume a default of myVersion because it only kicks in in two cases: |
95 | 95 | // 1. Not yet written - but so isn't the interval variable, so it gets updated anyway |
96 | 96 | // 2. Cannot be written (e.g. while developing). Obviously we don't want to update |
97 | 97 | // everytime because of something we can't read. |
98 | 98 | return (Main.pref.getInteger("cache.motd.html.version", -999) == myVersion) |
99 | | && Main.pref.get("cache.motd.html.lang").equals(myLang); |
| 99 | && Main.pref.get("cache.motd.html.lang").equals(myLang) |
| 100 | && data.length > 128; // a MOTD w/ less than 128 bytes indicateS necessity to update (see #7395) |
100 | 101 | } |
101 | 102 | } |
102 | 103 | |
diff --git a/src/org/openstreetmap/josm/io/CacheCustomContent.java b/src/org/openstreetmap/josm/io/CacheCustomContent.java
index dbb2ec3..5392b7b 100644
a
|
b
|
public abstract class CacheCustomContent<T extends Throwable> {
|
64 | 64 | * This function serves as a comfort hook to perform additional checks if the cache is valid |
65 | 65 | * @return True if the cached copy is still valid |
66 | 66 | */ |
67 | | protected boolean isCacheValid() { |
| 67 | protected boolean isCacheValid(byte[] data) { |
68 | 68 | return true; |
69 | 69 | } |
70 | 70 | |
… |
… |
public abstract class CacheCustomContent<T extends Throwable> {
|
86 | 86 | */ |
87 | 87 | public byte[] updateIfRequired() throws T { |
88 | 88 | if (Main.pref.getInteger("cache." + ident, 0) + updateInterval < new Date().getTime()/1000 |
89 | | || !isCacheValid()) |
| 89 | || !isCacheValid(getData())) |
90 | 90 | return updateForce(); |
91 | 91 | return getData(); |
92 | 92 | } |
… |
… |
public abstract class CacheCustomContent<T extends Throwable> {
|
97 | 97 | */ |
98 | 98 | public String updateIfRequiredString() throws T { |
99 | 99 | if (Main.pref.getInteger("cache." + ident, 0) + updateInterval < new Date().getTime()/1000 |
100 | | || !isCacheValid()) |
| 100 | || !isCacheValid(getData())) |
101 | 101 | return updateForceString(); |
102 | 102 | return getDataString(); |
103 | 103 | } |