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 225269 - Platform configuration file does not handle non-native line endings with a branding token
Summary: Platform configuration file does not handle non-native line endings with a br...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.4
Hardware: PC All
: P4 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-24 08:24 UTC by 280Z28
Modified: 2014-02-10 14:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


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?