~ubuntu-branches/ubuntu/precise/openjdk-7/precise-security

« back to all changes in this revision

Viewing changes to debian/patches/icedtea7-forest-jdk_7104625-XEvent_wrap_logging_calls_with_if.patch

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-04-11 07:21:41 UTC
  • mfrom: (1.3.8) (8.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20120411072141-v8i0x0ejg8sf7i5p
Tags: 7~u3-2.1.1~pre1-1ubuntu1
Regenerate the control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
 
 
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
 
10
@@ -475,12 +475,16 @@
 
11
         if (true) {
 
12
             switch(e.getID()) {
 
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);
 
18
+                  }
 
19
                   return;
 
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);
 
25
+                  }
 
26
                   return;
 
27
             }
 
28
         }
 
29
@@ -1257,7 +1261,9 @@
 
30
      * ButtonPress, ButtonRelease, KeyPress, KeyRelease, EnterNotify, LeaveNotify, MotionNotify
 
31
      */
 
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"));
 
36
+        }
 
37
         if (!isEnabled()) {
 
38
             switch (e.get_type()) {
 
39
               case XConstants.ButtonPress:
 
40
@@ -1267,7 +1273,9 @@
 
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);
 
47
+                  }
 
48
                   return true;
 
49
             }
 
50
         }