Ignore:
Timestamp:
2017-02-12T16:32:18+01:00 (3 years ago)
Author:
Don-vip
Message:

refactor handling of null values - use Java 8 Optional where possible

File:
1 edited

Legend:

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

    r9665 r11553  
    66import java.util.Iterator;
    77import java.util.LinkedHashMap;
     8import java.util.Objects;
    89import java.util.concurrent.CopyOnWriteArrayList;
    910
     
    5051     */
    5152    public synchronized void setNewCursor(Cursor cursor, Object reference) {
    52         if (reference == null) {
    53             throw new NullPointerException("Cannot register a cursor that can never be removed.");
    54         }
     53        Objects.requireNonNull(reference, "Cannot register a cursor that can never be removed.");
    5554        // re-insert to allow overriding.
    5655        cursors.remove(reference);
Note: See TracChangeset for help on using the changeset viewer.