-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
145631f
commit d91d21d
Showing
10 changed files
with
146 additions
and
85 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
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
35 changes: 35 additions & 0 deletions
35
afterburner/src/main/java/com/fasterxml/jackson/module/afterburner/ser/SerializerUtil.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,35 @@ | ||
package com.fasterxml.jackson.module.afterburner.ser; | ||
|
||
import com.fasterxml.jackson.databind.JsonSerializer; | ||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
import com.fasterxml.jackson.databind.util.ClassUtil; | ||
|
||
/** | ||
* Helper class that contains utility methods needed by various other classes | ||
* in this package. | ||
* | ||
* @since 2.12 | ||
*/ | ||
class SerializerUtil | ||
{ | ||
/** | ||
* Helper method used to check whether given serializer is the default | ||
* serializer implementation: this is necessary to avoid overriding other | ||
* kinds of serializers. | ||
*/ | ||
public static boolean isDefaultSerializer(JsonSerializer<?> ser) | ||
{ | ||
if (ser == null) { | ||
return true; | ||
} | ||
if (ClassUtil.isJacksonStdImpl(ser)) { | ||
// 20-Nov-2020, tatu: As per [modules-base#117], need to consider | ||
// one standard serializer that should not be replaced... | ||
if (ser instanceof ToStringSerializer) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
...c/test/java/com/fasterxml/jackson/module/afterburner/failing/JsonFormatForSer117Test.java
This file was deleted.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
blackbird/src/main/java/com/fasterxml/jackson/module/blackbird/ser/SerializerUtil.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,35 @@ | ||
package com.fasterxml.jackson.module.blackbird.ser; | ||
|
||
import com.fasterxml.jackson.databind.JsonSerializer; | ||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
import com.fasterxml.jackson.databind.util.ClassUtil; | ||
|
||
/** | ||
* Helper class that contains utility methods needed by various other classes | ||
* in this package. | ||
* | ||
* @since 2.12 | ||
*/ | ||
class SerializerUtil | ||
{ | ||
/** | ||
* Helper method used to check whether given serializer is the default | ||
* serializer implementation: this is necessary to avoid overriding other | ||
* kinds of serializers. | ||
*/ | ||
public static boolean isDefaultSerializer(JsonSerializer<?> ser) | ||
{ | ||
if (ser == null) { | ||
return true; | ||
} | ||
if (ClassUtil.isJacksonStdImpl(ser)) { | ||
// 20-Nov-2020, tatu: As per [modules-base#117], need to consider | ||
// one standard serializer that should not be replaced... | ||
if (ser instanceof ToStringSerializer) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
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