gnodet opened a new pull request, #13377:
URL: https://github.com/apache/maven/pull/13377

   ## Summary
   
   Replace inline string literals `":-"` and `":+"` in `DefaultInterpolator` 
with named constants `OP_DEFAULT` and `OP_ALTERNATE`, consistent with the 
existing `DELIM_START` / `DELIM_STOP` / `MARKER` pattern in the same class.
   
   ## Changes
   
   ### `DefaultInterpolator`
   - Add `OP_DEFAULT = ":-"` and `OP_ALTERNATE = ":+"` constants
   - Replace all four inline literal occurrences in `processSubstitution()`
   - Remove the unreachable `else-throw` branch: `op` is always extracted from 
a position returned by `indexOf(OP_DEFAULT)` or `indexOf(OP_ALTERNATE)`, so the 
`else` branch could never fire
   
   ### `Interpolator` (API)
   - Expand the class-level Javadoc to document the `${var:-default}` and 
`${var:+alternate}` operators, which were supported but undocumented
   - Document nesting and chaining (ternary pattern)
   
   ### `DefaultInterpolatorTest`
   - Add `testUnknownOperatorTreatedAsVariableName()` to document that an 
unrecognised operator character (e.g. `:\?`) is **not** treated as a 
substitution operator — the entire expression is resolved as a plain variable 
name


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