Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected all Java interfaces declarations #2807

Merged
merged 1 commit into from
Mar 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public final static <T> Observable<T> create(OnSubscribe<T> f) {
/**
* Invoked when Obserable.subscribe is called.
*/
public static interface OnSubscribe<T> extends Action1<Subscriber<? super T>> {
public interface OnSubscribe<T> extends Action1<Subscriber<? super T>> {
// cover for generics insanity
}

Expand Down Expand Up @@ -191,7 +191,7 @@ public <R> Observable<R> compose(Transformer<? super T, ? extends R> transformer
* Transformer function used by {@link #compose}.
* @warn more complete description needed
*/
public static interface Transformer<T, R> extends Func1<Observable<T>, Observable<R>> {
public interface Transformer<T, R> extends Func1<Observable<T>, Observable<R>> {
// cover for generics insanity
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/rx/Observer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface Observer<T> {
* <p>
* The {@link Observable} will not call this method if it calls {@link #onError}.
*/
public abstract void onCompleted();
void onCompleted();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. E.g., RxScala has a Scala Observer wrapper that calls these methods. Removing public abstract will break them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both modifiers are implicit and redundant. Run javap on the class file and you'll see both are still present.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Never noticed they are public by default...


/**
* Notifies the Observer that the {@link Observable} has experienced an error condition.
Expand All @@ -45,7 +45,7 @@ public interface Observer<T> {
* @param e
* the exception encountered by the Observable
*/
public abstract void onError(Throwable e);
void onError(Throwable e);

/**
* Provides the Observer with a new item to observe.
Expand All @@ -58,6 +58,6 @@ public interface Observer<T> {
* @param t
* the item emitted by the Observable
*/
public abstract void onNext(T t);
void onNext(T t);

}
2 changes: 1 addition & 1 deletion src/main/java/rx/Producer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public interface Producer {
* @param n the maximum number of items you want this Producer to produce, or {@code Long.MAX_VALUE} if you
* want the Producer to produce items at its own pace
*/
public void request(long n);
void request(long n);

}
4 changes: 2 additions & 2 deletions src/main/java/rx/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public interface Subscription {
* This allows unregistering an {@link Subscriber} before it has finished receiving all events (i.e. before
* onCompleted is called).
*/
public void unsubscribe();
void unsubscribe();

/**
* Indicates whether this {@code Subscription} is currently unsubscribed.
*
* @return {@code true} if this {@code Subscription} is currently unsubscribed, {@code false} otherwise
*/
public boolean isUnsubscribed();
boolean isUnsubscribed();

}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Action0.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* A zero-argument action.
*/
public interface Action0 extends Action {
public void call();
void call();
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Action1.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* A one-argument action.
*/
public interface Action1<T1> extends Action {
public void call(T1 t1);
void call(T1 t1);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Action2.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* A two-argument action.
*/
public interface Action2<T1, T2> extends Action {
public void call(T1 t1, T2 t2);
void call(T1 t1, T2 t2);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Action3.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* A three-argument action.
*/
public interface Action3<T1, T2, T3> extends Action {
public void call(T1 t1, T2 t2, T3 t3);
void call(T1 t1, T2 t2, T3 t3);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func0.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
*/
public interface Func0<R> extends Function, Callable<R> {
@Override
public R call();
R call();
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func1.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with one argument.
*/
public interface Func1<T1, R> extends Function {
public R call(T1 t1);
R call(T1 t1);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func2.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with two arguments.
*/
public interface Func2<T1, T2, R> extends Function {
public R call(T1 t1, T2 t2);
R call(T1 t1, T2 t2);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func3.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with three arguments.
*/
public interface Func3<T1, T2, T3, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3);
R call(T1 t1, T2 t2, T3 t3);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func4.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with four arguments.
*/
public interface Func4<T1, T2, T3, T4, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3, T4 t4);
R call(T1 t1, T2 t2, T3 t3, T4 t4);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func5.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with five arguments.
*/
public interface Func5<T1, T2, T3, T4, T5, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func6.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with six arguments.
*/
public interface Func6<T1, T2, T3, T4, T5, T6, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6);
R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func7.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with seven arguments.
*/
public interface Func7<T1, T2, T3, T4, T5, T6, T7, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7);
R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func8.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with eight arguments.
*/
public interface Func8<T1, T2, T3, T4, T5, T6, T7, T8, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8);
R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/Func9.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a function with nine arguments.
*/
public interface Func9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> extends Function {
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9);
R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9);
}
2 changes: 1 addition & 1 deletion src/main/java/rx/functions/FuncN.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
* Represents a vector-argument function.
*/
public interface FuncN<R> extends Function {
public R call(Object... args);
R call(Object... args);
}
4 changes: 2 additions & 2 deletions src/main/java/rx/internal/operators/OperatorTimeoutBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OperatorTimeoutBase<T> implements Operator<T, T> {
*
* @param <T>
*/
/* package-private */static interface FirstTimeoutStub<T> extends
/* package-private */interface FirstTimeoutStub<T> extends
Func3<TimeoutSubscriber<T>, Long, Scheduler.Worker, Subscription> {
}

Expand All @@ -45,7 +45,7 @@ class OperatorTimeoutBase<T> implements Operator<T, T> {
*
* @param <T>
*/
/* package-private */static interface TimeoutStub<T> extends
/* package-private */interface TimeoutStub<T> extends
Func4<TimeoutSubscriber<T>, Long, T, Scheduler.Worker, Subscription> {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

public class OnSubscribeUsingTest {

private static interface Resource {
private interface Resource {
public String getTextFromWeb();

public void dispose();
Expand Down