Skip to content

Commit

Permalink
Common tests passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Oct 19, 2016
1 parent c5ad8b7 commit 7cb86d2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 34 deletions.
Expand Up @@ -570,25 +570,17 @@ public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
// if (!super.equals(obj)) {
// return false;
// }
if (getClass() != obj.getClass()) {
return false;
}
CompositeRefinedObjectClassDefinition other = (CompositeRefinedObjectClassDefinition) obj;
if (auxiliaryObjectClassDefinitions == null) {
if (other.auxiliaryObjectClassDefinitions != null) {
return false;
}
} else if (!auxiliaryObjectClassDefinitions.equals(other.auxiliaryObjectClassDefinitions)) {
if (!auxiliaryObjectClassDefinitions.equals(other.auxiliaryObjectClassDefinitions)) {
return false;
}
if (structuralObjectClassDefinition == null) {
if (other.structuralObjectClassDefinition != null) {
return false;
}
} else if (!structuralObjectClassDefinition.equals(other.structuralObjectClassDefinition)) {
if (!structuralObjectClassDefinition.equals(other.structuralObjectClassDefinition)) {
return false;
}
return true;
Expand Down
Expand Up @@ -171,8 +171,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
// if (!super.equals(obj))
// return false;
if (getClass() != obj.getClass())
return false;
LayerRefinedAttributeDefinitionImpl other = (LayerRefinedAttributeDefinitionImpl) obj;
Expand Down Expand Up @@ -449,7 +449,7 @@ public String getNamespace() {

@Override
public int getMinOccurs() {
return refinedAttributeDefinition.getMinOccurs();
return refinedAttributeDefinition.getMinOccurs(layer);
}

@Override
Expand All @@ -459,7 +459,7 @@ public Collection<? extends DisplayableValue<T>> getAllowedValues() {

@Override
public int getMaxOccurs() {
return refinedAttributeDefinition.getMaxOccurs();
return refinedAttributeDefinition.getMaxOccurs(layer);
}

@Override
Expand All @@ -479,7 +479,7 @@ public boolean isTolerant() {

@Override
public boolean isSingleValue() {
return refinedAttributeDefinition.isSingleValue();
return refinedAttributeDefinition.isSingleValue(layer);
}

@Override
Expand All @@ -494,7 +494,7 @@ public boolean isSecondaryIdentifier() {

@Override
public boolean isMultiValue() {
return refinedAttributeDefinition.isMultiValue();
return refinedAttributeDefinition.isMultiValue(layer);
}

@Override
Expand All @@ -515,12 +515,12 @@ public boolean canAdd(LayerType layer) {

@Override
public boolean isMandatory() {
return refinedAttributeDefinition.isMandatory();
return refinedAttributeDefinition.isMandatory(layer);
}

@Override
public boolean isIgnored() {
return refinedAttributeDefinition.isIgnored();
return refinedAttributeDefinition.isIgnored(layer);
}

@Override
Expand All @@ -540,7 +540,7 @@ public boolean isAbstract() {

@Override
public boolean isOptional() {
return refinedAttributeDefinition.isOptional();
return refinedAttributeDefinition.isOptional(layer);
}

@Override
Expand Down
Expand Up @@ -550,8 +550,8 @@ public int hashCode() {
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
// if (!super.equals(obj))
// return false;
if (getClass() != obj.getClass())
return false;
LayerRefinedObjectClassDefinitionImpl other = (LayerRefinedObjectClassDefinitionImpl) obj;
Expand Down
Expand Up @@ -1058,16 +1058,15 @@ public void applyDefinition(ItemDefinition definition, boolean force) throws Sch
applyDefinition((PrismContainerDefinition<C>)definition, force);
}

public void applyDefinition(PrismContainerDefinition<C> containerDef, boolean force) throws SchemaException {
public void applyDefinition(@NotNull PrismContainerDefinition<C> containerDef, boolean force) throws SchemaException {
checkMutability();
ComplexTypeDefinition ctd = getComplexTypeDefinition();
if (ctd == null) {
if (containerDef == null || containerDef.getComplexTypeDefinition() == null) {
return;
}
ctd = containerDef.getComplexTypeDefinition();
}
if (ctd.isXsdAnyMarker()) {
// Although complexTypeDefinition is cached, its presence means that the parent had a definition before
// parent.applyDefinition() was called. So if !force, we can safely exit here.
if (complexTypeDefinition != null && !force) {
return; // there's a definition already
}
complexTypeDefinition = containerDef.getComplexTypeDefinition();
if (complexTypeDefinition == null || complexTypeDefinition.isXsdAnyMarker()) {
// No point in aplying this. Nothing will change and there may be phantom errors.
return;
}
Expand All @@ -1077,7 +1076,7 @@ public void applyDefinition(PrismContainerDefinition<C> containerDef, boolean fo
// Item has a definition already, no need to apply it
continue;
}
ItemDefinition itemDefinition = determineItemDefinition(item.getElementName(), ctd);
ItemDefinition itemDefinition = determineItemDefinition(item.getElementName(), complexTypeDefinition);
if (itemDefinition == null && item.getDefinition() != null && item.getDefinition().isDynamic()) {
// We will not apply the null definition here. The item has a dynamic definition that we don't
// want to destroy as it cannot be reconstructed later.
Expand Down

0 comments on commit 7cb86d2

Please sign in to comment.