This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question about FilterReader


I'm looking at PR 1913 some more.  I think this bug affects most of
the Reader subclasses in libgcj.  Generally, fixing them isn't a
problem.  However, I have a question about FilterReader.

One approach to fixing it would be to change each method to
synchronize on `lock' and also check-and-throw if the reader is
closed.

Another approach would be to simply change FilterReader.close() so
that it doesn't invoke `in = null'.  This approach is attractive
because it eliminates a lot of redundancy -- locking and checking and
so forth.  However, the downside is that whatever lies underneath the
FilterReader won't be GC'd until the FilterReader itself is garbage.

This makes the tradeoffs nebulous to me.  Any suggestions?

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]