# Remove Unnecessary Semicolons

# Properties

Property Value
Rule ID RemoveEmptyStatement
First seen in jSparrow version 2.7.0
Minimum Java version 1.1
Remediation cost 1 min
Links S1116

# 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.

# 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;
}

Automatic Application of This Rule

The automatic application of this rule is supported in the following jSparrow versions:

# Tags

1
default
You & jSparrow
default

Hey there! May I help you? 😊