#304 Formatting (unrelated)

This commit is contained in:
Gunnar Morling 2015-03-01 19:08:54 +01:00
parent 2d7ab089ff
commit 6a43ee9391
3 changed files with 28 additions and 16 deletions

View File

@ -147,7 +147,8 @@ public class BeanMappingMethod extends MappingMethod {
if ( resultTypeMirror != null ) {
resultType = ctx.getTypeFactory().getType( resultTypeMirror );
if ( !resultType.isAssignableTo( method.getResultType() ) ) {
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
beanMappingPrism.mirror,
Message.BEANMAPPING_NOT_ASSIGNABLE, resultType, method.getResultType()
);
@ -218,7 +219,8 @@ public class BeanMappingMethod extends MappingMethod {
// fetch the target property
ExecutableElement targetProperty = unprocessedTargetProperties.get( mapping.getTargetName() );
if ( targetProperty == null ) {
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
mapping.getMirror(),
mapping.getSourceAnnotationValue(),
Message.BEANMAPPING_UNKNOWN_PROPERTY_IN_RETURNTYPE,
@ -383,7 +385,8 @@ public class BeanMappingMethod extends MappingMethod {
if ( propertyMapping != null && newPropertyMapping != null ) {
// TODO improve error message
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
Message.BEANMAPPING_SEVERAL_POSSIBLE_SOURCES,
targetProperty.getKey()
);
@ -463,7 +466,8 @@ public class BeanMappingMethod extends MappingMethod {
}
// Should never really happen
else {
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
Message.BEANMAPPING_SEVERAL_POSSIBLE_TARGET_ACCESSORS,
sourcePropertyName
);
@ -506,7 +510,8 @@ public class BeanMappingMethod extends MappingMethod {
Message msg = unmappedTargetPolicy.getDiagnosticKind() == Diagnostic.Kind.ERROR ?
Message.BEANMAPPING_UNMAPPED_TARGETS_ERROR : Message.BEANMAPPING_UNMAPPED_TARGETS_WARNING;
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
msg,
MessageFormat.format(
"{0,choice,1#property|1<properties}: \"{1}\"",

View File

@ -194,7 +194,8 @@ public class PropertyMapping extends ModelElement {
}
}
else {
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
Message.PROPERTYMAPPING_MAPPING_NOT_FOUND,
sourceElement,
targetType,
@ -409,8 +410,8 @@ public class PropertyMapping extends ModelElement {
String name = getName( sourceType, targetType );
name = Strings.getSaveVariableName( name, ctx.getNamesOfMappingsToGenerate() );
if ( (sourceType.isCollectionType() || sourceType.isArrayType())
&& (targetType.isCollectionType() || targetType.isArrayType()) ) {
if ( ( sourceType.isCollectionType() || sourceType.isArrayType() )
&& ( targetType.isCollectionType() || targetType.isArrayType() ) ) {
ForgedMethod methodRef = new ForgedMethod( name, sourceType, targetType, element );
IterableMappingMethod.Builder builder = new IterableMappingMethod.Builder();
@ -578,7 +579,8 @@ public class PropertyMapping extends ModelElement {
}
}
else {
ctx.getMessager().printMessage( method.getExecutable(),
ctx.getMessager().printMessage(
method.getExecutable(),
Message.CONSTANTMAPPING_MAPPING_NOT_FOUND,
sourceType,
constantExpression,

View File

@ -81,7 +81,7 @@ public class Mapping {
mappingsOfProperty.add( mapping );
if ( mappingsOfProperty.size() > 1 && !isEnumType( method.getReturnType() ) ) {
messager.printMessage( method, Message.PROPERTYMAPPING_DUPLICATE_TARGETS, mappingPrism.target() );
messager.printMessage( method, Message.PROPERTYMAPPING_DUPLICATE_TARGETS, mappingPrism.target() );
}
}
}
@ -93,7 +93,8 @@ public class Mapping {
FormattingMessager messager) {
if ( mappingPrism.target().isEmpty() ) {
messager.printMessage( element,
messager.printMessage(
element,
mappingPrism.mirror,
mappingPrism.values.target(),
Message.PROPERTYMAPPING_EMPTY_TARGET
@ -140,7 +141,7 @@ public class Mapping {
);
}
@SuppressWarnings( "checkstyle:parameternumber" )
@SuppressWarnings("checkstyle:parameternumber")
private Mapping(String sourceName, String constant, String javaExpression, String targetName,
String dateFormat, List<TypeMirror> qualifiers,
boolean isIgnored, AnnotationMirror mirror,
@ -169,8 +170,10 @@ public class Mapping {
Matcher javaExpressionMatcher = JAVA_EXPRESSION.matcher( mappingPrism.expression() );
if ( !javaExpressionMatcher.matches() ) {
messager.printMessage( element, mappingPrism.mirror, mappingPrism.values.expression(),
Message.PROPERTYMAPPING_INVALID_EXPRESSION );
messager.printMessage(
element, mappingPrism.mirror, mappingPrism.values.expression(),
Message.PROPERTYMAPPING_INVALID_EXPRESSION
);
return null;
}
@ -280,8 +283,10 @@ public class Mapping {
if ( sourceReference != null && sourceReference.getPropertyEntries().isEmpty() ) {
// parameter mapping only, apparently the @InheritReverseConfiguration is intentional
// but erroneous. Lets raise an error to warn.
messager.printMessage( method.getExecutable(), Message.PROPERTYMAPPING_REVERSAL_PROBLEM,
sourceReference.getParameter() );
messager.printMessage(
method.getExecutable(), Message.PROPERTYMAPPING_REVERSAL_PROBLEM,
sourceReference.getParameter()
);
return null;
}