typetools / typetools/checker-framework
isVariableTreeDeclaredUsingVar assumes var types don't have start positions, is broken by changes in JDK-8329951
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
isVariableTreeDeclaredUsingVar assumes that the type of a VariableTree declared using var will not have a start position set:
After an upcoming javac change in https://github.com/openjdk/jdk/commit/e2f736658fbd03d2dc2186dbd9ba9b13b1f1a8ac, start positions are set for types of variables declared using var, so this approach no longer works.
isVariableTreeDeclaredUsingVar could be fixed by also checking for JCVariableDecl#declaredUsingVar
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 in javacutil/src/main/java/org/checkerframework/javacutil/TreeUtils.java at isVariableTreeDeclaredUsingVar, then inspect the JCVariableDecl#declaredUsingVar information mentioned in the issue. Confirm that the method still identifies variables declared with var after javac assigns start positions to their types, and verify the relevant checker-framework behavior against the described JDK change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100