private final void updateState() { // This used to be synchronized but now we do this instead if (!Platform.isFxApplicationThread()) { throw new IllegalThreadStateException("Must be on the Fx App Thread"); } Map<String, Advisory> advisories = evaluateState(); State newState = evaluateAdvisories(advisories); // Advisory processing if (newState != State.Normal) { Date now = new Date(System.currentTimeMillis()); String time = timeFormat.format(now); warningTextBuilder.delete(0, warningTextBuilder.length()); for (Advisory a : advisories.values()) { Advisory.toMessage(warningTextBuilder, a); warningTextBuilder.append("\r\n"); } warningTextBuilder.append("at ").append(time); warningText.set(warningTextBuilder.toString()); } else { warningText.set(getStatusOKMessage()); } state.set(new StateChange(newState, advisories)); }
@Override public int hashCode() { int result = 1; result = (31 * result) + ((advisory == null) ? 0 : advisory.hashCode()); result = (31 * result) + ((bugid == null) ? 0 : bugid.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if ((obj == null) || (!(obj instanceof AdvisoryBuglist))) { return false; } final AdvisoryBuglist other = (AdvisoryBuglist) obj; if (advisory == null) { if (other.advisory != null) { return false; } } else if (!advisory.equals(other.advisory)) { return false; } return true; }