Skip to content

Commit

Permalink
[Patterns] Suspect classification of when as a modifier
Browse files Browse the repository at this point in the history
* Fixes #3091
  • Loading branch information
srikanth-sankaran committed Oct 23, 2024
1 parent 638957c commit b9dd919
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
12 changes: 12 additions & 0 deletions org.eclipse.jdt.core/.settings/.api_filters
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@
</filter>
</resource>
<resource path="dom/org/eclipse/jdt/core/dom/Modifier.java" type="org.eclipse.jdt.core.dom.Modifier">
<filter comment="Withdraw incorrect modifier (tagged with noreference)" id="338755678">
<message_arguments>
<message_argument value="org.eclipse.jdt.core.dom.Modifier"/>
<message_argument value="WHEN"/>
</message_arguments>
</filter>
<filter id="576725006">
<message_arguments>
<message_argument value="IExtendedModifier"/>
Expand All @@ -264,6 +270,12 @@
<message_argument value="MODULE_KEYWORD"/>
</message_arguments>
</filter>
<filter comment="Withdraw incorrect modifier (tagged with noreference)" id="338755678">
<message_arguments>
<message_argument value="org.eclipse.jdt.core.dom.Modifier.ModifierKeyword"/>
<message_argument value="WHEN_KEYWORD"/>
</message_arguments>
</filter>
</resource>
<resource path="dom/org/eclipse/jdt/core/dom/ModuleQualifiedName.java" type="org.eclipse.jdt.core.dom.ModuleQualifiedName">
<filter comment="Java 15 Merge" id="576778288">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5898,9 +5898,6 @@ protected void setModifiers(List modifiers, org.eclipse.jdt.internal.compiler.as
case TerminalTokens.TokenNamenon_sealed:
modifier = createModifier(Modifier.ModifierKeyword.NON_SEALED_KEYWORD);
break;
case TerminalTokens.TokenNameRestrictedIdentifierWhen:
modifier = createModifier(Modifier.ModifierKeyword.WHEN_KEYWORD);
break;
case TerminalTokens.TokenNameAT :
// we have an annotation
if (annotations != null && indexInAnnotations < annotations.length) {
Expand Down
14 changes: 2 additions & 12 deletions org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Modifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ public static class ModifierKeyword {
* @since 3.24
*/
public static final ModifierKeyword SEALED_KEYWORD = new ModifierKeyword("sealed", SEALED);//$NON-NLS-1$
/**
* @since 3.32
* @noreference preview feature
*/
public static final ModifierKeyword WHEN_KEYWORD = new ModifierKeyword("when", WHEN);//$NON-NLS-1$

/**
* @since 3.24
*/
Expand Down Expand Up @@ -348,13 +344,7 @@ public String toString() {
* @since 3.24
*/
public static final int NON_SEALED = 0x1000;
/**
* "when" modifier constant (bit mask).
* Applicable only to types.
* @since 3.32
* @noreference preview feature
*/
public static final int WHEN = 0x2000;

/**
* "module" modifier constant (bit mask).
* Applicable only to imports.
Expand Down

0 comments on commit b9dd919

Please sign in to comment.