﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
8560	ImageryCache plugin can easily be corrupted	rickmastfan67	akks	"I've been trying out the new ImageryCache plugin since it was made available to download and I've been liking it so far.  However, I've found a way that can break the plugin, though it's something that normally wouldn't happen.

Steps to reproduce:
1. Be editing in JOSM with an imagery background (was using Bing) and have your power go out all of a sudden.
2. Once the power comes back online, restart your computer and load up JOSM once it's fully booted.
3. Open the file that you were working on and zoom in on a area where you were editing.
4. Turn back on your imagery source (Bing for me).
5. Watch the ImageryCache plugin crash hard.

Only way to fix this is to manually delete the ""Bing"" imagery cache file.  Then everything worked again and Bing imagery was shown in JOSM.

{{{
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-03-31 01:34:01
Last Changed Author: akks
Revision: 5815
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-03-30 20:21:20 +0100 (Sat, 30 Mar 2013)
Last Changed Rev: 5815

Identification: JOSM/1.5 (5815 en)
Memory Usage: 197 MB / 2730 MB (101 MB allocated, but free)
Java version: 1.7.0_15, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7
Dataset consistency test: No problems found

Plugin: ImageryCache (29368)
Plugin: OpeningHoursEditor (29210)
Plugin: buildings_tools (29210)
Plugin: mapdust (29210)
Plugin: measurement (29344)
Plugin: mirrored_download (29210)
Plugin: openstreetbugs (29373)
Plugin: osmarender (29210)
Plugin: reverter (29359)
Plugin: turnrestrictions (29210)
Plugin: undelete (29210)
Plugin: utilsplugin2 (29392)

java.lang.InternalError: Data were not fully read.
	at org.mapdb.StorageDirect.recordGet2(StorageDirect.java:510)
	at org.mapdb.StorageDirect.get(StorageDirect.java:201)
	at org.mapdb.EngineWrapper.get(EngineWrapper.java:50)
	at org.mapdb.AsyncWriteEngine.get(AsyncWriteEngine.java:163)
	at org.mapdb.EngineWrapper.get(EngineWrapper.java:50)
	at org.mapdb.CacheHashTable.get(CacheHashTable.java:85)
	at org.mapdb.DB.<init>(DB.java:49)
	at org.mapdb.DBMaker.make(DBMaker.java:546)
	at org.openstreetmap.josm.plugins.imagerycache.OsmDBTilesLoader$TileDAOMapDB.getDB(OsmDBTilesLoader.java:51)
	at org.openstreetmap.josm.plugins.imagerycache.OsmDBTilesLoader$TileDAOMapDB.getStorage(OsmDBTilesLoader.java:70)
	at org.openstreetmap.josm.plugins.imagerycache.OsmDBTilesLoader$TileDAOMapDB.getById(OsmDBTilesLoader.java:88)
	at org.openstreetmap.josm.plugins.imagerycache.OsmDBTilesLoader$DatabaseLoadJob.loadTileFromFile(OsmDBTilesLoader.java:181)
	at org.openstreetmap.josm.plugins.imagerycache.OsmDBTilesLoader$DatabaseLoadJob.run(OsmDBTilesLoader.java:160)
	at org.openstreetmap.gui.jmapviewer.JobDispatcher$JobThread.executeJobs(JobDispatcher.java:168)
	at org.openstreetmap.gui.jmapviewer.JobDispatcher$JobThread.run(JobDispatcher.java:135)
}}}

NOTE: I have archived the malfunctioning imagery cache file if you need it for testing (for now), but it's well over 120MB."	defect	closed	normal		Plugin imagerycache	latest	wontfix		
