gnodet-bot commented on code in PR #14068:
URL: https://github.com/apache/maven/pull/14068#discussion_r4617737067
##########
api/maven-api-core/src/main/java/org/apache/maven/api/Dependency.java:
##########
@@ -80,21 +80,30 @@ default Type getType() {
* @see DependencyCoordinates#getScope()
* @deprecated Use {@link #scope()} instead.
*/
- @Deprecated(since = "4.2.0", forRemoval = true)
+ @Deprecated(since = "4.0.0", forRemoval = true)
@Nonnull
default DependencyScope getScope() {
return scope();
}
/**
* Returns whether the dependency is optional or mandatory.
- * Unlike {@link DependencyCoordinates}, the obligation of a {@code
Dependency} is always present.
- * The value is computed during the dependencies collection phase.
*
* @return {@code true} if the dependency is optional, or {@code false} if
mandatory
* @see DependencyCoordinates#optional()
*/
- boolean isOptional();
+ boolean optional();
Review Comment:
⚠️ **Javadoc truncation — not addressed (re-raising from previous review)**
The original `isOptional()` Javadoc contained two semantically important
sentences that were dropped:
- *"Unlike `DependencyCoordinates`, the obligation of a `Dependency` is
always present."*
- *"The value is computed during the dependencies collection phase."*
These distinguish `Dependency.optional()` from
`DependencyCoordinates.optional()` (which returns `Optional<Boolean>`). Without
them, callers have no hint why this returns a plain `boolean` while the sibling
interface returns `Optional`.
```suggestion
/**
* Returns whether the dependency is optional or mandatory.
* Unlike {@link DependencyCoordinates}, the obligation of a {@code
Dependency} is always present.
* The value is computed during the dependencies collection phase.
*
* @return {@code true} if the dependency is optional, or {@code false}
if mandatory
* @see DependencyCoordinates#optional()
*/
```
##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/BuilderProblem.java:
##########
@@ -34,65 +34,126 @@
public interface BuilderProblem {
/**
- * Gets the hint about the source of the problem. While the syntax of this
hint is unspecified and depends on the
- * creator of the problem, the general expectation is that the hint
provides sufficient information to the user to
- * track the problem back to its origin. A concrete example for such a
source hint can be the file path or URL from
- * which the settings were read.
+ * Gets the hint about the source of the problem.
*
* @return the hint about the source of the problem or an empty string if
unknown, never {@code null}
*/
@Nonnull
- String getSource();
+ String source();
Review Comment:
⚠️ **Javadoc truncation — not addressed (re-raising from previous review)**
The original `getSource()` Javadoc explained that the hint syntax is
unspecified and that a concrete example is a file path or URL. That context
belongs on the new primary method:
```suggestion
/**
* Gets the hint about the source of the problem. While the syntax of
this hint is unspecified and
* depends on the creator of the problem, the general expectation is
that the hint provides sufficient
* information to the user to track the problem back to its origin. A
concrete example for such a
* source hint can be the file path or URL from which the settings were
read.
*
* @return the hint about the source of the problem or an empty string
if unknown, never {@code null}
*/
```
--
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]