Skip to content

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pankraz76
Copy link
Contributor

@Pankraz76 Pankraz76 commented May 10, 2025

comma after outputStream and outputStream --> output stream

#2306 (comment)

https://github.com/apache/maven/pull/2312/files#r2083278342

enabler for:

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

image

@Pankraz76
Copy link
Contributor Author

[INFO] BUILD SUCCESS

@Pankraz76 Pankraz76 force-pushed the fix-write-test-fix-spelling branch from 9556942 to 7a5b1ef Compare May 10, 2025 20:33
@@ -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");
Copy link
Contributor Author

@Pankraz76 Pankraz76 May 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new IllegalArgumentException("writer, output stream, or path must be non-null");
throw new IllegalArgumentException("writer, output stream, or path must be non-null.");

missing dot. (everywhere or nowhere)
image

@@ -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");
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 - ?

Copy link
Contributor

@gnodet gnodet May 11, 2025

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.

Copy link
Contributor Author

@Pankraz76 Pankraz76 May 11, 2025

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.

Suggested change
throw new IllegalArgumentException("writer, output stream, or path must be non-null");
throw new IllegalArgumentException("No valid input source given.");

Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Suggested change
throw new IllegalArgumentException("writer, output stream, or path must be non-null");
throw new IllegalArgumentException("Given input source is null.");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering OOP leveraging domain logic its kind of clear from the context now as the code should speak for itself:

ReadRequest/WriteRequest
image

Copy link
Contributor Author

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.

@Pankraz76 Pankraz76 requested review from gnodet and elharo May 11, 2025 10:47
@@ -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");
Copy link
Contributor Author

@Pankraz76 Pankraz76 May 11, 2025

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.

#2277 (comment)

@Pankraz76 Pankraz76 marked this pull request as draft May 12, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants