mirror of
https://github.com/square/okhttp.git
synced 2025-11-24 18:41:06 +03:00
add @overide for subclass override method
This commit is contained in:
@@ -30,38 +30,47 @@ public final class FakeSSLSession implements SSLSession {
|
|||||||
this.certificates = certificates;
|
this.certificates = certificates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getApplicationBufferSize() {
|
public int getApplicationBufferSize() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getCipherSuite() {
|
public String getCipherSuite() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getCreationTime() {
|
public long getCreationTime() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte[] getId() {
|
public byte[] getId() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getLastAccessedTime() {
|
public long getLastAccessedTime() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Certificate[] getLocalCertificates() {
|
public Certificate[] getLocalCertificates() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Principal getLocalPrincipal() {
|
public Principal getLocalPrincipal() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getPacketBufferSize() {
|
public int getPacketBufferSize() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
|
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
|
||||||
if (certificates.length == 0) {
|
if (certificates.length == 0) {
|
||||||
throw new SSLPeerUnverifiedException("peer not authenticated");
|
throw new SSLPeerUnverifiedException("peer not authenticated");
|
||||||
@@ -70,50 +79,62 @@ public final class FakeSSLSession implements SSLSession {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
|
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getPeerHost() {
|
public String getPeerHost() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getPeerPort() {
|
public int getPeerPort() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
|
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getProtocol() {
|
public String getProtocol() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public SSLSessionContext getSessionContext() {
|
public SSLSessionContext getSessionContext() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void putValue(String s, Object obj) {
|
public void putValue(String s, Object obj) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeValue(String s) {
|
public void removeValue(String s) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getValue(String s) {
|
public Object getValue(String s) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getValueNames() {
|
public String[] getValueNames() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void invalidate() {
|
public void invalidate() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class OkHttpClientTestRule implements TestRule {
|
|||||||
|
|
||||||
private Statement statement(final Statement base) {
|
private Statement statement(final Statement base) {
|
||||||
return new Statement() {
|
return new Statement() {
|
||||||
|
@Override
|
||||||
public void evaluate() throws Throwable {
|
public void evaluate() throws Throwable {
|
||||||
try {
|
try {
|
||||||
base.evaluate();
|
base.evaluate();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import javax.net.ssl.SSLSession;
|
|||||||
public final class RecordingHostnameVerifier implements HostnameVerifier {
|
public final class RecordingHostnameVerifier implements HostnameVerifier {
|
||||||
public final List<String> calls = new ArrayList<>();
|
public final List<String> calls = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean verify(String hostname, SSLSession session) {
|
public boolean verify(String hostname, SSLSession session) {
|
||||||
calls.add("verify " + hostname);
|
calls.add("verify " + hostname);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ public final class DiskLruCache implements Closeable, Flushable {
|
|||||||
/** Used to run 'cleanupRunnable' for journal rebuilds. */
|
/** Used to run 'cleanupRunnable' for journal rebuilds. */
|
||||||
private final Executor executor;
|
private final Executor executor;
|
||||||
private final Runnable cleanupRunnable = new Runnable() {
|
private final Runnable cleanupRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
synchronized (DiskLruCache.this) {
|
synchronized (DiskLruCache.this) {
|
||||||
if (!initialized | closed) {
|
if (!initialized | closed) {
|
||||||
@@ -814,6 +815,7 @@ public final class DiskLruCache implements Closeable, Flushable {
|
|||||||
return lengths[index];
|
return lengths[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
for (Source in : sources) {
|
for (Source in : sources) {
|
||||||
Util.closeQuietly(in);
|
Util.closeQuietly(in);
|
||||||
|
|||||||
Reference in New Issue
Block a user