Search in sources :

Example 71 with Override

use of java.lang.Override in project wire by square.

the class RedactedRepeated method newBuilder.

@Override
public Builder newBuilder() {
    Builder builder = new Builder();
    builder.a = Internal.copyOf("a", a);
    builder.b = Internal.copyOf("b", b);
    builder.addUnknownFields(unknownFields());
    return builder;
}
Also used : StringBuilder(java.lang.StringBuilder) Override(java.lang.Override)

Example 72 with Override

use of java.lang.Override in project wire by square.

the class RedactedRequired method newBuilder.

@Override
public Builder newBuilder() {
    Builder builder = new Builder();
    builder.a = a;
    builder.addUnknownFields(unknownFields());
    return builder;
}
Also used : StringBuilder(java.lang.StringBuilder) Override(java.lang.Override)

Example 73 with Override

use of java.lang.Override in project wire by square.

the class C method newBuilder.

@Override
public Builder newBuilder() {
    Builder builder = new Builder();
    builder.i = i;
    builder.addUnknownFields(unknownFields());
    return builder;
}
Also used : StringBuilder(java.lang.StringBuilder) Override(java.lang.Override)

Example 74 with Override

use of java.lang.Override in project facebook-android-sdk by facebook.

the class BatchRequestTests method testBatchOnProgressCallbackIsCalled.

@LargeTest
public void testBatchOnProgressCallbackIsCalled() {
    final AtomicInteger count = new AtomicInteger();
    final AccessToken accessToken = getAccessTokenForSharedUser();
    String appId = getApplicationId();
    GraphRequest.setDefaultBatchApplicationId(appId);
    GraphRequest request1 = GraphRequest.newGraphPathRequest(accessToken, "4", null);
    assertNotNull(request1);
    GraphRequest request2 = GraphRequest.newGraphPathRequest(accessToken, "4", null);
    assertNotNull(request2);
    GraphRequestBatch batch = new GraphRequestBatch(request1, request2);
    batch.addCallback(new GraphRequestBatch.OnProgressCallback() {

        @Override
        public void onBatchCompleted(GraphRequestBatch batch) {
        }

        @Override
        public void onBatchProgress(GraphRequestBatch batch, long current, long max) {
            count.incrementAndGet();
        }
    });
    batch.executeAndWait();
    assertEquals(1, count.get());
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Override(java.lang.Override) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 75 with Override

use of java.lang.Override in project reactive-streams-jvm by reactive-streams.

the class PublisherVerification method optional_spec104_mustSignalOnErrorWhenFails.

// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.4
@Override
@Test
public void optional_spec104_mustSignalOnErrorWhenFails() throws Throwable {
    try {
        whenHasErrorPublisherTest(new PublisherTestRun<T>() {

            @Override
            public void run(final Publisher<T> pub) throws InterruptedException {
                final Latch onErrorlatch = new Latch(env);
                final Latch onSubscribeLatch = new Latch(env);
                pub.subscribe(new TestEnvironment.TestSubscriber<T>(env) {

                    @Override
                    public void onSubscribe(Subscription subs) {
                        onSubscribeLatch.assertOpen("Only one onSubscribe call expected");
                        onSubscribeLatch.close();
                    }

                    @Override
                    public void onError(Throwable cause) {
                        onSubscribeLatch.assertClosed("onSubscribe should be called prior to onError always");
                        onErrorlatch.assertOpen(String.format("Error-state Publisher %s called `onError` twice on new Subscriber", pub));
                        onErrorlatch.close();
                    }
                });
                onSubscribeLatch.expectClose("Should have received onSubscribe");
                onErrorlatch.expectClose(String.format("Error-state Publisher %s did not call `onError` on new Subscriber", pub));
                env.verifyNoAsyncErrors();
            }
        });
    } catch (SkipException se) {
        throw se;
    } catch (Throwable ex) {
        // which was wrong of him - he should have signalled on error using onError
        throw new RuntimeException(String.format("Publisher threw exception (%s) instead of signalling error via onError!", ex.getMessage()), ex);
    }
}
Also used : Latch(org.reactivestreams.tck.TestEnvironment.Latch) SkipException(org.testng.SkipException) Subscription(org.reactivestreams.Subscription) Override(java.lang.Override) Test(org.testng.annotations.Test) Override(java.lang.Override)

Aggregations

Override (java.lang.Override)177 StringBuilder (java.lang.StringBuilder)83 String (java.lang.String)36 NonNull (android.support.annotation.NonNull)24 ContentValues (android.content.ContentValues)12 ArrayList (java.util.ArrayList)11 View (android.view.View)10 Integer (java.lang.Integer)9 Long (java.lang.Long)9 HashMap (java.util.HashMap)9 Boolean (java.lang.Boolean)8 Double (java.lang.Double)8 Float (java.lang.Float)8 Short (java.lang.Short)8 Bitmap (android.graphics.Bitmap)5 Canvas (android.graphics.Canvas)5 Handler (android.os.Handler)5 HandlerThread (android.os.HandlerThread)5 SmallTest (android.test.suitebuilder.annotation.SmallTest)5 Map (java.util.Map)5