From dcb0999418657f592c54f2499c1d03b9680f08f1 Mon Sep 17 00:00:00 2001 From: Neufang Andreas Date: Fri, 28 Jun 2024 09:51:51 +0200 Subject: [PATCH] Fix Assignment Strategy Subtree; Issue: #15; API-modification: Y[]/N[X]; Prevent invisible loop created by delivery instantiation. SCLProject.getDeliveryInformation() differentiates between the initialization case and the default behaviour. --- .../de/comlet/releasefab/CCLAssemblyInfo.java | 2 +- .../main/de/comlet/releasefab/SCLProject.java | 20 +++++++++++++------ .../comlet/releasefab/versions_unit_test.xml | 2 +- .../git/plugin/CCLAssignmentGitCommits.java | 14 +------------ .../git/plugin/CCLAssignmentLocalTag.java | 15 +------------- .../git/plugin/CCLImportGitCommits.java | 2 +- .../api/plugin/ACLAssignmentStrategy.java | 10 +--------- .../model/CCLAssignmentCommandExecuter.java | 14 +------------ .../library/model/CCLAssignmentConstText.java | 15 +------------- .../model/CCLAssignmentFileParser.java | 13 +----------- .../library/model/CCLAssignmentIgnore.java | 14 +------------ .../library/model/CCLAssignmentRandom.java | 13 +----------- .../library/model/CCLAssignmentSubtree.java | 14 +------------ .../src/main/module-info.java | 2 ++ 14 files changed, 28 insertions(+), 122 deletions(-) diff --git a/application/ReleaseFab_Application/src/main/de/comlet/releasefab/CCLAssemblyInfo.java b/application/ReleaseFab_Application/src/main/de/comlet/releasefab/CCLAssemblyInfo.java index 03dbbb9..88dd7da 100644 --- a/application/ReleaseFab_Application/src/main/de/comlet/releasefab/CCLAssemblyInfo.java +++ b/application/ReleaseFab_Application/src/main/de/comlet/releasefab/CCLAssemblyInfo.java @@ -25,7 +25,7 @@ public final class CCLAssemblyInfo { private static final String PRODUCT_NAME = "ReleaseFab"; private static final String COMPANY = "comlet Verteilte Systeme GmbH"; - private static final String COPYRIGHT = "Copyright © 2023"; + private static final String COPYRIGHT = "Copyright © 2024"; private static final String VERSION = "1.1.0"; private CCLAssemblyInfo() diff --git a/application/ReleaseFab_Application/src/main/de/comlet/releasefab/SCLProject.java b/application/ReleaseFab_Application/src/main/de/comlet/releasefab/SCLProject.java index 67ca087..d5e89e0 100644 --- a/application/ReleaseFab_Application/src/main/de/comlet/releasefab/SCLProject.java +++ b/application/ReleaseFab_Application/src/main/de/comlet/releasefab/SCLProject.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -993,10 +993,11 @@ else if (res < 0) * @param component component containing the information * @param delivery delivery containing the information * @param importer importer used to get the information + * @param init true if the call comes from {@link #getInitialComponent()}, false otherwise * @return detailed information about a delivery of a component */ public static ACLDeliveryInformation getDeliveryInformation(CCLComponent component, CCLDelivery delivery, - ACLImportStrategy importer) + ACLImportStrategy importer, boolean init) { ACLDeliveryInformation deliveryInformation = null; @@ -1010,8 +1011,15 @@ public static ACLDeliveryInformation getDeliveryInformation(CCLComponent compone List parameters = component.getParameters(importer.getName()); - deliveryInformation.setInformation(strat.getData(parameters, component, delivery, - getFormerDelivery(delivery), importer, getProjectRoot())); + if (init) + { + deliveryInformation.setInformation(strat.getData(parameters, component, delivery, + getFormerDelivery(delivery), importer, getProjectRoot(), new CCLComponent())); + } + else { + deliveryInformation.setInformation(strat.getData(parameters, component, delivery, + getFormerDelivery(delivery), importer, getProjectRoot(), SCLProject.getInstance().getInitialComponent())); + } if (!SCLProject.getInstance().getDeliveries().isEmpty() && !deliveryInformation.isNew()) { @@ -1289,7 +1297,7 @@ public Boolean doIt(CCLComponent component, CCLDelivery delivery) { if (!sTestMode) { - ACLDeliveryInformation info = getDeliveryInformation(component, delivery, importer); + ACLDeliveryInformation info = getDeliveryInformation(component, delivery, importer, false); if (!component.getDeliveryInformation().containsKey(delivery.getName() + importer.getName()) && null != info) { @@ -1480,7 +1488,7 @@ public CCLComponent getInitialComponent() { if (!initialComponent.getDeliveryInformation().containsKey(delivery.getName() + importer.getName())) { - ACLDeliveryInformation info = SCLProject.getDeliveryInformation(initialComponent, delivery, importer); + ACLDeliveryInformation info = SCLProject.getDeliveryInformation(initialComponent, delivery, importer, true); initialComponent.getDeliveryInformation().put(delivery.getName() + importer.getName(), info); } } diff --git a/application/ReleaseFab_Application/src/test/de/comlet/releasefab/versions_unit_test.xml b/application/ReleaseFab_Application/src/test/de/comlet/releasefab/versions_unit_test.xml index 17100d7..b80aab1 100644 --- a/application/ReleaseFab_Application/src/test/de/comlet/releasefab/versions_unit_test.xml +++ b/application/ReleaseFab_Application/src/test/de/comlet/releasefab/versions_unit_test.xml @@ -46,7 +46,7 @@ - + diff --git a/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentGitCommits.java b/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentGitCommits.java index 70fd4da..1b70e82 100644 --- a/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentGitCommits.java +++ b/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentGitCommits.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -151,16 +151,4 @@ protected CCLXMLSinkBase processInput(Iterable commits, CCLX sink.addItems(new CCLXMLCommitTransformer(commits)); return sink; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override - public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } } diff --git a/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentLocalTag.java b/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentLocalTag.java index 652b098..e61c695 100644 --- a/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentLocalTag.java +++ b/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLAssignmentLocalTag.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -116,17 +116,4 @@ public Element getData(List aParameters, CCLComponent aComponent, return desc; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override - public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } - } diff --git a/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLImportGitCommits.java b/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLImportGitCommits.java index cb7056e..0c36c2a 100644 --- a/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLImportGitCommits.java +++ b/application/ReleaseFab_Git_Plugin/src/main/de/comlet/releasefab/git/plugin/CCLImportGitCommits.java @@ -33,7 +33,7 @@ public class CCLImportGitCommits extends ACLImportStrategy { private static final String NAME = "Git Commits"; - private static final String VERSION = "1.1.1"; + private static final String VERSION = "1.1.2"; private static final String LICENSE = "Eclipse Public License - v 2.0"; private static final String LICENSE_SOURCE = "https://www.eclipse.org/legal/epl-2.0/"; diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/api/plugin/ACLAssignmentStrategy.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/api/plugin/ACLAssignmentStrategy.java index e311122..2814947 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/api/plugin/ACLAssignmentStrategy.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/api/plugin/ACLAssignmentStrategy.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -87,12 +87,4 @@ public String toString() { return getName(); } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - public abstract Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot); } diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentCommandExecuter.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentCommandExecuter.java index 49b5c6a..cbced5d 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentCommandExecuter.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentCommandExecuter.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -162,16 +162,4 @@ public String filterWithRegex(String text, String regex, String format) return result; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override - public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } } diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentConstText.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentConstText.java index 7571b4b..45aa0b7 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentConstText.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentConstText.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -75,17 +75,4 @@ public Element getData(List aParameters, CCLComponent aComponent, return desc; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override - public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } - } diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentFileParser.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentFileParser.java index 9ee4ef0..48f6eb1 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentFileParser.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentFileParser.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -159,15 +159,4 @@ public Element getData(List aParameters, CCLComponent aComponent, } return desc; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } } diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentIgnore.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentIgnore.java index 96a244d..d1c1f48 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentIgnore.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentIgnore.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -60,16 +60,4 @@ public Element getData(List aParameters, CCLComponent aComponent, desc.addContent(SCLXMLUtil.createElement("string", "-")); return desc; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override - public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } } diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentRandom.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentRandom.java index 1b4ef41..b1e248a 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentRandom.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentRandom.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -95,15 +95,4 @@ public Element getData(List aParameters, CCLComponent aComponent, desc.addContent(SCLXMLUtil.createElement("string", Integer.toString(rand))); return desc; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } } diff --git a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentSubtree.java b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentSubtree.java index 2912cff..ff67d4b 100644 --- a/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentSubtree.java +++ b/application/ReleaseFab_Library/src/main/de/comlet/releasefab/library/model/CCLAssignmentSubtree.java @@ -1,7 +1,7 @@ /** * ReleaseFab * - * Copyright © 2022 comlet Verteilte Systeme GmbH + * Copyright © 2024 comlet Verteilte Systeme GmbH * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -369,16 +369,4 @@ private Element getFirstDeliveryInformationOfImporterElement(Element importerEle } return deliverInfo; } - - /** - * Overload of method - * {@link #getData(List, CCLComponent, CCLDelivery, CCLDelivery, ACLImportStrategy, String, CCLComponent)} - * without an initial component. - */ - @Override - public Element getData(List parameters, CCLComponent component, CCLDelivery delivery, - CCLDelivery formerDelivery, ACLImportStrategy importer, String projectRoot) - { - return getData(parameters, component, delivery, formerDelivery, importer, projectRoot, null); - } } diff --git a/application/ReleaseFab_Library/src/main/module-info.java b/application/ReleaseFab_Library/src/main/module-info.java index 8bafad2..d01c278 100644 --- a/application/ReleaseFab_Library/src/main/module-info.java +++ b/application/ReleaseFab_Library/src/main/module-info.java @@ -16,6 +16,7 @@ */ import de.comlet.releasefab.api.plugin.ACLAssignmentStrategyExt; +import de.comlet.releasefab.api.plugin.ACLDeliveryInformation; module releasefab.library { @@ -38,6 +39,7 @@ requires transitive org.xmlunit; uses ACLAssignmentStrategyExt; + uses ACLDeliveryInformation; exports de.comlet.releasefab.api.plugin; exports de.comlet.releasefab.api.almservice;