Fix IntelliJ warnings in Java code

Fix all IntelliJ warnings in Java production code except for
bogus spelling warnings and warnings about unused public methods.
Also fix some warnings emitted by Code->Inspect Code.

Changes made:
- use text block instead of string concatenation
- extract method to avoid code duplication
- use switch expression
- fix Javadoc syntax and spelling
- fix spelling in comment
- increase class visibility to match visibility of use site
- delete overriding method with same implementation
- use String.isEmpty() and StringBuilder.isEmpty()
- add @Serial annotation
- make field final
- remove unused field
- remove unused private method
- remove exceptions that aren't thrown from throws clause
- insert non-null assertion
- annotate overriding method with @Nonnull
- suppress warning
- delete unused class (WriteAuxiliarySlotNode)
- add final modifier
- remove unused error message
- repeat @Nullable modifier in overriding method
- remove never thrown exception from throws clause
- remove redundant suppression
This commit is contained in:
translatenix
2024-04-26 20:32:48 -07:00
committed by Daniel Chao
parent 5feaa2aaf7
commit ae69e4776f
51 changed files with 148 additions and 302 deletions

View File

@@ -19,7 +19,7 @@ import java.util.*;
import java.util.regex.Pattern;
/**
* A semantic version (https://semver.org/spec/v2.0.0.html).
* A <a href="https://semver.org/spec/v2.0.0.html">semantic version</a>.
*
* <p>This class guarantees that valid semantic version numbers are handled correctly, but does
* <em>not</em> guarantee that invalid semantic version numbers are rejected.
@@ -212,8 +212,7 @@ final class Version implements Comparable<Version> {
@Override
public String toString() {
return ""
+ major
return major
+ "."
+ minor
+ "."