Martin Raifer created IGNITE-11781:
--------------------------------------
Summary: Invalid mode while deserializing JTS geometry objects with binary marshaller
Key: IGNITE-11781
URL:
https://issues.apache.org/jira/browse/IGNITE-11781 Project: Ignite
Issue Type: Bug
Components: binary, clients, compute
Affects Versions: 2.7
Environment: Tested on a 64 bit Ubuntu 18.04, with OpenJDK 1.8.0_191, running Ignite 2.7
Reporter: Martin Raifer
JTS Geometry objects can't be used as return types of compute jobs. Instead, _null_ is returned. Here's a minimal example showing the bug (and one example that shows that the bug is sometimes not triggered under slightly different conditions):
{code:java}
// this prints "null" (wrong – the expected result would be "POINT EMPTY"):
igniteCompute.broadcast(() -> (new GeometryFactory()).createPoint()).forEach(System.out::println);
// this prints "[POINT EMPTY]" (correct):
igniteCompute.broadcast(() -> Collections.singletonList((new GeometryFactory()).createPoint())).forEach(System.out::println);
{code}
This is caused by an invalid _BinaryWriteMode_ of _OPTIMIZED_ in [
https://github.com/apache/ignite/blob/ignite-2.7/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java#L852] which then leads to a null value to be returned a few lines further down: [
https://github.com/apache/ignite/blob/ignite-2.7/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java#L882]
From what I can see, the _OPTIMIZED_ mode is set in [
https://github.com/apache/ignite/blob/ignite-2.7/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java#L161] where the objects are explicitly tested against the _org.locationtech.jts.geom.Geometry_ class. This could be a regression introduced in
https://issues.apache.org/jira/browse/IGNITE-4259 ?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)