Skip to content

Commit

Permalink
Fix use of java-19 api
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed May 22, 2024
1 parent 8455b50 commit 2c2d2f9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ private void dumpInstance(Object instance, JsonWriter writer, Set<Object> alread
}

if (!alreadyDumped.add(instance)) {
writer.value("<<" + Objects.toIdentityString(instance) + ">>");
writer.value("<<" + toIdentityString(instance) + ">>");
return;
}

writer.beginObject();
try {
String identityString = Objects.toIdentityString(instance);
String identityString = toIdentityString(instance);
writer.name("#identity").value(identityString);

if (instance instanceof Map<?, ?> map) {
Expand Down Expand Up @@ -208,6 +208,10 @@ private void dumpInstance(Object instance, JsonWriter writer, Set<Object> alread
}
}

private static String toIdentityString(Object instance) {
return instance.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(instance));
}

private void dumpAnnotatedInstance(Class<?> type, Object instance, JsonWriter writer, Set<Object> alreadyDumped) throws IOException {

DebugDump typedd = type.getAnnotation(DebugDump.class);
Expand Down

0 comments on commit 2c2d2f9

Please sign in to comment.