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 253854 - NbBundleProcessor fail to handle keys with '$' in them
Summary: NbBundleProcessor fail to handle keys with '$' in them
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.1
Hardware: PC All
: P3 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-27 11:46 UTC by _ zeled
Modified: 2016-02-11 10:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NbBundleProcessor patch to fix troubles with '$' symbol in bundle keys. (1.12 KB, patch)
2015-07-27 11:46 UTC, _ zeled
Details | Diff
NbBundleProcessor patch to fix troubles with '$' symbol in bundle keys (NB-8.1 patch) (2.25 KB, patch)
2016-02-11 10:00 UTC, _ zeled
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ zeled 2015-07-27 11:46:22 UTC
Created attachment 154948 [details]
NbBundleProcessor patch to fix troubles with '$' symbol in bundle keys.

With a class source like this :

package my.mod;
import org.openide.util.NbBundle;
public class Annotation {
    @NbBundle.Messages({
        "LBL_Annotation$Alignement_LEFT=Left",
        "LBL_Annotation$Alignement_RIGHT=Right",
        "LBL_Annotation$Alignement_CENTER=Center",
        "LBL_Annotation$Alignement_JUSTIFY=Justified"
    })
    public enum Alignement {
        LEFT,
        RIGHT,
        CENTER,
        JUSTIFY;
    };
}

Sometimes, when I compile this module without cleaning it first (eg. after I edited and saved the source file), I get the following error:

mymod/build/classes-generated/my/mod/Bundle.java:16: LBL_Annotation$Alignement_CENTER() is already defined in my.mod.Bundle
    static String LBL_Annotation$Alignement_CENTER() {

It seems to be related with the '$' symbol used in bundle keys.
This bug has been discovered in NB 7.1.2 (my working env at the moment) but it still exists in NB 8).
The patch attached fixes the problem for me (one line patch made against NB 8 source tree).

Best regards.
Comment 1 _ zeled 2016-02-11 10:00:20 UTC
Created attachment 158459 [details]
NbBundleProcessor patch to fix troubles with '$' symbol in bundle keys (NB-8.1 patch)

Updated patch for NetBeans 8.1.