Skip to content

Commit

Permalink
handle and print error
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar committed Nov 11, 2023
1 parent 8184646 commit 128a81b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/nucleodb.library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = 'com.nucleodb'
version = '1.9.24'
version = '1.9.25'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,17 @@ public Connection(DataEntry from, String label, DataEntry to) {
this.modified = Instant.now();
}

public <T> T copy(Class<T> clazz) throws JsonProcessingException {
public <T> T copy(Class<T> clazz) {
ObjectMapper om = new ObjectMapper()
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
.findAndRegisterModules()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return om.readValue(om.writeValueAsString(this), clazz);
try {
return om.readValue(om.writeValueAsString(this), clazz);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
}

public Connection(DataEntry from, String label, DataEntry to, Map<String, String> metadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ public DataEntry(Create create) throws ClassNotFoundException, JsonProcessingExc
}


public <T> T copy(Class<T> clazz) throws JsonProcessingException {
public <T> T copy(Class<T> clazz) {
ObjectMapper om = new ObjectMapper()
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
.findAndRegisterModules()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return om.readValue(om.writeValueAsString(this), clazz);
try {
return om.readValue(om.writeValueAsString(this), clazz);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
}

public DataEntry() {
Expand Down

0 comments on commit 128a81b

Please sign in to comment.