registry must be not used here because not yet initialized

GitOrigin-RevId: 4731f2911c9a73f0c2e55f45240c51e94379d330
This commit is contained in:
Vladimir Krivosheev
2019-05-29 22:05:00 +03:00
committed by intellij-monorepo-bot
parent 87ad9d1fa9
commit 27d17de183
4 changed files with 8 additions and 30 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.keymap.impl.keyGestures;
import com.intellij.openapi.actionSystem.*;
@@ -6,6 +6,7 @@ import com.intellij.openapi.keymap.impl.ActionProcessor;
import com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher;
import com.intellij.openapi.keymap.impl.KeyState;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.SystemProperties;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
@@ -36,7 +37,7 @@ public class KeyboardGestureProcessor {
}
});
final Timer myDblClickTimer = UIUtil.createNamedTimer("Double click",Registry.intValue("actionSystem.keyGestureDblClickTime"), new ActionListener() {
final Timer myDblClickTimer = UIUtil.createNamedTimer("Double click", SystemProperties.getIntProperty("actionSystem.keyGestureDblClickTime", 650), new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
myState.processDblClickTimer();
@@ -374,7 +374,7 @@ public class ToolWindowManagerImpl extends ToolWindowManagerEx implements Persis
private void restartWaitingForSecondPressAlarm() {
myWaiterForSecondPress.cancelAllRequests();
myWaiterForSecondPress.addRequest(mySecondPressRunnable, Registry.intValue("actionSystem.keyGestureDblClickTime"));
myWaiterForSecondPress.addRequest(mySecondPressRunnable, SystemProperties.getIntProperty("actionSystem.keyGestureDblClickTime", 650));
}
private boolean hasOpenEditorFiles() {
@@ -21,7 +21,6 @@ actionSystem.playback.useDirectActionCall=true
actionSystem.playback.useTypingTargets=true
actionSystem.mac.screenMenuNotUpdatedFix=false
actionSystem.keyGestures.enabled=false
actionSystem.keyGestureDblClickTime=650
actionSystem.suspendFocusTransferIfApplicationInactive=true
actionSystem.getContextByRecentMouseEvent=false
actionSystem.secondKeystrokeTimeout=2000
@@ -1422,9 +1421,6 @@ inplace.change.signature.description=Enables change signature without dialog, in
low.memory.watcher.sync=true
low.memory.watcher.sync.description=Whether LowMemoryWatcher runnables should be executed on the same thread that the low memory events come
low.memory.watcher.notification.threshold=0.95
low.memory.watcher.notification.threshold.description=The proportion of maximum heap memory that needs to be exceeded for LowMemoryWatcher listeners to be notified
max.suggested.heap.size=2048
max.suggested.heap.size.description=The maximum Xmx value in megabytes that is going to be suggested by the EditXmxVMOption dialog
@@ -1,24 +1,11 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.util;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.Consumer;
import com.intellij.util.SystemProperties;
import com.intellij.util.concurrency.SequentialTaskExecutor;
import org.jetbrains.annotations.NotNull;
@@ -29,7 +16,6 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryNotificationInfo;
import java.lang.management.MemoryPoolMXBean;
import java.lang.management.MemoryType;
import java.util.MissingResourceException;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
@@ -103,13 +89,8 @@ public class LowMemoryWatcherManager implements Disposable {
}
};
private static double getOccupiedMemoryThreshold() {
try {
return Registry.doubleValue("low.memory.watcher.notification.threshold");
}
catch (MissingResourceException e) {
return 0.95;
}
private static float getOccupiedMemoryThreshold() {
return SystemProperties.getFloatProperty("low.memory.watcher.notification.threshold", 0.95f);
}
private void handleEventImmediately(boolean afterGc) {