Hi Vlad,

In src/components/src/main/java/org/apache/jmeter/assertions/gui/AssertionGui.java, line 160

Before:

    public void modifyTestElement(TestElement args) {
        GuiUtils.stopTableEditing(table);
        if (args instanceof Arguments) {
            Arguments arguments = (Arguments) args;
            arguments.clear();

After:
    public void modifyTestElement(TestElement args) {
        GuiUtils.stopTableEditing(table);
        if (args instanceof Arguments arguments) {
            arguments.clear();

=> directly define the arguments variable

Unfortunately the autostyle not seems recognize this:


Build jmeter FAILURE reason:
    Execution failed for task ':src:components:autostyleJavaProcess':
        com.github.autostyle.FormatterException: Error while formatting src/components/src/main/java/org/apache/jmeter/assertions/gui/AssertionGui.java: 160:45: error: ')' expected             Caused by: com.google.googlejavaformat.java.FormatterException: 160:45: error: ')' expected                 at com.google.googlejavaformat.java.FormatterException.fromJavacDiagnostics(FormatterException.java:50)                 at com.google.googlejavaformat.java.RemoveUnusedImports.parse(RemoveUnusedImports.java:253)                 at com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:211)                 at com.google.googlejavaformat.java.RemoveUnusedImports.removeUnusedImports(RemoveUnusedImports.java:204)                 at com.github.autostyle.java.GoogleJavaFormatStep$State.lambda$createRemoveUnusedImportsOnly$1(GoogleJavaFormatStep.java:156)                 at com.github.autostyle.FormatterFunc.apply(FormatterFunc.java:31)                 at com.github.autostyle.FormatterStepImpl$Standard.format(FormatterStepImpl.java:77)                 at com.github.autostyle.FormatterStep$Strict.format(FormatterStep.java:76)                 at com.github.autostyle.Formatter.compute(Formatter.java:204)                 at com.github.autostyle.Formatter.formatOrNull(Formatter.java:171)                 at com.github.autostyle.ConvergenceAnalyzer.analyze(ConvergenceAnalyzer.kt:45)                 at com.github.autostyle.gradle.AutostyleTask.formatFiles(AutostyleTask.kt:118)                 at com.github.autostyle.gradle.AutostyleTask.run(AutostyleTask.kt:107)

Is a autostyle bug/missing behavior or just need to update autostyle?

Milamber

Reply via email to