Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11869 closed enhancement (fixed)

Replace CacheFiles by JCS?

Reported by: simon04 Owned by: team
Priority: minor Milestone: 15.09
Component: Core Version:
Keywords: Cc: wiktorn

Description

While investigating #11867, I came across org.openstreetmap.josm.io.CacheFiles. This class is only used in ThumbsLoader and might be replaced by a JCS cache?

Attachments (1)

cache_files_to_jcs.patch (15.4 KB ) - added by wiktorn 9 years ago.

Download all attachments as: .zip

Change History (5)

by wiktorn, 9 years ago

Attachment: cache_files_to_jcs.patch added

comment:1 by wiktorn, 9 years ago

I doesn't look like hard thing. I attach a patch that does this for review. But I didn't it test thoroughly yet.

comment:2 by simon04, 9 years ago

Some thoughts:

  • When the cache initialization fails (IOException in the constructor), we will run into NPE while accessing the cache. So check for cache != null in if (!cacheOff) (2×)?
  • Maybe you can give some context for the Main.warn calls, e.g., "Thumbnail cache initialization failed" and "Thumbnail cache access failed".
  • Java 7 provides the try (ByteArrayOutputStream output = new ByteArrayOutputStream()) { /* ... */ } construct to automatically close the stream at the end. Might not be necessary for ByteArrayOutputStream, but is used through-out the code …

comment:3 by wiktorn, 9 years ago

Resolution: fixed
Status: newclosed

In 8762/josm:

Replace CacheFiles with JCS and remove CacheFiles

Closes: #11869

comment:4 by wiktorn, 9 years ago

Milestone: 15.09

@simon04

Thanks for your review.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.