1
Author: Federico Tello Gentile <federicotg@gmail.com>
2
Description: Wrap logging calls with if(){} statements to prevent
3
sun.awt.X11.XEvent from creating 600 MB of char[] for no good reason
4
Bug-Vendor: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7104625
5
Bug-Debian: http://bugs.debian.org/651423
6
From: http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/9cc780355c09
8
--- openjdk/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java.orig Fri Oct 14 03:02:15 2011 +0100
9
+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java Thu Dec 08 23:28:48 2011 +0100
13
case PaintEvent.UPDATE:
14
- log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
15
+ if (log.isLoggable(PlatformLogger.FINER)) {
16
+ log.finer("XCP coalescePaintEvent : UPDATE : add : x = " +
17
r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
20
case PaintEvent.PAINT:
21
- log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
22
+ if (log.isLoggable(PlatformLogger.FINER)) {
23
+ log.finer("XCP coalescePaintEvent : PAINT : add : x = " +
24
r.x + ", y = " + r.y + ", width = " + r.width + ",height = " + r.height);
30
* ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
32
protected boolean isEventDisabled(XEvent e) {
33
- enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable"));
34
+ if (enableLog.isLoggable(PlatformLogger.FINEST)) {
35
+ enableLog.finest("Component is {1}, checking for disabled event {0}", e, (isEnabled()?"enabled":"disable"));
38
switch (e.get_type()) {
39
case XConstants.ButtonPress:
41
case XConstants.EnterNotify:
42
case XConstants.LeaveNotify:
43
case XConstants.MotionNotify:
44
- enableLog.finer("Event {0} is disable", e);
45
+ if (enableLog.isLoggable(PlatformLogger.FINER)) {
46
+ enableLog.finer("Event {0} is disable", e);