Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java client does not support the complex type #175

Open
esc-mhild opened this issue Jul 28, 2021 · 1 comment
Open

Java client does not support the complex type #175

esc-mhild opened this issue Jul 28, 2021 · 1 comment

Comments

@esc-mhild
Copy link

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.

@s-u
Copy link
Owner

s-u commented Apr 6, 2022

There are really two issues here - one is that complex type should be supported and the other is that error handling is explicitly suppressed in favor of returning null. I'll convert this issue into complex type support and raise another one.

@s-u s-u changed the title RConnection.eval fails to error on unhandled type Java client does not support the complex type Apr 6, 2022
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

No branches or pull requests

2 participants