Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: master

Operating System version: any

Java version: any

Steps to reproduce this issue

no step

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

1.dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/script/ScriptRouter.java

2.dubbo-common/src/main/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfiguration.java

3.dubbo-common/src/main/java/org/apache/dubbo/common/json/GenericJSONConverter.java

4.dubbo-common/src/main/java/org/apache/dubbo/common/utils/ReflectUtils.java

5.dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ApplicationModel.java

6.dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java

7.dubbo-container/dubbo-container-api/src/main/java/org/apache/dubbo/container/Main.java

8.dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/support/AbstractMetadataReport.java

9.dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/store/BaseWritableMetadataService.java

10.dubbo-metadata/dubbo-metadata-definition-protobuf/src/main/java/org/apache/dubbo/metadata/definition/protobuf/ProtobufTypeBuilder.java

11.dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java

12.dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/DubboLogo.java

13.dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/Server.java

14.dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/handler/QosProcessHandler.java

15.dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/server/handler/TelnetProcessHandler.java

16.dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/server/handler/TelnetProcessHandlerTest.java

17.dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/servlet/DispatcherServlet.java

18.dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyClient.java

19.dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/DeprecatedFilter.java

20.dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/CallbackServiceCodec.java

21.dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/filter/TraceFilter.java

22.dubbo-rpc/dubbo-rpc-native-thrift/src/main/java/org/apache/dubbo/rpc/protocol/nativethrift/ThriftProtocol.java

23.dubbo-serialization/dubbo-serialization-fst/src/main/java/org/apache/dubbo/common/serialize/fst/FstFactory.java

What do you expected from the above steps？

1.changes constants in a class to uppercase and underscores between words

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.5.10

Operating System version: Mac

Java version: 1.7

Issue Description

In java serialization, the writeReplace method allows the developer to provide a replacement object that will be serialized instead of the original one.

Normally, this method would return another object. However, some classes may return itself, e.g. JsonMappingException#Reference.

In this case, hessian2 would enter an infinite recursion and finally get the java.lang.StackOverflowError.

Step to reproduce this issue

Define a class with a writeReplace method return this

public class WriteReplaceReturningItself implements Serializable {

private static final long serialVersionUID = 1L;

private String name;

WriteReplaceReturningItself(String name) {
this.name = name;
}

public String getName() {
return name;
}

/**
* Some object may return itself for wrapReplace, e.g.
* https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/JsonMappingException.java#L173
*/
Object writeReplace() {
//do some extra things

return this;
}
}

Use Hessian2Output to serialize it

ByteArrayOutputStream bout = new ByteArrayOutputStream();
Hessian2Output out = new Hessian2Output(bout);

out.writeObject(data);
out.flush();

Error occurs

java.lang.StackOverflowError
at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:302)
at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:381)
at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:226)
at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:383)
at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:226)

Expected Result

The serialization process should complete with no exception or error.

Actual Result

java.lang.StackOverflowError
at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:302)
at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:381)
at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:226)
at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:383)
at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:226)