Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ protected void internalToConvertedExpression(final XExpression obj, final ITreeA
}

// CHECKSTYLE:OFF
@SuppressWarnings("PMD.UnusedFormalParameter")
protected void _toJavaStatement(final XGuardExpression expr, final ITreeAppendable b, final boolean isReferenced) {
// CHECKSTYLE:ON
internalToJavaStatement(expr.getGuard(), b, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public UniquenessJavaValidationHelper(final Function<T, QualifiedName> nameFunct
* provides the feature of the duplicate object on which to anchor the marker
* @param issueCode
* the issue code
* @throws IllegalArgumentException
* if acceptor is null
*/
public void warnOnDuplicates(final Iterable<T> possiblyDuplicateObjects, final Function<T, EStructuralFeature> featureProvider, final String issueCode) {
if (acceptor == null) {
Expand Down Expand Up @@ -75,6 +77,8 @@ public void warnOnDuplicates(final Iterable<T> possiblyDuplicateObjects, final F
* provides the feature of the duplicate object on which to anchor the marker
* @param issueCode
* the issue code
* @throws IllegalArgumentException
* if acceptor is null
*/
public void errorOnDuplicates(final Iterable<T> possiblyDuplicateObjects, final Function<T, EStructuralFeature> featureProvider, final String issueCode) {
if (acceptor == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ public class UniquenessValidationHelper<T extends EObject> {

/**
* Creates a Uniqueness validation helper.
*
*
* @param nameFunction
* a function that returns a representation of a T object that can be compared by means of equals
* @throws IllegalArgumentException
* if nameFunction is null
*/
public UniquenessValidationHelper(final Function<T, QualifiedName> nameFunction) {
if (nameFunction == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class DummyCheckContext extends AbstractCheckContext {
* @return {@code true} always
*/
@CheckContext(issueCodes = {CheckContextTest.ENABLED_AND_DISABLED_ISSUE_CODE})
@SuppressWarnings("PMD.UnusedFormalParameter")
public boolean enableForEnabledDisabledCode(final EObject context) {
return ENABLED;
}
Expand All @@ -39,6 +40,7 @@ public boolean enableForEnabledDisabledCode(final EObject context) {
*/
@CheckContext(issueCodes = {CheckContextTest.DISABLED_ISSUE_CODE, CheckContextTest.DISABLED_AND_ENABLED_ISSUE_CODE,
CheckContextTest.ENABLED_AND_DISABLED_ISSUE_CODE})
@SuppressWarnings("PMD.UnusedFormalParameter")
public boolean disableForCodes(final EObject context) {
return DISABLED;
}
Expand All @@ -51,6 +53,7 @@ public boolean disableForCodes(final EObject context) {
* @return {@code true} always
*/
@CheckContext(issueCodes = {CheckContextTest.ENABLED_ISSUE_CODE, CheckContextTest.DISABLED_AND_ENABLED_ISSUE_CODE})
@SuppressWarnings("PMD.UnusedFormalParameter")
public boolean enabledForCodes(final EObject context) {
return ENABLED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private String getLanguage(final URI uri) {
* the context object of the validation being executed
* @return the configuration store instance
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
protected ICheckConfigurationStore internalGetCheckConfigurationStore(final Object context) {
if (configurationStore == null) {
configurationStore = new CheckConfigurationStore(DEFAULT_CHECK_CONFIGURATION_NODE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public interface DiagnosticCollector extends ValidationMessageAcceptor {
* @param eventCollector
* an event collector for collecting validation events, may be {@code null}
*/
@SuppressWarnings("checkstyle:IllegalCatch")
@SuppressWarnings({"checkstyle:IllegalCatch", "PMD.UnusedFormalParameter"})
protected void validate(final String contextName, final String qContextName, final EObject object, final Runnable checkAction, final DiagnosticCollector diagnosticCollector, final ResourceValidationRuleSummaryEvent.Collector eventCollector) {
if (!disabledMethodTracker.isDisabled(contextName)) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private String ruleName(final MethodWrapper method) {
* the context
* @return true, if successful
*/
@SuppressWarnings("PMD.NPathComplexity")
@SuppressWarnings({"PMD.NPathComplexity", "PMD.UnusedFormalParameter"})
protected final boolean internalValidate(final EClass class1, final EObject object, final DiagnosticChain diagnostics, final Map<Object, Object> context) {
initCheckMethodCache();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ default Diagnostic createDiagnostic(final Severity severity, final String messag
* @param severity
* the issue severity
* @return the numeric value representing a severity
* @throws IllegalArgumentException
* if the severity is unknown
*/
static int toDiagnosticSeverity(final Severity severity) {
return switch (severity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public BadLocationException(final String message) {

/**
* Creates a new bad location exception.
*
* @param exception
*
* @param wrappedException
* the cause for the exception
*/
public BadLocationException(final Exception wrappedException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ public Iterable<? extends ICheckValidatorImpl> getValidators(final Map<Object, O

/**
* Internal collect validators.
*
*
* @param language
* the language
* @param object
* the object to be validated
* @return the iterable
* @throws IllegalArgumentException
* if language is null
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
protected Iterable<? extends ICheckValidatorImpl> internalCollectValidators(final String language, final EObject object) {
if (language == null) {
throw new IllegalArgumentException("Input language cannot be null"); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ protected void handleChangedContents(final Delta delta, final IBuildContext cont
* @param context
* build context
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
protected void handleDeletion(final Delta delta, final IBuildContext context) {
if (hasCorrectExtension(delta, resourceServiceProvider)) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,15 @@ public boolean saveOpenEditor() {

/**
* Merges the {@code MANIFEST.MF} file with new plug-in dependencies. Adds dependencies as returned by
* {@link com.avaloq.tools.ddk.check.util.GrammarHelper#getRequiredBundleSymbolicNames()} of current
* check catalog to the MANIFEST.MF file.
*
* @param catalog
* check catalog
* @param monitor
* progress monitor {@link com.avaloq.tools.ddk.check.util.GrammarHelper#getRequiredBundleSymbolicNames()} of current
* check catalog to the MANIFEST.MF file.
* progress monitor
* @throws WrappedException
* if an IOException or CoreException occurs during manifest modification
*/
private void mergeManifest(final CheckCatalog catalog, final IProgressMonitor monitor) {
final IProject project = RuntimeProjectUtil.getProject(catalog.eResource().getURI(), mapper);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ protected <T> T getFromServiceProvider(final Class<T> type, final URI uri) {
* have changed before the builder participant kicks
* in.
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
protected boolean isExtensionUpdateRequired(final CheckCatalog catalog, final IPluginExtension extension, final Iterable<IPluginElement> elements) {
return extension.getPoint().equals(getExtensionPointId()); // if points are different, given extension must not be updated
}
Expand Down Expand Up @@ -214,6 +215,7 @@ public IPluginExtension addExtensionToPluginBase(final IPluginModelBase base, fi
* the extension id
* @return true, if the extension should be enabled
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
protected boolean isExtensionEnabled(final IPluginModelBase base, final CheckCatalog catalog, final ExtensionType type, final String extensionId) {
if (type == ExtensionType.MARKERHELP) {
return false; // disabled until https://bugs.eclipse.org/bugs/show_bug.cgi?id=369534 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ public ExtensionType apply(final IPluginExtension from) {
* @throws CoreException
* the core exception
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public void updateExtensions(final CheckCatalog catalog, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
QualifiedName catalogName = nameProvider.apply(catalog);
Collection<IPluginExtension> catalogExtensions = findExtensions(pluginModel, catalogName, ExtensionType.ALL);
Expand All @@ -296,6 +297,7 @@ public void updateExtensions(final CheckCatalog catalog, final IPluginModelBase
* @throws CoreException
* the core exception
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public void addExtensions(final CheckCatalog catalog, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
QualifiedName catalogName = nameProvider.apply(catalog);
Collection<IPluginExtension> catalogExtensions = findExtensions(pluginModel, catalogName, ExtensionType.ALL);
Expand Down Expand Up @@ -324,6 +326,7 @@ public void addExtensions(final CheckCatalog catalog, final IPluginModelBase plu
* @throws CoreException
* the core exception
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public void removeExtensions(final IEObjectDescription obj, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
for (IPluginExtension extension : findExtensions(pluginModel, obj.getName(), ExtensionType.ALL)) {
final ExtensionType extensionType = getExtensionType(extension);
Expand All @@ -344,6 +347,7 @@ public void removeExtensions(final IEObjectDescription obj, final IPluginModelBa
* @throws CoreException
* the core exception
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public void removeExtensions(final CheckCatalog catalog, final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
QualifiedName name = nameConverter.toQualifiedName(projectUtil.getCatalogQualifiedName(catalog));
for (IPluginExtension extension : findExtensions(pluginModel, name, ExtensionType.ALL)) {
Expand All @@ -362,6 +366,7 @@ public void removeExtensions(final CheckCatalog catalog, final IPluginModelBase
* @throws CoreException
* the core exception
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public void sortAllExtensions(final IPluginModelBase pluginModel, final IProgressMonitor monitor) throws CoreException {
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());
List<IPluginExtension> catalogExtensions = Lists.newArrayList(findAllExtensions(pluginModel));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ public CheckCatalog getCatalog(final IBuildContext context, final URI uri) {
* @param className
* the class name, must not be {@code null}
* @return whether the corresponding java file exists in the project
* @throws IllegalArgumentException
* if the class name is simple or not a valid class name
*/
public boolean isJavaFilePresent(final IProject project, final String className) {
int packageSplitIndex = className.lastIndexOf('.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public String text(final Category category) {
* any catalog
* @return a graphical representation of the catalog
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public Image image(final CheckCatalog catalog) {
return images.forCheckCatalog();
}
Expand All @@ -102,6 +103,7 @@ public Image image(final CheckCatalog catalog) {
* any category
* @return a graphical representation of the category
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public Image image(final Category category) {
return images.forCategory();
}
Expand All @@ -124,39 +126,43 @@ public Image image(final Check check) {
* any context
* @return a graphical representation of the context
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public Image image(final Context context) {
return images.forContext();
}

/**
* An image for member labels.
*
*
* @param context
* any context
* @return a graphical representation of the context
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public Image image(final Member context) {
return images.getJdtImage(xbaseImages.forField(JvmVisibility.PRIVATE, 0));
}

/**
* An image for member labels.
*
*
* @param context
* any context
* @return a graphical representation of the context
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public Image image(final ContextVariable context) {
return images.getJdtImage(xbaseImages.forLocalVariable(0));
}

/**
* An image for member labels.
*
*
* @param context
* any context
* @return a graphical representation of the context
*/
@SuppressWarnings("PMD.UnusedFormalParameter")
public Image image(final FormalParameter context) {
return images.getJdtImage(xbaseImages.forLocalVariable(0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ private static class DeployException extends Exception {
DeployException() {
}

/** Constructor with cause exception. */
/**
* Constructor with cause exception.
*
* @param e
* the cause exception
*/
DeployException(final Exception e) {
super(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class FieldInitializerUtil {
* @param selection
* the selection
* @return the selected resource
* @throws RuntimeException
* if a Java model exception occurs
*/
public IJavaElement getSelectedResource(final IStructuredSelection selection) {
IJavaElement elem = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void generateDefaultQuickfixProvider(final IPath path, final CheckProject
* @param projectInfo
* the project info
*/
@SuppressWarnings("nls")
@SuppressWarnings({"nls", "PMD.UnusedFormalParameter"})
public void generateDocsDirectory(final IPath path, final CheckProjectInfo projectInfo) {
fsa.setOutputPath(path.toOSString());
// IFileSystemAccess doesn't support creating empty directories, so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ public class NewCheckCatalogWizard extends XtextNewProjectWizard {

/**
* Instantiates a new new check file wizard.
*
*
* @param images
* the shared images
* @param page
* the new file wizard page
* @param catalogPage
* the new catalog wizard page
* @param creator
* the check catalog creator
*/
@Inject
public NewCheckCatalogWizard(final CheckImages images, final NewCheckCatalogWizardPage catalogPage, final ICheckCatalogCreator creator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public class NewCheckProjectWizard extends XtextNewProjectWizard { // extends Wi

/**
* Constructor for the check project wizard. The pages required by this wizard are not created by hand, but by Guice (see also plugin.xml).
*
* @param creator
* the project creator
* @param newProjectPage
* the new project wizard page
* @param newCatalogPage
* the new catalog wizard page
*/
@Inject
public NewCheckProjectWizard(final IProjectCreator creator, final NewCheckProjectWizardPage newProjectPage, final NewCheckCatalogWizardPage newCatalogPage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public class NewCheckProjectWizardPage extends NewTypeWizardPage {

/**
* Constructor for NewCheckProjectWizardPage.
*
* @param selection
*/
@Inject
public NewCheckProjectWizardPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ protected void _createProposals(final Keyword keyword, final ContentAssistContex
super._createProposals(keyword, context, acceptor);
}

@SuppressWarnings("PMD.UnusedFormalParameter")
protected void completeLanguages(final EObject model, final ContentAssistContext context, final IIdeContentProposalAcceptor acceptor) {
for (String language : checkCfgUtil.getAllLanguages()) {
ContentAssistEntry entry = getProposalCreator().createProposal(language, context, (final ContentAssistEntry it) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ protected String safeName(final String s) {
* @return {@code true}
*/
// CHECKSTYLE:OFF
@SuppressWarnings("PMD.UnusedFormalParameter")
protected boolean _isLeaf(final ConfiguredCheck modelElement) {
// CHECKSTYLE:ON
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ private ExtensionRegistryMock() {
/**
* Mocks the extension registry.
*
* @throws CoreException
* @throws WrappedException
* if the registry provider cannot be set
*/
@SuppressWarnings("restriction") // for accessing RegistryProviderFactory
public static synchronized void mockRegistry() {
Expand Down Expand Up @@ -148,6 +149,9 @@ public static void unMock(final String extensionPointId) {

/**
* Unmocks the extension registry.
*
* @throws WrappedException
* if the registry provider cannot be reset
*/
@SuppressWarnings("restriction") // for accessing RegistryProviderFactory
public static void unMockRegistry() {
Expand All @@ -167,6 +171,9 @@ public static void unMockRegistry() {

/**
* Asserts that the extension registry is unmocked.
*
* @throws IllegalStateException
* if the extension registry mock is in an unexpected state
*/
public static void assertUnMocked() {
if (registrySpy != null) {
Expand Down
Loading