Skip to content
Merged
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
3 changes: 3 additions & 0 deletions config/checkstyle-checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@
<property name="tags" value="noinspection"/>
</module>
<module name="JavadocContentLocation"/>
<module name="JavadocMethod">
<property name="validateThrows" value="true"/>
</module>
<module name="JavadocMissingLeadingAsterisk"/>
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
<module name="JavadocStyle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ private IFile getFile(String fileName) {

/**
* Helper method to get an array of java.io.Files. This array gets passed to the checker.
*
* @return the list of files
*/
private List<File> getFilesList() {
List<File> files = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ private static String getCacheKey(ICheckConfiguration config, IProject project)
/**
* Tries to reuse an already configured checker for this configuration.
*
* @param config
* the configuration file
* @param cacheKey
* the key for cache access
* @param modificationStamp
* the last modification timestamp of the configuration file
* @return the cached checker or null
*/
private static Checker tryCheckerCache(String cacheKey, long modificationStamp) {
Expand Down Expand Up @@ -200,15 +200,15 @@ private static Checker tryCheckerCache(String cacheKey, long modificationStamp)
*
* @param input
* the input source for the configuration file
* @param configFileUri
* the URI of the configuration file, or <code>null</code> if it could not be determined
* @param propResolver
* a property resolver null
* @param project
* the project
* @return the newly created Checker
* @throws CheckstyleException
* an exception during the creation of the checker occured
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private static Checker createCheckerInternal(InputSource input, PropertyResolver propResolver,
IProject project) throws CheckstyleException, CheckstylePluginException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ public final <T extends IResource> void handleBuildSelection(final Collection<T>
* configuration.
* File sets that share the same check configuration merge into
* one Auditor.
*
* @param <T> the resource type
* @param resources the resources to audit
* @param configuration the project configuration
* @param project the project
* @return the map of check configurations to auditors
* @throws CoreException if an error occurs
*/
private <T extends IResource> Map<ICheckConfiguration, Auditor> resolveAudits(
Collection<T> resources, IProjectConfiguration configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ private static IPath getTargetStateLocation(IPath newWorkspaceRoot) {

/**
* Load the check configurations from the persistent state storage.
*
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private static void loadFromPersistence() throws CheckstylePluginException {
File configFile = getInternalConfigurationFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private CheckConfigurationTester() {
/**
* Tests a configuration if there are unresolved properties.
*
* @param checkConfiguration the check configuration to test
* @return the list of unresolved properties as ResolvableProperty values.
* @throws CheckstylePluginException
* most likely the configuration file could not be found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ private static void writeModules(Module module, Branch parent, Severity parentSe
* the module to write
* @param parent
* the parent element
* @return the written module element
*/
private static Element writeModule(Module module, Branch parent) {
// Start the module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public class GlobalCheckConfigurationWorkingSet implements ICheckConfigurationWo
* the list of global check configurations
* @param defaultConfig
* the defaul check configuration
* @param defaultBuiltInCheckConfiguration
* the default built-in check configuration
*/
GlobalCheckConfigurationWorkingSet(List<ICheckConfiguration> checkConfigs,
ICheckConfiguration defaultConfig, ICheckConfiguration defaultBuiltInCheckConfiguration) {
Expand Down Expand Up @@ -218,8 +220,6 @@ public boolean isNameCollision(CheckConfigurationWorkingCopy configuration) {
/**
* Updates the project configurations that use the changed check configurations.
*
* @param configurations
* the check configurations
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
Expand Down Expand Up @@ -263,6 +263,9 @@ private void updateProjectConfigurations() throws CheckstylePluginException {

/**
* Store the check configurations to the persistent state storage.
*
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private void storeToPersistence() throws CheckstylePluginException {

Expand Down Expand Up @@ -306,6 +309,10 @@ private void notifyDeletedCheckConfigs() throws CheckstylePluginException {

/**
* Transforms the check configurations to a document.
*
* @param configurations the check configurations
* @param defaultConfig the default check configuration
* @return the document containing the check configurations
*/
private static Document createCheckConfigurationsDocument(
List<CheckConfigurationWorkingCopy> configurations, ICheckConfiguration defaultConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public CheckstyleMetadataAdapter() {

/**
* Creates RuleMetadata.
*
* @param groups the rule group metadata
* @param allModuleDetails all module details
* @param thirdPartyGroups third party rule groups
* @return the list of rule metadata
*/
public List<RuleMetadata> loadRuleMetadata(
Map<String, RuleGroupMetadata> groups, Collection<ModuleDetails> allModuleDetails,
Expand Down Expand Up @@ -100,6 +105,7 @@ public List<RuleMetadata> loadRuleMetadata(
* Create metadata for modules not present in the previously eclipse provided metadata.
* Work in progress.
*
* @param group the rule group
* @param moduleDetails module details fetched from checkstyle metadata
* @return ruleMetadata for the module
*/
Expand Down Expand Up @@ -199,7 +205,10 @@ private static List<String> getEnumValues(String className) {
/**
* Generate all prefix strings from the packageName and find which is a valid key in
* {@code sThirdPartyRuleGroupMap}.
* @param thirdPartyGroups
*
* @param thirdPartyGroups the third party rule groups
* @param packageName the package name to lookup
* @return the lookup key or null
*/
private static String findLookupKey(Map<String, Map<String, String>> thirdPartyGroups,
String packageName) {
Expand All @@ -225,6 +234,8 @@ private static String findLookupKey(Map<String, Map<String, String>> thirdPartyG

/**
* Create a mapping between checkstyle package names and {@code RuleGroupMetadata} group names.
*
* @return the package to group name mapping
*/
private static Map<String, String> createPackageToGroupNameMapping() {
Map<String, String> packageToGroupName = new HashMap<>();
Expand All @@ -251,7 +262,8 @@ private static Map<String, String> createPackageToGroupNameMapping() {

/**
* Create mapping between {@code ModulePropertyDetails} datatype and {@code ConfigPropertyType}.
* @return
*
* @return the property type mapping
*/
private static Map<String, ConfigPropertyType> createPropertyTypeMapping() {
Map<String, ConfigPropertyType> propertyTypes = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ private static void loadRuleMetadata() {
* Helper method to get all potential metadata files using the checkstyle_packages.xml as base
* where to look. It is not guaranteed that the files returned acutally exist.
*
* @param classLoader the class loader to use
* @return the collection of potential metadata files.
* @throws CheckstylePluginException
* an unexpected exception ocurred
Expand Down Expand Up @@ -441,6 +442,7 @@ private static Collection<String> getAllPotentialMetadataFiles(ClassLoader class
*
* @param metadataFile
* the metadata xml file
* @param classLoader the class loader to use
* @return the corresponding ResourceBundle for the metadata file or <code>null</code> if none
* exists
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ private ProjectConfigurationFactory() {
* @param project
* the project
* @return the default project configuration
* @throws RuntimeException
* an unexpected runtime exception occurred
*/
public static IProjectConfiguration createDefaultProjectConfiguration(IProject project) {

Expand Down Expand Up @@ -153,6 +155,11 @@ public static List<IProject> getProjectsUsingConfig(ICheckConfiguration checkCon

/**
* Load the audit configurations from the persistent state storage.
*
* @param project the project
* @return the project configuration
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private static IProjectConfiguration loadFromPersistence(IProject project)
throws CheckstylePluginException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ public int hashCode() {

/**
* Store the audit configurations to the persistent state storage.
*
* @param config the project configuration to persist
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private void storeToPersistence(ProjectConfigurationWorkingCopy config)
throws CheckstylePluginException {
Expand Down Expand Up @@ -374,6 +378,9 @@ private void storeToPersistence(ProjectConfigurationWorkingCopy config)
*
* @param config
* the configuration
* @return the XML document representing the project configuration
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private Document writeProjectConfig(ProjectConfigurationWorkingCopy config)
throws CheckstylePluginException {
Expand Down Expand Up @@ -445,6 +452,8 @@ private void writeLocalConfiguration(ICheckConfiguration checkConfig, Element do
* the project
* @param docRoot
* the root element of the project configuration
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private void writeFileSet(FileSet fileSet, IProject project, Element docRoot)
throws CheckstylePluginException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public abstract class AbstractCTransformationClass {
*
* @param rule
* The checkstyle-rule associated to this class.
* @throws RuntimeException
* an unexpected runtime exception occurred
*/
protected final void setRule(final Configuration rule) {
final String[] attrs = rule.getAttributeNames();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public abstract class AbstractFTransformationClass {
/**
* Method for setting the field mValue.
*
* @param setting
* The formatter-setting associated to this class.
* @param value
* The value of the setting.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public void writeXmlFile() {
*
* @param outStream
* BufferedWriter to outputfile.
* @throws IOException
* an I/O exception occurred
*/
private void writeXMLFile(final OutputStream outStream) throws IOException {
outStream.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".getBytes("UTF-8"));
Expand All @@ -80,8 +82,11 @@ private void writeXMLFile(final OutputStream outStream) throws IOException {
/**
* Method for writing all modules to file.
*
* @param modules the modules to write
* @param outStream
* BufferedWriter to xml-file.
* @throws IOException
* an I/O exception occurred
*/
private static void writeModules(final HashMap<String, HashMap<String, String>> modules,
final OutputStream outStream) throws IOException {
Expand All @@ -106,6 +111,9 @@ private static void writeModules(final HashMap<String, HashMap<String, String>>
*
* @param properties
* A HashMap containing all properties.
* @param outStream the output stream to write to
* @throws IOException
* an I/O exception occurred
*/
private static void writeProperty(final HashMap<String, String> properties,
final OutputStream outStream) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public CheckstyleTransformer(IProject project, final List<Configuration> ruleLis
*
* @param classnames
* A list of names of which classes get loaded.
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private void loadTransformationClasses(final List<String> classnames)
throws CheckstylePluginException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ public void transformRules(final String path, Map<String, String> formatterSetti
* Loads all transformationclasses that are needed to recognize the formatter-settings. A instance
* of every loaded class is stored in the field transformationClasses. Gets called by the
* constructor.
* @return
*
* @param formatterSettings the formatter settings
* @return the list of transformation classes
* @throws CheckstylePluginException
* an unexpected exception occurred
*/
private List<AbstractFTransformationClass> loadTransformationClasses(
Map<String, String> formatterSettings) throws CheckstylePluginException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ private void loadModules() {
/**
* Creates a module editor for the current selection.
*
* @param selection
* the selection
* @return whether configuration was successful
* @param rules the rules to configure
*/
private void newModule(List<RuleMetadata> rules) {
if (mConfiguration.isConfigurable()) {
Expand Down Expand Up @@ -260,6 +258,9 @@ private void newModule(List<RuleMetadata> rules) {

/**
* Checks if a certain module is already contained in the configuration.
*
* @param metadata the rule metadata to check
* @return whether the module is already configured
*/
private boolean isAlreadyConfigured(RuleMetadata metadata) {
String internalName = metadata.identity().internalName();
Expand All @@ -280,8 +281,7 @@ private boolean isAlreadyConfigured(RuleMetadata metadata) {
/**
* Opens the module editor for the current selection.
*
* @param selection
* the selection
* @param module the module to open
*/
private void openModule(Module module) {
if (module != null) {
Expand All @@ -300,8 +300,7 @@ private void openModule(Module module) {
/**
* Creates a module editor for the current selection.
*
* @param selection
* the selection
* @param modules the modules to remove
*/
private void removeModule(List<Module> modules) {
if (mConfiguration.isConfigurable() && !modules.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ protected void okPressed() {
/**
* Creates the configuration type specific location editor.
*
* @param configType
* the configuration type
* @param config
* the configuration working copy
*/
private void createConfigurationEditor(CheckConfigurationWorkingCopy config) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public final class CheckConfigurationWorkingSetEditor extends Composite {
/**
* Creates the configuration working set editor.
*
* @param parent the parent composite
* @param style the style bits
* @param workingSet
* the configuration working set to edit
* @param showUsage
* determines if the usage area should be shown
*/
public CheckConfigurationWorkingSetEditor(Composite parent, int style,
ICheckConfigurationWorkingSet workingSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public class RuleConfigurationEditDialog extends TitleAreaDialog {
* Parent shell.
* @param rule
* Rule being edited.
* @param readonly
* whether the dialog is read-only
* @param title
* the dialog title
*/
public RuleConfigurationEditDialog(Shell parent, Module rule, boolean readonly, String title) {
super(parent);
Expand Down
Loading
Loading