Ignore NPE for sun's bug under Linux, http://bugs.sun.com/bugdatabase/view_bug.do...
[fedora-idea.git] / platform / util / src / com / intellij / Patches.java
blobaf6571b56953f5b51ea5e461bb208ee9e7d238e2
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij;
18 import com.intellij.openapi.util.SystemInfo;
20 @SuppressWarnings({"HardCodedStringLiteral"})
21 public class Patches {
22 public static final boolean ALL_FOLDERS_ARE_WRITABLE = SystemInfo.isWindows;
24 /**
25 * See sun bug parage.
26 * When JTable loses focus it cancel cell editing. It should stop cell editing instead.
27 * Actually SUN-boys told they have fixed the bug, but they cancel editing instead of stopping it.
29 public static final boolean SUN_BUG_ID_4503845 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
31 /**
32 * See sun bug parage [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4620537].
33 * MouseListener on JTabbedPane with SCROLL_TAB_LAYOUT policy doesn't get events. In the related bug
34 * #4499556 Sun advices to reimplement or hack JTabbedPane as workaround :)
36 public static final boolean SUN_BUG_ID_4620537 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
38 /**
39 * See sun bug parage.
40 * Debugger hangs on any attempt to attach/listen Connector when attach hanged once.
42 public static final boolean SUN_BUG_338675 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
44 /**
45 * java.lang.NullPointerException: Failed to retrieve atom name.
47 public static final boolean SUN_BUG_6322854 = SystemInfo.isLinux;
49 /**
50 * See sun bug parade.
51 * If you invoke popup menu, then click on a different window (JFrame, JDialog. It doesn't matter),
52 * the JPopupMenu in the previous window still has focus, as does the new window.
53 * Seems like focus in two locations at the same time.
55 * This bug is fixed in JDK1.5
57 public static final boolean SUN_BUG_ID_4218084 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
59 /**
60 * JDK 1.3.x and 1.4.x has the following error. When we close dialog and its content pane is being inserted
61 * into another dialog and mouse WAS INSIDE of dialog's content pane then the AWT doesn't change
62 * some internal references on focused component. It cause crash of dispatching of MOUSE_EXIT
63 * event.
65 public static final boolean SPECIAL_WINPUT_METHOD_PROCESSING = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
67 /** BasicMenuUI$MenuKeyHandler.menuKeyPressed() incorrect for dynamic menus. */
68 public static final boolean SUN_BUG_ID_4738042 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1 &&
69 SystemInfo.JAVA_VERSION.indexOf("1.4.2") == -1;
71 /** BasicTreeUI.FocusHandler doesn't preperly repaint JTree on focus changes */
72 public static final boolean SUN_BUG_ID_4893787 = true;
74 public static final boolean FILE_CHANNEL_TRANSFER_BROKEN = SystemInfo.isLinux && SystemInfo.OS_VERSION.startsWith("2.6");
76 private static final boolean BELOW_142DP2 = SystemInfo.isMac &&
77 (SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.0") ||
78 SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.1") ||
79 SystemInfo.JAVA_RUNTIME_VERSION.equals("1.4.2_03-117.1"));
80 private static final boolean DP2_OR_DP3 = SystemInfo.isMac && (
81 SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.2_03") ||
82 SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.2_04")
85 /**
86 * Every typing produces InputMethodEvent instead of KeyEvent with keyTyped event code. Fixed in JRE higher than 1.4.2_03-117.1
88 public static final boolean APPLE_BUG_ID_3337563 = BELOW_142DP2;
90 /**
91 * A window that receives focus immediately receives focusLost() event and then focusGained() again.
93 public static final boolean APPLE_BUG_ID_3716865 = DP2_OR_DP3;
95 /**
96 * Incorrect repaint of the components wrapped with JScrollPane.
98 public static final boolean APPLE_BUG_ID_3716835 = DP2_OR_DP3;
101 * Use of JDK1.5 ReentrantReadWriteLock API eventually leads to JVM lock-up or core dump crashes.
102 * With this flag true, API is wrapped with alternative implementation via early days Doug Lea's API.
103 * @see com.intellij.util.concurrency.LockFactory
105 public static final boolean APPLE_BUG_ID_5359442 = SystemInfo.isMac && (!SystemInfo.isMacOSLeopard || !SystemInfo.isJavaVersionAtLeast("1.5.0_16"));
108 * Index out of bounds at apple.laf.AquaTabbedPaneUI.tabForCoordinate
109 * http://www.jetbrains.net/jira/browse/IDEADEV-15769
111 public static final boolean MAC_AQUA_TABS_HACK = SystemInfo.isMac;
114 * it happened on Mac that some thread did not suspended during VM suspend
115 * resiming VM in this case caused com.sun.jdi.InternalException #13
117 public static final boolean MAC_RESUME_VM_HACK = SystemInfo.isMac;
119 // IBM java machine 1.4.2 craches if debugger uses ObjectReference.disableCollection() and ObjectReference.enableCollection()
120 public static final boolean IBM_JDK_DISABLE_COLLECTION_BUG = "false".equalsIgnoreCase(System.getProperty("idea.debugger.keep.temp.objects"));
122 public static final boolean MAC_HIDE_QUIT_HACK = false;
125 * Causes calling thread to lock up aquiring content of the system clipboard on linux. Being called from the swing thread an
126 * application stops responding.
128 public static final boolean SUN_BUG_ID_4818143 = SystemInfo.isLinux || SystemInfo.isFreeBSD;
131 * Java does not recognize the optional BOM which can begin a UTF-8 stream.
132 * It treats the BOM as if it were the initial character of the stream
134 public static final boolean SUN_BUG_ID_4508058 = true;
137 * Huge int[] leak through VolatileImages cached in RepaintManager whenever screen configuration changes.
138 * For instance screen saver activates or computer goes hibernate. The problem still exists in 1.6 when two (or more)
139 * monitors exists
141 public static final boolean SUN_BUG_ID_6209673 = SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.5") || SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.6");
144 * Under Linux (Ubuntu) invoking "requestFocus" may (probably) activate inactive app. To investigate if it's really true.
146 public static final boolean REQUEST_FOCUS_MAY_ACTIVATE_APP = SystemInfo.isLinux;