Skip to content

jbct-maven-plugin 0.4.5: Parse error on 2D array declaration #16

@siy

Description

@siy

Description

The JBCT Maven plugin fails to parse a valid Java file containing a 2D array declaration.

Environment

  • jbct-maven-plugin version: 0.4.5
  • Java version: 21
  • Maven version: 3.9.x

Error Message

[ERROR] Error formatting MinuteAggregator.java: Parse error at MinuteAggregator.java:156:57 - unexpected input

Minimal Reproduction

The offending line:

float[][] result = new float[windowMinutes][];

Position 57 on line 156 points to the [][] portion of the 2D array type declaration.

Full Context

public float[][] toTTMInput(int windowMinutes) {
    lock.readLock()
        .lock();
    try {
        var recentAggregates = recent(windowMinutes);
        float[][] result = new float[windowMinutes][];  // <-- Parse error here
        // Initialize with zeros
        for (int i = 0; i < windowMinutes; i++) {
            result[i] = new float[MinuteAggregate.featureNames().length];
        }
        // ...
    }
}

Expected Behavior

The formatter should handle 2D array declarations without parse errors.

Workaround

None found - the file cannot be formatted with the plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions