Menu

#323 Printer Java:try/catch/finally Blocks Not Line Up Vertically

closed
nobody
1
2005-09-12
2003-05-29
John Hohlen
No

Unless I'm missing a setting, it appears the catch/finally
statements do not vertically align with the "try"
statement. More specifically, the "catch" and "finally"
statements are indented one character too far to the left.
Below is an example after I ran it through the Jalopy
formatter.

public class Example {
public void method() {
try {
// do nothing
}
catch (A a1) {
// Handler for situation A
}
catch (B b1) {
// Handler for situation B
}
catch (C c1) {
// Handler for situation C
}
finally {
// Activities that happen every time
}
}
}

Thanks,

jhohlen@erac.com

Discussion

  • John Hohlen

    John Hohlen - 2003-05-29

    Logged In: YES
    user_id=789761

    The example in my summary was reformatted upon submit,
    so I've attached a file with the same example.

     
  • John Hohlen

    John Hohlen - 2003-05-29

    Example of try/catch/finally alignment (

     
  • John Hohlen

    John Hohlen - 2003-05-29
    • summary: try/catch/finally Blocks Do Not Lineup Vertically --> try/catch/finally Blocks Do Not Line Up Vertically
     
  • Marco Hunsicker

    Marco Hunsicker - 2003-06-03

    Logged In: YES
    user_id=44430

    I know this problem. Only happens with Sun brace style. Will
    be fixed with the next release.

    Thanks

     
  • Marco Hunsicker

    Marco Hunsicker - 2003-06-03

    Logged In: YES
    user_id=44430

    Please note that I don't develop the open source code any
    further. See my post on the user list for more information
    (https://sourceforge.net/mailarchive/forum.php?thread_id=2463425&forum_id=8775).

    Thanks

     
  • John Hohlen

    John Hohlen - 2003-06-03

    Logged In: YES
    user_id=789761

    Actually, we have "custom style" braces selected,
    not "Sun". Our custom settings are:

    White Space
    Before left brace: 1
    Before right brace: 0
    After right brace: 1

     
  • John Hohlen

    John Hohlen - 2003-06-03

    Logged In: YES
    user_id=789761

    Actually, we have "custom style" braces selected,
    not "Sun". Our custom settings are:

    White Space
    Before left brace: 1
    Before right brace: 0
    After right brace: 1

     
  • Marco Hunsicker

    Marco Hunsicker - 2003-06-05

    Logged In: YES
    user_id=44430

    >Before left brace: 1
    >Before right brace: 0
    >After right brace: 1

    Hm, isn't that exactly what Sun brace style actually means?
    Just wonder.

     
  • Marco Hunsicker

    Marco Hunsicker - 2003-06-28
    • labels: --> Printer Java
    • priority: 5 --> 1
    • summary: try/catch/finally Blocks Do Not Line Up Vertically --> Printer Java:try/catch/finally Blocks Not Line Up Vertically
     
  • S

    S - 2005-09-12
    • milestone: --> Archive_pre_jalopy_1.5_bugs
    • status: open --> closed
     

Log in to post a comment.