-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3876 Fix TypeFactory cache performance degradation with `constructSp…
…ecializedType` (#3875) Improve TypeFactory cache performance with `constructSpecializedType` (...)
- Loading branch information
1 parent
ba76216
commit 9906b13
Showing
10 changed files
with
174 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/fasterxml/jackson/databind/type/IdentityEqualityType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.fasterxml.jackson.databind.type; | ||
|
||
import com.fasterxml.jackson.databind.JavaType; | ||
|
||
/** | ||
* Internal abstract type representing {@link TypeBase} implementations which use reference equality. | ||
*/ | ||
abstract class IdentityEqualityType extends TypeBase { | ||
protected IdentityEqualityType( | ||
Class<?> raw, | ||
TypeBindings bindings, | ||
JavaType superClass, | ||
JavaType[] superInts, | ||
int hash, | ||
Object valueHandler, | ||
Object typeHandler, | ||
boolean asStatic) { | ||
super(raw, bindings, superClass, superInts, hash, valueHandler, typeHandler, asStatic); | ||
} | ||
|
||
@Override | ||
public final boolean equals(Object o) { | ||
return o == this; | ||
} | ||
|
||
@Override | ||
public final int hashCode() { | ||
// The identity hashCode must be used otherwise all instances will have colliding hashCodes. | ||
return System.identityHashCode(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters