Skip to content

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

Closed
typetools/jdk
#302

Description

@alaktionov

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")

Activity

  1. mernst commented on Oct 7, 2026

    @mernst
    Member

    Thank you for the bug report, and I'm sorry about the problem. You are right about the root cause. #8326 and typetools/jdk#302 fix the problem. We can make a snapshot release or a 4.3.1 release if you need that.

  2. d9zbglobal commented on Oct 8, 2026

    @d9zbglobal

    4.3.1 release would be very much appreciated - just hit this one today.

  3. added a commit that references this issue on Oct 8, 2026
  4. mernst commented on Oct 8, 2026

    @mernst
    Member

    We made the release. Please let us know of any other problems you encounter.

  5. d9zbglobal commented on Oct 9, 2026

    @d9zbglobal

    7. We made the release. Please let us know of any other problems you encounter.

    Thank you very much - amazingly quick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions