Skip to content
Snippets Groups Projects
Commit f0180643 authored by Miloslav Metelka's avatar Miloslav Metelka
Browse files

Changes to run FastR on JDK9.

parent 01901dca
No related branches found
No related tags found
No related merge requests found
......@@ -45,9 +45,6 @@ import com.oracle.truffle.r.runtime.RInternalError;
import com.oracle.truffle.r.runtime.conn.ConnectionSupport.BaseRConnection;
import com.oracle.truffle.r.runtime.data.RDataFactory;
import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
import com.sun.istack.internal.NotNull;
import sun.nio.cs.StreamDecoder;
/**
* Actually performs the I/O operations for a connections.<br>
......@@ -260,7 +257,7 @@ abstract class DelegateRConnection implements RConnection, ByteChannel {
* @throws IOException
*/
@TruffleBoundary
public static void writeCharHelper(@NotNull WritableByteChannel channel, @NotNull String s, int pad, String eos) throws IOException {
public static void writeCharHelper(WritableByteChannel channel, String s, int pad, String eos) throws IOException {
final byte[] bytes = s.getBytes();
final byte[] eosBytes = eos != null ? eos.getBytes() : null;
......@@ -332,31 +329,6 @@ abstract class DelegateRConnection implements RConnection, ByteChannel {
return new String(buf.array(), 0, j);
}
/**
* Reads a specified number of characters (not bytes).<br>
* <p>
* This method is meant to be used if R's function {@code readChar} is called with parameter
* {@code useBytes=FALSE}.
* </p>
*
* @param nchars The number of characters to read.
* @param decoder The stream decoder to use (must not be {@code null}).
* @throws IOException
*/
public static String readCharHelper(int nchars, StreamDecoder decoder) throws IOException {
// we need a decoder
char[] chars = new char[nchars];
decoder.read(chars);
int j = 0;
for (; j < chars.length; j++) {
// strings end at 0
if (chars[j] == 0) {
break;
}
}
return new String(chars, 0, j);
}
/**
* Implements standard seeking behavior.<br>
* <p>
......@@ -429,9 +401,9 @@ abstract class DelegateRConnection implements RConnection, ByteChannel {
/**
* Creates the stream decoder on demand and returns it.
*/
protected StreamDecoder getDecoder(int bufSize) {
protected Reader getDecoder(int bufSize) {
CharsetDecoder charsetEncoder = base.getEncoding().newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE);
return StreamDecoder.forDecoder(this, charsetEncoder, bufSize);
return Channels.newReader(this, charsetEncoder, bufSize);
}
@Override
......
......@@ -80,11 +80,6 @@ suite = {
"sha1" : "0baa82bff19059401e90e1b90020beb9c96305d7",
},
"JDK_TOOLS" : {
"path" : "${JAVA_HOME}/lib/tools.jar",
"sha1" : "NOCHECK",
},
"ANTLR-C-3.5" : {
"path" : "libdownloads/antlr-complete-3.5.1.jar",
"urls" : ["http://central.maven.org/maven2/org/antlr/antlr-complete/3.5.1/antlr-complete-3.5.1.jar"],
......@@ -103,7 +98,6 @@ suite = {
"com.oracle.truffle.r.parser.processor" : {
"sourceDirs" : ["src"],
"dependencies" : [
"JDK_TOOLS",
"ANTLR-3.5",
"ANTLR-C-3.5",
],
......@@ -295,7 +289,6 @@ suite = {
"subDir" : "truffle",
"dependencies" : ["com.oracle.truffle.r.parser.processor"],
"exclude" : [
"JDK_TOOLS",
"ANTLR-3.5",
"ANTLR-C-3.5",
],
......@@ -308,7 +301,6 @@ suite = {
"dependencies" : ["com.oracle.truffle.r.engine", "com.oracle.truffle.r.runtime.ffi"],
"mainClass" : "com.oracle.truffle.r.engine.shell.RCommand",
"exclude" : [
"JDK_TOOLS",
"truffle:JLINE",
"ANTLR-C-3.5",
"ANTLR-3.5",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment