lukaszlenart opened a new pull request, #1825:
URL: https://github.com/apache/struts/pull/1825

   Fixes [WW-5656](https://issues.apache.org/jira/browse/WW-5656)
   
   `ConversionRule.COLLECTION` and 
`DefaultObjectTypeDeterminer.DEPRECATED_ELEMENT_PREFIX` (`"Collection_"`) have 
been documented as deprecated since WebWork 2.1.x, but neither carried an 
actual `@Deprecated` annotation. Users got no compile-time signal — only prose 
in Javadoc and an `INFO` log line that fires solely when the fallback is 
actually hit.
   
   `Collection_` and `Element_` express the same thing: the element type inside 
a collection. `Element_` additionally covers the **values** of a `Map`, which 
is why WebWork 2.1 introduced it as the single name for both cases and kept 
`Collection_` working as a fallback.
   
   ## Changes
   
   | Item | Change |
   |---|---|
   | `ConversionRule.COLLECTION` | `@Deprecated(since = "7.3.0")` + 
`@deprecated` Javadoc pointing at `ELEMENT` |
   | `DefaultObjectTypeDeterminer.DEPRECATED_ELEMENT_PREFIX` | same treatment, 
pointing at `ELEMENT_PREFIX` |
   | `XWorkConverter.CONVERSION_COLLECTION_PREFIX` | same treatment — see note 
below |
   | `TypeConversion` Javadoc | example switched from 
`ConversionRule.COLLECTION` to `ELEMENT`, and `rule()` reworded |
   | Deliberate call sites | `@SuppressWarnings("deprecation")` with a comment 
explaining why the reference stays |
   | Runtime behaviour | **unchanged** — the `Collection_` fallback keeps 
working |
   
   `ConversionRule.prefix()` needs its suppression because the switch is 
deliberately exhaustive with no `default`, so the `COLLECTION` arm cannot be 
dropped without a compile error. The two test fixtures (`AnnotationUser`, 
`ConversionTestAction`) keep declaring `rule = COLLECTION` on purpose, so the 
fallback stays covered.
   
   ## Beyond the ticket's scope
   
   `XWorkConverter.CONVERSION_COLLECTION_PREFIX` was not listed in the ticket. 
It is a public constant holding the same `"Collection_"` literal, with no 
readers anywhere in the tree. Leaving it unannotated would mean one public 
spelling of the prefix still gives users no signal, so it is deprecated here 
too — happy to drop it from this PR if you would rather keep the change 
strictly to the ticket's table.
   
   ## Follow-up
   
   The ticket's final step asks for a separate ticket to remove these in the 
next major release. Not filed yet — worth deciding at the same time whether 
that removal also covers the `Collection_` **properties-file** fallback, which 
is a larger and independent call.
   
   `forRemoval` is deliberately **not** set: removing the enum constant is 
source-breaking for applications and belongs in a major release.
   
   ## Testing
   
   Full `core` suite: 3149 tests, 0 failures. Compiled with 
`-Xlint:deprecation` to confirm the suppression set is exactly right and no new 
warnings leak into the build.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to