final Procedure1<MutableMethodDeclaration> _function = new Procedure1<MutableMethodDeclaration>() {
public void apply(final MutableMethodDeclaration init) {
boolean _isStatic = MethodMemoizer.this.method.isStatic();
init.setStatic(_isStatic);
init.setVisibility(Visibility.PRIVATE);
TypeReference _wrappedReturnType = MethodMemoizer.this.wrappedReturnType();
init.setReturnType(_wrappedReturnType);
Iterable<? extends MutableParameterDeclaration> _parameters = MethodMemoizer.this.method.getParameters();
final Procedure1<MutableParameterDeclaration> _function = new Procedure1<MutableParameterDeclaration>() {
public void apply(final MutableParameterDeclaration it) {
String _simpleName = it.getSimpleName();
TypeReference _type = it.getType();
init.addParameter(_simpleName, _type);
}
};
IterableExtensions.forEach(_parameters, _function);
Iterable<? extends TypeReference> _exceptions = MethodMemoizer.this.method.getExceptions();
init.setExceptions(((TypeReference[])Conversions.unwrapArray(_exceptions, TypeReference.class)));
Expression _body = MethodMemoizer.this.method.getBody();
init.setBody(_body);
}
};
it.addMethod(_initMethodName, _function);
String _cacheFieldName = MethodMemoizer.this.cacheFieldName();
final Procedure1<MutableFieldDeclaration> _function_1 = new Procedure1<MutableFieldDeclaration>() {
public void apply(final MutableFieldDeclaration it) {
boolean _isStatic = MethodMemoizer.this.method.isStatic();
it.setStatic(_isStatic);
TypeReference _cacheFieldType = MethodMemoizer.this.cacheFieldType();
it.setType(_cacheFieldType);
final CompilationStrategy _function = new CompilationStrategy() {
public CharSequence compile(final CompilationStrategy.CompilationContext it) {
return MethodMemoizer.this.cacheFieldInit(it);
}
};
it.setInitializer(_function);
}
};
it.addField(_cacheFieldName, _function_1);
}
};
ObjectExtensions.<MutableTypeDeclaration>operator_doubleArrow(_declaringType, _function);
final Procedure1<MutableMethodDeclaration> _function_1 = new Procedure1<MutableMethodDeclaration>() {
public void apply(final MutableMethodDeclaration it) {
final CompilationStrategy _function = new CompilationStrategy() {
public CharSequence compile(final CompilationStrategy.CompilationContext it) {
return MethodMemoizer.this.cacheCall(it);
}
};
it.setBody(_function);
TypeReference _wrappedReturnType = MethodMemoizer.this.wrappedReturnType();
it.setReturnType(_wrappedReturnType);
}
};
_xblockexpression = ObjectExtensions.<MutableMethodDeclaration>operator_doubleArrow(
this.method, _function_1);