# Remove Unnecessary Semicolons
# Description
Finds and removes the unnecessary semicolons from the code blocks.
# Benefits
Improves the readability by removing code that do not produce any computation steps.
# Tags
# Code Changes
# Unnecessary semicolon in method body
Pre
public void unnecessarySemiColon() {
;
int a = 0;
}
Post
public void unnecessarySemiColon() {
int a = 0;
}
# Multiple unnecessary semicolons
Pre
public void unnecessarySemiColon() {
;;;;
int a = 0;;;
;;;;
}
Post
public void unnecessarySemiColon() {
int a = 0;
}
# Limitations
# Unnecessary semicolons in class' body
class Foo {
;
private String foo;
}
Use a Java Refactoring Tool
Automate this Refactoring system-wide
You can apply this refactoring for free with the jSparrow Eclipse IDE plug-in.
Install the plug-in for Eclipse IDE: Eclipse Marketplace.