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

Summary: NbBundleProcessor fail to handle keys with '$' in them
Product: platform Reporter: _ zeled <zeled>
Component: -- Other --Assignee: Antonin Nebuzelsky <anebuzelsky>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: NbBundleProcessor patch to fix troubles with '$' symbol in bundle keys.
NbBundleProcessor patch to fix troubles with '$' symbol in bundle keys (NB-8.1 patch)

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.