fix spelling leveraging Oxford comma#2316
Conversation
|
[INFO] BUILD SUCCESS |
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultModelXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
9556942 to
7a5b1ef
Compare
| Function<Object, String> inputLocationFormatter = request.getInputLocationFormatter(); | ||
| if (writer == null && outputStream == null && path == null) { | ||
| throw new IllegalArgumentException("writer, outputStream or path must be non null"); | ||
| throw new IllegalArgumentException("writer, output stream, or path must be non-null"); |
| Function<Object, String> inputLocationFormatter = request.getInputLocationFormatter(); | ||
| if (writer == null && outputStream == null && path == null) { | ||
| throw new IllegalArgumentException("writer, outputStream or path must be non null"); | ||
| throw new IllegalArgumentException("writer, output stream, or path must be non-null"); |
There was a problem hiding this comment.
That's wrong and unrelated to this PR
There was a problem hiding this comment.
| throw new IllegalArgumentException("writer, output stream, or path must be non-null"); | |
| throw new IllegalArgumentException("writer, output stream, or path must be non null"); |
you mean the hyphen - ?
There was a problem hiding this comment.
No, outputStream is the parameter name, it's not output stream.
If those were common nouns, they would require an article.
There was a problem hiding this comment.
yes true. Making it generic would take random impl. details away. What if tomorrow foo resources is new input?
This is noise feeling fluffy and takes away from whats real business case.
We need some valid input - thats all.
| throw new IllegalArgumentException("writer, output stream, or path must be non-null"); | |
| throw new IllegalArgumentException("No valid input source given."); |
There was a problem hiding this comment.
But that's not helpful to the user. What does 'valid' means ?
There was a problem hiding this comment.
Yes, we could tell, as it is.
| throw new IllegalArgumentException("writer, output stream, or path must be non-null"); | |
| throw new IllegalArgumentException("Given input source is null."); |
There was a problem hiding this comment.
We should focus on communicating the actual business case rather than exposing low-level implementation details, which are likely to change.
At this stage, it’s more a matter of preference, since the code now clearly delineates each concern. Code and logging are 2 different worlds.
| Writer writer = request.getWriter(); | ||
| Function<Object, String> inputLocationFormatter = request.getInputLocationFormatter(); | ||
| if (writer == null && outputStream == null && path == null) { | ||
| throw new IllegalArgumentException("writer, outputStream or path must be non null"); |
There was a problem hiding this comment.
this might smell, as throwing IAE but having NPE.
|
wip reopen |


#2306 (comment)
https://github.com/apache/maven/pull/2312/files#r2083278342
enabler for:
outputStreamdestination;requestinstead ofpathinDefaultPluginXmlFactory#write#2312outputStream or path must be non nullevolves to ->No valid input source given.New sentence start with upper case, we well. Especially when talking about Oxford and articles.
but we have inconsistency already.