Skip to content

Violation of the LSP principle #20

@carana08

Description

@carana08

Liskov Substitution Principle
In this class, the principle is violated:

package org.orienteer.oposter.ok;
import com.github.scribejava.apis.OdnoklassnikiApi;
import com.github.scribejava.apis.odnoklassniki.OdnoklassnikiOAuthService;
import com.github.scribejava.core.httpclient.HttpClient;
import com.github.scribejava.core.httpclient.HttpClientConfig;
/**
* Temporal solution while https://github.com/scribejava/scribejava/pull/998 is awaiting to be merged
*/
public class FixedOdnoklassnikiApi extends OdnoklassnikiApi {
private static class InstanceHolder {
private static final FixedOdnoklassnikiApi INSTANCE = new FixedOdnoklassnikiApi();
}
public static FixedOdnoklassnikiApi instance() {
return InstanceHolder.INSTANCE;
}
@Override
public OdnoklassnikiOAuthService createService(String apiKey, String apiSecret, String callback,
String defaultScope, String responseType, String userAgent, HttpClientConfig httpClientConfig,
HttpClient httpClient) {
return new FixedOdnoklassnikiOAuthService(this, apiKey, apiSecret, callback, defaultScope, responseType, userAgent,
httpClientConfig, httpClient);
}
}

Maybe it could be solved like this
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions