tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Klute <kl...@tommy.rainer-klute.de>
Subject [PATCH] Tomcat 3.3: Small bug in StringManager
Date Fri, 02 Nov 2001 09:35:20 GMT
Hi,

while fiddling around with the JDBCRealm I encountered a
NullPointerException. This happend when I specified a wrong
authentication database. However, instead of a reasonable error
message I got that NullPointerException.

It turned out to be a small bug in the StringManager. Here's a 
patch:


--- src/share/org/apache/tomcat/util/res/StringManager.java	2001/10/21 19:26:14	1.1.1.1
+++ src/share/org/apache/tomcat/util/res/StringManager.java	2001/11/01 22:05:53
@@ -175,6 +175,8 @@
     public String getString(String key, Object[] args) {
         String iString = null;
         String value = getString(key);
+        if (value == null)
+            value = "null";
 
         // this check for the runtime exception is some pre 1.1.6
         // VM's don't do an automatic toString() on the passed in


Best regards
Rainer Klute

                             RAINER KLUTE IT-CONSULTING
  Dipl.-Inform.
  Rainer Klute               E-Mail:  rainer.klute@epost.de
  K├Ârner Grund 24            Telefon: +49 172 2324824
D-44143 Dortmund             Telefax: +49 231 5349423

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message