Skip to content

Java client does not support the complex type #175

@esc-mhild

Description

@esc-mhild

When RConnection.eval encounters an unhandled type (e.g., complex), it prints a warning to stderr and returns null.
This prevents proper error handling in Java code using the RConnection client.

The return of a null object is intended according to the documentation of the method implementation and Java code can, of course, easily check for this condition:

@return R-xpression or null if an error occured

Crucially, however, the message describing the source of the error is inaccessible to any error handling logic so that only an uninformative "Something failed" can be reported.

Moreover, writing to stderr is undesirable in Java applications where logging frameworks are the typical choice.

Replication:

In R, start a server:

library(Rserve); run.Rserve()

In Java,

RConnection c = new RConnection();

REXP r = c.eval("complex(real=1, imaginary=2)");

// prints to stderr: "unhandled type: 38"
// r == null

Many thanks!

M.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions