~hjd/ubuntu/wily/xmlgraphics-commons/debian-merged

« back to all changes in this revision

Viewing changes to src/java/org/apache/xmlgraphics/image/loader/cache/ImageCache.java

  • Committer: Hans Joachim Desserud
  • Date: 2015-11-11 18:22:53 UTC
  • mfrom: (9.1.5 sid)
  • Revision ID: hans_joachim_desserud-20151111182253-zwi0frfm97j0wddn
  * Merge from Debian unstable.  Remaining changes:
    - d/control: Drop dependencies required for unit testing as they
      include libmockito-java which would pull maven into main, disable unit
      test execution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * limitations under the License.
16
16
 */
17
17
 
18
 
/* $Id: ImageCache.java 816640 2009-09-18 14:14:55Z maxberger $ */
 
18
/* $Id: ImageCache.java 1681698 2015-05-26 07:49:35Z ssteiner $ */
19
19
 
20
20
package org.apache.xmlgraphics.image.loader.cache;
21
21
 
56
56
public class ImageCache {
57
57
 
58
58
    /** logger */
59
 
    protected static Log log = LogFactory.getLog(ImageCache.class);
 
59
    protected static final Log log = LogFactory.getLog(ImageCache.class);
60
60
 
61
61
    //Handling of invalid URIs
62
62
    private Map invalidURIs = Collections.synchronizedMap(new java.util.HashMap());
161
161
        Long timestamp = (Long) invalidURIs.get(uri);
162
162
        boolean expired = (timestamp == null)
163
163
                || this.invalidURIExpirationPolicy.isExpired(
164
 
                        this.timeStampProvider, timestamp.longValue());
 
164
                        this.timeStampProvider, timestamp);
165
165
        if (expired) {
166
166
            this.invalidURIs.remove(uri);
167
167
        }
203
203
     * @param uri the URI of the invalid image
204
204
     */
205
205
    void registerInvalidURI(String uri) {
206
 
        invalidURIs.put(uri, new Long(timeStampProvider.getTimeStamp()));
 
206
        invalidURIs.put(uri, timeStampProvider.getTimeStamp());
207
207
 
208
208
        considerHouseKeeping();
209
209
    }