/*
 * Copyright (C) 2014 The Dagger Authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package dagger.internal;

import static dagger.internal.Preconditions.checkNotNull;

import dagger.MembersInjector;
import javax.inject.Inject;

/**
 * Basic {@link MembersInjector} implementations used by the framework.
 *
 * @author Gregory Kick
 * @since 2.0
 */
public final class MembersInjectors {
  /**
   * Injects members into {@code instance} using {@code membersInjector}.  This method is a
   * convenience for cases in which you would want to chain members injection, but can't because
   * {@link MembersInjector#injectMembers} returns {@code void}.
   */
  public static <T> T injectMembers(MembersInjector<T> membersInjector, T instance) {
    membersInjector.injectMembers(instance);
    return instance;
  }

  /**
   * Returns a {@link MembersInjector} implementation that injects no members
   *
   * <p>Note that there is no verification that the type being injected does not have {@link Inject}
   * members, so care should be taken to ensure appropriate use.
   */
  @SuppressWarnings("unchecked")
  public static <T> MembersInjector<T> noOp() {
    return (MembersInjector<T>) NoOpMembersInjector.INSTANCE;
  }

  private static enum NoOpMembersInjector implements MembersInjector<Object> {
    INSTANCE;

    @Override public void injectMembers(Object instance) {
      checkInstanceNotNull(instance);
    }
  }

  public static void checkInstanceNotNull(Object instance) {
    checkNotNull(instance, "Cannot inject members into a null reference");
  }

  private MembersInjectors() {}
}

@@ -905,431 +905,8 @@
 s %7B%0A
-  /**%0A   * Injects members into %7B@code instance%7D using %7B@code membersInjector%7D.  This method is a%0A   * convenience for cases in which you would want to chain members injection, but can't because%0A   * %7B@link MembersInjector#injectMembers%7D returns %7B@code void%7D.%0A   */%0A  public static %3CT%3E T injectMembers(MembersInjector%3CT%3E membersInjector, T instance) %7B%0A    membersInjector.injectMembers(instance);%0A    return instance;%0A  %7D%0A%0A
   /*
@@ -985,16 +985,16 @@
 members%0A
+
    *%0A   
@@ -1469,116 +1469,8 @@
 %7B%0A  
-    checkInstanceNotNull(instance);%0A    %7D%0A  %7D%0A%0A  public static void checkInstanceNotNull(Object instance) %7B%0A
     
@@ -1540,16 +1540,22 @@
 ence%22);%0A
+    %7D%0A
   %7D%0A%0A  p

Remove unnecessary MembersInjectors.injectMembers method