Menu

#669 Strange Indenting with Anonymous Inner Class as Argument

3: Ugly
open
nobody
3
2008-05-02
2008-05-02
No

The following source code is indented in a very strange manner. The method of the first anonymous inner class (2nd argument) is indented one step from the beginning of the line where the method.

The method of the second anonymous inner class (3rd argument) is indented one step from the column with the "new" that creates the object. This is how indenting should behave.

<pre>
methodCall(this, new Lambda<Void,WindowEvent>() {
public Void apply(WindowEvent e) {
return null;
}
},
new Lambda<Void,WindowEvent>() {
public Void apply(WindowEvent e) {
return null;
}
});
</pre>

Discussion

  • Mathias Ricken

    Mathias Ricken - 2008-05-02

    Screenshot of the Strange Indenting

     
  • Mathias Ricken

    Mathias Ricken - 2008-05-02

    Logged In: YES
    user_id=1075744
    Originator: YES

    I had hoped that an HTML <pre> tag would preserve the spaces, but apparently SourceForge does not allow HTML. Instead, I have now attached a screenshot.
    File Added: screen-capture.png

     
  • Mathias Ricken

    Mathias Ricken - 2008-05-02
    • milestone: --> 3: Ugly
    • priority: 5 --> 3
     
  • Mathias Ricken

    Mathias Ricken - 2008-05-02

    Logged In: YES
    user_id=1075744
    Originator: YES

    Here's a text rendering that should work better.

    methodCall(this, new Lambda<Void,WindowEvent>() {
    __public Void apply(WindowEvent e) {
    ____return null;
    __}
    },
    ___________new Lambda<Void,WindowEvent>() {
    _____________public Void apply(WindowEvent e) {
    _______________return null;
    _____________}
    ___________});

     

Log in to post a comment.