Bug 268247 - Wrong new line if comma in annotations
Wrong new line if comma in annotations
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Formatting & Indentation
8.2
PC Linux
: P2 with 5 votes (vote)
: Dev
Assigned To: Dusan Balek
issues@editor
:
Depends on:
Blocks:
  Show dependency treegraph
 
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
:


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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo