typetools / typetools/checker-framework

Make an existing annotation indicate a field is set/injected; existing annotation acts like @SuppressWarnings

Open
#1,640 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Many injection framework allows to create class fields which will be initialized later.
Now I use @SuppressWarnings("initialization.fields.uninitialized") for all this fields to prevent CF error.
It would be nice to have some annotation which tell CF that field will be initialized later

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@AnnotatedFieldWillBeInjectedAtRuntime // <-------------------
public @interface MyInject {}

And any fields annotated using MyInject will not produce "initialization.fields.uninitialized" error.

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

The issue names no files, tests, or entry points. Start by locating the handling for "initialization.fields.uninitialized" and how annotations on fields and annotation declarations are interpreted. Define how an annotation such as MyInject should suppress that error, then add coverage for a runtime-injected field and its meta-annotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.