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

Fix a few nullability and other minor warnings #187

Merged
merged 8 commits into from
Mar 22, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ViewScopeProvider implements LifecycleScopeProvider<ViewLifecycleEv
* @param view the view to scope for
* @return a {@link LifecycleScopeProvider} against this view.
*/
public static LifecycleScopeProvider from(View view) {
public static LifecycleScopeProvider<ViewLifecycleEvent> from(View view) {
if (view == null) {
throw new NullPointerException("view == null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ static final class AutoDisposeParallelFlowable<T> extends ParallelFlowable<T> {
return;
}

Subscriber<? super T>[] newSubscribers = new Subscriber[subscribers.length];
@SuppressWarnings("unchecked") Subscriber<? super T>[] newSubscribers
= new Subscriber[subscribers.length];
for (int i = 0; i < subscribers.length; i++) {
AutoDisposingSubscriberImpl<? super T> subscriber =
new AutoDisposingSubscriberImpl<>(scope, subscribers[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public enum ActivityEvent {
return lifecycleEvents.getValue();
}

@Override protected void onCreate(Bundle savedInstanceState) {
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleEvents.onNext(ActivityEvent.CREATE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public enum FragmentEvent {
lifecycleEvents.onNext(FragmentEvent.ATTACH);
}

@Override public void onCreate(Bundle savedInstanceState) {
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lifecycleEvents.onNext(FragmentEvent.CREATE);
}

@Override public void onViewCreated(View view, Bundle savedInstanceState) {
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
lifecycleEvents.onNext(FragmentEvent.CREATE_VIEW);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public boolean matches(ExpressionTree tree, VisitorState state) {
private static Matcher<MethodInvocationTree> matcher(List<String> classesWithLifecycle) {
return (Matcher<MethodInvocationTree>) (tree, state) -> {

boolean matchFound = false;
ExpressionTree methodSelectTree = tree.getMethodSelect();

// MemberSelectTree is used only for member access expression.
Expand All @@ -164,7 +163,7 @@ private static Matcher<MethodInvocationTree> matcher(List<String> classesWithLif
return false;
}

matchFound = SUBSCRIBE_MATCHERS
boolean matchFound = SUBSCRIBE_MATCHERS
.stream()
.map(methodNameMatcher -> methodNameMatcher.matches(tree, state))
.filter(Boolean::booleanValue) // Filtering the method invocation with name subscribe
Expand Down