typetools / typetools/checker-framework

All inheritable declaration annotations are being inherited, regardless of their relationship

Open
#342 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

When inheriting related declaration annotations, the element should inherit 
only the "stronger ones", instead of all of them.

For example:
class Super {
     @Pure 
     void foo(){}
}   

class clazz extends Super {
     @SideEffectFree
     @Override
     void foo(){}
}

We want clazz.foo() to have only the @Pure annotation since @Pure and 
@SideEffectFree are related, but instead it currently has both of them.

There is a test case for that issue in 
checker-framework/checker/jtreg/nullness/inheritDeclAnnoPersist/Extends.java: 
method m3().


Original issue reported on code.google.com by pbsf...@gmail.com on 17 Jul 2014 at 10:12

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 with checker/jtreg/nullness/inheritDeclAnnoPersist/Extends.java, especially method m3(), and run the relevant jtreg test to reproduce the annotation inheritance behavior. Trace the declaration-annotation inheritance logic that handles related annotations. Done means only the stronger related annotation, such as @Pure rather than both @Pure and @SideEffectFree, is inherited.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.