From 6dc30b0740832431deaab54458c028c0bf91e8b2 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 14:27:44 +0100 Subject: [PATCH 1/8] #168: next snapshot version set --- cobigen-eclipse/cobigen-eclipse-feature/feature.xml | 2 +- cobigen-eclipse/cobigen-eclipse-feature/pom.xml | 2 +- cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml | 2 +- cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF | 2 +- cobigen-eclipse/cobigen-eclipse/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cobigen-eclipse/cobigen-eclipse-feature/feature.xml b/cobigen-eclipse/cobigen-eclipse-feature/feature.xml index 99ac279dfe..830c126170 100644 --- a/cobigen-eclipse/cobigen-eclipse-feature/feature.xml +++ b/cobigen-eclipse/cobigen-eclipse-feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/cobigen-eclipse/cobigen-eclipse-feature/pom.xml b/cobigen-eclipse/cobigen-eclipse-feature/pom.xml index 0d2bd33649..51a7b43e70 100644 --- a/cobigen-eclipse/cobigen-eclipse-feature/pom.xml +++ b/cobigen-eclipse/cobigen-eclipse-feature/pom.xml @@ -6,7 +6,7 @@ cobigen-eclipse-feature CobiGen - Eclipse Plug-In Feature eclipse-feature - 1.4.1 + 1.4.2-SNAPSHOT com.capgemini diff --git a/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml b/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml index 70a1df6509..47b2169bfa 100644 --- a/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml +++ b/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml @@ -5,7 +5,7 @@ com.capgemini cobigen-eclipse-updatesite CobiGen - Eclipse Plug-In UpdateSite - 1.4.1 + 1.4.2-SNAPSHOT eclipse-repository diff --git a/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF b/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF index a6abacb43f..1902159d51 100644 --- a/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF +++ b/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CobiGen Eclipse Plug-In Bundle-SymbolicName: cobigen-eclipse;singleton:=true -Bundle-Version: 1.4.1 +Bundle-Version: 1.4.2.qualifier Bundle-Activator: com.capgemini.cobigen.eclipse.Activator Bundle-Vendor: Capgemini Require-Bundle: org.eclipse.ui;bundle-version="3.104.0", diff --git a/cobigen-eclipse/cobigen-eclipse/pom.xml b/cobigen-eclipse/cobigen-eclipse/pom.xml index 966f879ba4..52b45a581e 100644 --- a/cobigen-eclipse/cobigen-eclipse/pom.xml +++ b/cobigen-eclipse/cobigen-eclipse/pom.xml @@ -6,7 +6,7 @@ cobigen-eclipse CobiGen - Eclipse Plug-In eclipse-plugin - 1.4.1 + 1.4.2-SNAPSHOT com.capgemini From 169aa7afccd5229c44f8ee35e61523c13ec169d1 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 15:12:45 +0100 Subject: [PATCH 2/8] #177: exception handling reworked to match new scenarios introduced by #156 --- .../exceptions/NotYetSupportedException.java | 24 ---------------- .../eclipse/generator/CobiGenWrapper.java | 6 +++- .../generator/GeneratorWrapperFactory.java | 28 +++++++++++++------ .../generator/java/JavaGeneratorWrapper.java | 3 +- .../eclipse/healthcheck/HealthCheck.java | 21 +++++++++----- .../AbstractGenerateSelectionProcess.java | 5 ---- .../handler/GenerateHandler.java | 17 ++++++++--- .../handler/HealthCheckHandler.java | 8 +++++- 8 files changed, 59 insertions(+), 53 deletions(-) delete mode 100644 cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/NotYetSupportedException.java diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/NotYetSupportedException.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/NotYetSupportedException.java deleted file mode 100644 index 33769068d7..0000000000 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/NotYetSupportedException.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.capgemini.cobigen.eclipse.common.exceptions; - -/** - * States that any logic has been triggered, which is currently not supported - * @author mbrunnli (17.10.2014) - */ -public class NotYetSupportedException extends RuntimeException { - - /** - * Default serial version UID - */ - private static final long serialVersionUID = 1L; - - /** - * Creates a new {@link NotYetSupportedException} with the given Message - * @param msg - * error message - * @author mbrunnli (17.10.2014) - */ - public NotYetSupportedException(String msg) { - super(msg + "\nPlease state a feature request on GitHub if you need further support."); - } - -} diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java index 7759b0ae59..1baa91a2f5 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java @@ -420,7 +420,11 @@ public List getMatchingTriggerIds(Object loadClass) { /** * Checks if the selected items are supported by one or more {@link Trigger}s, and if they are supported - * by the same {@link Trigger}s + * by the same {@link Trigger}s. Returns a boolean value, if all objects of the selection could be + * processed. If there are objects, which are not yet supported as inputs for generation, or the selection + * in composed of valid objects in an not yet supported way, an {@link InvalidInputException} will be + * thrown. Thus, getting a boolean value can be interpreted as + * "selection supported, but currently not matching trigger". * * @param selection * the selection made diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java index a2be81738d..cc8d8af855 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java @@ -15,7 +15,7 @@ import com.capgemini.cobigen.eclipse.common.exceptions.GeneratorCreationException; import com.capgemini.cobigen.eclipse.common.exceptions.GeneratorProjectNotExistentException; -import com.capgemini.cobigen.eclipse.common.exceptions.NotYetSupportedException; +import com.capgemini.cobigen.eclipse.common.exceptions.InvalidInputException; import com.capgemini.cobigen.eclipse.generator.java.JavaGeneratorWrapper; import com.capgemini.cobigen.eclipse.generator.java.JavaInputConverter; import com.capgemini.cobigen.eclipse.generator.xml.XmlGeneratorWrapper; @@ -41,10 +41,13 @@ public class GeneratorWrapperFactory { * if any exception occurred during converting the inputs or creating the generator * @throws GeneratorProjectNotExistentException * if the generator configuration project does not exist + * @throws InvalidInputException + * if the selection includes non supported input types or is composed in a non supported + * combination of inputs. * @author mbrunnli (04.12.2014) */ public static CobiGenWrapper createGenerator(IStructuredSelection selection) - throws GeneratorCreationException, GeneratorProjectNotExistentException { + throws GeneratorCreationException, GeneratorProjectNotExistentException, InvalidInputException { List extractedInputs = extractValidEclipseInputs(selection); if (extractedInputs.size() > 0) { @@ -75,7 +78,7 @@ public static CobiGenWrapper createGenerator(IStructuredSelection selection) /** * Extracts a list of valid eclipse inputs. Therefore this method will throw an - * {@link NotYetSupportedException},whenever
+ * {@link InvalidInputException},whenever
*
    *
  • the selection contains different content types
  • *
  • the selection contains a content type, which is currently not supported
  • @@ -84,9 +87,13 @@ public static CobiGenWrapper createGenerator(IStructuredSelection selection) * current {@link IStructuredSelection selection} of within the IDE * @return the {@link List} of selected objects, whereas all elements of the list are of the same content * type + * @throws InvalidInputException + * if the selection includes non supported input types or is composed in a non supported + * combination of inputs. * @author mbrunnli (04.12.2014) */ - public static List extractValidEclipseInputs(IStructuredSelection selection) { + public static List extractValidEclipseInputs(IStructuredSelection selection) + throws InvalidInputException { int type = 0; boolean initialized = false; List inputObjects = Lists.newLinkedList(); @@ -103,7 +110,7 @@ public static List extractValidEclipseInputs(IStructuredSelection select inputObjects.add(o); initialized = true; } else if (initialized) { - throw new NotYetSupportedException( + throw new InvalidInputException( "Multiple different inputs have been selected of the following types: " + ICompilationUnit.class + ", " + o.getClass()); } @@ -117,7 +124,7 @@ public static List extractValidEclipseInputs(IStructuredSelection select inputObjects.add(o); initialized = true; } else if (initialized) { - throw new NotYetSupportedException( + throw new InvalidInputException( "Multiple different inputs have been selected of the following types: " + IPackageFragment.class + ", " + o.getClass()); } @@ -131,7 +138,7 @@ public static List extractValidEclipseInputs(IStructuredSelection select inputObjects.add(o); initialized = true; } else if (initialized) { - throw new NotYetSupportedException( + throw new InvalidInputException( "Multiple different inputs have been selected of the following types: " + IFile.class + ", " + o.getClass()); } @@ -141,8 +148,11 @@ public static List extractValidEclipseInputs(IStructuredSelection select } //$FALL-THROUGH$ default: - throw new NotYetSupportedException("An input of the type " + o.getClass().toString() - + " has been forwarded an input for generation but it is not yet supported!"); + throw new InvalidInputException( + "Your selection contains an object of the type " + + o.getClass().toString() + + ", which is not yet supported to be treated as an input for generation.\n" + + "Please adjust your selection to only contain supported objects like Java classes/packages or XML files."); } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java index f5e2e0a19f..835ff16c21 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java @@ -158,8 +158,7 @@ public boolean isValidInput(IStructuredSelection selection) throws InvalidInputE if (uniqueSourceSelected && selection.size() > 1) { throw new InvalidInputException( - "You selected at least one input in a mass-selection," - + " which type is currently not supported for batch processing. " + "You selected at least one input, which type is currently not supported for batch processing.\n " + "Please just select multiple inputs only if batch processing is supported for all inputs."); } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/healthcheck/HealthCheck.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/healthcheck/HealthCheck.java index fd8fa7a207..0e0167b3c5 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/healthcheck/HealthCheck.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/healthcheck/HealthCheck.java @@ -8,6 +8,8 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Display; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.capgemini.cobigen.config.constant.ConfigurationConstants; import com.capgemini.cobigen.config.constant.ContextConfigurationVersion; @@ -30,6 +32,9 @@ */ public class HealthCheck { + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(HealthCheck.class); + /** Dialog title of the Health Check */ private static final String HEALTH_CHECK_DIALOG_TITLE = "Health Check"; @@ -51,14 +56,15 @@ public void execute(final ISelection selection) { IProject generatorConfProj = null; try { generatorConfProj = ResourcesPluginUtil.getGeneratorConfigurationProject(); - CobiGenWrapper cobiGenWrapper = - GeneratorWrapperFactory.createGenerator((IStructuredSelection) selection); healthyCheckMessage = firstStep + "OK."; healthyCheckMessage += secondStep + "OK."; healthyCheckMessage += "\n3. Check validity of current selection... "; if (selection instanceof IStructuredSelection) { try { + CobiGenWrapper cobiGenWrapper = + GeneratorWrapperFactory.createGenerator((IStructuredSelection) selection); + if (cobiGenWrapper.isValidInput((IStructuredSelection) selection)) { healthyCheckMessage += "OK."; openSuccessDialog(healthyCheckMessage, false); @@ -80,9 +86,9 @@ public void execute(final ISelection selection) { } } catch (GeneratorProjectNotExistentException e) { healthyCheckMessage = - firstStep + "NOT FOUND IN WORKSPACE!\n" - + "=> Please import the configuration project as stated in the documentation of CobiGen" - + " or in the one of your project."; + firstStep + "NOT FOUND!\n" + + "=> Please import the configuration project into your workspace as stated in the " + + "documentation of CobiGen or in the one of your project."; PlatformUIUtil.openErrorDialog(HEALTH_CHECK_DIALOG_TITLE, healthyCheckMessage, null); } catch (InvalidConfigurationException e) { healthyCheckMessage = firstStep + "OK."; @@ -114,12 +120,13 @@ public void run() { + "Maybe just a mistake in the context configuration?"; healthyCheckMessage += "\n\n=> " + e.getLocalizedMessage(); } - } PlatformUIUtil.openErrorDialog(HEALTH_CHECK_DIALOG_TITLE, healthyCheckMessage, null); + LOG.warn(healthyCheckMessage, e); } catch (Throwable e) { - healthyCheckMessage = "An unexpected error occurred while loading CobiGen! "; + healthyCheckMessage = "An unexpected error occurred!"; PlatformUIUtil.openErrorDialog(HEALTH_CHECK_DIALOG_TITLE, healthyCheckMessage, e); + LOG.error(healthyCheckMessage, e); } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java index ff2874e6a0..44fbf300ef 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java @@ -29,7 +29,6 @@ import org.slf4j.MDC; import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; -import com.capgemini.cobigen.eclipse.common.exceptions.NotYetSupportedException; import com.capgemini.cobigen.eclipse.common.tools.PlatformUIUtil; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.exceptions.PluginProcessingException; @@ -124,10 +123,6 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte PlatformUIUtil.openErrorDialog("Plug-in Processing Exception", "A plug-in caused an unhandled exception:\n", e); LOG.error("A plug-in caused an unhandled exception:\n{}", e.getMessage(), e); - } catch (NotYetSupportedException e) { - PlatformUIUtil.openErrorDialog("Not yet supported!", - "An unsupported operation has been triggered", e); - LOG.warn("An unsupported operation has been triggered:\n{}", e.getMessage(), e); } catch (Throwable e) { PlatformUIUtil.openErrorDialog("Error", "An unexpected exception occurred!", e); LOG.error("An unexpected exception occurred!", e); diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java index 04ecd67af1..ca56327a67 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java @@ -50,7 +50,7 @@ public class GenerateHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); - LOG.debug("on click Event? " + event.getClass().getName()); + LOG.debug("Generate command triggered."); ISelection sel = HandlerUtil.getCurrentSelection(event); @@ -62,12 +62,20 @@ public Object execute(ExecutionEvent event) throws ExecutionException { try { CobiGenWrapper generator = GeneratorWrapperFactory.createGenerator((IStructuredSelection) sel); - if (generator == null || !generator.isValidInput((IStructuredSelection) sel)) { + if (generator == null) { MessageDialog.openError(HandlerUtil.getActiveShell(event), "Not yet supported!", "The current selection is currently not supported as valid input."); return null; } + if (!generator.isValidInput((IStructuredSelection) sel)) { + MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "No matching Trigger!", + "Your current selection is not valid as input for any generation purpose. " + + "Please find the specification of valid inputs in the context configuration ('" + + ResourceConstants.CONFIG_PROJECT_NAME + "/context.xml')."); + return null; + } + if (((IStructuredSelection) sel).size() > 1 || (((IStructuredSelection) sel).size() == 1) && ((IStructuredSelection) sel).getFirstElement() instanceof IPackageFragment) { WizardDialog wiz = @@ -109,8 +117,9 @@ public Object execute(ExecutionEvent event) throws ExecutionException { PlatformUIUtil.openErrorDialog("Error", "Could not create an instance of the generator!", e); LOG.error("Could not create an instance of the generator.", e); } catch (InvalidInputException e) { - PlatformUIUtil.openErrorDialog("Error", "Invalid selection: " + e.getMessage(), e); - LOG.error("Invalid Configuration", e); + MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Invalid selection", + e.getMessage()); + LOG.info("Invalid input selected for generation: " + e.getMessage()); } catch (Throwable e) { PlatformUIUtil.openErrorDialog("Error", "An unexpected exception occurred!", e); LOG.error("An unexpected exception occurred!", e); diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/HealthCheckHandler.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/HealthCheckHandler.java index 895187a259..1edbe823f5 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/HealthCheckHandler.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/HealthCheckHandler.java @@ -6,6 +6,8 @@ import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.ui.handlers.HandlerUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.slf4j.MDC; import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; @@ -19,6 +21,9 @@ */ public class HealthCheckHandler extends AbstractHandler { + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(HealthCheckHandler.class); + /** * {@inheritDoc} * @author mbrunnli (Jun 16, 2015) @@ -30,8 +35,9 @@ public Object execute(final ExecutionEvent event) throws ExecutionException { try { new HealthCheck().execute(HandlerUtil.getCurrentSelection(event)); } catch (Throwable e) { + LOG.error("An unexpected error occurred while processing the health check. This is a bug.", e); PlatformUIUtil.openErrorDialog("Error", - "An unexpected error occurred while processing the health check. This is a bug.", e); + "An unexpected error occurred while processing the health check. This might be a bug.", e); } MDC.remove(InfrastructureConstants.CORRELATION_ID); From f8793d4e8fa47b2ad07d69e4596479a4cdc9adf9 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 15:40:49 +0100 Subject: [PATCH 3/8] #88: generation monitored process will now be performed beside the ui thread as intended. --- .../eclipse/common/tools/PlatformUIUtil.java | 20 +++++++++++------- .../wizard/generate/GenerateBatchWizard.java | 10 ++++----- .../wizard/generate/GenerateWizard.java | 4 ++-- .../AbstractGenerateSelectionProcess.java | 21 ++++++++----------- .../GenerateBatchSelectionProcess.java | 13 ++++-------- .../control/GenerateSelectionProcess.java | 8 ++----- 6 files changed, 35 insertions(+), 41 deletions(-) diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/tools/PlatformUIUtil.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/tools/PlatformUIUtil.java index f378c9e23f..fddc66c9e4 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/tools/PlatformUIUtil.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/tools/PlatformUIUtil.java @@ -70,13 +70,19 @@ public static IWorkbenchPage getActiveWorkbenchPage() { * of the error or null if the error was not caused by any {@link Throwable} * @author mbrunnli (Jun 23, 2015) */ - public static void openErrorDialog(String dialogTitle, String message, Throwable cause) { - if (cause == null) { - MessageDialog.openError(Display.getDefault().getActiveShell(), dialogTitle, message); - } else { - ErrorDialog.openError(Display.getDefault().getActiveShell(), dialogTitle, message, - createMultiStatus(cause)); - } + public static void openErrorDialog(final String dialogTitle, final String message, final Throwable cause) { + + getWorkbench().getDisplay().syncExec(new Runnable() { + @Override + public void run() { + if (cause == null) { + MessageDialog.openError(Display.getDefault().getActiveShell(), dialogTitle, message); + } else { + ErrorDialog.openError(Display.getDefault().getActiveShell(), dialogTitle, message, + createMultiStatus(cause)); + } + } + }); } /** diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java index a387e85e89..024ecb3c37 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java @@ -98,15 +98,15 @@ protected void generateContents(ProgressMonitorDialog dialog) { GenerateBatchSelectionProcess job; if (container == null) { job = - new GenerateBatchSelectionProcess(getShell(), cobigenWrapper, - cobigenWrapper.getTemplates(templateIds), inputTypes); + new GenerateBatchSelectionProcess(cobigenWrapper, cobigenWrapper.getTemplates(templateIds), + inputTypes); } else { job = - new GenerateBatchSelectionProcess(getShell(), cobigenWrapper, - cobigenWrapper.getTemplates(templateIds), container); + new GenerateBatchSelectionProcess(cobigenWrapper, cobigenWrapper.getTemplates(templateIds), + container); } try { - dialog.run(false, false, job); + dialog.run(true, false, job); } catch (InvocationTargetException e) { LOG.error("An internal error occured while invoking the generation batch job.", e); } catch (InterruptedException e) { diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java index d35eaffc8f..f870c5a830 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java @@ -91,9 +91,9 @@ protected void generateContents(ProgressMonitorDialog dialog) { } GenerateSelectionProcess job = - new GenerateSelectionProcess(getShell(), cobigenWrapper, page1.getTemplatesToBeGenerated()); + new GenerateSelectionProcess(cobigenWrapper, page1.getTemplatesToBeGenerated()); try { - dialog.run(false, false, job); + dialog.run(true, false, job); } catch (InvocationTargetException e) { LOG.error("An internal error occured while invoking the generation job.", e); } catch (InterruptedException e) { diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java index 44fbf300ef..2cfedadd4e 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java @@ -22,7 +22,6 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchPartSite; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,11 +46,6 @@ public abstract class AbstractGenerateSelectionProcess implements IRunnableWithP */ protected final Logger LOG = LoggerFactory.getLogger(getClass()); - /** - * {@link Shell} on which to display error messages - */ - private Shell shell; - /** * Generator instance with which to generate the contents */ @@ -65,17 +59,14 @@ public abstract class AbstractGenerateSelectionProcess implements IRunnableWithP /** * Sets the given properties and make them accessible for sub types * - * @param shell - * on which to display error messages * @param cobigenWrapper * with which to generate the contents * @param templatesToBeGenerated * {@link Set} of template ids to be generated */ - public AbstractGenerateSelectionProcess(Shell shell, CobiGenWrapper cobigenWrapper, + public AbstractGenerateSelectionProcess(CobiGenWrapper cobigenWrapper, List templatesToBeGenerated) { - this.shell = shell; this.cobigenWrapper = cobigenWrapper; this.templatesToBeGenerated = templatesToBeGenerated; } @@ -111,8 +102,14 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte formatSourceCode(cus); } - MessageDialog.openInformation(shell, "Success!", "Contents from " + templatesToBeGenerated.size() - + " templates have been generated."); + PlatformUIUtil.getWorkbench().getDisplay().syncExec(new Runnable() { + @Override + public void run() { + MessageDialog.openInformation( + PlatformUIUtil.getWorkbench().getDisplay().getActiveShell(), "Success!", + "Contents from " + templatesToBeGenerated.size() + " templates have been generated."); + } + }); } catch (CoreException e) { PlatformUIUtil.openErrorDialog("Eclipse internal Exception", diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java index 229c2ad055..07d6b8a2d8 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java @@ -8,7 +8,6 @@ import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.swt.widgets.Shell; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.extension.to.TemplateTo; @@ -34,8 +33,6 @@ public class GenerateBatchSelectionProcess extends AbstractGenerateSelectionProc /** * Creates a new process ({@link IRunnableWithProgress}) for performing the generation tasks * - * @param shell - * on which to display error messages * @param javaGeneratorWrapper * with which to generate the contents * @param templatesToBeGenerated @@ -45,18 +42,16 @@ public class GenerateBatchSelectionProcess extends AbstractGenerateSelectionProc * * @author trippl (22.04.2013) */ - public GenerateBatchSelectionProcess(Shell shell, CobiGenWrapper javaGeneratorWrapper, + public GenerateBatchSelectionProcess(CobiGenWrapper javaGeneratorWrapper, List templatesToBeGenerated, List inputTypes) { - super(shell, javaGeneratorWrapper, templatesToBeGenerated); + super(javaGeneratorWrapper, templatesToBeGenerated); this.inputTypes = inputTypes; } /** * Creates a new process ({@link IRunnableWithProgress}) for performing the generation tasks * - * @param shell - * on which to display error messages * @param javaGeneratorWrapper * with which to generate the contents * @param templatesToBeGenerated @@ -65,10 +60,10 @@ public GenerateBatchSelectionProcess(Shell shell, CobiGenWrapper javaGeneratorWr * selected {@link IPackageFragment} for the generation * @author mbrunnli (04.06.2014) */ - public GenerateBatchSelectionProcess(Shell shell, CobiGenWrapper javaGeneratorWrapper, + public GenerateBatchSelectionProcess(CobiGenWrapper javaGeneratorWrapper, List templatesToBeGenerated, IPackageFragment container) { - super(shell, javaGeneratorWrapper, templatesToBeGenerated); + super(javaGeneratorWrapper, templatesToBeGenerated); this.container = container; } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java index 0e2dfa878a..5ab2060af3 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java @@ -8,7 +8,6 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.swt.widgets.Shell; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.extension.to.TemplateTo; @@ -24,18 +23,15 @@ public class GenerateSelectionProcess extends AbstractGenerateSelectionProcess { /** * Creates a new process ({@link IRunnableWithProgress}) for performing the generation tasks * - * @param shell - * on which to display error messages * @param cobigenWrapper * with which to generate the contents * @param templatesToBeGenerated * {@link Set} of templates to be generated * @author mbrunnli (12.03.2013) */ - public GenerateSelectionProcess(Shell shell, CobiGenWrapper cobigenWrapper, - List templatesToBeGenerated) { + public GenerateSelectionProcess(CobiGenWrapper cobigenWrapper, List templatesToBeGenerated) { - super(shell, cobigenWrapper, templatesToBeGenerated); + super(cobigenWrapper, templatesToBeGenerated); } /** From e20a7a68075cc1499c3baabc67cde97b68b032e1 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 16:51:10 +0100 Subject: [PATCH 4/8] #178: register logback configuration listener whenever the cobigen configuration listener will be registered or the configuration folder is opened/imported --- .../ConfigurationProjectListener.java | 65 +++++++++++-------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/ConfigurationProjectListener.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/ConfigurationProjectListener.java index 18e9d66f3c..5487fa617d 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/ConfigurationProjectListener.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/ConfigurationProjectListener.java @@ -15,7 +15,9 @@ import com.capgemini.cobigen.eclipse.common.constants.ResourceConstants; /** - * {@link ConfigurationProjectListener} for starting / stopping the {@link LogbackConfigChangeListener} + * {@link ConfigurationProjectListener} for starting / stopping the {@link LogbackConfigChangeListener}. This + * class is an abstract, due to the potential need of having multiple nested {@link IResourceChangeListener} + * for the CobiGen configuration. * @author mbrunnli (08.04.2013) */ public class ConfigurationProjectListener implements IResourceChangeListener { @@ -23,11 +25,6 @@ public class ConfigurationProjectListener implements IResourceChangeListener { /** Logger instance. */ private static final Logger LOG = LoggerFactory.getLogger(ConfigurationProjectListener.class); - /** - * Checks whether the given {@link IResourceChangeEvent} has closed the generator configuration project - */ - private boolean closedBefore = false; - /** * Resource change listener for the logback configuration. */ @@ -38,6 +35,19 @@ public class ConfigurationProjectListener implements IResourceChangeListener { */ private Object logbackConfigListenerSync = new Object(); + /** + * Initializes the {@link ConfigurationProjectListener} by registering all nested resource listener if the + * folder already exists. + * @author mbrunnli (Jan 10, 2016) + */ + public ConfigurationProjectListener() { + IProject cobigenConfigProject = + ResourcesPlugin.getWorkspace().getRoot().getProject(ResourceConstants.CONFIG_PROJECT_NAME); + if (cobigenConfigProject.exists() && cobigenConfigProject.isOpen()) { + registerLogbackConfigListenerIfNotAlreadyDone(cobigenConfigProject); + } + } + /** * {@inheritDoc} * @author mbrunnli (08.04.2013), updated by sholzer (29.09.2015) for issue #156 @@ -53,41 +63,44 @@ public void resourceChanged(IResourceChangeEvent event) { if (event.getResource() instanceof IProject) { IProject proj = (IProject) event.getResource(); if (proj.getName().equals(ResourceConstants.CONFIG_PROJECT_NAME)) { - closedBefore = true; + synchronized (logbackConfigListenerSync) { + ResourcesPlugin.getWorkspace().removeResourceChangeListener(logbackConfigListener); + logbackConfigListener = null; + LOG.info("Logback configuration listener unregistered."); + } } } } - // ////////////// - // POST_CLOSE // - // ////////////// - if (event.getType() == IResourceChangeEvent.POST_BUILD && closedBefore) { - closedBefore = false; - synchronized (logbackConfigListenerSync) { - ResourcesPlugin.getWorkspace().removeResourceChangeListener(logbackConfigListener); - logbackConfigListener = null; - LOG.info("Logback configuration listener registered."); - } - } - // ////////////// // POST_CHANGE // // ////////////// - if (event.getType() == IResourceChangeEvent.POST_CHANGE) { // TODO probably not necessary anymore + if (event.getType() == IResourceChangeEvent.POST_CHANGE) { IResourceDelta[] affectedProjects = event.getDelta().getAffectedChildren(IResourceDelta.CHANGED); for (IResourceDelta projDelta : affectedProjects) { if (projDelta.getResource() instanceof IProject && projDelta.getResource().getName().equals(ResourceConstants.CONFIG_PROJECT_NAME)) { - synchronized (logbackConfigListenerSync) { - logbackConfigListener = - new LogbackConfigChangeListener(((IProject) projDelta.getResource())); - ResourcesPlugin.getWorkspace().addResourceChangeListener(logbackConfigListener); - LOG.info("Logback configuration listener unregistered."); - } + registerLogbackConfigListenerIfNotAlreadyDone((IProject) projDelta.getResource()); } } } MDC.remove(InfrastructureConstants.CORRELATION_ID); } + + /** + * Registers the {@link LogbackConfigChangeListener} if not already set + * @param cobigenConfigFolder + * CobiGens configuration project in the workspace + * @author mbrunnli (Jan 10, 2016) + */ + private void registerLogbackConfigListenerIfNotAlreadyDone(IProject cobigenConfigFolder) { + synchronized (logbackConfigListenerSync) { + if (logbackConfigListener == null) { + logbackConfigListener = new LogbackConfigChangeListener(cobigenConfigFolder); + ResourcesPlugin.getWorkspace().addResourceChangeListener(logbackConfigListener); + } + LOG.info("Logback configuration listener registered."); + } + } } From 9b6f1f8e5bc72e125f3a324e54a6c23cf74156fe Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 21:29:08 +0100 Subject: [PATCH 5/8] #88: long running jobs removed from ui thread --- .../capgemini/cobigen/eclipse/Activator.java | 6 + .../eclipse/common/AbstractCobiGenJob.java | 33 ++++++ .../CobiGenEclipseRuntimeException.java | 26 +++++ .../eclipse/generator/AnalyzeInputJob.java | 104 ++++++++++++++++++ .../eclipse/generator/CobiGenWrapper.java | 35 +++++- .../wizard/common/DetermineTemplatesJob.java | 83 ++++++++++++++ .../wizard/common/SelectFilesPage.java | 35 +++++- .../common/control/CheckStateListener.java | 19 +++- .../wizard/generate/GenerateBatchWizard.java | 8 +- .../wizard/generate/GenerateWizard.java | 7 +- .../common/AbstractGenerateWizard.java | 29 ++--- ...java => AbstractGenerateSelectionJob.java} | 12 +- ...ss.java => GenerateBatchSelectionJob.java} | 11 +- ...Process.java => GenerateSelectionJob.java} | 11 +- 14 files changed, 372 insertions(+), 47 deletions(-) create mode 100644 cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/AbstractCobiGenJob.java create mode 100644 cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/CobiGenEclipseRuntimeException.java create mode 100644 cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/AnalyzeInputJob.java create mode 100644 cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/DetermineTemplatesJob.java rename cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/{AbstractGenerateSelectionProcess.java => AbstractGenerateSelectionJob.java} (94%) rename cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/{GenerateBatchSelectionProcess.java => GenerateBatchSelectionJob.java} (82%) rename cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/{GenerateSelectionProcess.java => GenerateSelectionJob.java} (77%) diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/Activator.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/Activator.java index 7edfac51ec..be936976bc 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/Activator.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/Activator.java @@ -76,9 +76,11 @@ public void start(BundleContext context) throws Exception { * @author mbrunnli (08.04.2013) */ public void startConfigurationProjectListener() { + LOG.info("Start configuration project listener"); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); synchronized (configurationProjectListener) { if (configurationProjectListenerStarted) { return; @@ -90,6 +92,7 @@ public void run() { configurationProjectListenerStarted = true; LOG.info("ResourceChangeListener for configuration project started."); } + MDC.remove(InfrastructureConstants.CORRELATION_ID); } }); } @@ -99,9 +102,11 @@ public void run() { * @author mbrunnli (Jun 24, 2015) */ public void stopConfigurationListener() { + LOG.info("Stop configuration project listener"); Display.getDefault().syncExec(new Runnable() { @Override public void run() { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); synchronized (configurationProjectListener) { if (!configurationProjectListenerStarted) { return; @@ -110,6 +115,7 @@ public void run() { configurationProjectListenerStarted = false; LOG.info("ResourceChangeListener for configuration project stopped."); } + MDC.remove(InfrastructureConstants.CORRELATION_ID); } }); } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/AbstractCobiGenJob.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/AbstractCobiGenJob.java new file mode 100644 index 0000000000..a699b5fe72 --- /dev/null +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/AbstractCobiGenJob.java @@ -0,0 +1,33 @@ +package com.capgemini.cobigen.eclipse.common; + +import org.eclipse.jface.operation.IRunnableWithProgress; + +/** + * Abstract long running background job providing exception handling facilities. + * @author mbrunnli (Jan 10, 2016) + */ +public abstract class AbstractCobiGenJob implements IRunnableWithProgress { + + /** + * Exception occurred during processing + */ + protected RuntimeException occurredException; + + /** + * Returns the field 'occurredException' + * @return value of occurredException + * @author mbrunnli (Jan 10, 2016) + */ + public RuntimeException getOccurredException() { + return occurredException; + } + + /** + * States whether an exception occurred during processing. + * @return true if an exception occurred, false otherwise. + * @author mbrunnli (Jan 10, 2016) + */ + public boolean isExceptionOccurred() { + return occurredException != null; + } +} diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/CobiGenEclipseRuntimeException.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/CobiGenEclipseRuntimeException.java new file mode 100644 index 0000000000..ec03a3be9f --- /dev/null +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/common/exceptions/CobiGenEclipseRuntimeException.java @@ -0,0 +1,26 @@ +package com.capgemini.cobigen.eclipse.common.exceptions; + +/** + * + * @author mbrunnli (Jan 10, 2016) + */ +public class CobiGenEclipseRuntimeException extends RuntimeException { + + /** + * Default serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new {@link CobiGenEclipseRuntimeException} for the given message and cause. + * @param message + * error message + * @param cause + * of the exception + * @author mbrunnli (Jan 10, 2016) + */ + public CobiGenEclipseRuntimeException(String message, Throwable cause) { + super(message, cause); + } + +} diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/AnalyzeInputJob.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/AnalyzeInputJob.java new file mode 100644 index 0000000000..ae65fec097 --- /dev/null +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/AnalyzeInputJob.java @@ -0,0 +1,104 @@ +package com.capgemini.cobigen.eclipse.generator; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; +import java.util.UUID; + +import org.apache.log4j.MDC; +import org.eclipse.core.runtime.IProgressMonitor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.capgemini.cobigen.CobiGen; +import com.capgemini.cobigen.eclipse.common.AbstractCobiGenJob; +import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; +import com.capgemini.cobigen.extension.to.TemplateTo; +import com.google.common.collect.Lists; + +/** + * Job implementation for processing long running operations of CobiGen off the ui thread. + * @author mbrunnli (Jan 10, 2016) + */ +public class AnalyzeInputJob extends AbstractCobiGenJob { + + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(AnalyzeInputJob.class); + + /** + * CobiGen API + */ + private CobiGen cobigen; + + /** + * input objects to be analyzed + */ + private List inputs; + + /** + * Determined matching templates + */ + private List resultMatchingTemplates = Lists.newArrayList(); + + /** + * States whether the generation input is a single non container input. + */ + private boolean resultSingleNonContainerInput; + + /** + * Creates a new job for analyzing the inputs regarding matching templates etc. + * @param cobigen + * CobiGen instance + * @param inputs + * input objects to be analyzed + * @author mbrunnli (Jan 10, 2016) + */ + public AnalyzeInputJob(CobiGen cobigen, List inputs) { + this.cobigen = cobigen; + this.inputs = inputs; + } + + /** + * {@inheritDoc} + * @author mbrunnli (Jan 10, 2016) + */ + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); + + try { + LOG.info("Determine matching templates..."); + monitor.beginTask("Determine matching templates...", inputs.size() + 1); + for (Object input : inputs) { + resultMatchingTemplates.addAll(cobigen.getMatchingTemplates(input)); + monitor.worked(1); + } + LOG.info("Determine if input is container..."); + resultSingleNonContainerInput = + inputs.size() == 1 && !cobigen.combinesMultipleInputs(inputs.get(0)); + monitor.done(); + } catch (RuntimeException e) { + occurredException = e; + } + + MDC.remove(InfrastructureConstants.CORRELATION_ID); + } + + /** + * Returns the field 'resultMatchingTemplates' + * @return value of resultMatchingTemplates + * @author mbrunnli (Jan 10, 2016) + */ + public List getResultMatchingTemplates() { + return resultMatchingTemplates; + } + + /** + * Returns the field 'resultSingleNonContainerInput' + * @return value of resultSingleNonContainerInput + * @author mbrunnli (Jan 10, 2016) + */ + public boolean isResultSingleNonContainerInput() { + return resultSingleNonContainerInput; + } + +} diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java index 1baa91a2f5..0ad4de5d85 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/CobiGenWrapper.java @@ -1,6 +1,7 @@ package com.capgemini.cobigen.eclipse.generator; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; @@ -12,12 +13,15 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Display; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.capgemini.cobigen.CobiGen; import com.capgemini.cobigen.config.entity.Trigger; +import com.capgemini.cobigen.eclipse.common.exceptions.CobiGenEclipseRuntimeException; import com.capgemini.cobigen.eclipse.common.exceptions.GeneratorProjectNotExistentException; import com.capgemini.cobigen.eclipse.common.exceptions.InvalidInputException; import com.capgemini.cobigen.eclipse.common.tools.PathUtil; @@ -107,10 +111,12 @@ public CobiGenWrapper(List inputs) throws GeneratorProjectNotExistentExc */ public void setInput(Object input) { if (input != null) { + LOG.info("Set new generator input. Calculating matching templates..."); initialized = true; inputs = Lists.newArrayList(input); matchingTemplates = cobiGen.getMatchingTemplates(input); singleNonContainerInput = !cobiGen.combinesMultipleInputs(input); + LOG.info("Finished calculating matching templates."); } else { initialized = false; inputs = null; @@ -130,11 +136,31 @@ public void setInputs(List inputs) { initialized = this.inputs != null && this.inputs.size() > 0; if (initialized) { + LOG.info("Set new generator inputs. Calculating matching templates..."); matchingTemplates = Lists.newLinkedList(); - for (Object input : this.inputs) { - matchingTemplates.addAll(cobiGen.getMatchingTemplates(input)); + + ProgressMonitorDialog dialog = new ProgressMonitorDialog(Display.getDefault().getActiveShell()); + AnalyzeInputJob job = new AnalyzeInputJob(cobiGen, inputs); + try { + dialog.run(true, false, job); + } catch (InvocationTargetException e) { + LOG.error("An internal error occured while invoking input analyzer job.", e); + throw new CobiGenEclipseRuntimeException( + "An internal error occured while invoking input analyzer job", e); + } catch (InterruptedException e) { + LOG.warn("The working thread doing the input analyzer job has been interrupted.", e); + throw new CobiGenEclipseRuntimeException( + "The working thread doing the input analyzer job has been interrupted", e); + } + + // forward exception thrown in the processing thread if an exception occurred + if (job.isExceptionOccurred()) { + throw job.getOccurredException(); } - singleNonContainerInput = inputs.size() == 1 && !cobiGen.combinesMultipleInputs(inputs.get(0)); + + matchingTemplates = job.getResultMatchingTemplates(); + singleNonContainerInput = job.isResultSingleNonContainerInput(); + LOG.info("Finished analyzing generation input."); } else { inputs = null; matchingTemplates = null; @@ -366,8 +392,9 @@ public Set getAllTargetFiles() { } Set files = new HashSet<>(); + boolean combinesMultipleInputs = cobiGen.combinesMultipleInputs(inputs.get(0)); for (TemplateTo t : getAllTemplates()) { - if (cobiGen.combinesMultipleInputs(inputs.get(0))) { + if (combinesMultipleInputs) { List children = new JavaInputReader().getInputObjects(inputs.get(0), Charsets.UTF_8); for (Object child : children) { files.add(getGenerationTargetProject().getFile(t.resolveDestinationPath(child))); diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/DetermineTemplatesJob.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/DetermineTemplatesJob.java new file mode 100644 index 0000000000..83f50533c7 --- /dev/null +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/DetermineTemplatesJob.java @@ -0,0 +1,83 @@ +package com.capgemini.cobigen.eclipse.wizard.common; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import org.apache.log4j.MDC; +import org.eclipse.core.runtime.IProgressMonitor; + +import com.capgemini.cobigen.eclipse.common.AbstractCobiGenJob; +import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; +import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; +import com.capgemini.cobigen.extension.to.IncrementTo; +import com.capgemini.cobigen.extension.to.TemplateTo; +import com.google.common.collect.Lists; + +/** + * + * @author mbrunnli (Jan 10, 2016) + */ +public class DetermineTemplatesJob extends AbstractCobiGenJob { + + /** {@link CobiGenWrapper} instance */ + private CobiGenWrapper cobiGenWrapper; + + /** Paths to be generated */ + private Set filePathsToBeGenerated; + + /** Selected increments of the generate wizard */ + private Set selectedIncrements; + + /** Result templates determined */ + private List templates = Lists.newArrayList(); + + /** + * Creates a new job for determining the templates for specific paths to be generated. + * @param filePathsToBeGenerated + * Paths to be generated + * @param selectedIncrements + * of the generate wizard + * @param cobiGenWrapper + * {@link CobiGenWrapper} instance + * @author mbrunnli (Jan 10, 2016) + */ + public DetermineTemplatesJob(Set filePathsToBeGenerated, Set selectedIncrements, + CobiGenWrapper cobiGenWrapper) { + this.filePathsToBeGenerated = filePathsToBeGenerated; + this.selectedIncrements = selectedIncrements; + this.cobiGenWrapper = cobiGenWrapper; + } + + /** + * {@inheritDoc} + * @author mbrunnli (Jan 10, 2016) + */ + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); + + try { + monitor.beginTask("Determine templates for selected paths...", filePathsToBeGenerated.size()); + for (String path : filePathsToBeGenerated) { + monitor.subTask(path); + monitor.worked(1); + templates.addAll(cobiGenWrapper.getTemplatesForFilePath(path, selectedIncrements)); + } + } catch (RuntimeException e) { + occurredException = e; + } + + MDC.remove(InfrastructureConstants.CORRELATION_ID); + } + + /** + * Returns the determined templates as a result. + * @return the determined templates as a result. + * @author mbrunnli (Jan 10, 2016) + */ + public List getResultTemplates() { + return templates; + } +} diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/SelectFilesPage.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/SelectFilesPage.java index e35e4447ec..54f9fd4495 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/SelectFilesPage.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/SelectFilesPage.java @@ -1,5 +1,6 @@ package com.capgemini.cobigen.eclipse.wizard.common; +import java.lang.reflect.InvocationTargetException; import java.util.HashSet; import java.util.LinkedList; import java.util.List; @@ -10,6 +11,7 @@ import org.eclipse.core.runtime.preferences.ConfigurationScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.CheckboxTreeViewer; @@ -24,6 +26,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.TreeItem; import org.osgi.service.prefs.BackingStoreException; @@ -33,6 +36,7 @@ import com.capgemini.cobigen.config.entity.Template; import com.capgemini.cobigen.eclipse.Activator; +import com.capgemini.cobigen.eclipse.common.exceptions.CobiGenEclipseRuntimeException; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.eclipse.generator.entity.ComparableIncrement; import com.capgemini.cobigen.eclipse.wizard.common.control.ButtonListener; @@ -44,7 +48,6 @@ import com.capgemini.cobigen.eclipse.wizard.common.widget.SimulatedCheckboxTreeViewer; import com.capgemini.cobigen.extension.to.IncrementTo; import com.capgemini.cobigen.extension.to.TemplateTo; -import com.google.common.collect.Lists; import com.google.common.collect.Sets; /** @@ -312,11 +315,33 @@ public List getTemplatesToBeGenerated() { } } - List templates = Lists.newLinkedList(); - for (String path : getFilePathsToBeGenerated()) { - templates.addAll(cobigenWrapper.getTemplatesForFilePath(path, selectedIncrements)); + ProgressMonitorDialog dialog = new ProgressMonitorDialog(Display.getDefault().getActiveShell()); + DetermineTemplatesJob job = + new DetermineTemplatesJob(getFilePathsToBeGenerated(), selectedIncrements, cobigenWrapper); + try { + dialog.run(true, false, job); + } catch (InvocationTargetException e) { + LOG.error( + "An internal error occured while invoking the job for determining the templates to generate.", + e); + throw new CobiGenEclipseRuntimeException( + "An internal error occured while invoking the job for determining the templates to generate", + e); + } catch (InterruptedException e) { + LOG.warn( + "The working thread doing the job for determining the templates to generate has been interrupted.", + e); + throw new CobiGenEclipseRuntimeException( + "The working thread doing the job for determining the templates to generate has been interrupted", + e); + } + + // forward potential occurred exception + if (job.isExceptionOccurred()) { + throw job.getOccurredException(); } - return templates; + + return job.getResultTemplates(); } /** diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/control/CheckStateListener.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/control/CheckStateListener.java index b489d53df9..67fda831b2 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/control/CheckStateListener.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/control/CheckStateListener.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.Set; +import java.util.UUID; import org.eclipse.core.resources.IFile; import org.eclipse.jface.viewers.CheckStateChangedEvent; @@ -14,7 +15,11 @@ import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; import com.capgemini.cobigen.eclipse.common.tools.PathUtil; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.eclipse.generator.entity.ComparableIncrement; @@ -37,6 +42,9 @@ */ public class CheckStateListener implements ICheckStateListener, SelectionListener { + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(CheckStateListener.class); + /** * Currently used {@link CobiGenWrapper} instance */ @@ -70,7 +78,7 @@ public class CheckStateListener implements ICheckStateListener, SelectionListene */ public CheckStateListener(CobiGenWrapper cobigenWrapper, SelectFilesPage page, boolean batch) { - this.javaGeneratorWrapper = cobigenWrapper; + javaGeneratorWrapper = cobigenWrapper; this.page = page; this.batch = batch; } @@ -82,6 +90,8 @@ public CheckStateListener(CobiGenWrapper cobigenWrapper, SelectFilesPage page, b */ @Override public void checkStateChanged(CheckStateChangedEvent event) { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); + LOG.info("Increment selection changed. Calculating generation preview file tree..."); CheckboxTreeViewer resourcesTree = page.getResourcesTree(); CheckboxTreeViewer packageSelector = page.getPackageSelector(); @@ -109,6 +119,9 @@ public void checkStateChanged(CheckStateChangedEvent event) { } checkPageComplete(); + + LOG.info("Calculating of changed preview file tree finished."); + MDC.remove(InfrastructureConstants.CORRELATION_ID); } /** @@ -357,8 +370,10 @@ private void setAllResourcesChecked() { */ @Override public void widgetSelected(SelectionEvent e) { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); checkPageComplete(); + MDC.remove(InfrastructureConstants.CORRELATION_ID); } /** @@ -368,7 +383,9 @@ public void widgetSelected(SelectionEvent e) { */ @Override public void widgetDefaultSelected(SelectionEvent e) { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); checkPageComplete(); + MDC.remove(InfrastructureConstants.CORRELATION_ID); } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java index 024ecb3c37..60df912a89 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateBatchWizard.java @@ -13,7 +13,7 @@ import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.eclipse.generator.java.JavaGeneratorWrapper; import com.capgemini.cobigen.eclipse.wizard.generate.common.AbstractGenerateWizard; -import com.capgemini.cobigen.eclipse.wizard.generate.control.GenerateBatchSelectionProcess; +import com.capgemini.cobigen.eclipse.wizard.generate.control.GenerateBatchSelectionJob; import com.capgemini.cobigen.extension.to.TemplateTo; import com.google.common.collect.Lists; @@ -95,14 +95,14 @@ protected void generateContents(ProgressMonitorDialog dialog) { templateIds.add(template.getId()); } - GenerateBatchSelectionProcess job; + GenerateBatchSelectionJob job; if (container == null) { job = - new GenerateBatchSelectionProcess(cobigenWrapper, cobigenWrapper.getTemplates(templateIds), + new GenerateBatchSelectionJob(cobigenWrapper, cobigenWrapper.getTemplates(templateIds), inputTypes); } else { job = - new GenerateBatchSelectionProcess(cobigenWrapper, cobigenWrapper.getTemplates(templateIds), + new GenerateBatchSelectionJob(cobigenWrapper, cobigenWrapper.getTemplates(templateIds), container); } try { diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java index f870c5a830..02fab1b35f 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/GenerateWizard.java @@ -11,7 +11,7 @@ import com.capgemini.cobigen.eclipse.wizard.common.SelectFilesPage; import com.capgemini.cobigen.eclipse.wizard.generate.common.AbstractGenerateWizard; import com.capgemini.cobigen.eclipse.wizard.generate.common.SelectAttributesPage; -import com.capgemini.cobigen.eclipse.wizard.generate.control.GenerateSelectionProcess; +import com.capgemini.cobigen.eclipse.wizard.generate.control.GenerateSelectionJob; /** * The {@link SelectFilesPage} guides through the generation process @@ -90,8 +90,9 @@ protected void generateContents(ProgressMonitorDialog dialog) { } } - GenerateSelectionProcess job = - new GenerateSelectionProcess(cobigenWrapper, page1.getTemplatesToBeGenerated()); + LOG.info("Start generation process job..."); + GenerateSelectionJob job = + new GenerateSelectionJob(cobigenWrapper, page1.getTemplatesToBeGenerated()); try { dialog.run(true, false, job); } catch (InvocationTargetException e) { diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/common/AbstractGenerateWizard.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/common/AbstractGenerateWizard.java index b9d0c0468b..cea1d763e1 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/common/AbstractGenerateWizard.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/common/AbstractGenerateWizard.java @@ -1,6 +1,5 @@ package com.capgemini.cobigen.eclipse.wizard.generate.common; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -24,7 +23,6 @@ import com.capgemini.cobigen.eclipse.wizard.common.SelectFilesPage; import com.capgemini.cobigen.eclipse.wizard.common.model.stubs.IJavaElementStub; import com.capgemini.cobigen.eclipse.wizard.common.model.stubs.IResourceStub; -import com.capgemini.cobigen.extension.to.TemplateTo; /** * The {@link SelectFilesPage} guides through the generation process @@ -65,21 +63,7 @@ public AbstractGenerateWizard(CobiGenWrapper generator) { protected void initializeWizard() { page1 = new SelectFilesPage(cobigenWrapper, false); - } - - /** - * Returns the set of all destination paths for the templates - * - * @return the set of all destination paths for the templates - * @author mbrunnli (11.03.2013) - */ - public Set getAllGenerationPaths() { - - Set paths = new HashSet<>(); - for (TemplateTo tmp : cobigenWrapper.getAllTemplates()) { - paths.add(tmp.resolveDestinationPath(cobigenWrapper.getCurrentRepresentingInput())); - } - return paths; + LOG.info("AbstractGenerateWizard initialized"); } /** @@ -90,6 +74,7 @@ public Set getAllGenerationPaths() { @Override public boolean performFinish() { MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); + LOG.info("Start performing wizard finish operation..."); ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell()); @@ -100,6 +85,7 @@ public boolean performFinish() { page1.saveSelection(); generateContents(dialog); + LOG.info("Performing wizard finish operation completed."); MDC.remove(InfrastructureConstants.CORRELATION_ID); return true; } @@ -117,11 +103,12 @@ public boolean performFinish() { * Checks whether files will be overwritten by the generation process and whether the user is aware of * this behavior and confirms it * - * @return true, if the user confirms the changes beeing made or no files will be overwritten
    + * @return true, if the user confirms the changes being made or no files will be overwritten
    * false, otherwise * @author mbrunnli (18.02.2013) */ private boolean userConfirmed() { + LOG.info("Check for necessary user confirmation to be displayed."); List diff = page1.getSelectedResources(); @@ -145,7 +132,7 @@ private boolean userConfirmed() { } catch (JavaModelException e) { LOG.error( "An internal java model exception occured while retrieving the java elements '{}' corresponding resource.", - e); + ((IJavaElement) r).getElementName(), e); } } else { iResource = r; @@ -156,6 +143,7 @@ private boolean userConfirmed() { } if (!diff.isEmpty()) { + LOG.info("Opening dialog for user confirmation... waiting for user interaction."); MessageDialog dialog = new MessageDialog( getShell(), @@ -164,10 +152,13 @@ private boolean userConfirmed() { "You have selected resources that are already existent and will be overwritten when proceeding.\nDo you really want to replace the existing files by newly generated ones?", MessageDialog.WARNING, new String[] { "Yes", "No" }, 1); int result = dialog.open(); + LOG.info("Got user input. Continue processing..."); if (result == 1 || result == SWT.DEFAULT) { + LOG.info("Finish user confirmation checking: user indicates to not override existing files."); return false; } } + LOG.info("Finish user confirmation checking."); return true; } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionJob.java similarity index 94% rename from cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java rename to cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionJob.java index 2cfedadd4e..da71b029f1 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/AbstractGenerateSelectionJob.java @@ -19,7 +19,6 @@ import org.eclipse.jdt.ui.actions.FormatAllAction; import org.eclipse.jdt.ui.actions.OrganizeImportsAction; import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbenchPartSite; @@ -27,6 +26,7 @@ import org.slf4j.LoggerFactory; import org.slf4j.MDC; +import com.capgemini.cobigen.eclipse.common.AbstractCobiGenJob; import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; import com.capgemini.cobigen.eclipse.common.tools.PlatformUIUtil; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; @@ -39,7 +39,7 @@ * @author Malte Brunnlieb * @version $Revision$ */ -public abstract class AbstractGenerateSelectionProcess implements IRunnableWithProgress { +public abstract class AbstractGenerateSelectionJob extends AbstractCobiGenJob { /** * Logger instance @@ -64,8 +64,7 @@ public abstract class AbstractGenerateSelectionProcess implements IRunnableWithP * @param templatesToBeGenerated * {@link Set} of template ids to be generated */ - public AbstractGenerateSelectionProcess(CobiGenWrapper cobigenWrapper, - List templatesToBeGenerated) { + public AbstractGenerateSelectionJob(CobiGenWrapper cobigenWrapper, List templatesToBeGenerated) { this.cobigenWrapper = cobigenWrapper; this.templatesToBeGenerated = templatesToBeGenerated; @@ -79,6 +78,7 @@ public AbstractGenerateSelectionProcess(CobiGenWrapper cobigenWrapper, @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); + LOG.info("Start generation process..."); if (templatesToBeGenerated.size() == 0) { return; @@ -123,8 +123,10 @@ public void run() { } catch (Throwable e) { PlatformUIUtil.openErrorDialog("Error", "An unexpected exception occurred!", e); LOG.error("An unexpected exception occurred!", e); + } finally { + LOG.info("Finished processing generation."); + monitor.done(); } - monitor.done(); MDC.remove(InfrastructureConstants.CORRELATION_ID); } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionJob.java similarity index 82% rename from cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java rename to cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionJob.java index 07d6b8a2d8..95bb886c95 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateBatchSelectionJob.java @@ -18,7 +18,7 @@ * * @author trippl (22.04.2013) */ -public class GenerateBatchSelectionProcess extends AbstractGenerateSelectionProcess { +public class GenerateBatchSelectionJob extends AbstractGenerateSelectionJob { /** * {@link List} containing the types of the selected inputs @@ -42,7 +42,7 @@ public class GenerateBatchSelectionProcess extends AbstractGenerateSelectionProc * * @author trippl (22.04.2013) */ - public GenerateBatchSelectionProcess(CobiGenWrapper javaGeneratorWrapper, + public GenerateBatchSelectionJob(CobiGenWrapper javaGeneratorWrapper, List templatesToBeGenerated, List inputTypes) { super(javaGeneratorWrapper, templatesToBeGenerated); @@ -60,7 +60,7 @@ public GenerateBatchSelectionProcess(CobiGenWrapper javaGeneratorWrapper, * selected {@link IPackageFragment} for the generation * @author mbrunnli (04.06.2014) */ - public GenerateBatchSelectionProcess(CobiGenWrapper javaGeneratorWrapper, + public GenerateBatchSelectionJob(CobiGenWrapper javaGeneratorWrapper, List templatesToBeGenerated, IPackageFragment container) { super(javaGeneratorWrapper, templatesToBeGenerated); @@ -72,13 +72,16 @@ public GenerateBatchSelectionProcess(CobiGenWrapper javaGeneratorWrapper, */ @Override protected boolean performGeneration(IProgressMonitor monitor) throws Exception { + LOG.info("Perform generation of contents in batch mode..."); if (inputTypes != null && inputTypes.size() == 0 && container == null) { + LOG.warn("Generation finished: No inputs provided!"); return false; } final IProject proj = cobigenWrapper.getGenerationTargetProject(); if (proj != null) { + monitor.beginTask("Generating files...", templatesToBeGenerated.size()); for (TemplateTo temp : templatesToBeGenerated) { if (temp.getMergeStrategy() == null) { cobigenWrapper.generate(temp, true); @@ -87,8 +90,10 @@ protected boolean performGeneration(IProgressMonitor monitor) throws Exception { } monitor.worked(1); } + LOG.info("Generation finished successfully."); return true; } else { + LOG.warn("Generation finished: No generation target project configured! Potential Bug!"); return false; } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionJob.java similarity index 77% rename from cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java rename to cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionJob.java index 5ab2060af3..ae0fb4c7d7 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionProcess.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/generate/control/GenerateSelectionJob.java @@ -18,7 +18,7 @@ * * @author mbrunnli (12.03.2013) */ -public class GenerateSelectionProcess extends AbstractGenerateSelectionProcess { +public class GenerateSelectionJob extends AbstractGenerateSelectionJob { /** * Creates a new process ({@link IRunnableWithProgress}) for performing the generation tasks @@ -29,7 +29,7 @@ public class GenerateSelectionProcess extends AbstractGenerateSelectionProcess { * {@link Set} of templates to be generated * @author mbrunnli (12.03.2013) */ - public GenerateSelectionProcess(CobiGenWrapper cobigenWrapper, List templatesToBeGenerated) { + public GenerateSelectionJob(CobiGenWrapper cobigenWrapper, List templatesToBeGenerated) { super(cobigenWrapper, templatesToBeGenerated); } @@ -41,21 +41,26 @@ public GenerateSelectionProcess(CobiGenWrapper cobigenWrapper, List */ @Override protected boolean performGeneration(IProgressMonitor monitor) throws Exception { + LOG.info("Perform Generation..."); final IProject proj = cobigenWrapper.getGenerationTargetProject(); if (proj != null) { - monitor.beginTask("GenerateHandler files...", templatesToBeGenerated.size()); + monitor.beginTask("Generating files...", templatesToBeGenerated.size()); for (TemplateTo template : templatesToBeGenerated) { if (template.getMergeStrategy() == null) { cobigenWrapper.generate(template, true); } else { cobigenWrapper.generate(template, false); } + monitor.subTask(template.getId()); monitor.worked(1); } proj.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); + monitor.done(); + LOG.info("Generation finished successfully."); return true; } else { + LOG.warn("Generation finished: No generation target project configured! Potential Bug!"); return false; } } From 6ea23c1c85e33182d4b6a63843d816231b233111 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 21:31:25 +0100 Subject: [PATCH 6/8] #145: log context set for different runnables + more convenient log statements added for performance analysis --- .../generator/GeneratorWrapperFactory.java | 4 ++ .../generator/java/JavaGeneratorWrapper.java | 59 +++++++++++-------- .../common/model/SelectFileLabelProvider.java | 7 +++ .../handler/GenerateHandler.java | 7 ++- 4 files changed, 52 insertions(+), 25 deletions(-) diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java index cc8d8af855..f8b2bb96fa 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/GeneratorWrapperFactory.java @@ -54,12 +54,14 @@ public static CobiGenWrapper createGenerator(IStructuredSelection selection) try { Object firstElement = extractedInputs.get(0); if (firstElement instanceof IJavaElement) { + LOG.info("Create new CobiGen instance for java inputs..."); JavaGeneratorWrapper generator = new JavaGeneratorWrapper(); generator.setGenerationTargetProject(((IJavaElement) firstElement).getJavaProject() .getProject()); generator.setInputs(JavaInputConverter.convertInput(extractedInputs)); return generator; } else if (firstElement instanceof IFile) { + LOG.info("Create new CobiGen instance for xml inputs..."); XmlGeneratorWrapper generator = new XmlGeneratorWrapper(); generator.setGenerationTargetProject(((IFile) firstElement).getProject()); generator.setInputs(XmlInputConverter.convertInput(extractedInputs)); @@ -94,6 +96,7 @@ public static CobiGenWrapper createGenerator(IStructuredSelection selection) */ public static List extractValidEclipseInputs(IStructuredSelection selection) throws InvalidInputException { + LOG.info("Start extraction of valid inputs from selection..."); int type = 0; boolean initialized = false; List inputObjects = Lists.newLinkedList(); @@ -156,6 +159,7 @@ public static List extractValidEclipseInputs(IStructuredSelection select } } + LOG.info("Finished extraction of inputs from selection successfully."); return inputObjects; } } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java index 835ff16c21..ceccba7f0d 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/generator/java/JavaGeneratorWrapper.java @@ -14,6 +14,8 @@ import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; import org.eclipse.jface.viewers.IStructuredSelection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.capgemini.cobigen.config.entity.Trigger; import com.capgemini.cobigen.eclipse.common.exceptions.GeneratorProjectNotExistentException; @@ -33,6 +35,9 @@ */ public class JavaGeneratorWrapper extends CobiGenWrapper { + /** Logger instance. */ + private static final Logger LOG = LoggerFactory.getLogger(JavaGeneratorWrapper.class); + /** * A set of removed fields for the generation. */ @@ -127,41 +132,47 @@ private void removeIgnoredFieldsFromModel(Map model) { */ @Override public boolean isValidInput(IStructuredSelection selection) throws InvalidInputException { + LOG.debug("Start checking selection validity for the use as Java input."); Iterator it = selection.iterator(); List firstTriggers = null; boolean uniqueSourceSelected = false; - while (it.hasNext()) { - Object tmp = it.next(); - if (tmp instanceof ICompilationUnit) { - if (firstTriggers == null) { - firstTriggers = findMatchingTriggers((ICompilationUnit) tmp); - } else { - if (!firstTriggers.equals(findMatchingTriggers((ICompilationUnit) tmp))) { - throw new InvalidInputException( - "You selected at least two inputs, which are not matching the same triggers. " - + "For batch processing all inputs have to match the same triggers."); + try { + while (it.hasNext()) { + Object tmp = it.next(); + if (tmp instanceof ICompilationUnit) { + if (firstTriggers == null) { + firstTriggers = findMatchingTriggers((ICompilationUnit) tmp); + } else { + if (!firstTriggers.equals(findMatchingTriggers((ICompilationUnit) tmp))) { + throw new InvalidInputException( + "You selected at least two inputs, which are not matching the same triggers. " + + "For batch processing all inputs have to match the same triggers."); + } } + } else if (tmp instanceof IPackageFragment) { + uniqueSourceSelected = true; + firstTriggers = + cobiGen.getMatchingTriggerIds(new PackageFolder(((IPackageFragment) tmp) + .getResource().getLocationURI(), ((IPackageFragment) tmp).getElementName())); + } else { + throw new InvalidInputException( + "You selected at least one input, which type is currently not supported as input for generation. " + + "Please choose a different one or read the CobiGen documentation for more details."); } - } else if (tmp instanceof IPackageFragment) { - uniqueSourceSelected = true; - firstTriggers = - cobiGen.getMatchingTriggerIds(new PackageFolder(((IPackageFragment) tmp).getResource() - .getLocationURI(), ((IPackageFragment) tmp).getElementName())); - } else { - throw new InvalidInputException( - "You selected at least one input, which type is currently not supported as input for generation. " - + "Please choose a different one or read the CobiGen documentation for more details."); - } - if (uniqueSourceSelected && selection.size() > 1) { - throw new InvalidInputException( - "You selected at least one input, which type is currently not supported for batch processing.\n " - + "Please just select multiple inputs only if batch processing is supported for all inputs."); + if (uniqueSourceSelected && selection.size() > 1) { + throw new InvalidInputException( + "You selected at least one input, which type is currently not supported for batch processing.\n " + + "Please just select multiple inputs only if batch processing is supported for all inputs."); + } } + } finally { + LOG.debug("Ended checking selection validity for the use as Java input."); } + return firstTriggers != null && !firstTriggers.isEmpty(); } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/model/SelectFileLabelProvider.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/model/SelectFileLabelProvider.java index 69d00c5abd..75af17bc96 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/model/SelectFileLabelProvider.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/wizard/common/model/SelectFileLabelProvider.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.UUID; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; @@ -28,7 +29,9 @@ import org.eclipse.ui.ide.IDE; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.slf4j.MDC; +import com.capgemini.cobigen.eclipse.common.constants.InfrastructureConstants; import com.capgemini.cobigen.eclipse.generator.CobiGenWrapper; import com.capgemini.cobigen.eclipse.wizard.common.model.stubs.IJavaElementStub; import com.capgemini.cobigen.eclipse.wizard.common.model.stubs.IResourceStub; @@ -83,6 +86,7 @@ public SelectFileLabelProvider(CobiGenWrapper cobigenWrapper, boolean batch) { */ @Override public String getText(Object element) { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); String result = ""; @@ -108,6 +112,7 @@ public String getText(Object element) { result = addMetaInformation(element, result); + MDC.remove(InfrastructureConstants.CORRELATION_ID); return result.isEmpty() ? "UNDEFINED" : result; } @@ -151,6 +156,7 @@ public Color getForeground(Object element) { */ @Override public Color getBackground(Object element) { + MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); if (checkedResources.contains(element)) { if ((element instanceof IJavaElementStub || element instanceof IResourceStub) && !batch) { @@ -163,6 +169,7 @@ public Color getBackground(Object element) { } } } + MDC.remove(InfrastructureConstants.CORRELATION_ID); return null; } diff --git a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java index ca56327a67..44cc6bb8d4 100644 --- a/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java +++ b/cobigen-eclipse/cobigen-eclipse/src/com/capgemini/cobigen/eclipse/workbenchcontrol/handler/GenerateHandler.java @@ -50,7 +50,7 @@ public class GenerateHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { MDC.put(InfrastructureConstants.CORRELATION_ID, UUID.randomUUID().toString()); - LOG.debug("Generate command triggered."); + LOG.info("Generate command triggered."); ISelection sel = HandlerUtil.getCurrentSelection(event); @@ -60,11 +60,13 @@ public Object execute(ExecutionEvent event) throws ExecutionException { // supported by the following implementation try { + LOG.info("Initiating CobiGen..."); CobiGenWrapper generator = GeneratorWrapperFactory.createGenerator((IStructuredSelection) sel); if (generator == null) { MessageDialog.openError(HandlerUtil.getActiveShell(event), "Not yet supported!", "The current selection is currently not supported as valid input."); + LOG.info("Invalid selection. No CobiGen instance created. Exiting generate command."); return null; } @@ -73,6 +75,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { "Your current selection is not valid as input for any generation purpose. " + "Please find the specification of valid inputs in the context configuration ('" + ResourceConstants.CONFIG_PROJECT_NAME + "/context.xml')."); + LOG.info("No matching Trigger. Exiting generate command."); return null; } @@ -83,11 +86,13 @@ public Object execute(ExecutionEvent event) throws ExecutionException { new GenerateBatchWizard(generator)); wiz.setPageSize(new Point(800, 500)); wiz.open(); + LOG.info("Generate Wizard (Batchmode) opened."); } else if (((IStructuredSelection) sel).size() == 1) { WizardDialog wiz = new WizardDialog(HandlerUtil.getActiveShell(event), new GenerateWizard(generator)); wiz.setPageSize(new Point(800, 500)); wiz.open(); + LOG.info("Generate Wizard opened."); } } catch (UnknownContextVariableException e) { From e1f18084b786bf678bb1670ca6a8bdee87279652 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 21:33:53 +0100 Subject: [PATCH 7/8] #145: logback config improved in configuration projects --- cobigen-templates/templates-oasp/logback.xml | 12 ++++++------ cobigen-templates/templates-oasp4js/logback.xml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cobigen-templates/templates-oasp/logback.xml b/cobigen-templates/templates-oasp/logback.xml index d9d4ca9047..051d466c33 100644 --- a/cobigen-templates/templates-oasp/logback.xml +++ b/cobigen-templates/templates-oasp/logback.xml @@ -2,23 +2,23 @@ - D:\Diss\IDE\workspaces\CobiGen\tools-cobigen\cobigen-templates\templates-oasp\CobiGen.log + - %n%date [%thread] [%X{correlationId}] %-5level %logger - %msg%n + %n%date [%thread] [C:%X{correlationId}] - %-5level - %logger - %msg%n - %n%date [%thread] [%X{correlationId}] %-5level %logger{36} - %msg%n + %d{HH:mm:ss.SSS} [%thread] [C:%X{correlationId}] - %-5level - %logger{36} - %msg%n - + - - + + diff --git a/cobigen-templates/templates-oasp4js/logback.xml b/cobigen-templates/templates-oasp4js/logback.xml index 7ff3a65bc6..051d466c33 100644 --- a/cobigen-templates/templates-oasp4js/logback.xml +++ b/cobigen-templates/templates-oasp4js/logback.xml @@ -4,14 +4,14 @@ - %n%date %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n + %n%date [%thread] [C:%X{correlationId}] - %-5level - %logger - %msg%n - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + %d{HH:mm:ss.SSS} [%thread] [C:%X{correlationId}] - %-5level - %logger{36} - %msg%n From 1a8741753493081cce1f84f9e9e4ce47feff2a42 Mon Sep 17 00:00:00 2001 From: Malte Brunnlieb Date: Sun, 10 Jan 2016 21:45:48 +0100 Subject: [PATCH 8/8] #179: set release version --- cobigen-eclipse/cobigen-eclipse-feature/feature.xml | 2 +- cobigen-eclipse/cobigen-eclipse-feature/pom.xml | 2 +- cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml | 2 +- cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF | 2 +- cobigen-eclipse/cobigen-eclipse/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cobigen-eclipse/cobigen-eclipse-feature/feature.xml b/cobigen-eclipse/cobigen-eclipse-feature/feature.xml index 830c126170..2848df1a1a 100644 --- a/cobigen-eclipse/cobigen-eclipse-feature/feature.xml +++ b/cobigen-eclipse/cobigen-eclipse-feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/cobigen-eclipse/cobigen-eclipse-feature/pom.xml b/cobigen-eclipse/cobigen-eclipse-feature/pom.xml index 51a7b43e70..db3891a022 100644 --- a/cobigen-eclipse/cobigen-eclipse-feature/pom.xml +++ b/cobigen-eclipse/cobigen-eclipse-feature/pom.xml @@ -6,7 +6,7 @@ cobigen-eclipse-feature CobiGen - Eclipse Plug-In Feature eclipse-feature - 1.4.2-SNAPSHOT + 1.4.2 com.capgemini diff --git a/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml b/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml index 47b2169bfa..30cb7e239e 100644 --- a/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml +++ b/cobigen-eclipse/cobigen-eclipse-updatesite/pom.xml @@ -5,7 +5,7 @@ com.capgemini cobigen-eclipse-updatesite CobiGen - Eclipse Plug-In UpdateSite - 1.4.2-SNAPSHOT + 1.4.2 eclipse-repository diff --git a/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF b/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF index 1902159d51..54319deb54 100644 --- a/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF +++ b/cobigen-eclipse/cobigen-eclipse/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CobiGen Eclipse Plug-In Bundle-SymbolicName: cobigen-eclipse;singleton:=true -Bundle-Version: 1.4.2.qualifier +Bundle-Version: 1.4.2 Bundle-Activator: com.capgemini.cobigen.eclipse.Activator Bundle-Vendor: Capgemini Require-Bundle: org.eclipse.ui;bundle-version="3.104.0", diff --git a/cobigen-eclipse/cobigen-eclipse/pom.xml b/cobigen-eclipse/cobigen-eclipse/pom.xml index 52b45a581e..ef7c671d97 100644 --- a/cobigen-eclipse/cobigen-eclipse/pom.xml +++ b/cobigen-eclipse/cobigen-eclipse/pom.xml @@ -6,7 +6,7 @@ cobigen-eclipse CobiGen - Eclipse Plug-In eclipse-plugin - 1.4.2-SNAPSHOT + 1.4.2 com.capgemini