diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2015-01-02 13:44:30 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-01-02 13:44:30 +0100 |
commit | 1cef6076e8cecb7b19181c8955444841edb679c4 (patch) | |
tree | 9e0d69036f1d0df8aafb8b7ee9dbacd05eadfae2 /main/src/cgeo/geocaching/files/FileParser.java | |
parent | 6c7f203f91496f699ae2d681b089483e37b01e01 (diff) | |
download | cgeo-1cef6076e8cecb7b19181c8955444841edb679c4.zip cgeo-1cef6076e8cecb7b19181c8955444841edb679c4.tar.gz cgeo-1cef6076e8cecb7b19181c8955444841edb679c4.tar.bz2 |
Use System.currentTimeMillis() instead of new Date().getTime()
Diffstat (limited to 'main/src/cgeo/geocaching/files/FileParser.java')
-rw-r--r-- | main/src/cgeo/geocaching/files/FileParser.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/files/FileParser.java b/main/src/cgeo/geocaching/files/FileParser.java index 9521c70..09b7b84 100644 --- a/main/src/cgeo/geocaching/files/FileParser.java +++ b/main/src/cgeo/geocaching/files/FileParser.java @@ -16,7 +16,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Collection; -import java.util.Date; import java.util.concurrent.CancellationException; public abstract class FileParser { @@ -24,24 +23,19 @@ public abstract class FileParser { * Parses caches from input stream. * * @param stream + * the input stream * @param progressHandler - * for reporting parsing progress (in bytes read from input stream) + * for reporting parsing progress (in bytes read from input stream) * @return collection of caches * @throws IOException - * if the input stream can't be read + * if the input stream can't be read * @throws ParserException - * if the input stream contains data not matching the file format of the parser + * if the input stream contains data not matching the file format of the parser */ public abstract Collection<Geocache> parse(@NonNull final InputStream stream, @Nullable final CancellableHandler progressHandler) throws IOException, ParserException; /** * Convenience method for parsing a file. - * - * @param file - * @param progressHandler - * @return - * @throws IOException - * @throws ParserException */ public Collection<Geocache> parse(final File file, final CancellableHandler progressHandler) throws IOException, ParserException { final BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file)); @@ -84,7 +78,7 @@ public abstract class FileParser { } else { cache.setInventoryItems(0); } - final long time = new Date().getTime(); + final long time = System.currentTimeMillis(); cache.setUpdated(time); cache.setDetailedUpdate(time); } |