keiron      01/12/02 23:57:41

  Modified:    src/org/apache/fop/image Tag: fop-0_20_2-maintain
                        FopImageFactory.java
  Log:
  doesn't open stream if image already loaded and in hash map
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.2  +8 -7      xml-fop/src/org/apache/fop/image/FopImageFactory.java
  
  Index: FopImageFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/FopImageFactory.java,v
  retrieving revision 1.25.2.1
  retrieving revision 1.25.2.2
  diff -u -r1.25.2.1 -r1.25.2.2
  --- FopImageFactory.java      2001/12/02 22:17:29     1.25.2.1
  +++ FopImageFactory.java      2001/12/03 07:57:40     1.25.2.2
  @@ -1,5 +1,5 @@
   /*
  - * $Id: FopImageFactory.java,v 1.25.2.1 2001/12/02 22:17:29 tore Exp $
  + * $Id: FopImageFactory.java,v 1.25.2.2 2001/12/03 07:57:40 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -58,6 +58,12 @@
                   href = href.substring(1, href.length() - 1);
               }
           }
  +
  +        // check if already created
  +        FopImage imageObject = (FopImage)m_urlMap.get(href);
  +        if (imageObject != null)
  +            return imageObject;
  +
           try {
               // try url as complete first, this can cause
               // a problem with relative uri's if there is an
  @@ -94,11 +100,6 @@
               }
           }
   
  -        // check if already created
  -        FopImage imageObject = (FopImage)m_urlMap.get(absoluteURL.toString());
  -        if (imageObject != null)
  -            return imageObject;
  -
               // If not, check image type
           ImageReader imgReader = null;
           try {
  @@ -192,7 +193,7 @@
                                           + "class " + imageClass.getName()
                                           + " doesn't implement 
org.apache.fop.image.FopImage interface");
           }
  -        m_urlMap.put(absoluteURL.toString(), imageInstance);
  +        m_urlMap.put(href, imageInstance);
           return (FopImage)imageInstance;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to