forked from phoedos/pmd
Promote experimental APIs as stable
- HTML support and Kotlin support no more experimental - The only left over experimental APIs are java preview features
This commit is contained in:
parent
4ff00bfe66
commit
0d40878b0a
@ -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.
|
||||
|
@ -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 <https://github.com/Kotlin/kotlin-spec>.
|
||||
|
||||
{% 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." %}
|
||||
|
@ -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
|
||||
|
||||
```
|
||||
|
@ -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)])
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
*
|
||||
* <p>This information is used for the rule "EmptyCatchBlock", which can ignore empty catch blocks, if they
|
||||
* contain comments.
|
||||
*/
|
||||
@Experimental
|
||||
public interface ASTCommentContainer<T extends AstNode> extends ApexNode<T> {
|
||||
|
||||
boolean getContainsComment();
|
||||
|
@ -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'.
|
||||
*
|
||||
* <p>Note: This is used by {@link net.sourceforge.pmd.lang.apex.rule.design.UnusedMethodRule}.
|
||||
*
|
||||
* @author Kevin Jones
|
||||
*/
|
||||
@Experimental
|
||||
public final class ApexMultifileAnalysis {
|
||||
|
||||
// test only
|
||||
|
@ -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 <T> the type of the input to the predicate
|
||||
*/
|
||||
// TODO java8 - replace with java.util.function.Predicate
|
||||
@Experimental
|
||||
//@Experimental
|
||||
public interface Predicate<T> {
|
||||
|
||||
boolean test(T t);
|
@ -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<RuleViolation> 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();
|
||||
|
||||
|
@ -64,7 +64,6 @@ public class CPDReport {
|
||||
*
|
||||
* @return copy of this report
|
||||
*/
|
||||
@Experimental
|
||||
public CPDReport filterMatches(Predicate<Match> filter) {
|
||||
List<Match> filtered = this.matches.stream().filter(filter).collect(Collectors.toList());
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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";
|
||||
|
||||
|
@ -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<T extends RootNode> {
|
||||
* "suppressMarker", which by default is "PMD". The text after the
|
||||
* suppressMarker is used as a "review comment" and included in this map.
|
||||
*
|
||||
* <p>
|
||||
* This map is later used to determine, if a violation is being suppressed.
|
||||
* <p>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<Integer, String> getSuppressionComments() {
|
||||
return suppressionComments;
|
||||
}
|
||||
|
||||
|
||||
@Experimental
|
||||
public AstInfo<T> withSuppressMap(Map<Integer, String> map) {
|
||||
return new AstInfo<>(
|
||||
textDocument,
|
||||
|
@ -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<T extends GenericToken<T>> extends Comparable<T>,
|
||||
* Gets a unique integer representing the kind of token this is.
|
||||
* The semantics of this kind depend on the language.
|
||||
*
|
||||
* <p><strong>Note:</strong> This is an experimental API.
|
||||
*
|
||||
* <p>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();
|
||||
}
|
||||
|
@ -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<T extends GenericToken> {
|
||||
|
||||
private final TextDocument textDocument;
|
||||
|
@ -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<AntlrToken> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public int getKind() {
|
||||
return token.getType();
|
||||
}
|
||||
|
@ -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.
|
||||
*
|
||||
* <p>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<B extends AbstractJjtreeNode<B, N>, N extends JjtreeNode<N>> extends AbstractNode<B, N> implements JjtreeNode<N> {
|
||||
protected final int id;
|
||||
private JavaccToken firstToken;
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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<T> {
|
||||
* @see net.sourceforge.pmd.util.internal.xml.SchemaConstants#PROPERTY_MIN
|
||||
* @see net.sourceforge.pmd.util.internal.xml.SchemaConstants#PROPERTY_MAX
|
||||
*/
|
||||
@Experimental
|
||||
default Map<String, String> getXmlConstraint() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
@ -70,7 +67,6 @@ public interface PropertyConstraint<T> {
|
||||
* by checking that the value conforms to this constraint if
|
||||
* it is non-empty.
|
||||
*/
|
||||
@Experimental
|
||||
default PropertyConstraint<Optional<? extends T>> toOptionalConstraint() {
|
||||
return new PropertyConstraint<Optional<? extends T>>() {
|
||||
@Override
|
||||
@ -122,7 +118,6 @@ public interface PropertyConstraint<T> {
|
||||
*
|
||||
* @return A new validator
|
||||
*/
|
||||
@Experimental
|
||||
static <U> PropertyConstraint<U> fromPredicate(final Predicate<? super U> pred, final String constraintDescription) {
|
||||
return fromPredicate(pred, constraintDescription, Collections.emptyMap());
|
||||
}
|
||||
@ -133,7 +128,6 @@ public interface PropertyConstraint<T> {
|
||||
*
|
||||
* @see #fromPredicate(Predicate, String)
|
||||
*/
|
||||
@Experimental
|
||||
static <U> PropertyConstraint<U> fromPredicate(final Predicate<? super U> pred, final String constraintDescription,
|
||||
final Map<String, String> xmlConstraint) {
|
||||
return new PropertyConstraint<U>() {
|
||||
|
@ -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
|
||||
* <p>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));
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
*
|
||||
* <p>The binary API is <b>unstable</b> 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 {
|
||||
|
||||
|
||||
|
@ -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<GroovyToken> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public int getKind() {
|
||||
return token.getType();
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
* <p>Not all contexts allow all kinds of conversions. See
|
||||
* {@link ExprContext}.
|
||||
*/
|
||||
@Experimental
|
||||
default @NonNull ExprContext getConversionContext() {
|
||||
return getRoot().getLazyTypeResolver().getConversionContextForExternalUse(this);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user