Skip to content

Commit eb38d0f

Browse files
committed
Move TraceHandler to internals of org.eclipse.terminal.view.ui
This type is not in fact used in other bundles therefore it should not be a part of API
1 parent 1ab7153 commit eb38d0f

File tree

6 files changed

+12
-72
lines changed
  • terminal/bundles
    • org.eclipse.terminal.connector.local/src/org/eclipse/terminal/connector/local/activator
    • org.eclipse.terminal.connector.process/src/org/eclipse/terminal/connector/process/internal
    • org.eclipse.terminal.connector.ssh/src/org/eclipse/terminal/connector/ssh/activator
    • org.eclipse.terminal.connector.telnet/src/org/eclipse/terminal/connector/telnet/activator
    • org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal

6 files changed

+12
-72
lines changed

terminal/bundles/org.eclipse.terminal.connector.local/src/org/eclipse/terminal/connector/local/activator/UIPlugin.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.eclipse.jface.resource.ImageDescriptor;
1616
import org.eclipse.jface.resource.ImageRegistry;
1717
import org.eclipse.swt.graphics.Image;
18-
import org.eclipse.terminal.view.core.utils.TraceHandler;
1918
import org.eclipse.terminal.view.ui.launcher.ILauncherDelegateManager;
2019
import org.eclipse.ui.plugin.AbstractUIPlugin;
2120
import org.osgi.framework.BundleContext;
@@ -27,8 +26,6 @@
2726
public class UIPlugin extends AbstractUIPlugin {
2827
// The shared instance
2928
private static volatile UIPlugin plugin;
30-
// The trace handler instance
31-
private static volatile TraceHandler traceHandler;
3229

3330
private ServiceTracker<ILauncherDelegateManager, ILauncherDelegateManager> launchDelegateServiceTracker;
3431

@@ -51,18 +48,6 @@ public static String getUniqueIdentifier() {
5148
return "org.eclipse.terminal.connector.local"; //$NON-NLS-1$
5249
}
5350

54-
/**
55-
* Returns the bundles trace handler.
56-
*
57-
* @return The bundles trace handler.
58-
*/
59-
public static TraceHandler getTraceHandler() {
60-
if (traceHandler == null) {
61-
traceHandler = new TraceHandler(getUniqueIdentifier());
62-
}
63-
return traceHandler;
64-
}
65-
6651
@Override
6752
public void start(BundleContext context) throws Exception {
6853
super.start(context);
@@ -74,7 +59,6 @@ public void start(BundleContext context) throws Exception {
7459
@Override
7560
public void stop(BundleContext context) throws Exception {
7661
plugin = null;
77-
traceHandler = null;
7862
super.stop(context);
7963
}
8064

terminal/bundles/org.eclipse.terminal.connector.process/src/org/eclipse/terminal/connector/process/internal/UIPlugin.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2012, 2018 Wind River Systems, Inc. and others. All rights reserved.
2+
* Copyright (c) 2012, 2025 Wind River Systems, Inc. and others. All rights reserved.
33
* This program and the accompanying materials are made available under the terms
44
* of the Eclipse Public License 2.0 which accompanies this distribution, and is
55
* available at https://www.eclipse.org/legal/epl-2.0/
@@ -8,6 +8,7 @@
88
*
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
11+
* Alexander Fedorov (ArSysOp) - further evolution
1112
*******************************************************************************/
1213
package org.eclipse.terminal.connector.process.internal;
1314

@@ -16,7 +17,6 @@
1617
import org.eclipse.jface.resource.ImageDescriptor;
1718
import org.eclipse.jface.resource.ImageRegistry;
1819
import org.eclipse.swt.graphics.Image;
19-
import org.eclipse.terminal.view.core.utils.TraceHandler;
2020
import org.eclipse.ui.plugin.AbstractUIPlugin;
2121
import org.osgi.framework.BundleContext;
2222

@@ -27,9 +27,6 @@ public class UIPlugin extends AbstractUIPlugin {
2727
// The shared instance
2828
private static UIPlugin plugin;
2929

30-
// The trace handler instance
31-
private static volatile TraceHandler traceHandler;
32-
3330
/**
3431
* The constructor
3532
*/
@@ -55,18 +52,6 @@ public static String getUniqueIdentifier() {
5552
return "org.eclipse.terminal.connector.process"; //$NON-NLS-1$
5653
}
5754

58-
/**
59-
* Returns the bundles trace handler.
60-
*
61-
* @return The bundles trace handler.
62-
*/
63-
public static TraceHandler getTraceHandler() {
64-
if (traceHandler == null) {
65-
traceHandler = new TraceHandler(getUniqueIdentifier());
66-
}
67-
return traceHandler;
68-
}
69-
7055
@Override
7156
public void start(BundleContext context) throws Exception {
7257
super.start(context);

terminal/bundles/org.eclipse.terminal.connector.ssh/src/org/eclipse/terminal/connector/ssh/activator/UIPlugin.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2018 Wind River Systems, Inc. and others. All rights reserved.
2+
* Copyright (c) 2011, 2025 Wind River Systems, Inc. and others. All rights reserved.
33
* This program and the accompanying materials are made available under the terms
44
* of the Eclipse Public License 2.0 which accompanies this distribution, and is
55
* available at https://www.eclipse.org/legal/epl-2.0/
@@ -8,6 +8,7 @@
88
*
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
11+
* Alexander Fedorov (ArSysOp) - further evolution
1112
*******************************************************************************/
1213
package org.eclipse.terminal.connector.ssh.activator;
1314

@@ -16,7 +17,6 @@
1617
import org.eclipse.jsch.core.IJSchService;
1718
import org.eclipse.swt.graphics.Image;
1819
import org.eclipse.terminal.connector.ssh.connector.SshConnection;
19-
import org.eclipse.terminal.view.core.utils.TraceHandler;
2020
import org.eclipse.ui.plugin.AbstractUIPlugin;
2121
import org.osgi.framework.BundleContext;
2222
import org.osgi.util.tracker.ServiceTracker;
@@ -27,8 +27,6 @@
2727
public class UIPlugin extends AbstractUIPlugin {
2828
// The shared instance
2929
private static UIPlugin plugin;
30-
// The trace handler instance
31-
private static volatile TraceHandler traceHandler;
3230

3331
// ServiceTracker for IJschService
3432
private ServiceTracker<IJSchService, IJSchService> tracker;
@@ -58,18 +56,6 @@ public static String getUniqueIdentifier() {
5856
return "org.eclipse.terminal.connector.ssh"; //$NON-NLS-1$
5957
}
6058

61-
/**
62-
* Returns the bundles trace handler.
63-
*
64-
* @return The bundles trace handler.
65-
*/
66-
public static TraceHandler getTraceHandler() {
67-
if (traceHandler == null) {
68-
traceHandler = new TraceHandler(getUniqueIdentifier());
69-
}
70-
return traceHandler;
71-
}
72-
7359
//---------------------------------------------------------------------------
7460
//<copied code from org.eclipse.team.cvs.ssh2/CVSSSH2Plugin (Copyright IBM)>
7561
//---------------------------------------------------------------------------

terminal/bundles/org.eclipse.terminal.connector.telnet/src/org/eclipse/terminal/connector/telnet/activator/UIPlugin.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2018 Wind River Systems, Inc. and others. All rights reserved.
2+
* Copyright (c) 2011, 2025 Wind River Systems, Inc. and others. All rights reserved.
33
* This program and the accompanying materials are made available under the terms
44
* of the Eclipse Public License 2.0 which accompanies this distribution, and is
55
* available at https://www.eclipse.org/legal/epl-2.0/
@@ -9,13 +9,13 @@
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
1111
* Max Weninger (Wind River) - [366374] [TERMINALS][TELNET] Add Telnet terminal support
12+
* Alexander Fedorov (ArSysOp) - further evolution
1213
*******************************************************************************/
1314
package org.eclipse.terminal.connector.telnet.activator;
1415

1516
import org.eclipse.jface.resource.ImageDescriptor;
1617
import org.eclipse.jface.resource.ImageRegistry;
1718
import org.eclipse.swt.graphics.Image;
18-
import org.eclipse.terminal.view.core.utils.TraceHandler;
1919
import org.eclipse.ui.plugin.AbstractUIPlugin;
2020
import org.osgi.framework.BundleContext;
2121

@@ -25,8 +25,6 @@
2525
public class UIPlugin extends AbstractUIPlugin {
2626
// The shared instance
2727
private static UIPlugin plugin;
28-
// The trace handler instance
29-
private static volatile TraceHandler traceHandler;
3028

3129
/**
3230
* The constructor
@@ -53,18 +51,6 @@ public static String getUniqueIdentifier() {
5351
return "org.eclipse.terminal.connector.telnet"; //$NON-NLS-1$
5452
}
5553

56-
/**
57-
* Returns the bundles trace handler.
58-
*
59-
* @return The bundles trace handler.
60-
*/
61-
public static TraceHandler getTraceHandler() {
62-
if (traceHandler == null) {
63-
traceHandler = new TraceHandler(getUniqueIdentifier());
64-
}
65-
return traceHandler;
66-
}
67-
6854
@Override
6955
public void start(BundleContext context) throws Exception {
7056
super.start(context);
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2018 Wind River Systems, Inc. and others. All rights reserved.
2+
* Copyright (c) 2011, 2025 Wind River Systems, Inc. and others. All rights reserved.
33
* This program and the accompanying materials are made available under the terms
44
* of the Eclipse Public License 2.0 which accompanies this distribution, and is
55
* available at https://www.eclipse.org/legal/epl-2.0/
@@ -8,13 +8,13 @@
88
*
99
* Contributors:
1010
* Wind River Systems - initial API and implementation
11+
* Alexander Fedorov (ArSysOp) - further evolution
1112
*******************************************************************************/
12-
package org.eclipse.terminal.view.core.utils;
13+
package org.eclipse.terminal.view.ui.internal;
1314

1415
import org.eclipse.core.runtime.Assert;
1516
import org.eclipse.core.runtime.IStatus;
1617
import org.eclipse.core.runtime.Platform;
17-
import org.eclipse.terminal.view.core.internal.CoreBundleActivator;
1818

1919
/**
2020
* Helper class to handle tracing using the platforms debug capabilities.
@@ -184,11 +184,11 @@ public final void trace(String message, int debugMode, String slotId, int severi
184184
* <p>
185185
* Initializes the tracing handler with the given bundle identifier.
186186
*
187-
* @param identifier The bundle identifier or <code>null</code>.
187+
* @param identifier The bundle identifier, must not be <code>null</code>.
188188
*/
189189
public TraceHandler(String identifier) {
190-
this.identifier = identifier != null ? identifier : CoreBundleActivator.getUniqueIdentifier();
191-
Assert.isNotNull(this.identifier);
190+
Assert.isNotNull(identifier);
191+
this.identifier = identifier;
192192
}
193193

194194
/**

terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/UIPlugin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.eclipse.terminal.control.ITerminalViewControl;
3030
import org.eclipse.terminal.view.core.ITerminalService;
3131
import org.eclipse.terminal.view.core.utils.ScopedEclipsePreferences;
32-
import org.eclipse.terminal.view.core.utils.TraceHandler;
3332
import org.eclipse.terminal.view.ui.internal.listeners.WorkbenchWindowListener;
3433
import org.eclipse.terminal.view.ui.internal.view.TerminalsView;
3534
import org.eclipse.terminal.view.ui.internal.view.TerminalsViewMementoHandler;

0 commit comments

Comments
 (0)