AbstractIdentifiedObject changes for revisions 24972:24973

Replacement of Identifier type by ReferenceIdentifier for the name property. This change has been forced by a GeoAPI change. Reverting this change causes a compilation failure, which is resolved by restoring the ReferenceIdentifier values as required by GeoAPI interfaces. So rewriting this contribution produces identical result, except for the if … else block. The later is written in a different way in SIS.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r24972:24973 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/AbstractIdentifiedObject.java
Revision 24972Revision 24973
import org.opengis.referencing.IdentifiedObject;
import org.opengis.referencing.AuthorityFactory;
import org.opengis.referencing.ObjectFactory;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.util.LocalName;
import org.opengis.referencing.IdentifiedObject;
import org.opengis.referencing.AuthorityFactory;
import org.opengis.referencing.ObjectFactory;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.util.GenericName;
import org.opengis.util.InternationalString;
import org.opengis.util.LocalName;
/**
 * The name for this object or code. Should never be {@code null}.
 */
private final Identifier name;

/**
 * An alternative name by which this object is identified.
/**
 * The name for this object or code. Should never be {@code null}.
 */
private final ReferenceIdentifier name;

/**
 * An alternative name by which this object is identified.
case  1126917133: if (key.equalsIgnoreCase("positionalAccuracy")) key="positionalAccuracy"; break;
case  1127093059: if (key.equalsIgnoreCase("realizationEpoch"))   key="realizationEpoch";   break;
case -1109785975: if (key.equalsIgnoreCase("validArea"))          key="validArea";          break;
// ----------------------------
// "name": String or Identifier
// ----------------------------
case  1126917133: if (key.equalsIgnoreCase("positionalAccuracy")) key="positionalAccuracy"; break;
case  1127093059: if (key.equalsIgnoreCase("realizationEpoch"))   key="realizationEpoch";   break;
case -1109785975: if (key.equalsIgnoreCase("validArea"))          key="validArea";          break;

// ----------------------------
// "name": String or Identifier
// ----------------------------
    if (value instanceof String) {
        name = new NamedIdentifier(properties, false);
        assert value.equals(((Identifier) name).getCode()) : name;
    } else {
        name = value;
    }
    continue NEXT_KEY;
}
break;
    if (value instanceof String) {
        name = new NamedIdentifier(properties, false);
        assert value.equals(((Identifier) name).getCode()) : name;
    } else if (value instanceof ReferenceIdentifier ){
        name = value;
    }
    else {
        // WARNING!
        name = value;
    }
    continue NEXT_KEY;
}
break;
 */
String key=null; Object value=null;
try {
    key=        NAME_KEY; this.name        =          (Identifier) (value=name);
    key=       ALIAS_KEY; this.alias       = asSet((GenericName[]) (value=alias));
    key= IDENTIFIERS_KEY; this.identifiers = asSet( (Identifier[]) (value=identifiers));
    key=     REMARKS_KEY; this.remarks     = (InternationalString) (value=remarks);
 */
String key=null; Object value=null;
try {
    key=        NAME_KEY; this.name        = (ReferenceIdentifier) (value=name);
    key=       ALIAS_KEY; this.alias       = asSet((GenericName[]) (value=alias));
    key= IDENTIFIERS_KEY; this.identifiers = asSet( (Identifier[]) (value=identifiers));
    key=     REMARKS_KEY; this.remarks     = (InternationalString) (value=remarks);
 *
 * @see #getName(Citation)
 */
public Identifier getName() {
    return name;
}
 *
 * @see #getName(Citation)
 */
public ReferenceIdentifier getName() {
    return name;
}