File tree Expand file tree Collapse file tree 3 files changed +3
-23
lines changed
main/java/com/uber/cadence
test/java/com/uber/cadence/converter Expand file tree Collapse file tree 3 files changed +3
-23
lines changed Original file line number Diff line number Diff line change 15
15
package com .uber .cadence .client ;
16
16
17
17
import com .uber .cadence .CadenceError ;
18
- import java .util .Objects ;
19
18
20
19
public final class ApplicationFailureException extends CadenceError {
21
20
22
21
public ApplicationFailureException (String message ) {
23
22
super (message );
24
23
}
25
-
26
- @ Override
27
- public boolean equals (Object obj ) {
28
- if (this == obj ) {
29
- return true ;
30
- }
31
- if (obj == null || getClass () != obj .getClass ()) {
32
- return false ;
33
- }
34
- ApplicationFailureException that = (ApplicationFailureException ) obj ;
35
- return Objects .equals (getMessage (), that .getMessage ())
36
- && Objects .equals (getCause (), that .getCause ());
37
- }
38
-
39
- @ Override
40
- public int hashCode () {
41
- return Objects .hash (getMessage (), getCause ());
42
- }
43
24
}
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ public T read(JsonReader jsonReader) throws IOException {
138
138
try {
139
139
classType = Class .forName (className );
140
140
} catch (ClassNotFoundException e ) {
141
- return ( T ) new ApplicationFailureException ( "Class not found: " + className ) ;
141
+ classType = ApplicationFailureException . class ;
142
142
}
143
143
if (!Throwable .class .isAssignableFrom (classType )) {
144
144
throw new IOException ("Expected type that extends Throwable: " + className );
Original file line number Diff line number Diff line change @@ -287,8 +287,7 @@ public void testExceptionNotFound() {
287
287
RuntimeException .class ,
288
288
RuntimeException .class );
289
289
assertEquals (ApplicationFailureException .class , fromConverted .getClass ());
290
- assertEquals (
291
- "Class not found: com.uber.cadence.converter.ExceptionNotFound" ,
292
- fromConverted .getMessage ());
290
+ assertEquals ("application exception" , fromConverted .getMessage ());
291
+ assertNotSame (fromConverted .getStackTrace ().length , 0 );
293
292
}
294
293
}
You can’t perform that action at this time.
0 commit comments