Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

发现了个bug #37

Closed
Luyu05 opened this issue Oct 22, 2018 · 3 comments
Closed

发现了个bug #37

Luyu05 opened this issue Oct 22, 2018 · 3 comments

Comments

@Luyu05
Copy link

Luyu05 commented Oct 22, 2018

public static void main(String[] args) throws Exception {
        ExpressRunner runner = new ExpressRunner();
        DefaultContext<String, Object> context = new DefaultContext<String, Object>();
        String express = "part = \"1@2@3\".split(\"@\");\n" +
                "Integer.valueOf(part[2]);";
        runner.execute(express, context, null, true, false);
}

执行这段代码会报这个错误

Caused by: java.lang.Exception: 没有找到java.lang.Class的方法:valueOf([Ljava.lang.String;)
	at com.ql.util.express.instruction.op.OperatorMethod.executeInner(OperatorMethod.java:96)
	at com.ql.util.express.instruction.op.OperatorBase.execute(OperatorBase.java:67)
	at com.ql.util.express.instruction.detail.InstructionOperator.execute(InstructionOperator.java:44)
	... 8 more

把express的内容改为

part = "1@2@3".split("@");
str = part[2];
Integer.valueOf(str);

就可以了

@daliuser
Copy link

试了下,确实如此。

@baoxingjie
Copy link
Contributor

是的,目前在数组的识别上是有bug

@baoxingjie
Copy link
Contributor

https://github.com/alibaba/QLExpress/blob/master/VERSIONS.md
使用3.2.5,类型识别上的bug已经修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants