private int getLaunchProperty ( ) { // See if the first command line argument specifies the UI. if ( args . length > 0 ) { String firstArg = args [ 0 ] ; if ( firstArg . startsWith ( "-" ) ) { String uiName = firstArg . substring ( 1 ) ; if ( uiNameToCodeMap . containsKey ( uiName ) ) { // Strip the first argument from the command line arguments. String [ ] modifiedArgs = new String [ args . length - 1 ] ; System . arraycopy ( args , 1 , modifiedArgs , 0 , args . length - 1 ) ; args = modifiedArgs ; return uiNameToCodeMap . get ( uiName ) ; } } } // Check findbugs.launchUI property. // "gui2" is the default if not otherwise specified. String s = System . getProperty ( "findbugs.launchUI" ) ; if ( s == null ) { for ( String a : args ) { if ( "-output" . equals ( a ) || "-xml" . equals ( a ) || a . endsWith ( ".class" ) || a . endsWith ( ".jar" ) ) { return TEXTUI ; } } s = "gui2" ; } // See if the property value is one of the human-readable // UI names. if ( uiNameToCodeMap . containsKey ( s ) ) { return uiNameToCodeMap . get ( s ) ; } // Fall back: try to parse it as an integer. try { return Integer . parseInt ( s ) ; } catch ( NumberFormatException nfe ) { return GUI2 ; } }
Find out what UI should be launched .