typetools / typetools/checker-framework
isElementFromByteCode ignores whether Element is from source code
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
org.checkerframework.javacutil.ElementUtils#isElementFromByteCode(Element) is documented as:
Returns true if the element is declared in ByteCode.
This method appears to be buggy. It returns true if the element can be found in byte code on the classpath.
However, it is possible that an element is was read from source code even though it is also available as byte code from the classpath. For example, a .java file could be supplied on the command line even though the corresponding .class file is also on the classpath. In this case, javac ignores the .class file on the classpath and only uses the source code.
isElementFromByteCode should do the same as javac, and return false if the element has been read from source code.
This issue is affecting Paulo's interprocedural type inference.
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 at org.checkerframework.javacutil.ElementUtils#isElementFromByteCode and inspect how javac distinguishes source-backed elements from classpath bytecode. Reproduce the source-and-classpath case described in the issue, then verify the method returns false for the source element and true for a bytecode element.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100