Changeset 12272 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2017-05-29T15:29:39+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #14849 - fix crash at startup when two initialization tasks have been translated with the same text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/SplashScreen.java

    r11881 r12272  
    158158
    159159        public void finish() {
    160             if (!"".equals(duration)) {
    161                 throw new IllegalStateException("This tasks has already been finished");
     160            if (isFinished()) {
     161                throw new IllegalStateException("This task has already been finished: " + name);
    162162            }
    163163            duration = tr(" ({0})", Utils.getDurationString(System.currentTimeMillis() - start));
     164        }
     165
     166        /**
     167         * Determines if this task has been finished.
     168         * @return {@code true} if this task has been finished
     169         */
     170        public boolean isFinished() {
     171            return !duration.isEmpty();
    164172        }
    165173
     
    174182            if (o == null || getClass() != o.getClass()) return false;
    175183            MeasurableTask that = (MeasurableTask) o;
    176             return Objects.equals(name, that.name);
     184            return Objects.equals(name, that.name)
     185                && isFinished() == that.isFinished();
    177186        }
    178187
Note: See TracChangeset for help on using the changeset viewer.