ASF Bugzilla – Attachment 14189 Details for
Bug 33368
swallowOutput causes memory leak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
ThreadLocal Patch for Jaspers SystemLogHandler
patch_jaspersystemloghandler_threadlocal.txt (text/plain), 2.80 KB, created by
Rainer Jung
on 2005-02-05 17:54:40 UTC
(
hide
)
Description:
ThreadLocal Patch for Jaspers SystemLogHandler
Filename:
MIME Type:
Creator:
Rainer Jung
Created:
2005-02-05 17:54:40 UTC
Size:
2.80 KB
patch
obsolete
>*** jasper2/src/share/org/apache/jasper/util/SystemLogHandler.java.orig Thu Jun 17 21:03:02 2004 >--- jasper2/src/share/org/apache/jasper/util/SystemLogHandler.java Sat Feb 5 17:03:28 2005 >*************** >*** 55,67 **** > /** > * Thread <-> PrintStream associations. > */ >! protected static Hashtable streams = new Hashtable(); > > > /** > * Thread <-> ByteArrayOutputStream associations. > */ >! protected static Hashtable data = new Hashtable(); > > > // --------------------------------------------------------- Public Methods >--- 55,67 ---- > /** > * Thread <-> PrintStream associations. > */ >! protected static ThreadLocal streams = new ThreadLocal(); > > > /** > * Thread <-> ByteArrayOutputStream associations. > */ >! protected static ThreadLocal data = new ThreadLocal(); > > > // --------------------------------------------------------- Public Methods >*************** >*** 76,84 **** > */ > public static void setThread() { > ByteArrayOutputStream baos = new ByteArrayOutputStream(); >! PrintStream ps = new PrintStream(baos); >! data.put(Thread.currentThread(), baos); >! streams.put(Thread.currentThread(), ps); > } > > >--- 76,83 ---- > */ > public static void setThread() { > ByteArrayOutputStream baos = new ByteArrayOutputStream(); >! data.set(baos); >! streams.set(new PrintStream(baos)); > } > > >*************** >*** 87,98 **** > */ > public static String unsetThread() { > ByteArrayOutputStream baos = >! (ByteArrayOutputStream) data.get(Thread.currentThread()); > if (baos == null) { > return null; > } >! streams.remove(Thread.currentThread()); >! data.remove(Thread.currentThread()); > return baos.toString(); > } > >--- 86,97 ---- > */ > public static String unsetThread() { > ByteArrayOutputStream baos = >! (ByteArrayOutputStream) data.get(); > if (baos == null) { > return null; > } >! streams.set(null); >! data.set(null); > return baos.toString(); > } > >*************** >*** 104,110 **** > * Find PrintStream to which the output must be written to. > */ > protected PrintStream findStream() { >! PrintStream ps = (PrintStream) streams.get(Thread.currentThread()); > if (ps == null) { > ps = wrapped; > } >--- 103,109 ---- > * Find PrintStream to which the output must be written to. > */ > protected PrintStream findStream() { >! PrintStream ps = (PrintStream) streams.get(); > if (ps == null) { > ps = wrapped; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33368
:
14184
|
14185
|
14186
|
14187
| 14189 |
14190
|
14191