aviatorscript
aviatorscript copied to clipboard
A high performance scripting language hosted on the JVM.
因为traceOutputStream似乎是全局唯一的?
`let appkey = get_appkey("com.sankuai.aaa.bbb.ccc"); if appkey != nil{ return appkey.serviceLevel; } return nil;` getVariableFullNames返回["appkey.serviceLevel"],与预期为[]不一致,请问是feature还是bug
有比较好用的aviatorscript编辑器推荐吗?
关于脚本校验问题
作者你好,我这边遇到一个困难,就是在跳过运行阶段,去校验脚本的正确性,比如需要获取所有的变量、和获取所有的调用的函数。 获取所有变量好像可以通过getVariableFullNames()获取,但是获取脚本内调用的函数,无法获取,想看看有没啥好办法
**前提:业务上允许a.b.c中a or b为null,当a or b为null时返回null,且为了方便配置大部分均这样配置** **Option设置:Options.NIL_WHEN_PROPERTY_NOT_FOUND=true** 性能分析时,发现com.googlecode.aviator.utils.Reflector#fastGetProperty(java.lang.String, java.lang.String[], java.util.Map, com.googlecode.aviator.utils.Reflector.Target, boolean, int, int)方法中有如下实现 通过火焰图分析发现com.googlecode.aviator.runtime.type.AviatorJavaType#tryResolveAsClass方法执行性能损耗极大(如下面的性能分析所示)。 分析该方法的实现逻辑,大概是:当a.b.c中a为null时,对a进行一系列的class类型处理,其目的之一是读取静态变量的前置逻辑。 除此之外该方法还有哪些意图? 如果禁止该方法的执行会丢失哪些功能? 提供禁止执行的选项开关(如添加Options选项)是否是一种解决方案? 附:性能对比实现与结果 实现: 1. 对com.googlecode.aviator.runtime.type.AviatorJavaType#tryResolveAsClass执行添加开关Options.SWITCH ```java if (target.innerEnv != null) { val =...
【问题描述】 当指定的集合中存在 null 元素,且 null 位于集合的首位时,会抛出 NullPointerException。 【测试步骤】 ``` Expression expr = AviatorEvaluator.compile("seq.max(coll)"); Map env = new HashMap(); env.put("coll", Arrays.asList(null, 1, 2)); Object obj = expr.execute(env); System.out.println(obj); ``` 【预期结果】 忽略集合中的...
现在我自定义了一个函数: get函数。 在Aviator中这样使用,get(today_sum, -1),getVariableNames方法能返回today_sum, -1这个值能有办法返回吗?
https://www.baeldung.com/java-hidden-classes
Hello 👋 I run a security community that finds and fixes vulnerabilities in OSS. A researcher (@siebene) has found a potential issue, which I would be eager to share with...