You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by GitBox <gi...@apache.org> on 2022/07/13 14:13:41 UTC

[GitHub] [syncope] github-code-scanning[bot] commented on a diff in pull request #360: Consolidating Provision, Mapping and Items into single JSON column

github-code-scanning[bot] commented on code in PR #360:
URL: https://github.com/apache/syncope/pull/360#discussion_r920131551


##########
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/PersistenceContext.java:
##########
@@ -611,7 +611,8 @@
             final GroupDAO groupDAO,
             final PolicyDAO policyDAO,
             final VirSchemaDAO virSchemaDAO,
-            final RealmDAO realmDAO) {
+            final RealmDAO realmDAO,
+            final EntityCacheDAO entityCacheDAO) {

Review Comment:
   ## Useless parameter
   
   The parameter entityCacheDAO is unused.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1085)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/SinglePushJobDelegate.java:
##########
@@ -45,15 +47,16 @@
 public class SinglePushJobDelegate extends PushJobDelegate implements SyncopeSinglePushExecutor {
 
     @Autowired
-    private ImplementationDAO implementationDAO;
+    protected ImplementationDAO implementationDAO;
 
-    private List<PushActions> before(
-            final Provision provision,
+    protected List<PushActions> before(
+            final ExternalResource resource,
+            final ProvisionTO provision,

Review Comment:
   ## Useless parameter
   
   The parameter provision is unused.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1092)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultMappingManager.java:
##########
@@ -230,10 +242,10 @@
      * @param connObjectKey connector object key
      * @return the value to be propagated as __NAME__
      */
-    protected Name evaluateNAME(final Any<?> any, final Provision provision, final String connObjectKey) {
+    protected Name evaluateNAME(final Any<?> any, final ProvisionTO provision, final String connObjectKey) {
         if (StringUtils.isBlank(connObjectKey)) {
             // LOG error but avoid to throw exception: leave it to the external resource
-            LOG.warn("Missing ConnObjectKey value for {}: ", provision.getResource());
+            LOG.warn("Missing ConnObjectKey value for {}: ", provision);

Review Comment:
   ## Use of default toString()
   
   Default toString(): ProvisionTO inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1096)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultMappingManager.java:
##########
@@ -607,15 +625,16 @@
     @SuppressWarnings("unchecked")
     @Override
     public Pair<AttrSchemaType, List<PlainAttrValue>> getIntValues(
-            final Provision provision,
-            final Item mapItem,
+            final ExternalResource resource,
+            final ProvisionTO provision,
+            final ItemTO mapItem,
             final IntAttrName intAttrName,
             final AttrSchemaType schemaType,
             final Any<?> any,
             final AccountGetter usernameAccountGetter,
             final PlainAttrGetter plainAttrGetter) {
 
-        LOG.debug("Get internal values for {} as '{}' on {}", any, mapItem.getIntAttrName(), provision.getResource());
+        LOG.debug("Get internal values for {} as '{}' on {}", any, mapItem.getIntAttrName(), provision);

Review Comment:
   ## Use of default toString()
   
   Default toString(): ProvisionTO inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1101)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/stream/StreamPushJobDelegate.java:
##########
@@ -147,7 +144,7 @@
 
         try {
             ExternalResource resource = externalResource(anyType, columns, propagationActions);
-            Provision provision = resource.getProvisions().get(0);
+            ProvisionTO provision = resource.getProvisions().get(0);

Review Comment:
   ## Unread local variable
   
   Variable 'ProvisionTO provision' is never read.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1093)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultMappingManager.java:
##########
@@ -262,10 +274,10 @@
      * @param connObjectKey connector object key
      * @return the value to be propagated as __NAME__
      */
-    protected Name evaluateNAME(final Realm realm, final OrgUnit orgUnit, final String connObjectKey) {
+    protected Name evaluateNAME(final Realm realm, final OrgUnitTO orgUnit, final String connObjectKey) {
         if (StringUtils.isBlank(connObjectKey)) {
             // LOG error but avoid to throw exception: leave it to the external resource
-            LOG.warn("Missing ConnObjectKey value for {}: ", orgUnit.getResource());
+            LOG.warn("Missing ConnObjectKey value for {}: ", orgUnit);

Review Comment:
   ## Use of default toString()
   
   Default toString(): OrgUnitTO inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1097)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultMappingManager.java:
##########
@@ -884,18 +908,24 @@
 
     @Transactional(readOnly = true)
     @Override
-    public Optional<String> getConnObjectKeyValue(final Any<?> any, final Provision provision) {
-        Optional<? extends MappingItem> connObjectKeyItem = provision.getMapping().getConnObjectKeyItem();
+    public Optional<String> getConnObjectKeyValue(
+            final Any<?> any,
+            final ExternalResource resource,
+            final ProvisionTO provision) {
+
+        Optional<ItemTO> connObjectKeyItem = provision.getMapping().getConnObjectKeyItem();
         if (connObjectKeyItem.isEmpty()) {
-            LOG.error("Unable to locate conn object key item for " + provision.getMapping().getKey());
+            LOG.error("Unable to locate conn object key item for " + provision.getMapping());

Review Comment:
   ## Use of default toString()
   
   Default toString(): MappingTO inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1102)



##########
core/idm/logic/src/main/java/org/apache/syncope/core/logic/ReconciliationLogic.java:
##########
@@ -483,24 +514,26 @@
             final Set<String> moreAttrsToGet,
             final PullTaskTO pullTask) {
 
-        Provision provision = getProvision(anyTypeKey, resourceKey);
+        Triple<AnyType, ExternalResource, ProvisionTO> triple = getProvision(anyTypeKey, resourceKey);
 
-        Any<?> any = getAny(provision, anyKey);
-
-        if (provision.getMapping().getConnObjectKeyItem().isEmpty()) {
+        if (triple.getRight().getMapping().getConnObjectKeyItem().isEmpty()) {
             throw new NotFoundException(
-                    "ConnObjectKey cannot be determined for mapping " + provision.getMapping().getKey());
+                    "ConnObjectKey cannot be determined for mapping " + triple.getRight().getMapping());

Review Comment:
   ## Use of default toString()
   
   Default toString(): MappingTO inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1095)



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultMappingManager.java:
##########
@@ -911,22 +941,22 @@
 
     @Transactional(readOnly = true)
     @Override
-    public Optional<String> getConnObjectKeyValue(final Realm realm, final OrgUnit orgUnit) {
-        Optional<? extends OrgUnitItem> connObjectKeyItem = orgUnit.getConnObjectKeyItem();
+    public Optional<String> getConnObjectKeyValue(final Realm realm, final OrgUnitTO orgUnit) {
+        Optional<ItemTO> connObjectKeyItem = orgUnit.getConnObjectKeyItem();
         if (connObjectKeyItem.isEmpty()) {
-            LOG.error("Unable to locate conn object key item for " + orgUnit.getKey());
+            LOG.error("Unable to locate conn object key item for " + orgUnit);

Review Comment:
   ## Use of default toString()
   
   Default toString(): OrgUnitTO inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1103)



##########
core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java:
##########
@@ -44,7 +44,7 @@
      * @param orgUnit Realm provisioning information
      * @return additional attributes to include in the result from the underlying connector
      */
-    default Set<String> moreAttrsToGet(ProvisioningProfile<?, ?> profile, OrgUnit orgUnit) {
+    default Set<String> moreAttrsToGet(ProvisioningProfile<?, ?> profile, OrgUnitTO orgUnit) {

Review Comment:
   ## Useless parameter
   
   The parameter orgUnit is unused.
   
   [Show more details](https://github.com/apache/syncope/security/code-scanning/1091)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@syncope.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org