Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2019-11-26 04:20:56 +0000
committerSarika Sinha2019-12-17 04:36:41 +0000
commit5b82ccf0240a9efd7c6092354267b571f4abc056 (patch)
tree4c6974bb571ef7aeaff389f1709fed6b32fd1b37
parent66d739ac9191532640d4cdf90e3a1e9f7e1f06a8 (diff)
downloadeclipse.platform.debug-5b82ccf0240a9efd7c6092354267b571f4abc056.tar.gz
eclipse.platform.debug-5b82ccf0240a9efd7c6092354267b571f4abc056.tar.xz
eclipse.platform.debug-5b82ccf0240a9efd7c6092354267b571f4abc056.zip
Bug 553354 - Catch SecurityException if setting sysprop is forbiddenY20191217-0600I20191220-1805I20191219-1800I20191218-1805I20191218-0015I20191217-1800
A security manager might disallow setting of system properties. As there are no clients of that rely on this property in the platform, the combination of external clients together with a restrictive security manager is unlikely. When clients have a restrictive security manager there error log should not be polluted with error entries. Thus the potential SecurityException is silently ignored. Change-Id: I6cfa04cbed0537e7c92ad42284de56f81c77b97e Also-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index 51119c0ff..f17597ee6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -1056,7 +1056,13 @@ public class LaunchView extends AbstractDebugView
getViewSite().getActionBars().updateActionBars();
// Update system property used by contributed actions.
- System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, Boolean.toString(show));
+ if (!Boolean.toString(show).equals(System.getProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE))) {
+ try {
+ System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, Boolean.toString(show));
+ } catch (SecurityException ex) {
+ // ignore
+ }
+ }
}
@Override
@@ -1374,8 +1380,15 @@ public class LaunchView extends AbstractDebugView
public void partActivated(IWorkbenchPartReference partRef) {
// Ensure that the system property matches the debug toolbar state.
// Bug 385400
- System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE,
- Boolean.toString(isDebugToolbarShownInPerspective(getSite().getPage().getPerspective())) );
+ String debugToolBarShown = Boolean
+ .toString(isDebugToolbarShownInPerspective(getSite().getPage().getPerspective()));
+ if (!(debugToolBarShown.equals(System.getProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE)))) {
+ try {
+ System.setProperty(IDebugUIConstants.DEBUG_VIEW_TOOBAR_VISIBLE, debugToolBarShown);
+ } catch (SecurityException ex) {
+ // ignore
+ }
+ }
}
@Override

Back to the top