Bug 225269 - Platform configuration file does not handle non-native line endings with a branding token
Platform configuration file does not handle non-native line endings with a br...
Status: NEW
Product: platform
Classification: Unclassified
Component: Launchers&CLI
7.4
PC All
: P4 (vote)
: 7.4
Assigned To: Libor Fischmeistr
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-24 08:24 UTC by 280Z28
Modified: 2014-02-10 14:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 280Z28 2013-01-24 08:24:41 UTC
An exception occurs while launching a platform application when all of the following conditions are met. Note that I use Markdown-style `...` to denote code literals.

* The app.conf file uses Windows-style (`\r\n`) line endings
* The application is launched on a system with native Unix-style (`\n`) line endings
* The `default_options` line ends with `--branding brandname"\r\n`, where `brandname` is a valid branding token

In this case, the value passed to `NbBundle.setBranding` is `brandname\r`, which results in an IllegalArgumentException. Since the app.conf can appear in source control for users developing NetBeans platform applications, and the file is plain text, and the source control system might always put the file in the build using `\r\n` line endings for Windows users, the launch process for NetBeans should be updated to handle both `\n` and `\r\n` line endings regardless of the native line endings for the system.

The stack trace for the exception is the following:

java.lang.IllegalArgumentException: Malformed branding token: brandname at
 org.openide.util.NbBundle.setBranding(NbBundle.java:138)
 at org.netbeans.core.startup.CLIOptions.cli(CLIOptions.java:233)
 at org.netbeans.core.startup.CLIOptions.cli(CLIOptions.java:98)
 at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:234)
 at org.netbeans.CLIHandler.initialize(CLIHandler.java:518)
 at org.netbeans.CLIHandler.initialize(CLIHandler.java:383)
 at org.netbeans.MainImpl.execute(MainImpl.java:193)
 at org.netbeans.MainImpl.main(MainImpl.java:85)
 at org.netbeans.Main.main(Main.java:78)
Comment 1 280Z28 2013-01-24 08:26:56 UTC
A workaround for affected users is to move the `--branding brandname` argument to the beginning of the `default_options` string.
Comment 2 Jiri Rechtacek 2013-01-25 12:13:57 UTC
Jardo, could you comment it? Thanks
Comment 3 Jaroslav Tulach 2013-01-29 09:54:19 UTC
Can you strip "\n" or "\r" off the end of config file line?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo