Fail with an informative message if there are NO constructors.
Which shouldn't happen. And re: the last commit, this is only called once for each class so the deal wasn't so big.
This commit is contained in:
@@ -425,7 +425,7 @@ public abstract class Streamer
|
|||||||
// otherwise there should be a single non-zero-argument constructor, which we'll call
|
// otherwise there should be a single non-zero-argument constructor, which we'll call
|
||||||
// with zero-valued arguments at unstreaming time, which will then be overwritten by
|
// with zero-valued arguments at unstreaming time, which will then be overwritten by
|
||||||
// readObject()
|
// readObject()
|
||||||
if (ctors.length > 1) {
|
if (ctors.length != 1) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Streamable closure classes must have either a zero-argument constructor " +
|
"Streamable closure classes must have either a zero-argument constructor " +
|
||||||
"or a single argument-taking constructor; multiple argument-taking " +
|
"or a single argument-taking constructor; multiple argument-taking " +
|
||||||
|
|||||||
Reference in New Issue
Block a user