Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-04-18 14:36:33 +0000
committerCamille Letavernier2014-04-18 14:57:22 +0000
commit23e2265a48a1853d23ce6a4959f317bcff47ccf2 (patch)
tree650fd7ef7a5135fc109d625f46f2ceb8e80a0689
parent552ca2fdff5165f9c7569eefa38859351ef39974 (diff)
downloadorg.eclipse.papyrus-23e2265a48a1853d23ce6a4959f317bcff47ccf2.tar.gz
org.eclipse.papyrus-23e2265a48a1853d23ce6a4959f317bcff47ccf2.tar.xz
org.eclipse.papyrus-23e2265a48a1853d23ce6a4959f317bcff47ccf2.zip
430414: [Properties View] StackOverFlow in Reference dialogs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=430414
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java13
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java14
-rw-r--r--tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/AllTests.launch3
-rw-r--r--tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF1
4 files changed, 19 insertions, 12 deletions
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java
index a8ee96e3931..5eda83d86d1 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
- *
+ *
* 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
@@ -66,7 +66,7 @@ public class ProviderBasedBrowseStrategy extends EncapsulatedContentProvider imp
/**
* Filters the valid root elements, ie. the root elements containing
* at least one valid child (Or being valid themselves)
- *
+ *
* @param roots
* @return
*/
@@ -123,7 +123,7 @@ public class ProviderBasedBrowseStrategy extends EncapsulatedContentProvider imp
protected boolean hasOneVisibleChild(Object element, Set<Object> visitedElements) {
if(!visibleChildCache.containsKey(element)) {
boolean result = false;
- if(visitedElements.add(element)) {
+ if(visitedElements.add(getAdaptedValue(element))) {
for(Object child : super.getChildren(element)) {
if(isValid(child, visitedElements)) {
result = true;
@@ -137,6 +137,7 @@ public class ProviderBasedBrowseStrategy extends EncapsulatedContentProvider imp
return visibleChildCache.get(element);
}
+ @Override
public TreePath findPath(Object semanticElement, Object[] rootElements) {
return TreePath.EMPTY; //TODO : Naive search
}
@@ -154,15 +155,15 @@ public class ProviderBasedBrowseStrategy extends EncapsulatedContentProvider imp
/**
* {@inheritDoc}
- *
+ *
* The basic implementation is a naive tree search
- *
+ *
* @param elementToReveal
*/
@Override
public void revealSemanticElement(List<?> elementsToReveal) {
if(viewer != null) {
- //FIXME: TreeViewers cannot do this search when the items have not yet be expanded.
+ //FIXME: TreeViewers cannot do this search when the items have not yet be expanded.
//We need to search on the ContentProvider and pass a TreeSelection to the viewer
viewer.setSelection(new StructuredSelection(elementsToReveal), true);
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java
index 2fb0d32e560..fcd9c8d0156 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 410346
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.providers;
@@ -41,7 +41,7 @@ import org.eclipse.uml2.uml.resource.UMLResource;
/**
* A semantic Hierarchic Content Provider for UML
- *
+ *
* @author Camille Letavernier
*/
public class SemanticUMLContentProvider extends SemanticEMFContentProvider {
@@ -149,6 +149,10 @@ public class SemanticUMLContentProvider extends SemanticEMFContentProvider {
}
protected static boolean isUMLResource(Resource resource) {
+ if(resource == null) {
+ return false;
+ }
+
if(resource instanceof UMLResource) {
return true;
}
@@ -193,7 +197,7 @@ public class SemanticUMLContentProvider extends SemanticEMFContentProvider {
/**
* This method should return either the StereotypeApplication (For Sto - Sto associations),
* or the UML Element (For Sto - UML associations)
- *
+ *
* This depends on the wanted metaclass.
*/
//TODO : In some cases, we may have a filter based on both a UML Metaclass and a Stereotype
@@ -265,7 +269,7 @@ public class SemanticUMLContentProvider extends SemanticEMFContentProvider {
root = null;
roots = null;
}
-
+
if(resourceSet != null) {
resourceSetListener.setTarget(resourceSet);
this.root = resourceSet;
@@ -275,7 +279,7 @@ public class SemanticUMLContentProvider extends SemanticEMFContentProvider {
@Override
public void dispose() {
- if (root != null) {
+ if(root != null) {
resourceSetListener.unsetTarget(root);
}
root = null;
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/AllTests.launch b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/AllTests.launch
index 227d0a6efd9..3b6eaf2190b 100644
--- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/AllTests.launch
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/AllTests.launch
@@ -17,7 +17,7 @@
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-umltools-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.eclipse.papyrus.uml.tools.tests/src/org/eclipse/papyrus/uml/tools/tests/tests/AllTests.java"/>
</listAttribute>
@@ -28,6 +28,7 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.uml.tools.tests.tests.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.uml.tools.tests"/>
diff --git a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF
index 4f88a6973ef..8ebae0c6e79 100644
--- a/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/uml/tools/org.eclipse.papyrus.uml.tools.tests/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.junit.utils;bundle-version="1.0.0",
org.eclipse.emf.transaction;bundle-version="1.4.0",
org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.0.0",
+ org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.0.0",
org.eclipse.papyrus.uml.extensionpoints;bundle-version="1.0.0"
Export-Package: org.eclipse.papyrus.uml.tools.tests,
org.eclipse.papyrus.uml.tools.tests.tests

Back to the top