Skip to content

Fix for SpatialReferenceImpl.equals(Object) - compare different values#90

Merged
stolstov merged 1 commit intoEsri:masterfrom
panchenko:SpatialReferenceImpl-equals-fix
Sep 30, 2015
Merged

Fix for SpatialReferenceImpl.equals(Object) - compare different values#90
stolstov merged 1 commit intoEsri:masterfrom
panchenko:SpatialReferenceImpl-equals-fix

Conversation

@panchenko
Copy link
Contributor

No description provided.

@panchenko panchenko force-pushed the SpatialReferenceImpl-equals-fix branch from f6daf0b to db93aa2 Compare September 24, 2015 10:01
@stolstov
Copy link
Member

@panchenko Thanks! The fix looks good. Could you change the unit test like that (TestSpatialReference.java):

package com.esri.core.geometry;

import junit.framework.TestCase;
import org.junit.Test;

public class TestSpatialReference extends TestCase {
    @Test
    public void testEquals() {
        final SpatialReference a = SpatialReference.create("GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]");
        final SpatialReference b = SpatialReference.create("PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator_Auxiliary_Sphere\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Standard_Parallel_1\",0.0],PARAMETER[\"Auxiliary_Sphere_Type\",0.0],UNIT[\"Meter\",1.0]]");
        final SpatialReference c = SpatialReference.create("GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]");
        assertTrue(a.equals(a));
        assertTrue(b.equals(b));
        assertTrue(a.equals(c));
        assertTrue(!a.equals(b));
        assertTrue(!b.equals(a));
    }
}

@panchenko
Copy link
Contributor Author

@stolstov Why a combination of juni3/junit4 styles? it looks confusing.

@stolstov
Copy link
Member

@panchenko I only can say that it works like that too :). The naming convention should stay but feel free to fix this to a better style.

@panchenko panchenko force-pushed the SpatialReferenceImpl-equals-fix branch from db93aa2 to fdf3c49 Compare September 30, 2015 07:47
@panchenko
Copy link
Contributor Author

@stolstov I've updated this test

stolstov added a commit that referenced this pull request Sep 30, 2015
Fix for SpatialReferenceImpl.equals(Object) - compare different values
@stolstov stolstov merged commit d10cfc1 into Esri:master Sep 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants