Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2010-09-11 20:47:52 -0400
committerslewis2010-09-11 20:47:52 -0400
commit72e77260bd14d42a6152b307e8295d6902a19613 (patch)
tree8bdf4ad48ba4df3e4399c367d22b398606ff0e6a /framework/bundles/org.eclipse.ecf.identity/src
parent8c7b7abb4d41505ee41c5d283059f0fa7d61a9e1 (diff)
downloadorg.eclipse.ecf-72e77260bd14d42a6152b307e8295d6902a19613.tar.gz
org.eclipse.ecf-72e77260bd14d42a6152b307e8295d6902a19613.tar.xz
org.eclipse.ecf-72e77260bd14d42a6152b307e8295d6902a19613.zip
Removed tracing/debug code in order to shrink code size.I-HEAD-platform_feature-69-2010_09_13
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java89
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java35
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/IdentityDebugOptions.java23
3 files changed, 11 insertions, 136 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
index 8dafbbe36..c040aed6e 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
@@ -12,9 +12,7 @@ import java.security.AccessController;
import java.util.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.core.identity.Activator;
-import org.eclipse.ecf.internal.core.identity.IdentityDebugOptions;
/**
* A factory class for creating ID instances. This is the factory for plugins to
@@ -42,16 +40,10 @@ public class IDFactory implements IIDFactory {
private synchronized static void initialize() {
if (!initialized) {
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "initialize");
Activator a = Activator.getDefault();
if (a != null)
a.setupNamespaceExtensionPoint();
initialized = true;
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "initialize");
}
}
@@ -74,17 +66,10 @@ public class IDFactory implements IIDFactory {
public Namespace addNamespace(Namespace namespace) throws SecurityException {
if (namespace == null)
return null;
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "addNamespace", namespace); //$NON-NLS-1$
checkPermission(new NamespacePermission(namespace.toString(),
NamespacePermission.ADD_NAMESPACE));
initialize();
- Namespace result = addNamespace0(namespace);
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "addNamespace", result); //$NON-NLS-1$
- return result;
+ return addNamespace0(namespace);
}
public final static Namespace addNamespace0(Namespace namespace) {
@@ -110,17 +95,10 @@ public class IDFactory implements IIDFactory {
throws SecurityException {
if (namespace == null)
return false;
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "containsNamespace", namespace); //$NON-NLS-1$
checkPermission(new NamespacePermission(namespace.toString(),
NamespacePermission.CONTAINS_NAMESPACE));
initialize();
- boolean result = containsNamespace0(namespace);
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "containsNamespace", new Boolean(result)); //$NON-NLS-1$
- return result;
+ return containsNamespace0(namespace);
}
/*
@@ -129,9 +107,6 @@ public class IDFactory implements IIDFactory {
* @see org.eclipse.ecf.core.identity.IIDFactory#getNamespaces()
*/
public List getNamespaces() {
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "getNamespaces"); //$NON-NLS-1$
initialize();
return new ArrayList(namespaces.values());
}
@@ -152,17 +127,10 @@ public class IDFactory implements IIDFactory {
public Namespace getNamespace(Namespace namespace) throws SecurityException {
if (namespace == null)
return null;
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "getNamespace", namespace); //$NON-NLS-1$
checkPermission(new NamespacePermission(namespace.toString(),
NamespacePermission.GET_NAMESPACE));
initialize();
- Namespace result = getNamespace0(namespace);
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "getNamespace", result); //$NON-NLS-1$
- return result;
+ return getNamespace0(namespace);
}
/*
@@ -173,15 +141,8 @@ public class IDFactory implements IIDFactory {
* .String)
*/
public Namespace getNamespaceByName(String name) throws SecurityException {
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "getNamespaceByName", name); //$NON-NLS-1$
initialize();
- Namespace result = getNamespace0(name);
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "getNamespaceByName", result); //$NON-NLS-1$
- return result;
+ return getNamespace0(name);
}
protected final static Namespace getNamespace0(Namespace n) {
@@ -211,15 +172,8 @@ public class IDFactory implements IIDFactory {
* @see org.eclipse.ecf.core.identity.IIDFactory#createGUID(int)
*/
public ID createGUID(int length) throws IDCreateException {
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "createGUID", new Integer(length)); //$NON-NLS-1$
- Namespace namespace = new GUID.GUIDNamespace();
- ID result = createID(namespace, new Integer[] { new Integer(length) });
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "createGUID", result); //$NON-NLS-1$
- return result;
+ return createID(new GUID.GUIDNamespace(), new Integer[] { new Integer(
+ length) });
}
protected static void logAndThrow(String s, Throwable t)
@@ -231,9 +185,6 @@ public class IDFactory implements IIDFactory {
} else {
e = new IDCreateException(s);
}
- Trace.throwing(Activator.PLUGIN_ID,
- IdentityDebugOptions.EXCEPTIONS_THROWING, IDFactory.class,
- "logAndThrow", e); //$NON-NLS-1$
Activator.getDefault().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
IDENTITY_CREATION_ERRORCODE, s, e));
@@ -248,9 +199,6 @@ public class IDFactory implements IIDFactory {
* .identity.Namespace, java.lang.Object[])
*/
public ID createID(Namespace n, Object[] args) throws IDCreateException {
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "createID", new Object[] { n, Trace.getArgumentsString(args) }); //$NON-NLS-1$
// Verify namespace is non-null
if (n == null)
logAndThrow("Namespace cannot be null", null); //$NON-NLS-1$
@@ -260,14 +208,7 @@ public class IDFactory implements IIDFactory {
Namespace ns = getNamespace0(n);
if (ns == null)
logAndThrow("Namespace " + n.getName() + " not found", null); //$NON-NLS-1$
- // We're OK, go ahead and setup array of classes for call to
- // instantiator
- // Ask instantiator to actually create instance
- ID result = ns.createInstance(args);
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "createID", result); //$NON-NLS-1$
- return result;
+ return ns.createInstance(args);
}
/*
@@ -303,8 +244,8 @@ public class IDFactory implements IIDFactory {
public ID createStringID(String idstring) throws IDCreateException {
if (idstring == null)
throw new IDCreateException("StringID cannot be null"); //$NON-NLS-1$
- Namespace n = new StringID.StringIDNamespace();
- return createID(n, new String[] { idstring });
+ return createID(new StringID.StringIDNamespace(),
+ new String[] { idstring });
}
/*
@@ -313,8 +254,7 @@ public class IDFactory implements IIDFactory {
* @see org.eclipse.ecf.core.identity.IIDFactory#createLongID(long)
*/
public ID createLongID(long l) throws IDCreateException {
- Namespace n = new LongID.LongNamespace();
- return createID(n, new Long[] { new Long(l) });
+ return createID(new LongID.LongNamespace(), new Long[] { new Long(l) });
}
/*
@@ -327,17 +267,10 @@ public class IDFactory implements IIDFactory {
public Namespace removeNamespace(Namespace n) throws SecurityException {
if (n == null)
return null;
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "removeNamespace", n); //$NON-NLS-1$
checkPermission(new NamespacePermission(n.toString(),
NamespacePermission.REMOVE_NAMESPACE));
initialize();
- Namespace result = removeNamespace0(n);
- Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "removeNamespace", result); //$NON-NLS-1$
- return result;
+ return removeNamespace0(n);
}
protected final static Namespace removeNamespace0(Namespace n) {
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
index 7604c3824..0b186c026 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
@@ -159,9 +159,6 @@ public class Activator implements BundleActivator {
* the members to remove
*/
protected void removeNamespaceExtensions(IConfigurationElement[] members) {
- org.eclipse.ecf.core.util.Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, Activator.class,
- "removeNamespaceExtensions", members); //$NON-NLS-1$
for (int m = 0; m < members.length; m++) {
final IConfigurationElement member = members[m];
String name = null;
@@ -179,23 +176,13 @@ public class Activator implements BundleActivator {
}
// remove
factory.removeNamespace(n);
- org.eclipse.ecf.core.util.Trace.trace(Activator.PLUGIN_ID,
- IdentityDebugOptions.DEBUG,
- "removeNamespaceExtensions.removedNamespace(" //$NON-NLS-1$
- + n + ")"); //$NON-NLS-1$
} catch (final Exception e) {
- org.eclipse.ecf.core.util.Trace.catching(Activator.PLUGIN_ID,
- IdentityDebugOptions.EXCEPTIONS_CATCHING,
- Activator.class, "removeNamespaceExtensions", e); //$NON-NLS-1$
getDefault().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
REMOVE_NAMESPACE_ERRORCODE,
"Exception removing namespace", e)); //$NON-NLS-1$
}
}
- org.eclipse.ecf.core.util.Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, Activator.class,
- "removeNamespaceExtensions", members); //$NON-NLS-1$
}
public Bundle getBundle() {
@@ -237,9 +224,6 @@ public class Activator implements BundleActivator {
* the members to add
*/
protected void addNamespaceExtensions(IConfigurationElement[] members) {
- org.eclipse.ecf.core.util.Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_ENTERING, Activator.class,
- "addNamespaceExtensions", members); //$NON-NLS-1$
final String bundleName = getDefault().getBundle().getSymbolicName();
for (int m = 0; m < members.length; m++) {
final IConfigurationElement member = members[m];
@@ -258,24 +242,13 @@ public class Activator implements BundleActivator {
final String nsDescription = member
.getAttribute(DESCRIPTION_ATTRIBUTE);
ns.initialize(nsName, nsDescription);
- org.eclipse.ecf.core.util.Trace.trace(Activator.PLUGIN_ID,
- IdentityDebugOptions.DEBUG,
- "addNamespaceExtensions.createdNamespace(" + ns + ")"); //$NON-NLS-1$ //$NON-NLS-2$
// Check to see if we have a namespace name collision
if (!IDFactory.containsNamespace0(ns)) {
// Now add to known namespaces
IDFactory.addNamespace0(ns);
- org.eclipse.ecf.core.util.Trace
- .trace(Activator.PLUGIN_ID,
- IdentityDebugOptions.DEBUG,
- "addNamespaceExtensions.addedNamespaceToFactory(" + ns //$NON-NLS-1$
- + ")"); //$NON-NLS-1$
}
} catch (final CoreException e) {
getDefault().log(e.getStatus());
- org.eclipse.ecf.core.util.Trace.catching(Activator.PLUGIN_ID,
- IdentityDebugOptions.EXCEPTIONS_CATCHING,
- Activator.class, "addNamespaceExtensions", e); //$NON-NLS-1$
} catch (final Exception e) {
getDefault()
.log(new Status(
@@ -288,14 +261,8 @@ public class Activator implements BundleActivator {
+ extension
.getExtensionPointUniqueIdentifier(),
null));
- org.eclipse.ecf.core.util.Trace.catching(Activator.PLUGIN_ID,
- IdentityDebugOptions.EXCEPTIONS_CATCHING,
- Activator.class, "addNamespaceExtensions", e); //$NON-NLS-1$
}
}
- org.eclipse.ecf.core.util.Trace.exiting(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, Activator.class,
- "addNamespaceExtensions"); //$NON-NLS-1$
}
/**
@@ -322,8 +289,6 @@ public class Activator implements BundleActivator {
* org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext ctxt) throws Exception {
- Trace.entering(Activator.PLUGIN_ID,
- IdentityDebugOptions.METHODS_EXITING, Activator.class, "stop"); //$NON-NLS-1$
final IExtensionRegistry reg = getExtensionRegistry();
if (reg != null)
reg.removeRegistryChangeListener(registryManager);
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/IdentityDebugOptions.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/IdentityDebugOptions.java
deleted file mode 100644
index 4480e486c..000000000
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/IdentityDebugOptions.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Composent, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.ecf.internal.core.identity;
-
-public interface IdentityDebugOptions {
-
- public static final String DEBUG = Activator.PLUGIN_ID + "/debug"; //$NON-NLS-1$
-
- public static final String EXCEPTIONS_CATCHING = DEBUG + "/exceptions/catching"; //$NON-NLS-1$
-
- public static final String EXCEPTIONS_THROWING = DEBUG + "/exceptions/throwing"; //$NON-NLS-1$
-
- public static final String METHODS_ENTERING = DEBUG + "/methods/entering"; //$NON-NLS-1$
-
- public static final String METHODS_EXITING = DEBUG + "/methods/exiting"; //$NON-NLS-1$
-
-}

Back to the top