From be593d258a5bd805f6247b5cc001534d9035d347 Mon Sep 17 00:00:00 2001 From: Richard Richter Date: Mon, 1 Jun 2020 20:11:27 +0200 Subject: [PATCH] prism-api+impl: cleanup of classes with unnecessary code blocks --- .../ns/_public/query_3/FilterClauseType.java | 85 ++--- .../query_3/LogicalOperatorFilterType.java | 42 +- .../NAryLogicalOperatorFilterType.java | 91 ++--- .../xml/ns/_public/query_3/PagingType.java | 244 +++++------- .../PropertyComplexValueFilterType.java | 80 ++-- .../query_3/PropertyNoValueFilterType.java | 76 ++-- .../PropertySimpleValueFilterType.java | 358 ++++++------------ .../xml/ns/_public/query_3/QueryType.java | 301 +++++---------- .../ns/_public/query_3/SearchFilterType.java | 49 +-- .../xml/ns/_public/query_3/UriFilterType.java | 81 ++-- .../xml/ns/_public/query_3/ValueType.java | 100 ++--- .../ns/_public/types_3/XmlAsStringType.java | 60 ++- .../prism/foo/EventCategoryFilterType.java | 97 ++--- .../prism/foo/EventHandlerChainType.java | 165 +++----- .../midpoint/prism/foo/EventHandlerType.java | 92 ++--- .../prism/foo/EventOperationFilterType.java | 101 ++--- .../prism/foo/EventStatusFilterType.java | 101 ++--- 17 files changed, 767 insertions(+), 1356 deletions(-) diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/FilterClauseType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/FilterClauseType.java index 70f0e99b01d..94756d6ffdb 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/FilterClauseType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/FilterClauseType.java @@ -7,17 +7,12 @@ package com.evolveum.prism.xml.ns._public.query_3; import java.io.Serializable; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -26,6 +21,9 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for FilterType complex type. @@ -46,17 +44,16 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FilterType", propOrder = { - "matching" + "matching" }) @XmlSeeAlso({ - PropertyNoValueFilterType.class, - PropertyComplexValueFilterType.class, - PropertySimpleValueFilterType.class, - UriFilterType.class, - LogicalOperatorFilterType.class + PropertyNoValueFilterType.class, + PropertyComplexValueFilterType.class, + PropertySimpleValueFilterType.class, + UriFilterType.class, + LogicalOperatorFilterType.class }) -public class FilterClauseType implements Serializable, Cloneable, Equals, HashCode -{ +public class FilterClauseType implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; protected String matching; @@ -65,7 +62,6 @@ public class FilterClauseType implements Serializable, Cloneable, Equals, HashCo /** * Creates a new {@code FilterType} instance. - * */ public FilterClauseType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -75,11 +71,8 @@ public FilterClauseType() { /** * Creates a new {@code FilterType} instance by deeply copying a given {@code FilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public FilterClauseType(final FilterClauseType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -88,16 +81,14 @@ public FilterClauseType(final FilterClauseType o) { throw new NullPointerException("Cannot create a copy of 'FilterType' from 'null'."); } // CBuiltinLeafInfo: java.lang.String - this.matching = ((o.matching == null)?null:o.getMatching()); + this.matching = ((o.matching == null) ? null : o.getMatching()); } /** * Gets the value of the matching property. * - * @return - * possible object is - * {@link String } - * + * @return possible object is + * {@link String } */ public String getMatching() { return matching; @@ -106,10 +97,8 @@ public String getMatching() { /** * Sets the value of the matching property. * - * @param value - * allowed object is - * {@link String } - * + * @param value allowed object is + * {@link String } */ public void setMatching(String value) { this.matching = value; @@ -118,7 +107,6 @@ public void setMatching(String value) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -127,11 +115,9 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; - { - String theMatching; - theMatching = this.getMatching(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "matching", theMatching), currentHashCode, theMatching); - } + String theMatching; + theMatching = this.getMatching(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "matching", theMatching), currentHashCode, theMatching); return currentHashCode; } @@ -148,18 +134,17 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return true; } final FilterClauseType that = ((FilterClauseType) object); - { - String lhsMatching; - lhsMatching = this.getMatching(); - String rhsMatching; - rhsMatching = that.getMatching(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "matching", lhsMatching), LocatorUtils.property(thatLocator, "matching", rhsMatching), lhsMatching, rhsMatching)) { - return false; - } + String lhsMatching; + lhsMatching = this.getMatching(); + String rhsMatching; + rhsMatching = that.getMatching(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "matching", lhsMatching), LocatorUtils.property(thatLocator, "matching", rhsMatching), lhsMatching, rhsMatching)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -168,20 +153,16 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public FilterClauseType clone() { try { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final FilterClauseType clone = ((FilterClauseType) super.clone()); - // CBuiltinLeafInfo: java.lang.String - clone.matching = ((this.matching == null)?null:this.getMatching()); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final FilterClauseType clone = ((FilterClauseType) super.clone()); + // CBuiltinLeafInfo: java.lang.String + clone.matching = ((this.matching == null) ? null : this.getMatching()); + return clone; } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/LogicalOperatorFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/LogicalOperatorFilterType.java index 56b6f026357..070a9c110e8 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/LogicalOperatorFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/LogicalOperatorFilterType.java @@ -7,17 +7,12 @@ package com.evolveum.prism.xml.ns._public.query_3; import java.io.Serializable; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -25,6 +20,9 @@ import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for LogicalOperatorFilterType complex type. @@ -43,20 +41,18 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LogicalOperatorFilterType") @XmlSeeAlso({ - NAryLogicalOperatorFilterType.class, - UnaryLogicalOperatorFilterType.class + NAryLogicalOperatorFilterType.class, + UnaryLogicalOperatorFilterType.class }) public abstract class LogicalOperatorFilterType - extends FilterClauseType - implements Serializable, Cloneable, Equals, HashCode -{ + extends FilterClauseType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; public final static QName COMPLEX_TYPE = new QName(PrismConstants.NS_QUERY, "LogicalOperatorFilterType"); /** * Creates a new {@code LogicalOperatorFilterType} instance. - * */ public LogicalOperatorFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -66,11 +62,8 @@ public LogicalOperatorFilterType() { /** * Creates a new {@code LogicalOperatorFilterType} instance by deeply copying a given {@code LogicalOperatorFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public LogicalOperatorFilterType(final LogicalOperatorFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -83,7 +76,6 @@ public LogicalOperatorFilterType(final LogicalOperatorFilterType o) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -91,8 +83,7 @@ public String toString() { } public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = super.hashCode(locator, strategy); - return currentHashCode; + return super.hashCode(locator, strategy); } public int hashCode() { @@ -113,6 +104,7 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -121,17 +113,11 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public LogicalOperatorFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final LogicalOperatorFilterType clone = ((LogicalOperatorFilterType) super.clone()); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + return ((LogicalOperatorFilterType) super.clone()); } - } diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/NAryLogicalOperatorFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/NAryLogicalOperatorFilterType.java index ba3a9a3b42b..39c006e5202 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/NAryLogicalOperatorFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/NAryLogicalOperatorFilterType.java @@ -8,19 +8,13 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -30,6 +24,9 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Element; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for NAryLogicalOperatorFilterType complex type. @@ -50,12 +47,11 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NAryLogicalOperatorFilterType", propOrder = { - "filter" + "filter" }) public class NAryLogicalOperatorFilterType - extends LogicalOperatorFilterType - implements Serializable, Cloneable, Equals, HashCode -{ + extends LogicalOperatorFilterType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; @XmlAnyElement @@ -64,7 +60,6 @@ public class NAryLogicalOperatorFilterType /** * Creates a new {@code NAryLogicalOperatorFilterType} instance. - * */ public NAryLogicalOperatorFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -74,11 +69,8 @@ public NAryLogicalOperatorFilterType() { /** * Creates a new {@code NAryLogicalOperatorFilterType} instance by deeply copying a given {@code NAryLogicalOperatorFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public NAryLogicalOperatorFilterType(final NAryLogicalOperatorFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -87,7 +79,7 @@ public NAryLogicalOperatorFilterType(final NAryLogicalOperatorFilterType o) { throw new NullPointerException("Cannot create a copy of 'NAryLogicalOperatorFilterType' from 'null'."); } // 'Filter' collection. - if (o.filter!= null) { + if (o.filter != null) { copyFilter(o.getFilter(), this.getFilter()); } } @@ -111,8 +103,6 @@ public NAryLogicalOperatorFilterType(final NAryLogicalOperatorFilterType o) { *

* Objects of the following type(s) are allowed in the list * {@link Element } - * - * */ public List getFilter() { if (filter == null) { @@ -124,7 +114,6 @@ public List getFilter() { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -133,11 +122,9 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - List theFilter; - theFilter = (((this.filter!= null)&&(!this.filter.isEmpty()))?this.getFilter():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "filter", theFilter), currentHashCode, theFilter); - } + List theFilter; + theFilter = (((this.filter != null) && (!this.filter.isEmpty())) ? this.getFilter() : null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "filter", theFilter), currentHashCode, theFilter); return currentHashCode; } @@ -157,18 +144,17 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final NAryLogicalOperatorFilterType that = ((NAryLogicalOperatorFilterType) object); - { - List lhsFilter; - lhsFilter = (((this.filter!= null)&&(!this.filter.isEmpty()))?this.getFilter():null); - List rhsFilter; - rhsFilter = (((that.filter!= null)&&(!that.filter.isEmpty()))?that.getFilter():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "filter", lhsFilter), LocatorUtils.property(thatLocator, "filter", rhsFilter), lhsFilter, rhsFilter)) { - return false; - } + List lhsFilter; + lhsFilter = (((this.filter != null) && (!this.filter.isEmpty())) ? this.getFilter() : null); + List rhsFilter; + rhsFilter = (((that.filter != null) && (!that.filter.isEmpty())) ? that.getFilter() : null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "filter", lhsFilter), LocatorUtils.property(thatLocator, "filter", rhsFilter), lhsFilter, rhsFilter)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -177,26 +163,21 @@ public boolean equals(Object object) { /** * Copies all values of property {@code Filter} deeply. * - * @param source - * The source to copy from. - * @param target - * The target to copy {@code source} to. - * @throws NullPointerException - * if {@code target} is {@code null}. + * @param source The source to copy from. + * @param target The target to copy {@code source} to. + * @throws NullPointerException if {@code target} is {@code null}. */ - @SuppressWarnings("unchecked") private static void copyFilter(final List source, final List target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if ((source!= null)&&(!source.isEmpty())) { - for (final Iterator it = source.iterator(); it.hasNext(); ) { - final Object next = it.next(); + if ((source != null) && (!source.isEmpty())) { + for (final Object next : source) { if (next instanceof Element) { // CWildcardTypeInfo: org.w3c.dom.Element - target.add(((Element)((Element) next).cloneNode(true))); + target.add(((Element) ((Element) next).cloneNode(true))); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Filter' of class 'com.evolveum.prism.xml.ns._public.query_3.NAryLogicalOperatorFilterType'.")); + throw new AssertionError((("Unexpected instance '" + next) + "' for property 'Filter' of class 'com.evolveum.prism.xml.ns._public.query_3.NAryLogicalOperatorFilterType'.")); } } } @@ -204,22 +185,18 @@ private static void copyFilter(final List source, final List t /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public NAryLogicalOperatorFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final NAryLogicalOperatorFilterType clone = ((NAryLogicalOperatorFilterType) super.clone()); - // 'Filter' collection. - if (this.filter!= null) { - clone.filter = null; - copyFilter(this.getFilter(), clone.getFilter()); - } - return clone; + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final NAryLogicalOperatorFilterType clone = ((NAryLogicalOperatorFilterType) super.clone()); + // 'Filter' collection. + if (this.filter != null) { + clone.filter = null; + copyFilter(this.getFilter(), clone.getFilter()); } + return clone; } } diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PagingType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PagingType.java index 58904cee7c8..32900a65050 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PagingType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PagingType.java @@ -7,18 +7,12 @@ package com.evolveum.prism.xml.ns._public.query_3; import java.io.Serializable; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - -import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -28,13 +22,16 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Element; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; /** - * - * Parameters limiting the number of returned - * entries, offset, etc. - * Used in the web service operations - * such as list or search + * Parameters limiting the number of returned + * entries, offset, etc. + * Used in the web service operations + * such as list or search * * *

Java class for PagingType complex type. @@ -59,14 +56,13 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PagingType", propOrder = { - "orderBy", - "orderDirection", - "offset", - "maxSize", - "groupBy" + "orderBy", + "orderDirection", + "offset", + "maxSize", + "groupBy" }) -public class PagingType implements Serializable, Cloneable, Equals, HashCode -{ +public class PagingType implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; protected ItemPathType orderBy; @@ -85,7 +81,6 @@ public class PagingType implements Serializable, Cloneable, Equals, HashCode /** * Creates a new {@code PagingType} instance. - * */ public PagingType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -95,11 +90,8 @@ public PagingType() { /** * Creates a new {@code PagingType} instance by deeply copying a given {@code PagingType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public PagingType(final PagingType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -107,23 +99,21 @@ public PagingType(final PagingType o) { if (o == null) { throw new NullPointerException("Cannot create a copy of 'PagingType' from 'null'."); } - this.orderBy = (o.orderBy == null)?null:o.orderBy.clone(); + this.orderBy = (o.orderBy == null) ? null : o.orderBy.clone(); // CEnumLeafInfo: com.evolveum.prism.xml.ns._public.query_3.OrderDirectionType - this.orderDirection = ((o.orderDirection == null)?null:o.getOrderDirection()); + this.orderDirection = ((o.orderDirection == null) ? null : o.getOrderDirection()); // CBuiltinLeafInfo: java.lang.Integer - this.offset = ((o.offset == null)?null:o.getOffset()); + this.offset = ((o.offset == null) ? null : o.getOffset()); // CBuiltinLeafInfo: java.lang.Integer - this.maxSize = ((o.maxSize == null)?null:o.getMaxSize()); - this.groupBy = (o.groupBy == null)?null:o.groupBy.clone(); + this.maxSize = ((o.maxSize == null) ? null : o.getMaxSize()); + this.groupBy = (o.groupBy == null) ? null : o.groupBy.clone(); } /** * Gets the value of the orderBy property. * - * @return - * possible object is - * {@link Element } - * + * @return possible object is + * {@link Element } */ public ItemPathType getOrderBy() { return orderBy; @@ -132,10 +122,8 @@ public ItemPathType getOrderBy() { /** * Sets the value of the orderBy property. * - * @param value - * allowed object is - * {@link Element } - * + * @param value allowed object is + * {@link Element } */ public void setOrderBy(ItemPathType value) { this.orderBy = value; @@ -144,10 +132,8 @@ public void setOrderBy(ItemPathType value) { /** * Gets the value of the orderDirection property. * - * @return - * possible object is - * {@link OrderDirectionType } - * + * @return possible object is + * {@link OrderDirectionType } */ public OrderDirectionType getOrderDirection() { return orderDirection; @@ -156,10 +142,8 @@ public OrderDirectionType getOrderDirection() { /** * Sets the value of the orderDirection property. * - * @param value - * allowed object is - * {@link OrderDirectionType } - * + * @param value allowed object is + * {@link OrderDirectionType } */ public void setOrderDirection(OrderDirectionType value) { this.orderDirection = value; @@ -168,10 +152,8 @@ public void setOrderDirection(OrderDirectionType value) { /** * Gets the value of the offset property. * - * @return - * possible object is - * {@link Integer } - * + * @return possible object is + * {@link Integer } */ public Integer getOffset() { return offset; @@ -180,10 +162,8 @@ public Integer getOffset() { /** * Sets the value of the offset property. * - * @param value - * allowed object is - * {@link Integer } - * + * @param value allowed object is + * {@link Integer } */ public void setOffset(Integer value) { this.offset = value; @@ -192,10 +172,8 @@ public void setOffset(Integer value) { /** * Gets the value of the maxSize property. * - * @return - * possible object is - * {@link Integer } - * + * @return possible object is + * {@link Integer } */ public Integer getMaxSize() { return maxSize; @@ -204,10 +182,8 @@ public Integer getMaxSize() { /** * Sets the value of the maxSize property. * - * @param value - * allowed object is - * {@link Integer } - * + * @param value allowed object is + * {@link Integer } */ public void setMaxSize(Integer value) { this.maxSize = value; @@ -216,10 +192,8 @@ public void setMaxSize(Integer value) { /** * Gets the value of the groupBy property. * - * @return - * possible object is - * {@link Element } - * + * @return possible object is + * {@link Element } */ public ItemPathType getGroupBy() { return groupBy; @@ -228,10 +202,8 @@ public ItemPathType getGroupBy() { /** * Sets the value of the orderBy property. * - * @param value - * allowed object is - * {@link Element } - * + * @param value allowed object is + * {@link Element } */ public void setGroupBy(ItemPathType value) { this.groupBy = value; @@ -240,7 +212,6 @@ public void setGroupBy(ItemPathType value) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -249,31 +220,11 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; - { - ItemPathType theOrderBy; - theOrderBy = this.getOrderBy(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "orderBy", theOrderBy), currentHashCode, theOrderBy); - } - { - OrderDirectionType theOrderDirection; - theOrderDirection = this.getOrderDirection(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "orderDirection", theOrderDirection), currentHashCode, theOrderDirection); - } - { - Integer theOffset; - theOffset = this.getOffset(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "offset", theOffset), currentHashCode, theOffset); - } - { - Integer theMaxSize; - theMaxSize = this.getMaxSize(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "maxSize", theMaxSize), currentHashCode, theMaxSize); - } - { - ItemPathType theGroupBy; - theGroupBy = this.getGroupBy(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "groupBy", theGroupBy), currentHashCode, theGroupBy); - } + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "orderBy", this.getOrderBy()), currentHashCode, this.getOrderBy()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "orderDirection", this.getOrderDirection()), currentHashCode, this.getOrderDirection()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "offset", this.getOffset()), currentHashCode, this.getOffset()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "maxSize", this.getMaxSize()), currentHashCode, this.getMaxSize()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "groupBy", this.getGroupBy()), currentHashCode, this.getGroupBy()); return currentHashCode; } @@ -290,54 +241,45 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return true; } final PagingType that = ((PagingType) object); - { - ItemPathType lhsOrderBy; - lhsOrderBy = this.getOrderBy(); - ItemPathType rhsOrderBy; - rhsOrderBy = that.getOrderBy(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "orderBy", lhsOrderBy), LocatorUtils.property(thatLocator, "orderBy", rhsOrderBy), lhsOrderBy, rhsOrderBy)) { - return false; - } + ItemPathType lhsOrderBy; + lhsOrderBy = this.getOrderBy(); + ItemPathType rhsOrderBy; + rhsOrderBy = that.getOrderBy(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "orderBy", lhsOrderBy), LocatorUtils.property(thatLocator, "orderBy", rhsOrderBy), lhsOrderBy, rhsOrderBy)) { + return false; } - { - OrderDirectionType lhsOrderDirection; - lhsOrderDirection = this.getOrderDirection(); - OrderDirectionType rhsOrderDirection; - rhsOrderDirection = that.getOrderDirection(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "orderDirection", lhsOrderDirection), LocatorUtils.property(thatLocator, "orderDirection", rhsOrderDirection), lhsOrderDirection, rhsOrderDirection)) { - return false; - } + OrderDirectionType lhsOrderDirection; + lhsOrderDirection = this.getOrderDirection(); + OrderDirectionType rhsOrderDirection; + rhsOrderDirection = that.getOrderDirection(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "orderDirection", lhsOrderDirection), LocatorUtils.property(thatLocator, "orderDirection", rhsOrderDirection), lhsOrderDirection, rhsOrderDirection)) { + return false; } - { - Integer lhsOffset; - lhsOffset = this.getOffset(); - Integer rhsOffset; - rhsOffset = that.getOffset(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "offset", lhsOffset), LocatorUtils.property(thatLocator, "offset", rhsOffset), lhsOffset, rhsOffset)) { - return false; - } + Integer lhsOffset; + lhsOffset = this.getOffset(); + Integer rhsOffset; + rhsOffset = that.getOffset(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "offset", lhsOffset), LocatorUtils.property(thatLocator, "offset", rhsOffset), lhsOffset, rhsOffset)) { + return false; } - { - Integer lhsMaxSize; - lhsMaxSize = this.getMaxSize(); - Integer rhsMaxSize; - rhsMaxSize = that.getMaxSize(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "maxSize", lhsMaxSize), LocatorUtils.property(thatLocator, "maxSize", rhsMaxSize), lhsMaxSize, rhsMaxSize)) { - return false; - } + Integer lhsMaxSize; + lhsMaxSize = this.getMaxSize(); + Integer rhsMaxSize; + rhsMaxSize = that.getMaxSize(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "maxSize", lhsMaxSize), LocatorUtils.property(thatLocator, "maxSize", rhsMaxSize), lhsMaxSize, rhsMaxSize)) { + return false; } - { - ItemPathType lhsGroupBy; - lhsGroupBy = this.getGroupBy(); - ItemPathType rhsGroupBy; - rhsGroupBy = that.getOrderBy(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "groupBy", lhsGroupBy), LocatorUtils.property(thatLocator, "groupBy", rhsGroupBy), lhsGroupBy, rhsGroupBy)) { - return false; - } + ItemPathType lhsGroupBy; + lhsGroupBy = this.getGroupBy(); + ItemPathType rhsGroupBy; + rhsGroupBy = that.getOrderBy(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "groupBy", lhsGroupBy), LocatorUtils.property(thatLocator, "groupBy", rhsGroupBy), lhsGroupBy, rhsGroupBy)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -346,28 +288,24 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public PagingType clone() { try { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final PagingType clone = ((PagingType) super.clone()); - // CWildcardTypeInfo: org.w3c.dom.Element - clone.orderBy = ((this.orderBy == null)?null:((this.getOrderBy() == null)?null:(this.getOrderBy().clone()))); - // CEnumLeafInfo: com.evolveum.prism.xml.ns._public.query_3.OrderDirectionType - clone.orderDirection = ((this.orderDirection == null)?null:this.getOrderDirection()); - // CBuiltinLeafInfo: java.lang.Integer - clone.offset = ((this.offset == null)?null:this.getOffset()); - // CBuiltinLeafInfo: java.lang.Integer - clone.maxSize = ((this.maxSize == null)?null:this.getMaxSize()); - // CWildcardTypeInfo: org.w3c.dom.Element - clone.groupBy = ((this.groupBy == null)?null:((this.getGroupBy() == null)?null:(this.getGroupBy().clone()))); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final PagingType clone = ((PagingType) super.clone()); + // CWildcardTypeInfo: org.w3c.dom.Element + clone.orderBy = ((this.orderBy == null) ? null : ((this.getOrderBy() == null) ? null : (this.getOrderBy().clone()))); + // CEnumLeafInfo: com.evolveum.prism.xml.ns._public.query_3.OrderDirectionType + clone.orderDirection = ((this.orderDirection == null) ? null : this.getOrderDirection()); + // CBuiltinLeafInfo: java.lang.Integer + clone.offset = ((this.offset == null) ? null : this.getOffset()); + // CBuiltinLeafInfo: java.lang.Integer + clone.maxSize = ((this.maxSize == null) ? null : this.getMaxSize()); + // CWildcardTypeInfo: org.w3c.dom.Element + clone.groupBy = ((this.groupBy == null) ? null : ((this.getGroupBy() == null) ? null : (this.getGroupBy().clone()))); + return clone; } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyComplexValueFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyComplexValueFilterType.java index 52ab5eb3c86..6e2c2a778d4 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyComplexValueFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyComplexValueFilterType.java @@ -214,21 +214,9 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - Element thePath; - thePath = this.getPath(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "path", thePath), currentHashCode, thePath); - } - { - ValueType theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - { - Object theAny; - theAny = this.getAny(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "any", theAny), currentHashCode, theAny); - } + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "path", this.getPath()), currentHashCode, this.getPath()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", this.getValue()), currentHashCode, this.getValue()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "any", this.getAny()), currentHashCode, this.getAny()); return currentHashCode; } @@ -248,32 +236,26 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final PropertyComplexValueFilterType that = ((PropertyComplexValueFilterType) object); - { - Element lhsPath; - lhsPath = this.getPath(); - Element rhsPath; - rhsPath = that.getPath(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "path", lhsPath), LocatorUtils.property(thatLocator, "path", rhsPath), lhsPath, rhsPath)) { - return false; - } + Element lhsPath; + lhsPath = this.getPath(); + Element rhsPath; + rhsPath = that.getPath(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "path", lhsPath), LocatorUtils.property(thatLocator, "path", rhsPath), lhsPath, rhsPath)) { + return false; } - { - ValueType lhsValue; - lhsValue = this.getValue(); - ValueType rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } + ValueType lhsValue; + lhsValue = this.getValue(); + ValueType rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; } - { - Object lhsAny; - lhsAny = this.getAny(); - Object rhsAny; - rhsAny = that.getAny(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "any", lhsAny), LocatorUtils.property(thatLocator, "any", rhsAny), lhsAny, rhsAny)) { - return false; - } + Object lhsAny; + lhsAny = this.getAny(); + Object rhsAny; + rhsAny = that.getAny(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "any", lhsAny), LocatorUtils.property(thatLocator, "any", rhsAny), lhsAny, rhsAny)) { + return false; } return true; } @@ -679,17 +661,15 @@ private static Serializable copyOf(final Serializable serializable) { */ @Override public PropertyComplexValueFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final PropertyComplexValueFilterType clone = ((PropertyComplexValueFilterType) super.clone()); - // CWildcardTypeInfo: org.w3c.dom.Element - clone.path = ((this.path == null)?null:((this.getPath() == null)?null:((Element) this.getPath().cloneNode(true)))); - // CClassInfo: com.evolveum.prism.xml.ns._public.query_3.ValueType - clone.value = ((this.value == null)?null:((this.getValue() == null)?null:this.getValue().clone())); - // CBuiltinLeafInfo: java.lang.Object - clone.any = ((this.any == null)?null:copyOf(this.getAny())); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final PropertyComplexValueFilterType clone = ((PropertyComplexValueFilterType) super.clone()); + // CWildcardTypeInfo: org.w3c.dom.Element + clone.path = ((this.path == null)?null:((this.getPath() == null)?null:((Element) this.getPath().cloneNode(true)))); + // CClassInfo: com.evolveum.prism.xml.ns._public.query_3.ValueType + clone.value = ((this.value == null)?null:((this.getValue() == null)?null:this.getValue().clone())); + // CBuiltinLeafInfo: java.lang.Object + clone.any = ((this.any == null)?null:copyOf(this.getAny())); + return clone; } } diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyNoValueFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyNoValueFilterType.java index d25a353539b..7c331df39b6 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyNoValueFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertyNoValueFilterType.java @@ -7,17 +7,12 @@ package com.evolveum.prism.xml.ns._public.query_3; import java.io.Serializable; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -27,6 +22,9 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Element; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for PropertyNoValueFilterType complex type. @@ -47,12 +45,11 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PropertyNoValueFilterType", propOrder = { - "property" + "property" }) public class PropertyNoValueFilterType - extends FilterClauseType - implements Serializable, Cloneable, Equals, HashCode -{ + extends FilterClauseType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; @XmlAnyElement @@ -61,7 +58,6 @@ public class PropertyNoValueFilterType /** * Creates a new {@code PropertyNoValueFilterType} instance. - * */ public PropertyNoValueFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -71,11 +67,8 @@ public PropertyNoValueFilterType() { /** * Creates a new {@code PropertyNoValueFilterType} instance by deeply copying a given {@code PropertyNoValueFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public PropertyNoValueFilterType(final PropertyNoValueFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -84,16 +77,14 @@ public PropertyNoValueFilterType(final PropertyNoValueFilterType o) { throw new NullPointerException("Cannot create a copy of 'PropertyNoValueFilterType' from 'null'."); } // CWildcardTypeInfo: org.w3c.dom.Element - this.property = ((o.property == null)?null:((o.getProperty() == null)?null:((Element) o.getProperty().cloneNode(true)))); + this.property = ((o.property == null) ? null : ((o.getProperty() == null) ? null : ((Element) o.getProperty().cloneNode(true)))); } /** * Gets the value of the property property. * - * @return - * possible object is - * {@link Element } - * + * @return possible object is + * {@link Element } */ public Element getProperty() { return property; @@ -102,10 +93,8 @@ public Element getProperty() { /** * Sets the value of the property property. * - * @param value - * allowed object is - * {@link Element } - * + * @param value allowed object is + * {@link Element } */ public void setProperty(Element value) { this.property = value; @@ -114,7 +103,6 @@ public void setProperty(Element value) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -123,11 +111,9 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - Element theProperty; - theProperty = this.getProperty(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "property", theProperty), currentHashCode, theProperty); - } + Element theProperty; + theProperty = this.getProperty(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "property", theProperty), currentHashCode, theProperty); return currentHashCode; } @@ -147,18 +133,15 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final PropertyNoValueFilterType that = ((PropertyNoValueFilterType) object); - { - Element lhsProperty; - lhsProperty = this.getProperty(); - Element rhsProperty; - rhsProperty = that.getProperty(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "property", lhsProperty), LocatorUtils.property(thatLocator, "property", rhsProperty), lhsProperty, rhsProperty)) { - return false; - } + Element lhsProperty = this.getProperty(); + Element rhsProperty = that.getProperty(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "property", lhsProperty), LocatorUtils.property(thatLocator, "property", rhsProperty), lhsProperty, rhsProperty)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -167,19 +150,14 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public PropertyNoValueFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final PropertyNoValueFilterType clone = ((PropertyNoValueFilterType) super.clone()); - // CWildcardTypeInfo: org.w3c.dom.Element - clone.property = ((this.property == null)?null:((this.getProperty() == null)?null:((Element) this.getProperty().cloneNode(true)))); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final PropertyNoValueFilterType clone = ((PropertyNoValueFilterType) super.clone()); + // CWildcardTypeInfo: org.w3c.dom.Element + clone.property = ((this.property == null) ? null : ((this.getProperty() == null) ? null : ((Element) this.getProperty().cloneNode(true)))); + return clone; } - } diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertySimpleValueFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertySimpleValueFilterType.java index 0515cf57319..e774957aa01 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertySimpleValueFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/PropertySimpleValueFilterType.java @@ -6,17 +6,7 @@ */ package com.evolveum.prism.xml.ns._public.query_3; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InvalidClassException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OptionalDataException; -import java.io.Serializable; -import java.io.StreamCorruptedException; +import java.io.*; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; @@ -25,13 +15,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.util.Calendar; -import java.util.Currency; -import java.util.Date; -import java.util.Locale; -import java.util.TimeZone; -import java.util.UUID; - +import java.util.*; import javax.activation.MimeType; import javax.activation.MimeTypeParseException; import javax.xml.bind.JAXBElement; @@ -43,11 +27,6 @@ import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.prism.Raw; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -57,6 +36,10 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Element; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.prism.Raw; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for PropertySimpleValueFilterType complex type. @@ -78,19 +61,16 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PropertySimpleValueFilterType", propOrder = { - "property", - "value", - "any" + "property", + "value", + "any" }) public class PropertySimpleValueFilterType - extends FilterClauseType - implements Serializable, Cloneable, Equals, HashCode -{ + extends FilterClauseType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; @XmlAnyElement @@ -104,7 +84,6 @@ public class PropertySimpleValueFilterType /** * Creates a new {@code PropertySimpleValueFilterType} instance. - * */ public PropertySimpleValueFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -114,11 +93,8 @@ public PropertySimpleValueFilterType() { /** * Creates a new {@code PropertySimpleValueFilterType} instance by deeply copying a given {@code PropertySimpleValueFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public PropertySimpleValueFilterType(final PropertySimpleValueFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -127,20 +103,18 @@ public PropertySimpleValueFilterType(final PropertySimpleValueFilterType o) { throw new NullPointerException("Cannot create a copy of 'PropertySimpleValueFilterType' from 'null'."); } // CWildcardTypeInfo: org.w3c.dom.Element - this.property = ((o.property == null)?null:((o.getProperty() == null)?null:((Element) o.getProperty().cloneNode(true)))); + this.property = o.property == null ? null : o.getProperty() == null ? null : (Element) o.getProperty().cloneNode(true); // CBuiltinLeafInfo: java.lang.Object - this.value = ((o.value == null)?null:copyOf(o.getValue())); + this.value = o.value == null ? null : copyOf(o.getValue()); // CBuiltinLeafInfo: java.lang.Object - this.any = ((o.any == null)?null:copyOf(o.getAny())); + this.any = o.any == null ? null : copyOf(o.getAny()); } /** * Gets the value of the property property. * - * @return - * possible object is - * {@link Element } - * + * @return possible object is + * {@link Element } */ public Element getProperty() { return property; @@ -149,10 +123,8 @@ public Element getProperty() { /** * Sets the value of the property property. * - * @param value - * allowed object is - * {@link Element } - * + * @param value allowed object is + * {@link Element } */ public void setProperty(Element value) { this.property = value; @@ -161,10 +133,8 @@ public void setProperty(Element value) { /** * Gets the value of the value property. * - * @return - * possible object is - * {@link Object } - * + * @return possible object is + * {@link Object } */ public Object getValue() { return value; @@ -173,10 +143,8 @@ public Object getValue() { /** * Sets the value of the value property. * - * @param value - * allowed object is - * {@link Object } - * + * @param value allowed object is + * {@link Object } */ public void setValue(Object value) { this.value = value; @@ -185,10 +153,8 @@ public void setValue(Object value) { /** * Gets the value of the any property. * - * @return - * possible object is - * {@link Object } - * + * @return possible object is + * {@link Object } */ public Object getAny() { return any; @@ -197,10 +163,8 @@ public Object getAny() { /** * Sets the value of the any property. * - * @param value - * allowed object is - * {@link Object } - * + * @param value allowed object is + * {@link Object } */ public void setAny(Object value) { this.any = value; @@ -209,7 +173,6 @@ public void setAny(Object value) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -218,21 +181,9 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - Element theProperty; - theProperty = this.getProperty(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "property", theProperty), currentHashCode, theProperty); - } - { - Object theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - { - Object theAny; - theAny = this.getAny(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "any", theAny), currentHashCode, theAny); - } + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "property", this.getProperty()), currentHashCode, this.getProperty()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", this.getValue()), currentHashCode, this.getValue()); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "any", this.getAny()), currentHashCode, this.getAny()); return currentHashCode; } @@ -251,37 +202,26 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje if (!super.equals(thisLocator, thatLocator, object, strategy)) { return false; } - final PropertySimpleValueFilterType that = ((PropertySimpleValueFilterType) object); - { - Element lhsProperty; - lhsProperty = this.getProperty(); - Element rhsProperty; - rhsProperty = that.getProperty(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "property", lhsProperty), LocatorUtils.property(thatLocator, "property", rhsProperty), lhsProperty, rhsProperty)) { - return false; - } + final PropertySimpleValueFilterType that = (PropertySimpleValueFilterType) object; + Element lhsProperty = this.getProperty(); + Element rhsProperty = that.getProperty(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "property", lhsProperty), LocatorUtils.property(thatLocator, "property", rhsProperty), lhsProperty, rhsProperty)) { + return false; } - { - Object lhsValue; - lhsValue = this.getValue(); - Object rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } + Object lhsValue = this.getValue(); + Object rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; } - { - Object lhsAny; - lhsAny = this.getAny(); - Object rhsAny; - rhsAny = that.getAny(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "any", lhsAny), LocatorUtils.property(thatLocator, "any", rhsAny), lhsAny, rhsAny)) { - return false; - } + Object lhsAny = this.getAny(); + Object rhsAny = that.getAny(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "any", lhsAny), LocatorUtils.property(thatLocator, "any", rhsAny), lhsAny, rhsAny)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -290,16 +230,13 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of a given object. * - * @param o - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. + * @param o The instance to copy or {@code null}. + * @return A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. */ - @SuppressWarnings("unchecked") private static Object copyOf(final Object o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 try { - if (o!= null) { + if (o != null) { if (o.getClass().isPrimitive()) { return o; } @@ -385,84 +322,66 @@ private static Object copyOf(final Object o) { return ((Locale) o).clone(); } if (o instanceof Element) { - return ((Element)((Element) o).cloneNode(true)); + return ((Element) o).cloneNode(true); } if (o instanceof JAXBElement) { - return copyOf(((JAXBElement) o)); + return copyOf((JAXBElement) o); } try { - return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); + return o.getClass().getMethod("clone", (Class[]) null).invoke(o, (Object[]) null); } catch (NoSuchMethodException e) { if (o instanceof Serializable) { - return copyOf(((Serializable) o)); + return copyOf((Serializable) o); } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (IllegalAccessException e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (InvocationTargetException e) { + throw new AssertionError("Unexpected instance during copying object '" + o + "'.", e); + } catch (IllegalAccessException | ExceptionInInitializerError | IllegalArgumentException | SecurityException | InvocationTargetException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (SecurityException e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (IllegalArgumentException e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (ExceptionInInitializerError e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); + throw new AssertionError("Unexpected instance during copying object '" + o + "'.", e); } } return null; - } catch (URISyntaxException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (MalformedURLException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (MimeTypeParseException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); + } catch (URISyntaxException | MimeTypeParseException | MalformedURLException e) { + throw new AssertionError("Unexpected instance during copying object '" + o + "'.", e); } } /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static Object copyOfArray(final Object array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { + if (array != null) { if (array.getClass() == boolean[].class) { - return copyOf(((boolean[]) array)); + return copyOf((boolean[]) array); } if (array.getClass() == byte[].class) { - return copyOf(((byte[]) array)); + return copyOf((byte[]) array); } if (array.getClass() == char[].class) { - return copyOf(((char[]) array)); + return copyOf((char[]) array); } if (array.getClass() == double[].class) { - return copyOf(((double[]) array)); + return copyOf((double[]) array); } if (array.getClass() == float[].class) { - return copyOf(((float[]) array)); + return copyOf((float[]) array); } if (array.getClass() == int[].class) { - return copyOf(((int[]) array)); + return copyOf((int[]) array); } if (array.getClass() == long[].class) { - return copyOf(((long[]) array)); + return copyOf((long[]) array); } if (array.getClass() == short[].class) { - return copyOf(((short[]) array)); + return copyOf((short[]) array); } final int len = Array.getLength(array); final Object copy = Array.newInstance(array.getClass().getComponentType(), len); - for (int i = (len- 1); (i >= 0); i--) { + for (int i = len - 1; i >= 0; i--) { Array.set(copy, i, copyOf(Array.get(array, i))); } return copy; @@ -473,15 +392,13 @@ private static Object copyOfArray(final Object array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static boolean[] copyOf(final boolean[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final boolean[] copy = (boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -491,15 +408,13 @@ private static boolean[] copyOf(final boolean[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static byte[] copyOf(final byte[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final byte[] copy = (byte[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -509,15 +424,13 @@ private static byte[] copyOf(final byte[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static char[] copyOf(final char[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final char[] copy = (char[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -527,15 +440,13 @@ private static char[] copyOf(final char[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static double[] copyOf(final double[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final double[] copy = (double[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -545,15 +456,13 @@ private static double[] copyOf(final double[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static float[] copyOf(final float[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final float[] copy = (float[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -563,15 +472,13 @@ private static float[] copyOf(final float[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static int[] copyOf(final int[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final int[] copy = (int[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -581,15 +488,13 @@ private static int[] copyOf(final int[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static long[] copyOf(final long[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final long[] copy = (long[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -599,15 +504,13 @@ private static long[] copyOf(final long[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static short[] copyOf(final short[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final short[] copy = (short[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -617,15 +520,13 @@ private static short[] copyOf(final short[] array) { /** * Creates and returns a deep copy of a given {@code JAXBElement} instance. * - * @param element - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. + * @param element The instance to copy or {@code null}. + * @return A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. */ @SuppressWarnings("unchecked") private static JAXBElement copyOf(final JAXBElement element) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (element!= null) { + if (element != null) { final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); copy.setNil(element.isNil()); copy.setValue(copyOf(copy.getValue())); @@ -637,14 +538,12 @@ private static JAXBElement copyOf(final JAXBElement element) { /** * Creates and returns a deep copy of a given {@code Serializable}. * - * @param serializable - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. + * @param serializable The instance to copy or {@code null}. + * @return A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. */ private static Serializable copyOf(final Serializable serializable) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (serializable!= null) { + if (serializable != null) { try { final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); @@ -652,23 +551,11 @@ private static Serializable copyOf(final Serializable serializable) { out.close(); final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); final ObjectInputStream in = new ObjectInputStream(byteArrayInput); - final Serializable copy = ((Serializable) in.readObject()); + final Serializable copy = (Serializable) in.readObject(); in.close(); return copy; - } catch (SecurityException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (ClassNotFoundException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (InvalidClassException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (NotSerializableException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (StreamCorruptedException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (OptionalDataException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (IOException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); + } catch (ClassNotFoundException | SecurityException | IOException e) { + throw new AssertionError("Unexpected instance during copying object '" + serializable + "'.", e); } } return null; @@ -677,23 +564,18 @@ private static Serializable copyOf(final Serializable serializable) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public PropertySimpleValueFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final PropertySimpleValueFilterType clone = ((PropertySimpleValueFilterType) super.clone()); - // CWildcardTypeInfo: org.w3c.dom.Element - clone.property = ((this.property == null)?null:((this.getProperty() == null)?null:((Element) this.getProperty().cloneNode(true)))); - // CBuiltinLeafInfo: java.lang.Object - clone.value = ((this.value == null)?null:copyOf(this.getValue())); - // CBuiltinLeafInfo: java.lang.Object - clone.any = ((this.any == null)?null:copyOf(this.getAny())); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final PropertySimpleValueFilterType clone = (PropertySimpleValueFilterType) super.clone(); + // CWildcardTypeInfo: org.w3c.dom.Element + clone.property = this.property == null ? null : this.getProperty() == null ? null : (Element) this.getProperty().cloneNode(true); + // CBuiltinLeafInfo: java.lang.Object + clone.value = this.value == null ? null : copyOf(this.getValue()); + // CBuiltinLeafInfo: java.lang.Object + clone.any = this.any == null ? null : copyOf(this.getAny()); + return clone; } - } diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/QueryType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/QueryType.java index b226014a81d..fc650671684 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/QueryType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/QueryType.java @@ -6,17 +6,7 @@ */ package com.evolveum.prism.xml.ns._public.query_3; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InvalidClassException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OptionalDataException; -import java.io.Serializable; -import java.io.StreamCorruptedException; +import java.io.*; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; import java.math.BigDecimal; @@ -25,13 +15,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.util.Calendar; -import java.util.Currency; -import java.util.Date; -import java.util.Locale; -import java.util.TimeZone; -import java.util.UUID; - +import java.util.*; import javax.activation.MimeType; import javax.activation.MimeTypeParseException; import javax.xml.bind.JAXBElement; @@ -49,10 +33,8 @@ import com.evolveum.midpoint.util.DebugDumpable; import com.evolveum.midpoint.util.DebugUtil; - /** - * - * TODO + * TODO * * *

Java class for QueryType complex type. @@ -75,12 +57,11 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "QueryType", propOrder = { - "description", - "filter", - "paging" + "description", + "filter", + "paging" }) -public class QueryType implements Serializable, Cloneable, DebugDumpable -{ +public class QueryType implements Serializable, Cloneable, DebugDumpable { private final static long serialVersionUID = 201105211233L; public final static QName COMPLEX_TYPE = new QName(PrismConstants.NS_QUERY, "QueryType"); public final static QName F_DESCRIPTION = new QName(PrismConstants.NS_QUERY, "description"); @@ -92,15 +73,11 @@ public class QueryType implements Serializable, Cloneable, DebugDumpable protected SearchFilterType filter; protected PagingType paging; - - /** * Gets the value of the description property. * - * @return - * possible object is - * {@link String } - * + * @return possible object is + * {@link String } */ public String getDescription() { return description; @@ -109,10 +86,8 @@ public String getDescription() { /** * Sets the value of the description property. * - * @param value - * allowed object is - * {@link String } - * + * @param value allowed object is + * {@link String } */ public void setDescription(String value) { this.description = value; @@ -126,10 +101,8 @@ public QueryType description(String value) { /** * Gets the value of the filter property. * - * @return - * possible object is - * {@link SearchFilterType } - * + * @return possible object is + * {@link SearchFilterType } */ public SearchFilterType getFilter() { return filter; @@ -138,10 +111,8 @@ public SearchFilterType getFilter() { /** * Sets the value of the filter property. * - * @param value - * allowed object is - * {@link SearchFilterType } - * + * @param value allowed object is + * {@link SearchFilterType } */ public void setFilter(SearchFilterType value) { this.filter = value; @@ -155,10 +126,8 @@ public QueryType filter(SearchFilterType value) { /** * Gets the value of the paging property. * - * @return - * possible object is - * {@link PagingType } - * + * @return possible object is + * {@link PagingType } */ public PagingType getPaging() { return paging; @@ -167,10 +136,8 @@ public PagingType getPaging() { /** * Sets the value of the paging property. * - * @param value - * allowed object is - * {@link PagingType } - * + * @param value allowed object is + * {@link PagingType } */ public void setPaging(PagingType value) { this.paging = value; @@ -185,52 +152,40 @@ public QueryType paging(PagingType value) { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((description == null) ? 0 : description.hashCode()); - result = prime * result + ((filter == null) ? 0 : filter.hashCode()); - result = prime * result + ((paging == null) ? 0 : paging.hashCode()); + result = prime * result + (description == null ? 0 : description.hashCode()); + result = prime * result + (filter == null ? 0 : filter.hashCode()); + result = prime * result + (paging == null ? 0 : paging.hashCode()); return result; } @Override public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; + if (this == obj) { return true; } + if (obj == null) { return false; } + if (getClass() != obj.getClass()) { return false; } QueryType other = (QueryType) obj; if (description == null) { - if (other.description != null) - return false; - } else if (!description.equals(other.description)) - return false; + if (other.description != null) { return false; } + } else if (!description.equals(other.description)) { return false; } if (filter == null) { - if (other.filter != null) - return false; - } else if (!filter.equals(other.filter)) - return false; + if (other.filter != null) { return false; } + } else if (!filter.equals(other.filter)) { return false; } if (paging == null) { - if (other.paging != null) - return false; - } else if (!paging.equals(other.paging)) - return false; + if (other.paging != null) { return false; } + } else if (!paging.equals(other.paging)) { return false; } return true; } /** * Creates and returns a deep copy of a given object. * - * @param o - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. + * @param o The instance to copy or {@code null}. + * @return A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. */ - @SuppressWarnings("unchecked") private static Object copyOf(final Object o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 try { - if (o!= null) { + if (o != null) { if (o.getClass().isPrimitive()) { return o; } @@ -319,81 +274,63 @@ private static Object copyOf(final Object o) { return ((Element) o).cloneNode(true); } if (o instanceof JAXBElement) { - return copyOf(((JAXBElement) o)); + return copyOf((JAXBElement) o); } try { - return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); + return o.getClass().getMethod("clone", (Class[]) null).invoke(o, (Object[]) null); } catch (NoSuchMethodException e) { if (o instanceof Serializable) { - return copyOf(((Serializable) o)); + return copyOf((Serializable) o); } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (IllegalAccessException e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (InvocationTargetException e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (SecurityException e) { + throw new AssertionError("Unexpected instance during copying object '" + o + "'.", e); + } catch (IllegalAccessException | ExceptionInInitializerError | IllegalArgumentException | SecurityException | InvocationTargetException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (IllegalArgumentException e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (ExceptionInInitializerError e) { - // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); + throw new AssertionError("Unexpected instance during copying object '" + o + "'.", e); } } return null; - } catch (MimeTypeParseException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (MalformedURLException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); - } catch (URISyntaxException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); + } catch (MimeTypeParseException | URISyntaxException | MalformedURLException e) { + throw new AssertionError("Unexpected instance during copying object '" + o + "'.", e); } } /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static Object copyOfArray(final Object array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { + if (array != null) { if (array.getClass() == boolean[].class) { - return copyOf(((boolean[]) array)); + return copyOf((boolean[]) array); } if (array.getClass() == byte[].class) { - return copyOf(((byte[]) array)); + return copyOf((byte[]) array); } if (array.getClass() == char[].class) { - return copyOf(((char[]) array)); + return copyOf((char[]) array); } if (array.getClass() == double[].class) { - return copyOf(((double[]) array)); + return copyOf((double[]) array); } if (array.getClass() == float[].class) { - return copyOf(((float[]) array)); + return copyOf((float[]) array); } if (array.getClass() == int[].class) { - return copyOf(((int[]) array)); + return copyOf((int[]) array); } if (array.getClass() == long[].class) { - return copyOf(((long[]) array)); + return copyOf((long[]) array); } if (array.getClass() == short[].class) { - return copyOf(((short[]) array)); + return copyOf((short[]) array); } final int len = Array.getLength(array); final Object copy = Array.newInstance(array.getClass().getComponentType(), len); - for (int i = (len- 1); (i >= 0); i--) { + for (int i = len - 1; i >= 0; i--) { Array.set(copy, i, copyOf(Array.get(array, i))); } return copy; @@ -404,15 +341,13 @@ private static Object copyOfArray(final Object array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static boolean[] copyOf(final boolean[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final boolean[] copy = (boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -422,15 +357,13 @@ private static boolean[] copyOf(final boolean[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static byte[] copyOf(final byte[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final byte[] copy = (byte[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -440,15 +373,13 @@ private static byte[] copyOf(final byte[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static char[] copyOf(final char[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final char[] copy = (char[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -458,15 +389,13 @@ private static char[] copyOf(final char[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static double[] copyOf(final double[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final double[] copy = (double[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -476,15 +405,13 @@ private static double[] copyOf(final double[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static float[] copyOf(final float[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final float[] copy = (float[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -494,15 +421,13 @@ private static float[] copyOf(final float[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static int[] copyOf(final int[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final int[] copy = (int[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -512,15 +437,13 @@ private static int[] copyOf(final int[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static long[] copyOf(final long[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final long[] copy = (long[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -530,15 +453,13 @@ private static long[] copyOf(final long[] array) { /** * Creates and returns a deep copy of a given array. * - * @param array - * The array to copy or {@code null}. - * @return - * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. + * @param array The array to copy or {@code null}. + * @return A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. */ private static short[] copyOf(final short[] array) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (array!= null) { - final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); + if (array != null) { + final short[] copy = (short[]) Array.newInstance(array.getClass().getComponentType(), array.length); System.arraycopy(array, 0, copy, 0, array.length); return copy; } @@ -548,14 +469,12 @@ private static short[] copyOf(final short[] array) { /** * Creates and returns a deep copy of a given {@code Serializable}. * - * @param serializable - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. + * @param serializable The instance to copy or {@code null}. + * @return A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. */ private static Serializable copyOf(final Serializable serializable) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (serializable!= null) { + if (serializable != null) { try { final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); @@ -563,23 +482,11 @@ private static Serializable copyOf(final Serializable serializable) { out.close(); final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); final ObjectInputStream in = new ObjectInputStream(byteArrayInput); - final Serializable copy = ((Serializable) in.readObject()); + final Serializable copy = (Serializable) in.readObject(); in.close(); return copy; - } catch (SecurityException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (ClassNotFoundException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (InvalidClassException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (NotSerializableException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (StreamCorruptedException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (OptionalDataException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); - } catch (IOException e) { - throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); + } catch (ClassNotFoundException | SecurityException | IOException e) { + throw new AssertionError("Unexpected instance during copying object '" + serializable + "'.", e); } } return null; @@ -588,24 +495,20 @@ private static Serializable copyOf(final Serializable serializable) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public QueryType clone() { try { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final QueryType clone = ((QueryType) super.clone()); - // CBuiltinLeafInfo: java.lang.String - clone.description = ((this.description == null)?null:this.getDescription()); - // CWildcardTypeInfo: org.w3c.dom.Element - clone.filter = ((this.filter == null)?null:((this.getFilter() == null)?null:((SearchFilterType) this.getFilter().clone()))); - // CClassInfo: com.evolveum.prism.xml.ns._public.query_3.PagingType - clone.paging = ((this.paging == null)?null:((this.getPaging() == null)?null:this.getPaging().clone())); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final QueryType clone = (QueryType) super.clone(); + // CBuiltinLeafInfo: java.lang.String + clone.description = this.description == null ? null : this.getDescription(); + // CWildcardTypeInfo: org.w3c.dom.Element + clone.filter = this.filter == null ? null : this.getFilter() == null ? null : this.getFilter().clone(); + // CClassInfo: com.evolveum.prism.xml.ns._public.query_3.PagingType + clone.paging = this.paging == null ? null : this.getPaging() == null ? null : this.getPaging().clone(); + return clone; } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/SearchFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/SearchFilterType.java index 4f8d402866e..18e43d27969 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/SearchFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/SearchFilterType.java @@ -11,7 +11,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -28,13 +27,7 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Element; -import com.evolveum.midpoint.prism.AbstractFreezable; -import com.evolveum.midpoint.prism.Freezable; -import com.evolveum.midpoint.prism.JaxbVisitable; -import com.evolveum.midpoint.prism.JaxbVisitor; -import com.evolveum.midpoint.prism.ParsingContext; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.xnode.MapXNode; import com.evolveum.midpoint.prism.xnode.PrimitiveXNode; import com.evolveum.midpoint.prism.xnode.RootXNode; @@ -49,11 +42,10 @@ @XmlAccessorType(XmlAccessType.NONE) // we select getters/fields to expose via JAXB individually @XmlType(name = "SearchFilterType", propOrder = { // no prop order, because we serialize this class manually - // BTW, the order is the following: description, filterClause + // BTW, the order is the following: description, filterClause }) -public class SearchFilterType extends AbstractFreezable implements Serializable, Cloneable, Equals, HashCode, DebugDumpable, Freezable, JaxbVisitable -{ +public class SearchFilterType extends AbstractFreezable implements Serializable, Cloneable, Equals, HashCode, DebugDumpable, Freezable, JaxbVisitable { private final static long serialVersionUID = 201303040000L; @XmlElement @@ -67,7 +59,6 @@ public class SearchFilterType extends AbstractFreezable implements Serializable, /** * Creates a new {@code QueryType} instance. - * */ public SearchFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -77,11 +68,8 @@ public SearchFilterType() { /** * Creates a new {@code QueryType} instance by deeply copying a given {@code QueryType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public SearchFilterType(final SearchFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -100,7 +88,6 @@ public void setDescription(String description) { this.description = description; } - public boolean containsFilterClause() { return filterClauseXNode != null && !filterClauseXNode.isEmpty(); } @@ -152,13 +139,13 @@ public void parseFromXNode(XNode xnode, ParsingContext pc, PrismContext prismCon this.description = null; } else { if (!(xnode instanceof MapXNode)) { - throw new SchemaException("Cannot parse filter from "+xnode); + throw new SchemaException("Cannot parse filter from " + xnode); } - MapXNode xmap = (MapXNode)xnode; + MapXNode xmap = (MapXNode) xnode; XNode xdesc = xmap.get(SearchFilterType.F_DESCRIPTION); if (xdesc != null) { if (xdesc instanceof PrimitiveXNode) { - String desc = ((PrimitiveXNode)xdesc).getParsedValue(DOMUtil.XSD_STRING, String.class); + String desc = ((PrimitiveXNode) xdesc).getParsedValue(DOMUtil.XSD_STRING, String.class); setDescription(desc); } else { throw new SchemaException("Description must have a primitive value"); @@ -197,7 +184,6 @@ public MapXNode serializeToXNode(PrismContext prismContext) throws SchemaExcepti /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -206,11 +192,8 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; - { - MapXNode theFilter; - theFilter = this.filterClauseXNode; - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "filter", theFilter), currentHashCode, theFilter); - } + MapXNode theFilter = this.filterClauseXNode; + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "filter", theFilter), currentHashCode, theFilter); return currentHashCode; } @@ -230,10 +213,8 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje final SearchFilterType that = ((SearchFilterType) object); if (filterClauseXNode == null) { - if (that.filterClauseXNode != null) - return false; - } else if (!filterClauseXNode.equals(that.filterClauseXNode)) - return false; + if (that.filterClauseXNode != null) { return false; } + } else if (!filterClauseXNode.equals(that.filterClauseXNode)) { return false; } return true; } @@ -247,9 +228,7 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @SuppressWarnings("MethodDoesntCallSuperMethod") @Override @@ -257,7 +236,7 @@ public SearchFilterType clone() { final SearchFilterType clone; try { clone = this.getClass().newInstance(); // TODO fix this using super.clone() - } catch (InstantiationException|IllegalAccessException e) { + } catch (InstantiationException | IllegalAccessException e) { throw new IllegalStateException("Couldn't instantiate " + this.getClass() + ": " + e.getMessage(), e); } clone.description = this.description; diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/UriFilterType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/UriFilterType.java index f1dbb335508..fbd3aab244d 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/UriFilterType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/UriFilterType.java @@ -7,18 +7,9 @@ package com.evolveum.prism.xml.ns._public.query_3; import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -27,6 +18,9 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for UriFilterType complex type. @@ -46,9 +40,8 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "UriFilterType") public class UriFilterType - extends FilterClauseType - implements Serializable, Cloneable, Equals, HashCode -{ + extends FilterClauseType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; @XmlAttribute(name = "uri") @@ -59,7 +52,6 @@ public class UriFilterType /** * Creates a new {@code UriFilterType} instance. - * */ public UriFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -69,11 +61,8 @@ public UriFilterType() { /** * Creates a new {@code UriFilterType} instance by deeply copying a given {@code UriFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public UriFilterType(final UriFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -82,16 +71,14 @@ public UriFilterType(final UriFilterType o) { throw new NullPointerException("Cannot create a copy of 'UriFilterType' from 'null'."); } // CBuiltinLeafInfo: java.lang.String - this.uri = ((o.uri == null)?null:o.getUri()); + this.uri = ((o.uri == null) ? null : o.getUri()); } /** * Gets the value of the uri property. * - * @return - * possible object is - * {@link String } - * + * @return possible object is + * {@link String } */ public String getUri() { return uri; @@ -100,10 +87,8 @@ public String getUri() { /** * Sets the value of the uri property. * - * @param value - * allowed object is - * {@link String } - * + * @param value allowed object is + * {@link String } */ public void setUri(String value) { this.uri = value; @@ -112,7 +97,6 @@ public void setUri(String value) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -121,11 +105,7 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - String theUri; - theUri = this.getUri(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "uri", theUri), currentHashCode, theUri); - } + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "uri", getUri()), currentHashCode, getUri()); return currentHashCode; } @@ -145,18 +125,17 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final UriFilterType that = ((UriFilterType) object); - { - String lhsUri; - lhsUri = this.getUri(); - String rhsUri; - rhsUri = that.getUri(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "uri", lhsUri), LocatorUtils.property(thatLocator, "uri", rhsUri), lhsUri, rhsUri)) { - return false; - } + String lhsUri; + lhsUri = this.getUri(); + String rhsUri; + rhsUri = that.getUri(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "uri", lhsUri), LocatorUtils.property(thatLocator, "uri", rhsUri), lhsUri, rhsUri)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -165,19 +144,15 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public UriFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final UriFilterType clone = ((UriFilterType) super.clone()); - // CBuiltinLeafInfo: java.lang.String - clone.uri = ((this.uri == null)?null:this.getUri()); - return clone; - } - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final UriFilterType clone = ((UriFilterType) super.clone()); + // CBuiltinLeafInfo: java.lang.String + clone.uri = ((this.uri == null) ? null : this.getUri()); + return clone; + } } diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/ValueType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/ValueType.java index 00b9b09345b..c2ebdb56785 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/ValueType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/query_3/ValueType.java @@ -8,20 +8,10 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlMixed; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.PrismConstants; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; - import org.apache.commons.lang.builder.ToStringBuilder; import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; @@ -31,6 +21,9 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Element; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for ValueType complex type. @@ -51,10 +44,9 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ValueType", propOrder = { - "content" + "content" }) -public class ValueType implements Serializable, Cloneable, Equals, HashCode -{ +public class ValueType implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; @XmlMixed @@ -64,7 +56,6 @@ public class ValueType implements Serializable, Cloneable, Equals, HashCode /** * Creates a new {@code ValueType} instance. - * */ public ValueType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -74,11 +65,8 @@ public ValueType() { /** * Creates a new {@code ValueType} instance by deeply copying a given {@code ValueType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public ValueType(final ValueType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -87,7 +75,7 @@ public ValueType(final ValueType o) { throw new NullPointerException("Cannot create a copy of 'ValueType' from 'null'."); } // 'Content' collection. - if (o.content!= null) { + if (o.content != null) { copyContent(o.getContent(), this.getContent()); } } @@ -112,8 +100,6 @@ public ValueType(final ValueType o) { * Objects of the following type(s) are allowed in the list * {@link String } * {@link Element } - * - * */ public List getContent() { if (content == null) { @@ -125,7 +111,6 @@ public List getContent() { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ @Override public String toString() { @@ -134,11 +119,9 @@ public String toString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; - { - List theContent; - theContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent); - } + List theContent; + theContent = this.content != null && !this.content.isEmpty() ? this.getContent() : null; + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent); return currentHashCode; } @@ -154,19 +137,15 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje if (this == object) { return true; } - final ValueType that = ((ValueType) object); - { - List lhsContent; - lhsContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); - List rhsContent; - rhsContent = (((that.content!= null)&&(!that.content.isEmpty()))?that.getContent():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent)) { - return false; - } - } - return true; + final ValueType that = (ValueType) object; + List lhsContent; + lhsContent = this.content != null && !this.content.isEmpty() ? this.getContent() : null; + List rhsContent; + rhsContent = that.content != null && !that.content.isEmpty() ? that.getContent() : null; + return strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent); } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -175,31 +154,26 @@ public boolean equals(Object object) { /** * Copies all values of property {@code Content} deeply. * - * @param source - * The source to copy from. - * @param target - * The target to copy {@code source} to. - * @throws NullPointerException - * if {@code target} is {@code null}. + * @param source The source to copy from. + * @param target The target to copy {@code source} to. + * @throws NullPointerException if {@code target} is {@code null}. */ - @SuppressWarnings("unchecked") private static void copyContent(final List source, final List target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if ((source!= null)&&(!source.isEmpty())) { - for (final Iterator it = source.iterator(); it.hasNext(); ) { - final Object next = it.next(); + if (source != null && !source.isEmpty()) { + for (final Object next : source) { if (next instanceof Element) { // CWildcardTypeInfo: org.w3c.dom.Element - target.add(((Element)((Element) next).cloneNode(true))); + target.add(((Element) next).cloneNode(true)); continue; } if (next instanceof String) { // CBuiltinLeafInfo: java.lang.String - target.add(((String) next)); + target.add(next); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Content' of class 'com.evolveum.prism.xml.ns._public.query_3.ValueType'.")); + throw new AssertionError("Unexpected instance '" + next + "' for property 'Content' of class 'com.evolveum.prism.xml.ns._public.query_3.ValueType'."); } } } @@ -207,23 +181,19 @@ private static void copyContent(final List source, final List ta /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public ValueType clone() { try { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final ValueType clone = ((ValueType) super.clone()); - // 'Content' collection. - if (this.content!= null) { - clone.content = null; - copyContent(this.getContent(), clone.getContent()); - } - return clone; + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final ValueType clone = (ValueType) super.clone(); + // 'Content' collection. + if (this.content != null) { + clone.content = null; + copyContent(this.getContent(), clone.getContent()); } + return clone; } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); diff --git a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/XmlAsStringType.java b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/XmlAsStringType.java index c2eb3a6e13c..c3c7c6f93b6 100644 --- a/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/XmlAsStringType.java +++ b/infra/prism-api/src/main/java/com/evolveum/prism/xml/ns/_public/types_3/XmlAsStringType.java @@ -7,11 +7,11 @@ package com.evolveum.prism.xml.ns._public.types_3; -import com.evolveum.midpoint.prism.JaxbVisitable; -import com.evolveum.midpoint.prism.JaxbVisitor; -import com.evolveum.midpoint.util.DOMUtil; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.*; + import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; @@ -20,14 +20,11 @@ import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; import org.w3c.dom.Node; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlMixed; -import javax.xml.bind.annotation.XmlType; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; +import com.evolveum.midpoint.prism.JaxbVisitable; +import com.evolveum.midpoint.prism.JaxbVisitor; +import com.evolveum.midpoint.util.DOMUtil; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** * A class used to hold string represented either as plain string or as XML markup. (Useful e.g. for jasper templates.) @@ -40,12 +37,11 @@ public class XmlAsStringType implements Serializable, Cloneable, Equals, HashCod private final static long serialVersionUID = 201105211233L; @XmlMixed - @XmlAnyElement(lax = false) // JAXB should not try to unmarshal inner elements + @XmlAnyElement(lax = false) // JAXB should not try to unmarshal inner elements protected List content; /** * Creates a new {@code XmlAsStringType} instance. - * */ public XmlAsStringType() { } @@ -70,7 +66,7 @@ public String getContentAsString() { } else if (object instanceof Node) { sb.append(DOMUtil.serializeDOMToString((Node) object)); } else { - throw new IllegalStateException("Unexpected content in XmlAsStringType: " + (object!=null?object.getClass():"(null)")); + throw new IllegalStateException("Unexpected content in XmlAsStringType: " + (object != null ? object.getClass() : "(null)")); } } return sb.toString(); @@ -78,11 +74,9 @@ public String getContentAsString() { public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; - { - List theContent; - theContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent); - } + List theContent; + theContent = this.content != null && !this.content.isEmpty() ? this.getContent() : null; + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "content", theContent), currentHashCode, theContent); return currentHashCode; } @@ -98,19 +92,18 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje if (this == object) { return true; } - final XmlAsStringType that = ((XmlAsStringType) object); - { - List lhsContent; - lhsContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null); - List rhsContent; - rhsContent = (((that.content!= null)&&(!that.content.isEmpty()))?that.getContent():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent)) { - return false; - } + final XmlAsStringType that = (XmlAsStringType) object; + List lhsContent; + lhsContent = this.content != null && !this.content.isEmpty() ? this.getContent() : null; + List rhsContent; + rhsContent = that.content != null && !that.content.isEmpty() ? that.getContent() : null; + if (!strategy.equals(LocatorUtils.property(thisLocator, "content", lhsContent), LocatorUtils.property(thatLocator, "content", rhsContent), lhsContent, rhsContent)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -119,14 +112,13 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public XmlAsStringType clone() { final XmlAsStringType clone; try { - clone = ((XmlAsStringType) super.clone()); + clone = (XmlAsStringType) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Couldn't clone object's superclass", e); } @@ -138,7 +130,7 @@ public XmlAsStringType clone() { } else if (o instanceof Node) { clone.content.add(((Node) o).cloneNode(true)); } else { - throw new IllegalStateException("XmlAsStringType.clone: unexpected item in content: " + (o!=null?o.getClass():"(null)")); + throw new IllegalStateException("XmlAsStringType.clone: unexpected item in content: " + (o != null ? o.getClass() : "(null)")); } } } diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventCategoryFilterType.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventCategoryFilterType.java index fadefd00fdf..d428d007c2f 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventCategoryFilterType.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventCategoryFilterType.java @@ -8,8 +8,13 @@ package com.evolveum.midpoint.prism.foo; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; @@ -17,29 +22,22 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EventCategoryFilterType", propOrder = { - "category" + "category" }) public class EventCategoryFilterType - extends EventHandlerType - implements Serializable, Cloneable, Equals, HashCode -{ + extends EventHandlerType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; protected List category; /** * Creates a new {@code EventCategoryFilterType} instance. - * */ public EventCategoryFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -49,11 +47,8 @@ public EventCategoryFilterType() { /** * Creates a new {@code EventCategoryFilterType} instance by deeply copying a given {@code EventCategoryFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public EventCategoryFilterType(final EventCategoryFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -62,7 +57,7 @@ public EventCategoryFilterType(final EventCategoryFilterType o) { throw new NullPointerException("Cannot create a copy of 'EventCategoryFilterType' from 'null'."); } // 'Category' collection. - if (o.category!= null) { + if (o.category != null) { copyCategory(o.getCategory(), this.getCategory()); } } @@ -86,8 +81,6 @@ public EventCategoryFilterType(final EventCategoryFilterType o) { *

* Objects of the following type(s) are allowed in the list * {@link String } - * - * */ public List getCategory() { if (category == null) { @@ -99,16 +92,13 @@ public List getCategory() { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - List theCategory; - theCategory = (((this.category!= null)&&(!this.category.isEmpty()))?this.getCategory():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "category", theCategory), currentHashCode, theCategory); - } + List theCategory; + theCategory = (((this.category != null) && (!this.category.isEmpty())) ? this.getCategory() : null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "category", theCategory), currentHashCode, theCategory); return currentHashCode; } @@ -128,14 +118,12 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final EventCategoryFilterType that = ((EventCategoryFilterType) object); - { - List lhsCategory; - lhsCategory = (((this.category!= null)&&(!this.category.isEmpty()))?this.getCategory():null); - List rhsCategory; - rhsCategory = (((that.category!= null)&&(!that.category.isEmpty()))?that.getCategory():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "category", lhsCategory), LocatorUtils.property(thatLocator, "category", rhsCategory), lhsCategory, rhsCategory)) { - return false; - } + List lhsCategory; + lhsCategory = (((this.category != null) && (!this.category.isEmpty())) ? this.getCategory() : null); + List rhsCategory; + rhsCategory = (((that.category != null) && (!that.category.isEmpty())) ? that.getCategory() : null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "category", lhsCategory), LocatorUtils.property(thatLocator, "category", rhsCategory), lhsCategory, rhsCategory)) { + return false; } return true; } @@ -148,26 +136,21 @@ public boolean equals(Object object) { /** * Copies all values of property {@code Category} deeply. * - * @param source - * The source to copy from. - * @param target - * The target to copy {@code source} to. - * @throws NullPointerException - * if {@code target} is {@code null}. + * @param source The source to copy from. + * @param target The target to copy {@code source} to. + * @throws NullPointerException if {@code target} is {@code null}. */ - @SuppressWarnings("unchecked") private static void copyCategory(final List source, final List target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if ((source!= null)&&(!source.isEmpty())) { - for (final Iterator it = source.iterator(); it.hasNext(); ) { - final Object next = it.next(); + if ((source != null) && (!source.isEmpty())) { + for (final Object next : source) { if (next instanceof String) { // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.String target.add(((String) next)); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Category' of class 'com.evolveum.midpoint.xml.ns._public.common.common_3.EventCategoryFilterType'.")); + throw new AssertionError((("Unexpected instance '" + next) + "' for property 'Category' of class 'com.evolveum.midpoint.xml.ns._public.common.common_3.EventCategoryFilterType'.")); } } } @@ -175,22 +158,18 @@ private static void copyCategory(final List source, final List t /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public EventCategoryFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final EventCategoryFilterType clone = ((EventCategoryFilterType) super.clone()); - // 'Category' collection. - if (this.category!= null) { - clone.category = null; - copyCategory(this.getCategory(), clone.getCategory()); - } - return clone; + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final EventCategoryFilterType clone = ((EventCategoryFilterType) super.clone()); + // 'Category' collection. + if (this.category != null) { + clone.category = null; + copyCategory(this.getCategory(), clone.getCategory()); } + return clone; } @Override diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerChainType.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerChainType.java index aad12b7024a..2eba3a1ab0f 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerChainType.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerChainType.java @@ -8,8 +8,16 @@ package com.evolveum.midpoint.prism.foo; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; @@ -17,25 +25,16 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElementRef; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EventHandlerChainType", propOrder = { - "handler" + "handler" }) public class EventHandlerChainType - extends EventHandlerType - implements Serializable, Cloneable, Equals, HashCode -{ + extends EventHandlerType + implements Serializable, Cloneable, Equals, HashCode { public final static QName COMPLEX_TYPE = new QName("http://midpoint.evolveum.com/xml/ns/test/foo-1.xsd", "EventHandlerChainType"); private final static long serialVersionUID = 201105211233L; @@ -44,7 +43,6 @@ public class EventHandlerChainType /** * Creates a new {@code EventHandlerChainType} instance. - * */ public EventHandlerChainType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -54,11 +52,8 @@ public EventHandlerChainType() { /** * Creates a new {@code EventHandlerChainType} instance by deeply copying a given {@code EventHandlerChainType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public EventHandlerChainType(final EventHandlerChainType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -67,7 +62,7 @@ public EventHandlerChainType(final EventHandlerChainType o) { throw new NullPointerException("Cannot create a copy of 'EventHandlerChainType' from 'null'."); } // 'Handler' collection. - if (o.handler!= null) { + if (o.handler != null) { copyHandler(o.getHandler(), this.getHandler()); } } @@ -103,8 +98,6 @@ public EventHandlerChainType(final EventHandlerChainType o) { * {@link javax.xml.bind.JAXBElement }{@code <}{@link EventHandlerForkType }{@code >} * {@link javax.xml.bind.JAXBElement }{@code <}{@link EventOperationFilterType }{@code >} * {@link javax.xml.bind.JAXBElement }{@code <}{@link SimpleUserNotifierType }{@code >} - * - * */ public List> getHandler() { if (handler == null) { @@ -116,15 +109,12 @@ public List> getHandler() { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - List> theHandler; - theHandler = (((this.handler!= null)&&(!this.handler.isEmpty()))?this.getHandler():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handler", theHandler), currentHashCode, theHandler); - } + List> theHandler; + theHandler = (((this.handler != null) && (!this.handler.isEmpty())) ? this.getHandler() : null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handler", theHandler), currentHashCode, theHandler); return currentHashCode; } @@ -144,18 +134,14 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final EventHandlerChainType that = ((EventHandlerChainType) object); - { - List> lhsHandler; - lhsHandler = (((this.handler!= null)&&(!this.handler.isEmpty()))?this.getHandler():null); - List> rhsHandler; - rhsHandler = (((that.handler!= null)&&(!that.handler.isEmpty()))?that.getHandler():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "handler", lhsHandler), LocatorUtils.property(thatLocator, "handler", rhsHandler), lhsHandler, rhsHandler)) { - return false; - } - } - return true; + List> lhsHandler; + lhsHandler = (((this.handler != null) && (!this.handler.isEmpty())) ? this.getHandler() : null); + List> rhsHandler; + rhsHandler = (((that.handler != null) && (!that.handler.isEmpty())) ? that.getHandler() : null); + return strategy.equals(LocatorUtils.property(thisLocator, "handler", lhsHandler), LocatorUtils.property(thatLocator, "handler", rhsHandler), lhsHandler, rhsHandler); } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -164,19 +150,15 @@ public boolean equals(Object object) { /** * Copies all values of property {@code Handler} deeply. * - * @param source - * The source to copy from. - * @param target - * The target to copy {@code source} to. - * @throws NullPointerException - * if {@code target} is {@code null}. + * @param source The source to copy from. + * @param target The target to copy {@code source} to. + * @throws NullPointerException if {@code target} is {@code null}. */ @SuppressWarnings("unchecked") private static void copyHandler(final List> source, final List> target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if ((source!= null)&&(!source.isEmpty())) { - for (final Iterator it = source.iterator(); it.hasNext(); ) { - final Object next = it.next(); + if ((source != null) && (!source.isEmpty())) { + for (final Object next : source) { if (next instanceof JAXBElement) { // Referenced elements without classes. if (((JAXBElement) next).getValue() instanceof EventOperationFilterType) { @@ -206,7 +188,7 @@ private static void copyHandler(final List} instance. * - * @param e - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. + * @param e The instance to copy or {@code null}. + * @return A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ - @SuppressWarnings("unchecked") - private static JAXBElement copyOfEventOperationFilterTypeElement(final JAXBElement e) { + private static JAXBElement copyOfEventOperationFilterTypeElement( + final JAXBElement e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (e!= null) { + if (e != null) { final JAXBElement copy = new JAXBElement<>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.EventOperationFilterType - copy.setValue(((((EventOperationFilterType) copy.getValue()) == null)?null:((EventOperationFilterType) copy.getValue()).clone())); + copy.setValue(((copy.getValue() == null) ? null : copy.getValue().clone())); return copy; } return null; } - /** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement} instance. * - * @param e - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. + * @param e The instance to copy or {@code null}. + * @return A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ - @SuppressWarnings("unchecked") private static JAXBElement copyOfEventStatusFilterTypeElement(final JAXBElement e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (e!= null) { + if (e != null) { final JAXBElement copy = new JAXBElement<>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.EventStatusFilterType - copy.setValue(((((EventStatusFilterType) copy.getValue()) == null)?null:((EventStatusFilterType) copy.getValue()).clone())); + copy.setValue(((copy.getValue() == null) ? null : copy.getValue().clone())); return copy; } return null; @@ -257,63 +233,52 @@ private static JAXBElement copyOfEventStatusFilterTypeEle /** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement} instance. * - * @param e - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. + * @param e The instance to copy or {@code null}. + * @return A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ - @SuppressWarnings("unchecked") private static JAXBElement copyOfEventCategoryFilterTypeElement(final JAXBElement e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (e!= null) { + if (e != null) { final JAXBElement copy = new JAXBElement<>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.EventCategoryFilterType - copy.setValue(((((EventCategoryFilterType) copy.getValue()) == null)?null:((EventCategoryFilterType) copy.getValue()).clone())); + copy.setValue(((copy.getValue() == null) ? null : copy.getValue().clone())); return copy; } return null; } - /** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement} instance. * - * @param e - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. + * @param e The instance to copy or {@code null}. + * @return A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ - @SuppressWarnings("unchecked") private static JAXBElement copyOfEventHandlerChainTypeElement(final JAXBElement e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (e!= null) { + if (e != null) { final JAXBElement copy = new JAXBElement<>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.EventHandlerChainType - copy.setValue(((((EventHandlerChainType) copy.getValue()) == null)?null:((EventHandlerChainType) copy.getValue()).clone())); + copy.setValue(((copy.getValue() == null) ? null : copy.getValue().clone())); return copy; } return null; } - /** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement} instance. * - * @param e - * The instance to copy or {@code null}. - * @return - * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. + * @param e The instance to copy or {@code null}. + * @return A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ - @SuppressWarnings("unchecked") private static JAXBElement copyOfEventHandlerTypeElement(final JAXBElement e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if (e!= null) { + if (e != null) { final JAXBElement copy = new JAXBElement<>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.EventHandlerType - copy.setValue(((((EventHandlerType) copy.getValue()) == null)?null:((EventHandlerType) copy.getValue()).clone())); + copy.setValue(((copy.getValue() == null) ? null : copy.getValue().clone())); return copy; } return null; @@ -322,22 +287,18 @@ private static JAXBElement copyOfEventHandlerTypeElement(final /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public EventHandlerChainType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final EventHandlerChainType clone = ((EventHandlerChainType) super.clone()); - // 'Handler' collection. - if (this.handler!= null) { - clone.handler = null; - copyHandler(this.getHandler(), clone.getHandler()); - } - return clone; + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final EventHandlerChainType clone = ((EventHandlerChainType) super.clone()); + // 'Handler' collection. + if (this.handler != null) { + clone.handler = null; + copyHandler(this.getHandler(), clone.getHandler()); } + return clone; } @Override diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerType.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerType.java index 1cab4835ce8..bc7611d1cd7 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerType.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventHandlerType.java @@ -8,8 +8,9 @@ package com.evolveum.midpoint.prism.foo; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import java.io.Serializable; +import javax.xml.bind.annotation.*; + import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; @@ -17,17 +18,11 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import java.io.Serializable; - +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** - * - * An event handler - typically either a filter, a notifier, a fork (fan-out), or a chain of handlers. + * An event handler - typically either a filter, a notifier, a fork (fan-out), or a chain of handlers. * * *

Java class for EventHandlerType complex type. @@ -46,21 +41,18 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EventHandlerType", propOrder = { }) @XmlSeeAlso({ - EventHandlerChainType.class, - EventCategoryFilterType.class, - EventStatusFilterType.class, - EventOperationFilterType.class + EventHandlerChainType.class, + EventCategoryFilterType.class, + EventStatusFilterType.class, + EventOperationFilterType.class }) -public class EventHandlerType implements Serializable, Cloneable, Equals, HashCode -{ +public class EventHandlerType implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; @XmlAttribute(name = "name") @@ -68,7 +60,6 @@ public class EventHandlerType implements Serializable, Cloneable, Equals, HashCo /** * Creates a new {@code EventHandlerType} instance. - * */ public EventHandlerType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -78,11 +69,8 @@ public EventHandlerType() { /** * Creates a new {@code EventHandlerType} instance by deeply copying a given {@code EventHandlerType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public EventHandlerType(final EventHandlerType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -91,16 +79,14 @@ public EventHandlerType(final EventHandlerType o) { throw new NullPointerException("Cannot create a copy of 'EventHandlerType' from 'null'."); } // CBuiltinLeafInfo: java.lang.String - this.name = ((o.name == null)?null:o.getName()); + this.name = ((o.name == null) ? null : o.getName()); } /** * Gets the value of the name property. * - * @return - * possible object is - * {@link String } - * + * @return possible object is + * {@link String } */ public String getName() { return name; @@ -109,10 +95,8 @@ public String getName() { /** * Sets the value of the name property. * - * @param value - * allowed object is - * {@link String } - * + * @param value allowed object is + * {@link String } */ public void setName(String value) { this.name = value; @@ -121,16 +105,13 @@ public void setName(String value) { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); return currentHashCode; } @@ -147,18 +128,17 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return true; } final EventHandlerType that = ((EventHandlerType) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -167,20 +147,16 @@ public boolean equals(Object object) { /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public EventHandlerType clone() { try { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final EventHandlerType clone = ((EventHandlerType) super.clone()); - // CBuiltinLeafInfo: java.lang.String - clone.name = ((this.name == null)?null:this.getName()); - return clone; - } + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final EventHandlerType clone = ((EventHandlerType) super.clone()); + // CBuiltinLeafInfo: java.lang.String + clone.name = ((this.name == null) ? null : this.getName()); + return clone; } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventOperationFilterType.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventOperationFilterType.java index 4436ee85fa0..c4966abc1fe 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventOperationFilterType.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventOperationFilterType.java @@ -8,8 +8,13 @@ package com.evolveum.midpoint.prism.foo; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; @@ -17,14 +22,8 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for EventOperationFilterType complex type. @@ -42,24 +41,20 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EventOperationFilterType", propOrder = { - "operation" + "operation" }) public class EventOperationFilterType - extends EventHandlerType - implements Serializable, Cloneable, Equals, HashCode -{ + extends EventHandlerType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; protected List operation; /** * Creates a new {@code EventOperationFilterType} instance. - * */ public EventOperationFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -69,11 +64,8 @@ public EventOperationFilterType() { /** * Creates a new {@code EventOperationFilterType} instance by deeply copying a given {@code EventOperationFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public EventOperationFilterType(final EventOperationFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -82,7 +74,7 @@ public EventOperationFilterType(final EventOperationFilterType o) { throw new NullPointerException("Cannot create a copy of 'EventOperationFilterType' from 'null'."); } // 'Operation' collection. - if (o.operation!= null) { + if (o.operation != null) { copyOperation(o.getOperation(), this.getOperation()); } } @@ -106,8 +98,6 @@ public EventOperationFilterType(final EventOperationFilterType o) { *

* Objects of the following type(s) are allowed in the list * {@link EventOperationType } - * - * */ public List getOperation() { if (operation == null) { @@ -119,16 +109,13 @@ public List getOperation() { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - List theOperation; - theOperation = (((this.operation!= null)&&(!this.operation.isEmpty()))?this.getOperation():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "operation", theOperation), currentHashCode, theOperation); - } + List theOperation; + theOperation = (((this.operation != null) && (!this.operation.isEmpty())) ? this.getOperation() : null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "operation", theOperation), currentHashCode, theOperation); return currentHashCode; } @@ -148,18 +135,17 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final EventOperationFilterType that = ((EventOperationFilterType) object); - { - List lhsOperation; - lhsOperation = (((this.operation!= null)&&(!this.operation.isEmpty()))?this.getOperation():null); - List rhsOperation; - rhsOperation = (((that.operation!= null)&&(!that.operation.isEmpty()))?that.getOperation():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "operation", lhsOperation), LocatorUtils.property(thatLocator, "operation", rhsOperation), lhsOperation, rhsOperation)) { - return false; - } + List lhsOperation; + lhsOperation = (((this.operation != null) && (!this.operation.isEmpty())) ? this.getOperation() : null); + List rhsOperation; + rhsOperation = (((that.operation != null) && (!that.operation.isEmpty())) ? that.getOperation() : null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "operation", lhsOperation), LocatorUtils.property(thatLocator, "operation", rhsOperation), lhsOperation, rhsOperation)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -168,26 +154,21 @@ public boolean equals(Object object) { /** * Copies all values of property {@code Operation} deeply. * - * @param source - * The source to copy from. - * @param target - * The target to copy {@code source} to. - * @throws NullPointerException - * if {@code target} is {@code null}. + * @param source The source to copy from. + * @param target The target to copy {@code source} to. + * @throws NullPointerException if {@code target} is {@code null}. */ - @SuppressWarnings("unchecked") private static void copyOperation(final List source, final List target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if ((source!= null)&&(!source.isEmpty())) { - for (final Iterator it = source.iterator(); it.hasNext(); ) { - final Object next = it.next(); + if ((source != null) && (!source.isEmpty())) { + for (final Object next : source) { if (next instanceof String) { // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.EventOperationType target.add(((String) next)); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Operation' of class 'com.evolveum.midpoint.xml.ns._public.common.common_3.EventOperationFilterType'.")); + throw new AssertionError((("Unexpected instance '" + next) + "' for property 'Operation' of class 'com.evolveum.midpoint.xml.ns._public.common.common_3.EventOperationFilterType'.")); } } } @@ -195,22 +176,18 @@ private static void copyOperation(final List source, final List /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public EventOperationFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final EventOperationFilterType clone = ((EventOperationFilterType) super.clone()); - // 'Operation' collection. - if (this.operation!= null) { - clone.operation = null; - copyOperation(this.getOperation(), clone.getOperation()); - } - return clone; + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final EventOperationFilterType clone = ((EventOperationFilterType) super.clone()); + // 'Operation' collection. + if (this.operation != null) { + clone.operation = null; + copyOperation(this.getOperation(), clone.getOperation()); } + return clone; } @Override diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventStatusFilterType.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventStatusFilterType.java index 9ce1ae9df15..f5efaa9af43 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventStatusFilterType.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/foo/EventStatusFilterType.java @@ -8,8 +8,13 @@ package com.evolveum.midpoint.prism.foo; -import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; -import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + import org.jvnet.jaxb2_commons.lang.Equals; import org.jvnet.jaxb2_commons.lang.EqualsStrategy; import org.jvnet.jaxb2_commons.lang.HashCode; @@ -17,14 +22,8 @@ import org.jvnet.jaxb2_commons.locator.ObjectLocator; import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - +import com.evolveum.midpoint.util.xml.DomAwareEqualsStrategy; +import com.evolveum.midpoint.util.xml.DomAwareHashCodeStrategy; /** *

Java class for EventStatusFilterType complex type. @@ -42,24 +41,20 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EventStatusFilterType", propOrder = { - "status" + "status" }) public class EventStatusFilterType - extends EventHandlerType - implements Serializable, Cloneable, Equals, HashCode -{ + extends EventHandlerType + implements Serializable, Cloneable, Equals, HashCode { private final static long serialVersionUID = 201105211233L; protected List status; /** * Creates a new {@code EventStatusFilterType} instance. - * */ public EventStatusFilterType() { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -69,11 +64,8 @@ public EventStatusFilterType() { /** * Creates a new {@code EventStatusFilterType} instance by deeply copying a given {@code EventStatusFilterType} instance. * - * - * @param o - * The instance to copy. - * @throws NullPointerException - * if {@code o} is {@code null}. + * @param o The instance to copy. + * @throws NullPointerException if {@code o} is {@code null}. */ public EventStatusFilterType(final EventStatusFilterType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 @@ -82,7 +74,7 @@ public EventStatusFilterType(final EventStatusFilterType o) { throw new NullPointerException("Cannot create a copy of 'EventStatusFilterType' from 'null'."); } // 'Status' collection. - if (o.status!= null) { + if (o.status != null) { copyStatus(o.getStatus(), this.getStatus()); } } @@ -106,8 +98,6 @@ public EventStatusFilterType(final EventStatusFilterType o) { *

* Objects of the following type(s) are allowed in the list * {@link String } - * - * */ public List getStatus() { if (status == null) { @@ -119,16 +109,13 @@ public List getStatus() { /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin - * */ public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = super.hashCode(locator, strategy); - { - List theStatus; - theStatus = (((this.status!= null)&&(!this.status.isEmpty()))?this.getStatus():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus); - } + List theStatus; + theStatus = (((this.status != null) && (!this.status.isEmpty())) ? this.getStatus() : null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus); return currentHashCode; } @@ -148,18 +135,17 @@ public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Obje return false; } final EventStatusFilterType that = ((EventStatusFilterType) object); - { - List lhsStatus; - lhsStatus = (((this.status!= null)&&(!this.status.isEmpty()))?this.getStatus():null); - List rhsStatus; - rhsStatus = (((that.status!= null)&&(!that.status.isEmpty()))?that.getStatus():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus)) { - return false; - } + List lhsStatus; + lhsStatus = (((this.status != null) && (!this.status.isEmpty())) ? this.getStatus() : null); + List rhsStatus; + rhsStatus = (((that.status != null) && (!that.status.isEmpty())) ? that.getStatus() : null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "status", lhsStatus), LocatorUtils.property(thatLocator, "status", rhsStatus), lhsStatus, rhsStatus)) { + return false; } return true; } + @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); @@ -168,26 +154,21 @@ public boolean equals(Object object) { /** * Copies all values of property {@code Status} deeply. * - * @param source - * The source to copy from. - * @param target - * The target to copy {@code source} to. - * @throws NullPointerException - * if {@code target} is {@code null}. + * @param source The source to copy from. + * @param target The target to copy {@code source} to. + * @throws NullPointerException if {@code target} is {@code null}. */ - @SuppressWarnings("unchecked") private static void copyStatus(final List source, final List target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - if ((source!= null)&&(!source.isEmpty())) { - for (final Iterator it = source.iterator(); it.hasNext(); ) { - final Object next = it.next(); + if ((source != null) && (!source.isEmpty())) { + for (final Object next : source) { if (next instanceof String) { // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.String target.add(((String) next)); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ - throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Status' of class 'com.evolveum.midpoint.xml.ns._public.common.common_3.EventStatusFilterType'.")); + throw new AssertionError((("Unexpected instance '" + next) + "' for property 'Status' of class 'com.evolveum.midpoint.xml.ns._public.common.common_3.EventStatusFilterType'.")); } } } @@ -195,22 +176,18 @@ private static void copyStatus(final List source, final List tar /** * Creates and returns a deep copy of this object. * - * - * @return - * A deep copy of this object. + * @return A deep copy of this object. */ @Override public EventStatusFilterType clone() { - { - // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 - final EventStatusFilterType clone = ((EventStatusFilterType) super.clone()); - // 'Status' collection. - if (this.status!= null) { - clone.status = null; - copyStatus(this.getStatus(), clone.getStatus()); - } - return clone; + // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 + final EventStatusFilterType clone = ((EventStatusFilterType) super.clone()); + // 'Status' collection. + if (this.status != null) { + clone.status = null; + copyStatus(this.getStatus(), clone.getStatus()); } + return clone; } @Override