You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slachiewicz (via GitHub)" <gi...@apache.org> on 2026/09/03 12:10:25 UTC

[I] Drop the dead LineBreaker class and the commons-io dependency [maven-doxia]

slachiewicz opened a new issue, #1093:
URL: https://github.com/apache/maven-doxia/issues/1093

   ### New feature, improvement proposal
   
   Two independent bits of weight in modules that sit on the classpath of every Maven site
   build. Neither is urgent; both are small.
   
   #### 1. `LineBreaker` is dead public API
   
   `doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java` is the only file
   that mentions the name. Not in any other source, not in a test, and not in any other file
   type — checked across a checkout of the Maven repositories, not just Doxia.
   
   It is also written to lose data if it ever were used. The write loop ends in
   `catch (Exception e) { // TODO: log }`, which swallows runtime exceptions as well as
   `IOException`, and `flush()` swallows `IOException` with the javadoc saying so outright.
   A failing writer would produce a silently truncated file and a green build.
   
   Removing it is better than fixing it. It is `public` in a published module, so:
   deprecate for removal now, drop it alongside the other next-major items (#1074, #1092).
   
   #### 2. commons-io is a compile dependency of six modules for seven call sites
   
   `doxia-core` and all five modules declare `commons-io` at compile scope. Main-source usage
   in full:
   
   | Call | Sites |
   | --- | --- |
   | `IOUtils.copy(Reader, Writer)` | `XdocParser`, `FmlParser`, `Xhtml5Parser`, `AptParser` |
   | `IOUtils.toString(Reader)` | `AbstractXmlParser`, `MarkdownParser` |
   | `IOUtils.toByteArray(InputStream)` | `AbstractXmlParser` |
   
   The Java 8 baseline rules out `Reader.transferTo` and `InputStream.readAllBytes`, so this
   needs either a small helper or an inlined loop. Two options:
   
   - Inline a `char[]` copy loop at the seven sites. No new API, no new class.
   - Put a package-private helper in `doxia-core`, which every module already depends on
     through `doxia-modules/pom.xml`. Fewer copies, but it wants a home that is not a
     published `util` package.
   
   Worth doing together with a look at the seven test-source usages, which can keep
   commons-io at test scope if that is easier.
   
   *This issue was created with AI assistance.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Drop the dead LineBreaker class and the commons-io dependency [maven-doxia]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz closed issue #1093: Drop the dead LineBreaker class and the commons-io dependency
URL: https://github.com/apache/maven-doxia/issues/1093


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org