You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by ks...@apache.org on 2002/07/11 10:37:11 UTC

cvs commit: xml-xindice/java/src/org/apache/xindice/core DocumentCache.java FaultCodes.java

kstaken     2002/07/11 01:37:11

  Modified:    java/src/org/apache/xindice/core DocumentCache.java
                        FaultCodes.java
  Log:
  Adding a fix for a NPE in DocumentCache and some better output on errors.
  Submitted by: Jeff Suttor
  Reviewed by: Kimbro Staken
  
  Revision  Changes    Path
  1.2       +5 -1      xml-xindice/java/src/org/apache/xindice/core/DocumentCache.java
  
  Index: DocumentCache.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/core/DocumentCache.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DocumentCache.java	6 Dec 2001 21:00:11 -0000	1.1
  +++ DocumentCache.java	11 Jul 2002 08:37:11 -0000	1.2
  @@ -167,6 +167,10 @@
         }
   
         public boolean equals(Object o) {
  +         if ( o == null ) {
  +            return false;
  +         }
  +         
            CacheKey comp = (CacheKey)o;
            if ( col != comp.col )
               return false;
  
  
  
  1.2       +8 -4      xml-xindice/java/src/org/apache/xindice/core/FaultCodes.java
  
  Index: FaultCodes.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/core/FaultCodes.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FaultCodes.java	6 Dec 2001 21:00:11 -0000	1.1
  +++ FaultCodes.java	11 Jul 2002 08:37:11 -0000	1.2
  @@ -203,9 +203,13 @@
         if ( e instanceof APIException )
            return (APIException)e;
         else {
  -         String m = e.getMessage();
  -         if ( m == null )
  -            m = "";
  +         // provide as much information as possible about the exception
  +         String m = e.toString();
  +         if ( m == null ) {
  +            // should never happen
  +            m = "Exception.toString() returned null in FaultCodes.APIException(Exception)";
  +         }
  +         e.printStackTrace();
   
            if ( e instanceof RuntimeException )
               return new APIException(JAVA_RUNTIME_ERROR, getMessage(JAVA_RUNTIME_ERROR), m);