Sonar Fixes (6) (#2214)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-01-21 16:13:43 +02:00
committed by GitHub
parent e8406afeba
commit bbb5f40207
23 changed files with 95 additions and 109 deletions

View File

@@ -91,8 +91,8 @@ class HawkbitEclipseLinkJpaDialect extends EclipseLinkJpaDialect {
Throwable exception = jpaSystemException;
do {
final Throwable cause = exception.getCause();
if (cause instanceof SQLException) {
return (SQLException) cause;
if (cause instanceof SQLException sqlException) {
return sqlException;
}
exception = cause;
} while (exception != null);

View File

@@ -31,7 +31,7 @@ public class EntityPropertyChangeListener extends DescriptorEventAdapter {
final Object object = event.getObject();
if (((UpdateObjectQuery) event.getQuery()).getObjectChangeSet().getChangedAttributeNames().stream()
.anyMatch(field -> !TARGET_UPDATE_EVENT_IGNORE_FIELDS.contains(field))) {
AbstractJpaBaseEntity.doNotify(() -> ((EventAwareEntity) object).fireUpdateEvent());
AbstractBaseEntity.doNotify(((EventAwareEntity) object)::fireUpdateEvent);
}
}
}