Resolve "Redundant null check: the variable cannot be null at this location" warning.
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 5 Oct 2011 15:38:38 +0000 (15:38 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 5 Oct 2011 15:38:38 +0000 (15:38 +0000)
The JspC constructor cannot throw a JasperException.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1179268 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/JspC.java

index 3d4c08c..fda8b32 100644 (file)
@@ -250,9 +250,8 @@ public class JspC implements Options {
         if (arg.length == 0) {
             System.out.println(Localizer.getMessage("jspc.usage"));
         } else {
-            JspC jspc = null;
+            JspC jspc = new JspC();
             try {
-                jspc = new JspC();
                 jspc.setArgs(arg);
                 if (jspc.helpNeeded) {
                     System.out.println(Localizer.getMessage("jspc.usage"));
@@ -261,7 +260,7 @@ public class JspC implements Options {
                 }
             } catch (JasperException je) {
                 System.err.println(je);
-                if (jspc != null && jspc.dieLevel != NO_DIE_LEVEL) {
+                if (jspc.dieLevel != NO_DIE_LEVEL) {
                     System.exit(jspc.dieLevel);
                 }
             }