diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java index 218308205a5a6ab23a4fbe3fef72588d05c8fd42..7cbc81998e59b454d7561bebff83e620f9c87894 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/AsVector.java @@ -32,6 +32,7 @@ import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.Cached; import com.oracle.truffle.api.dsl.Fallback; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.nodes.Node; @@ -59,6 +60,7 @@ import com.oracle.truffle.r.runtime.ArgumentsSignature; import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RError.Message; import com.oracle.truffle.r.runtime.RInternalError; +import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RType; import com.oracle.truffle.r.runtime.builtins.RBuiltin; import com.oracle.truffle.r.runtime.data.RDataFactory; @@ -70,6 +72,8 @@ import com.oracle.truffle.r.runtime.data.RSymbol; import com.oracle.truffle.r.runtime.data.model.RAbstractAtomicVector; import com.oracle.truffle.r.runtime.data.model.RAbstractListVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; import com.oracle.truffle.r.runtime.nodes.RBaseNode; @RBuiltin(name = "as.vector", kind = INTERNAL, parameterNames = {"x", "mode"}, dispatch = INTERNAL_GENERIC, behavior = COMPLEX) @@ -118,6 +122,7 @@ public abstract class AsVector extends RBuiltinNode.Arg2 { return internal.execute(x, mode); } + @ImportStatic(RRuntime.class) public abstract static class AsVectorInternal extends Node { public abstract Object execute(Object x, String mode); @@ -160,6 +165,10 @@ public abstract class AsVector extends RBuiltinNode.Arg2 { return mode == cachedMode || indirectMatchProfile.profile(cachedMode.equals(mode)); } + protected ForeignArray2R createForeignArray2R() { + return ForeignArray2RNodeGen.create(); + } + // there should never be more than ~12 specializations @SuppressWarnings("unused") @Specialization(limit = "99", guards = "matchesMode(mode, cachedMode)") @@ -167,7 +176,19 @@ public abstract class AsVector extends RBuiltinNode.Arg2 { @Cached("mode") String cachedMode, @Cached("fromMode(cachedMode)") RType type, @Cached("createCast(type)") CastNode cast, - @Cached("create()") DropAttributesNode drop) { + @Cached("create()") DropAttributesNode drop, + @Cached("createForeignArray2R()") ForeignArray2R foreignArray2R) { + if (RRuntime.isForeignObject(x)) { + Object o = foreignArray2R.execute(x); + if (!RRuntime.isForeignObject(o)) { + return cast == null ? o : cast.doCast(o); + } + if (type == RType.List) { + throw RError.error(RError.SHOW_CALLER, RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "list"); + } else { + throw RError.error(RError.SHOW_CALLER, RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + } return drop.execute(cast == null ? x : cast.doCast(x)); } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastComplexNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastComplexNode.java index 88151421902d9518fbfeb23035b5ca4e27bcce3e..d318c9747e68476189f3efbc26618db9b3b7e922 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastComplexNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastComplexNode.java @@ -26,7 +26,9 @@ import java.util.function.IntFunction; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.profiles.BranchProfile; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.runtime.RError; @@ -46,9 +48,12 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector; import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector; import com.oracle.truffle.r.runtime.data.model.RAbstractListVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; import com.oracle.truffle.r.runtime.ops.na.NACheck; import com.oracle.truffle.r.runtime.ops.na.NAProfile; +@ImportStatic(RRuntime.class) public abstract class CastComplexNode extends CastBaseNode { private final NACheck naCheck = NACheck.create(); @@ -264,6 +269,22 @@ public abstract class CastComplexNode extends CastBaseNode { return ret; } + @Specialization(guards = "isForeignObject(obj)") + protected RComplexVector doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RComplexVector) { + return (RComplexVector) o; + } + o = castComplexRecursive(o); + if (o instanceof RComplexVector) { + return (RComplexVector) o; + } + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + public static CastComplexNode create() { return CastComplexNodeGen.create(true, true, true); } @@ -275,4 +296,8 @@ public abstract class CastComplexNode extends CastBaseNode { public static CastComplexNode createNonPreserving() { return CastComplexNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastDoubleNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastDoubleNode.java index 381bd14e90fbfdc5f491bcfad838e066c463adde..643ee099fd2e48f6092a7333ec7f5711e1a3bf74 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastDoubleNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastDoubleNode.java @@ -26,7 +26,9 @@ import java.util.function.IntToDoubleFunction; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.profiles.BranchProfile; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.runtime.RError; @@ -44,7 +46,10 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector; import com.oracle.truffle.r.runtime.data.model.RAbstractListVector; import com.oracle.truffle.r.runtime.data.model.RAbstractLogicalVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; +@ImportStatic(RRuntime.class) public abstract class CastDoubleNode extends CastDoubleBaseNode { protected CastDoubleNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes, boolean forRFFI) { @@ -207,6 +212,22 @@ public abstract class CastDoubleNode extends CastDoubleBaseNode { return ret; } + @Specialization(guards = "isForeignObject(obj)") + protected RDoubleVector doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RDoubleVector) { + return (RDoubleVector) o; + } + o = castDoubleRecursive(o); + if (o instanceof RDoubleVector) { + return (RDoubleVector) o; + } + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + public static CastDoubleNode create() { return CastDoubleNodeGen.create(true, true, true); } @@ -218,4 +239,9 @@ public abstract class CastDoubleNode extends CastDoubleBaseNode { public static CastDoubleNode createNonPreserving() { return CastDoubleNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } + } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastExpressionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastExpressionNode.java index c426860c0f999a558a6de930d99a750e1133cec7..408c9940fa4adef30321eec74b8d093a550f346a 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastExpressionNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastExpressionNode.java @@ -22,10 +22,14 @@ */ package com.oracle.truffle.r.nodes.unary; +import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.GetNamesAttributeNode; import com.oracle.truffle.r.runtime.RError; +import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RType; import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RExpression; @@ -34,9 +38,14 @@ import com.oracle.truffle.r.runtime.data.RList; import com.oracle.truffle.r.runtime.data.RNull; import com.oracle.truffle.r.runtime.data.RSymbol; import com.oracle.truffle.r.runtime.data.model.RAbstractContainer; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; +@ImportStatic(RRuntime.class) public abstract class CastExpressionNode extends CastBaseNode { + @Child private CastExpressionNode recursiveCastExpression; + public abstract Object executeExpression(Object o); protected CastExpressionNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes) { @@ -104,6 +113,16 @@ public abstract class CastExpressionNode extends CastBaseNode { } } + @Specialization(guards = "isForeignObject(obj)") + protected RExpression doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + return (RExpression) castExpressionRecursive(o); + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + private static RExpression create(Object obj) { return RDataFactory.createExpression(new Object[]{obj}); } @@ -118,4 +137,16 @@ public abstract class CastExpressionNode extends CastBaseNode { public static CastExpressionNode createNonPreserving() { return CastExpressionNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } + + private Object castExpressionRecursive(Object o) { + if (recursiveCastExpression == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + recursiveCastExpression = insert(CastExpressionNodeGen.create(preserveNames(), preserveDimensions(), preserveAttributes())); + } + return recursiveCastExpression.executeExpression(o); + } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastIntegerNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastIntegerNode.java index 7d46d80f99c8e1fd2db9a48b9a008a468348e836..311d2ffcdcf44e21eb2fdb2ad4a852e25fcaa01d 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastIntegerNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastIntegerNode.java @@ -23,7 +23,9 @@ package com.oracle.truffle.r.nodes.unary; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.profiles.BranchProfile; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.runtime.RError; @@ -43,8 +45,11 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractLogicalVector; import com.oracle.truffle.r.runtime.data.model.RAbstractRawVector; import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; import com.oracle.truffle.r.runtime.ops.na.NAProfile; +@ImportStatic(RRuntime.class) public abstract class CastIntegerNode extends CastIntegerBaseNode { private final NAProfile naProfile = NAProfile.create(); @@ -216,6 +221,22 @@ public abstract class CastIntegerNode extends CastIntegerBaseNode { return ret; } + @Specialization(guards = "isForeignObject(obj)") + protected RIntVector doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RIntVector) { + return (RIntVector) o; + } + o = castIntegerRecursive(o); + if (o instanceof RIntVector) { + return (RIntVector) o; + } + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + // TODO Should be type-variable and moved to CastNode @Specialization(guards = {"args.getLength() == 1", "isIntVector(args.getArgument(0))"}) protected RIntVector doRArgsValuesAndNames(RArgsValuesAndNames args) { @@ -237,4 +258,8 @@ public abstract class CastIntegerNode extends CastIntegerBaseNode { public static CastIntegerNode createNonPreserving() { return CastIntegerNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastListNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastListNode.java index 9a868b06d2ba24581bfec447e8c02de0076bfddc..2275f18416e2fc3eff142454221e2d1b776665c6 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastListNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastListNode.java @@ -25,6 +25,7 @@ package com.oracle.truffle.r.nodes.unary; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.object.DynamicObject; @@ -32,6 +33,7 @@ import com.oracle.truffle.api.profiles.ValueProfile; import com.oracle.truffle.r.nodes.attributes.ArrayAttributeNode; import com.oracle.truffle.r.nodes.attributes.SetAttributeNode; import com.oracle.truffle.r.nodes.attributes.SpecialAttributesFunctions.SetClassAttributeNode; +import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RType; import com.oracle.truffle.r.runtime.context.RContext; @@ -47,7 +49,12 @@ import com.oracle.truffle.r.runtime.data.RS4Object; import com.oracle.truffle.r.runtime.data.RSymbol; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; import com.oracle.truffle.r.runtime.env.REnvironment; +import com.oracle.truffle.r.runtime.interop.Foreign2R; +import com.oracle.truffle.r.runtime.interop.Foreign2RNodeGen; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; +@ImportStatic(RRuntime.class) public abstract class CastListNode extends CastBaseNode { @Child private SetClassAttributeNode setClassAttrNode; @@ -154,9 +161,18 @@ public abstract class CastListNode extends CastBaseNode { return RDataFactory.createList(new Object[]{ri}); } - @Specialization(guards = {"isForeignObject(to)"}) - protected RList doForeignObject(TruffleObject to) { - return RDataFactory.createList(new Object[]{to}); + @Specialization(guards = {"isForeignObject(obj)"}) + protected RList doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RList) { + return (RList) o; + } + return (RList) execute(o); + } + return RDataFactory.createList(new Object[]{obj}); } public static CastListNode create() { @@ -170,4 +186,9 @@ public abstract class CastListNode extends CastBaseNode { protected boolean isForeignObject(TruffleObject to) { return RRuntime.isForeignObject(to); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } + } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastLogicalNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastLogicalNode.java index 4cd7f7ffc2041169795b2b0774b60aae2eb094b3..e9fb5472c55e03d13e50ceede13dc42d7e577a1a 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastLogicalNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastLogicalNode.java @@ -25,8 +25,12 @@ package com.oracle.truffle.r.nodes.unary; import java.util.Arrays; import com.oracle.truffle.api.CompilerDirectives; +import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.r.nodes.helpers.InheritsCheckNode; +import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.data.RComplexVector; import com.oracle.truffle.r.runtime.data.RDataFactory; @@ -40,8 +44,11 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector; import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector; import com.oracle.truffle.r.runtime.data.model.RAbstractListVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; import com.oracle.truffle.r.runtime.ops.na.NAProfile; +@ImportStatic(RRuntime.class) public abstract class CastLogicalNode extends CastLogicalBaseNode { private final NAProfile naProfile = NAProfile.create(); @@ -186,6 +193,22 @@ public abstract class CastLogicalNode extends CastLogicalBaseNode { return missing; } + @Specialization(guards = "isForeignObject(obj)") + protected RLogicalVector doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RLogicalVector) { + return (RLogicalVector) o; + } + o = castLogicalRecursive(o); + if (o instanceof RLogicalVector) { + return (RLogicalVector) o; + } + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + public static CastLogicalNode create() { return CastLogicalNodeGen.create(true, true, true); } @@ -197,4 +220,8 @@ public abstract class CastLogicalNode extends CastLogicalBaseNode { public static CastLogicalNode createNonPreserving() { return CastLogicalNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastRawNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastRawNode.java index c66438279a68fe416dead3725adc170253c3d9ac..b402d1a759f350116f9fe8aab83ded70d06adbc4 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastRawNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastRawNode.java @@ -24,7 +24,9 @@ package com.oracle.truffle.r.nodes.unary; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.profiles.BranchProfile; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.runtime.RError; @@ -43,9 +45,12 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector; import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector; import com.oracle.truffle.r.runtime.data.model.RAbstractListVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; import com.oracle.truffle.r.runtime.ops.na.NACheck; import com.oracle.truffle.r.runtime.ops.na.NAProfile; +@ImportStatic(RRuntime.class) public abstract class CastRawNode extends CastBaseNode { private final NACheck naCheck = NACheck.create(); @@ -312,6 +317,22 @@ public abstract class CastRawNode extends CastBaseNode { return result; } + @Specialization(guards = "isForeignObject(obj)") + protected RRawVector doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RRawVector) { + return (RRawVector) o; + } + o = castRawRecursive(o); + if (o instanceof RRawVector) { + return (RRawVector) o; + } + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + public static CastRawNode createForRFFI(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes) { return CastRawNodeGen.create(preserveNames, preserveDimensions, preserveAttributes, true); } @@ -319,4 +340,8 @@ public abstract class CastRawNode extends CastBaseNode { public static CastRawNode createNonPreserving() { return CastRawNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastStringNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastStringNode.java index 66cc1de16106911653b8e49691134ee0778d02fb..96fe370580946c6dd51a9cf9097d7232f5b8d91b 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastStringNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastStringNode.java @@ -22,19 +22,29 @@ */ package com.oracle.truffle.r.nodes.unary; +import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.api.profiles.ValueProfile; import com.oracle.truffle.r.runtime.RDeparse; +import com.oracle.truffle.r.runtime.RError; +import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RLanguage; import com.oracle.truffle.r.runtime.data.RStringVector; import com.oracle.truffle.r.runtime.data.RSymbol; import com.oracle.truffle.r.runtime.data.model.RAbstractContainer; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; +@ImportStatic(RRuntime.class) public abstract class CastStringNode extends CastStringBaseNode { + @Child private CastStringNode recursiveCastString; + protected CastStringNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes) { this(preserveNames, preserveDimensions, preserveAttributes, false); } @@ -83,6 +93,22 @@ public abstract class CastStringNode extends CastStringBaseNode { return vectorCopy(operand, sdata); } + @Specialization(guards = "isForeignObject(obj)") + protected RStringVector doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + if (o instanceof RStringVector) { + return (RStringVector) o; + } + o = castStringRecursive(o); + if (o instanceof RStringVector) { + return (RStringVector) o; + } + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + @Specialization protected String doRSymbol(RSymbol s) { return s.getName(); @@ -99,4 +125,16 @@ public abstract class CastStringNode extends CastStringBaseNode { public static CastStringNode createNonPreserving() { return CastStringNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } + + private Object castStringRecursive(Object o) { + if (recursiveCastString == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + recursiveCastString = insert(CastStringNodeGen.create(preserveNames(), preserveDimensions(), preserveAttributes())); + } + return recursiveCastString.executeString(o); + } } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java index 2b45b6639ae5045f8d4941d354b0fc0bf958e45a..438141d4925bc57f0641749544b962383d1ef739 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastSymbolNode.java @@ -24,9 +24,13 @@ package com.oracle.truffle.r.nodes.unary; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; +import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RError.Message; +import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.RType; import com.oracle.truffle.r.runtime.data.RDataFactory; import com.oracle.truffle.r.runtime.data.RDoubleVector; @@ -37,10 +41,14 @@ import com.oracle.truffle.r.runtime.data.RNull; import com.oracle.truffle.r.runtime.data.RStringVector; import com.oracle.truffle.r.runtime.data.RSymbol; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; +@ImportStatic(RRuntime.class) public abstract class CastSymbolNode extends CastBaseNode { @Child private ToStringNode toString = ToStringNodeGen.create(); + @Child private CastSymbolNode recursiveCastSymbol; protected CastSymbolNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes) { this(preserveNames, preserveDimensions, preserveAttributes, false); @@ -132,6 +140,16 @@ public abstract class CastSymbolNode extends CastBaseNode { return RDataFactory.createSymbolInterned(s); } + @Specialization(guards = "isForeignObject(obj)") + protected RSymbol doForeignObject(TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + return (RSymbol) castSymbolRecursive(o); + } + throw error(RError.Message.CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR, "vector"); + } + @Override protected Object doOtherRFFI(Object mappedValue) { if (mappedValue instanceof RList) { @@ -148,4 +166,17 @@ public abstract class CastSymbolNode extends CastBaseNode { public static CastSymbolNode createNonPreserving() { return CastSymbolNodeGen.create(false, false, false); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } + + private Object castSymbolRecursive(Object o) { + if (recursiveCastSymbol == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + recursiveCastSymbol = insert(CastSymbolNodeGen.create(preserveNames(), preserveDimensions(), preserveAttributes())); + } + return recursiveCastSymbol.executeSymbol(o); + } + } diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastToContainerNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastToContainerNode.java deleted file mode 100644 index 383e4adb83981d2687459d79f18864669741aa4e..0000000000000000000000000000000000000000 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/CastToContainerNode.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.truffle.r.nodes.unary; - -import com.oracle.truffle.api.dsl.Specialization; -import com.oracle.truffle.r.runtime.RType; -import com.oracle.truffle.r.runtime.data.RFunction; -import com.oracle.truffle.r.runtime.data.RLanguage; -import com.oracle.truffle.r.runtime.data.RNull; -import com.oracle.truffle.r.runtime.data.RPairList; -import com.oracle.truffle.r.runtime.data.model.RAbstractVector; -import com.oracle.truffle.r.runtime.env.REnvironment; - -public abstract class CastToContainerNode extends CastBaseNode { - - public abstract Object executeObject(Object value); - - protected CastToContainerNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes) { - this(preserveNames, preserveDimensions, preserveAttributes, false); - } - - protected CastToContainerNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes, boolean forRFFI) { - super(preserveNames, preserveDimensions, preserveAttributes, forRFFI); - } - - @Override - protected final RType getTargetType() { - return RType.Any; - } - - @Specialization - @SuppressWarnings("unused") - protected RNull castNull(RNull rnull) { - return RNull.instance; - } - - @Specialization - protected RFunction castFunction(RFunction f) { - return f; - } - - @Specialization - protected RAbstractVector cast(RAbstractVector vector) { - return vector; - } - - @Specialization - protected RLanguage cast(RLanguage lang) { - return lang; - } - - @Specialization - protected RPairList cast(RPairList pairlist) { - return pairlist; - } - - @Specialization - protected REnvironment cast(REnvironment env) { - return env; - } -} diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/ConvertBooleanNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/ConvertBooleanNode.java index 42edcbb3ac9b8481281e8f7f631dbf241da2c6dd..20a0f0a2b0d860ad4ba4ed333c2989da5b948f95 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/ConvertBooleanNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/ConvertBooleanNode.java @@ -22,9 +22,13 @@ */ package com.oracle.truffle.r.nodes.unary; +import com.oracle.truffle.api.CompilerDirectives; +import com.oracle.truffle.api.dsl.Cached; +import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.NodeChild; import com.oracle.truffle.api.dsl.Specialization; import com.oracle.truffle.api.frame.VirtualFrame; +import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.profiles.BranchProfile; import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RRuntime; @@ -39,15 +43,19 @@ import com.oracle.truffle.r.runtime.data.RStringVector; import com.oracle.truffle.r.runtime.data.model.RAbstractDoubleVector; import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector; import com.oracle.truffle.r.runtime.data.model.RAbstractVector; +import com.oracle.truffle.r.runtime.interop.ForeignArray2R; +import com.oracle.truffle.r.runtime.interop.ForeignArray2RNodeGen; import com.oracle.truffle.r.runtime.nodes.RNode; import com.oracle.truffle.r.runtime.nodes.RSyntaxNode; import com.oracle.truffle.r.runtime.ops.na.NAProfile; @NodeChild("operand") +@ImportStatic(RRuntime.class) public abstract class ConvertBooleanNode extends RNode { private final NAProfile naProfile = NAProfile.create(); private final BranchProfile invalidElementCountBranch = BranchProfile.create(); + @Child private ConvertBooleanNode recursiveConvertBoolean; @Override public final Object execute(VirtualFrame frame) { @@ -165,6 +173,16 @@ public abstract class ConvertBooleanNode extends RNode { throw error(RError.Message.ARGUMENT_NOT_INTERPRETABLE_LOGICAL); } + @Specialization(guards = "isForeignObject(obj)") + protected byte doForeignObject(VirtualFrame frame, TruffleObject obj, + @Cached("createForeignArray2RNode()") ForeignArray2R foreignArray2R) { + Object o = foreignArray2R.execute(obj); + if (!RRuntime.isForeignObject(o)) { + return convertBooleanRecursive(frame, o); + } + throw error(RError.Message.ARGUMENT_NOT_INTERPRETABLE_LOGICAL); + } + public static ConvertBooleanNode create(RSyntaxNode node) { if (node instanceof ConvertBooleanNode) { return (ConvertBooleanNode) node; @@ -177,4 +195,16 @@ public abstract class ConvertBooleanNode extends RNode { public RSyntaxNode getRSyntaxNode() { return getOperand().asRSyntaxNode(); } + + protected ForeignArray2R createForeignArray2RNode() { + return ForeignArray2RNodeGen.create(); + } + + protected byte convertBooleanRecursive(VirtualFrame frame, Object o) { + if (recursiveConvertBoolean == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + recursiveConvertBoolean = insert(ConvertBooleanNode.create(getRSyntaxNode())); + } + return recursiveConvertBoolean.executeByte(frame, o); + } } diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java index 615ab5006ef4db5eb86acac0d021bbcc3f3585e4..9ad7956f955b193a99bc2bb774560f42f282577c 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java @@ -617,6 +617,7 @@ public final class RError extends RuntimeException implements TruffleException { INVALID_FORMAT_INTEGER("invalid format '%s'; use format %%d, %%i, %%o, %%x or %%X for integer objects"), POS_NOT_ALLOWED_WITH_NUMERIC("pos argument not allowed with a numeric value"), OBJ_CANNOT_BE_ATTRIBUTED("external object cannot be attributed"), + CANNOT_COERCE_EXTERNAL_OBJECT_TO_VECTOR("no method for coercing this external object to a %s"), // the following list is incomplete (but like GNU-R) INVALID_FORMAT_DOUBLE("invalid format '%s'; use format %%f, %%e, %%g or %%a for numeric objects"), INVALID_LOGICAL("'%s' must be TRUE or FALSE"), diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/interop/ForeignArray2R.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/interop/ForeignArray2R.java index a34174b0cdac5725bae3681b02601dac0b4e27ba..895d6114c9ff47d3d6e754709d816e4f1698670b 100644 --- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/interop/ForeignArray2R.java +++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/interop/ForeignArray2R.java @@ -24,133 +24,207 @@ package com.oracle.truffle.r.runtime.interop; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; +import com.oracle.truffle.api.dsl.Cached; import com.oracle.truffle.api.dsl.Fallback; import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.dsl.Specialization; +import com.oracle.truffle.api.interop.ArityException; import com.oracle.truffle.api.interop.ForeignAccess; import com.oracle.truffle.api.interop.Message; import com.oracle.truffle.api.interop.TruffleObject; import com.oracle.truffle.api.interop.UnknownIdentifierException; import com.oracle.truffle.api.interop.UnsupportedMessageException; +import com.oracle.truffle.api.interop.UnsupportedTypeException; +import com.oracle.truffle.api.interop.java.JavaInterop; import com.oracle.truffle.api.nodes.Node; -import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.r.runtime.RError; import com.oracle.truffle.r.runtime.RRuntime; import com.oracle.truffle.r.runtime.data.RDataFactory; +import com.oracle.truffle.r.runtime.data.RNull; +import com.oracle.truffle.r.runtime.data.model.RAbstractVector; import com.oracle.truffle.r.runtime.nodes.RBaseNode; +import java.util.ArrayList; +import java.util.List; @ImportStatic({Message.class, RRuntime.class}) public abstract class ForeignArray2R extends RBaseNode { + @Child protected Node hasSize = Message.HAS_SIZE.createNode(); @Child private Foreign2R foreign2R; - @Child private Node hasSize = Message.HAS_SIZE.createNode(); - @Child private Node getSize; @Child private Node read; @Child private Node isNull; @Child private Node isBoxed; @Child private Node unbox; - private final ConditionProfile isArrayProfile = ConditionProfile.createBinaryProfile(); - public abstract Object execute(Object obj); - @Specialization(guards = "isForeignObject(obj)") + @Specialization(guards = {"isArray(obj, hasSize)"}) @TruffleBoundary - public Object array2r(TruffleObject obj) { - if (!isArrayProfile.profile(ForeignAccess.sendHasSize(hasSize, obj))) { - return obj; - } - if (getSize == null) { - CompilerDirectives.transferToInterpreterAndInvalidate(); - getSize = insert(Message.GET_SIZE.createNode()); - } + public RAbstractVector doArray(TruffleObject obj, + @SuppressWarnings("unused") @Cached("HAS_SIZE.createNode()") Node hasSize, + @Cached("GET_SIZE.createNode()") Node getSize) { int size; try { size = (int) ForeignAccess.sendGetSize(getSize, obj); if (size == 0) { return RDataFactory.createList(); } - Object[] elements = new Object[size]; - boolean allBoolean = true; - boolean allInteger = true; - boolean allDouble = true; - boolean allString = true; - for (int i = 0; i < size; i++) { - if (read == null) { + + CollectedElements ce = getArrayElements(size, obj); + RAbstractVector ret = toVector(ce); + if (ret != null) { + return ret; + } else { + return RDataFactory.createList(ce.elements); + } + } catch (UnsupportedMessageException | UnknownIdentifierException e) { + throw error(RError.Message.GENERIC, "error while converting array: " + e.getMessage()); + } + } + + @Specialization(guards = "isJavaIterable(obj)") + @TruffleBoundary + protected RAbstractVector doJavaIterable(TruffleObject obj, + @Cached("createExecute(0).createNode()") Node execute) { + + try { + CollectedElements ce = getIterableElements(obj, execute); + RAbstractVector ret = toVector(ce); + if (ret != null) { + return ret; + } + return RDataFactory.createList(ce.elements); + } catch (UnsupportedMessageException | UnknownIdentifierException | UnsupportedTypeException | ArityException e) { + throw error(RError.Message.GENERIC, "error while casting external object to list: " + e.getMessage()); + } + } + + @Specialization(guards = {"!isJavaIterable(obj)", "!isArray(obj, hasSize)"}) + public Object doObject(TruffleObject obj) { + return obj; + } + + @Specialization + public Object doObject(Object obj) { + return obj; + } + + private CollectedElements getArrayElements(int size, TruffleObject obj) throws UnsupportedMessageException, UnknownIdentifierException { + CollectedElements ce = new CollectedElements(); + ce.elements = new Object[size]; + for (int i = 0; i < size; i++) { + if (read == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + read = insert(Message.READ.createNode()); + } + Object element = ForeignAccess.sendRead(read, obj, i); + ce.elements[i] = element2R(element, ce); + } + return ce; + } + + private CollectedElements getIterableElements(TruffleObject obj, Node execute) + throws UnknownIdentifierException, ArityException, UnsupportedMessageException, UnsupportedTypeException { + List<Object> elements = new ArrayList<>(); + if (read == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + read = insert(Message.READ.createNode()); + } + TruffleObject itFunction = (TruffleObject) ForeignAccess.sendRead(read, obj, "iterator"); + TruffleObject it = (TruffleObject) ForeignAccess.sendExecute(execute, itFunction); + TruffleObject hasNextFunction = (TruffleObject) ForeignAccess.sendRead(read, it, "hasNext"); + + CollectedElements ce = new CollectedElements(); + while ((boolean) ForeignAccess.sendExecute(execute, hasNextFunction)) { + TruffleObject nextFunction = (TruffleObject) ForeignAccess.sendRead(read, it, "next"); + Object element = ForeignAccess.sendExecute(execute, nextFunction); + elements.add(element2R(element, ce)); + } + ce.elements = elements.toArray(new Object[elements.size()]); + return ce; + } + + private Object element2R(Object value, CollectedElements ce) throws UnsupportedMessageException { + if (value instanceof TruffleObject) { + if (isNull == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + isNull = insert(Message.IS_NULL.createNode()); + } + if (ForeignAccess.sendIsNull(isNull, (TruffleObject) value)) { + value = RNull.instance; + } else { + if (isBoxed == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); - read = insert(Message.READ.createNode()); + isBoxed = insert(Message.IS_BOXED.createNode()); } - Object element = ForeignAccess.sendRead(read, obj, i); - if (element instanceof TruffleObject) { - if (isNull == null) { + if (ForeignAccess.sendIsBoxed(isBoxed, (TruffleObject) value)) { + if (unbox == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); - isNull = insert(Message.IS_NULL.createNode()); + unbox = insert(Message.UNBOX.createNode()); } - if (ForeignAccess.sendIsNull(isNull, (TruffleObject) element)) { - element = null; - } else { - if (isBoxed == null) { - CompilerDirectives.transferToInterpreterAndInvalidate(); - isBoxed = insert(Message.IS_BOXED.createNode()); - } - if (ForeignAccess.sendIsBoxed(isBoxed, (TruffleObject) element)) { - if (unbox == null) { - CompilerDirectives.transferToInterpreterAndInvalidate(); - unbox = insert(Message.UNBOX.createNode()); - } - element = ForeignAccess.sendIsBoxed(unbox, (TruffleObject) element); - } - } - } - allBoolean &= element instanceof Boolean; - allInteger &= element instanceof Byte || element instanceof Integer || element instanceof Short; - allDouble &= element instanceof Double || element instanceof Float || element instanceof Long; - allString &= element instanceof Character || element instanceof String; - - if (foreign2R == null) { - CompilerDirectives.transferToInterpreterAndInvalidate(); - foreign2R = insert(Foreign2RNodeGen.create()); + value = ForeignAccess.sendUnbox(unbox, (TruffleObject) value); } - elements[i] = foreign2R.execute(element); } + } - if (allBoolean) { - byte[] ret = new byte[size]; - for (int i = 0; i < size; i++) { - ret[i] = ((Number) elements[i]).byteValue(); - } - return RDataFactory.createLogicalVector(ret, true); + ce.allBoolean &= value instanceof Boolean; + ce.allInteger &= value instanceof Byte || value instanceof Integer || value instanceof Short; + ce.allDouble &= value instanceof Double || value instanceof Float || value instanceof Long; + ce.allString &= value instanceof Character || value instanceof String; + + if (foreign2R == null) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + foreign2R = insert(Foreign2RNodeGen.create()); + } + return foreign2R.execute(value); + } + + protected RAbstractVector toVector(CollectedElements ce) { + int size = ce.elements.length; + if (ce.allBoolean) { + byte[] ret = new byte[size]; + for (int i = 0; i < size; i++) { + ret[i] = ((Number) ce.elements[i]).byteValue(); } - if (allInteger) { - int[] ret = new int[size]; - for (int i = 0; i < size; i++) { - ret[i] = ((Number) elements[i]).intValue(); - } - return RDataFactory.createIntVector(ret, true); + return RDataFactory.createLogicalVector(ret, true); + } + if (ce.allInteger) { + int[] ret = new int[size]; + for (int i = 0; i < size; i++) { + ret[i] = ((Number) ce.elements[i]).intValue(); } - if (allDouble) { - double[] ret = new double[size]; - for (int i = 0; i < size; i++) { - ret[i] = ((Number) elements[i]).doubleValue(); - } - return RDataFactory.createDoubleVector(ret, true); + return RDataFactory.createIntVector(ret, true); + } + if (ce.allDouble) { + double[] ret = new double[size]; + for (int i = 0; i < size; i++) { + ret[i] = ((Number) ce.elements[i]).doubleValue(); } - if (allString) { - String[] ret = new String[size]; - for (int i = 0; i < size; i++) { - ret[i] = String.valueOf(elements[i]); - } - return RDataFactory.createStringVector(ret, true); + return RDataFactory.createDoubleVector(ret, true); + } + if (ce.allString) { + String[] ret = new String[size]; + for (int i = 0; i < size; i++) { + ret[i] = String.valueOf(ce.elements[i]); } - return RDataFactory.createList(elements); - } catch (UnsupportedMessageException | UnknownIdentifierException e) { - throw error(RError.Message.GENERIC, "error while converting array: " + e.getMessage()); + return RDataFactory.createStringVector(ret, true); } + return null; } - @Fallback - public Object object2r(Object obj) { - return obj; + protected boolean isArray(TruffleObject obj, Node hasSize) { + return RRuntime.isForeignObject(obj) && ForeignAccess.sendHasSize(hasSize, obj); } + protected boolean isJavaIterable(TruffleObject obj) { + return RRuntime.isForeignObject(obj) && JavaInterop.isJavaObject(Iterable.class, obj); + } + + private class CollectedElements { + Object[] elements; + boolean allBoolean = true; + boolean allInteger = true; + boolean allDouble = true; + boolean allString = true; + } } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index 0fe9a5554b4700a1b893514c8b1549a973a4617f..60d3794b83ae8ca0134c376aeb103c78f72fad11 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -130753,11 +130753,11 @@ $stringValue [1] 1 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testArrayReadWrite# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntArray[1]; } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntegerArray[1]; } [1] 1 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testArrayReadWrite# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntArray[[1]]; } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntegerArray[[1]]; } [1] 1 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testArrayReadWrite# @@ -130769,11 +130769,11 @@ $stringValue [1] 123 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testArrayReadWrite# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 123 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntArray[1] <- 123L; to$fieldIntArray[1] } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 123 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntegerArray[1] <- 123L; to$fieldIntegerArray[1] } [1] 123 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testArrayReadWrite# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1234 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntArray[[1]] <- 1234L; to$fieldIntArray[[1]] } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1234 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntegerArray[[1]] <- 1234L; to$fieldIntegerArray[[1]] } [1] 1234 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testArrayReadWrite# @@ -130806,6 +130806,1405 @@ NULL [external object] [1] 1 2 3 +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'a' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$arrayObject); l[[1]]$data } +[1] "a" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'a' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$fieldStringArray); l[[1]] } +[1] "a" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'a' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listObject); l[[1]]$data } +[1] "a" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'a' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listString); l[[1]] } +[1] "a" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'b' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$arrayObject); l[[2]]$data } +[1] "b" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'b' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$fieldStringArray); l[[2]] } +[1] "b" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'b' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listObject); l[[2]]$data } +[1] "b" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 'b' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listString); l[[2]] } +[1] "b" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$fieldStringArray); length(l) } +[1] 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listString); length(l) } +[1] 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 4 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$arrayObject); length(l) } +[1] 4 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 4 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listObject); length(l) } +[1] 4 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { NULL } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$arrayObject); l[[4]]$data } +NULL + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { NULL } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listObject); l[[4]]$data } +NULL + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$arrayObject); is.list(l) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$fieldStringArray); is.list(l) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listObject); is.list(l) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to$listString); is.list(l) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsList#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.list(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a list', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); l<-as.list(to); } +Error in as.list(to) : + no method for coercing this external object to a list + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character("1.10000002384186") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticFloatObject) } +[1] "1.10000002384186" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character("1.79769313486231e+308") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticDoubleObject) } +[1] "1.79769313486231e+308" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character("NaN") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticNaNObject) } +[1] "NaN" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticStringObject) } +[1] "a string" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticCharObject) } +[1] "a" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticByteObject) } +[1] "127" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticIntegerObject) } +[1] "2147483647" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticShortObject) } +[1] "32767" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticLongObject) } +[1] "9223372036854775808" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticNullObject) } +character(0) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStaticBooleanObject) } +[1] "TRUE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStringIntArray); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listStringInt); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("1.1","2.1","3.1")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldDoubleArray); } +[1] "1.1" "2.1" "3.1" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("1.1","2.1","3.1")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listDouble); } +[1] "1.1" "2.1" "3.1" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("1.10000002384186","2.09999990463257","3.09999990463257")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldFloatArray); } +[1] "1.10000002384186" "2.09999990463257" "3.09999990463257" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("1.10000002384186","2.09999990463257","3.09999990463257")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listFloat); } +[1] "1.10000002384186" "2.09999990463257" "3.09999990463257" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStringBooleanArray); } +[1] "TRUE" "TRUE" "FALSE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listStringBoolean); } +[1] "TRUE" "TRUE" "FALSE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldCharArray); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldStringArray); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listChar); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listString); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldByteArray); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldIntegerArray); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldLongArray); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldShortArray); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listByte); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listInteger); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listLong); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listShort); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$fieldBooleanArray); } +[1] "TRUE" "FALSE" "TRUE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.character(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to$listBoolean); } +[1] "TRUE" "FALSE" "TRUE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticStringObject) } +[1] NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticCharObject) } +[1] NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticFloatObject) } +[1] 1.1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticDoubleObject) } +[1] 1.797693e+308+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticByteObject) } +[1] 127+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticIntegerObject) } +[1] 2147483647+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticShortObject) } +[1] 32767+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticLongObject) } +[1] 9.223372e+18+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticNullObject) } +complex(0) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticNaNObject) } +[1] NaN+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStaticBooleanObject) } +[1] 1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStringIntArray); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listStringInt); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStringBooleanArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listStringBoolean); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldCharArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldStringArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listChar); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listString); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldByteArray); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldIntegerArray); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldLongArray); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldShortArray); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listByte); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listInteger); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listLong); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listShort); } +[1] 1+0i 2+0i 3+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldDoubleArray); } +[1] 1.1+0i 2.1+0i 3.1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldFloatArray); } +[1] 1.1+0i 2.1+0i 3.1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listDouble); } +[1] 1.1+0i 2.1+0i 3.1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listFloat); } +[1] 1.1+0i 2.1+0i 3.1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$fieldBooleanArray); } +[1] 1+0i 0+0i 1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.complex(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to$listBoolean); } +[1] 1+0i 0+0i 1+0i + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticStringObject) } +[1] NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticCharObject) } +[1] NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticFloatObject) } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticDoubleObject) } +[1] 1.797693e+308 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticByteObject) } +[1] 127 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticIntegerObject) } +[1] 2147483647 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticShortObject) } +[1] 32767 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticLongObject) } +[1] 9.223372e+18 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticNullObject) } +numeric(0) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticNaNObject) } +[1] NaN + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStaticBooleanObject) } +[1] 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStringIntArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listStringInt); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStringBooleanArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listStringBoolean); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldCharArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldStringArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listChar); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listString); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldByteArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldIntegerArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldLongArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldShortArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listByte); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listInteger); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listLong); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listShort); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldDoubleArray); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldFloatArray); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listDouble); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listFloat); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$fieldBooleanArray); } +[1] 1 0 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.double(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to$listBoolean); } +[1] 1 0 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticStringObject) } +expression("a string") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticCharObject) } +expression("a") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticFloatObject) } +expression(1.1) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticDoubleObject) } +expression(1.79769313486232e+308) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticByteObject) } +expression(127) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticIntegerObject) } +expression(2147483647) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticShortObject) } +expression(32767) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticLongObject) } +expression(9223372036854775808) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticNullObject) } +expression(NULL) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticNaNObject) } +expression(NaN) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStaticBooleanObject) } +expression(TRUE) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStringIntArray); } +expression("1", "2", "3") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listStringInt); } +expression("1", "2", "3") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStringBooleanArray); } +expression("TRUE", "TRUE", "FALSE") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listStringBoolean); } +expression("TRUE", "TRUE", "FALSE") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldCharArray); } +expression("a", "b", "c") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldStringArray); } +expression("a", "b", "c") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listChar); } +expression("a", "b", "c") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listString); } +expression("a", "b", "c") + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldByteArray); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldIntegerArray); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldLongArray); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldShortArray); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listByte); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listInteger); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listLong); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listShort); } +expression(1, 2, 3) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldDoubleArray); } +expression(1.1, 2.1, 3.1) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldFloatArray); } +expression(1.1, 2.1, 3.1) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listDouble); } +expression(1.1, 2.1, 3.1) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listFloat); } +expression(1.1, 2.1, 3.1) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$fieldBooleanArray); } +expression(TRUE, FALSE, TRUE) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.expression(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to$listBoolean); } +expression(TRUE, FALSE, TRUE) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticStringObject) } +[1] NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticCharObject) } +[1] NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticFloatObject) } +[1] 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticDoubleObject) } +[1] NA +Warning message: +NAs introduced by coercion to integer range + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticByteObject) } +[1] 127 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticIntegerObject) } +[1] 2147483647 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticShortObject) } +[1] 32767 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticLongObject) } +[1] NA +Warning message: +NAs introduced by coercion to integer range + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticNullObject) } +integer(0) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticNaNObject) } +[1] NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStaticBooleanObject) } +[1] 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStringIntArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listStringInt); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStringBooleanArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listStringBoolean); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldCharArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldStringArray); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listChar); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listString); } +[1] NA NA NA +Warning message: +NAs introduced by coercion + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldByteArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldIntegerArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldLongArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldShortArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listByte); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listInteger); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listLong); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listShort); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldDoubleArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldFloatArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listDouble); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listFloat); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$fieldBooleanArray); } +[1] 1 0 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.integer(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to$listBoolean); } +[1] 1 0 1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticStringObject) } +[1] NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticCharObject) } +[1] NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticFloatObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticDoubleObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticByteObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticIntegerObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticShortObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticLongObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticNullObject) } +logical(0) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticNaNObject) } +[1] NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStaticBooleanObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStringIntArray); } +[1] NA NA NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listStringInt); } +[1] NA NA NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStringBooleanArray); } +[1] TRUE TRUE FALSE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listStringBoolean); } +[1] TRUE TRUE FALSE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldCharArray); } +[1] NA NA NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldStringArray); } +[1] NA NA NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listChar); } +[1] NA NA NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listString); } +[1] NA NA NA + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldByteArray); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldIntegerArray); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldLongArray); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldShortArray); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listByte); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listInteger); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listLong); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listShort); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldDoubleArray); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldFloatArray); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listDouble); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listFloat); } +[1] TRUE TRUE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$fieldBooleanArray); } +[1] TRUE FALSE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.logical(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to$listBoolean); } +[1] TRUE FALSE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticStringObject) } +[1] 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticCharObject) } +[1] 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticFloatObject) } +[1] 01 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticDoubleObject) } +[1] 00 +Warning messages: +1: NAs introduced by coercion to integer range +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticByteObject) } +[1] 7f + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticIntegerObject) } +[1] 00 +Warning message: +out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticShortObject) } +[1] 00 +Warning message: +out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticLongObject) } +[1] 00 +Warning messages: +1: NAs introduced by coercion to integer range +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticNullObject) } +raw(0) + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticNaNObject) } +[1] 00 +Warning message: +out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStaticBooleanObject) } +[1] 01 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStringIntArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listStringInt); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStringBooleanArray); } +[1] 00 00 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listStringBoolean); } +[1] 00 00 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldCharArray); } +[1] 00 00 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldStringArray); } +[1] 00 00 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningMessage# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listChar); } +[1] 00 00 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listString); } +[1] 00 00 00 +Warning messages: +1: NAs introduced by coercion +2: out-of-range values treated as 0 in coercion to raw + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldByteArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldIntegerArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldLongArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldShortArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listByte); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listInteger); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listLong); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listShort); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldDoubleArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldFloatArray); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listDouble); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listFloat); } +[1] 01 02 03 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$fieldBooleanArray); } +[1] 01 00 01 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.raw(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to$listBoolean); } +[1] 01 00 01 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticStringObject) } +`a string` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticCharObject) } +a + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticFloatObject) } +`1.1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticDoubleObject) } +`1.797693e+308` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticByteObject) } +`127` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticIntegerObject) } +`2147483647` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticShortObject) } +`32767` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticLongObject) } +`9.223372e+18` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticNullObject) } +Error in as.symbol(NULL) : + invalid type/length (symbol/0) in vector allocation + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticNaNObject) } +`NaN` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStaticBooleanObject) } +`TRUE` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStringIntArray); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listStringInt); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStringBooleanArray); } +`TRUE` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listStringBoolean); } +`TRUE` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldCharArray); } +a + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldStringArray); } +a + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listChar); } +a + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listString); } +a + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldByteArray); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldIntegerArray); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldLongArray); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldShortArray); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listByte); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listInteger); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listLong); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listShort); } +`1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldDoubleArray); } +`1.1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldFloatArray); } +`1.1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listDouble); } +`1.1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Ignored.ImplementationError# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listFloat); } +`1.1` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$fieldBooleanArray); } +`TRUE` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.symbol(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to$listBoolean); } +`TRUE` + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector("a string") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticStringObject) } +[1] "a string" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector("a") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticCharObject) } +[1] "a" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(1.1) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticFloatObject) } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(1.7976931348623157E308) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticDoubleObject) } +[1] 1.797693e+308 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(127) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticByteObject) } +[1] 127 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(2147483647) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticIntegerObject) } +[1] 2147483647 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(32767) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticShortObject) } +[1] 32767 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(9223372036854775807) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticLongObject) } +[1] 9.223372e+18 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(NULL) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticNullObject) } +NULL + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(NaN) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticNaNObject) } +[1] NaN + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(TRUE) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStaticBooleanObject) } +[1] TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStringIntArray); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("1","2","3")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listStringInt); } +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStringBooleanArray); } +[1] "TRUE" "TRUE" "FALSE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("TRUE","TRUE","FALSE")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listStringBoolean); } +[1] "TRUE" "TRUE" "FALSE" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldCharArray); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldStringArray); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listChar); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c("a","b","c")) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listString); } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldByteArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldIntegerArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldLongArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldShortArray); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listByte); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listInteger); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listLong); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1,2,3)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listShort); } +[1] 1 2 3 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldDoubleArray); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldFloatArray); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listDouble); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(1.1,2.1,3.1)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listFloat); } +[1] 1.1 2.1 3.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$fieldBooleanArray); } +[1] TRUE FALSE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { as.vector(c(TRUE,FALSE,TRUE)) } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to$listBoolean); } +[1] TRUE FALSE TRUE + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.character(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.character(to); } +Error in as.character(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.complex(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.complex(to); } +Error in as.complex(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.double(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.double(to); } +Error in as.double(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.expression(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.expression(to); } +Error in as.expression(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.integer(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.integer(to); } +Error in as.integer(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.logical(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.logical(to); } +Error in as.logical(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.raw(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.raw(to); } +Error in as.raw(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.symbol(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.symbol(to); } +Error in as.symbol(to) : + no method for coercing this external object to a vector + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAsXXX# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in as.vector(to) : ', '<<<NEWLINE>>>', ' no method for coercing this external object to a vector', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));as.vector(to); } +Error in as.vector(to) : + no method for coercing this external object to a vector + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testAttributes# #if (length(grep("FastR", R.Version()$version.string)) != 1) { NULL } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); attributes(to) } NULL @@ -130854,6 +132253,22 @@ Error in attr(to, which = "a") : external object cannot be attributed #if (length(grep("FastR", R.Version()$version.string)) != 1) { 'truffle.object' } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); class(c(to)) } [1] "truffle.object" +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testCombineInteropTypes#Ignored.Unimplemented# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { c("a","b","c") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); c(to$fieldStringArray) } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testCombineInteropTypes#Ignored.Unimplemented# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { c("a","b","c") } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); c(to$listString) } +[1] "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testCombineInteropTypes#Ignored.Unimplemented# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { c('a', 'b', 'c', 'a', 'b', 'c') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); c(to$fieldStringArray, to$fieldStringArray) } +[1] "a" "b" "c" "a" "b" "c" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testCombineInteropTypes#Ignored.Unimplemented# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { c('a', 'b', 'c', 'a', 'b', 'c') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); c(to$listString, to$listString) } +[1] "a" "b" "c" "a" "b" "c" + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# #if (length(grep("FastR", R.Version()$version.string)) != 1) { "a string" } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticStringObject } [1] "a string" @@ -130878,6 +132293,22 @@ Error in attr(to, which = "a") : external object cannot be attributed #if (length(grep("FastR", R.Version()$version.string)) != 1) { "a" } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticCharObject } [1] "a" +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldFloat } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldFloatObject } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticFloat } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticFloatObject } +[1] 1.1 + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# #if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.7976931348623157E308 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldDouble } [1] 1.797693e+308 @@ -130926,22 +132357,6 @@ Error in attr(to, which = "a") : external object cannot be attributed #if (length(grep("FastR", R.Version()$version.string)) != 1) { 2147483647 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticIntegerObject } [1] 2147483647 -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldFloat } -[1] 3.402823e+38 - -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldFloatObject } -[1] 3.402823e+38 - -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticFloat } -[1] 3.402823e+38 - -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticFloatObject } -[1] 3.402823e+38 - ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# #if (length(grep("FastR", R.Version()$version.string)) != 1) { 32767 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldShort } [1] 32767 @@ -131016,6 +132431,16 @@ NULL [external object] [1] TRUE FALSE TRUE +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] "1" "2" "3"\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStringIntArray } +[external object] +[1] "1" "2" "3" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] "TRUE" "TRUE" "FALSE"\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStringBooleanArray } +[external object] +[1] "TRUE" "TRUE" "FALSE" + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# #if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] "a" "b" "c"\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldCharArray } [external object] @@ -131042,7 +132467,7 @@ NULL [1] 1 2 3 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] 1 2 3\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntArray } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] 1 2 3\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldIntegerArray } [external object] [1] 1 2 3 @@ -131062,7 +132487,7 @@ NULL [1] 1 2 3 ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFields# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] 1 2 3\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticIntArray } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('[external object]\n[1] 1 2 3\n') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$fieldStaticIntegerArray } [external object] [1] 1 2 3 @@ -131125,7 +132550,7 @@ NULL [1] "integer" ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFromArray# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { "integer" } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); v <- .fastr.interop.fromArray(to$fieldStaticIntArray); typeof(v) } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { "integer" } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); v <- .fastr.interop.fromArray(to$fieldStaticIntegerArray); typeof(v) } [1] "integer" ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFromArray# @@ -131161,7 +132586,7 @@ NULL [1] TRUE ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFromArray# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); v <- .fastr.interop.fromArray(to$fieldStaticIntArray); is.vector(v) } +#if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); v <- .fastr.interop.fromArray(to$fieldStaticIntegerArray); is.vector(v) } [1] TRUE ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testFromArray# @@ -131234,6 +132659,77 @@ NULL #if (length(grep("FastR", R.Version()$version.string)) != 1) { TRUE } else { b1 <- .fastr.interop.toByte(1); identical(b1, b1) } [1] TRUE +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in if (T) print(\'OK\') : ', '<<<NEWLINE>>>', ' argument is not interpretable as logical', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to) print('OK') } +Error in if (T) print('OK') : + argument is not interpretable as logical + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(1) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldInteger) print('OK') } +[1] "OK" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(T) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldBoolean) print('OK') } +[1] "OK" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c("TRUE","TRUE","FALSE")) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$listStringBoolean) print('OK') } +[1] "OK" +Warning message: +In if (c("TRUE", "TRUE", "FALSE")) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c('A', 'B')) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$listString) print('OK') } +Error in if (c("A", "B")) print("OK") : + argument is not interpretable as logical +In addition: Warning message: +In if (c("A", "B")) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c('TRUE', 'TRUE', 'FALSE')) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldStringBooleanArray) print('OK') } +[1] "OK" +Warning message: +In if (c("TRUE", "TRUE", "FALSE")) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c('a', 'b')) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldStringArray) print('OK') } +Error in if (c("a", "b")) print("OK") : + argument is not interpretable as logical +In addition: Warning message: +In if (c("a", "b")) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c(T, F)) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldBooleanArray) print('OK') } +[1] "OK" +Warning message: +In if (c(T, F)) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c(T, F)) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldIntegerArray) print('OK') } +[1] "OK" +Warning message: +In if (c(T, F)) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c(T, F)) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$listBoolean) print('OK') } +[1] "OK" +Warning message: +In if (c(T, F)) print("OK") : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testIf#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { if(c(T, F)) print('OK') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$listInteger) print('OK') } +[1] "OK" +Warning message: +In if (c(T, F)) print("OK") : + the condition has length > 1 and only the first element will be used + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testInteroptNew# #if (length(grep("FastR", R.Version()$version.string)) != 1) { 'a' } else { tc <- .fastr.java.class('java.lang.Character'); t <- .fastr.interop.new(tc, .fastr.interop.toChar(97)); t } [1] "a" @@ -131481,6 +132977,22 @@ Error in is.nan(to) : #if (length(grep("FastR", R.Version()$version.string)) != 1) { "a" } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodStaticCharObject() } [1] "a" +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodFloat() } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodFloatObject() } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodStaticFloat() } +[1] 1.1 + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.1 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodStaticFloatObject() } +[1] 1.1 + ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# #if (length(grep("FastR", R.Version()$version.string)) != 1) { 1.7976931348623157E308 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodDouble() } [1] 1.797693e+308 @@ -131529,22 +133041,6 @@ Error in is.nan(to) : #if (length(grep("FastR", R.Version()$version.string)) != 1) { 2147483647 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodStaticIntegerObject() } [1] 2147483647 -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodFloat() } -[1] 3.402823e+38 - -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodFloatObject() } -[1] 3.402823e+38 - -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodStaticFloat() } -[1] 3.402823e+38 - -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# -#if (length(grep("FastR", R.Version()$version.string)) != 1) { 3.4028235E38 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodStaticFloatObject() } -[1] 3.402823e+38 - ##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testMethods# #if (length(grep("FastR", R.Version()$version.string)) != 1) { 32767 } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass')); to$methodShort() } [1] 32767 @@ -131621,7 +133117,7 @@ NULL [external object] [1] 1 2 3 -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNamesForForeignObject# +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNamesForForeignObject#Ignored.ImplementationError# #if (length(grep("FastR", R.Version()$version.string)) != 1) { NULL } else { cl <- .fastr.java.class('java.util.Collections'); em<-cl$EMPTY_MAP; names(em) } NULL @@ -131645,7 +133141,7 @@ NULL #if (length(grep("FastR", R.Version()$version.string)) != 1) { c('field', 'method', 'staticField', 'staticMethod') } else { tc <- .fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestNamesClass'); t <- .fastr.interop.new(tc); sort(names(t)) } [1] "field" "method" "staticField" "staticMethod" -##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNamesForForeignObject# +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testNamesForForeignObject#Ignored.ImplementationError# #if (length(grep("FastR", R.Version()$version.string)) != 1) { c('one', 'two') } else { tc <- .fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestNamesClassMap'); to <- .fastr.interop.new(tc); sort(names(to$m())) } [1] "one" "two" @@ -132100,6 +133596,75 @@ Error in .fastr.interop.toChar(97L, 1) : #if (length(grep("FastR", R.Version()$version.string)) != 1) { 32767 } else { v <- .fastr.interop.toShort(32767); v; } [1] 32767 +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { cat('Error in if (T) print(\'OK\') : ', '<<<NEWLINE>>>', ' argument is not interpretable as logical', '<<<NEWLINE>>>') } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to) print('OK') } +Error in if (T) print('OK') : + argument is not interpretable as logical + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(1) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$fieldInteger) {print('OK'); break;} } +[1] "OK" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(T) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$fieldBoolean) {print('OK'); break;} } +[1] "OK" + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c("TRUE","TRUE","FALSE")) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$listStringBoolean) {print('OK'); break;} } +[1] "OK" +Warning message: +In while (c("TRUE", "TRUE", "FALSE")) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c('A', 'B')) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$listString) {print('OK'); break;} } +Error in while (c("A", "B")) { : argument is not interpretable as logical +In addition: Warning message: +In while (c("A", "B")) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c('TRUE', 'TRUE', 'FALSE')) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$fieldStringBooleanArray) {print('OK'); break;} } +[1] "OK" +Warning message: +In while (c("TRUE", "TRUE", "FALSE")) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext#Output.IgnoreErrorContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c('a', 'b')) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));if(to$fieldStringArray) {print('OK'); break;} } +Error in while (c("a", "b")) { : argument is not interpretable as logical +In addition: Warning message: +In while (c("a", "b")) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c(T, F)) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$fieldBooleanArray) {print('OK'); break;} } +[1] "OK" +Warning message: +In while (c(T, F)) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c(T, F)) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$fieldIntegerArray) {print('OK'); break;} } +[1] "OK" +Warning message: +In while (c(T, F)) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c(T, F)) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$listBoolean) {print('OK'); break;} } +[1] "OK" +Warning message: +In while (c(T, F)) { : + the condition has length > 1 and only the first element will be used + +##com.oracle.truffle.r.test.library.fastr.TestJavaInterop.testWhile#Output.IgnoreWarningContext# +#if (length(grep("FastR", R.Version()$version.string)) != 1) { while(c(T, F)) {print('OK'); break;} } else { to <- .fastr.interop.new(.fastr.java.class('com.oracle.truffle.r.test.library.fastr.TestJavaInterop$TestClass'));while(to$listInteger) {print('OK'); break;} } +[1] "OK" +Warning message: +In while (c(T, F)) { : + the condition has length > 1 and only the first element will be used + ##com.oracle.truffle.r.test.library.fastr.TestStateTrans.testTransitions# #if (length(grep("FastR", R.Version()$version.string)) != 1) { 1 } else { { f<-function(x) .fastr.refcountinfo(x); f(c(1,2)) } } [1] 1 diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java index 461c8efddb029aef5862fdb5f8c4fd03d106ef31..7c5e2b8fd0c558ecd15f8bba64459cee3c8a4f2a 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/TestBase.java @@ -481,6 +481,10 @@ public class TestBase { return evalAndCompare(getAssertEvalFastR(gnuROutput, input), trait1); } + protected boolean assertEvalFastR(TestTrait trait1, TestTrait trait2, String input, String gnuROutput) { + return evalAndCompare(getAssertEvalFastR(gnuROutput, input), trait1, trait2); + } + protected boolean assertEvalFastR(String input, String gnuROutput) { return evalAndCompare(getAssertEvalFastR(gnuROutput, input)); } diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java index 40cf0e7e01f837cc2d2b0e19f54fee9f7dbfe2d6..9dcd1dcb7a2b132989bac30db739fa627e2e5de9 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/fastr/TestJavaInterop.java @@ -22,11 +22,16 @@ */ package com.oracle.truffle.r.test.library.fastr; +import com.oracle.truffle.r.nodes.builtin.base.printer.DoubleVectorPrinter; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; +import java.util.Iterator; +import java.util.List; import java.util.Map; import org.junit.Assert; @@ -178,7 +183,7 @@ public class TestJavaInterop extends TestBase { testFromArray("fieldStaticCharArray", "character"); testFromArray("fieldStaticDoubleArray", "double"); testFromArray("fieldStaticFloatArray", "double"); - testFromArray("fieldStaticIntArray", "integer"); + testFromArray("fieldStaticIntegerArray", "integer"); testFromArray("fieldStaticLongArray", "double"); testFromArray("fieldStaticShortArray", "integer"); testFromArray("fieldStaticStringArray", "character"); @@ -239,6 +244,12 @@ public class TestJavaInterop extends TestBase { assertEvalFastR("tc <- .fastr.java.class('" + TEST_CLASS + "'); t <- .fastr.interop.new(tc); t1 <- .fastr.interop.new(tc); class(c(t, t1))", "'list'"); assertEvalFastR(CREATE_TRUFFLE_OBJECT + " class(c(1, t))", "'list'"); assertEvalFastR(CREATE_TRUFFLE_OBJECT + " class(c(t, 1))", "'list'"); + + TestClass t = new TestClass(); + assertEvalFastR(Ignored.Unimplemented, CREATE_TRUFFLE_OBJECT + " c(to$fieldStringArray)", toRVector(t.fieldStringArray, null)); + assertEvalFastR(Ignored.Unimplemented, CREATE_TRUFFLE_OBJECT + " c(to$listString)", toRVector(t.listString, null)); + assertEvalFastR(Ignored.Unimplemented, CREATE_TRUFFLE_OBJECT + " c(to$fieldStringArray, to$fieldStringArray)", "c('a', 'b', 'c', 'a', 'b', 'c')"); + assertEvalFastR(Ignored.Unimplemented, CREATE_TRUFFLE_OBJECT + " c(to$listString, to$listString)", "c('a', 'b', 'c', 'a', 'b', 'c')"); } @Test @@ -322,8 +333,8 @@ public class TestJavaInterop extends TestBase { assertEvalFastR("a <- .fastr.java.toArray(c(1,2,3)); a[1]", "1"); assertEvalFastR("a <- .fastr.java.toArray(c(1,2,3)); a[[1]]", "1"); - assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntArray[1];", "1"); - assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntArray[[1]];", "1"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntegerArray[1];", "1"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntegerArray[[1]];", "1"); assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$int2DimArray[1]", getRValue(new int[]{1, 2, 3})); assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$int2DimArray[[1]]", getRValue(new int[]{1, 2, 3})); @@ -333,8 +344,8 @@ public class TestJavaInterop extends TestBase { assertEvalFastR("a <- .fastr.java.toArray(c(1,2,3)); a[1] <- 123; a[1]", "123"); assertEvalFastR("a <- .fastr.java.toArray(c(1,2,3)); a[[1]] <- 123; a[[1]]", "123"); - assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntArray[1] <- 123L; to$fieldIntArray[1]", "123"); - assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntArray[[1]] <- 1234L; to$fieldIntArray[[1]]", "1234"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntegerArray[1] <- 123L; to$fieldIntegerArray[1]", "123"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldIntegerArray[[1]] <- 1234L; to$fieldIntegerArray[[1]]", "1234"); assertEvalFastR(CREATE_TRUFFLE_OBJECT + " to$fieldStringArray[1] <- NULL; to$fieldStringArray[1]", "NULL"); @@ -449,6 +460,191 @@ public class TestJavaInterop extends TestBase { assertEvalFastR("ll <- .fastr.interop.new(.fastr.java.class('java.util.LinkedList')); al <- .fastr.interop.new(.fastr.java.class('java.util.ArrayList')); identical(al, ll)", "FALSE"); } + @Test + public void testAsList() { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listString); is.list(l)", "TRUE"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listString); l[[1]]", "'a'"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listString); l[[2]]", "'b'"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listString); length(l)", "3"); + + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listObject); is.list(l)", "TRUE"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listObject); l[[1]]$data", "'a'"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listObject); l[[2]]$data", "'b'"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listObject); length(l)", "4"); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + " l<-as.list(to$listObject); l[[4]]$data", "NULL"); + + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$fieldStringArray); is.list(l)", "TRUE"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$fieldStringArray); l[[1]]", "'a'"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$fieldStringArray); l[[2]]", "'b'"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$fieldStringArray); length(l)", "3"); + + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$arrayObject); is.list(l)", "TRUE"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$arrayObject); l[[1]]$data", "'a'"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$arrayObject); l[[2]]$data", "'b'"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$arrayObject); length(l)", "4"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + " l<-as.list(to$arrayObject); l[[4]]$data", "NULL"); + + assertEvalFastR(Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + " l<-as.list(to);", "cat('Error in as.list(to) : ', '\n', ' no method for coercing this external object to a list', '\n')"); + } + + @Test + public void testAsXXX() throws IllegalArgumentException, IllegalAccessException { + testAsXXX("as.character"); + testAsXXX("as.complex"); + testAsXXX("as.double"); + testAsXXX("as.expression"); + testAsXXX("as.integer"); + testAsXXX("as.logical"); + testAsXXX("as.raw"); + testAsXXX("as.symbol"); + testAsXXX("as.vector"); + // TODO more tests + } + + public void testAsXXX(String asXXX) throws IllegalArgumentException, IllegalAccessException { + TestClass t = new TestClass(); + + Field[] fields = t.getClass().getDeclaredFields(); + for (Field f : fields) { + String name = f.getName(); + String expr = CREATE_TRUFFLE_OBJECT + asXXX + "(to$" + name + ")"; + // test for each primitive wrapper object and string + if (name.startsWith("fieldStatic") && name.endsWith("Object")) { + if (asXXX.equals("as.character") && name.contains("Long")) { + assertEvalFastR(Ignored.ImplementationError, expr, getAsXXX(f.get(t), asXXX)); + } else if (!(asXXX.equals("as.character") || asXXX.equals("as.expression") || asXXX.equals("as.logical") || asXXX.equals("as.symbol") || asXXX.equals("as.vector")) && + (name.contains("String") || name.contains("Char"))) { + assertEvalFastR(Output.IgnoreWarningMessage, expr, getAsXXX(f.get(t), asXXX)); + } else if (asXXX.equals("as.expression") && (name.contains("Long") || name.contains("Double"))) { + assertEvalFastR(Ignored.ImplementationError, expr, getAsXXX(f.get(t), asXXX)); + } else if (asXXX.equals("as.raw") && (name.contains("Short") || name.contains("Integer") || name.contains("Long") || name.contains("Double") || name.contains("NaN"))) { + assertEvalFastR(Output.IgnoreWarningMessage, expr, getAsXXX(f.get(t), asXXX)); + } else if (asXXX.equals("as.symbol") && (name.contains("Long") || name.contains("Double") || name.contains("Float"))) { + assertEvalFastR(Ignored.ImplementationError, expr, getAsXXX(f.get(t), asXXX)); + } else if (asXXX.equals("as.symbol") && (name.contains("Null"))) { + assertEvalFastR(Output.IgnoreErrorContext, expr, getAsXXX(f.get(t), asXXX)); + } else { + assertEvalFastR(expr, getAsXXX(f.get(t), asXXX)); + } + } + } + + // test arrays + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldBooleanArray);", toRVector(t.fieldBooleanArray, asXXX)); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldByteArray);", toRVector(t.fieldByteArray, asXXX)); + if (!(asXXX.equals("as.character") || asXXX.equals("as.expression") || asXXX.equals("as.logical") || asXXX.equals("as.symbol") || asXXX.equals("as.vector"))) { + assertEvalFastR(Output.IgnoreWarningMessage, CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldCharArray);", toRVector(t.fieldCharArray, asXXX)); + } else { + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldCharArray);", toRVector(t.fieldCharArray, asXXX)); + } + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldDoubleArray);", toRVector(t.fieldDoubleArray, asXXX)); + if (asXXX.equals("as.symbol")) { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldFloatArray);", toRVector(t.fieldFloatArray, asXXX)); + } else { + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldFloatArray);", toRVector(t.fieldFloatArray, asXXX)); + } + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldIntegerArray);", toRVector(t.fieldIntegerArray, asXXX)); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldLongArray);", toRVector(t.fieldLongArray, asXXX)); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldShortArray);", toRVector(t.fieldShortArray, asXXX)); + if (!(asXXX.equals("as.character") || asXXX.equals("as.expression") || asXXX.equals("as.logical") || asXXX.equals("as.symbol") || asXXX.equals("as.vector"))) { + assertEvalFastR(Output.IgnoreWarningMessage, CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldStringArray);", toRVector(t.fieldStringArray, asXXX)); + } else { + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldStringArray);", toRVector(t.fieldStringArray, asXXX)); + } + + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldStringIntArray);", toRVector(t.fieldStringIntArray, asXXX)); + if (!(asXXX.equals("as.complex") || asXXX.equals("as.integer") || asXXX.equals("as.raw") || asXXX.equals("as.double"))) { + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldStringBooleanArray);", toRVector(t.fieldStringBooleanArray, asXXX)); + } else { + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + asXXX + "(to$fieldStringBooleanArray);", toRVector(t.fieldStringBooleanArray, asXXX)); + } + + // tests lists + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listBoolean);", toRVector(t.listBoolean, asXXX)); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listByte);", toRVector(t.listByte, asXXX)); + if (!(asXXX.equals("as.character") || asXXX.equals("as.expression") || asXXX.equals("as.logical") || asXXX.equals("as.symbol") || asXXX.equals("as.vector"))) { + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningMessage, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listChar);", toRVector(t.listChar, asXXX)); + } else { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listChar);", toRVector(t.listChar, asXXX)); + } + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listDouble);", toRVector(t.listDouble, asXXX)); + if (asXXX.equals("as.symbol")) { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listFloat);", toRVector(t.listFloat, asXXX)); + } else { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listFloat);", toRVector(t.listFloat, asXXX)); + } + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listInteger);", toRVector(t.listInteger, asXXX)); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listLong);", toRVector(t.listLong, asXXX)); + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listShort);", toRVector(t.listShort, asXXX)); + if (!(asXXX.equals("as.character") || asXXX.equals("as.expression") || asXXX.equals("as.logical") || asXXX.equals("as.symbol") || asXXX.equals("as.vector"))) { + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listString);", toRVector(t.listString, asXXX)); + } else { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listString);", toRVector(t.listString, asXXX)); + } + + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listStringInt);", toRVector(t.listStringInt, asXXX)); + if (!(asXXX.equals("as.complex") || asXXX.equals("as.integer") || asXXX.equals("as.raw") || asXXX.equals("as.double"))) { + assertEvalFastR(Ignored.ImplementationError, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listStringBoolean);", toRVector(t.listStringBoolean, asXXX)); + } else { + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + asXXX + "(to$listStringBoolean);", toRVector(t.listStringBoolean, asXXX)); + } + + if (asXXX.equals("as.expression")) { + assertEvalFastR(Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + asXXX + "(to);", + "cat('Error in " + asXXX + "(to) : ', '\n', ' no method for coercing this external object to a vector', '\n')"); + } else { + assertEvalFastR(CREATE_TRUFFLE_OBJECT + asXXX + "(to);", "cat('Error in " + asXXX + "(to) : ', '\n', ' no method for coercing this external object to a vector', '\n')"); + } + } + + @Test + public void testIf() throws IllegalArgumentException, IllegalAccessException { + TestClass t = new TestClass(); + + assertEvalFastR(CREATE_TRUFFLE_OBJECT + "if(to$fieldBoolean) print('OK')", "if(T) print('OK')"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + "if(to$fieldInteger) print('OK')", "if(1) print('OK')"); + + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "if(to$fieldBooleanArray) print('OK')", "if(c(T, F)) print('OK')"); + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "if(to$fieldIntegerArray) print('OK')", "if(c(T, F)) print('OK')"); + assertEvalFastR(Output.IgnoreWarningContext, Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + "if(to$fieldStringArray) print('OK')", "if(c('a', 'b')) print('OK')"); + + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "if(to$fieldStringBooleanArray) print('OK')", "if(c('TRUE', 'TRUE', 'FALSE')) print('OK')"); + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "if(to$listBoolean) print('OK')", "if(c(T, F)) print('OK')"); + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "if(to$listInteger) print('OK')", "if(c(T, F)) print('OK')"); + assertEvalFastR(Ignored.ImplementationError, /* Output.IgnoreWarningContext, */ Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + "if(to$listString) print('OK')", + "if(c('A', 'B')) print('OK')"); + + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "if(to$listStringBoolean) print('OK')", + "if(" + toRVector(t.listStringBoolean, null) + ") print('OK')"); + + assertEvalFastR(Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + "if(to) print('OK')", + "cat('Error in if (T) print(\\'OK\\') : ', '\n', ' argument is not interpretable as logical', '\n')"); + } + + @Test + public void testWhile() throws IllegalArgumentException, IllegalAccessException { + TestClass t = new TestClass(); + + assertEvalFastR(CREATE_TRUFFLE_OBJECT + "while(to$fieldBoolean) {print('OK'); break;}", "while(T) {print('OK'); break;}"); + assertEvalFastR(CREATE_TRUFFLE_OBJECT + "while(to$fieldInteger) {print('OK'); break;}", "while(1) {print('OK'); break;}"); + + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "while(to$fieldBooleanArray) {print('OK'); break;}", "while(c(T, F)) {print('OK'); break;}"); + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "while(to$fieldIntegerArray) {print('OK'); break;}", "while(c(T, F)) {print('OK'); break;}"); + assertEvalFastR(Output.IgnoreWarningContext, Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + "if(to$fieldStringArray) {print('OK'); break;}", "while(c('a', 'b')) {print('OK'); break;}"); + + assertEvalFastR(Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "while(to$fieldStringBooleanArray) {print('OK'); break;}", "while(c('TRUE', 'TRUE', 'FALSE')) {print('OK'); break;}"); + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "while(to$listBoolean) {print('OK'); break;}", "while(c(T, F)) {print('OK'); break;}"); + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "while(to$listInteger) {print('OK'); break;}", "while(c(T, F)) {print('OK'); break;}"); + assertEvalFastR(Ignored.ImplementationError, /* Output.IgnoreWarningContext, */ Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + "while(to$listString) {print('OK'); break;}", + "while(c('A', 'B')) {print('OK'); break;}"); + + assertEvalFastR(Ignored.ImplementationError, Output.IgnoreWarningContext, CREATE_TRUFFLE_OBJECT + "while(to$listStringBoolean) {print('OK'); break;}", + "while(" + toRVector(t.listStringBoolean, null) + ") {print('OK'); break;}"); + + assertEvalFastR(Output.IgnoreErrorContext, CREATE_TRUFFLE_OBJECT + "while(to) print('OK')", + "cat('Error in if (T) print(\\'OK\\') : ', '\n', ' argument is not interpretable as logical', '\n')"); + } + private String getRValue(Object value) { if (value == null) { return "NULL"; @@ -473,14 +669,14 @@ public class TestJavaInterop extends TestBase { if (value.getClass().isArray()) { StringBuilder sb = new StringBuilder(); sb.append("cat('[external object]\\n[1] "); - int lenght = Array.getLength(value); - for (int i = 0; i < lenght; i++) { - if (lenght > 1 && value.getClass().getComponentType() == Boolean.TYPE && (boolean) Array.get(value, i)) { + int length = Array.getLength(value); + for (int i = 0; i < length; i++) { + if (length > 1) { // what the heck? - sb.append(" "); + sb.append(getBooleanPrefix(value, i)); } sb.append(getRValue(Array.get(value, i))); - if (i < lenght - 1) { + if (i < length - 1) { sb.append(" "); } } @@ -490,6 +686,61 @@ public class TestJavaInterop extends TestBase { return value.toString(); } + private String toRVector(Object o, String asXXX) { + if (o.getClass().isArray()) { + List<Object> l = new ArrayList<>(); + for (int i = 0; i < Array.getLength(o); i++) { + l.add(Array.get(o, i)); + } + return toRVector(l, asXXX); + } + Assert.fail(o + " should have been an array"); + return null; + } + + private String toRVector(List<?> l, String asXXX) { + StringBuilder sb = new StringBuilder(); + if (asXXX != null) { + sb.append(asXXX); + sb.append("(c("); + } else { + sb.append("c("); + } + Iterator<?> it = l.iterator(); + while (it.hasNext()) { + Object o = it.next(); + if (asXXX != null) { + if (asXXX.equals("as.character") && (o instanceof Double || o instanceof Float)) { + o = DoubleVectorPrinter.encodeReal(((Number) o).doubleValue()); + } + sb.append(getRValue(o)); + } else { + sb.append(getRValue(o)); + } + if (it.hasNext()) { + sb.append(','); + } + } + if (asXXX != null) { + sb.append("))"); + } else { + sb.append(")"); + } + return sb.toString(); + } + + private String getAsXXX(Object o, String asXXX) { + StringBuilder sb = new StringBuilder(); + sb.append(asXXX); + sb.append("("); + if (asXXX.equals("as.character") && (o instanceof Double || o instanceof Float)) { + o = DoubleVectorPrinter.encodeReal(((Number) o).doubleValue()); + } + sb.append(getRValue(o)); + sb.append(')'); + return sb.toString(); + } + private String getRValuesAsString(Object... values) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < values.length; i++) { @@ -502,6 +753,17 @@ public class TestJavaInterop extends TestBase { return sb.toString(); } + private String getBooleanPrefix(Object value, int i) { + if (value.getClass().getComponentType() == Boolean.TYPE && (boolean) Array.get(value, i)) { + return " "; + } + if (i > 0 && value.getClass().getComponentType() == String.class && + (Array.get(value, i).equals("T") || Array.get(value, i).equals("F") || Array.get(value, i).equals("TRUE") || Array.get(value, i).equals("FALSE"))) { + return " "; + } + return ""; + } + public static class TestNamesClass { public Object field; public static Object staticField; @@ -582,7 +844,7 @@ public class TestJavaInterop extends TestBase { public static char[] fieldStaticCharArray; public static double[] fieldStaticDoubleArray; public static float[] fieldStaticFloatArray; - public static int[] fieldStaticIntArray; + public static int[] fieldStaticIntegerArray; public static long[] fieldStaticLongArray; public static short[] fieldStaticShortArray; public static String[] fieldStaticStringArray; @@ -592,10 +854,12 @@ public class TestJavaInterop extends TestBase { public char[] fieldCharArray = fieldStaticCharArray; public double[] fieldDoubleArray = fieldStaticDoubleArray; public float[] fieldFloatArray = fieldStaticFloatArray; - public int[] fieldIntArray = fieldStaticIntArray; + public int[] fieldIntegerArray = fieldStaticIntegerArray; public long[] fieldLongArray = fieldStaticLongArray; public short[] fieldShortArray = fieldStaticShortArray; public String[] fieldStringArray = fieldStaticStringArray; + public String[] fieldStringIntArray = new String[]{"1", "2", "3"}; + public String[] fieldStringBooleanArray = new String[]{"TRUE", "TRUE", "FALSE"}; public int[][] int2DimArray; public Object[] objectArray; @@ -610,10 +874,33 @@ public class TestJavaInterop extends TestBase { public static Object fieldStaticNullObject = null; public Object fieldNullObject = null; + public List<Boolean> listBoolean = new ArrayList<>(Arrays.asList(true, false, true)); + public List<Byte> listByte = new ArrayList<>(Arrays.asList((byte) 1, (byte) 2, (byte) 3)); + public List<Character> listChar = new ArrayList<>(Arrays.asList('a', 'b', 'c')); + public List<Double> listDouble = new ArrayList<>(Arrays.asList(1.1, 2.1, 3.1)); + public List<Float> listFloat = new ArrayList<>(Arrays.asList(1.1f, 2.1f, 3.1f)); + public List<Integer> listInteger = new ArrayList<>(Arrays.asList(1, 2, 3)); + public List<Long> listLong = new ArrayList<>(Arrays.asList(1L, 2L, 3L)); + public List<Short> listShort = new ArrayList<>(Arrays.asList((short) 1, (short) 2, (short) 3)); + public List<String> listString = new ArrayList<>(Arrays.asList("a", "b", "c")); + public List<String> listStringInt = new ArrayList<>(Arrays.asList("1", "2", "3")); + public List<String> listStringBoolean = new ArrayList<>(Arrays.asList("TRUE", "TRUE", "FALSE")); + + public static class Element { + public final String data; + + public Element(String data) { + this.data = data; + } + } + + public List<Element> listObject = new ArrayList<>(Arrays.asList(new Element("a"), new Element("b"), new Element("c"), null)); + public Element[] arrayObject = new Element[]{new Element("a"), new Element("b"), new Element("c"), null}; + public Map<String, String> map; public TestClass() { - this(true, Byte.MAX_VALUE, 'a', Double.MAX_VALUE, Float.MAX_VALUE, Integer.MAX_VALUE, Long.MAX_VALUE, Short.MAX_VALUE, "a string"); + this(true, Byte.MAX_VALUE, 'a', Double.MAX_VALUE, 1.1f, Integer.MAX_VALUE, Long.MAX_VALUE, Short.MAX_VALUE, "a string"); } public TestClass(boolean bo, byte bt, char c, double d, float f, int i, long l, short sh, String st) { @@ -660,7 +947,7 @@ public class TestJavaInterop extends TestBase { fieldStaticCharArray = new char[]{'a', 'b', 'c'}; fieldStaticDoubleArray = new double[]{1.1, 2.1, 3.1}; fieldStaticFloatArray = new float[]{1.1f, 2.1f, 3.1f}; - fieldStaticIntArray = new int[]{1, 2, 3}; + fieldStaticIntegerArray = new int[]{1, 2, 3}; fieldStaticLongArray = new long[]{1, 2, 3}; fieldStaticShortArray = new short[]{1, 2, 3}; fieldStaticStringArray = new String[]{"a", "b", "c"}; @@ -670,7 +957,7 @@ public class TestJavaInterop extends TestBase { fieldCharArray = fieldStaticCharArray; fieldDoubleArray = fieldStaticDoubleArray; fieldFloatArray = fieldStaticFloatArray; - fieldIntArray = fieldStaticIntArray; + fieldIntegerArray = fieldStaticIntegerArray; fieldLongArray = fieldStaticLongArray; fieldShortArray = fieldStaticShortArray; fieldStringArray = fieldStaticStringArray; @@ -728,7 +1015,7 @@ public class TestJavaInterop extends TestBase { } public static int[] methodStaticIntArray() { - return fieldStaticIntArray; + return fieldStaticIntegerArray; } public boolean methodBoolean() { @@ -772,7 +1059,7 @@ public class TestJavaInterop extends TestBase { } public int[] methodIntArray() { - return fieldIntArray; + return fieldIntegerArray; } public static Boolean methodStaticBooleanObject() {