From 5e801edb64e1ea8b97c5a455b1e8567bbdc51ae5 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Tue, 30 Aug 2022 18:55:50 +0200 Subject: [PATCH] Fix insights reporting agent members non-invocable --- .../truffle/tools/agentscript/impl/AgentObject.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/src/com.oracle.truffle.tools.agentscript/src/com/oracle/truffle/tools/agentscript/impl/AgentObject.java b/tools/src/com.oracle.truffle.tools.agentscript/src/com/oracle/truffle/tools/agentscript/impl/AgentObject.java index 4879de6d4da7..dbb6e4230310 100644 --- a/tools/src/com.oracle.truffle.tools.agentscript/src/com/oracle/truffle/tools/agentscript/impl/AgentObject.java +++ b/tools/src/com.oracle.truffle.tools.agentscript/src/com/oracle/truffle/tools/agentscript/impl/AgentObject.java @@ -24,6 +24,10 @@ */ package com.oracle.truffle.tools.agentscript.impl; +import java.io.IOException; + +import org.graalvm.tools.insight.Insight; + import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.interop.InteropLibrary; import com.oracle.truffle.api.interop.TruffleObject; @@ -32,8 +36,6 @@ import com.oracle.truffle.api.library.CachedLibrary; import com.oracle.truffle.api.library.ExportLibrary; import com.oracle.truffle.api.library.ExportMessage; -import java.io.IOException; -import org.graalvm.tools.insight.Insight; @SuppressWarnings({"unused", "static-method"}) @ExportLibrary(InteropLibrary.class) @@ -155,6 +157,6 @@ private static String convertToString(InteropLibrary interop, Object obj) throws @ExportMessage static boolean isMemberInvocable(AgentObject obj, String member) { - return false; + return "on".equals(member) || "off".equals(member); } }