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 268247

Summary: Wrong new line if comma in annotations
Product: editor Reporter: kovica <kovica>
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: AlexFalappa, nigjo_iqn
Priority: P2    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description kovica 2016-09-28 12:39:21 UTC
I have an NetBeans Platform module with an action specified like this:
package com.kovica;

@ActionID(
        category = "MyCategory",
        id = "com.kovica.MyAction"
)
@ActionRegistration(
        displayName = "#CTL_ACTION",
        asynchronous = true,
        iconBase = "icon.png"

)
@ActionReferences({
    @ActionReference(path = "Shortcuts", name = "D-G"),
    @ActionReference(path = "Toolbars/MyToolbar", position = 6)
})
@NbBundle.Messages("CTL_ACTION=ACTION STRING")
public class MyAction implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        // DO SOMETHING
    }
}

if I do code formatting I get:
package com.kovica;

@ActionID(
        category = "MyCategory",
        id = "com.kovica.MyAction"
)
@ActionRegistration(
        displayName = "#CTL_ACTION",
        asynchronous = true,
        iconBase = "icon.png"

)
@ActionReferences({
    @ActionReference(path = "Shortcuts", name = "D-G")
    ,
    @ActionReference(path = "Toolbars/MyToolbar", position = 6)
})
@NbBundle.Messages("CTL_ACTION=ACTION STRING")
public class MyAction implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        // DO SOMETHING
    }
}

Earlier versions did not do that.
Comment 1 AlexFalappa 2016-10-06 14:56:54 UTC
Just noticed this myself too.

Voted
Comment 2 AlexFalappa 2016-10-06 15:04:37 UTC
The the comma is at the beginning of next annotation it's considered correct. I.e. following form instead is not reformatted:

@ActionReferences({
    @ActionReference(path = "Shortcuts", name = "D-G")
    ,@ActionReference(path = "Toolbars/MyToolbar", position = 6)
})
Comment 3 Dusan Balek 2017-05-04 11:03:05 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/0c0ccf9905d2