File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ proto.readObject = function (withType) {
423423 debug ( 'read object finish' ) ;
424424
425425 // java.lang.NoClassDefFoundError
426- if ( / E x c e p t i o n $ / . test ( type ) || / ^ j a v a \ .l a n g \. \w + E r r o r $ / . test ( type ) ) {
426+ if ( type . endsWith ( 'Exception' ) || ( type . startsWith ( ' java.lang.' ) && type . endsWith ( 'Error' ) ) ) {
427427 result . $ = new JavaExceptionError ( result , withType ) ;
428428 }
429429
Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ proto.readObject = function (withType) {
571571 } else {
572572 this . throwError ( 'readObject' , code ) ;
573573 }
574-
574+
575575 var cls = this . classes [ ref ] ;
576576 debug ( 'readObject %s, ref: %s' , cls . name , ref ) ;
577577
@@ -590,7 +590,7 @@ proto.readObject = function (withType) {
590590 }
591591 }
592592
593- if ( / E x c e p t i o n $ / . test ( cls . name ) ) {
593+ if ( cls . name . endsWith ( 'Exception' ) ) {
594594 result . $ = new JavaExceptionError ( result , withType ) ;
595595 }
596596
@@ -759,7 +759,7 @@ utils.addByteCodes(BYTE_CODES, [
759759 * v2.0
760760 * ```
761761 * map ::= M(x4d) [type] (value value)* Z
762- *
762+ *
763763 * @see http://hessian.caucho.com/doc/hessian-serialization.html##map
764764 * ```
765765 * Represents serialized maps and can represent objects.
@@ -801,7 +801,7 @@ proto.readMap = function (withType) {
801801 this . _addRef ( result ) ;
802802 this . _readMap ( result . $ , withType ) ;
803803
804- if ( / E x c e p t i o n $ / . test ( type ) ) {
804+ if ( type . endsWith ( 'Exception' ) ) {
805805 result . $ = new JavaExceptionError ( result ) ;
806806 }
807807
You can’t perform that action at this time.
0 commit comments