Ignore:
Timestamp:
2016-05-14T02:38:41+02:00 (4 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/actions/ExtensionFileFilter.java

    r9968 r10208  
    6565        for (final Class<? extends FileImporter> importerClass : importerNames) {
    6666            try {
    67                 FileImporter importer = importerClass.newInstance();
     67                FileImporter importer = importerClass.getConstructor().newInstance();
    6868                importers.add(importer);
    6969                MapView.addLayerChangeListener(importer);
    70             } catch (Exception e) {
     70            } catch (ReflectiveOperationException e) {
    7171                if (Main.isDebugEnabled()) {
    7272                    Main.debug(e.getMessage());
     
    106106        for (final Class<? extends FileExporter> exporterClass : exporterClasses) {
    107107            try {
    108                 FileExporter exporter = exporterClass.newInstance();
     108                FileExporter exporter = exporterClass.getConstructor().newInstance();
    109109                exporters.add(exporter);
    110110                MapView.addLayerChangeListener(exporter);
    111             } catch (Exception e) {
     111            } catch (ReflectiveOperationException e) {
    112112                if (Main.isDebugEnabled()) {
    113113                    Main.debug(e.getMessage());
Note: See TracChangeset for help on using the changeset viewer.