<NME> OAuth.java
<BEF> package cgeo.geocaching.network;

import cgeo.geocaching.utils.CryptUtils;

import org.apache.commons.lang3.StringUtils;

public class OAuth {
import org.eclipse.jdt.annotation.NonNull;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class OAuth {
                                 final String method,
                                 final boolean https,
                                 final Parameters params,
                                 final OAuthTokens tokens,
                                 final String consumerKey,
                                 final String consumerSecret) {
        params.put(
                "oauth_consumer_key", consumerKey,
                "oauth_nonce", CryptUtils.md5(Long.toString(System.currentTimeMillis())),
                "oauth_consumer_key", consumerKey,
                "oauth_nonce", CryptUtils.md5(Long.toString(System.currentTimeMillis())),
                "oauth_signature_method", "HMAC-SHA1",
                "oauth_timestamp", Long.toString(new Date().getTime() / 1000),
                "oauth_token", StringUtils.defaultString(tokens.getTokenPublic()),
                "oauth_version", "1.0");
        params.sort();
                signCompletedOAuth(host, path, method, https, params, tokens.getTokenSecret(), consumerSecret));
    }

    static String signCompletedOAuth(final String host, final String path, final String method, final boolean https,
                                     final Parameters params, final String tokenSecret, final String consumerSecret) {
        params.sort();

        // Twitter requires that the signature is generated from the raw data that is received in the query string.
        // Opencaching sites require that the signature is generated from the percent-encoded versions of the parameters.
        // As a consequence, we will always use percent-encoding for parameters during the OAuth signing process, which
    }

    /**
     * percent encode following http://tools.ietf.org/html/rfc5849#section-3.6
     *
     * @param url
     * @return
     */
    static String percentEncode(@NonNull final String url) {
        return StringUtils.replace(Network.rfc3986URLEncode(url), "*", "%2A");
    }

}

<MSG> Use System.currentTimeMillis() instead of new Date().getTime()

<DFF> @@ -8,7 +8,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jdt.annotation.NonNull;
 
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 public class OAuth {
@@ -24,7 +23,7 @@ public class OAuth {
                 "oauth_consumer_key", consumerKey,
                 "oauth_nonce", CryptUtils.md5(Long.toString(System.currentTimeMillis())),
                 "oauth_signature_method", "HMAC-SHA1",
-                "oauth_timestamp", Long.toString(new Date().getTime() / 1000),
+                "oauth_timestamp", Long.toString(System.currentTimeMillis() / 1000),
                 "oauth_token", StringUtils.defaultString(tokens.getTokenPublic()),
                 "oauth_version", "1.0");
         params.sort();
@@ -41,10 +40,7 @@ public class OAuth {
     }
 
     /**
-     * percent encode following http://tools.ietf.org/html/rfc5849#section-3.6
-     *
-     * @param url
-     * @return
+     * Percent encode following http://tools.ietf.org/html/rfc5849#section-3.6
      */
     static String percentEncode(@NonNull final String url) {
         return StringUtils.replace(Network.rfc3986URLEncode(url), "*", "%2A");

Use System.currentTimeMillis() instead of new Date().getTime()