Changeset 18484 in josm


Ignore:
Timestamp:
2022-06-09T15:52:24+02:00 (23 months ago)
Author:
taylor.smock
Message:

MainApplication: Fix CORRECTNESS NP_NULL_PARAM_DEREF

This is mostly due to a false positive (the only way
for mainJOSM to be called with null is if
new ProgramArguments throws an exception, but we
exit the program in that case using Lifecycle.exitJosm).

In any case, moving mainJOSM into the try-catch
block should be marginally clearer, in so far as
it is easier to tell that we don't run mainJOSM
if we cannot parse the program arguments.

File:
1 edited

Legend:

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

    r18366 r18484  
    272272        @Override
    273273        public void processArguments(String[] argArray) {
    274             ProgramArguments args = null;
    275             // construct argument table
    276274            try {
    277                 args = new ProgramArguments(argArray);
     275                // construct argument table
     276                ProgramArguments args = new ProgramArguments(argArray);
     277                mainJOSM(args);
    278278            } catch (IllegalArgumentException e) {
    279279                System.err.println(e.getMessage());
    280280                Lifecycle.exitJosm(true, 1);
    281281            }
    282             mainJOSM(args);
    283282        }
    284283    };
Note: See TracChangeset for help on using the changeset viewer.