Ignore:
Timestamp:
2022-01-26T20:13:22+01:00 (2 years ago)
Author:
taylor.smock
Message:

Replace usages of System.exit with Lifecycle.exitJosm

This fixes some coverity scan issues (spotbugs) with respect to exiting the VM.

See #15182: Standalone JOSM validator

File:
1 edited

Legend:

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

    r16818 r18366  
    3939import org.openstreetmap.josm.io.IllegalDataException;
    4040import org.openstreetmap.josm.io.OsmReader;
     41import org.openstreetmap.josm.spi.lifecycle.Lifecycle;
    4142import org.openstreetmap.josm.spi.preferences.Config;
    4243import org.openstreetmap.josm.spi.preferences.MemoryPreferences;
     
    177178            }
    178179            System.err.println(tr("Error - file not found: ''{0}''", e.getMessage()));
    179             System.exit(1);
     180            Lifecycle.exitJosm(true, 1);
    180181        } catch (IllegalArgumentException | IllegalDataException | IOException e) {
    181182            if (Logging.isDebugEnabled()) {
     
    185186                System.err.println(tr("Error: {0}", e.getMessage()));
    186187            }
    187             System.exit(1);
    188         }
    189         System.exit(0);
     188            Lifecycle.exitJosm(true, 1);
     189        }
     190        Lifecycle.exitJosm(true, 0);
    190191    }
    191192
     
    228229        case HELP:
    229230            showHelp();
    230             System.exit(0);
     231            Lifecycle.exitJosm(true, 0);
    231232            break;
    232233        case DEBUG:
Note: See TracChangeset for help on using the changeset viewer.