Skip to content

Commit

Permalink
Allow for deserialized JavaType.Unknown instances
Browse files Browse the repository at this point in the history
These can't be compared with referential equality against `JavaType.Unknown.getInstance()`.
  • Loading branch information
knutwannheden committed Oct 31, 2023
1 parent 15ecf02 commit 289e809
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DefaultJavaTypeSignatureBuilder implements JavaTypeSignatureBuilder

@Override
public String signature(@Nullable Object type) {
if (type == null || type == JavaType.Unknown.getInstance()) {
if (type == null || type instanceof JavaType.Unknown) {
return "{undefined}";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,7 @@ public static JavaType.Primitive asPrimitive(@Nullable JavaType type) {

@Nullable
public static JavaType.FullyQualified asFullyQualified(@Nullable JavaType type) {
if (type instanceof JavaType.FullyQualified) {
if (type == JavaType.Unknown.getInstance()) {
return null;
}
if (type instanceof JavaType.FullyQualified && !(type instanceof JavaType.Unknown)) {
return (JavaType.FullyQualified) type;
}
return null;
Expand Down

0 comments on commit 289e809

Please sign in to comment.