Ignore:
Timestamp:
2013-11-05T01:53:15+01:00 (10 years ago)
Author:
Don-vip
Message:

Sonar/Findbugs - fix of recent violations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java

    r6362 r6365  
    1111/**
    1212 * This is the default authenticator used in JOSM. It delegates lookup of credentials
    13  * for the OSM API and an optional proxy server to the currently configured
    14  * {@link CredentialsManager}.
    15  *
     13 * for the OSM API and an optional proxy server to the currently configured {@link CredentialsManager}.
     14 * @since 2641
    1615 */
    1716public final class DefaultAuthenticator extends Authenticator {
    1817    private static DefaultAuthenticator instance;
    1918
     19    /**
     20     * Returns the unique instance
     21     * @return The unique instance
     22     */
    2023    public static DefaultAuthenticator getInstance() {
    2124        return instance;
    2225    }
    2326
     27    /**
     28     * Creates the unique instance
     29     */
    2430    public static void createInstance() {
    2531        instance = new DefaultAuthenticator();
     
    3339
    3440    /**
    35      * Called by the Java http stack when either the OSM API server or a proxy requires
    36      * authentication.
    37      *
     41     * Called by the Java HTTP stack when either the OSM API server or a proxy requires authentication.
    3842     */
    39     @Override protected PasswordAuthentication getPasswordAuthentication() {
     43    @Override
     44    protected PasswordAuthentication getPasswordAuthentication() {
    4045        if (!enabled)
    4146            return null;
    4247        try {
    43             if (getRequestorType().equals(Authenticator.RequestorType.SERVER)) {
     48            if (getRequestorType().equals(Authenticator.RequestorType.SERVER) && OsmApi.isUsingOAuth()) {
    4449                // if we are working with OAuth we don't prompt for a password
    45                 if (OsmApi.isUsingOAuth())
    46                     return null;
     50                return null;
    4751            }
    4852            boolean tried = credentialsTried.get(getRequestorType()) != null;
Note: See TracChangeset for help on using the changeset viewer.