lishxi / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

NoSuchElementException in TileWriter.isSymbolicDirectoryLink #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A user reported this trace. Attached simple diff to catch the exception.

Thread: Thread[Thread-696,1,main] throwable:
java.util.NoSuchElementExceptionjava.util.NoSuchElementException
at java.util.LinkedList.removeFirst(LinkedList.java:634)
at
org.apache.harmony.luni.internal.io.FileCanonPathCache.get(FileCanonPathCache.ja
va:87)
at java.io.File.getCanonicalPath(File.java:500)
at java.io.File.getCanonicalFile(File.java:678)
at
org.osmdroid.tileprovider.modules.TileWriter.isSymbolicDirectoryLink(TileWriter.
java:169)
at
org.osmdroid.tileprovider.modules.TileWriter.calculateDirectorySize(TileWriter.j
ava:153)
at
org.osmdroid.tileprovider.modules.TileWriter.calculateDirectorySize(TileWriter.j
ava:154)
at
org.osmdroid.tileprovider.modules.TileWriter.access$0(TileWriter.java:146)
at org.osmdroid.tileprovider.modules.TileWriter$1.run(TileWriter.java:52)

Original issue reported on code.google.com by bobzill...@gmail.com on 28 May 2011 at 6:20

Attachments:

GoogleCodeExporter commented 9 years ago
Grrrr... lots of crazy things can happen with file systems I guess :) We should 
probably add lots of exception handling in this area because some manufacturer 
out there will probably find a way to break whatever we implement.

Original comment by kurtzm...@gmail.com on 31 May 2011 at 6:16

GoogleCodeExporter commented 9 years ago
See:
http://code.google.com/p/android/issues/detail?id=5807
http://code.google.com/p/android/issues/detail?id=4961

This is a known bug from a cache implementation in Android that was later 
removed. The getCanonicalFile method should not throw this exception but it is 
so we will catch this specific exception (we are already catching IOExceptions 
which are expected).

Original comment by kurtzm...@gmail.com on 3 Jun 2011 at 8:24

GoogleCodeExporter commented 9 years ago
We also return "false" when we get an exception. We should err on the side of 
caution and return true if we get an exception so that no further processing is 
done on the directory.

Original comment by kurtzm...@gmail.com on 3 Jun 2011 at 8:28

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r939.

Original comment by kurtzm...@gmail.com on 3 Jun 2011 at 8:29