owlcs / ont-api

ONT-API (OWL-API over Apache Jena)
44 stars 5 forks source link

Wrong equals/hashcode for several numeric literals (mismatch with default impl) #13

Closed sszuev closed 4 years ago

sszuev commented 4 years ago

Not sure if this is a mistake/regression or is it due to recent changes in OWL-API. Anyway it is a bug of ONT-API. The testcase:

        OWLDataFactory owlapi = OntManagers.createOWL().getOWLDataFactory();
        DataFactory ontapi = OntManagers.getDataFactory();
        String value = "1922";
        OWL2Datatype dt = OWL2Datatype.XSD_POSITIVE_INTEGER;
        OWLLiteral x = owlapi.getOWLLiteral(value, dt);
        OWLLiteral z = ontapi.getOWLLiteral(value, dt);
        System.out.println(x.hashCode() + " ? " + z.hashCode());
        Assert.assertEquals(x, z);
sszuev commented 4 years ago

done