Skip to content

Commit b98f220

Browse files
committed
add ReflectionHacksTest
1 parent 875e10c commit b98f220

File tree

13 files changed

+280
-12
lines changed

13 files changed

+280
-12
lines changed

modules/typed-ids-hibernate-61/src/main/java/org/framefork/typedIds/bigint/hibernate/ObjectBigIntIdJavaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setParameterValues(final Properties parameters)
5959
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectBigIntId.class));
6060
}
6161

62-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, long.class);
62+
this.constructor = ReflectionHacks.getConstructor(identifierClass, long.class);
6363
}
6464

6565
@Override

modules/typed-ids-hibernate-61/src/main/java/org/framefork/typedIds/uuid/hibernate/ObjectUuidJavaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void setParameterValues(final Properties parameters)
6565
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectUuid.class));
6666
}
6767

68-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, UUID.class);
68+
this.constructor = ReflectionHacks.getConstructor(identifierClass, UUID.class);
6969
}
7070

7171
@Override

modules/typed-ids-hibernate-62/src/main/java/org/framefork/typedIds/bigint/hibernate/ObjectBigIntIdJavaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setParameterValues(final Properties parameters)
5959
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectBigIntId.class));
6060
}
6161

62-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, long.class);
62+
this.constructor = ReflectionHacks.getConstructor(identifierClass, long.class);
6363
}
6464

6565
@Override

modules/typed-ids-hibernate-62/src/main/java/org/framefork/typedIds/uuid/hibernate/ObjectUuidJavaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void setParameterValues(final Properties parameters)
6565
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectUuid.class));
6666
}
6767

68-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, UUID.class);
68+
this.constructor = ReflectionHacks.getConstructor(identifierClass, UUID.class);
6969
}
7070

7171
@Override

modules/typed-ids-hibernate-63/src/main/java/org/framefork/typedIds/bigint/hibernate/ObjectBigIntIdJavaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setParameterValues(final Properties parameters)
5959
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectBigIntId.class));
6060
}
6161

62-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, long.class);
62+
this.constructor = ReflectionHacks.getConstructor(identifierClass, long.class);
6363
}
6464

6565
@Override

modules/typed-ids-hibernate-63/src/main/java/org/framefork/typedIds/uuid/hibernate/ObjectUuidJavaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void setParameterValues(final Properties parameters)
6565
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectUuid.class));
6666
}
6767

68-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, UUID.class);
68+
this.constructor = ReflectionHacks.getConstructor(identifierClass, UUID.class);
6969
}
7070

7171
@Override

modules/typed-ids/src/main/java/org/framefork/typedIds/bigint/json/gson/ObjectBigIntIdTypeAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ObjectBigIntIdTypeAdapter(final Class<T> identifierClass)
2121
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectBigIntId.class));
2222
}
2323

24-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, long.class);
24+
this.constructor = ReflectionHacks.getConstructor(identifierClass, long.class);
2525
}
2626

2727
@Override

modules/typed-ids/src/main/java/org/framefork/typedIds/common/ReflectionHacks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static <ExpectedType> Class<ExpectedType> getFieldTypeChecked(
7171
return (Class<ExpectedType>) declaredFieldType;
7272
}
7373

74-
public static MethodHandle getMainConstructor(final Class<?> type, final Class<?>... parameterTypes)
74+
public static MethodHandle getConstructor(final Class<?> type, final Class<?>... parameterTypes)
7575
{
7676
try {
7777
Constructor<?> constructor = type.getDeclaredConstructor(parameterTypes);

modules/typed-ids/src/main/java/org/framefork/typedIds/uuid/json/gson/ObjectUuidTypeAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ObjectUuidTypeAdapter(final Class<T> identifierClass)
2222
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectUuid.class));
2323
}
2424

25-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, UUID.class);
25+
this.constructor = ReflectionHacks.getConstructor(identifierClass, UUID.class);
2626
}
2727

2828
@Override

modules/typed-ids/src/main/java/org/framefork/typedIds/uuid/json/jackson/ObjectUuidDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ObjectUuidDeserializer(final Class<?> identifierClass)
2222
throw new IllegalArgumentException("Type %s is not a subtype of %s".formatted(identifierClass, ObjectUuid.class));
2323
}
2424

25-
this.constructor = ReflectionHacks.getMainConstructor(identifierClass, UUID.class);
25+
this.constructor = ReflectionHacks.getConstructor(identifierClass, UUID.class);
2626
}
2727

2828
@Override

0 commit comments

Comments
 (0)