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 1515package com .uber .cadence .client ;
1616
1717import com .uber .cadence .CadenceError ;
18- import java .util .Objects ;
1918
2019public final class ApplicationFailureException extends CadenceError {
2120
2221 public ApplicationFailureException (String message ) {
2322 super (message );
2423 }
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- }
4324}
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ public T read(JsonReader jsonReader) throws IOException {
138138 try {
139139 classType = Class .forName (className );
140140 } catch (ClassNotFoundException e ) {
141- return ( T ) new ApplicationFailureException ( "Class not found: " + className ) ;
141+ classType = ApplicationFailureException . class ;
142142 }
143143 if (!Throwable .class .isAssignableFrom (classType )) {
144144 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() {
287287 RuntimeException .class ,
288288 RuntimeException .class );
289289 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 );
293292 }
294293}
You can’t perform that action at this time.
0 commit comments