[doc] Update release notes (#5050, #5051)

This commit is contained in:
Andreas Dangel
2024-06-27 10:49:20 +02:00
parent f5ab687c6a
commit 31b4e3745a
4 changed files with 16 additions and 3 deletions

View File

@ -15,9 +15,18 @@ This is a {{ site.pmd.release_type }} release.
### 🚀 New and noteworthy
### 🐛 Fixed Issues
* pmd-java
* [#5050](https://github.com/pmd/pmd/issues/5050): \[java] Problems with pattern variables in switch branches
### 🚨 API Changes
#### Deprecated for removal
* pmd-java
* {%jdoc java::lang.java.ast.ASTRecordPattern#getVarId() %} This method was added here by mistake. Record
patterns don't declare a pattern variable for the whole pattern, but rather for individual record
components, which can be accessed via {%jdoc java::lang.java.ast.ASTRecordPattern#getComponentPatterns() %}.
### ✨ External Contributions
{% endtocmaker %}

View File

@ -38,6 +38,8 @@ public final class ASTRecordPattern extends AbstractJavaPattern {
/**
* Return the patterns for each record component.
*
* @since 7.3.0
*/
public ASTPatternList getComponentPatterns() {
return firstChild(ASTPatternList.class);
@ -47,7 +49,9 @@ public final class ASTRecordPattern extends AbstractJavaPattern {
/**
* Returns the declared variable.
*
* @deprecated This method was added here by mistake
* @deprecated This method was added here by mistake. Record patterns don't declare a pattern variable
* for the whole pattern, but rather for individual record components, which can be accessed via
* {@link #getComponentPatterns()}.
*/
@Deprecated
public ASTVariableId getVarId() {

View File

@ -18,7 +18,7 @@ import net.sourceforge.pmd.lang.java.types.Substitution;
* with a private final {@link JFieldSymbol} and a public
* {@linkplain JMethodSymbol accessor method}.
*
* @since 7.0.0
* @since 7.3.0
*/
public interface JRecordComponentSymbol extends JAccessibleElementSymbol, BoundToNode<ASTRecordComponent> {

View File

@ -162,7 +162,7 @@ public class Foo {
]]></code>
</test-code>
<test-code>
<description>FP in switch</description>
<description>FP in switch #5050</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class Example {