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

@@ -55,7 +55,7 @@ public interface Config {
/**
* Converts this node's value to the given {@link Type}.
*
* <p>Note that usages of this methods are not type safe.
* <p>Note that usages of this method are not type safe.
*
* @throws ConversionException if the value cannot be converted to the given type
*/

View File

@@ -22,12 +22,12 @@ import org.pkl.core.PClassInfo;
/**
* A factory for {@link Converter}s. Used to implement conversions to generic Java classes. In such
* a case a single {@link Converter} does not suffice. Instead the factory creates a new converter
* a case a single {@link Converter} does not suffice. Instead, the factory creates a new converter
* for every parameterization of the target type. Once created, the converter is cached for later
* use, and the factory is never again invoked for the same parameterized target type.
*
* <p>For best performance, all introspection of target types (for example using {@link Reflection})
* should happen in the factory rather then the returned converters.
* should happen in the factory rather than the returned converters.
*/
@FunctionalInterface
public interface ConverterFactory {

View File

@@ -104,8 +104,8 @@ public final class Reflection {
/**
* Returns a parameterization of the given raw supertype, taking into account type arguments of
* the given subtype. For example, @{code getExactSupertype(listOf(String.class),
* Collection.class)} will return @{code collectionOf(String.class)}. If the given subtype is not
* the given subtype. For example, {@code getExactSupertype(listOf(String.class),
* Collection.class)} will return {@code collectionOf(String.class)}. If the given subtype is not
* a parameterized type, returns the given raw supertype. If the given types have no inheritance
* relationship, returns {@code null}.
*/
@@ -118,8 +118,8 @@ public final class Reflection {
/**
* Returns a parameterization of the given raw subtype, taking into account type arguments of the
* given supertype. For example, @{code getExactSubtype(collectionOf(String.class), List.class)}
* will return @{code listOf(String.class)}. If the given supertype is not a parameterized type,
* given supertype. For example, {@code getExactSubtype(collectionOf(String.class), List.class)}
* will return {@code listOf(String.class)}. If the given supertype is not a parameterized type,
* returns the given raw subtype. If the given types have no inheritance relationship, returns
* {@code null}.
*/