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


##########
core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/serialization/AbstractValueSerializer.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.api.serialization;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.List;
+import org.identityconnectors.common.security.GuardedString;
+
+public abstract class AbstractValueSerializer<T extends Object> extends 
JsonSerializer<T> {
+
+    public static final String BYTE_ARRAY_PREFIX = "<binary>";
+
+    public static final String BYTE_ARRAY_SUFFIX = "</binary>";
+
+    protected void doSerialize(final List<Object> value, final JsonGenerator 
jgen) throws IOException {
+        if (value == null) {
+            jgen.writeNull();
+        } else {
+            jgen.writeStartArray();
+            for (Object v : value) {
+                if (v == null) {

Review Comment:
   ## Chain of 'instanceof' tests
   
   This if block performs a chain of 6 type tests - consider alternatives, e.g. 
polymorphism or the visitor pattern.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1123)



##########
core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/PropagationData.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.api.entity.task;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import java.io.Serializable;
+import java.util.Set;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.AttributeDelta;
+
+public class PropagationData implements Serializable {
+
+    private static final long serialVersionUID = -6193849782964810456L;
+
+    public static class Builder {
+
+        private final PropagationData instance;
+
+        public Builder() {
+            instance = new PropagationData();
+        }
+
+        public Builder attributes(final Set<Attribute> attributes) {
+            instance.setAttributes(attributes);
+            return this;
+        }
+
+        public Builder attributeDeltas(final Set<AttributeDelta> 
attributeDeltas) {
+            instance.setAttributeDeltas(attributeDeltas);
+            return this;
+        }
+
+        public PropagationData build() {
+            return instance;
+        }
+    }
+
+    private Set<Attribute> attributes;
+
+    private Set<AttributeDelta> attributeDeltas;
+
+    public Set<Attribute> getAttributes() {

Review Comment:
   ## Exposing internal representation
   
   getAttributes exposes the internal representation stored in field 
attributes. The value may be modified [after this call to getAttributes](1).
   getAttributes exposes the internal representation stored in field 
attributes. The value may be modified [after this call to getAttributes](2).
   getAttributes exposes the internal representation stored in field 
attributes. The value may be modified [after this call to getAttributes](3).
   getAttributes exposes the internal representation stored in field 
attributes. The value may be modified [after this call to getAttributes](4).
   getAttributes exposes the internal representation stored in field 
attributes. The value may be modified [after this call to getAttributes](5).
   getAttributes exposes the internal representation stored in field 
attributes. The value may be modified [after this call to getAttributes](6).
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/1124)



-- 
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-unsubscr...@syncope.apache.org

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

Reply via email to