[
https://issues.apache.org/jira/browse/IO-861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17895935#comment-17895935
]
Gary D. Gregory edited comment on IO-861 at 11/6/24 12:40 PM:
--------------------------------------------------------------
Hello [~msqr]
Please post your subclass so I can see if it can be coded differently. It might
not of course but I'd like to make sure I am seeing the full picture from your
POV.
was (Author: garydgregory):
Hello [~msqr]
Please post your subclass so I can see if it can be coded differently.
> BoundedInputStream is hard to subclass becauase constructors are deprecated
> ---------------------------------------------------------------------------
>
> Key: IO-861
> URL: https://issues.apache.org/jira/browse/IO-861
> Project: Commons IO
> Issue Type: Improvement
> Components: Streams/Writers
> Affects Versions: 2.17.0
> Reporter: Matt Magoffin
> Priority: Major
>
> The {{org.apache.commons.io.input.BoundedInputStream}} class added a
> {{Builder}} in version 2.16 (I think), and also annotated all public
> constructors with {{{}@Deprecated{}}}. I have classes that extend
> {{BoundedInputStream}} < 2.16 that make use of those constructors, and I'd
> like to avoid using deprecated code in version 2.17. I do not see any other
> way to sub-class {{{}BoundedInputStream{}}}, however.
> The purpose of my subclass is to override the provided {{onMaxLength}} method:
> {code:java}
> protected void onMaxLength(final long maxLength, final long count) throws
> IOException {
> // for subclasses
> }
> {code}
> method, which has been specifically designed for sub-classes like mine to
> override. Would it be possible to remove the deprecation on at least one
> constructor, or is there some other way I'm missing?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)