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 - Wrong new line if comma in annotations
Summary: Wrong new line if comma in annotations
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.2
Hardware: PC Linux
: P2 normal with 5 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-28 12:39 UTC by kovica
Modified: 2017-05-04 11:03 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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