Skip to content

Commit

Permalink
Polish for 0.5 (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
seongahjo authored Feb 28, 2023
1 parent 1ab7167 commit f8c8423
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fun getAnnotatedType(ownerType: AnnotatedType, kProperty: KProperty<*>): Annotat

override fun getRawType(): Type = type.rawType

override fun getOwnerType(): Type = type.ownerType
override fun getOwnerType(): Type? = type.ownerType
}

val resolvedGenericsTypesArray = resolvedGenericsTypes.toTypedArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,23 @@ public NodeSetDecomposedValueManipulator(
public void manipulate(ArbitraryNode arbitraryNode) {
Class<?> actualType = Types.getActualType(arbitraryNode.getProperty().getType());
if (value != null && !isAssignable(value.getClass(), actualType)) {
String parentNodeLogMessage = arbitraryNode.getResolvedParentProperty() != null
? String.format(
"parent node type : %s",
arbitraryNode.getResolvedParentProperty().getType().getTypeName()
)
: "";
throw new IllegalArgumentException(
"The value is not of the same type as the property."
+ " node name: " + arbitraryNode.getArbitraryProperty()
.getObjectProperty()
.getResolvedPropertyName()
+ " node type: " + arbitraryNode.getProperty().getType().getTypeName()
+ " value type: " + value.getClass().getTypeName()
String.format(
"The value is not of the same type as the property.\n"
+ "%s node name: %s, node type: %s, value type: %s",
parentNodeLogMessage,
arbitraryNode.getArbitraryProperty()
.getObjectProperty()
.getResolvedPropertyName(),
arbitraryNode.getProperty().getType().getTypeName(),
value.getClass().getTypeName()
)
);
}
setValue(arbitraryNode, value);
Expand Down

0 comments on commit f8c8423

Please sign in to comment.