Skip to content

Commit 977c3d1

Browse files
#46 Correcting copy and paste errors and typos
1 parent eee1bbe commit 977c3d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/socialsignin/spring/data/dynamodb/repository/support/DynamoDBHashAndRangeKeyMethodExtractorImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void doWith(Method method) {
6363
@Override
6464
public void doWith(Field field) {
6565
if (field.getAnnotation(DynamoDBHashKey.class) != null) {
66-
Assert.isNull(field, "Multiple fields annotated by @DynamoDBHashKey within type " + idType.getName()
66+
Assert.isNull(hashKeyField, "Multiple fields annotated by @DynamoDBHashKey within type " + idType.getName()
6767
+ "!");
6868
ReflectionUtils.makeAccessible(field);
6969

@@ -86,8 +86,8 @@ public void doWith(Method method) {
8686
@Override
8787
public void doWith(Field field) {
8888
if (field.getAnnotation(DynamoDBRangeKey.class) != null) {
89-
Assert.isNull(rangeKeyMethod,
90-
"Multiple methods annotated by @DynamoDBRangeKey within type " + idType.getName() + "!");
89+
Assert.isNull(rangeKeyField,
90+
"Multiple fields annotated by @DynamoDBRangeKey within type " + idType.getName() + "!");
9191
ReflectionUtils.makeAccessible(field);
9292
rangeKeyField = field;
9393
}
@@ -96,13 +96,13 @@ public void doWith(Field field) {
9696
if (hashKeyMethod == null && hashKeyField == null) {
9797
throw new IllegalArgumentException("No method or field annotated by @DynamoDBHashKey within type " + idType.getName() + "!");
9898
}
99-
if (rangeKeyMethod == null && hashKeyField == null) {
99+
if (rangeKeyMethod == null && rangeKeyField == null) {
100100
throw new IllegalArgumentException("No method or field annotated by @DynamoDBRangeKey within type " + idType.getName() + "!");
101101
}
102102
if (hashKeyMethod != null && hashKeyField != null) {
103103
throw new IllegalArgumentException("Both method and field annotated by @DynamoDBHashKey within type " + idType.getName() + "!");
104104
}
105-
if(rangeKeyMethod != null && hashKeyField != null) {
105+
if(rangeKeyMethod != null && rangeKeyField != null) {
106106
throw new IllegalArgumentException("Both method and field annotated by @DynamoDBRangeKey within type " + idType.getName() + "!");
107107
}
108108
}

0 commit comments

Comments
 (0)