forked from phoedos/pmd
@ -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 %}
|
||||
|
@ -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() {
|
||||
|
@ -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> {
|
||||
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user