Copilot commented on code in PR #1874:
URL: https://github.com/apache/struts/pull/1874#discussion_r3873973969
##########
core/src/main/java/org/apache/struts2/conversion/impl/CollectionConverter.java:
##########
@@ -61,7 +61,7 @@ public Object convertValue(Map<String, Object> context,
Object target, Member me
for (Object anObjArray : objArray) {
Object convertedValue = converter.convertValue(context,
target, member, propertyName, anObjArray, memberType);
- if (!NO_CONVERSION_POSSIBLE.equals(convertedValue)) {
+ if (convertedValue != NO_CONVERSION_POSSIBLE) {
Review Comment:
Consider adding a short inline comment next to these identity checks
explaining that reference comparison is intentional (the marker’s value can
equal a legitimate user-submitted string). This helps prevent a future
‘cleanup’ that reintroduces the WW-5701 bug by switching back to `equals()`.
##########
core/src/main/java/org/apache/struts2/conversion/impl/CollectionConverter.java:
##########
@@ -72,15 +72,15 @@ public Object convertValue(Map<String, Object> context,
Object target, Member me
for (Object aCol : col) {
Object convertedValue = converter.convertValue(context,
target, member, propertyName, aCol, memberType);
- if (!NO_CONVERSION_POSSIBLE.equals(convertedValue)) {
+ if (convertedValue != NO_CONVERSION_POSSIBLE) {
result.add(convertedValue);
}
}
} else {
result = createCollection(toType, memberType, -1);
TypeConverter converter = getTypeConverter(context);
Object convertedValue = converter.convertValue(context, target,
member, propertyName, value, memberType);
- if (!NO_CONVERSION_POSSIBLE.equals(convertedValue)) {
+ if (convertedValue != NO_CONVERSION_POSSIBLE) {
Review Comment:
Consider adding a short inline comment next to these identity checks
explaining that reference comparison is intentional (the marker’s value can
equal a legitimate user-submitted string). This helps prevent a future
‘cleanup’ that reintroduces the WW-5701 bug by switching back to `equals()`.
##########
core/src/main/java/org/apache/struts2/conversion/impl/CollectionConverter.java:
##########
@@ -72,15 +72,15 @@ public Object convertValue(Map<String, Object> context,
Object target, Member me
for (Object aCol : col) {
Object convertedValue = converter.convertValue(context,
target, member, propertyName, aCol, memberType);
- if (!NO_CONVERSION_POSSIBLE.equals(convertedValue)) {
+ if (convertedValue != NO_CONVERSION_POSSIBLE) {
Review Comment:
Consider adding a short inline comment next to these identity checks
explaining that reference comparison is intentional (the marker’s value can
equal a legitimate user-submitted string). This helps prevent a future
‘cleanup’ that reintroduces the WW-5701 bug by switching back to `equals()`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]