From 0d40878b0aaabfd4c13e0f1ba1ed72df9404eff8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 9 Feb 2024 08:46:48 +0100 Subject: [PATCH] Promote experimental APIs as stable - HTML support and Kotlin support no more experimental - The only left over experimental APIs are java preview features --- docs/pages/pmd/languages/html.md | 6 +- docs/pages/pmd/languages/kotlin.md | 10 +-- docs/pages/pmd/languages/visualforce.md | 7 +- docs/pages/release_notes.md | 78 +++++++++++++++++-- docs/pages/release_notes_pmd7.md | 11 +-- .../lang/apex/ast/ASTCommentContainer.java | 6 +- .../apex/multifile/ApexMultifileAnalysis.java | 4 +- .../net/sourceforge/pmd/util/Predicate.java | 7 +- .../main/java/net/sourceforge/pmd/Report.java | 3 - .../net/sourceforge/pmd/cpd/CPDReport.java | 1 - .../pmd/lang/LanguageVersionHandler.java | 7 -- .../pmd/lang/PlainTextLanguage.java | 2 - .../net/sourceforge/pmd/lang/ast/AstInfo.java | 6 +- .../pmd/lang/ast/GenericToken.java | 4 - .../pmd/lang/ast/impl/TokenDocument.java | 2 - .../pmd/lang/ast/impl/antlr4/AntlrToken.java | 2 - .../ast/impl/javacc/AbstractJjtreeNode.java | 9 +-- .../pmd/lang/document/FileCollector.java | 2 - .../pmd/lang/document/package-info.java | 3 - .../pmd/properties/PropertyConstraint.java | 6 -- .../pmd/renderers/AbstractRenderer.java | 2 - .../sourceforge/pmd/renderers/Renderer.java | 2 - .../designerbindings/DesignerBindings.java | 3 - .../RelatedNodesSelector.java | 5 -- .../groovy/ast/impl/antlr4/GroovyToken.java | 2 - .../pmd/lang/html/package-info.java | 1 - .../pmd/lang/java/ast/ASTCompilationUnit.java | 2 +- .../pmd/lang/java/ast/ASTExpression.java | 2 - .../pmd/lang/java/ast/ASTPattern.java | 2 +- .../pmd/lang/java/ast/ASTRecordPattern.java | 2 +- .../pmd/lang/java/ast/ASTTemplate.java | 2 +- .../lang/java/ast/ASTTemplateExpression.java | 2 +- .../lang/java/ast/ASTTemplateFragment.java | 2 +- .../pmd/lang/java/ast/ASTTypePattern.java | 2 +- .../pmd/lang/java/ast/ASTUnnamedPattern.java | 2 +- .../java/rule/AbstractJavaRulechainRule.java | 2 - .../pmd/lang/java/symbols/JElementSymbol.java | 2 - .../pmd/lang/java/symbols/package-info.java | 7 +- .../lang/java/symbols/table/JSymbolTable.java | 2 - .../lang/java/types/JIntersectionType.java | 10 +-- .../pmd/lang/java/types/JTypeMirror.java | 20 ++--- .../pmd/lang/java/types/ast/ExprContext.java | 2 - .../pmd/lang/kotlin/KotlinLanguageModule.java | 4 - .../pmd/test/schema/TestSchemaParser.java | 2 - 44 files changed, 120 insertions(+), 140 deletions(-) rename {pmd-core => pmd-compat6}/src/main/java/net/sourceforge/pmd/util/Predicate.java (69%) diff --git a/docs/pages/pmd/languages/html.md b/docs/pages/pmd/languages/html.md index 44442f4cd2..dba9fc0e4e 100644 --- a/docs/pages/pmd/languages/html.md +++ b/docs/pages/pmd/languages/html.md @@ -1,15 +1,13 @@ --- title: HTML support permalink: pmd_languages_html.html -last_updated: September 2023 (7.0.0) -tags: [languages, PmdCapableLanguage, CpdCapableLanguage, experimental] +last_updated: February 2024 (7.0.0) +tags: [languages, PmdCapableLanguage, CpdCapableLanguage] summary: "HTML-specific features and guidance" --- {% include language_info.html name='HTML' id='html' implementation='html::lang.html.HtmlLanguageModule' supports_pmd=true supports_cpd=true since='6.45.0' %} -{% include warning.html content="This language module is experimental and may change any time." %} - The HTML language module uses [jsoup](https://jsoup.org/) for parsing. XPath rules are supported, but the DOM is not always a typical XML/XPath DOM. diff --git a/docs/pages/pmd/languages/kotlin.md b/docs/pages/pmd/languages/kotlin.md index e6a5c77b1a..a95904eba3 100644 --- a/docs/pages/pmd/languages/kotlin.md +++ b/docs/pages/pmd/languages/kotlin.md @@ -1,17 +1,13 @@ --- title: Kotlin Support permalink: pmd_languages_kotlin.html -last_updated: September 2023 (7.0.0) -tags: [languages, PmdCapableLanguage, CpdCapableLanguage, experimental] +last_updated: February 2024 (7.0.0) +tags: [languages, PmdCapableLanguage, CpdCapableLanguage] summary: "Kotlin-specific features and guidance" --- [Kotlin](https://kotlinlang.org/) support in PMD is based on the official grammar from . -{% include language_info.html name='Kotlin' id='kotlin' implementation='kotlin::lang.kotlin.JspLanguageModule' supports_pmd=true supports_cpd=true %} +{% include language_info.html name='Kotlin' id='kotlin' implementation='kotlin::lang.kotlin.JspLanguageModule' supports_pmd=true supports_cpd=true since=7.0.0 %} Java-based rules and XPath-based rules are supported. - -{% include note.html content="Kotlin support has **experimental** stability level, meaning no compatibility should -be expected between even incremental releases. Any functionality can be added, removed or changed without -warning." %} diff --git a/docs/pages/pmd/languages/visualforce.md b/docs/pages/pmd/languages/visualforce.md index c1ca10e625..ecb56a9f9e 100644 --- a/docs/pages/pmd/languages/visualforce.md +++ b/docs/pages/pmd/languages/visualforce.md @@ -1,8 +1,8 @@ --- title: Visualforce Support permalink: pmd_languages_visualforce.html -last_updated: September 2023 -tags: [languages, PmdCapableLanguage, CpdCapableLanguage, experimental] +last_updated: February 2024 (7.0.0) +tags: [languages, PmdCapableLanguage, CpdCapableLanguage] author: Andreas Dangel summary: "Visualforce-specific features and guidance" --- @@ -40,9 +40,6 @@ These env vars have changed from PMD 6 to PMD 7: * `PMD_VF_OBJECTSDIRECTORIES` ➡️ `PMD_VF_OBJECTS_DIRECTORIES` "%} -This feature is experimental, in particular, expect changes to the way the configuration is specified. -We'll probably extend the CLI instead of relying on environment variables in a future version. - ### Sample usage ``` diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index ccbe2c9df9..c04196ae15 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -89,6 +89,15 @@ This PMD release ships a new version of the pmd-designer. For the changes, see * [PMD Designer Changelog (7.0.0)](https://github.com/pmd/pmd-designer/releases/tag/7.0.0). +##### Changed: HTML support + +Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this +is now considered stable. + +##### Changed: Kotlin support + +Experimental Kotlin support has been promoted as stable API now. + #### Rule Changes **New Rules** @@ -393,10 +402,10 @@ in the migration guide for details. * `isNullLiteral()` - use `node instanceof ASTNullLiteral` instead. * `isBooleanLiteral()` - use `node instanceof ASTBooleanLiteral` instead. * `isNumericLiteral()` - use `node instanceof ASTNumericLiteral` instead. - * `isIntLiteral()` - use {%jdoc lang.java.ast.ASTNumericLiteral#isIntLiteral() %} instead. - * `isLongLiteral()` - use {%jdoc lang.java.ast.ASTNumericLiteral#isLongLiteral() %} instead. - * `isFloatLiteral()` - use {%jdoc lang.java.ast.ASTNumericLiteral#isFloatLiteral() %} instead. - * `isDoubleLiteral()` - use {%jdoc lang.java.ast.ASTNumericLiteral#isDoubleLiteral() %} instead. + * `isIntLiteral()` - use {%jdoc java::lang.java.ast.ASTNumericLiteral#isIntLiteral() %} instead. + * `isLongLiteral()` - use {%jdoc java::lang.java.ast.ASTNumericLiteral#isLongLiteral() %} instead. + * `isFloatLiteral()` - use {%jdoc java::lang.java.ast.ASTNumericLiteral#isFloatLiteral() %} instead. + * `isDoubleLiteral()` - use {%jdoc java::lang.java.ast.ASTNumericLiteral#isDoubleLiteral() %} instead. * {%jdoc !!java::lang.java.ast.ASTMethodDeclaration %} - methods `getImage()` and `getMethodName()` have been removed. Use {%jdoc java::lang.java.ast.ASTMethodDeclaration#getName() %} instead. * {%jdoc !!java::lang.java.ast.ASTMethodReference %} - method `getImage()` has been removed. @@ -497,6 +506,9 @@ in the migration guide for details. **Removed classes, interfaces and methods (not previously deprecated)** +* pmd-core + * `net.sourceforge.pmd.util.Predicate` has been removed. It was marked as Experimental before. Use + `java.util.function.Predicate` instead. * pmd-java * The interface `FinalizableNode` (introduced in 7.0.0-rc1) has been removed. Its method `isFinal()` has been moved down to the @@ -541,6 +553,57 @@ in the migration guide for details. This affects all language modules. * {%jdoc_old core::cpd.AnyTokenizer %} has been renamed to {% jdoc core::cpd.AnyCpdLexer %}. +**Classes and methods, that are not experimental anymore** + +These were annotated with `@Experimental`, but can now be considered stable. + +* pmd-apex + * {%jdoc !!apex::lang.apex.ast.ASTCommentContainer %} + * {%jdoc !!apex::lang.apex.multifile.ApexMultifileAnalysis %} +* pmd-core + * {%jdoc !!core::cpd.CPDReport#filterMatches(java.util.function.Predicate) %} + * {%jdoc !!core::lang.ast.impl.antlr4.AntlrToken.getKind() %} + * {%jdoc !!core::lang.ast.impl.javacc.AbstractJjtreeNode %} + * {%jdoc !!core::lang.ast.impl.TokenDocument %} + * {%jdoc !!core::lang.ast.AstInfo.getSuppressionComments() %} + * {%jdoc !!core::lang.ast.AstInfo.withSuppressMap(java.util.Map) %} + * {%jdoc !!core::lang.ast.GenericToken.getKind() %} + * {%jdoc !!core::lang.document.FileCollector.addZipFileWithContent(java.nio.file.Path) %} + * {%jdoc_package core::lang.document %} + * {%jdoc !!core::lang.LanguageVersionHandler.getLanguageMetricsProvider() %} + * {%jdoc !!core::lang.LanguageVersionHandler.getDesignerBindings() %} + * {%jdoc !!core::lang.PlainTextLanguage %} + * {%jdoc !!core::properties.PropertyConstraint.getXmlConstraint() %} + * {%jdoc !!core::properties.PropertyConstraint.toOptionalConstraint() %} + * {%jdoc !!core::properties.PropertyConstraint.fromPredicate(java.util.function.Predicate,java.lang.String) %} + * {%jdoc !!core::properties.PropertyConstraint.fromPredicate(java.util.function.Predicate,java.lang.String,java.util.Map) %} + * {%jdoc !!core::renderers.AbstractRenderer.setReportFile(java.lang.String) %} + * {%jdoc !!core::renderers.Renderer.setReportFile(java.lang.String) %} + * {%jdoc !!core::util.designerbindings.DesignerBindings %} + * {%jdoc !!core::util.designerbindings.DesignerBindings.TreeIconId %} + * {%jdoc !!core::util.designerbindings.RelatedNodesSelector %} + * {%jdoc !!core::Report.filterViolations(java.util.function.Predicate) %} + * {%jdoc !!core::Report.union(core::Report) %} +* pmd-groovy + * {%jdoc !!groovy::lang.groovy.ast.impl.antlr4.GroovyToken.getKind() %} +* pmd-html + * {%jdoc_package html::lang.html %} +* pmd-java + * {%jdoc !!java::lang.java.ast.ASTExpression#getConversionContext() %} + * {%jdoc !!java::lang.java.rule.AbstractJavaRulechainRule#AbstractJavaRulechainRule(java.lang.Class,java.lang.Class...) %} + * {%jdoc !!java::lang.java.symbols.table.JSymbolTable %} + * {%jdoc !!java::lang.java.symbols.JElementSymbol %} + * {%jdoc_package java::lang.java.symbols %} + * {%jdoc !!java::lang.java.types.ast.ExprContext %} + * {%jdoc !!java::lang.java.types.JIntersectionType#getInducedClassType() %} + * {%jdoc !!java::lang.java.types.JTypeMirror#streamMethods(java.util.function.Predicate) %} + * {%jdoc !!java::lang.java.types.JTypeMirror#streamDeclaredMethods(java.util.function.Predicate) %} + * {%jdoc !!java::lang.java.types.JTypeMirror#getConstructors() %} +* pmd-kotlin + * {%jdoc !!kotlin::lang.kotlin.KotlinLanguageModule %} +* pmd-test-schema + * {%jdoc !!test-schema::test.schema.TestSchemaParser %} + **Removed functionality** * The CLI parameter `--no-ruleset-compatibility` has been removed. It was only used to allow loading @@ -645,7 +708,7 @@ Contributors: [Lucas Soncini](https://github.com/lsoncini) (@lsoncini), [Matías Fraga](https://github.com/matifraga) (@matifraga), [Tomás De Lucca](https://github.com/tomidelucca) (@tomidelucca) -#### New: Kotlin support (experimental) +#### New: Kotlin support * use PMD to analyze Kotlin code with PMD rules * Support for Kotlin 1.8 grammar @@ -696,6 +759,11 @@ version `21-preview`: Note: Support for Java 19 preview language features have been removed. The version "19-preview" is no longer available. +#### Changed: HTML support + +Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this +is now considered stable. + #### Changed: JavaScript support * latest version supports ES6 and also some new constructs (see [Rhino](https://github.com/mozilla/rhino)]) diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index f55e3578c5..4f3a8590c6 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -176,15 +176,11 @@ Contributors: [Lucas Soncini](https://github.com/lsoncini) (@lsoncini), [Matías Fraga](https://github.com/matifraga) (@matifraga), [Tomás De Lucca](https://github.com/tomidelucca) (@tomidelucca) -### New: Kotlin support (experimental) +### New: Kotlin support PMD now supports Kotlin as an additional language for analyzing source code. It is based on the official kotlin Antlr grammar. Java-based rules and XPath-based rules are supported. -Kotlin support has **experimental** stability level, meaning no compatibility should -be expected between even incremental releases. Any functionality can be added, removed or changed without -warning. - We are shipping the following rules: * {% rule kotlin/bestpractices/FunctionNameTooShort %} (`kotlin-bestpractices`) finds functions with a too @@ -247,6 +243,11 @@ PMD supports Apache Velocity for a very long time, but the CPD integration never This is now done and CPD supports Apache Velocity Template language for detecting copy and paste. It is shipped in the module `pmd-vm`. +### Changed: HTML support + +Support for HTML was introduced in PMD 6.55.0 as an experimental feature. With PMD 7.0.0 this +is now considered stable. + ### Changed: JavaScript support The JS specific parser options have been removed. The parser now always retains comments and uses version ES6. diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTCommentContainer.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTCommentContainer.java index 53827efa2c..12901bc69a 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTCommentContainer.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTCommentContainer.java @@ -4,16 +4,16 @@ package net.sourceforge.pmd.lang.apex.ast; -import net.sourceforge.pmd.annotation.Experimental; - import apex.jorje.semantic.ast.AstNode; /** * Interface for nodes that can contain comments. Because comments are for the most part lost, the tree builder only * captures whether the node did contain comments of any sort in the source code and not the actual contents of those * comments. This is useful for rules which need to know whether a node did contain comments. + * + *

This information is used for the rule "EmptyCatchBlock", which can ignore empty catch blocks, if they + * contain comments. */ -@Experimental public interface ASTCommentContainer extends ApexNode { boolean getContainsComment(); diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileAnalysis.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileAnalysis.java index e940786551..6ac2283b98 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileAnalysis.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/multifile/ApexMultifileAnalysis.java @@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.apex.ApexLanguageProcessor; import net.sourceforge.pmd.lang.apex.ApexLanguageProperties; @@ -32,9 +31,10 @@ import com.nawforce.pkgforce.diagnostics.LoggerOps; * issues after packages are loaded and throw away the 'Org'. That would be a better model if all you wanted was the * issues but more complex rules will need the ability to traverse the internal graph of the 'Org'. * + *

Note: This is used by {@link net.sourceforge.pmd.lang.apex.rule.design.UnusedMethodRule}. + * * @author Kevin Jones */ -@Experimental public final class ApexMultifileAnalysis { // test only diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/Predicate.java b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/Predicate.java similarity index 69% rename from pmd-core/src/main/java/net/sourceforge/pmd/util/Predicate.java rename to pmd-compat6/src/main/java/net/sourceforge/pmd/util/Predicate.java index 36fb94f507..a6d0e68ce1 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/Predicate.java +++ b/pmd-compat6/src/main/java/net/sourceforge/pmd/util/Predicate.java @@ -2,17 +2,16 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -package net.sourceforge.pmd.util; +// This class has been taken from 7.0.0-SNAPSHOT -import net.sourceforge.pmd.annotation.Experimental; +package net.sourceforge.pmd.util; /** * Simple predicate of one argument. * * @param the type of the input to the predicate */ -// TODO java8 - replace with java.util.function.Predicate -@Experimental +//@Experimental public interface Predicate { boolean test(T t); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/Report.java b/pmd-core/src/main/java/net/sourceforge/pmd/Report.java index d81c387717..612a7cc3af 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/Report.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/Report.java @@ -16,7 +16,6 @@ import java.util.function.Consumer; import java.util.function.Predicate; import net.sourceforge.pmd.annotation.DeprecatedUntil700; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.lang.document.TextFile; @@ -347,7 +346,6 @@ public final class Report { * @param filter when true, the violation will be kept. * @return copy of this report */ - @Experimental public Report filterViolations(Predicate filter) { Report copy = new Report(); @@ -370,7 +368,6 @@ public final class Report { * @param other the other report to combine * @return a new report which is the combination of this and the other report. */ - @Experimental public Report union(Report other) { Report copy = new Report(); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDReport.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDReport.java index 30af2fcdba..f9b148fc61 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDReport.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDReport.java @@ -64,7 +64,6 @@ public class CPDReport { * * @return copy of this report */ - @Experimental public CPDReport filterMatches(Predicate filter) { List filtered = this.matches.stream().filter(filter).collect(Collectors.toList()); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java index 3e6d3063a5..bfb0356c77 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageVersionHandler.java @@ -8,7 +8,6 @@ import java.util.Collections; import java.util.List; import net.sourceforge.pmd.ViolationSuppressor; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.Parser; import net.sourceforge.pmd.lang.metrics.LanguageMetricsProvider; import net.sourceforge.pmd.lang.rule.xpath.impl.XPathHandler; @@ -59,12 +58,7 @@ public interface LanguageVersionHandler { /** * Returns the metrics provider for this language version, * or null if it has none. - * - * Note: this is experimental, ie unstable until 7.0.0, after - * which it will probably be promoted to a stable API. For - * instance the return type will probably be changed to an Optional. */ - @Experimental default LanguageMetricsProvider getLanguageMetricsProvider() { return null; } @@ -77,7 +71,6 @@ public interface LanguageVersionHandler { * * @since 6.20.0 */ - @Experimental default DesignerBindings getDesignerBindings() { return DefaultDesignerBindings.getInstance(); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java index c510759c10..54a1e91a2d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.cpd.AnyCpdLexer; import net.sourceforge.pmd.cpd.CpdCapableLanguage; import net.sourceforge.pmd.cpd.CpdLexer; @@ -26,7 +25,6 @@ import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; * @author Clément Fournier * @since 6.48.0 */ -@Experimental public final class PlainTextLanguage extends SimpleLanguageModuleBase implements CpdCapableLanguage { private static final String ID = "text"; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AstInfo.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AstInfo.java index 27e69b8d5d..d35294ec9f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AstInfo.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/AstInfo.java @@ -9,7 +9,6 @@ import java.util.Map; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.LanguageProcessorRegistry; import net.sourceforge.pmd.lang.ast.Parser.ParserTask; @@ -69,19 +68,16 @@ public final class AstInfo { * "suppressMarker", which by default is "PMD". The text after the * suppressMarker is used as a "review comment" and included in this map. * - *

- * This map is later used to determine, if a violation is being suppressed. + *

This map is later used to determine, if a violation is being suppressed. * It is suppressed, if the line of the violation is contained in this suppress map. * * @return map of the suppress lines with the corresponding review comments. */ - @Experimental public Map getSuppressionComments() { return suppressionComments; } - @Experimental public AstInfo withSuppressMap(Map map) { return new AstInfo<>( textDocument, diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/GenericToken.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/GenericToken.java index bc9e09a608..4f4ecc7973 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/GenericToken.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/GenericToken.java @@ -8,7 +8,6 @@ import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.document.Chars; import net.sourceforge.pmd.lang.document.TextRegion; import net.sourceforge.pmd.reporting.Reportable; @@ -145,12 +144,9 @@ public interface GenericToken> extends Comparable, * Gets a unique integer representing the kind of token this is. * The semantics of this kind depend on the language. * - *

Note: This is an experimental API. - * *

The returned constants can be looked up in the language's "*ParserConstants", * e.g. CppParserConstants or JavaParserConstants. These constants are considered * internal API and may change at any time when the language's grammar is changed. */ - @Experimental int getKind(); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/TokenDocument.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/TokenDocument.java index 08ed6d2ddf..a59c3e769a 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/TokenDocument.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/TokenDocument.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.ast.impl; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.GenericToken; import net.sourceforge.pmd.lang.document.Chars; import net.sourceforge.pmd.lang.document.TextDocument; @@ -12,7 +11,6 @@ import net.sourceforge.pmd.lang.document.TextDocument; /** * Token layer of a parsed file. */ -@Experimental public abstract class TokenDocument { private final TextDocument textDocument; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java index 4774f8f178..8a7d08c1f5 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/antlr4/AntlrToken.java @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.ast.impl.antlr4; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.Token; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.GenericToken; import net.sourceforge.pmd.lang.document.FileLocation; import net.sourceforge.pmd.lang.document.TextDocument; @@ -74,7 +73,6 @@ public class AntlrToken implements GenericToken { } @Override - @Experimental public int getKind() { return token.getType(); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java index 0a8e70b58b..34859a8932 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/impl/javacc/AbstractJjtreeNode.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.ast.impl.javacc; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.impl.AbstractNode; import net.sourceforge.pmd.lang.document.FileLocation; @@ -13,13 +12,9 @@ import net.sourceforge.pmd.util.StringUtil; /** * Base class for node produced by JJTree. JJTree specific functionality - * present on the API of {@link Node} and {@link AbstractNode} will be - * moved here for 7.0.0. - * - *

This is experimental because it's expected to change for 7.0.0 in - * unforeseeable ways. Don't use it directly, use the node interfaces. + * present on the API of {@link Node} and {@link AbstractNode} has been + * moved here for 7.0.0 (e.g. jjtClose methods). */ -@Experimental public abstract class AbstractJjtreeNode, N extends JjtreeNode> extends AbstractNode implements JjtreeNode { protected final int id; private JavaccToken firstToken; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileCollector.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileCollector.java index 7110c27a56..be5b59c73b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileCollector.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/FileCollector.java @@ -325,7 +325,6 @@ public final class FileCollector implements AutoCloseable { * * @return True if the zip file including its content has been added without errors */ - @Experimental public boolean addZipFileWithContent(Path zipFile) throws IOException { if (!Files.isRegularFile(zipFile)) { throw new IllegalArgumentException("Not a regular file: " + zipFile); @@ -365,7 +364,6 @@ public final class FileCollector implements AutoCloseable { /** A collector that prefixes the display name of the files it will contain with the path of the zip. */ - @Experimental private FileCollector newZipCollector(Path zipFilePath) { return new FileCollector(discoverer, reporter, FileId.fromPath(zipFilePath)); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/package-info.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/package-info.java index ca0ea4b7ca..6af8fa48dc 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/package-info.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/package-info.java @@ -15,7 +15,4 @@ * @see net.sourceforge.pmd.lang.document.TextDocument * @see net.sourceforge.pmd.reporting.Reportable */ -@Experimental package net.sourceforge.pmd.lang.document; - -import net.sourceforge.pmd.annotation.Experimental; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyConstraint.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyConstraint.java index 8cb42e42ba..37d9556b85 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyConstraint.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/PropertyConstraint.java @@ -11,8 +11,6 @@ import java.util.function.Predicate; import org.apache.commons.lang3.StringUtils; -import net.sourceforge.pmd.annotation.Experimental; - /** * Validates the value of a property. @@ -60,7 +58,6 @@ public interface PropertyConstraint { * @see net.sourceforge.pmd.util.internal.xml.SchemaConstants#PROPERTY_MIN * @see net.sourceforge.pmd.util.internal.xml.SchemaConstants#PROPERTY_MAX */ - @Experimental default Map getXmlConstraint() { return Collections.emptyMap(); } @@ -70,7 +67,6 @@ public interface PropertyConstraint { * by checking that the value conforms to this constraint if * it is non-empty. */ - @Experimental default PropertyConstraint> toOptionalConstraint() { return new PropertyConstraint>() { @Override @@ -122,7 +118,6 @@ public interface PropertyConstraint { * * @return A new validator */ - @Experimental static PropertyConstraint fromPredicate(final Predicate pred, final String constraintDescription) { return fromPredicate(pred, constraintDescription, Collections.emptyMap()); } @@ -133,7 +128,6 @@ public interface PropertyConstraint { * * @see #fromPredicate(Predicate, String) */ - @Experimental static PropertyConstraint fromPredicate(final Predicate pred, final String constraintDescription, final Map xmlConstraint) { return new PropertyConstraint() { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java index d633d4dead..29804ac1e3 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java @@ -9,7 +9,6 @@ import java.io.Writer; import java.util.Objects; import net.sourceforge.pmd.PMDConfiguration; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.internal.util.IOUtil; import net.sourceforge.pmd.lang.document.FileId; import net.sourceforge.pmd.properties.AbstractPropertySource; @@ -116,7 +115,6 @@ public abstract class AbstractRenderer extends AbstractPropertySource implements *

This default implementation always uses the system default charset for the writer. * Overwrite in specific renderers to support other charsets. */ - @Experimental @Override public void setReportFile(String reportFilename) { this.setWriter(IOUtil.createWriter(reportFilename)); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java index 443eef1b1d..6f0e436403 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/renderers/Renderer.java @@ -14,7 +14,6 @@ import net.sourceforge.pmd.Report.ProcessingError; import net.sourceforge.pmd.Report.ReportBuilderListener; import net.sourceforge.pmd.Report.SuppressedViolation; import net.sourceforge.pmd.RuleViolation; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.benchmark.TimeTracker; import net.sourceforge.pmd.benchmark.TimedOperation; import net.sourceforge.pmd.benchmark.TimedOperationCategory; @@ -183,7 +182,6 @@ public interface Renderer extends PropertySource { * * @param reportFilename the filename (optional). */ - @Experimental void setReportFile(String reportFilename); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/DesignerBindings.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/DesignerBindings.java index b679b1b965..03a58ab3bf 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/DesignerBindings.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/DesignerBindings.java @@ -7,7 +7,6 @@ package net.sourceforge.pmd.util.designerbindings; import java.util.Collection; import java.util.Collections; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.xpath.Attribute; import net.sourceforge.pmd.lang.symboltable.ScopedNode; @@ -19,7 +18,6 @@ import net.sourceforge.pmd.lang.symboltable.ScopedNode; * @author Clément Fournier * @since 6.20.0 */ -@Experimental public interface DesignerBindings { /** @@ -120,7 +118,6 @@ public interface DesignerBindings { /** * See {@link #getIcon(Node)}. */ - @Experimental enum TreeIconId { CLASS, METHOD, diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/RelatedNodesSelector.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/RelatedNodesSelector.java index e16433bb84..9da6116712 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/RelatedNodesSelector.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/designerbindings/RelatedNodesSelector.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.util.designerbindings; import java.util.List; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.Node; /** @@ -18,13 +17,9 @@ import net.sourceforge.pmd.lang.ast.Node; * is subject to change at the implementation's discretion. In particular it's * not necessarily the usages of a variable. * - *

The binary API is unstable until at least 7.0, meaning the only - * place this can be implemented safely is within PMD's own codebase. - * * @author Clément Fournier * @since 6.20.0 */ -@Experimental public interface RelatedNodesSelector { diff --git a/pmd-groovy/src/main/java/net/sourceforge/pmd/lang/groovy/ast/impl/antlr4/GroovyToken.java b/pmd-groovy/src/main/java/net/sourceforge/pmd/lang/groovy/ast/impl/antlr4/GroovyToken.java index 535a9f97a2..197e40d78d 100644 --- a/pmd-groovy/src/main/java/net/sourceforge/pmd/lang/groovy/ast/impl/antlr4/GroovyToken.java +++ b/pmd-groovy/src/main/java/net/sourceforge/pmd/lang/groovy/ast/impl/antlr4/GroovyToken.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.groovy.ast.impl.antlr4; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.GenericToken; import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken; import net.sourceforge.pmd.lang.document.FileLocation; @@ -78,7 +77,6 @@ public class GroovyToken implements GenericToken { } @Override - @Experimental public int getKind() { return token.getType(); } diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/package-info.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/package-info.java index 72286a3ccb..5aa91cc1e7 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/package-info.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/package-info.java @@ -2,5 +2,4 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ -@net.sourceforge.pmd.annotation.Experimental package net.sourceforge.pmd.lang.html; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java index c13a716375..3f7bb81065 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java @@ -138,7 +138,7 @@ public final class ASTCompilationUnit extends AbstractJavaNode implements JavaNo return lazyTypeResolver; } - @Experimental + @Experimental("Unnamed classes is a Java 21 Preview feature") @NoAttribute public boolean isUnnamedClass() { return children(ASTMethodDeclaration.class).nonEmpty(); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java index 501216efb8..53fe256d36 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.types.ast.ExprContext; /** @@ -124,7 +123,6 @@ public interface ASTExpression *

Not all contexts allow all kinds of conversions. See * {@link ExprContext}. */ - @Experimental default @NonNull ExprContext getConversionContext() { return getRoot().getLazyTypeResolver().getConversionContextForExternalUse(this); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java index e80ed54084..214bfcac9c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java @@ -32,7 +32,7 @@ public interface ASTPattern extends JavaNode { * If this method returns 0, then no parentheses are present. * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21. */ - @Experimental + @Experimental("Parenthesized patterns is a Java 20 Preview feature") @Deprecated int getParenthesisDepth(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java index ee9da2fb40..20d4e80fce 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java @@ -51,7 +51,7 @@ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPatte } @Override - @Experimental + @Experimental("Parenthesized patterns is a Java 20 Preview feature") public int getParenthesisDepth() { return parenDepth; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java index 15c2c72a85..d1379fbf07 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java @@ -17,7 +17,7 @@ import net.sourceforge.pmd.annotation.Experimental; * * @see JEP 430: String Templates (Preview) */ -@Experimental +@Experimental("String templates is a Java 21 Preview feature") public final class ASTTemplate extends AbstractJavaNode { ASTTemplate(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java index 76a91b8e0b..c612ce5ef7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java @@ -19,7 +19,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr * * @see JEP 430: String Templates (Preview) */ -@Experimental +@Experimental("String templates is a Java 21 Preview feature") public final class ASTTemplateExpression extends AbstractJavaExpr { ASTTemplateExpression(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java index 8bb1c40b87..2ff13744b0 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.annotation.Experimental; * * @see JEP 430: String Templates (Preview) */ -@Experimental +@Experimental("String templates is a Java 21 Preview feature") public final class ASTTemplateFragment extends AbstractJavaNode { ASTTemplateFragment(int i) { super(i); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java index bcbe9802ba..66fc999e03 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java @@ -53,7 +53,7 @@ public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern } @Override - @Experimental + @Experimental("Parenthesized patterns is a Java 20 Preview feature") public int getParenthesisDepth() { return parenDepth; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java index 641e932458..9b76fbb19f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.annotation.Experimental; * * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21) */ -@Experimental +@Experimental("Unnamed patterns is a Java 21 Preview feature") public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPattern { ASTUnnamedPattern(int id) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRulechainRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRulechainRule.java index 68b4861393..0de15f92d7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRulechainRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRulechainRule.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule; import org.checkerframework.checker.nullness.qual.NonNull; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.rule.RuleTargetSelector; @@ -28,7 +27,6 @@ public abstract class AbstractJavaRulechainRule extends AbstractJavaRule { * @param visits The rest */ @SafeVarargs - @Experimental public AbstractJavaRulechainRule(Class first, Class... visits) { selector = RuleTargetSelector.forTypes(first, visits); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JElementSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JElementSymbol.java index ccc6dc4cb9..fc000db342 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JElementSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JElementSymbol.java @@ -8,7 +8,6 @@ package net.sourceforge.pmd.lang.java.symbols; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.JavaNode; @@ -26,7 +25,6 @@ import net.sourceforge.pmd.lang.java.types.TypeSystem; * * @since 7.0.0 */ -@Experimental @InternalApi public interface JElementSymbol { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/package-info.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/package-info.java index c759d0e899..511d96a303 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/package-info.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/package-info.java @@ -3,15 +3,14 @@ */ /** - * Prototype of a new symbol resolution framework + * The new symbol resolution framework * that inter-operates cleanly with type resolution. * * @see net.sourceforge.pmd.lang.java.symbols.JElementSymbol * @see net.sourceforge.pmd.lang.java.symbols.table.JSymbolTable * @see net.sourceforge.pmd.lang.java.symbols.SymbolResolver + * + * @since 7.0.0 */ -@Experimental package net.sourceforge.pmd.lang.java.symbols; - -import net.sourceforge.pmd.annotation.Experimental; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/JSymbolTable.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/JSymbolTable.java index 7a97d0d0db..04dcf3d896 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/JSymbolTable.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/JSymbolTable.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.java.symbols.table; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.ast.ASTClassType; import net.sourceforge.pmd.lang.java.ast.ASTVariableAccess; import net.sourceforge.pmd.lang.java.symbols.table.coreimpl.ShadowChain; @@ -21,7 +20,6 @@ import net.sourceforge.pmd.lang.java.types.JVariableSig; * * @since 7.0.0 */ -@Experimental public interface JSymbolTable { /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JIntersectionType.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JIntersectionType.java index 0803aa1c34..5bc9879966 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JIntersectionType.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JIntersectionType.java @@ -19,7 +19,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.pcollections.HashTreePSet; import org.pcollections.PSet; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; @@ -111,12 +110,11 @@ public final class JIntersectionType implements JTypeMirror { * for the purpose of identifying its members. This may be a functional * interface. This returns null for the non-implemented cases. * - * @experimental this is only relevant to check for functional - * interface parameterization, eg {@code Runnable & Serializable}. Do - * not use this to find out the members of this type, rather, use {@link #streamMethods(Predicate)} - * or so. + *

This is only relevant to check for functional + * interface parameterization, eg {@code Runnable & Serializable}. Do + * not use this to find out the members of this type, rather, use {@link #streamMethods(Predicate)} + * or so. */ - @Experimental public @Nullable JClassType getInducedClassType() { JTypeMirror primary = getPrimaryBound(); if (primary instanceof JTypeVar || primary instanceof JArrayType) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeMirror.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeMirror.java index 8750b2f721..fbc58bd99f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeMirror.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeMirror.java @@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.pcollections.PSet; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.ast.TypeNode; import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol; @@ -413,17 +412,16 @@ public interface JTypeMirror extends JTypeVisitable { * method, they're not reused between calls. This stream does not * include constructors. * + *

Note: streams are a bit impractical when it comes to + * configuring the filter. Possibly a specialized API should be introduced. + * We need to support the use cases of the symbol table, ie filter by name + accessibility + staticity, + * and also possibly use cases for rules, like getting a method from + * a known signature. See also {@link JClassType#getDeclaredMethod(JExecutableSymbol)}, + * which looks like this. Unifying this API would be nice. + * * @param prefilter Filter selecting symbols for which a signature * should be created and yielded by the stream - * - * @experimental streams are a bit impractical when it comes to - * configuring the filter. Possibly a specialized API should be introduced. - * We need to support the use cases of the symbol table, ie filter by name + accessibility + staticity, - * and also possibly use cases for rules, like getting a method from - * a known signature. See also {@link JClassType#getDeclaredMethod(JExecutableSymbol)}, - * which looks like this. Unifying this API would be nice. */ - @Experimental default Stream streamMethods(Predicate prefilter) { return Stream.empty(); } @@ -433,11 +431,10 @@ public interface JTypeMirror extends JTypeVisitable { * not recurse into supertypes. Note that only class and array types * declare methods themselves. * - * @experimental See {@link #streamMethods(Predicate)} + *

See also note in {@link #streamMethods(Predicate)}. * * @see #streamMethods(Predicate) */ - @Experimental default Stream streamDeclaredMethods(Predicate prefilter) { return Stream.empty(); } @@ -447,7 +444,6 @@ public interface JTypeMirror extends JTypeVisitable { * Returns a list of all the declared constructors for this type. * Abstract types like type variables and interfaces have no constructors. */ - @Experimental default List getConstructors() { return Collections.emptyList(); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java index aa80538da1..5209b40208 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java @@ -12,7 +12,6 @@ import static net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKin import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.java.ast.InvocationNode; import net.sourceforge.pmd.lang.java.types.JTypeMirror; import net.sourceforge.pmd.lang.java.types.OverloadSelectionResult; @@ -25,7 +24,6 @@ import net.sourceforge.pmd.util.AssertionUtil; * determines what kinds of conversions apply to the value to make it * compatible with the context. */ -@Experimental("The API is minimal until more use cases show up, and this is better tested.") public abstract class ExprContext { // note: most members of this class are quite low-level and should // stay package-private for exclusive use by PolyResolution. diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java index f47a870efc..d4a8bbd0a7 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java @@ -4,7 +4,6 @@ package net.sourceforge.pmd.lang.kotlin; -import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; @@ -13,10 +12,7 @@ import net.sourceforge.pmd.lang.kotlin.cpd.KotlinCpdLexer; /** * Language Module for Kotlin - * - *

Note: Kotlin support is considered an experimental feature. The AST structure might change.

*/ -@Experimental public class KotlinLanguageModule extends SimpleLanguageModuleBase { private static final String ID = "kotlin"; diff --git a/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/TestSchemaParser.java b/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/TestSchemaParser.java index 4d1688c940..8a8f96f467 100644 --- a/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/TestSchemaParser.java +++ b/pmd-test-schema/src/main/java/net/sourceforge/pmd/test/schema/TestSchemaParser.java @@ -14,7 +14,6 @@ import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.InputSource; import net.sourceforge.pmd.Rule; -import net.sourceforge.pmd.annotation.Experimental; import com.github.oowekyala.ooxml.messages.NiceXmlMessageSpec; import com.github.oowekyala.ooxml.messages.OoxmlFacade; @@ -33,7 +32,6 @@ import com.github.oowekyala.ooxml.messages.XmlSeverity; * * @author Clément Fournier */ -@Experimental public class TestSchemaParser { private final TestSchemaVersion version;