@@ -0,0 +1,2636 @@
+/*%0A * Copyright 2013 Google Inc. All rights reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.errorprone.refaster;%0A%0Aimport com.google.auto.value.AutoValue;%0Aimport com.google.common.collect.ImmutableList;%0A%0Aimport com.sun.source.tree.ModifiersTree;%0Aimport com.sun.source.tree.TreeVisitor;%0Aimport com.sun.tools.javac.code.Flags;%0Aimport com.sun.tools.javac.tree.JCTree;%0Aimport com.sun.tools.javac.tree.JCTree.JCAnnotation;%0Aimport com.sun.tools.javac.tree.JCTree.JCModifiers;%0Aimport com.sun.tools.javac.util.List;%0A%0Aimport java.util.Set;%0A%0Aimport javax.annotation.Nullable;%0Aimport javax.lang.model.element.Modifier;%0A%0A%0A/**%0A * %7B@code UTree%7D representation of a %7B@code ModifiersTree%7D.%0A * %0A * @author lowasser@google.com (Louis Wasserman)%0A */%0A@AutoValue%0Apublic abstract class UModifiers implements UTree%3CJCModifiers%3E, ModifiersTree %7B%0A  public static UModifiers create(long flagBits, UAnnotation... annotations) %7B%0A    return create(flagBits, ImmutableList.copyOf(annotations));%0A  %7D%0A  %0A  public static UModifiers create(long flagBits, Iterable%3C? extends UAnnotation%3E annotations) %7B%0A    return new AutoValue_UModifiers(flagBits, ImmutableList.copyOf(annotations));%0A  %7D%0A  %0A  abstract long flagBits();%0A%0A  @Override%0A  public abstract ImmutableList%3CUAnnotation%3E getAnnotations();%0A  %0A  @Override%0A  public JCModifiers inline(Inliner inliner) throws CouldNotResolveImportException %7B%0A    return inliner.maker().Modifiers(%0A        flagBits(), %0A        List.convert(JCAnnotation.class, inliner.inlineList(getAnnotations())));%0A  %7D%0A%0A  @Override%0A  @Nullable%0A  public Unifier unify(JCTree target, @Nullable Unifier unifier) %7B%0A    if (unifier != null && target instanceof JCModifiers) %7B%0A      JCModifiers modifiers = (JCModifiers) target;%0A      return (flagBits() == modifiers.flags) ? unifier : null; %0A    %7D%0A    return null;%0A  %7D%0A%0A  @Override%0A  public %3CR, D%3E R accept(TreeVisitor%3CR, D%3E visitor, D data) %7B%0A    return visitor.visitModifiers(this, data);%0A  %7D%0A%0A  @Override%0A  public Kind getKind() %7B%0A    return Kind.MODIFIERS;%0A  %7D%0A%0A  @Override%0A  public Set%3CModifier%3E getFlags() %7B%0A    return Flags.asModifierSet(flagBits());%0A  %7D%0A%7D%0A

Move UModifiers to third_party Refaster ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=72185094