typetools / typetools/checker-framework

Gui Effect Checker: handle field accesses like setters

Open
#1,175 7 comments 0 reactions 1 assignee View on GitHub

@csgordon is already working on this.

Since Mar 23, 2017.

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

Description

Consider class

class GBC extends GridBagConstraints{
          
      public GBC(int gridx,int gridy,...){
             // Checker issues warning to annotate this constructor using @UIEffect
      }

      public GBC setweights(int weightx,int weighty){
            this.weightx = weightx;
            this.weighty = weighty;
            return this;
            // Checker fails to issue warning for such methods that may access UI elements.
      }
}

Gui effect checker correctly issues warning when for constructor of this class. but fails to issue error when we create methods that may access the UI elements.

One should expect

   Error - Calling a method with UIEffect effect from a context limited to SafeEffect effects.
	                public GBC setweights(int weightx, int weighty) {

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.