Menu

#124 if blocks and comments

closed-fixed
None
1
2002-11-13
2002-08-14
No

If I have an if block w/o braces, and at the end of the if
line is a single line comment, the conversion of the code
is a bit messed up when the option to use Sun-style
braces is set (default).

Test Case:
public class Test {

public static void main(String args[]) {

if (true) // blah blah
System.out.println("Blah");
else
System.out.println("Blah Blah");

}

}

Current results

public class Test {
public static void main(String[] args) {
if (true) // blah blah

{
System.out.println("Blah");
} else
{
System.out.println("Blah Blah");
}
}
}

Desired results

public class Test {
public static void main(String[] args) {
if (true) { // blah blah
System.out.println("Blah");
} else {
System.out.println("Blah Blah");
}
}
}

Discussion

  • Marco Hunsicker

    Marco Hunsicker - 2002-08-18
    • assigned_to: nobody --> marcohu
     
  • Marco Hunsicker

    Marco Hunsicker - 2002-08-18

    Logged In: YES
    user_id=44430

    Should be fixed with the next beta.

    Thanks.

     
  • Marco Hunsicker

    Marco Hunsicker - 2002-08-21
    • priority: 5 --> 1
     
  • Marco Hunsicker

    Marco Hunsicker - 2002-09-15
    • status: open --> open-fixed
     
  • Marco Hunsicker

    Marco Hunsicker - 2002-11-13
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.