Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 142352 Details for
Bug 284348
[Validation] Deterioration of performance with Eclipse Galileo due to Tracing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch that caches the isDebugging flag and invalidates the cache on changes
EMFModelValidationPlugin_tracing.patch (text/plain), 2.99 KB, created by
Mario Winterer
on 2009-07-23 03:47:18 EDT
(
hide
)
Description:
patch that caches the isDebugging flag and invalidates the cache on changes
Filename:
MIME Type:
Creator:
Mario Winterer
Created:
2009-07-23 03:47:18 EDT
Size:
2.99 KB
patch
obsolete
>Index: EMFModelValidationPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.validation/plugins/org.eclipse.emf.validation/src/org/eclipse/emf/validation/internal/EMFModelValidationPlugin.java,v >retrieving revision 1.6 >diff -u -r1.6 EMFModelValidationPlugin.java >--- EMFModelValidationPlugin.java 5 Oct 2008 22:12:16 -0000 1.6 >+++ EMFModelValidationPlugin.java 23 Jul 2009 07:40:05 -0000 >@@ -15,7 +15,9 @@ > package org.eclipse.emf.validation.internal; > > import java.util.Collection; >+import java.util.Dictionary; > import java.util.HashMap; >+import java.util.Hashtable; > import java.util.Iterator; > import java.util.Map; > >@@ -26,6 +28,8 @@ > import org.eclipse.emf.common.EMFPlugin; > import org.eclipse.emf.common.util.ResourceLocator; > import org.eclipse.emf.validation.internal.l10n.ValidationMessages; >+import org.eclipse.osgi.service.debug.DebugOptions; >+import org.eclipse.osgi.service.debug.DebugOptionsListener; > import org.eclipse.osgi.util.NLS; > import org.osgi.framework.BundleContext; > >@@ -213,7 +217,7 @@ > * > * @author Christian W. Damus (cdamus) > */ >- public static class Implementation extends EMFPlugin.EclipsePlugin { >+ public static class Implementation extends EMFPlugin.EclipsePlugin implements DebugOptionsListener { > /** > * Track extensions for extension points defined in this bundle. > */ >@@ -237,6 +241,11 @@ > super.start(context); > > extensionTracker = new ExtensionTracker(); >+ >+ // register listener that is notified whenever debug options change >+ Dictionary<String, Object> props = new Hashtable<String, Object>(4); >+ props.put(DebugOptions.LISTENER_SYMBOLICNAME, getPluginId()); >+ context.registerService(DebugOptionsListener.class.getName(), this, props); > } > > @Override >@@ -246,6 +255,10 @@ > > super.stop(context); > } >+ >+ public void optionsChanged(DebugOptions options) { >+ Tracing.invalidateCache(); >+ } > } > > public static class Tracing { >@@ -255,13 +268,31 @@ > private static final Map<String, Boolean> cachedOptions = new HashMap<String, Boolean>(); > > /** >+ * The cached Boolean value indicating whether tracing is enabled. >+ */ >+ private static Boolean debugging = null; >+ >+ /** >+ * Invalidates the cached debug options and the cached Boolean value >+ * indicating whether tracing is enabled. >+ */ >+ protected static void invalidateCache() { >+ cachedOptions.clear(); >+ debugging = null; >+ } >+ >+ /** > * Retrieves a Boolean value indicating whether tracing is enabled. > * > * @return Whether tracing is enabled for the plug-in. > * > */ > protected static boolean shouldTrace() { >- return plugin.isDebugging(); >+ if (debugging == null) { >+ debugging = plugin.isDebugging(); >+ } >+ >+ return debugging.booleanValue(); > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mario.winterer
:
review?
Actions:
View
|
Diff
Attachments on
bug 284348
: 142352 |
142366
|
142407