This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221032 - Using OptionProcessor with CommandException exit code 0 exits application with code 2
Summary: Using OptionProcessor with CommandException exit code 0 exits application wit...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.2.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-29 14:51 UTC by stevenyi
Modified: 2012-11-03 02:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example RCP Application that uses OptionProcessor to throw CommandException with exit code 0 (16.52 KB, application/zip)
2012-10-29 14:51 UTC, stevenyi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stevenyi 2012-10-29 14:51:56 UTC
Created attachment 126729 [details]
Example RCP Application that uses OptionProcessor to throw CommandException with exit code 0

With 7.2.1, I am seeing behavior that has changed from previous Netbeans platforms (unsure what last platform exhibited expected behavior).  With an OptionProcessor, if a CommandException is thrown with exitCode 0, the application would shutdown and return the exit code 0.  With 7.2.1, if a CommandException with exit code 0 is thrown, the application shuts down but returns an exitCode of 2. 

The use cases I am developing for are:

-user does not supply commandline flags and GUI application loads
-user supplies specific commandline flags, app will process then shut
down without loading gui

Before 7.2.1, I used exit code 0 with CommandException to signal both
"shut down application" and "return code 0".

It seems without the ability to use exit code 0 with CommandException,
there is no way to make the platform shut down purposefully with a
success code.

Attached is an example RCP application that uses an OptionProcessor to throw CommandException with exit code 0. project.properties has been modified to use:

run.args.extra=--compile test.blue --output test.csd --nosplash --nogui

The use of --compile and --output triggers the OptionProcessor correctly.
Comment 1 Jaroslav Tulach 2012-11-01 09:34:11 UTC
ergonomics#02ed1b3bc14a
Comment 2 Quality Engineering 2012-11-03 02:43:51 UTC
Integrated into 'main-golden', will be available in build *201211030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/02ed1b3bc14a
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #221032: Allow CommandException(0) to terminate the application