Skip to content

Commit a2351d2

Browse files
authored
clean up a few unthrown exceptions (#1232)
* clean up a few unthrown exceptions
1 parent 6f13412 commit a2351d2

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,9 +2412,8 @@ private boolean isNewClassFromLastVersion(JavaClass javaClass) {
24122412
* @param javaExecutable a given method not null
24132413
* @return <code>true</code> if Clirr said that this method is added from the last version,
24142414
* <code>false</code> otherwise or if {@link #clirrNewMethods} is null.
2415-
* @throws MojoExecutionException if any
24162415
*/
2417-
private boolean isNewMethodFromLastRevision(JavaExecutable javaExecutable) throws MojoExecutionException {
2416+
private boolean isNewMethodFromLastRevision(JavaExecutable javaExecutable) {
24182417
if (clirrNewMethods == null) {
24192418
return false;
24202419
}

src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ protected static Collection<String> getExcludedPackages(
373373
try {
374374
Files.walkFileTree(sourceDirectory, new SimpleFileVisitor<Path>() {
375375
@Override
376-
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
376+
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
377377
if (file.getFileName().toString().endsWith(".java")) {
378378
fileList.add(
379379
sourceDirectory.relativize(file.getParent()).toString());

src/main/java/org/apache/maven/plugins/javadoc/resolver/ResourceResolver.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private List<JavadocBundle> resolveBundlesFromArtifacts(
222222
Collection<Path> dirs = new ArrayList<>(toResolve.size());
223223
try {
224224
dirs = resolveAndUnpack(toResolve, config, RESOURCE_VALID_CLASSIFIERS, false);
225-
} catch (ArtifactResolutionException | ArtifactNotFoundException e) {
225+
} catch (ArtifactResolutionException e) {
226226
if (LOGGER.isDebugEnabled()) {
227227
LOGGER.debug(e.getMessage(), e);
228228
}
@@ -289,14 +289,13 @@ private org.eclipse.aether.artifact.Artifact createResourceArtifact(
289289
* @param propagateErrors
290290
* @return list of <dependencyConflictId, absolutePath>
291291
* @throws ArtifactResolutionException if an exception occurs
292-
* @throws ArtifactNotFoundException if an exception occurs
293292
*/
294293
private Collection<Path> resolveAndUnpack(
295294
final List<org.eclipse.aether.artifact.Artifact> artifacts,
296295
final SourceResolverConfig config,
297296
final List<String> validClassifiers,
298297
final boolean propagateErrors)
299-
throws ArtifactResolutionException, ArtifactNotFoundException {
298+
throws ArtifactResolutionException {
300299
// NOTE: Since these are '-sources' and '-test-sources' artifacts, they won't actually
301300
// resolve transitively...this is just used to aggregate resolution failures into a single
302301
// exception.

0 commit comments

Comments
 (0)