You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/10/07 15:17:35 UTC
[syncope] branch master updated: Addressing some CodeQL alerts
(#219)
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/master by this push:
new 8b00eb5 Addressing some CodeQL alerts (#219)
8b00eb5 is described below
commit 8b00eb5a3a79cad853fc434c4c7d0ffe026139cc
Author: Francesco Chicchiriccò <il...@users.noreply.github.com>
AuthorDate: Wed Oct 7 17:17:18 2020 +0200
Addressing some CodeQL alerts (#219)
---
.../console/panels/PrivilegeDirectoryPanel.java | 2 +-
.../console/policies/PolicyRuleDirectoryPanel.java | 2 +-
.../console/reports/ReportletDirectoryPanel.java | 2 +-
.../client/console/tasks/TaskDirectoryPanel.java | 2 +-
.../markup/html/form/ActionLinksTogglePanel.java | 2 -
.../client/console/wizards/WizardMgtPanel.java | 2 +-
.../syncope/client/console/wizards/any/Groups.java | 2 +-
.../apache/syncope/common/lib/AnyOperations.java | 5 +-
.../syncope/core/logic/U2FRegistrationLogic.java | 196 +++++++++++----------
.../apache/syncope/core/logic/SyncopeLogic.java | 2 +-
.../core/provisioning/java/MappingManagerImpl.java | 6 +-
.../java/cache/MemoryVirAttrCache.java | 2 +-
.../PriorityPropagationTaskExecutor.java | 2 +-
.../spring/security/JWTAuthenticationProvider.java | 2 +-
14 files changed, 113 insertions(+), 116 deletions(-)
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/PrivilegeDirectoryPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/PrivilegeDirectoryPanel.java
index 5b40422..9d7f182 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/PrivilegeDirectoryPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/panels/PrivilegeDirectoryPanel.java
@@ -177,7 +177,7 @@ public class PrivilegeDirectoryPanel extends DirectoryPanel<
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
- if (event.getPayload() instanceof ExitEvent && modal != null) {
+ if (event.getPayload() instanceof ExitEvent) {
final AjaxRequestTarget target = ExitEvent.class.cast(event.getPayload()).getTarget();
baseModal.show(false);
baseModal.close(target);
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
index 0f27e9f..f67f1d5 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
@@ -278,7 +278,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
- if (event.getPayload() instanceof ExitEvent && modal != null) {
+ if (event.getPayload() instanceof ExitEvent) {
final AjaxRequestTarget target = ExitEvent.class.cast(event.getPayload()).getTarget();
baseModal.show(false);
baseModal.close(target);
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
index a04d2d3..7d854f0 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
@@ -260,7 +260,7 @@ public class ReportletDirectoryPanel extends DirectoryPanel<
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
- if (event.getPayload() instanceof ExitEvent && modal != null) {
+ if (event.getPayload() instanceof ExitEvent) {
final AjaxRequestTarget target = ExitEvent.class.cast(event.getPayload()).getTarget();
baseModal.show(false);
baseModal.close(target);
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
index 2c94179..1486ab6 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
@@ -93,7 +93,7 @@ public abstract class TaskDirectoryPanel<T extends TaskTO>
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
- if (event.getPayload() instanceof ExitEvent && modal != null) {
+ if (event.getPayload() instanceof ExitEvent) {
final AjaxRequestTarget target = ExitEvent.class.cast(event.getPayload()).getTarget();
baseModal.show(false);
baseModal.close(target);
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
index dd7a991..c4894ab 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
@@ -103,8 +103,6 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
header = ((StatusBean) modelObject).getResource();
} else if (modelObject instanceof PolicyRuleWrapper) {
header = ((PolicyRuleWrapper) modelObject).getImplementationKey();
- } else if (modelObject instanceof PolicyRuleWrapper) {
- header = ((PolicyRuleWrapper) modelObject).getImplementationKey();
} else if (modelObject instanceof ReportletWrapper) {
header = ((ReportletWrapper) modelObject).getImplementationKey();
} else if (modelObject instanceof JobTO) {
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
index fe28794..1653600 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
@@ -171,7 +171,7 @@ public abstract class WizardMgtPanel<T extends Serializable> extends AbstractWiz
@Override
@SuppressWarnings("unchecked")
public void onEvent(final IEvent<?> event) {
- if (event.getPayload() instanceof ExitEvent && modal != null) {
+ if (event.getPayload() instanceof ExitEvent) {
final AjaxRequestTarget target = ExitEvent.class.cast(event.getPayload()).getTarget();
// default behaviour: change it catching the event if needed
modal.close(target);
diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
index 2ab456a..cf74da0 100644
--- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
+++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/Groups.java
@@ -248,7 +248,7 @@ public class Groups extends AbstractGroups {
List<CompleteCondition> conditions = GroupableRelatableTO.class.cast(anyTO).getMemberships().
stream().
- skip((page - 1) * Constants.MAX_GROUP_LIST_SIZE).
+ skip(((long) page - 1L) * (long) Constants.MAX_GROUP_LIST_SIZE).
limit(Constants.MAX_GROUP_LIST_SIZE).
map(m -> builder.is(Constants.KEY_FIELD_NAME).equalTo(m.getGroupKey()).wrap()).
collect(Collectors.toList());
diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
index b5becbf..a3e1fc6 100644
--- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
+++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
@@ -21,6 +21,7 @@ package org.apache.syncope.common.lib;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@@ -58,7 +59,7 @@ public final class AnyOperations {
private static final Logger LOG = LoggerFactory.getLogger(AnyOperations.class);
- private static final Set<String> NULL_SINGLETON = Collections.singleton(null);
+ private static final List<String> NULL_SINGLETON_LIST = Collections.singletonList(null);
private AnyOperations() {
// empty constructor for static utility classes
@@ -631,6 +632,6 @@ public final class AnyOperations {
}
private static boolean isEmpty(final Attr attr) {
- return attr.getValues().isEmpty() || NULL_SINGLETON.equals(attr.getValues());
+ return attr.getValues().isEmpty() || NULL_SINGLETON_LIST.equals(attr.getValues());
}
}
diff --git a/core/am/logic/src/main/java/org/apache/syncope/core/logic/U2FRegistrationLogic.java b/core/am/logic/src/main/java/org/apache/syncope/core/logic/U2FRegistrationLogic.java
index a6232cc..8d0d8de 100644
--- a/core/am/logic/src/main/java/org/apache/syncope/core/logic/U2FRegistrationLogic.java
+++ b/core/am/logic/src/main/java/org/apache/syncope/core/logic/U2FRegistrationLogic.java
@@ -16,9 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.syncope.core.logic;
+import java.lang.reflect.Method;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.CompareToBuilder;
@@ -39,15 +44,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
-import java.lang.reflect.Method;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
@Component
public class U2FRegistrationLogic extends AbstractTransactionalLogic<AuthProfileTO> {
+
@Autowired
private AuthProfileDAO authProfileDAO;
@@ -59,7 +58,7 @@ public class U2FRegistrationLogic extends AbstractTransactionalLogic<AuthProfile
@Override
protected AuthProfileTO resolveReference(final Method method, final Object... args)
- throws UnresolvedReferenceException {
+ throws UnresolvedReferenceException {
String key = null;
if (ArrayUtils.isNotEmpty(args)) {
for (int i = 0; key == null && i < args.length; i++) {
@@ -74,8 +73,8 @@ public class U2FRegistrationLogic extends AbstractTransactionalLogic<AuthProfile
if (key != null) {
try {
return authProfileDAO.findByKey(key).
- map(authProfileDataBinder::getAuthProfileTO).
- orElseThrow();
+ map(authProfileDataBinder::getAuthProfileTO).
+ orElseThrow();
} catch (final Throwable e) {
LOG.debug("Unresolved reference", e);
throw new UnresolvedReferenceException(e);
@@ -85,14 +84,14 @@ public class U2FRegistrationLogic extends AbstractTransactionalLogic<AuthProfile
}
@PreAuthorize("hasRole('" + AMEntitlement.U2F_SAVE_DEVICE + "') "
- + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
+ + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public U2FRegisteredDevice save(final U2FRegisteredDevice acct) {
AuthProfile profile = authProfileDAO.findByOwner(acct.getOwner()).
- orElseGet(() -> {
- final AuthProfile authProfile = entityFactory.newEntity(AuthProfile.class);
- authProfile.setOwner(acct.getOwner());
- return authProfile;
- });
+ orElseGet(() -> {
+ final AuthProfile authProfile = entityFactory.newEntity(AuthProfile.class);
+ authProfile.setOwner(acct.getOwner());
+ return authProfile;
+ });
if (acct.getKey() == null) {
acct.setKey(SecureRandomUtils.generateRandomUUID().toString());
@@ -100,29 +99,29 @@ public class U2FRegistrationLogic extends AbstractTransactionalLogic<AuthProfile
profile.add(acct);
profile = authProfileDAO.save(profile);
return profile.getU2FRegisteredDevices().
- stream().
- filter(Objects::nonNull).
- filter(t -> t.getKey().equals(acct.getKey())).
- findFirst().
- orElse(null);
+ stream().
+ filter(Objects::nonNull).
+ filter(t -> t.getKey().equals(acct.getKey())).
+ findFirst().
+ orElse(null);
}
@PreAuthorize("hasRole('" + AMEntitlement.U2F_READ_DEVICE + "') "
- + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
+ + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
@Transactional(readOnly = true)
public U2FRegisteredDevice read(final String key) {
return authProfileDAO.findAll().
- stream().
- map(AuthProfile::getU2FRegisteredDevices).
- filter(Objects::nonNull).
- flatMap(List::stream).
- filter(record -> record.getKey().equals(key)).
- findFirst().
- orElse(null);
+ stream().
+ map(AuthProfile::getU2FRegisteredDevices).
+ filter(Objects::nonNull).
+ flatMap(List::stream).
+ filter(record -> record.getKey().equals(key)).
+ findFirst().
+ orElse(null);
}
@PreAuthorize("hasRole('" + AMEntitlement.U2F_DELETE_DEVICE + "') "
- + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
+ + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void delete(final String entityKey, final Long id, final Date expirationDate) {
List<AuthProfile> profiles = authProfileDAO.findAll();
profiles.forEach(profile -> {
@@ -144,84 +143,87 @@ public class U2FRegistrationLogic extends AbstractTransactionalLogic<AuthProfile
}
@PreAuthorize("hasRole('" + AMEntitlement.U2F_SEARCH + "') "
- + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
+ + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public Pair<Integer, List<U2FRegisteredDevice>> search(final String entityKey, final Integer page,
- final Integer itemsPerPage, final Long id,
- final Date expirationDate,
- final List<OrderByClause> orderByClauses) {
+ final Integer itemsPerPage, final Long id,
+ final Date expirationDate,
+ final List<OrderByClause> orderByClauses) {
List<Comparator<U2FRegisteredDevice>> comparatorList = orderByClauses.
- stream().
- map(orderByClause -> {
- Comparator<U2FRegisteredDevice> comparator = null;
- if (orderByClause.getField().equals("id")) {
- comparator = (o1, o2) -> new CompareToBuilder().append(o1.getId(), o2.getId()).toComparison();
- }
- if (orderByClause.getField().equals("owner")) {
- comparator = (o1, o2) -> new CompareToBuilder().append(o1.getOwner(), o2.getOwner()).toComparison();
- }
- if (orderByClause.getField().equals("key")) {
- comparator = (o1, o2) -> new CompareToBuilder().append(o1.getKey(), o2.getKey()).toComparison();
- }
- if (orderByClause.getField().equals("issueDate")) {
- comparator = (o1, o2) ->
- new CompareToBuilder().append(o1.getIssueDate(), o2.getIssueDate()).toComparison();
- }
- if (orderByClause.getField().equals("record")) {
- comparator = (o1, o2) ->
- new CompareToBuilder().append(o1.getRecord(), o2.getRecord()).toComparison();
- }
- if (comparator != null) {
- if (orderByClause.getDirection() == OrderByClause.Direction.DESC) {
- return comparator.reversed();
+ stream().
+ map(orderByClause -> {
+ Comparator<U2FRegisteredDevice> comparator = null;
+ if (orderByClause.getField().equals("id")) {
+ comparator = (o1, o2) -> new CompareToBuilder().
+ append(o1.getId(), o2.getId()).toComparison();
}
- return comparator;
- }
- return null;
- }).
- filter(Objects::nonNull).
- collect(Collectors.toList());
+ if (orderByClause.getField().equals("owner")) {
+ comparator = (o1, o2) -> new CompareToBuilder().
+ append(o1.getOwner(), o2.getOwner()).toComparison();
+ }
+ if (orderByClause.getField().equals("key")) {
+ comparator = (o1, o2) -> new CompareToBuilder().
+ append(o1.getKey(), o2.getKey()).toComparison();
+ }
+ if (orderByClause.getField().equals("issueDate")) {
+ comparator = (o1, o2) -> new CompareToBuilder().
+ append(o1.getIssueDate(), o2.getIssueDate()).toComparison();
+ }
+ if (orderByClause.getField().equals("record")) {
+ comparator = (o1, o2) -> new CompareToBuilder().
+ append(o1.getRecord(), o2.getRecord()).toComparison();
+ }
+ if (comparator != null) {
+ if (orderByClause.getDirection() == OrderByClause.Direction.DESC) {
+ return comparator.reversed();
+ }
+ return comparator;
+ }
+ return null;
+ }).
+ filter(Objects::nonNull).
+ collect(Collectors.toList());
List<U2FRegisteredDevice> devices = authProfileDAO.findAll().
- stream().
- map(AuthProfile::getU2FRegisteredDevices).
- filter(Objects::nonNull).
- flatMap(List::stream).
- filter(device -> {
- EqualsBuilder builder = new EqualsBuilder();
- if (StringUtils.isNotBlank(entityKey)) {
- builder.append(entityKey, device.getKey());
- }
- if (id != null) {
- builder.append(id, (Long) device.getId());
- }
- if (expirationDate != null) {
- builder.appendSuper(device.getIssueDate().compareTo(expirationDate) >= 0);
- }
- return true;
- }).
- filter(Objects::nonNull).
- collect(Collectors.toList());
+ stream().
+ map(AuthProfile::getU2FRegisteredDevices).
+ filter(Objects::nonNull).
+ flatMap(List::stream).
+ filter(device -> {
+ EqualsBuilder builder = new EqualsBuilder();
+ if (StringUtils.isNotBlank(entityKey)) {
+ builder.append(entityKey, device.getKey());
+ }
+ if (id != null) {
+ builder.append(id, (Long) device.getId());
+ }
+ if (expirationDate != null) {
+ builder.appendSuper(device.getIssueDate().compareTo(expirationDate) >= 0);
+ }
+ return true;
+ }).
+ filter(Objects::nonNull).
+ collect(Collectors.toList());
List<U2FRegisteredDevice> pagedResults = devices.
- stream().
- limit(itemsPerPage).
- skip(itemsPerPage * (page <= 0 ? 0 : page - 1)).
- sorted((o1, o2) -> {
- int result;
- for (Comparator<U2FRegisteredDevice> comparator : comparatorList) {
- result = comparator.compare(o1, o2);
- if (result != 0) {
- return result;
+ stream().
+ limit(itemsPerPage).
+ skip(itemsPerPage * (page <= 0 ? 0L : page.longValue() - 1L)).
+ sorted((o1, o2) -> {
+ int result;
+ for (Comparator<U2FRegisteredDevice> comparator : comparatorList) {
+ result = comparator.compare(o1, o2);
+ if (result != 0) {
+ return result;
+ }
}
- }
- return 0;
- })
- .collect(Collectors.toList());
+ return 0;
+ })
+ .collect(Collectors.toList());
return Pair.of(devices.size(), pagedResults);
}
@PreAuthorize("hasRole('" + AMEntitlement.U2F_UPDATE_DEVICE + "') "
- + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
+ + "or hasRole('" + IdRepoEntitlement.ANONYMOUS + "')")
public void update(final U2FRegisteredDevice acct) {
List<AuthProfile> profiles = authProfileDAO.findAll();
profiles.forEach(profile -> {
diff --git a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
index f82a3d6..60ae3a3 100644
--- a/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
+++ b/core/idrepo/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
@@ -440,7 +440,7 @@ public class SyncopeLogic extends AbstractLogic<EntityTO> {
numbersInfo.setAnyType1(entry.getKey().getKey());
numbersInfo.setTotalAny1(entry.getValue());
numbersInfo.getAny1ByRealm().putAll(anyObjectDAO.countByRealm(entry.getKey()));
- } else if (i == 1) {
+ } else {
numbersInfo.setAnyType2(entry.getKey().getKey());
numbersInfo.setTotalAny2(entry.getValue());
numbersInfo.getAny2ByRealm().putAll(anyObjectDAO.countByRealm(entry.getKey()));
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
index 23f9f8a..a789fc5 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
@@ -773,11 +773,7 @@ public class MappingManagerImpl implements MappingManager {
case PLAIN:
PlainAttr<?> attr;
if (membership == null) {
- if (ref instanceof Attributable) {
- attr = plainAttrGetter.apply((Attributable) ref, intAttrName.getSchema().getKey());
- } else {
- attr = ref.getPlainAttr(intAttrName.getSchema().getKey()).orElse(null);
- }
+ attr = plainAttrGetter.apply((Attributable) ref, intAttrName.getSchema().getKey());
} else {
attr = ((GroupableRelatable<?, ?, ?, ?, ?>) ref).getPlainAttr(
intAttrName.getSchema().getKey(), membership).orElse(null);
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
index e5c1b42..77d1751 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
@@ -126,7 +126,7 @@ public class MemoryVirAttrCache implements VirAttrCache {
*/
@Override
public boolean isValidEntry(final VirAttrCacheValue value) {
- final Date expiringDate = new Date(value == null ? 0 : value.getCreationDate().getTime() + ttl * 1000);
+ Date expiringDate = new Date(value == null ? 0 : value.getCreationDate().getTime() + ttl * 1000L);
return expiringDate.after(new Date());
}
}
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
index 7d1c478..5af16d1 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PriorityPropagationTaskExecutor.java
@@ -125,7 +125,7 @@ public class PriorityPropagationTaskExecutor extends AbstractPropagationTaskExec
taskInfo, ExecStatus.CREATED, null, null, null);
}
} catch (Exception e) {
- LOG.error("While submitting task for async execution", taskInfo, e);
+ LOG.error("While submitting task for async execution: {}", taskInfo, e);
rejected(taskInfo, e.getMessage(), reporter, executor);
}
});
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/JWTAuthenticationProvider.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/JWTAuthenticationProvider.java
index 2a5865d..90c0d4b 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/JWTAuthenticationProvider.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/JWTAuthenticationProvider.java
@@ -40,7 +40,7 @@ public class JWTAuthenticationProvider implements AuthenticationProvider {
JWTAuthentication jwtAuthentication = (JWTAuthentication) authentication;
JWTClaimsSet claims = jwtAuthentication.getClaims();
- Long referenceTime = System.currentTimeMillis();
+ long referenceTime = System.currentTimeMillis();
Date expiryTime = claims.getExpirationTime();
if (expiryTime == null || expiryTime.getTime() < referenceTime) {