Ignore:
Timestamp:
2016-05-14T02:38:41+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11924 - Java 9 - JDK-6850612 deprecates Class.newInstance() ==> replace it by Class.getConstructor().newInstance()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r10181 r10208  
    12091209        T structPrototype;
    12101210        try {
    1211             structPrototype = klass.newInstance();
    1212         } catch (InstantiationException | IllegalAccessException ex) {
     1211            structPrototype = klass.getConstructor().newInstance();
     1212        } catch (ReflectiveOperationException ex) {
    12131213            throw new RuntimeException(ex);
    12141214        }
     
    12581258        T struct = null;
    12591259        try {
    1260             struct = klass.newInstance();
    1261         } catch (InstantiationException | IllegalAccessException ex) {
     1260            struct = klass.getConstructor().newInstance();
     1261        } catch (ReflectiveOperationException ex) {
    12621262            throw new RuntimeException(ex);
    12631263        }
    12641264        for (Entry<String, String> key_value : hash.entrySet()) {
    1265             Object value = null;
     1265            Object value;
    12661266            Field f;
    12671267            try {
Note: See TracChangeset for help on using the changeset viewer.