private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException { ois.readObject(); try { Field constructor = ConstructorExpression.class.getDeclaredField("constructor"); constructor.setAccessible(true); constructor.set(this, getConstructor(getType(), parameterTypes)); Field transformers = ConstructorExpression.class.getDeclaredField("transformers"); transformers.setAccessible(true); transformers.set(this, getTransformers(this.constructor)); } catch (Exception e) { throw new RuntimeException(e); } }
protected ConstructorExpression(Class<? extends T> type, Class<?>[] paramTypes, ImmutableList<Expression<?>> args) { super(type); try { this.parameterTypes = getConstructorParameters(type, paramTypes).clone(); this.args = args; this.constructor = getConstructor(getType(), parameterTypes); this.transformers = getTransformers(constructor); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } }
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException { ois.readObject(); try { Field constructor = ConstructorExpression.class.getDeclaredField("constructor"); constructor.setAccessible(true); constructor.set(this, getConstructor(getType(), parameterTypes)); Field transformers = ConstructorExpression.class.getDeclaredField("transformers"); transformers.setAccessible(true); transformers.set(this, getTransformers(this.constructor)); } catch (Exception e) { throw new RuntimeException(e); } }
protected ConstructorExpression(Class<? extends T> type, Class<?>[] paramTypes, ImmutableList<Expression<?>> args) { super(type); try { this.parameterTypes = getConstructorParameters(type, paramTypes).clone(); this.args = args; this.constructor = getConstructor(getType(), parameterTypes); this.transformers = getTransformers(constructor); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } }