Skip to content

Conversation

@mernst
Copy link
Contributor

@mernst mernst commented Jan 5, 2026

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

Added a new public 6-argument constructor to EntryReader that includes a boolean twoBlankLines plus charset, filename, comment regex, and include regex parameters. Multiple existing EntryReader constructors (InputStream, Reader, Path, File, String variants) were annotated @Deprecated and Javadoc updated to point to the new constructor variants. A private DummyReader inner class was (re)introduced and relocated to support the new constructor. CHANGELOG.md was updated to note the deprecations in 1.13.0. One test method (testWithCharset) was removed from EntryReaderTest.

Possibly related PRs

  • plume-lib/plume-util PR 581: Modifies EntryReader public constructors, including adding the full-argument constructor with charset, filename, twoBlankLines, commentRegex, and includeRegex.
  • plume-lib/plume-util PR 574: Adds and propagates the twoBlankLines parameter across EntryReader constructor overloads.
  • plume-lib/plume-util PR 555: Introduces propagation of the twoBlankLines parameter and related multi-argument EntryReader constructor variants.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 874651f and 746cd11.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/main/java/org/plumelib/util/EntryReader.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (21)
  • GitHub Check: build (25)
  • GitHub Check: build (17)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (7)
CHANGELOG.md (2)

10-14: LGTM! Changelog entry is accurate.

The spelling issue flagged in previous review ("unweildy" → "unwieldy") has been corrected. The changelog entry accurately reflects the deprecation of multiple EntryReader constructors.


18-19: LGTM! Formatting improvement.

Capitalization changes improve consistency in the changelog formatting.

src/main/java/org/plumelib/util/EntryReader.java (5)

138-167: LGTM! New canonical constructor.

The new 6-argument constructor properly handles all parameters including the twoBlankLines flag and correctly delegates to the Reader-based constructor.


169-209: LGTM! Proper deprecation with correct guidance.

The deprecated InputStream constructors with charset correctly point to the new 6-argument constructor and properly delegate with twoBlankLines=false.


213-259: LGTM! Clear migration path with explicit charset.

The deprecated InputStream constructors without charset correctly guide users to the new 6-argument constructor and explicitly mention passing UTF_8 as the charset, which matches the implementation.


283-337: LGTM! Reader-based constructors properly structured.

The new 5-argument Reader constructor serves as the actual implementation that initializes the reader stack. The deprecated 4-argument version correctly delegates to it with twoBlankLines=false.


1125-1191: LGTM! Appropriate utility class.

The private DummyReader class serves as a placeholder for the superclass constructor requirement (line 303). Its implementation appropriately throws errors for all methods except close(), which is correct for try-with-resources compatibility.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Fix all issues with AI Agents 🤖
In @CHANGELOG.md:
- Around line 10-14: Update the changelog entry under "## 1.13.0 (2026-??-??)"
by fixing the typo in the bullet about EntryReader: replace "unweildy" with the
correct spelling "unwieldy" so the line reads "There were an unwieldy number of
them."

In @src/main/java/org/plumelib/util/EntryReader.java:
- Line 406: The Javadoc @see for the constructor is incorrect: replace "Stream"
with "InputStream" in the @see tag that references EntryReader's constructor
signature (currently written as
#EntryReader(Stream,String,String,boolean,String,String)) so it correctly
references #EntryReader(InputStream,String,String,boolean,String,String).
- Around line 407-412: Update the @deprecated javadoc on EntryReader(Path,
String) to point to the InputStream-based constructor that preserves charset
support (the constructor invoked by this(...) that takes an InputStream and a
charset, e.g. EntryReader(InputStream, String, String, boolean, ...)), so users
retain charset-capable guidance; make the same change for the File- and
String-filename constructors that accept a charset (the other two deprecated
constructors noted) to reference their corresponding InputStream-based
charset-preserving constructor.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/main/java/org/plumelib/util/EntryReader.java (2)

223-238: Clarify charset requirement in deprecation message.

The deprecation points to the 6-argument constructor that requires an explicit charset parameter, but this deprecated constructor implicitly uses UTF-8 (line 233). Users may be confused about which charset to pass to maintain equivalent behavior.

Consider updating the deprecation message to explicitly mention UTF-8:

🔎 Suggested deprecation message improvement
  /**
   * Create an EntryReader.
   *
   * @param in source from which to read entries
   * @param twoBlankLines true if entries are separated by two blank lines rather than one
   * @param filename non-null file name for stream being read
   * @param commentRegexString regular expression that matches comments. Any text that matches
   *     commentRegex is removed. A line that is entirely a comment is ignored.
   * @param includeRegexString regular expression that matches include directives. The expression
   *     should define one group that contains the include file name.
-  * @deprecated use {@link #EntryReader(InputStream,String,String,boolean,String,String)}
+  * @deprecated use {@link #EntryReader(InputStream,String,String,boolean,String,String)} with "UTF-8" as the charset
   */

Apply similar changes to the deprecation message at line 249.


513-522: Deprecation should point to String-based constructor, not File-based.

The deprecation message recommends using EntryReader(File,boolean,String,String), but there's a String-based equivalent at line 494: EntryReader(String filename, boolean twoBlankLines, String commentRegex, String includeRegex). Users working with String filenames would prefer to continue using the String-based API.

🔎 Suggested fix
  /**
   * Create a new EntryReader starting with the specified file.
   *
   * @param filename initial file to read
   * @param commentRegex regular expression that matches comments. Any text that matches {@code
   *     commentRegex} is removed. A line that is entirely a comment is ignored.
   * @param includeRegex regular expression that matches include directives. The expression should
   *     define one group that contains the include file name.
   * @throws IOException if there is a problem reading the file
   * @see #EntryReader(File,boolean,String,String)
-  * @deprecated use {@link #EntryReader(File,boolean,String,String)}
+  * @deprecated use {@link #EntryReader(String,boolean,String,String)}
   */
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b09a43a and 874651f.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/main/java/org/plumelib/util/EntryReader.java
  • src/test/java/org/plumelib/util/EntryReaderTest.java
💤 Files with no reviewable changes (1)
  • src/test/java/org/plumelib/util/EntryReaderTest.java
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[grammar] ~13-~13: Ensure spelling is correct
Context: ...ted several constructors; there were an unweildy number of them. ## 1.12.3 (2025-11-26)...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (25)
  • GitHub Check: build (21)
  • GitHub Check: build (17)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
src/main/java/org/plumelib/util/EntryReader.java (2)

138-167: LGTM! Well-designed canonical constructor.

The new 6-argument constructor provides a complete API surface and properly delegates to the Reader-based constructor. The design choice to make this the canonical constructor is sound.


1124-1190: LGTM! DummyReader properly reintroduced.

The DummyReader class serves as a valid placeholder for the LineNumberReader superclass constructor (line 302), with all methods appropriately throwing errors except close(), which intentionally doesn't throw to support try-with-resources patterns.

@mernst mernst merged commit d8bdb69 into plume-lib:master Jan 5, 2026
5 checks passed
@mernst mernst deleted the entryset-constructors branch January 5, 2026 22:28
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.

1 participant