Skip to content

Commit f5e0544

Browse files
committed
Rename function
1 parent 3d19060 commit f5e0544

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

h2o-core/src/main/java/water/AutoBuffer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1578,13 +1578,13 @@ public static byte[] javaSerializeWritePojo(Object o) {
15781578
}
15791579
}
15801580

1581-
public static Object javaSerializeReadPojo(byte [] bytes) {
1581+
public static Object javaSerializeReadBytes(byte [] bytes) {
15821582
try {
15831583
final ValidatingObjectInputStream ois = new ValidatingObjectInputStream(new ByteArrayInputStream(bytes));
15841584
// GH-16174 this method is used for HyperParameter serialization and allow execution of malicious code
15851585
// if the object type is not checked -> the acceptable objects are Integer, Number and String
15861586
// 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
15881588
ois.accept(Integer.class, Number.class, String.class,
15891589
water.exceptions.H2OIllegalArgumentException.class,
15901590
water.exceptions.H2OAbstractRuntimeException.class,
@@ -1657,7 +1657,7 @@ static String nameOfClass(byte[] bytes) {
16571657

16581658
@SuppressWarnings("unused") public Object getSer() {
16591659
byte[] ba = getA1();
1660-
return ba == null ? null : javaSerializeReadPojo(ba);
1660+
return ba == null ? null : javaSerializeReadBytes(ba);
16611661
}
16621662

16631663
@SuppressWarnings("unused") public <T> T getSer(Class<T> tc) {

h2o-core/src/main/java/water/DTask.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import water.H2O.H2OCountedCompleter;
55
import water.util.DistributedException;
66

7-
import java.io.*;
8-
97
/** Objects which are passed and {@link #dinvoke} is remotely executed.<p>
108
* <p>
119
* Efficient serialization methods for subclasses will be automatically
@@ -42,7 +40,7 @@ public synchronized void setException(Throwable ex) {
4240
}
4341
/** The _ex field as a RuntimeException or null.
4442
* @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);}
4644

4745
// Track if the reply came via TCP - which means a timeout on ACKing the TCP
4846
// result does NOT need to get the entire result again, just that the client

h2o-core/src/main/java/water/Job.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void fail(Throwable ex) {
192192
private byte [] _ex;
193193
public Throwable ex() {
194194
if(_ex == null) return null;
195-
return (Throwable)AutoBuffer.javaSerializeReadPojo(_ex);
195+
return (Throwable)AutoBuffer.javaSerializeReadBytes(_ex);
196196
}
197197

198198
/** Total expected work. */
@@ -438,7 +438,7 @@ public T get() {
438438
bar.join(); // Block on the *barrier* task, which blocks until the fjtask on*Completion code runs completely
439439
assert isStopped();
440440
if (_ex!=null)
441-
throw new RuntimeException((Throwable)AutoBuffer.javaSerializeReadPojo(_ex));
441+
throw new RuntimeException((Throwable)AutoBuffer.javaSerializeReadBytes(_ex));
442442
// Maybe null return, if the started fjtask does not actually produce a result at this Key
443443
return _result==null ? null : _result.get();
444444
}

0 commit comments

Comments
 (0)