Skip to content

Commit

Permalink
fix: make Groot compatible with jdk1.8 (#4004)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongze0629 authored Jul 5, 2024
1 parent fad59b6 commit 7ab99ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -118,7 +119,7 @@ public static GraphSchemaMapper parseFromJson(String schemaJson) {

public static void main(String[] args) throws IOException {
String path = "groot-server/src/test/resources/schema.json";
String schemaJson = Files.readString(Path.of(path));
String schemaJson = new String(Files.readAllBytes(Paths.get(path)), StandardCharsets.UTF_8);
GraphSchema graphSchema = GraphSchemaMapper.parseFromJson(schemaJson).toGraphSchema();
GraphSchemaMapper mapper = GraphSchemaMapper.parseFromSchema(graphSchema);
System.out.println(mapper.toJsonString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class EdgeMapping {
@JsonIgnore
public String getInputFileName() {
String input = inputs.get(0);
String[] parts = input.strip().split("/");
String[] parts = input.trim().split("/");
return parts[parts.length - 1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class VertexMapping {
@JsonIgnore
public String getInputFileName() {
String input = inputs.get(0);
String[] parts = input.strip().split("/");
String[] parts = input.trim().split("/");
return parts[parts.length - 1];
}
}

0 comments on commit 7ab99ec

Please sign in to comment.