Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-11-18 14:19:15 +0000
committerCamille Letavernier2013-11-18 14:19:15 +0000
commitba4827633bf0d405aa719670a9a66afc070b26a6 (patch)
tree1c403dd4e9cf209bd5b6257682954f7d79defa2f /extraplugins
parentb1016a6d67c1aa22532356683e3eb62942db3d4b (diff)
downloadorg.eclipse.papyrus-ba4827633bf0d405aa719670a9a66afc070b26a6.tar.gz
org.eclipse.papyrus-ba4827633bf0d405aa719670a9a66afc070b26a6.tar.xz
org.eclipse.papyrus-ba4827633bf0d405aa719670a9a66afc070b26a6.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
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