typetools / typetools/checker-framework
Value Checker should warn when @StaticallyExecutable is ignored
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
A @StaticallyExecutable annotation is ignored unless the method's types are among those analyzed by the Value Checker. If a user writes a @StaticallyExecutable annotation that will be ignored, then the Value Checker should issue a warning (not an error).
Here is example code for which the Index Checker issues a warning, because the Value Checker is not able to statically analyze the code, but that reason is not obvious to a programmer:
import org.checkerframework.common.value.qual.ArrayLen;
import org.checkerframework.common.value.qual.StaticallyExecutable;
import org.checkerframework.dataflow.qual.SideEffectFree;
public class StaticallyExecutableSplitLines {
public String /*@ArrayLen(11)*/[] testSplitLines() {
return splitLines("one\ntwo\n\rthree\r\nfour\rfive\n\n\nsix\r\n\r\n\r\n");
}
/*@SideEffectFree*/ /*@StaticallyExecutable*/
public static String[] splitLines(String s) {
return s.split("\r\n?|\n\r?", -1);
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided StaticallyExecutableSplitLines example with the Value Checker and inspect how @StaticallyExecutable is handled when the method's types are unsupported. Done means the checker emits a warning, rather than an error, when the annotation is ignored; the payload names no source file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100