The eclipse generated equals() method does not have { } for if structure. e.g
public boolean equals(Object obj) {
if (this == obj)
return true;
.........
return true;
}
How can it be changed to generate code in following patter
public boolean equals(Object obj) {
if (this == obj){
return true;
}
.........
return true;
}
You can use the check Use blocks in if statements
of the Generate hashcode and equals
option to generate the brackets, like this:
And the code generated will look like:
Another option is use the Save actions
feature, and add a format sourcecode
action.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With