Closed
Conversation
elharo
commented
Mar 1, 2025
Contributor
Author
elharo
left a comment
There was a problem hiding this comment.
There are no unit tests (although I prompted for one).
| * | ||
| * @since 1.3 | ||
| */ | ||
| private static class WriterOutputStream extends OutputStream { |
Contributor
Author
There was a problem hiding this comment.
This class is insane. Who would create something this broken?
| } | ||
|
|
||
| @Override | ||
| public void write(final int b) throws IOException { |
Contributor
Author
There was a problem hiding this comment.
This all depends on the platform dependent default encoding.
|
|
||
| @Override | ||
| public void write(final byte[] b) throws IOException { | ||
| writer.write(new String(b)); |
Contributor
Author
There was a problem hiding this comment.
only works in ASCII and 8859-1
| } | ||
|
|
||
| @Override | ||
| public void write(final byte[] b, final int off, final int len) throws IOException { |
Contributor
Author
There was a problem hiding this comment.
avoid single letter and abbreviated variable names
| try { | ||
| new SyndFeedOutput().output(feed, writer); | ||
| } catch (FeedException ex) { | ||
| } catch (FeedException ex) { //NOPMD |
| feed.setFeedType(feedType); | ||
| feed.setTitle(title); | ||
| feed.setAuthor(author); | ||
| feed.setPublishedDate(new Date()); |
Contributor
Author
There was a problem hiding this comment.
never sets encoding, which is the point of the bug
| exportInternal(releases, outputStream); | ||
| } | ||
|
|
||
| private void exportInternal(final List<Release> releases, final OutputStream outputStream) throws IOException { |
Contributor
Author
There was a problem hiding this comment.
This implementation probably shouldn't be shared.
| feed.setEntries(getEntries(releases)); | ||
|
|
||
| try { | ||
| new SyndFeedOutput().output(feed, writer); |
Contributor
Author
There was a problem hiding this comment.
writer variable does not exist. This does not compile.
|
Resolve #390 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Curious to see if Gemini code assist can help with a real prioblem in Maven. tldr, no, no it can't.
It could not write a unit test to expose the bug, and the code it produced to fix the bug not only didn't fix the bug; it didn't even compile.