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 226065 - Malformed branding token allowed when creating Maven-based Platform App
Summary: Malformed branding token allowed when creating Maven-based Platform App
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-13 14:22 UTC by mienamoo
Modified: 2013-07-04 08:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
suggested patch to mojo.codehaus.org (1.09 KB, patch)
2013-03-26 13:29 UTC, Milos Kleint
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mienamoo 2013-02-13 14:22:43 UTC
NetBeans build 201302070001
JDK 7u11 64-bit

When creating a Maven-based NetBeans Application, the user is allowed to enter a project name such as APP_1. But the _1 part causes the branding token to be malformed, so the app doesn't run without first editing the branding token in the parent POM.

    java.lang.IllegalArgumentException: Malformed branding token: app_1
	    at org.openide.util.NbBundle.setBranding(NbBundle.java:138)
            ...

So please either don't allow the user to enter a name that would cause the branding token to be invalid, or change the entered value until the branding token  is valid.
Comment 1 Milos Kleint 2013-02-20 13:23:32 UTC
vaguely related to https://jira.codehaus.org/browse/MNBMODULE-92
conversion from artifactid to branding token is performed in velocity. 

The panel for choosing artifact is in generic maven support space, not the apisupport modules..
Comment 2 Milos Kleint 2013-02-20 13:25:36 UTC
I guess one way would be to strip the  token of any alphanumerical characters.
Comment 3 Milos Kleint 2013-02-20 13:32:16 UTC
(In reply to comment #2)
> I guess one way would be to strip the  token of any alphanumerical characters.

any NON-aplhanumerical
Comment 4 mienamoo 2013-02-20 13:35:16 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > I guess one way would be to strip the  token of any alphanumerical characters.
> 
> any NON-aplhanumerical

Agreed. :)
Comment 5 Milos Kleint 2013-03-26 13:29:47 UTC
Created attachment 133084 [details]
suggested patch to mojo.codehaus.org
Comment 6 Milos Kleint 2013-06-28 13:08:39 UTC
http://hg.netbeans.org/core-main/rev/52fa13b00a4a
Comment 7 Quality Engineering 2013-07-01 15:54:29 UTC
Integrated into 'main-silver', will be available in build *201307011244* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/52fa13b00a4a
User: Milos Kleint <mkleint@netbeans.org>
Log: #226065 use 1.15 of application archetype that skips all non alphanumerical chars from branding token
Comment 8 mienamoo 2013-07-04 08:03:46 UTC
Verified with build 201307032300. Thanks!