Skip to content

Commit

Permalink
fix match for wrapper factory of schema type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Apr 23, 2024
1 parent 4971504 commit 7f3d409
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import com.evolveum.midpoint.gui.impl.prism.wrapper.SchemaPropertyWrapperImpl;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SchemaType;
import com.evolveum.prism.xml.ns._public.types_3.SchemaDefinitionType;

import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand All @@ -19,7 +19,6 @@
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismPropertyWrapper;
import com.evolveum.midpoint.gui.impl.prism.panel.PrismPropertyPanel;
import com.evolveum.midpoint.gui.impl.prism.wrapper.PrismPropertyValueWrapper;
import com.evolveum.midpoint.gui.impl.prism.wrapper.PrismPropertyWrapperImpl;
import com.evolveum.midpoint.prism.*;
import com.evolveum.midpoint.schema.SchemaService;
Expand All @@ -42,8 +41,10 @@ public class SchemaWrapperFactoryImpl
private static final String DOT_CLASS = SchemaWrapperFactoryImpl.class.getSimpleName() + ".";

@Override
public boolean match(ItemDefinition<?> def) {
return QNameUtil.match(SchemaDefinitionType.COMPLEX_TYPE, def.getTypeName());
public <C extends Containerable> boolean match(ItemDefinition<?> def, PrismContainerValue<C> parent) {
return QNameUtil.match(SchemaDefinitionType.COMPLEX_TYPE, def.getTypeName())
&& parent != null
&& QNameUtil.match(parent.getTypeName(), SchemaType.COMPLEX_TYPE);
}

@Override
Expand Down

0 comments on commit 7f3d409

Please sign in to comment.