killme2008 / killme2008/aviatorscript

seq.max(coll) 存在报 NullPointerException 的问题

Open
#537 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.2k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

【问题描述】
当指定的集合中存在 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);
```

【预期结果】
忽略集合中的 null 值,输出结果为 2

【实际结果】
报错 NullPointerException

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported seq.max(coll) expression with Arrays.asList(null, 1, 2) and inspect the seq.max implementation or entry point. Done means null elements are ignored and the expression returns 2 without throwing a NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.