return findConstructorCallInfoForField( fieldDeclaration.getSimpleName(), fieldDeclaration.getType() );
}
@NotNull
public ConstructorCallInfo findConstructorCallInfoForField( @NotNull @NonNls String simpleName, @NotNull TypeMirror type ) throws IllegalArgumentException {
ConstructorDeclaration constructorDeclaration = DomainObjectDescriptor.findBestConstructor( classDeclaration );
int index = 0;
for ( ParameterDeclaration parameterDeclaration : constructorDeclaration.getParameters() ) {
if ( parameterDeclaration.getSimpleName().equals( simpleName ) ) {
//Found a fitting type
if ( TypeUtils.mightBeConstructorCallFor( parameterDeclaration.getType(), type ) ) {
return new ConstructorCallInfo( constructorDeclaration, index, parameterDeclaration );
} else {