Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,23 @@ public void write(DataOutput out) throws IOException {

@Override
public void readFields(DataInput in) throws IOException {

// Get the number of "unknown" classes

newClasses = in.readByte();


// Get the class loader of the current thread because
// Class.forName does not have the job jar in its path
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

// Then read in the class names and add them to our tables

for (int i = 0; i < newClasses; i++) {
byte id = in.readByte();
String className = in.readUTF();
try {
addToMap(Class.forName(className), id);

addToMap(classLoader.loadClass(className), id);
} catch (ClassNotFoundException e) {
throw new IOException("can't find class: " + className + " because "+
e.getMessage());
throw new IOException(e);
}
}
}
}
}