Menu

#51 Jalopy Bug or Request... Not sure...

closed-fixed
None
1
2002-08-06
2002-05-22
No

Hi,

I want to use Jalopy to format our source code correctly but I have 4 things that I'm not sure about...
Maybe I can configure it properly or it's not possible:

1- When I have an array definition like that:
Rstring m_rStatValue[] = {new Rstring("UNK", 15), // AIM name
new Rstring("", 15), // Date
new Rstring("UNK", 15), // Type
new Rstring("0/0", 15), // IN/OUT ports
new Rstring("NO/NO",15), // CNX
new Rstring("0", 15),
new Rstring("0", 15),
new Rstring("0", 15),
new Rstring("", 15)
};

I always get something strange:

Rstring[] m_rStatValue =
{
new Rstring( "UNK", 15 // AIM name
),
new Rstring( "", 15 // Date
),
new Rstring( "UNK", 15 // Type
),
new Rstring( "0/0", 15 // IN/OUT ports
),
new Rstring( "NO/NO", 15 // CNX
),
new Rstring( "0", 15 ),
new Rstring( "0", 15 ),
new Rstring( "0", 15 ),
new Rstring( "", 15 )
};

Comment are moved before the end parenthese ?!?!?!

2- When a declade a method with a thows statement:

public void submitSm(smppHeader h, Message m, byte body[])
throws SmppException

Change with:

public void submitSm( smppHeader h, Message m, byte[] body )
throws SmppException

Is it possible to indent the throws statement with the default tab to get:
public void submitSm( smppHeader h, Message m, byte[] body )
throws SmppException

3- When I call a different method from the same object like:

message.format(ERROR_SOURCE_ADDRESS)
.param (m_session.getAimName())
.param (m.getFrom().toString())
.param (m.getTo().toString())
.send();

It's always formatted like:

message.format( ERROR_SOURCE_ADDRESS ).param( m_session.getAimName() ).param(
m.getFrom().toString() ).param( m.getTo().toString() ).send();

Is it possible to maintain the same indentation for this case

4- When I declare some String like this:
private static final String
TOTO1 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe qweqwe",
TOTO2 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe qweqwe",
TOTO3 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe qweqwe",
TOTO4 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe qweqwe";

I always get:

private static final String TOTO1 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe
qweqwe";
private static final String TOTO2 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe
qweqwe";
private static final String TOTO3 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe
qweqwe";
private static final String TOTO4 = "wqeqwewq qweqweq qweqe qweqwe qweqwe qeqwe qweqe qweqwe
qweqwe";

Is it possible to change that?? To keep the original declaration... for a multiple declaration??

Thank you very much for your help... Jalopoy is really great... Good job!!!

Steph

Discussion

  • Marco Hunsicker

    Marco Hunsicker - 2002-05-22

    Logged In: YES
    user_id=44430

    >1- When I have an array definition like that:
    > Rstring m_rStatValue[] = {new Rstring("UNK", 15), //
    AIM name
    [...]
    >
    >Comment are moved before the end parenthese ?!?!?!

    Ahh, this endline comment stuff really sucks. One day this
    have to be rewritten or maybe ANTLR has better build-in
    support. I'll look into it and hope I can provide a fix with the
    next beta (I know what the problem is, but changing the
    current implementation will bring other issues...)

    >
    >2- When a declade a method with a thows statement:
    [...]
    >Is it possible to indent the throws statement with the default
    tab to get:
    > public void submitSm( smppHeader h, Message m, byte[]
    body )
    > throws SmppException
    >

    This will be a new feature provided with the next beta.

    >3- When I call a different method from the same object like:
    [...]
    >
    >Is it possible to maintain the same indentation for this case

    Line wrapping is not yet implemented for this dotted stuff. I'm
    still thinking about the best way to implement it. Preserving
    an original style is especially difficult. I will probably add a
    switch to let the user force line wrapping for these kind of
    nested calls.

    >4- When I declare some String like this:
    [...]
    >Is it possible to change that?? To keep the original
    declaration... for a multiple declaration??

    Not possible with the current Java parser grammar and as I
    only have very limited knowledge about this ANTLR stuff, I'm
    not up to change it. The rule in question is
    called "variableDefinitions" (in java.g)

    Thanks for bringing up the issues.

    Cheers,
    Marco

     
  • Marco Hunsicker

    Marco Hunsicker - 2002-05-22
    • assigned_to: nobody --> marcohu
     
  • Stephane Houle

    Stephane Houle - 2002-05-22

    Logged In: YES
    user_id=551412

    Hey thanks Marco for all these answers... Here is my comment on your answer:

    1- Hummm... There is no problem... I can live with that but if you can bring a solution, that can be nice... But no
    prob...

    2- Do you know when the next beta version should be available??

    3- It would be nice to get a switch on that... Because something, that makes really long line... A switch will be
    perfect....

    4- Oh well.... This is a nice to have... Thanks...

    Thank you very much Marco... Keep your good work!!! It's very usefull for us!!

    Stph

     
  • Marco Hunsicker

    Marco Hunsicker - 2002-05-27

    Logged In: YES
    user_id=44430

    1) delayed

    2) + 3) done with 1.0b7

    4) not possible with the current grammar

     
  • Marco Hunsicker

    Marco Hunsicker - 2002-07-28
    • priority: 5 --> 1
     
  • Marco Hunsicker

    Marco Hunsicker - 2002-08-06
    • status: open --> closed-fixed
     

Log in to post a comment.