workaround for sticky focused components and windows
[fedora-idea.git] / util / src / com / intellij / Patches.java
blobfd07604b9ac94082324293c89b27414f89bf23b9
1 /*
2 * Copyright 2000-2007 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 * See sun bug parade.
46 * If you invoke popup menu, then click on a different window (JFrame, JDialog. It doesn't matter),
47 * the JPopupMenu in the previous window still has focus, as does the new window.
48 * Seems like focus in two locations at the same time.
50 * This bug is fixed in JDK1.5
52 public static final boolean SUN_BUG_ID_4218084 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
54 /**
55 * JDK 1.3.x and 1.4.x has the following error. When we close dialog and its content pane is being inserted
56 * into another dialog and mouse WAS INSIDE of dialog's content pane then the AWT doesn't change
57 * some internal references on focused component. It cause crash of dispatching of MOUSE_EXIT
58 * event.
60 public static final boolean SPECIAL_WINPUT_METHOD_PROCESSING = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1;
62 /** BasicMenuUI$MenuKeyHandler.menuKeyPressed() incorrect for dynamic menus. */
63 public static final boolean SUN_BUG_ID_4738042 = SystemInfo.JAVA_VERSION.indexOf("1.4.") != -1 &&
64 SystemInfo.JAVA_VERSION.indexOf("1.4.2") == -1;
66 /** BasicTreeUI.FocusHandler doesn't preperly repaint JTree on focus changes */
67 public static final boolean SUN_BUG_ID_4893787 = true;
69 public static final boolean FILE_CHANNEL_TRANSFER_BROKEN = SystemInfo.isLinux && SystemInfo.OS_VERSION.startsWith("2.6");
71 private static final boolean BELOW_142DP2 = SystemInfo.isMac &&
72 (SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.0") ||
73 SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.1") ||
74 SystemInfo.JAVA_RUNTIME_VERSION.equals("1.4.2_03-117.1"));
75 private static final boolean DP2_OR_DP3 = SystemInfo.isMac && (
76 SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.2_03") ||
77 SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.4.2_04")
80 /**
81 * Every typing produces InputMethodEvent instead of KeyEvent with keyTyped event code. Fixed in JRE higher than 1.4.2_03-117.1
83 public static final boolean APPLE_BUG_ID_3337563 = BELOW_142DP2;
85 /**
86 * A window that receives focus immediately receives focusLost() event and then focusGained() again.
88 public static final boolean APPLE_BUG_ID_3716865 = DP2_OR_DP3;
90 /**
91 * Incorrect repaint of the components wrapped with JScrollPane.
93 public static final boolean APPLE_BUG_ID_3716835 = DP2_OR_DP3;
95 /**
96 * Use of JDK1.5 ReentrantReadWriteLock API eventually leads to JVM lock-up or core dump crashes.
97 * With this flag true, API is wrapped with alternative implementation via early days Doug Lea's API.
98 * @see com.intellij.util.concurrency.LockFactory
100 public static final boolean APPLE_BUG_ID_5359442 = SystemInfo.isMac && (!SystemInfo.isMacOSLeopard || !SystemInfo.isJavaVersionAtLeast("1.5.0_16"));
103 * Index out of bounds at apple.laf.AquaTabbedPaneUI.tabForCoordinate
104 * http://www.jetbrains.net/jira/browse/IDEADEV-15769
106 public static final boolean MAC_AQUA_TABS_HACK = SystemInfo.isMac;
109 * it happened on Mac that some thread did not suspended during VM suspend
110 * resiming VM in this case caused com.sun.jdi.InternalException #13
112 public static final boolean MAC_RESUME_VM_HACK = SystemInfo.isMac;
114 // IBM java machine 1.4.2 craches if debugger uses ObjectReference.disableCollection() and ObjectReference.enableCollection()
115 public static final boolean IBM_JDK_DISABLE_COLLECTION_BUG = "false".equalsIgnoreCase(System.getProperty("idea.debugger.keep.temp.objects"));
117 public static final boolean MAC_HIDE_QUIT_HACK = false;
120 * Causes calling thread to lock up aquiring content of the system clipboard on linux. Being called from the swing thread an
121 * application stops responding.
123 public static final boolean SUN_BUG_ID_4818143 = SystemInfo.isLinux || SystemInfo.isFreeBSD;
126 * Java does not recognize the optional BOM which can begin a UTF-8 stream.
127 * It treats the BOM as if it were the initial character of the stream
129 public static final boolean SUN_BUG_ID_4508058 = true;
132 * Huge int[] leak through VolatileImages cached in RepaintManager whenever screen configuration changes.
133 * For instance screen saver activates or computer goes hibernate. The problem still exists in 1.6 when two (or more)
134 * monitors exists
136 public static final boolean SUN_BUG_ID_6209673 = SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.5") || SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.6");
139 * Under Linux (Ubuntu) invoking "requestFocus" may (probably) activate inactive app. To investigate if it's really true.
141 public static final boolean REQUEST_FOCUS_MAY_ACTIVATE_APP = SystemInfo.isLinux;