From bcbf588bba76c16e5d26121b16d4d7d0a85c174e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 11 Dec 2020 18:35:41 +0100 Subject: [PATCH] Rename RuleSetLoadException --- ...setLoadException.java => RuleSetLoadException.java} | 6 +++--- .../main/java/net/sourceforge/pmd/RuleSetLoader.java | 10 +++++----- .../net/sourceforge/pmd/RuleSetNotFoundException.java | 2 +- .../net/sourceforge/pmd/docs/RuleDocGenerator.java | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) rename pmd-core/src/main/java/net/sourceforge/pmd/{RulesetLoadException.java => RuleSetLoadException.java} (80%) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RulesetLoadException.java b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java similarity index 80% rename from pmd-core/src/main/java/net/sourceforge/pmd/RulesetLoadException.java rename to pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java index 7979971118..a59321e146 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RulesetLoadException.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoadException.java @@ -15,17 +15,17 @@ import net.sourceforge.pmd.annotation.InternalApi; *

In the new {@link RuleSetLoader} API, this is thrown instead of * {@link RuleSetNotFoundException}. */ -public final class RulesetLoadException extends RuntimeException { +public final class RuleSetLoadException extends RuntimeException { /** Constructors are internal. */ @InternalApi - public RulesetLoadException(String message, Throwable cause) { + public RuleSetLoadException(String message, Throwable cause) { super(message, cause); } /** Constructors are internal. */ @InternalApi - public RulesetLoadException(String message) { + public RuleSetLoadException(String message) { super(message); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java index 6bde6e0dbb..61f441db7e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetLoader.java @@ -126,7 +126,7 @@ public final class RuleSetLoader { * * @param rulesetPath A reference to a single ruleset * - * @throws RulesetLoadException If any error occurs (eg, invalid syntax, or resource not found) + * @throws RuleSetLoadException If any error occurs (eg, invalid syntax, or resource not found) */ public RuleSet loadFromResource(String rulesetPath) { return loadFromResource(new RuleSetReferenceId(rulesetPath)); @@ -137,7 +137,7 @@ public final class RuleSetLoader { * * @param paths Paths * - * @throws RulesetLoadException If any error occurs (eg, invalid syntax, or resource not found), + * @throws RuleSetLoadException If any error occurs (eg, invalid syntax, or resource not found), * for any of the parameters * @throws NullPointerException If the parameter, or any component is null */ @@ -155,7 +155,7 @@ public final class RuleSetLoader { * @param first First path * @param rest Paths * - * @throws RulesetLoadException If any error occurs (eg, invalid syntax, or resource not found), + * @throws RuleSetLoadException If any error occurs (eg, invalid syntax, or resource not found), * for any of the parameters * @throws NullPointerException If the parameter, or any component is null */ @@ -168,7 +168,7 @@ public final class RuleSetLoader { try { return toFactory().createRuleSet(ruleSetReferenceId); } catch (Exception e) { - throw new RulesetLoadException("Cannot parse " + ruleSetReferenceId, e); + throw new RuleSetLoadException("Cannot parse " + ruleSetReferenceId, e); } } @@ -190,7 +190,7 @@ public final class RuleSetLoader { * * @return A list of all category rulesets * - * @throws RulesetLoadException If a standard ruleset cannot be loaded. + * @throws RuleSetLoadException If a standard ruleset cannot be loaded. * This is a corner case, that probably should not be caught by clients. * The standard rulesets are well-formed, at least in stock PMD distributions. * diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetNotFoundException.java b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetNotFoundException.java index 05dd3d4be2..4e3acad5d4 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetNotFoundException.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetNotFoundException.java @@ -6,7 +6,7 @@ package net.sourceforge.pmd; /** * @deprecated This is now only thrown by deprecated apis. {@link RuleSetLoader} - * throws {@link RulesetLoadException} instead + * throws {@link RuleSetLoadException} instead */ @Deprecated public class RuleSetNotFoundException extends Exception { diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java index 2b5d83c0cc..6f7c7e60ce 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java @@ -36,8 +36,8 @@ import org.apache.commons.text.StringEscapeUtils; import net.sourceforge.pmd.Rule; import net.sourceforge.pmd.RuleSet; +import net.sourceforge.pmd.RuleSetLoadException; import net.sourceforge.pmd.RuleSetLoader; -import net.sourceforge.pmd.RulesetLoadException; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.lang.rule.XPathRule; @@ -122,7 +122,7 @@ public class RuleDocGenerator { } else { LOG.fine("Ignoring ruleset " + filename); } - } catch (RulesetLoadException e) { + } catch (RuleSetLoadException e) { // ignore rulesets, we can't read LOG.log(Level.WARNING, "ruleset file " + filename + " ignored (" + e.getMessage() + ")", e); }