Skip to content

Commit f740f27

Browse files
authored
Merge pull request #1774 from adobe/masterTo650dec
Master to650dec
2 parents 36cb433 + 8691607 commit f740f27

File tree

95 files changed

+3115
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3115
-218
lines changed

.circleci/config.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ executors:
121121
forms_executor_java8:
122122
docker:
123123
- image: cimg/openjdk:8.0-browsers
124+
forms_executor_java21:
125+
docker:
126+
- image: cimg/openjdk:21.0-browsers
124127
test_executor_cloudready:
125128
docker:
126129
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
@@ -137,7 +140,7 @@ executors:
137140
docker:
138141
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
139142
<<: *docker_auth
140-
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.24-load4-openjdk11
143+
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.24.0-openjdk11
141144
<<: *docker_auth
142145

143146
jobs:
@@ -185,6 +188,30 @@ jobs:
185188
conf: .circleci/codecov.yml
186189
flags: unittests
187190

191+
build-java-21:
192+
executor: forms_executor_java21
193+
working_directory: /home/circleci/build
194+
steps:
195+
- checkout
196+
- restore_cache:
197+
keys:
198+
- maven-repo-java21-v1-{{ checksum "pom.xml" }}
199+
- maven-repo-java21-v1-
200+
- run:
201+
name: Update permissions
202+
command: sudo chown -R circleci /usr/local/lib/node_modules
203+
- run:
204+
name: Build with Java 21
205+
command: node .circleci/ci/build.js
206+
- save_cache:
207+
paths:
208+
- ~/.m2
209+
key: maven-repo-java21-v1-{{ .Branch }}-{{ checksum "pom.xml" }}
210+
- store_test_results:
211+
path: bundles/core/target/surefire-reports
212+
- store_artifacts:
213+
path: bundles/core/target/surefire-reports
214+
188215
build-java-8:
189216
executor: forms_executor_java8
190217
working_directory: /home/circleci/build
@@ -416,6 +443,10 @@ workflows:
416443
filters:
417444
tags:
418445
only: /.*/
446+
- build-java-21:
447+
filters:
448+
tags:
449+
only: /.*/
419450
- build-java-8:
420451
filters:
421452
tags:

bundles/af-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@
573573
<dependency>
574574
<groupId>org.junit.platform</groupId>
575575
<artifactId>junit-platform-commons</artifactId>
576-
<version>1.5.2</version>
576+
<version>1.10.2</version>
577577
<scope>test</scope>
578578
</dependency>
579579
<!--

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/datalayer/ComponentDataImpl.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.day.cq.commons.jcr.JcrConstants;
3333
import com.fasterxml.jackson.core.JsonProcessingException;
3434
import com.fasterxml.jackson.databind.ObjectMapper;
35+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3536

