Skip to content

SONARJAVA-7236 PoC: replace the ECJ parser with semsitter - #6407

Draft
rombirli wants to merge 4 commits into
masterfrom
rombirli/semsitter-ecj-replacement
Draft

rombirli wants to merge 4 commits into
masterfrom
rombirli/semsitter-ecj-replacement

Conversation

@rombirli

Copy link
Copy Markdown
Contributor

Part of SONARJAVA-7234

Draft, do not merge. Stops before a Java grammar.

Summary

  • Drops the jdt-package (ECJ) dependency. Parser and semantic types are empty stubs. Main sources compile. Tests are not expected to pass.
  • Adds semsitter-sample, a Cargo crate pinned to semsitter udg-model at d606e04b766dc4f506c20c3c37f26d1511b5f065, with one tree-sitter rule (source_file matches hello). cargo test in that directory passes.
  • Java grammar and unit tests are not in this PR.

How SonarSource uses semsitter

  • sonar-context-augmentation depends on udg-gen from github.com/SonarSource/semsitter (git rev pin, optional navigation feature) plus tree-sitter grammars. Cargo needs GitHub auth for the private repo (gh auth setup-git, or CARGO_NET_GIT_FETCH_WITH_CLI=true).
  • sonar-skunk depends on udg-model the same way (different rev). Its Java side is a JNI bridge; the project graph still uses an inactive stub.
  • sonarqube-mcp-server only toggles SONAR_CAG_USE_SEMSITTER.
  • This PoC pins udg-model only, over SSH, so it does not pull udg-gen default features (lang-delphi needs private sonar-skunk).

Test plan

  • mvn -pl java-frontend,java-checks,java-checks-common,java-jsp,sonar-java-plugin -am compile -DskipTests (check-list process-classes first, so GeneratedCheckList exists)
  • cargo test in semsitter-sample
  • Java grammar and frontend unit tests (next step, not this PR)

Main sources still compile against empty trees and symbols. Tests are expected to fail until a semsitter parser fills them in.
Pin udg-model and prove a single tree-sitter rule parses, before attempting a Java grammar.
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

SONARJAVA-7236

@datadog-sonarsource

datadog-sonarsource Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 8 Pipeline jobs failed

Build | Build and Unit Test on Windows — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Build | Plugin QA (LATEST_RELEASE, false) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Build | Ruling QA (warp-custom-windows-2022-l, without-sonarqube-project, LATEST_RELEASE) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

View all 8 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 755b0cf | Docs | View more details | Give us feedback!

The shaded jdt-package was most of the 19 MB minimum. The plugin is now about 11 MB.
Comment on lines -27 to +41

private ModifierTree convertModifier(org.eclipse.jdt.core.dom.Modifier node) {
switch (node.getKeyword().toString()) {
case "public":
return new ModifierKeywordTreeImpl(Modifier.PUBLIC, firstTokenIn(node, TerminalToken.TokenNamepublic));
case "protected":
return new ModifierKeywordTreeImpl(Modifier.PROTECTED, firstTokenIn(node, TerminalToken.TokenNameprotected));
case "private":
return new ModifierKeywordTreeImpl(Modifier.PRIVATE, firstTokenIn(node, TerminalToken.TokenNameprivate));
case "static":
return new ModifierKeywordTreeImpl(Modifier.STATIC, firstTokenIn(node, TerminalToken.TokenNamestatic));
case "abstract":
return new ModifierKeywordTreeImpl(Modifier.ABSTRACT, firstTokenIn(node, TerminalToken.TokenNameabstract));
case "final":
return new ModifierKeywordTreeImpl(Modifier.FINAL, firstTokenIn(node, TerminalToken.TokenNamefinal));
case "native":
return new ModifierKeywordTreeImpl(Modifier.NATIVE, firstTokenIn(node, TerminalToken.TokenNamenative));
case "synchronized":
return new ModifierKeywordTreeImpl(Modifier.SYNCHRONIZED, firstTokenIn(node, TerminalToken.TokenNamesynchronized));
case "transient":
return new ModifierKeywordTreeImpl(Modifier.TRANSIENT, firstTokenIn(node, TerminalToken.TokenNametransient));
case "volatile":
return new ModifierKeywordTreeImpl(Modifier.VOLATILE, firstTokenIn(node, TerminalToken.TokenNamevolatile));
case "strictfp":
return new ModifierKeywordTreeImpl(Modifier.STRICTFP, firstTokenIn(node, TerminalToken.TokenNamestrictfp));
case "default":
return new ModifierKeywordTreeImpl(Modifier.DEFAULT, firstTokenIn(node, TerminalToken.TokenNamedefault));
case "sealed":
return new ModifierKeywordTreeImpl(Modifier.SEALED, firstTokenIn(node, TerminalToken.TokenNameRestrictedIdentifiersealed));
case "non-sealed": {
return new ModifierKeywordTreeImpl(Modifier.NON_SEALED, firstTokenIn(node, TerminalToken.TokenNamenon_sealed));
column++;
}
default:
throw new IllegalStateException(node.getKeyword().toString());
}
}

private static final TerminalToken ANY_TOKEN = TerminalToken.TokenNameInvalid;

private static final Map<Object, Op> operators = new HashMap<>();

private static class Op {
final Tree.Kind kind;

/**
* {@link TerminalToken}
*/
final TerminalToken tokenType;

Op(Tree.Kind kind, TerminalToken tokenType) {
this.kind = kind;
this.tokenType = tokenType;
}
}

static {
operators.put(PrefixExpression.Operator.PLUS, new Op(Tree.Kind.UNARY_PLUS, TerminalToken.TokenNamePLUS));
operators.put(PrefixExpression.Operator.MINUS, new Op(Tree.Kind.UNARY_MINUS, TerminalToken.TokenNameMINUS));
operators.put(PrefixExpression.Operator.NOT, new Op(Tree.Kind.LOGICAL_COMPLEMENT, TerminalToken.TokenNameNOT));
operators.put(PrefixExpression.Operator.COMPLEMENT, new Op(Tree.Kind.BITWISE_COMPLEMENT, TerminalToken.TokenNameTWIDDLE));
operators.put(PrefixExpression.Operator.DECREMENT, new Op(Tree.Kind.PREFIX_DECREMENT, TerminalToken.TokenNameMINUS_MINUS));
operators.put(PrefixExpression.Operator.INCREMENT, new Op(Tree.Kind.PREFIX_INCREMENT, TerminalToken.TokenNamePLUS_PLUS));

operators.put(PostfixExpression.Operator.DECREMENT, new Op(Tree.Kind.POSTFIX_DECREMENT, TerminalToken.TokenNameMINUS_MINUS));
operators.put(PostfixExpression.Operator.INCREMENT, new Op(Tree.Kind.POSTFIX_INCREMENT, TerminalToken.TokenNamePLUS_PLUS));

operators.put(InfixExpression.Operator.TIMES, new Op(Tree.Kind.MULTIPLY, TerminalToken.TokenNameMULTIPLY));
operators.put(InfixExpression.Operator.DIVIDE, new Op(Tree.Kind.DIVIDE, TerminalToken.TokenNameDIVIDE));
operators.put(InfixExpression.Operator.REMAINDER, new Op(Tree.Kind.REMAINDER, TerminalToken.TokenNameREMAINDER));
operators.put(InfixExpression.Operator.PLUS, new Op(Tree.Kind.PLUS, TerminalToken.TokenNamePLUS));
operators.put(InfixExpression.Operator.MINUS, new Op(Tree.Kind.MINUS, TerminalToken.TokenNameMINUS));
operators.put(InfixExpression.Operator.LEFT_SHIFT, new Op(Tree.Kind.LEFT_SHIFT, TerminalToken.TokenNameLEFT_SHIFT));
operators.put(InfixExpression.Operator.RIGHT_SHIFT_SIGNED, new Op(Tree.Kind.RIGHT_SHIFT, TerminalToken.TokenNameRIGHT_SHIFT));
operators.put(InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED, new Op(Tree.Kind.UNSIGNED_RIGHT_SHIFT, TerminalToken.TokenNameUNSIGNED_RIGHT_SHIFT));
operators.put(InfixExpression.Operator.LESS, new Op(Tree.Kind.LESS_THAN, TerminalToken.TokenNameLESS));
operators.put(InfixExpression.Operator.GREATER, new Op(Tree.Kind.GREATER_THAN, TerminalToken.TokenNameGREATER));
operators.put(InfixExpression.Operator.LESS_EQUALS, new Op(Tree.Kind.LESS_THAN_OR_EQUAL_TO, TerminalToken.TokenNameLESS_EQUAL));
operators.put(InfixExpression.Operator.GREATER_EQUALS, new Op(Tree.Kind.GREATER_THAN_OR_EQUAL_TO, TerminalToken.TokenNameGREATER_EQUAL));
operators.put(InfixExpression.Operator.EQUALS, new Op(Tree.Kind.EQUAL_TO, TerminalToken.TokenNameEQUAL_EQUAL));
operators.put(InfixExpression.Operator.NOT_EQUALS, new Op(Tree.Kind.NOT_EQUAL_TO, TerminalToken.TokenNameNOT_EQUAL));
operators.put(InfixExpression.Operator.XOR, new Op(Tree.Kind.XOR, TerminalToken.TokenNameXOR));
operators.put(InfixExpression.Operator.OR, new Op(Tree.Kind.OR, TerminalToken.TokenNameOR));
operators.put(InfixExpression.Operator.AND, new Op(Tree.Kind.AND, TerminalToken.TokenNameAND));
operators.put(InfixExpression.Operator.CONDITIONAL_OR, new Op(Tree.Kind.CONDITIONAL_OR, TerminalToken.TokenNameOR_OR));
operators.put(InfixExpression.Operator.CONDITIONAL_AND, new Op(Tree.Kind.CONDITIONAL_AND, TerminalToken.TokenNameAND_AND));

operators.put(Assignment.Operator.ASSIGN, new Op(Tree.Kind.ASSIGNMENT, TerminalToken.TokenNameEQUAL));
operators.put(Assignment.Operator.PLUS_ASSIGN, new Op(Tree.Kind.PLUS_ASSIGNMENT, TerminalToken.TokenNamePLUS_EQUAL));
operators.put(Assignment.Operator.MINUS_ASSIGN, new Op(Tree.Kind.MINUS_ASSIGNMENT, TerminalToken.TokenNameMINUS_EQUAL));
operators.put(Assignment.Operator.TIMES_ASSIGN, new Op(Tree.Kind.MULTIPLY_ASSIGNMENT, TerminalToken.TokenNameMULTIPLY_EQUAL));
operators.put(Assignment.Operator.DIVIDE_ASSIGN, new Op(Tree.Kind.DIVIDE_ASSIGNMENT, TerminalToken.TokenNameDIVIDE_EQUAL));
operators.put(Assignment.Operator.BIT_AND_ASSIGN, new Op(Tree.Kind.AND_ASSIGNMENT, TerminalToken.TokenNameAND_EQUAL));
operators.put(Assignment.Operator.BIT_OR_ASSIGN, new Op(Tree.Kind.OR_ASSIGNMENT, TerminalToken.TokenNameOR_EQUAL));
operators.put(Assignment.Operator.BIT_XOR_ASSIGN, new Op(Tree.Kind.XOR_ASSIGNMENT, TerminalToken.TokenNameXOR_EQUAL));
operators.put(Assignment.Operator.REMAINDER_ASSIGN, new Op(Tree.Kind.REMAINDER_ASSIGNMENT, TerminalToken.TokenNameREMAINDER_EQUAL));
operators.put(Assignment.Operator.LEFT_SHIFT_ASSIGN, new Op(Tree.Kind.LEFT_SHIFT_ASSIGNMENT, TerminalToken.TokenNameLEFT_SHIFT_EQUAL));
operators.put(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN, new Op(Tree.Kind.RIGHT_SHIFT_ASSIGNMENT, TerminalToken.TokenNameRIGHT_SHIFT_EQUAL));
operators.put(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN, new Op(Tree.Kind.UNSIGNED_RIGHT_SHIFT_ASSIGNMENT, TerminalToken.TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL));
InternalSyntaxToken eof = new InternalSyntaxToken(line, column, "", Collections.emptyList(), true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Cross-Repo: Removed JParser.parse(ASTParser,…) breaks sonar-java-symbolic-execution tests

Fix here and in SonarSource/sonar-java-symbolic-execution

Breaks in: SonarSource/sonar-java-symbolic-execution - java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java - JParserTestUtils.parse

This PR replaces the four-argument JParser.parse(ASTParser, String, String, String) with a three-argument parse(version, unitName, source) that returns an empty compilation unit. It also removes the ECJ astParser() factory from JParserConfig. In SonarSource/sonar-java-symbolic-execution, JParserTestUtils.parse (java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java) calls JParserConfig.Mode.FILE_BY_FILE.create(...).astParser() and then the four-argument JParser.parse. Once that repo bumps sonar.java.version (pinned today to 8.44.0.48651) to a release with this change, its test helper won't compile. Even after porting it to the new signature, every parsed tree would be empty and have no semantics, so all SE tests built on it would stop checking anything. The PR is a draft PoC and the break is on purpose. The SE repo still needs a coordinated migration before it adopts this frontend.

Here: Before releasing this frontend, record the removal of JParser.parse(ASTParser, …) and JParserConfig.astParser() in the changelog or migration notes, and tell sonar-java-symbolic-execution about the new three-argument entry point. Coordinate the release so the SE repo does not bump to it until the new parser returns real trees.

There: In JParserTestUtils.parse, drop the astParser() call and use the three-argument JParser.parse(version, unitName, source). Keep sonar.java.version on the current release until the semsitter-based parser produces populated trees with semantics.

In SonarSource/sonar-java-symbolic-execution - java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java:

public static CompilationUnitTree parse(String unitName, String source) {
  return JParser.parse(JParserConfig.MAXIMUM_SUPPORTED_JAVA_VERSION.effectiveJavaVersionAsString(), unitName, source);
}

Was this helpful? React with 👍 / 👎

@github-actions

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6409

@github-actions

Copy link
Copy Markdown
Contributor

Ruling Diff Summary

Detected changes in 18 rule files: 0 issues removed, 15708 issues added.

S1220 (java) on commons-beanutils - 0 issues removed, 246 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BaseDynaBeanMapDecorator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BasicDynaBean.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BasicDynaClass.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanAccessLanguageException.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanIntrospectionData.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanIntrospector.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanPredicate.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanPropertyValueChangeClosure.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicate.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformer.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanUtils.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanUtilsBean.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanUtilsBean2.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software
S2309 (java) on commons-beanutils - 0 issues removed, 100 issues added - new ruling file

Added src/main/java/org/apache/commons/beanutils2/BaseDynaBeanMapDecorator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BasicDynaBean.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BasicDynaClass.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanAccessLanguageException.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanComparator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanIntrospectionData.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanIntrospector.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanPredicate.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanPropertyValueChangeClosure.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanPropertyValueEqualsPredicate.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanToPropertyValueTransformer.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanUtils.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanUtilsBean.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software

Added src/main/java/org/apache/commons/beanutils2/BeanUtilsBean2.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Licensed to the Apache Software Foundation (ASF) under one or more
         3 |  * contributor license agreements.  See the NOTICE file distributed with
         4 |  * this work for additional information regarding copyright ownership.
         5 |  * The ASF licenses this file to You under the Apache License, Version 2.0
         6 |  * (the "License"); you may not use this file except in compliance with
         7 |  * the License.  You may obtain a copy of the License at
         8 |  *
         9 |  *      http://www.apache.org/licenses/LICENSE-2.0
        10 |  *
        11 |  * Unless required by applicable law or agreed to in writing, software
S1220 (java) on eclipse-jetty - 0 issues removed, 690 issues added - new ruling file

Added jetty-http/src/main/java/module-info.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/module-info.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/GZIPContentDecoder.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/GZIPContentDecoder.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HostPortHttpField.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HostPortHttpField.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/Http1FieldPreEncoder.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/Http1FieldPreEncoder.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpContent.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpContent.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java)
S2309 (java) on eclipse-jetty - 0 issues removed, 438 issues added - new ruling file

Added jetty-http/src/main/java/module-info.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/module-info.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/BadMessageException.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/ComplianceViolation.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCompliance.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateGenerator.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/DateParser.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/GZIPContentDecoder.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/GZIPContentDecoder.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HostPortHttpField.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HostPortHttpField.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/Http1FieldPreEncoder.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/Http1FieldPreEncoder.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpCompliance.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpContent.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpContent.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java)

Added jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java (file-level)

(source file not found at this revision: jetty-http/src/main/java/org/eclipse/jetty/http/HttpField.java)
S1220 (java) on guava - 0 issues removed, 469 issues added - new ruling file

Added src/com/google/common/annotations/Beta.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/GwtCompatible.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2009 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/GwtIncompatible.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2009 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/VisibleForTesting.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2006 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/package-info.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Absent.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2011 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/AbstractIterator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2007 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Ascii.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/CaseFormat.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2006 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/CharMatcher.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2008 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Charsets.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2007 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Converter.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2008 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Defaults.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2007 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Enums.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2011 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Equivalence.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,
S2309 (java) on guava - 0 issues removed, 469 issues added - new ruling file

Added src/com/google/common/annotations/Beta.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/GwtCompatible.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2009 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/GwtIncompatible.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2009 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/VisibleForTesting.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2006 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/annotations/package-info.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Absent.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2011 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/AbstractIterator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2007 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Ascii.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/CaseFormat.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2006 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/CharMatcher.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2008 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Charsets.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2007 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Converter.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2008 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Defaults.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2007 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Enums.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2011 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,

Added src/com/google/common/base/Equivalence.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | /*
         2 |  * Copyright (C) 2010 The Guava Authors
         3 |  *
         4 |  * Licensed under the Apache License, Version 2.0 (the "License");
         5 |  * you may not use this file except in compliance with the License.
         6 |  * You may obtain a copy of the License at
         7 |  *
         8 |  * http://www.apache.org/licenses/LICENSE-2.0
         9 |  *
        10 |  * Unless required by applicable law or agreed to in writing, software
        11 |  * distributed under the License is distributed on an "AS IS" BASIS,
S1220 (java) on java-time-example - 0 issues removed, 5 issues added - new ruling file

Added src/main/java/example/AppointmentService.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.LocalDate;
         4 | import java.time.LocalDateTime;
         5 | import java.time.Month;
         6 | import java.time.MonthDay;
         7 | import java.time.YearMonth;
         8 | 
         9 | public class AppointmentService {
        10 | 
        11 |   void schedule() {

Added src/main/java/example/CalendarUtils.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class CalendarUtils {
        11 | 

Added src/main/java/example/EventScheduler.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class EventScheduler {
        11 | 

Added src/main/java/example/HolidayChecker.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class HolidayChecker {
        11 | 

Added src/main/java/example/ReportGenerator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class ReportGenerator {
        11 | 
S2309 (java) on java-time-example - 0 issues removed, 5 issues added - new ruling file

Added src/main/java/example/AppointmentService.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.LocalDate;
         4 | import java.time.LocalDateTime;
         5 | import java.time.Month;
         6 | import java.time.MonthDay;
         7 | import java.time.YearMonth;
         8 | 
         9 | public class AppointmentService {
        10 | 
        11 |   void schedule() {

Added src/main/java/example/CalendarUtils.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class CalendarUtils {
        11 | 

Added src/main/java/example/EventScheduler.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class EventScheduler {
        11 | 

Added src/main/java/example/HolidayChecker.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class HolidayChecker {
        11 | 

Added src/main/java/example/ReportGenerator.java (file-level)

>>> FILE-LEVEL ISSUE
         1 | package example;
         2 | 
         3 | import java.time.DayOfWeek;
         4 | import java.time.LocalDate;
         5 | import java.time.LocalDateTime;
         6 | import java.time.Month;
         7 | import java.time.MonthDay;
         8 | import java.time.YearMonth;
         9 | 
        10 | public class ReportGenerator {
        11 | 

... and 10 more rules with changes (diff too large to display fully)

Java starts the native executable and exchanges one JSON object per line, so a parse tree can be logged without a binary protocol.
@github-actions

Copy link
Copy Markdown
Contributor

⚖️ Ruling update ready for review: #6409

Comment on lines +70 to +77
public synchronized String parse(String source) throws IOException {
JsonObject request = new JsonObject();
request.addProperty("id", nextId);
request.addProperty("op", "parse");
request.addProperty("source", source);
nextId++;
return exchange(request);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: close() cannot kill a hung bridge: it's synchronized and waits forever

parse() and close() are both synchronized, and exchange() blocks on fromBridge.readLine() with no timeout. Say the bridge stalls on a parse (a pathological input, or an infinite loop in a grammar). The thread stuck in parse() keeps the monitor, so close(), for example from try-with-resources on another thread or a shutdown path, waits on the lock forever. It never gets to destroy()/destroyForcibly(). Even without a second thread, close() first runs a blocking quit exchange. A bridge that has stopped answering hangs close() on readLine() and is never killed. The escape path should not depend on the bridge cooperating: either kill the process before taking the lock, or put a deadline on the quit read and fall through to destroyForcibly().

Make close() not depend on the parse lock or on the bridge answering: send quit best-effort without reading the reply, then destroy with a timeout.:

@Override
public void close() {
  if (closed) { return; }
  closed = true;
  try {
    toBridge.write("{"op":"quit"}
");
    toBridge.flush();
    toBridge.close();
  } catch (IOException ignored) {
    // bridge already gone
  }
  process.destroy();
  // waitFor(2s) then destroyForcibly() as before
}
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment on lines +68 to +71
fn node_json(node: tree_sitter::Node, depth: usize) -> serde_json::Value {
if depth > 64 {
return serde_json::json!({"truncated": true});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Trees deeper than 64 are silently cut off but still report ok:true

node_json returns {"truncated": true} for any node deeper than 64. That placeholder has no kind, positions or children. The response still says ok: true, and hasError comes from the full root, so nothing at the response level tells the Java client the tree is incomplete. The SemsitterBridge Javadoc and the handle_line docs describe the tree without mentioning truncation. Once the planned Java grammar is in, ordinary code goes past depth 64: a left-recursive chain of 60+ + string concatenations or long fluent call chains will do it. A consumer that reads kind on every node would then hit nulls, or silently drop subtrees. Either raise the limit, or switch to iterative serialization with a TreeCursor to avoid stack overflow. Failing that, report truncation explicitly, for example with a top-level "truncated": true flag or ok: false.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown
CI failed: Two failures from the semsitter/ECJ replacement PoC: a SanityTest assertion (scan_non_compiling_files expected 4 results, got 0) that is marked change-related, and a mall ruling analysis failing on unanalyzed expected files whose relation to the change is unclear; no infrastructure failures identified.

Overview

Five unique error templates across 16 logs were analyzed. Two distinct failure patterns surfaced in the provided findings: a Sanity Test assertion failure and a ruling-test expected-directory mismatch for the mall project. Both are test failures, not infrastructure issues. The remaining templates were not included in the per-template findings provided, so this synthesis covers only the two findings present.

Failures

SanityTest.scan_non_compiling_files returns 0 results instead of 4 (confidence: high)

  • Type: test
  • Affected jobs: 121670095425 (Sanity Test)
  • Related to change: yes
  • Root cause: org.sonar.plugins.java.SanityTest.scan_non_compiling_files fails at SanityTest.java:134 with Expected size: 4 but was: 0. Maven compilation succeeded. The PR drops the ECJ parser (commit e15ea96), so the missing scan results for non-compiling files are consistent with the parser replacement. The log does not show which individual results are absent.
  • Suggested fix: Check how the semsitter parser handles non-compiling Java files in the scan path exercised by SanityTest.scan_non_compiling_files, and restore the behavior that yields the four expected results (or defer dropping ECJ until semsitter supports this case). Re-run SanityTest.scan_non_compiling_files in the sonar-java-plugin module.

Ruling analysis for mall: expected files not analyzed (confidence: medium)

  • Type: test
  • Affected jobs: mall ruling job (it-java-ruling, Windows Server 2022 runner)
  • Related to change: unclear
  • Root cause: The sonar-maven-plugin run for project mall failed with Files listed in Expected directory were not analyzed: mall. The log shows ECJ batch parsing of 153 main and 1 test source files, but does not identify which expected entries were missed. This caused the reactor build to fail and the ruling test to report 2 failures and 5 errors. The log itself shows the ECJ path being used, and the change context does not establish a concrete link between this failure and the missing expected entries, so the relationship is unclear rather than confirmed.
  • Suggested fix: Compare the entries in its/ruling/src/test/resources/expected/mall/ against the source paths analyzed under its/sources/mall, correct any source-scope or path mismatch, or update the expectations if the intended parser output changed. Re-run the ruling test using the parser this PR is meant to exercise, and confirm whether the ECJ-vs-semsitter path affects these expected files.

Summary

  • Change-related failures: 1 (SanityTest.scan_non_compiling_files, expected 4 results, got 0, consistent with dropping the ECJ parser).
  • Infrastructure/flaky failures: None identified in the provided findings.
  • Unclear relationship: 1 (mall ruling expected-directory mismatch; may overlap with the parser change but is not confirmed).
  • Recommended action: Restore non-compiling file handling in the semsitter path so SanityTest passes, then triage the mall ruling expectations to determine whether the parser change altered analyzed file scope. Note this is a draft PoC; the stacked PR Update ruling results for PR #6407 #6409 updates ruling expectations and may already reflect the intended new output, so check it before editing expected files here.
Code Review ⚠️ Changes requested 0 closed / 3 findings

🔴 High risk · Replacing ECJ parsing and semantic resolution with empty stubs could leave Java files without syntax trees or symbols, broadly disrupting analysis.

Replaces the ECJ parser with a semsitter JSONL bridge and adds a Rust sample crate, but the PR is not ready and changes are requested. Open findings: removing JParser.parse(ASTParser, …) and JParserConfig.astParser() breaks the sonar-java-symbolic-execution test helper and needs a coordinated migration and release note. SemsitterBridge.close() is synchronized and blocks on readLine() with no timeout, so a hung bridge can deadlock close and never be destroyed. The sample's node_json truncates trees deeper than 64 yet still reports ok: true, so consumers can silently receive incomplete trees.

⚠️ Bug: close() cannot kill a hung bridge: it's synchronized and waits forever

📄 java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:70-77 📄 java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:80-94 📄 java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:115

parse() and close() are both synchronized, and exchange() blocks on fromBridge.readLine() with no timeout. Say the bridge stalls on a parse (a pathological input, or an infinite loop in a grammar). The thread stuck in parse() keeps the monitor, so close(), for example from try-with-resources on another thread or a shutdown path, waits on the lock forever. It never gets to destroy()/destroyForcibly(). Even without a second thread, close() first runs a blocking quit exchange. A bridge that has stopped answering hangs close() on readLine() and is never killed. The escape path should not depend on the bridge cooperating: either kill the process before taking the lock, or put a deadline on the quit read and fall through to destroyForcibly().

Make close() not depend on the parse lock or on the bridge answering: send quit best-effort without reading the reply, then destroy with a timeout.
@Override
public void close() {
  if (closed) { return; }
  closed = true;
  try {
    toBridge.write("{"op":"quit"}
");
    toBridge.flush();
    toBridge.close();
  } catch (IOException ignored) {
    // bridge already gone
  }
  process.destroy();
  // waitFor(2s) then destroyForcibly() as before
}
💡 Cross-Repo: Removed JParser.parse(ASTParser,…) breaks sonar-java-symbolic-execution tests

📄 java-frontend/src/main/java/org/sonar/java/model/JParser.java:27-41 📄 java-frontend/src/main/java/org/sonar/java/model/JParserConfig.java:168-177

Fix here and in SonarSource/sonar-java-symbolic-execution

Breaks in: SonarSource/sonar-java-symbolic-execution - java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java - JParserTestUtils.parse

This PR replaces the four-argument JParser.parse(ASTParser, String, String, String) with a three-argument parse(version, unitName, source) that returns an empty compilation unit. It also removes the ECJ astParser() factory from JParserConfig. In SonarSource/sonar-java-symbolic-execution, JParserTestUtils.parse (java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java) calls JParserConfig.Mode.FILE_BY_FILE.create(...).astParser() and then the four-argument JParser.parse. Once that repo bumps sonar.java.version (pinned today to 8.44.0.48651) to a release with this change, its test helper won't compile. Even after porting it to the new signature, every parsed tree would be empty and have no semantics, so all SE tests built on it would stop checking anything. The PR is a draft PoC and the break is on purpose. The SE repo still needs a coordinated migration before it adopts this frontend.

Here: Before releasing this frontend, record the removal of JParser.parse(ASTParser, …) and JParserConfig.astParser() in the changelog or migration notes, and tell sonar-java-symbolic-execution about the new three-argument entry point. Coordinate the release so the SE repo does not bump to it until the new parser returns real trees.

There: In JParserTestUtils.parse, drop the astParser() call and use the three-argument JParser.parse(version, unitName, source). Keep sonar.java.version on the current release until the semsitter-based parser produces populated trees with semantics.

In SonarSource/sonar-java-symbolic-execution - java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java:

public static CompilationUnitTree parse(String unitName, String source) {
  return JParser.parse(JParserConfig.MAXIMUM_SUPPORTED_JAVA_VERSION.effectiveJavaVersionAsString(), unitName, source);
}
💡 Edge Case: Trees deeper than 64 are silently cut off but still report ok:true

📄 semsitter-sample/src/lib.rs:68-71 📄 semsitter-sample/src/lib.rs:96-107 📄 java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:32-41

node_json returns {"truncated": true} for any node deeper than 64. That placeholder has no kind, positions or children. The response still says ok: true, and hasError comes from the full root, so nothing at the response level tells the Java client the tree is incomplete. The SemsitterBridge Javadoc and the handle_line docs describe the tree without mentioning truncation. Once the planned Java grammar is in, ordinary code goes past depth 64: a left-recursive chain of 60+ + string concatenations or long fluent call chains will do it. A consumer that reads kind on every node would then hit nulls, or silently drop subtrees. Either raise the limit, or switch to iterative serialization with a TreeCursor to avoid stack overflow. Failing that, report truncation explicitly, for example with a top-level "truncated": true flag or ok: false.

🤖 Prompt for agents
Code Review: Replaces the ECJ parser with a semsitter JSONL bridge and adds a Rust sample crate, but the PR is not ready and changes are requested. Open findings: removing `JParser.parse(ASTParser, …)` and `JParserConfig.astParser()` breaks the sonar-java-symbolic-execution test helper and needs a coordinated migration and release note. `SemsitterBridge.close()` is `synchronized` and blocks on `readLine()` with no timeout, so a hung bridge can deadlock close and never be destroyed. The sample's `node_json` truncates trees deeper than 64 yet still reports `ok: true`, so consumers can silently receive incomplete trees.

1. 💡 Cross-Repo: Removed JParser.parse(ASTParser,…) breaks sonar-java-symbolic-execution tests
   Files: java-frontend/src/main/java/org/sonar/java/model/JParser.java:27-41, java-frontend/src/main/java/org/sonar/java/model/JParserConfig.java:168-177

   **Fix here and in [`SonarSource/sonar-java-symbolic-execution`](https://github.com/SonarSource/sonar-java-symbolic-execution)**
   
   **Breaks in:** [`SonarSource/sonar-java-symbolic-execution`](https://github.com/SonarSource/sonar-java-symbolic-execution) - [`java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java`](https://github.com/SonarSource/sonar-java-symbolic-execution/blob/HEAD/java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java) - `JParserTestUtils.parse`
   
   This PR replaces the four-argument `JParser.parse(ASTParser, String, String, String)` with a three-argument `parse(version, unitName, source)` that returns an empty compilation unit. It also removes the ECJ `astParser()` factory from `JParserConfig`. In SonarSource/sonar-java-symbolic-execution, `JParserTestUtils.parse` (java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java) calls `JParserConfig.Mode.FILE_BY_FILE.create(...).astParser()` and then the four-argument `JParser.parse`. Once that repo bumps `sonar.java.version` (pinned today to 8.44.0.48651) to a release with this change, its test helper won't compile. Even after porting it to the new signature, every parsed tree would be empty and have no semantics, so all SE tests built on it would stop checking anything. The PR is a draft PoC and the break is on purpose. The SE repo still needs a coordinated migration before it adopts this frontend.
   
   **Here:** Before releasing this frontend, record the removal of `JParser.parse(ASTParser, …)` and `JParserConfig.astParser()` in the changelog or migration notes, and tell sonar-java-symbolic-execution about the new three-argument entry point. Coordinate the release so the SE repo does not bump to it until the new parser returns real trees.
   
   **There:** In JParserTestUtils.parse, drop the `astParser()` call and use the three-argument `JParser.parse(version, unitName, source)`. Keep `sonar.java.version` on the current release until the semsitter-based parser produces populated trees with semantics.
   
   In SonarSource/sonar-java-symbolic-execution - `java-symbolic-execution/java-symbolic-execution-plugin/src/test/java/org/sonar/java/se/utils/JParserTestUtils.java`:
   
   ````
   public static CompilationUnitTree parse(String unitName, String source) {
     return JParser.parse(JParserConfig.MAXIMUM_SUPPORTED_JAVA_VERSION.effectiveJavaVersionAsString(), unitName, source);
   }
   ````

2. ⚠️ Bug: close() cannot kill a hung bridge: it's synchronized and waits forever
   Files: java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:70-77, java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:80-94, java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:115

   `parse()` and `close()` are both `synchronized`, and `exchange()` blocks on `fromBridge.readLine()` with no timeout. Say the bridge stalls on a parse (a pathological input, or an infinite loop in a grammar). The thread stuck in `parse()` keeps the monitor, so `close()`, for example from try-with-resources on another thread or a shutdown path, waits on the lock forever. It never gets to `destroy()`/`destroyForcibly()`. Even without a second thread, `close()` first runs a blocking `quit` exchange. A bridge that has stopped answering hangs `close()` on `readLine()` and is never killed. The escape path should not depend on the bridge cooperating: either kill the process before taking the lock, or put a deadline on the quit read and fall through to `destroyForcibly()`.

   Fix (Make close() not depend on the parse lock or on the bridge answering: send quit best-effort without reading the reply, then destroy with a timeout.):
   @Override
   public void close() {
     if (closed) { return; }
     closed = true;
     try {
       toBridge.write("{"op":"quit"}
   ");
       toBridge.flush();
       toBridge.close();
     } catch (IOException ignored) {
       // bridge already gone
     }
     process.destroy();
     // waitFor(2s) then destroyForcibly() as before
   }

3. 💡 Edge Case: Trees deeper than 64 are silently cut off but still report ok:true
   Files: semsitter-sample/src/lib.rs:68-71, semsitter-sample/src/lib.rs:96-107, java-frontend/src/main/java/org/sonar/java/semsitter/SemsitterBridge.java:32-41

   `node_json` returns `{"truncated": true}` for any node deeper than 64. That placeholder has no `kind`, positions or children. The response still says `ok: true`, and `hasError` comes from the full root, so nothing at the response level tells the Java client the tree is incomplete. The `SemsitterBridge` Javadoc and the `handle_line` docs describe the tree without mentioning truncation. Once the planned Java grammar is in, ordinary code goes past depth 64: a left-recursive chain of 60+ `+` string concatenations or long fluent call chains will do it. A consumer that reads `kind` on every node would then hit nulls, or silently drop subtrees. Either raise the limit, or switch to iterative serialization with a `TreeCursor` to avoid stack overflow. Failing that, report truncation explicitly, for example with a top-level `"truncated": true` flag or `ok: false`.

Verification Rules 1/2 met Repos 4 inspected
Rules 1 failed 1 passed 1 not applicable

❌ Internal artifact registries - The new semsitter-sample Cargo crate resolves dependencies directly from public crates.io (Cargo.lock) and a GitHub git/SSH dependency with no Repox/Artifactory cargo registry configuration; configure Cargo to use the Repox cargo endpoint (e.g. via .cargo/config.toml source replacement) before it is built in CI.
✅ Repository license compliance

Functional validation No results

Broader impact Repos 4 inspected
Cross-repo 4 repositories inspected 1 open impact

SonarSource/sonar-java-symbolic-execution Inspected
SonarSource/sonarlint-vscode Inspected
SonarSource/sonarlint-intellij Inspected
SonarSource/sonarlint-language-server Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.
Unblock → Override a blocking verdict and allow merging.

Comment with these commands to change the behavior for this request:

Auto-apply Compact Unblock
gitar auto-apply:on         
gitar display:verbose         
gitar unblock         

Was this helpful? React with 👍 / 👎 | Gitar

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant