From 144ff4788a0986386cbb0be537c6311336c33193 Mon Sep 17 00:00:00 2001 From: Vincent Aravantinos <aravantinos@fortiss.org> Date: Wed, 4 Feb 2015 16:36:00 +0000 Subject: [PATCH] GREEN refs 2255 --- .../extension/base/ElementCompositorBase.java | 3 +- .../kernel/extension/data/Prototype.java | 2 +- .../internal/ConnectionCompositorService.java | 2 +- .../internal/ElementCompositorService.java | 6 ++-- .../kernel/internal/MigrationService.java | 2 +- .../kernel/utils/EMFResourceUtils.java | 2 +- .../tooling/kernel/utils/EcoreUtils.java | 35 ++++++++++++------- .../kernel/utils/KernelModelElementUtils.java | 2 +- 8 files changed, 32 insertions(+), 22 deletions(-) diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java index c8cf31a85..51020ba38 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/ElementCompositorBase.java @@ -24,11 +24,12 @@ import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext; import org.fortiss.tooling.kernel.extension.data.Prototype; /** + * Base implementation for supporting composition of {@link IElementCompositor}. * * @author moudy * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating YELLOW Hash: 9795B85BC74E3167DC8697262B931F45 + * @ConQAT.Rating GREEN Hash: 2E67535CC62707219CB9F266DA06F99B */ public abstract class ElementCompositorBase<C extends EObject> implements IElementCompositor<C> { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/Prototype.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/Prototype.java index 2293927a9..c9814b415 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/Prototype.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/Prototype.java @@ -27,7 +27,7 @@ import org.eclipse.emf.ecore.EObject; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 8F0E6F639CF6EE33174A1EE5016E3E69 + * @ConQAT.Rating GREEN Hash: 3329872E451EF853C552E9AEAC5CB7EC */ public class Prototype { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java index b67619714..adb1b25ac 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java @@ -32,7 +32,7 @@ import org.fortiss.tooling.kernel.service.base.EObjectAware2ServiceBase; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 32A10A407ACEEAE1210429B4A2C6FB91 + * @ConQAT.Rating GREEN Hash: E2E2C40D393401D420CA9000D1BD1028 */ public class ConnectionCompositorService extends EObjectAware2ServiceBase<IConnectionCompositor<EObject, EObject, EObject>> implements diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java index b65d07663..3ded84599 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java @@ -36,7 +36,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 92E1A4E58E91DC08258B83B53E3034D2 + * @ConQAT.Rating GREEN Hash: D2813F2898EBA0ABD1BF12D7D1554323 */ public final class ElementCompositorService extends EObjectAwareServiceBase<IElementCompositor<EObject>> implements IElementCompositorService { @@ -68,8 +68,8 @@ public final class ElementCompositorService extends findWorkingCompositor(container, element, context, false); if(compositor == null) { LoggingUtils.error(ToolingKernelActivator.getDefault(), String.format( - "Can not find compositor for container %s and element %s", - container.getClass(), element.getClass())); + "Cannot find compositor for container %s and element %s", container.getClass(), + element.getClass())); return false; } IPersistencyService.INSTANCE.getTopLevelElementFor(container).prepareIDs(element); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java index f73cac150..fdc67e23b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java @@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase; * @author mou * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 022F25C1D17554DE41E792592028C20D + * @ConQAT.Rating GREEN Hash: 4008B014AD23F8E56B1D90CEE9A5C319 */ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> implements IMigrationService { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java index 36cb3b8e3..c5a3b75e2 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EMFResourceUtils.java @@ -41,7 +41,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: A8091215BF4A3742FAA20AD702A1295B + * @ConQAT.Rating GREEN Hash: 0F500D545960AA85BBE636519B9120C4 */ public final class EMFResourceUtils { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EcoreUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EcoreUtils.java index e5ca6579f..1cae3d09a 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EcoreUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/EcoreUtils.java @@ -42,22 +42,23 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil.Copier; /** - * Utility methods for dealing with <code>.ecore</code> models. These methods should be used to + * Utility methods for dealing with <code>Ecore</code> models. These methods should be used to * define EMF operations that make the models easier to use. * * @author ratiu * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating YELLOW Hash: 8EAEF7E3DCA3BC1D3F412165108A9DEA + * @ConQAT.Rating GREEN Hash: 283A66F00038F9CA2487E758FC9C057E */ public class EcoreUtils { /** The new event type count defined by the kernel. */ public static final int KERNEL_EMF_EVENT_TYPE_COUNT = EVENT_TYPE_COUNT + 1; - /** Notification to cause model element display refresh. */ - // we use a large number above EMF standard notifications to avoid collision - // with other EMF tools. + /** + * Notification to cause model element display refresh. We use a large number above EMF standard + * notifications to avoid collision with other EMF tools. + */ private static final Notification refreshNotification = new NotificationImpl( EVENT_TYPE_COUNT + 1, null, null); @@ -115,12 +116,15 @@ public class EcoreUtils { */ @SuppressWarnings("unchecked") public static <T> EList<T> pickInstanceOf(Class<T> targetClass, List<?> sourceList) { - if(sourceList == null) + if(sourceList == null) { return null; + } EList<T> result = new BasicEList<T>(); - for(Object sourceElement : sourceList) - if(targetClass.isAssignableFrom(sourceElement.getClass())) + for(Object sourceElement : sourceList) { + if(targetClass.isAssignableFrom(sourceElement.getClass())) { result.add((T)sourceElement); + } + } return ECollections.unmodifiableEList(result); } @@ -140,8 +144,9 @@ public class EcoreUtils { */ public static <S> EList<S> pickInstanceOf(Collection<Class<?>> targetClasses, List<S> sourceList) { - if(sourceList == null) + if(sourceList == null) { return null; + } EList<S> result = new BasicEList<S>(); for(S sourceElement : sourceList) { Class<?> sourceClass = sourceElement.getClass(); @@ -169,8 +174,9 @@ public class EcoreUtils { * <code>targetClass</code> instances */ public static <S> EList<S> filterOutInstanceOf(Class<?> targetClass, List<S> sourceList) { - if(sourceList == null) + if(sourceList == null) { return null; + } EList<S> result = new BasicEList<S>(); for(S sourceElement : sourceList) { Class<?> sourceClass = sourceElement.getClass(); @@ -193,11 +199,14 @@ public class EcoreUtils { */ @SuppressWarnings("unchecked") public static <S, T extends S> T pickFirstInstanceOf(Class<T> targetClass, List<S> sourceList) { - if(sourceList == null) + if(sourceList == null) { return null; - for(S sourceElement : sourceList) - if(targetClass.isAssignableFrom(sourceElement.getClass())) + } + for(S sourceElement : sourceList) { + if(targetClass.isAssignableFrom(sourceElement.getClass())) { return (T)sourceElement; + } + } return null; } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java index f05ea261b..0e413d99b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java @@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: E4EBC5D7A0611A8B71877E7000BE58DF + * @ConQAT.Rating GREEN Hash: AF4108116CA2222CFBF5FD1A83E6C48E */ public final class KernelModelElementUtils { -- GitLab