Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.34.0
Description
The problem is that it implicitly implies that method should have 2+ args based on org.apache.calcite.rel.metadata.janino.CacheGeneratorUtil.CacheKeyStrategy#safeArgList.
At the same time different libs like JaCoCo could generate extra methods like private static boolean[] org.apache.calcite.rel.metadata.BuiltInMetadata$Predicates$Handler.$jacocoInit().
It took several hours to realize it.... since currently it complains like
java.lang.IllegalArgumentException: fromIndex(2) > toIndex(0) at java.base/java.util.AbstractList.subListRangeCheck(AbstractList.java:509) at java.base/java.util.AbstractList.subList(AbstractList.java:497) at org.apache.calcite.rel.metadata.janino.CacheGeneratorUtil$CacheKeyStrategy$1.safeArgList(CacheGeneratorUtil.java:213) at org.apache.calcite.rel.metadata.janino.CacheGeneratorUtil$CacheKeyStrategy$1.cacheKeyBlock(CacheGeneratorUtil.java:205) ...
The idea is to put assert something like that
assert method.getParameterCount() >= 2 : method.toString();
to simplify the process of finding the root cause
Attachments
Issue Links
- links to