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

Summary: Platform configuration file does not handle non-native line endings with a branding token
Product: platform Reporter: 280Z28
Component: Launchers&CLIAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW ---    
Severity: normal    
Priority: P4    
Version: 7.4   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

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?