23
23
import java .io .IOException ;
24
24
import java .io .InputStream ;
25
25
import java .lang .reflect .Type ;
26
+ import java .util .Objects ;
26
27
27
28
import com .alibaba .com .caucho .hessian .io .Hessian2Input ;
28
29
@@ -96,9 +97,9 @@ public String readUTF() throws IOException {
96
97
97
98
@ Override
98
99
public Object readObject () throws IOException {
99
- if (!mH2i . getSerializerFactory ()
100
- . getClassLoader ()
101
- . equals ( Thread .currentThread ().getContextClassLoader ())) {
100
+ if (!Objects . equals (
101
+ mH2i . getSerializerFactory (). getClassLoader (),
102
+ Thread .currentThread ().getContextClassLoader ())) {
102
103
mH2i .setSerializerFactory (hessian2FactoryManager .getSerializerFactory (
103
104
Thread .currentThread ().getContextClassLoader ()));
104
105
}
@@ -108,9 +109,9 @@ public Object readObject() throws IOException {
108
109
@ Override
109
110
@ SuppressWarnings ("unchecked" )
110
111
public <T > T readObject (Class <T > cls ) throws IOException , ClassNotFoundException {
111
- if (!mH2i . getSerializerFactory ()
112
- . getClassLoader ()
113
- . equals ( Thread .currentThread ().getContextClassLoader ())) {
112
+ if (!Objects . equals (
113
+ mH2i . getSerializerFactory (). getClassLoader (),
114
+ Thread .currentThread ().getContextClassLoader ())) {
114
115
mH2i .setSerializerFactory (hessian2FactoryManager .getSerializerFactory (
115
116
Thread .currentThread ().getContextClassLoader ()));
116
117
}
@@ -119,9 +120,9 @@ public <T> T readObject(Class<T> cls) throws IOException, ClassNotFoundException
119
120
120
121
@ Override
121
122
public <T > T readObject (Class <T > cls , Type type ) throws IOException , ClassNotFoundException {
122
- if (!mH2i . getSerializerFactory ()
123
- . getClassLoader ()
124
- . equals ( Thread .currentThread ().getContextClassLoader ())) {
123
+ if (!Objects . equals (
124
+ mH2i . getSerializerFactory (). getClassLoader (),
125
+ Thread .currentThread ().getContextClassLoader ())) {
125
126
mH2i .setSerializerFactory (hessian2FactoryManager .getSerializerFactory (
126
127
Thread .currentThread ().getContextClassLoader ()));
127
128
}
0 commit comments