Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Jun 23, 2024
1 parent c5e4b61 commit 68e4450
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ tasks.javadoc {
options {
(this as? StandardJavadocDocletOptions)?.apply {
links(
"https://docs.oracle.com/javase/21/docs/api/",
"https://docs.oracle.com/en/java/javase/21/docs/api/",
)
addStringOption("Xdoclint:none", "-quiet")
if (JavaVersion.current().isJava9Compatible)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/bluecolored/bluenbt/TypeToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class TypeToken<T> {
* You can create any TypeToken instance by creating an anonymous subclass with type-parameters.<br>
* Like this:
* <blockquote><pre>
* TypeToken< Map<String, Collection<Integer>> > typeToken = new TypeToken<>() {};
* TypeToken&lt; Map&lt;String, Collection&lt;Integer&gt;&gt; &gt; typeToken = new TypeToken&lt;&gt;() {};
* </pre></blockquote>
*/
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -157,7 +157,7 @@ public static <T> TypeToken<T> of(Class<T> type) {
/**
* Creates a new TypeToken representing the provided generic type with the specified type-arguments
* <blockquote><pre>
* // Map<String, Object>
* // Map&lt;String, Object&gt;
* TypeToken.of(Map.class, String.class, Object.class)
* </pre></blockquote>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class MapAdapterFactory implements TypeAdapterFactory {

public static final MapAdapterFactory INSTANCE = new MapAdapterFactory();

@SuppressWarnings("unchecked")
@Override
public <T> Optional<TypeAdapter<T>> create(TypeToken<T> typeToken, BlueNBT blueNBT) {
Type[] keyAndValueTypes = getMapKeyAndValueTypes(typeToken);
Expand All @@ -54,7 +55,6 @@ public <T> Optional<TypeAdapter<T>> create(TypeToken<T> typeToken, BlueNBT blueN
fromStringFunction = Function.identity();
} else if (Enum.class.isAssignableFrom(keyType)) {
toStringFunction = (Function<Enum<?>, String>) Enum::name;
//noinspection unchecked, rawtypes
fromStringFunction = (Function<String, Enum>) name -> Enum.valueOf((Class<? extends Enum>) keyAndValueTypes[0], name);
} else {
// key-type not supported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* <blockquote><pre>
* NBT-Tag -> Deserialized Java-Object
* --------------------
* COMPOUND -> LinkedHashMap<String, Object>
* LIST -> ArrayList<Object>
* COMPOUND -> LinkedHashMap&lt;String, Object&gt;
* LIST -> ArrayList&lt;Object&gt;
* STRING -> String
* BYTE -> byte
* SHORT -> short
Expand Down

0 comments on commit 68e4450

Please sign in to comment.