You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/08/23 10:34:16 UTC
[commons-net] branch master updated: Inline single use local variable
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
The following commit(s) were added to refs/heads/master by this push:
new d97a9399 Inline single use local variable
d97a9399 is described below
commit d97a9399b2bd44d04f73e9e7bf7cb8bcf27dea51
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 23 06:34:11 2023 -0400
Inline single use local variable
---
.../net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java b/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
index 60023143..db5e4bdb 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
@@ -96,8 +96,7 @@ public class DefaultFTPFileEntryParserFactoryTest extends TestCase {
factory.createFileEntryParser("org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory");
fail("Exception should have been thrown. \"DefaultFTPFileEntryParserFactory\" does not implement FTPFileEntryParser");
} catch (final ParserInitializationException pie) {
- final Throwable root = pie.getCause();
- assertTrue(root instanceof ClassCastException);
+ assertTrue(pie.getCause() instanceof ClassCastException);
}
try {
@@ -105,16 +104,14 @@ public class DefaultFTPFileEntryParserFactoryTest extends TestCase {
factory.createFileEntryParser("org.apache.commons.net.ftp.parser.FTPFileEntryParserFactory");
fail("ParserInitializationException should have been thrown.");
} catch (final ParserInitializationException pie) {
- final Throwable root = pie.getCause();
- assertTrue(root instanceof InstantiationException);
+ assertTrue(pie.getCause() instanceof InstantiationException);
}
try {
// Class exists, but is abstract
factory.createFileEntryParser("org.apache.commons.net.ftp.FTPFileEntryParserImpl");
fail("ParserInitializationException should have been thrown.");
} catch (final ParserInitializationException pie) {
- final Throwable root = pie.getCause();
- assertTrue(root instanceof InstantiationException);
+ assertTrue(pie.getCause() instanceof InstantiationException);
}
}