Unsurprisingly, my test code still is satisfactory with Glenn's variant
of the fix.

Jeremy


Glenn Marcy wrote:
> 
> Jeremy,
> 
> This part looks correct.  My only suggestion to improve the change is to
> split the cleanup responsibilities between the classes that define the
> data members (and add the fData field as well):
> 
> In XMLEntityReader.java:
> 
>     protected XMLEntityHandler.EntityReader changeReaders() throws
> Exception {
>         XMLEntityHandler.EntityReader nextReader = null;
>         if (fStillActive) {
>             nextReader = fEntityHandler.changeReaders();
>             fStillActive = false;
>        // Allow these following three fields to be GC-ed.
>             fEntityHandler = null;
>             fErrorReporter = null;
>             fCharDataHandler = null;
>         }
>         return nextReader;
>     }
> 
> In StringReader.java:
> 
>     public XMLEntityHandler.EntityReader changeReaders() throws Exception {
>         XMLEntityHandler.EntityReader nextReader = super.changeReaders();
>         synchronized (StringReader.class) {
>             fNextFreeReader = fgFreeReaders;
>             fgFreeReaders = this;
>        // Allow these following two fields to be GC-ed.
>             fStringPool = null;
>           fData = null;
>         }
>         return nextReader;
>     }
> 
> Regards,
> Glenn
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to