Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,45 +223,45 @@ public void enhance(ComponentRegistry registry) {
}

/**
* Checks the classpath for Jackson 2 or Jackson 3 and its requiremenets for this application.
* Checks the classpath for Jackson 2 or Jackson 3 and its requirements for this application.
* Will fail to create the component if neither is there, or if one is present and doesn't have the right modules.
*/
private static RSocketPayloadEncodingStrategy createJackson2Or3EncodingStrategy() {
try {
Class.forName("tools.jackson.databind.ObjectMapper");
Class.forName("com.fasterxml.jackson.databind.ObjectMapper");
try {
Class.forName("tools.jackson.dataformat.cbor.CBORMapper");
Class.forName(
"com.fasterxml.jackson.dataformat.cbor.databind.CBORMapper");
try {
Class.forName("tools.jackson.module.kotlin.KotlinModule");
return new CborJackson3EncodingStrategy();
Class.forName(
"com.fasterxml.jackson.module.kotlin.KotlinModule");
return new CborJackson2EncodingStrategy();
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
"Found Jackson 3 on the classpath, but can not find the KotlinModule. Please add the tools.jackson.module:jackson-module-kotlin dependency to your project");
"Found Jackson 2 on the classpath, but can not find the KotlinModule. Please add the com.fasterxml.jackson.module:jackson-module-kotlin dependency to your project");
}
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
"Found Jackson 3 on the classpath, but cannot find the CBOR dataformat. Please add the tools.jackson.dataformat:jackson-dataformat-cbor dependency to your project.");
"Found Jackson 2 on the classpath, but cannot find the CBOR dataformat. Please add the com.fasterxml.jackson.dataformat:jackson-dataformat-cbor dependency to your project.");
}
} catch (ClassNotFoundException e) {
// Do nothing, Jackson 3 is not on the classpath. Continue to check for 2
// Do nothing, Jackson 2 is not on the classpath. Continue to check for 3
}

try {
Class.forName("com.fasterxml.jackson.databind.ObjectMapper");
Class.forName("tools.jackson.databind.ObjectMapper");
try {
Class.forName(
"com.fasterxml.jackson.dataformat.cbor.databind.CBORMapper");
Class.forName("tools.jackson.dataformat.cbor.CBORMapper");
try {
Class.forName(
"com.fasterxml.jackson.module.kotlin.KotlinModule");
return new CborJackson2EncodingStrategy();
Class.forName("tools.jackson.module.kotlin.KotlinModule");
return new CborJackson3EncodingStrategy();
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
"Found Jackson 2 on the classpath, but can not find the KotlinModule. Please add the com.fasterxml.jackson.module:jackson-module-kotlin dependency to your project");
"Found Jackson 3 on the classpath, but can not find the KotlinModule. Please add the tools.jackson.module:jackson-module-kotlin dependency to your project");
}
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
"Found Jackson 2 on the classpath, but cannot find the CBOR dataformat. Please add the com.fasterxml.jackson.dataformat:jackson-dataformat-cbor dependency to your project.");
"Found Jackson 3 on the classpath, but cannot find the CBOR dataformat. Please add the tools.jackson.dataformat:jackson-dataformat-cbor dependency to your project.");
}
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(
Expand Down
Loading