File tree 3 files changed +6
-8
lines changed
h2o-core/src/main/java/water
3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1578,13 +1578,13 @@ public static byte[] javaSerializeWritePojo(Object o) {
1578
1578
}
1579
1579
}
1580
1580
1581
- public static Object javaSerializeReadPojo (byte [] bytes ) {
1581
+ public static Object javaSerializeReadBytes (byte [] bytes ) {
1582
1582
try {
1583
1583
final ValidatingObjectInputStream ois = new ValidatingObjectInputStream (new ByteArrayInputStream (bytes ));
1584
1584
// GH-16174 this method is used for HyperParameter serialization and allow execution of malicious code
1585
1585
// if the object type is not checked -> the acceptable objects are Integer, Number and String
1586
1586
// TODO: see what happens with other usage of this method -> edit acceptable classes based on the tests results
1587
- // TODO: find better way to defifne acceptable class
1587
+ // TODO: find better way to define acceptable classes
1588
1588
ois .accept (Integer .class , Number .class , String .class ,
1589
1589
water .exceptions .H2OIllegalArgumentException .class ,
1590
1590
water .exceptions .H2OAbstractRuntimeException .class ,
@@ -1657,7 +1657,7 @@ static String nameOfClass(byte[] bytes) {
1657
1657
1658
1658
@ SuppressWarnings ("unused" ) public Object getSer () {
1659
1659
byte [] ba = getA1 ();
1660
- return ba == null ? null : javaSerializeReadPojo (ba );
1660
+ return ba == null ? null : javaSerializeReadBytes (ba );
1661
1661
}
1662
1662
1663
1663
@ SuppressWarnings ("unused" ) public <T > T getSer (Class <T > tc ) {
Original file line number Diff line number Diff line change 4
4
import water .H2O .H2OCountedCompleter ;
5
5
import water .util .DistributedException ;
6
6
7
- import java .io .*;
8
-
9
7
/** Objects which are passed and {@link #dinvoke} is remotely executed.<p>
10
8
* <p>
11
9
* Efficient serialization methods for subclasses will be automatically
@@ -42,7 +40,7 @@ public synchronized void setException(Throwable ex) {
42
40
}
43
41
/** The _ex field as a RuntimeException or null.
44
42
* @return The _ex field as a RuntimeException or null. */
45
- public Throwable getDException () {return _ex == null ?null :(Throwable )AutoBuffer .javaSerializeReadPojo (_ex );}
43
+ public Throwable getDException () {return _ex == null ?null :(Throwable )AutoBuffer .javaSerializeReadBytes (_ex );}
46
44
47
45
// Track if the reply came via TCP - which means a timeout on ACKing the TCP
48
46
// result does NOT need to get the entire result again, just that the client
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ public void fail(Throwable ex) {
192
192
private byte [] _ex ;
193
193
public Throwable ex () {
194
194
if (_ex == null ) return null ;
195
- return (Throwable )AutoBuffer .javaSerializeReadPojo (_ex );
195
+ return (Throwable )AutoBuffer .javaSerializeReadBytes (_ex );
196
196
}
197
197
198
198
/** Total expected work. */
@@ -438,7 +438,7 @@ public T get() {
438
438
bar .join (); // Block on the *barrier* task, which blocks until the fjtask on*Completion code runs completely
439
439
assert isStopped ();
440
440
if (_ex !=null )
441
- throw new RuntimeException ((Throwable )AutoBuffer .javaSerializeReadPojo (_ex ));
441
+ throw new RuntimeException ((Throwable )AutoBuffer .javaSerializeReadBytes (_ex ));
442
442
// Maybe null return, if the started fjtask does not actually produce a result at this Key
443
443
return _result ==null ? null : _result .get ();
444
444
}
You can’t perform that action at this time.
0 commit comments