Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semicolon after a method crashes the process #2

Open
LIttleAncientForestKami opened this issue Aug 9, 2023 · 0 comments
Open

Semicolon after a method crashes the process #2

LIttleAncientForestKami opened this issue Aug 9, 2023 · 0 comments

Comments

@LIttleAncientForestKami
Copy link

If we have a getter like this:

@Override
public String getTitle(){
    return title;
};    // <----- note the semicolon here

this crashes the trivial getter routine (actually the parser called by it crashes) and stops lomboker with a following message:

java.lang.UnsupportedOperationException: kept child(MethodDeclaration) vs ";" <102> (line 313,col 3)-(line 313,col 3)
at com.github.javaparser.printer.lexicalpreservation.Difference.applyKeptDiffElement(Difference.java:513)

Workaround: remove the semicolon or replace }; with just }. Have not tested semicolon on it's own, like so

} // here some method ends
;

While not great, it's legal to place semicolon on it's own line, so ideally this wouldn't crash the reduction (or any other operations, TBH). If not, then I'd welcome wrapping the exception in Lomboker's own with a message "You have an orphaned semicolon at line 313, remove it and restart the process".

BTW, and firstly and foremostly! Thank you for the tool. It saved me hours of work already.

 m    m        mmmmm                                                         
 #    #        #   "#         mmm  m     m  mmm    mmm    mmm   mmmmm   mmm  
 #    #        #mmmm"        "   # "m m m" #"  #  #   "  #" "#  # # #  #"  # 
 #    #        #   "m        m"""#  #m#m#  #""""   """m  #   #  # # #  #"""" 
 "mmmm"        #    "        "mm"#   # #   "#mm"  "mmm"  "#m#"  # # #  "#mm" 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant