New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2842]Replace Fastjson with Jackson #2893
Conversation
api/src/main/java/com/alibaba/nacos/api/exception/NacosDeserializationException.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Override
public String toString() { public String toString() {
ObjectMapper objectMapper = new ObjectMapper(); return "Instance{" +
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); "instanceId='" + instanceId + '\'' +
try { ", ip='" + ip + '\'' +
return objectMapper.writeValueAsString(this); ", port=" + port +
} catch (JsonProcessingException e) { ", weight=" + weight +
throw new RuntimeException("Instance toJson failed", e); ", healthy=" + healthy +
} ", enabled=" + enabled +
", ephemeral=" + ephemeral +
", clusterName='" + clusterName + '\'' +
", serviceName='" + serviceName + '\'' +
", metadata=" + metadata +
'}';
} }
ephemeral 这个字段是后来增加了,如果之前没有的看一下是为空还是null,如果是null看一下是否有问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NacosDeserializationException / NacosSerializationException 看一下差别有多大,如果一个能搞定建议搞一个。 因为我看这个类大部分是一样的。 如果对比同领域都拆开以便更精细控制表达可以留着
目前api.pojo.Instance的toString方法并没有被使用,naming中子类重写了toString方法,所以这里影响不大。 |
可以通过错误码区分。通过错误码区分的话 可以合并成一个 |
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
For #2842 .
Replace Fastjson with Jackson.
Brief changelog
Verifying this change
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.