Skip to content

Commit 8814421

Browse files
committed
Suppress unchecked casts
There is not a lot we can do about the ReflectionUtils library used in the project. I have opted to supress the casts, so we don't end up with unfixable warnings.
1 parent 849478f commit 8814421

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • PgBulkInsert/pgbulkinsert-jpa/src/main/java/de/bytefish/pgbulkinsert/jpa

PgBulkInsert/pgbulkinsert-jpa/src/main/java/de/bytefish/pgbulkinsert/jpa/JpaMapping.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ public JpaMapping(Class<TEntity> entityClass, IPostgresTypeMapping typeMapping,
5050

5151
super(getSchemaName(entityClass), getTableName(entityClass), usePostgresQuoting);
5252

53-
if (entityClass == null) {
54-
throw new IllegalArgumentException("entityClass");
55-
}
56-
5753
this.entityClass = entityClass;
5854
this.typeMapping = typeMapping;
5955

@@ -69,6 +65,7 @@ public IPostgresTypeMapping getTypeMapping() {
6965
return typeMapping;
7066
}
7167

68+
@SuppressWarnings("unchecked")
7269
private void processDataTypeAnnotations(Map<String, DataType> columnMapping) {
7370
Set<Field> fields = ReflectionUtils.getAllFields(entityClass);
7471

@@ -100,6 +97,7 @@ private void mapFields(Class<TEntity> entityClass, IPostgresTypeMapping typeMapp
10097
}
10198
}
10299

100+
@SuppressWarnings("unchecked")
103101
private void internalMapFields(Class<TEntity> entityClass, IPostgresTypeMapping typeMapping, Map<String, DataType> columnMapping) throws Exception {
104102

105103
Set<Method> getters = ReflectionUtils.getAllMethods(entityClass, ReflectionUtils.withModifier(Modifier.PUBLIC), ReflectionUtils.withPrefix("get"), ReflectionUtils.withParametersCount(0));

0 commit comments

Comments
 (0)