Skip to content

Commit

Permalink
kill the ide with one annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Jul 12, 2024
1 parent cdbcf8c commit 680b762
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/main/java/dev/nolij/zson/Zson.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.nolij.zson;

import org.intellij.lang.annotations.Language;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -10,13 +11,21 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;

import java.nio.file.Files;
import java.nio.file.Path;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.Map.Entry;

import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@SuppressWarnings({"deprecation", "UnstableApiUsage"})
public final class Zson {
Expand Down Expand Up @@ -50,7 +59,7 @@ public static Map.Entry<String, ZsonValue> entry(@NotNull String key, @Nullable
@Contract("_ -> new")
public static Map<String, ZsonValue> object(@NotNull Map.Entry<String, ZsonValue>... entries) {
Map<String, ZsonValue> map = new LinkedHashMap<>();
for (Entry<String, ZsonValue> e : entries) {
for (Map.Entry<String, ZsonValue> e : entries) {
map.put(e.getKey(), e.getValue());
}
return map;
Expand Down Expand Up @@ -349,7 +358,7 @@ public static <T> T parseFile(@NotNull Path path) throws IOException {
*/
@Nullable
@Contract(pure = true)
public static <T> T parseString(@NotNull String serialized) {
public static <T> T parseString(@NotNull @Language("json5") String serialized) {
try {
return parse(new StringReader(serialized));
} catch (IOException e) {
Expand Down

0 comments on commit 680b762

Please sign in to comment.