Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-11-18 11:17:45 -0500
committerCamille Letavernier2013-11-18 11:17:45 -0500
commit78abd37a54727ae31df5c56b68279fb51d23e1a1 (patch)
treedfa08e607db1f4ea8528d25367a4ab68d8b7ddcb /extraplugins
parentccda2811a197106c52b6721a5b8148fac3106531 (diff)
downloadorg.eclipse.papyrus-78abd37a54727ae31df5c56b68279fb51d23e1a1.tar.gz
org.eclipse.papyrus-78abd37a54727ae31df5c56b68279fb51d23e1a1.tar.xz
org.eclipse.papyrus-78abd37a54727ae31df5c56b68279fb51d23e1a1.zip
354845: [Model Explorer] really slow with a big model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=354845 Integrate contribution from L. Wouters. Clean up code & fix small mistakes Conflicts: Cherry picked from ba4827 in master. One of the plug-ins doesn't exist in Kepler. The files have been excluded from the cherry pick.
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java13
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java11
2 files changed, 15 insertions, 9 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java
index 35221d2ab62..c7eb315ff2c 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java
@@ -37,15 +37,18 @@ public class GetContainedTextEditors extends AbstractEditorContainerQuery implem
* {@inheritDoc}
*/
public Collection<TextEditorModel> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
- List<TextEditorModel> result = new ArrayList<TextEditorModel>(3);
+ List<TextEditorModel> result = new ArrayList<TextEditorModel>();
Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
- if (roots == null)
+ if(roots == null) {
return result;
- while (roots.hasNext()) {
+ }
+
+ while(roots.hasNext()) {
EObject root = roots.next();
- if (root instanceof TextEditorModel) {
- if (EcoreUtil.equals(((TextEditorModel)root).getEditedObject(), context))
+ if(root instanceof TextEditorModel) {
+ if(EcoreUtil.equals(((TextEditorModel)root).getEditedObject(), context)) {
result.add((TextEditorModel)root);
+ }
}
}
return result;
diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java
index 07a423e048f..8aaf591760b 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java
@@ -34,13 +34,16 @@ public class IsTextEditorContainer extends AbstractEditorContainerQuery implemen
*/
public Boolean evaluate(final EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
Iterator<EObject> roots = NavigatorUtils.getNotationRoots(context);
- if (roots == null)
+ if(roots == null) {
return false;
- while (roots.hasNext()) {
+ }
+
+ while(roots.hasNext()) {
EObject root = roots.next();
- if (root instanceof TextEditorModel) {
- if (EcoreUtil.equals(((TextEditorModel)root).getEditedObject(), context))
+ if(root instanceof TextEditorModel) {
+ if(EcoreUtil.equals(((TextEditorModel)root).getEditedObject(), context)) {
return true;
+ }
}
}
return false;

Back to the top