-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix spelling leveraging Oxford comma #2316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
@@ -121,7 +121,7 @@ public void write(XmlWriterRequest<Model> request) throws XmlWriterException { | |||
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"); | |||
throw new IllegalArgumentException("writer, output stream, or path must be non-null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -121,7 +121,7 @@ public void write(XmlWriterRequest<Model> request) throws XmlWriterException { | |||
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"); | |||
throw new IllegalArgumentException("writer, output stream, or path must be non-null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's wrong and unrelated to this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's not helpful to the user. What does 'valid' means ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -121,7 +121,7 @@ public void write(XmlWriterRequest<Model> request) throws XmlWriterException { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might smell, as throwing IAE
but having NPE
.
#2306 (comment)
https://github.com/apache/maven/pull/2312/files#r2083278342
enabler for:
outputStream
destination;request
instead ofpath
inDefaultPluginXmlFactory#write
#2312outputStream or path must be non null
evolves 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.