Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-04-28 16:54:12 +0000
committerChristian W. Damus2014-04-28 16:54:31 +0000
commit8d4eb0afc9a65820c06967aef366360b8b60deea (patch)
treed8691c9d31cf8880e6a2b2493e6b1283dd4707e3
parent113c69e9710e09b774d00013a8225ecc4953f866 (diff)
downloadorg.eclipse.papyrus-8d4eb0afc9a65820c06967aef366360b8b60deea.tar.gz
org.eclipse.papyrus-8d4eb0afc9a65820c06967aef366360b8b60deea.tar.xz
org.eclipse.papyrus-8d4eb0afc9a65820c06967aef366360b8b60deea.zip
422257: [Performances] Memory leaks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=422257 Ensure clean-up of scratch resource sets created by the Properties Customization wizard, which leak models in the UML CacheAdapter.
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java20
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java20
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java23
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java9
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java9
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java28
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java34
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java15
-rw-r--r--tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests/src/org/eclipse/papyrus/customization/properties/tests/qvt/TransformationsTests.java19
9 files changed, 126 insertions, 51 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java
index 1a545e909d9..5141bdaa53d 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,14 +8,19 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.extensionpoint;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.papyrus.customization.properties.generation.Activator;
import org.eclipse.papyrus.customization.properties.generation.generators.IGenerator;
-import org.eclipse.papyrus.customization.properties.generation.wizard.CreateContextWizard;
import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
/**
@@ -28,6 +33,8 @@ public class GeneratorExtensionPoint {
private final String EXTENSION_ID = "org.eclipse.papyrus.customization.properties.generation.generator"; //$NON-NLS-1$
+ private final List<IGenerator> generators;
+
/**
* Constructor.
*/
@@ -35,6 +42,7 @@ public class GeneratorExtensionPoint {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+ List<IGenerator> generators = new ArrayList<IGenerator>(2);
for(IConfigurationElement e : config) {
String generatorClassName = e.getAttribute("generator"); //$NON-NLS-1$
IGenerator generator = ClassLoaderHelper.newInstance(generatorClassName, IGenerator.class);
@@ -42,7 +50,13 @@ public class GeneratorExtensionPoint {
Activator.log.warn("Cannot instantiate the generator : " + generatorClassName); //$NON-NLS-1$
continue;
}
- CreateContextWizard.addGenerator(generator);
+ generators.add(generator);
}
+
+ this.generators = Collections.unmodifiableList(generators);
+ }
+
+ public List<IGenerator> getGenerators() {
+ return generators;
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java
index c0eb24f54b4..6ac14193e7c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,14 +8,19 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.extensionpoint;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.papyrus.customization.properties.generation.Activator;
import org.eclipse.papyrus.customization.properties.generation.layout.ILayoutGenerator;
-import org.eclipse.papyrus.customization.properties.generation.wizard.CreateContextWizard;
import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
/**
@@ -28,12 +33,15 @@ public class LayoutExtensionPoint {
private final String EXTENSION_ID = "org.eclipse.papyrus.customization.properties.generation.layout"; //$NON-NLS-1$
+ private final List<ILayoutGenerator> generators;
+
/**
* Constructor.
*/
public LayoutExtensionPoint() {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+ List<ILayoutGenerator> generators = new ArrayList<ILayoutGenerator>(2);
for(IConfigurationElement e : config) {
String generatorClassName = e.getAttribute("generator"); //$NON-NLS-1$
ILayoutGenerator generator = ClassLoaderHelper.newInstance(generatorClassName, ILayoutGenerator.class);
@@ -41,7 +49,13 @@ public class LayoutExtensionPoint {
Activator.log.warn("Cannot instantiate the layout generator : " + generatorClassName); //$NON-NLS-1$
continue;
}
- CreateContextWizard.addLayoutGenerator(generator);
+ generators.add(generator);
}
+
+ this.generators = Collections.unmodifiableList(generators);
+ }
+
+ public List<ILayoutGenerator> getGenerators() {
+ return generators;
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
index ba1e257ae8f..51b96d0289a 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,11 +9,15 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Strategy improvement of generated files
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.generators;
import java.io.IOException;
import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -35,6 +39,7 @@ import org.eclipse.m2m.qvt.oml.ModelExtent;
import org.eclipse.m2m.qvt.oml.TransformationExecutor;
import org.eclipse.m2m.qvt.oml.util.WriterLog;
import org.eclipse.papyrus.customization.properties.generation.Activator;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.views.properties.contexts.Context;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
@@ -61,6 +66,8 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
private Set<Listener> listeners = new HashSet<Listener>();
private int strategy;
+
+ private Collection<ResourceSet> scratchResourceSets;
public List<Context> generate(List<URI> targetURI) {
@@ -80,7 +87,14 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
return generatedContexts;
}
-
+ public void dispose() {
+ if(scratchResourceSets != null) {
+ for(ResourceSet next : scratchResourceSets) {
+ EMFHelper.unload(next);
+ }
+ scratchResourceSets = null;
+ }
+ }
@@ -118,6 +132,11 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
*/
protected EObject loadEMFModel(URI uri) throws IOException {
ResourceSet resourceSet = new ResourceSetImpl();
+ if(scratchResourceSets == null) {
+ scratchResourceSets = new ArrayList<ResourceSet>();
+ }
+ scratchResourceSets.add(resourceSet);
+
try {
Resource resource = resourceSet.getResource(uri, true);
if(resource != null) {
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
index f78798993ee..70533dfb552 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,8 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.generators;
@@ -34,6 +36,11 @@ import org.eclipse.swt.widgets.Listener;
*/
public class EditContextGenerator implements IGenerator {
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
public List<Context> generate(List<URI> targetURI) {
// TODO Auto-generated method stub
return null;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
index 081a4cbbc95..1450b85be98 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,8 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Strategy improvement of generated files
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.generators;
@@ -138,5 +140,10 @@ public interface IGenerator {
public void setStrategy(int strategy);
public void addCheckElement(Object obj);
+
+ /**
+ * Disposes of any resources allocated by me when I am no longer needed.
+ */
+ public void dispose();
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java
index fa064adc65b..abf418c0861 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,10 +9,15 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Add SelectOutputPage
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.wizard;
+import java.util.List;
+
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.papyrus.customization.properties.generation.extensionpoint.GeneratorExtensionPoint;
import org.eclipse.papyrus.customization.properties.generation.generators.IGenerator;
import org.eclipse.papyrus.customization.properties.generation.messages.Messages;
import org.eclipse.swt.SWT;
@@ -35,11 +40,26 @@ public class CreateContextMainPage extends AbstractCreateContextPage implements
private CCombo combo;
+ private final List<IGenerator> generators;
+
/**
* Constructor
*/
public CreateContextMainPage() {
super(Messages.CreateContextMainPage_title);
+
+ generators = new GeneratorExtensionPoint().getGenerators();
+ }
+
+ @Override
+ public void dispose() {
+ try {
+ for(IGenerator next : generators) {
+ next.dispose();
+ }
+ } finally {
+ super.dispose();
+ }
}
public void createControl(Composite parent) {
@@ -47,7 +67,7 @@ public class CreateContextMainPage extends AbstractCreateContextPage implements
root.setLayout(new GridLayout(1, false));
combo = new CCombo(root, SWT.BORDER);
- for(IGenerator generator : CreateContextWizard.contextGenerators) {
+ for(IGenerator generator : generators) {
combo.add(generator.getName());
}
combo.setEditable(false);
@@ -63,8 +83,8 @@ public class CreateContextMainPage extends AbstractCreateContextPage implements
@Override
public IWizardPage getNextPage() {
int selection = combo.getSelectionIndex();
- getWizard().setGenerator(CreateContextWizard.contextGenerators.get(selection));
-// getWizard().generatorPage.clearTarget();
+ getWizard().setGenerator(generators.get(selection));
+ // getWizard().generatorPage.clearTarget();
return getWizard().generatorPage;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
index 4650c11218b..6c11474f5f5 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.wizard;
@@ -66,16 +68,6 @@ public class CreateContextWizard extends Wizard implements INewWizard {
protected SelectFieldsPage selectFieldsPage;
/**
- * All available context generators
- */
- protected static List<IGenerator> contextGenerators = new LinkedList<IGenerator>();
-
- /**
- * All available layout generators
- */
- protected static List<ILayoutGenerator> layoutGenerators = new LinkedList<ILayoutGenerator>();
-
- /**
* The generated contexts
*/
protected List<Context> contexts;
@@ -316,24 +308,4 @@ public class CreateContextWizard extends Wizard implements INewWizard {
}
}
- /**
- * Registers a new context Generator for the CreateContextWizard
- *
- * @param generator
- * The IGenerator to register
- */
- public static void addGenerator(IGenerator generator) {
- contextGenerators.add(generator);
- }
-
- /**
- * Registers a new Layout Generator for the CreateContextWizard
- *
- * @param generator
- * The ILayoutGenerator to register
- */
- public static void addLayoutGenerator(ILayoutGenerator generator) {
- layoutGenerators.add(generator);
- }
-
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
index 620e6079ddb..1410738921f 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,9 +9,13 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Strategy improvement of generated files
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.wizard;
+import java.util.List;
+
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
@@ -23,6 +27,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.common.util.URI;
import org.eclipse.jface.databinding.wizard.WizardPageSupport;
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.papyrus.customization.properties.generation.extensionpoint.LayoutExtensionPoint;
import org.eclipse.papyrus.customization.properties.generation.generators.IGenerator;
import org.eclipse.papyrus.customization.properties.generation.layout.ILayoutGenerator;
import org.eclipse.papyrus.customization.properties.generation.messages.Messages;
@@ -49,6 +54,8 @@ import org.eclipse.swt.widgets.Listener;
*/
public class GeneratorPage extends AbstractCreateContextPage implements Listener {
+ private final List<ILayoutGenerator> layoutGenerators;
+
protected IGenerator generator;
private Composite root, generatorControl;
@@ -85,6 +92,8 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
ctx = new DataBindingContext();
srcFieldStrategy = new UpdateValueStrategy();
targetFieldStrategy = new UpdateValueStrategy();
+
+ layoutGenerators = new LayoutExtensionPoint().getGenerators();
}
/**
@@ -140,7 +149,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
layoutCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
layoutCombo.setEditable(false);
layoutCombo.setBackground(new Color(layoutCombo.getDisplay(), 255, 255, 255));
- for(ILayoutGenerator layoutGenerator : CreateContextWizard.layoutGenerators) {
+ for(ILayoutGenerator layoutGenerator : layoutGenerators) {
layoutCombo.add(layoutGenerator.getName());
}
layoutCombo.select(0);
@@ -248,7 +257,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
@Override
public IWizardPage getNextPage() {
int selection = layoutCombo.getSelectionIndex();
- getWizard().layoutGenerator = CreateContextWizard.layoutGenerators.get(selection);
+ getWizard().layoutGenerator = layoutGenerators.get(selection);
oldURI = URI.createPlatformResourceURI(targetFileChooser.getFilePath(), true);
return super.getNextPage();
diff --git a/tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests/src/org/eclipse/papyrus/customization/properties/tests/qvt/TransformationsTests.java b/tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests/src/org/eclipse/papyrus/customization/properties/tests/qvt/TransformationsTests.java
index 7a26f1a8c3b..bdb78818e09 100644
--- a/tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests/src/org/eclipse/papyrus/customization/properties/tests/qvt/TransformationsTests.java
+++ b/tests/junit/plugins/customization/org.eclipse.papyrus.customization.properties.tests/src/org/eclipse/papyrus/customization/properties/tests/qvt/TransformationsTests.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 422257
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.tests.qvt;
@@ -40,6 +42,7 @@ import org.eclipse.papyrus.views.properties.root.PropertiesRoot;
import org.eclipse.papyrus.views.properties.runtime.ConfigurationManager;
import org.eclipse.papyrus.views.properties.ui.CompositeWidget;
import org.eclipse.uml2.uml.Profile;
+import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -59,6 +62,8 @@ public class TransformationsTests extends AbstractPapyrusTest {
private static IProject targetProject;
+ private IGenerator generator;
+
@BeforeClass
public static void init() throws CoreException {
targetProject = ProjectUtils.createProject(Activator.PLUGIN_ID + ".testProject");
@@ -70,6 +75,14 @@ public class TransformationsTests extends AbstractPapyrusTest {
targetProject.delete(true, new NullProgressMonitor());
}
+ @After
+ public void disposeFixture() {
+ if(generator != null) {
+ generator.dispose();
+ generator = null;
+ }
+ }
+
@Test
public void handleXWTFileFromResource() {
//From an XWT Resource
@@ -113,7 +126,7 @@ public class TransformationsTests extends AbstractPapyrusTest {
public void generateEcoreContext() {
final URI packageURI = URI.createPlatformPluginURI(Activator.PLUGIN_ID + "/resources/Sample.ecore", false);
- IGenerator generator = new EcoreGenerator() {
+ generator = new EcoreGenerator() {
//FIXME: The EcoreGenerator is currently not built to be used programmatically; we need to override it to test it.
@@ -174,7 +187,7 @@ public class TransformationsTests extends AbstractPapyrusTest {
//FIXME: The ProfileGenerator is currently not built to be used programmatically; we need to override it to test it.
- IGenerator generator = new ProfileGenerator() {
+ generator = new ProfileGenerator() {
@Override
protected List<ModelExtent> getModelExtents() {

Back to the top