You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the Resource Leak Checker only supports writing @MustCallAlias on one formal parameter of a method, but we should generalize this. Consider SequenceInputStream:
For the Resource Leak Checker, I believe the correct qualifiers for this class are:
@MustCall({}) for the class
@MustCallAlias for both formal parameters of the SequenceInputStream(InputStream s1, InputStream s2) constructor
I believe the semantics are clear; when that constructor is invoked, the returned SequenceInputStream is a resource alias for boths1 and s2, and closing the SequenceInputStream will close both s1 and s2. I do not believe it will be terribly difficult to add support for this pattern to the checker.
The text was updated successfully, but these errors were encountered:
(moving from kelloggm/object-construction-checker#409)
Right now, the Resource Leak Checker only supports writing
@MustCallAlias
on one formal parameter of a method, but we should generalize this. ConsiderSequenceInputStream
:https://docs.oracle.com/javase/7/docs/api/java/io/SequenceInputStream.html
For the Resource Leak Checker, I believe the correct qualifiers for this class are:
@MustCall({})
for the class@MustCallAlias
for both formal parameters of theSequenceInputStream(InputStream s1, InputStream s2)
constructorI believe the semantics are clear; when that constructor is invoked, the returned
SequenceInputStream
is a resource alias for boths1
ands2
, and closing theSequenceInputStream
will close boths1
ands2
. I do not believe it will be terribly difficult to add support for this pattern to the checker.The text was updated successfully, but these errors were encountered: