Commit e29706f0 authored by Simon Barner's avatar Simon Barner
Browse files

Mutually exclusive entity types: Return empty list instead of null

* get{Source,Target}EntityMutuallyExclusiveEntryTypes(): empty list
  instead of null in case no mutually exclusive types have been
  registered

Issue-Ref: 3569
Issue-Url: https://af3-developer.fortiss.org/issues/3569

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 499c8cb3
AF3AllocationActivator.java fa98bbdbd34d9d3c76f7f2827f2f456105c90fa6 GREEN
IAllocationService.java ccbb1e3a5c62a18b5a4f9bb0f8e74282e4cc4d08 YELLOW
IAllocationService.java f6aa121d339316412b18c57dbb5881ecad266e0b YELLOW
......@@ -215,7 +215,8 @@ public interface IAllocationService {
/**
* For the given reference {@link AllocationEntry} type, returns the set of all
* {@link AllocationEntry} types that are mutually exclusive w.r.t. source entity (including the
* reference element). In case no such types are registered, the method returns {@code null}.
* reference element). In case no such types are registered, an empty {@link Collection} is
* returned.
*/
public Collection<Class<? extends AllocationEntry>> getSourceEntityMutuallyExclusiveEntryTypes(
Class<? extends AllocationEntry> referenceEntryType);
......@@ -223,7 +224,8 @@ public interface IAllocationService {
/**
* For the given reference {@link AllocationEntry} type, returns the set of all
* {@link AllocationEntry} types that are mutually exclusive w.r.t. target entity (including the
* reference element). In case no such types are registered, the method returns {@code null}.
* reference element). In case no such types are registered, an empty {@link Collection} is
* returned.
*/
public Collection<Class<? extends AllocationEntry>> getTargetEntityMutuallyExclusiveEntryTypes(
Class<? extends AllocationEntry> referenceEntryType);
......
AllocationService.java f07a9ba862ec98b32938a3f9ffde4095ec15f6e7 YELLOW
AllocationService.java 1c6089ca61fd0575289267c2a427b83979721ee7 YELLOW
......@@ -513,7 +513,8 @@ public final class AllocationService implements IAllocationService, IIntrospecti
/** {@inheritDoc} */
@Override
public void addSourceEntityMutualEntryTypeExclusion(Class<? extends AllocationEntry> allocationEntryType,
public void addSourceEntityMutualEntryTypeExclusion(
Class<? extends AllocationEntry> allocationEntryType,
Class<? extends AllocationEntry> otherAllocationEntryType) {
addMutualExclusionEntityType(sourceEntityMutualExclusions, allocationEntryType,
otherAllocationEntryType);
......@@ -521,7 +522,8 @@ public final class AllocationService implements IAllocationService, IIntrospecti
/** {@inheritDoc} */
@Override
public void addTargetEntityMutualEntryTypeExclusion(Class<? extends AllocationEntry> allocationEntryType,
public void addTargetEntityMutualEntryTypeExclusion(
Class<? extends AllocationEntry> allocationEntryType,
Class<? extends AllocationEntry> otherAllocationEntryType) {
addMutualExclusionEntityType(targetEntityMutualExclusions, allocationEntryType,
otherAllocationEntryType);
......@@ -547,13 +549,17 @@ public final class AllocationService implements IAllocationService, IIntrospecti
@Override
public Collection<Class<? extends AllocationEntry>> getSourceEntityMutuallyExclusiveEntryTypes(
Class<? extends AllocationEntry> referenceEntryType) {
return getMutualExclusionTypeSet(sourceEntityMutualExclusions, referenceEntryType);
TypeSet<AllocationEntry> rval =
getMutualExclusionTypeSet(sourceEntityMutualExclusions, referenceEntryType);
return rval != null ? rval : emptyList();
}
/** {@inheritDoc} */
@Override
public Collection<Class<? extends AllocationEntry>> getTargetEntityMutuallyExclusiveEntryTypes(
Class<? extends AllocationEntry> referenceEntryType) {
return getMutualExclusionTypeSet(targetEntityMutualExclusions, referenceEntryType);
TypeSet<AllocationEntry> rval =
getMutualExclusionTypeSet(targetEntityMutualExclusions, referenceEntryType);
return rval != null ? rval : emptyList();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment