typetools / typetools/checker-framework

@Interned and autoboxing

Open
#84 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

The type checker manual says: "... object creation expressions (using new) are 
never considered @Interned unless they are annotated as such, as in
@Interned Double internedDoubleZero = new @Interned Double(0); "

I would expect that 

@Interned Double internedDoubleZero = new Double(0);

would result in a type checker warning then.  However, the type checker does 
not warn.

Similarly, I would expect a warning when the following method is invoked with 
non-interned values:

boolean method(@Interned Character a, @Interned Character b) {return a==b;}

method(new Character('a'),new Character('a'));  // <== oops, no warning ???
method('ä','ü');                                // dito

What version of the product are you using? On what operating system?

javac 1.7.0-jsr308-1.1.0b on Windows

Original issue reported on code.google.com by ja...@angelikalanger.com on 30 Aug 2010 at 6:34

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two examples in the issue with the reported javac 1.7.0-jsr308-1.1.0b environment, focusing on @Interned assignments, method arguments, autoboxing, and character literals. Determine whether the type checker should warn for each non-interned value; done means the expected warnings are produced consistently.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.