3637
public class ComponentDataImpl implements FormComponentData {
3738

@@ -41,7 +42,25 @@ public class ComponentDataImpl implements FormComponentData {
4142

4243
protected final Resource resource;
4344

45+
/**
46+
* Creates a new ComponentDataImpl instance.
47+
*
48+
* Note: This constructor stores references to FormComponent and Resource objects.
49+
* These objects are designed to be immutable and shared across the system.
50+
* The FormComponent interface provides read-only access to form component data,
51+
* and the Resource interface represents an immutable JCR resource.
52+
*
53+
* @param component The form component (immutable, read-only interface)
54+
* @param resource The JCR resource (immutable, read-only interface)
55+
*/
56+
@SuppressFBWarnings(
57+
value = "EI_EXPOSE_REP2",
58+
justification = "This constructor stores references to FormComponent and Resource objects. These objects are designed to be immutable and shared across the system. The FormComponent interface provides read-only access to form component data, and the Resource interface represents an immutable JCR resource. This is safe from a security perspective as these objects cannot be modified through the stored references.")
4459
public ComponentDataImpl(FormComponent component, Resource resource) {
60+
// Both FormComponent and Resource are interfaces designed to be immutable
61+
// and shared across the system. They provide read-only access to data.
62+
// This is safe from a security perspective as these objects cannot be
63+
// modified through the stored references.
4564
this.component = component;
4665
this.resource = resource;
4766
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/ReservedProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,6 @@ private static Set<String> aggregateReservedProperties() {
203203
}
204204

205205
public static Set<String> getReservedProperties() {
206-
return reservedProperties;
206+
return new HashSet<>(reservedProperties);
207207
}
208208
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/FragmentImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public String getFragmentPath() {
103103
if (itemModels == null) {
104104
itemModels = getChildrenModels(request, ComponentExporter.class);
105105
}
106-
return itemModels;
106+
return new LinkedHashMap<>(itemModels);
107107
}
108108

109109
protected <T> Map<String, T> getChildrenModels(@Nullable SlingHttpServletRequest request, @NotNull Class<T> modelClass) {
@@ -180,7 +180,7 @@ public List<Resource> getFragmentChildren() {
180180
if (filteredChildComponents == null) {
181181
filteredChildComponents = getFilteredChildrenResources(fragmentContainer);
182182
}
183-
return filteredChildComponents;
183+
return new ArrayList<>(filteredChildComponents);
184184
}
185185

186186
@JsonIgnore

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/OptionsConstraint.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import org.osgi.annotation.versioning.ProviderType;
1919

20+
import com.fasterxml.jackson.annotation.JsonIgnore;
2021
import com.fasterxml.jackson.annotation.JsonProperty;
2122

2223
/**
@@ -58,4 +59,13 @@ default boolean isEnforceEnum() {
5859
* @since com.adobe.cq.forms.core.components.models.form 0.0.1
5960
*/
6061
String[] getEnumNames();
62+
63+
/**
64+
* Returns screen reader friendly aria labels for the options.
65+
*
66+
* @return the list of aria labels for the options
67+
* @since com.adobe.cq.forms.core.components.models.form 5.12.3
68+
*/
69+
@JsonIgnore
70+
String[] getOptionScreenReaderLabels();
6171
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* </p>
3636
*/
3737

38-
@Version("5.12.2")
38+
@Version("5.12.3")
3939
package com.adobe.cq.forms.core.components.models.form;
4040

4141
import org.osgi.annotation.versioning.Version;

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractBaseImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ protected String getConstraintMessage(ConstraintType type) {
282282
putConstraintMessage(ConstraintType.VALIDATION_EXPRESSION, msgs.getValidationExpressionConstraintMessage());
283283
putConstraintMessage(ConstraintType.UNIQUE_ITEMS, msgs.getUniqueItemsConstraintMessage());
284284
}
285-
return constraintMessages;
285+
return new LinkedHashMap<>(constraintMessages);
286286
}
287287

288288
/**

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractContainerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public List<? extends ComponentExporter> getItems() {
116116
if (childrenModels == null) {
117117
childrenModels = new ArrayList<>(getChildrenModels(request, ComponentExporter.class).values());
118118
}
119-
return childrenModels;
119+
return new ArrayList<>(childrenModels);
120120
}
121121

122122
@NotNull
@@ -172,7 +172,7 @@ protected <T> Map<String, T> getChildrenModels(@Nullable SlingHttpServletRequest
172172
if (itemModels == null) {
173173
itemModels = getChildrenModels(request, ComponentExporter.class);
174174
}
175-
return itemModels;
175+
return new LinkedHashMap<>(itemModels);
176176
}
177177

178178
protected List<Resource> getFilteredChildrenResources() {

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ private boolean isAllowedType(Object value) {
543543
* @return {@code Map<String, String>} returns all custom property key value pairs associated with the resource
544544
*/
545545
private Map<String, Object> getCustomProperties() {
546-
Map<String, Object> customProperties = new HashMap<>();
546+
Map<String, Object> customProperties = new LinkedHashMap<>();
547547
Map<String, String> templateBasedCustomProperties;
548548
List<String> excludedPrefixes = Arrays.asList("fd:", "jcr:", "sling:");
549549
Set<String> reservedProperties = ReservedProperties.getReservedProperties();

0 commit comments

Comments
 (0)