Skip to content

Commit 76ac792

Browse files
committed
chore: address PMD markers
1 parent 35746ab commit 76ac792

File tree

37 files changed

+68
-5
lines changed

37 files changed

+68
-5
lines changed

com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/generator/CheckCompiler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ protected void internalToConvertedExpression(final XExpression obj, final ITreeA
195195
}
196196

197197
// CHECKSTYLE:OFF
198+
@SuppressWarnings("PMD.UnusedFormalParameter")
198199
protected void _toJavaStatement(final XGuardExpression expr, final ITreeAppendable b, final boolean isReferenced) {
199200
// CHECKSTYLE:ON
200201
internalToJavaStatement(expr.getGuard(), b, true);

com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/context/DummyCheckContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class DummyCheckContext extends AbstractCheckContext {
2626
* @return {@code true} always
2727
*/
2828
@CheckContext(issueCodes = {CheckContextTest.ENABLED_AND_DISABLED_ISSUE_CODE})
29+
@SuppressWarnings("PMD.UnusedFormalParameter")
2930
public boolean enableForEnabledDisabledCode(final EObject context) {
3031
return ENABLED;
3132
}
@@ -39,6 +40,7 @@ public boolean enableForEnabledDisabledCode(final EObject context) {
3940
*/
4041
@CheckContext(issueCodes = {CheckContextTest.DISABLED_ISSUE_CODE, CheckContextTest.DISABLED_AND_ENABLED_ISSUE_CODE,
4142
CheckContextTest.ENABLED_AND_DISABLED_ISSUE_CODE})
43+
@SuppressWarnings("PMD.UnusedFormalParameter")
4244
public boolean disableForCodes(final EObject context) {
4345
return DISABLED;
4446
}
@@ -51,6 +53,7 @@ public boolean disableForCodes(final EObject context) {
5153
* @return {@code true} always
5254
*/
5355
@CheckContext(issueCodes = {CheckContextTest.ENABLED_ISSUE_CODE, CheckContextTest.DISABLED_AND_ENABLED_ISSUE_CODE})
56+
@SuppressWarnings("PMD.UnusedFormalParameter")
5457
public boolean enabledForCodes(final EObject context) {
5558
return ENABLED;
5659
}

com.avaloq.tools.ddk.check.runtime.core/src/com/avaloq/tools/ddk/check/runtime/configuration/CheckConfigurationStoreService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ private String getLanguage(final URI uri) {
127127
* the context object of the validation being executed
128128
* @return the configuration store instance
129129
*/
130+
@SuppressWarnings("PMD.UnusedFormalParameter")
130131
protected ICheckConfigurationStore internalGetCheckConfigurationStore(final Object context) {
131132
if (configurationStore == null) {
132133
configurationStore = new CheckConfigurationStore(DEFAULT_CHECK_CONFIGURATION_NODE);

com.avaloq.tools.ddk.check.runtime.core/src/com/avaloq/tools/ddk/check/runtime/issue/AbstractDispatchingCheckImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public interface DiagnosticCollector extends ValidationMessageAcceptor {
109109
* @param eventCollector
110110
* an event collector for collecting validation events, may be {@code null}
111111
*/
112-
@SuppressWarnings("checkstyle:IllegalCatch")
112+
@SuppressWarnings({"checkstyle:IllegalCatch", "PMD.UnusedFormalParameter"})
113113
protected void validate(final String contextName, final String qContextName, final EObject object, final Runnable checkAction, final DiagnosticCollector diagnosticCollector, final ResourceValidationRuleSummaryEvent.Collector eventCollector) {
114114
if (!disabledMethodTracker.isDisabled(contextName)) {
115115
try {

com.avaloq.tools.ddk.check.runtime.core/src/com/avaloq/tools/ddk/check/runtime/issue/DefaultCheckImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private String ruleName(final MethodWrapper method) {
9999
* the context
100100
* @return true, if successful
101101
*/
102-
@SuppressWarnings("PMD.NPathComplexity")
102+
@SuppressWarnings({"PMD.NPathComplexity", "PMD.UnusedFormalParameter"})
103103
protected final boolean internalValidate(final EClass class1, final EObject object, final DiagnosticChain diagnostics, final Map<Object, Object> context) {
104104
initCheckMethodCache();
105105

com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/CheckBuilderParticipant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ protected void handleChangedContents(final Delta delta, final IBuildContext cont
111111
* @param context
112112
* build context
113113
*/
114+
@SuppressWarnings("PMD.UnusedFormalParameter")
114115
protected void handleDeletion(final Delta delta, final IBuildContext context) {
115116
if (hasCorrectExtension(delta, resourceServiceProvider)) {
116117
try {

com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/util/AbstractCheckExtensionHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ protected <T> T getFromServiceProvider(final Class<T> type, final URI uri) {
142142
* have changed before the builder participant kicks
143143
* in.
144144
*/
145+
@SuppressWarnings("PMD.UnusedFormalParameter")
145146
protected boolean isExtensionUpdateRequired(final CheckCatalog catalog, final IPluginExtension extension, final Iterable<IPluginElement> elements) {
146147
return extension.getPoint().equals(getExtensionPointId()); // if points are different, given extension must not be updated
147148
}
@@ -214,6 +215,7 @@ public IPluginExtension addExtensionToPluginBase(final IPluginModelBase base, fi
214215
* the extension id
215216
* @return true, if the extension should be enabled
216217
*/
218+
@SuppressWarnings("PMD.UnusedFormalParameter")
217219
protected boolean isExtensionEnabled(final IPluginModelBase base, final CheckCatalog catalog, final ExtensionType type, final String extensionId) {
218220
if (type == ExtensionType.MARKERHELP) {
219221
return false; // disabled until https://bugs.eclipse.org/bugs/show_bug.cgi?id=369534 is fixed

com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/util/CheckExtensionHelperManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ public ExtensionType apply(final IPluginExtension from) {
272272
* @throws CoreException
273273
* the core exception
274274
*/
275+
@SuppressWarnings("PMD.UnusedFormalParameter")
275276
public void updateExtensions(final CheckCatalog catalog, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
276277
QualifiedName catalogName = nameProvider.apply(catalog);
277278
Collection<IPluginExtension> catalogExtensions = findExtensions(pluginModel, catalogName, ExtensionType.ALL);
@@ -296,6 +297,7 @@ public void updateExtensions(final CheckCatalog catalog, final IPluginModelBase
296297
* @throws CoreException
297298
* the core exception
298299
*/
300+
@SuppressWarnings("PMD.UnusedFormalParameter")
299301
public void addExtensions(final CheckCatalog catalog, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
300302
QualifiedName catalogName = nameProvider.apply(catalog);
301303
Collection<IPluginExtension> catalogExtensions = findExtensions(pluginModel, catalogName, ExtensionType.ALL);
@@ -324,6 +326,7 @@ public void addExtensions(final CheckCatalog catalog, final IPluginModelBase plu
324326
* @throws CoreException
325327
* the core exception
326328
*/
329+
@SuppressWarnings("PMD.UnusedFormalParameter")
327330
public void removeExtensions(final IEObjectDescription obj, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
328331
for (IPluginExtension extension : findExtensions(pluginModel, obj.getName(), ExtensionType.ALL)) {
329332
final ExtensionType extensionType = getExtensionType(extension);
@@ -344,6 +347,7 @@ public void removeExtensions(final IEObjectDescription obj, final IPluginModelBa
344347
* @throws CoreException
345348
* the core exception
346349
*/
350+
@SuppressWarnings("PMD.UnusedFormalParameter")
347351
public void removeExtensions(final CheckCatalog catalog, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
348352
QualifiedName name = nameConverter.toQualifiedName(projectUtil.getCatalogQualifiedName(catalog));
349353
for (IPluginExtension extension : findExtensions(pluginModel, name, ExtensionType.ALL)) {
@@ -362,6 +366,7 @@ public void removeExtensions(final CheckCatalog catalog, final IPluginModelBase
362366
* @throws CoreException
363367
* the core exception
364368
*/
369+
@SuppressWarnings("PMD.UnusedFormalParameter")
365370
public void sortAllExtensions(final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
366371
Ordering<IPluginExtension> ordering = Ordering.from((a, b) -> ComparisonChain.start().compare(a.getPoint(), b.getPoint()).compare(a.getId(), b.getId(), Ordering.natural().nullsLast()).compare(a.getName(), b.getName(), Ordering.natural().nullsLast()).result());
367372
List<IPluginExtension> catalogExtensions = Lists.newArrayList(findAllExtensions(pluginModel));

com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/wizard/CheckCatalogGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void generateDefaultQuickfixProvider(final IPath path, final CheckProject
6767
* @param projectInfo
6868
* the project info
6969
*/
70-
@SuppressWarnings("nls")
70+
@SuppressWarnings({"nls", "PMD.UnusedFormalParameter"})
7171
public void generateDocsDirectory(final IPath path, final CheckProjectInfo projectInfo) {
7272
fsa.setOutputPath(path.toOSString());
7373
// IFileSystemAccess doesn't support creating empty directories, so:

com.avaloq.tools.ddk.checkcfg.ide/src/com/avaloq/tools/ddk/checkcfg/ide/contentassist/CheckCfgIdeContentProposalProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ protected void _createProposals(final Keyword keyword, final ContentAssistContex
111111
super._createProposals(keyword, context, acceptor);
112112
}
113113

114+
@SuppressWarnings("PMD.UnusedFormalParameter")
114115
protected void completeLanguages(final EObject model, final ContentAssistContext context, final IIdeContentProposalAcceptor acceptor) {
115116
for (String language : checkCfgUtil.getAllLanguages()) {
116117
ContentAssistEntry entry = getProposalCreator().createProposal(language, context, (final ContentAssistEntry it) -> {

0 commit comments

Comments
 (0)