Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2016-01-13 09:57:07 -0500
committerCamille Letavernier2016-01-18 07:41:09 -0500
commite470aff3493a4d9c00ecaa22cae442625a50e2c5 (patch)
treebc5003fe2aa9d339a68fcfd535c45248c95bb42e /plugins/facet/org.eclipse.papyrus.emf.facet.custom.core
parent1305645a73413c2c73c3e2dad8e99c409279a342 (diff)
downloadorg.eclipse.papyrus-e470aff3493a4d9c00ecaa22cae442625a50e2c5.tar.gz
org.eclipse.papyrus-e470aff3493a4d9c00ecaa22cae442625a50e2c5.tar.xz
org.eclipse.papyrus-e470aff3493a4d9c00ecaa22cae442625a50e2c5.zip
485539: [Performances - Facet Manager] FacetManager recomputes the
Facets for a given element too many times https://bugs.eclipse.org/bugs/show_bug.cgi?id=485539 - Replace the custom property isVisible(EObject, EStructuralFeature) with getVisibleReferences(EObject) and getVisibleAttributes(EObject). This improves performances a lot, especially for complex metamodels such as UML Change-Id: I170b70774b8f6f19ded7fe1e824097b0c5cf7300 Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.core')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java14
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java29
5 files changed, 44 insertions, 9 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath
index 2d1a4302f04..b862a296d38 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..62a08f4494d 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF
index 3c02f96adb6..a8d56779409 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF
@@ -22,4 +22,4 @@ Bundle-Name: %Bundle-Name
Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.core.internal.Activator
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.core;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java
index 297243fe9aa..332ae9dc16e 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/ICustomizationManager.java
@@ -59,7 +59,7 @@ public interface ICustomizationManager {
*/
<T> T getCustomValueOf(EObject eObject,
FacetOperation customProperty, Class<T> classs)
- throws CustomizationException;
+ throws CustomizationException;
/**
* This method is used to get the value of a customization property for a
@@ -78,7 +78,7 @@ public interface ICustomizationManager {
<T> T getCustomValueOf(EObject eObject,
ETypedElement structuralFeature,
FacetOperation customProperty, Class<T> classs)
- throws CustomizationException;
+ throws CustomizationException;
/**
* This method returns the resourceSet used to manage the customization
@@ -88,4 +88,14 @@ public interface ICustomizationManager {
IFacetManager getFacetManager();
+ /**
+ * Multi-valued version of {@link #getCustomValueOf(EObject, FacetOperation, Class)}
+ *
+ * @param eObject
+ * @param visibleReferences
+ * @param class1
+ * @return
+ */
+ <T> List<T> getCustomValuesOf(EObject eObject, FacetOperation customProperty, Class<T> class1) throws CustomizationException;;
+
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java
index bf12983c637..02816817be2 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/CustomizationManager.java
@@ -55,14 +55,16 @@ public class CustomizationManager implements ICustomizationManager {
this.facetManager.getManagedFacetSets().remove(customization);
}
+ @Override
public List<Customization> getManagedCustomizations() {
return new CustomizationsDelegatingList(this.facetManager.getManagedFacetSets());
}
+ @Override
public <T> T getCustomValueOf(final EObject eObject,
final FacetOperation customizationProperty,
final Class<T> classs)
- throws CustomizationException {
+ throws CustomizationException {
// Begin precondition checking section
/*
* The scope of a customization property is not available yet in new customization meta-model
@@ -86,11 +88,12 @@ public class CustomizationManager implements ICustomizationManager {
return result;
}
+ @Override
public <T> T getCustomValueOf(final EObject eObject,
final ETypedElement eTypedElement,
final FacetOperation customizationProperty,
final Class<T> classs)
- throws CustomizationException {
+ throws CustomizationException {
// Begin precondition checking section
if (eObject == null) {
throw new IllegalArgumentException("The parameter 'eObject' must not be null."); //$NON-NLS-1$
@@ -157,6 +160,7 @@ public class CustomizationManager implements ICustomizationManager {
}
}
+ @Override
public ResourceSet getResourceSet() {
return this.facetManager.getResourceSet();
}
@@ -174,7 +178,28 @@ public class CustomizationManager implements ICustomizationManager {
}
}
+ @Override
public IFacetManager getFacetManager() {
return this.facetManager;
}
+
+ /**
+ * @see org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager#getCustomValuesOf(org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation, java.lang.Class)
+ *
+ * @param eObject
+ * @param customProperty
+ * @param class1
+ * @return
+ * @throws CustomizationException
+ */
+ @Override
+ public <T> List<T> getCustomValuesOf(EObject eObject, FacetOperation customizationProperty, Class<T> classs) throws CustomizationException {
+ List<T> result = null;
+ try {
+ result = this.facetManager.getOrInvokeMultiValued(eObject, customizationProperty, classs);
+ } catch (final Exception e) {
+ throw new CustomizationException(e);
+ }
+ return result;
+ }
}

Back to the top