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 178461 Details for
Bug 282436
[performance][context] remove From Context hangs eclipse
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
clipboard.txt (text/plain), 6.14 KB, created by
Shawn Minto
on 2010-09-08 18:31:13 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Shawn Minto
Created:
2010-09-08 18:31:13 EDT
Size:
6.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.context.core >Index: src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.context.core/src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java,v >retrieving revision 1.86 >diff -u -r1.86 InteractionContextManager.java >--- src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java 2 Sep 2010 21:18:33 -0000 1.86 >+++ src/org/eclipse/mylyn/internal/context/core/InteractionContextManager.java 8 Sep 2010 22:29:16 -0000 >@@ -39,12 +39,12 @@ > import org.eclipse.mylyn.context.core.AbstractContextListener; > import org.eclipse.mylyn.context.core.AbstractContextStructureBridge; > import org.eclipse.mylyn.context.core.ContextChangeEvent; >-import org.eclipse.mylyn.context.core.ContextChangeEvent.ContextChangeKind; > import org.eclipse.mylyn.context.core.ContextCore; > import org.eclipse.mylyn.context.core.IInteractionContext; > import org.eclipse.mylyn.context.core.IInteractionContextManager; > import org.eclipse.mylyn.context.core.IInteractionElement; > import org.eclipse.mylyn.context.core.IInteractionRelation; >+import org.eclipse.mylyn.context.core.ContextChangeEvent.ContextChangeKind; > import org.eclipse.mylyn.monitor.core.InteractionEvent; > import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind; > >@@ -804,9 +804,8 @@ > > if (activityMetaContext == null) { > resetActivityMetaContext(); >- } else if (!ContextCorePlugin.getDefault() >- .getPluginPreferences() >- .getBoolean(PREFERENCE_ATTENTION_MIGRATED)) { >+ } else if (!ContextCorePlugin.getDefault().getPluginPreferences().getBoolean( >+ PREFERENCE_ATTENTION_MIGRATED)) { > activityMetaContext = migrateLegacyActivity(activityMetaContext); > saveActivityMetaContext(); > ContextCorePlugin.getDefault().getPluginPreferences().setValue(PREFERENCE_ATTENTION_MIGRATED, true); >@@ -1010,8 +1009,7 @@ > // reduce interest of children > for (String childHandle : bridge.getChildHandles(element.getHandleIdentifier())) { > IInteractionElement childElement = context.get(childHandle); >- if (childElement != null /*&& childElement.getInterest().isInteresting()*/ >- && !childElement.equals(element)) { >+ if (childElement != null && isAPartOfContext(childElement) && !childElement.equals(element)) { > manipulateInterestForElementHelper(childElement, increment, forceLandmark, > preserveUninteresting, sourceId, context, changedElements, forcedBridge, > isExplicitManipulation); >@@ -1044,6 +1042,14 @@ > return true; > } > >+ private boolean isAPartOfContext(IInteractionElement childElement) { >+ if (childElement instanceof CompositeContextElement) { >+ CompositeContextElement element = (CompositeContextElement) childElement; >+ return element.getNodes() != null && element.getNodes().size() > 0; >+ } >+ return true; >+ } >+ > /** > * Used to migrate old activity to new activity events > * >#P org.eclipse.mylyn.java.tests >Index: src/org/eclipse/mylyn/java/tests/InteractionContextManagerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.java.tests/src/org/eclipse/mylyn/java/tests/InteractionContextManagerTest.java,v >retrieving revision 1.20 >diff -u -r1.20 InteractionContextManagerTest.java >--- src/org/eclipse/mylyn/java/tests/InteractionContextManagerTest.java 8 Jun 2010 23:06:15 -0000 1.20 >+++ src/org/eclipse/mylyn/java/tests/InteractionContextManagerTest.java 8 Sep 2010 22:29:17 -0000 >@@ -26,6 +26,7 @@ > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.jdt.core.IJavaElement; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.IMethod; > import org.eclipse.jdt.core.IPackageFragment; > import org.eclipse.jdt.core.IType; >@@ -572,15 +573,54 @@ > } > } > >+ public void testRemoveProjectFromContextRemovesOnlyInteresting() throws JavaModelException { >+ >+ StubContextElementedDeletedListener listener = new StubContextElementedDeletedListener(); >+ try { >+ manager.addListener(listener); >+ type1.createMethod("void m1() { }", null, true, null); >+ type1.createMethod("void m2() { }", null, true, null); >+ type1.createMethod("void m4() { }", null, true, null); >+ type1.createMethod("void m5() { }", null, true, null); >+ IJavaProject project = type1.getJavaProject(); >+ IInteractionElement node = ContextCore.getContextManager().getElement(project.getHandleIdentifier()); >+ assertFalse(node.getInterest().isInteresting()); >+ >+ InteractionEvent event = new InteractionEvent(InteractionEvent.Kind.MANIPULATION, >+ new JavaStructureBridge().getContentType(), project.getHandleIdentifier(), "source"); >+ IInteractionElement element = ContextCorePlugin.getContextManager().processInteractionEvent(event, true); >+ >+ // test implicit deletion >+ ContextCorePlugin.getContextManager().processInteractionEvent(event, true); >+ assertEquals(0, listener.explicitDeletionEventCount); >+ assertEquals(0, listener.elementCount); >+ >+ // test explicit deletion >+ manager.manipulateInterestForElements(Collections.singletonList(element), false, false, false, "test", >+ ContextCorePlugin.getContextManager().getActiveContext(), true); >+ assertEquals(1, listener.explicitDeletionEventCount); >+ >+ // should have 2 element changes. 1 for resources and 1 for java >+ assertEquals(2, listener.elementCount); >+ >+ } finally { >+ // clean up >+ manager.removeListener(listener); >+ } >+ } >+ > private class StubContextElementedDeletedListener extends AbstractContextListener { > > private int explicitDeletionEventCount; > > private int implicitDeletionEventCount; > >+ private int elementCount; >+ > void reset() { > implicitDeletionEventCount = 0; > explicitDeletionEventCount = 0; >+ elementCount = 0; > } > > @Override >@@ -594,6 +634,7 @@ > } else { > implicitDeletionEventCount++; > } >+ elementCount += event.getElements().size(); > break; > } > }
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
Actions:
View
|
Diff
Attachments on
bug 282436
:
174112
|
178105
|
178106
| 178461 |
178462