Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

4.3.0: BitSet.clear() fails with flowexpr.parse.index.too.big — @SideEffectsOnly("#1") on a no-arg method

Open Beginner friendly
#8,325 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@mernst is already working on this.

Since Oct 7, 2026.

  • #8326 by @mernst — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing-qa

Research direction

The issue identifies the three clear overloads in annotated-jdk/src/java.base/share/classes/java/util/BitSet.java and provides a reproducer. Read the @SideEffectsOnly annotations and run the supplied Nullness Checker command with the 4.3.0 jars. Done when the no-arg reproducer no longer reports the parameter-index error and the other overloads' annotations reflect receiver mutation.

Written by the indexing model from the issue text.

Description

Problem

Since 4.3.0, any call to the no-arg BitSet.clear() fails the Nullness Checker:

Repro.java:5: error: [flowexpr.parse.index.too.big] the method has no parameter #1 (total 0 parameters)
        bits.clear();
                  ^

It worked on 4.2.2.

Reproduce
import java.util.BitSet;

class Repro {
    void reset(BitSet bits) {
        bits.clear();
    }
}
javac -proc:only \
  -cp checker-qual-4.3.0.jar \
  -processorpath checker-4.3.0.jar:checker-qual-4.3.0.jar \
  -processor org.checkerframework.checker.nullness.NullnessChecker \
  Repro.java

With 4.2.2 jars: no errors. With 4.3.0 jars: the error above.
JDK: 21.0.3.

Cause

4.3.0 added @SideEffectsOnly("#1") to all three clear overloads in annotated-jdk/src/java.base/share/classes/java/util/BitSet.java:

@SideEffectsOnly("#1")
public void clear(@GuardSatisfied BitSet this, @NonNegative int bitIndex);

@SideEffectsOnly("#1")
public void clear(@GuardSatisfied BitSet this, @NonNegative int fromIndex, @NonNegative int toIndex);

@SideEffectsOnly("#1")
public void clear(@GuardSatisfied BitSet this);

On clear(), #1 doesn't exist, which causes the error. On the other two overloads, #1 is an int index, but the method mutates the receiver. So "this" looks like the intended value for all three:

@SideEffectsOnly("this")
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 8h
Merged PRs (30d)
154

Getting set up

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.

More from typetools/checker-framework

All issues in typetools/checker-framework

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.