Please use the Apache issue tracking system for new NetBeans issues ( !!
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
PC All
: P4 (vote)
: 7.4
Assigned To: Libor Fischmeistr
Depends on:
  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


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
 at org.netbeans.core.startup.CLIOptions.cli(
 at org.netbeans.core.startup.CLIOptions.cli(
 at org.netbeans.CLIHandler.notifyHandlers(
 at org.netbeans.CLIHandler.initialize(
 at org.netbeans.CLIHandler.initialize(
 at org.netbeans.MainImpl.execute(
 at org.netbeans.MainImpl.main(
 at org.netbeans.Main.main(
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. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo