From 7bf44c69ac4528c91ee2b561143894dd16350776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 14 Apr 2022 19:49:48 +0200 Subject: [PATCH] Replace package name with class name Co-authored-by: Andreas Dangel --- pmd-java/etc/grammar/Java.jjt | 2 +- .../sourceforge/pmd/lang/java/ast/ASTModuleUsesDirective.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 0563a698e4..d175247c17 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -2759,7 +2759,7 @@ void ModuleDirective() #void: ModuleName() ";" ) #ModuleRequiresDirective | ( LOOKAHEAD({isKeyword("exports")}) packageName=VoidNameNoLookahead() {jjtThis.setPackageName(packageName);} [ LOOKAHEAD({isKeyword("to")}) ModuleName() ("," ModuleName())* ] ";" ) #ModuleExportsDirective | ( LOOKAHEAD({isKeyword("opens")}) packageName=VoidNameNoLookahead() {jjtThis.setPackageName(packageName);} [ LOOKAHEAD({isKeyword("to")}) ModuleName() ("," ModuleName())* ] ";" ) #ModuleOpensDirective - | ( LOOKAHEAD({isKeyword("uses")}) packageName=VoidNameNoLookahead() {jjtThis.setPackageName(packageName);} ";" ) #ModuleUsesDirective + | ( LOOKAHEAD({isKeyword("uses")}) ClassName() ";" ) #ModuleUsesDirective | ( LOOKAHEAD({isKeyword("provides")}) ClassName() LOOKAHEAD({isKeyword("with")}) ClassName() ("," ClassName() )* ";" ) #ModuleProvidesDirective } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModuleUsesDirective.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModuleUsesDirective.java index c7557f6e4a..19541af597 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModuleUsesDirective.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTModuleUsesDirective.java @@ -13,7 +13,7 @@ package net.sourceforge.pmd.lang.java.ast; * * */ -public final class ASTModuleUsesDirective extends AbstractPackageNameModuleDirective { +public final class ASTModuleUsesDirective extends ASTModuleDirective { ASTModuleUsesDirective(int id) { super(id, DirectiveType.USES);