Search in sources :

Example 81 with Nullable

use of javax.annotation.Nullable in project stetho by facebook.

the class DialogDescriptor method getViewAndBoundsForHighlighting.

@Nullable
@Override
public View getViewAndBoundsForHighlighting(Dialog element, Rect bounds) {
    final Descriptor.Host host = getHost();
    Window window = null;
    HighlightableDescriptor descriptor = null;
    if (host instanceof AndroidDescriptorHost) {
        window = element.getWindow();
        descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(window);
    }
    return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(window, bounds);
}
Also used : Window(android.view.Window) AbstractChainedDescriptor(com.facebook.stetho.inspector.elements.AbstractChainedDescriptor) Descriptor(com.facebook.stetho.inspector.elements.Descriptor) Nullable(javax.annotation.Nullable)

Example 82 with Nullable

use of javax.annotation.Nullable in project stetho by facebook.

the class DialogDescriptor method getElementToHighlightAtPosition.

@Nullable
@Override
public Object getElementToHighlightAtPosition(Dialog element, int x, int y, Rect bounds) {
    final Descriptor.Host host = getHost();
    Window window = null;
    HighlightableDescriptor descriptor = null;
    if (host instanceof AndroidDescriptorHost) {
        window = element.getWindow();
        descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(window);
    }
    return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(window, x, y, bounds);
}
Also used : Window(android.view.Window) AbstractChainedDescriptor(com.facebook.stetho.inspector.elements.AbstractChainedDescriptor) Descriptor(com.facebook.stetho.inspector.elements.Descriptor) Nullable(javax.annotation.Nullable)

Example 83 with Nullable

use of javax.annotation.Nullable in project stetho by facebook.

the class DialogFragmentDescriptor method getViewAndBoundsForHighlighting.

@Nullable
@Override
public View getViewAndBoundsForHighlighting(Object element, Rect bounds) {
    final Descriptor.Host host = getHost();
    Dialog dialog = null;
    HighlightableDescriptor descriptor = null;
    if (host instanceof AndroidDescriptorHost) {
        dialog = mAccessor.getDialog(element);
        descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(dialog);
    }
    return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(dialog, bounds);
}
Also used : Dialog(android.app.Dialog) ChainedDescriptor(com.facebook.stetho.inspector.elements.ChainedDescriptor) AbstractChainedDescriptor(com.facebook.stetho.inspector.elements.AbstractChainedDescriptor) Descriptor(com.facebook.stetho.inspector.elements.Descriptor) Nullable(javax.annotation.Nullable)

Example 84 with Nullable

use of javax.annotation.Nullable in project stetho by facebook.

the class FragmentDescriptor method getElementToHighlightAtPosition.

@Nullable
@Override
public Object getElementToHighlightAtPosition(Object element, int x, int y, Rect bounds) {
    final Descriptor.Host host = getHost();
    View view = null;
    HighlightableDescriptor descriptor = null;
    if (host instanceof AndroidDescriptorHost) {
        view = mAccessor.getView(element);
        descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(view);
    }
    return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(view, x, y, bounds);
}
Also used : AbstractChainedDescriptor(com.facebook.stetho.inspector.elements.AbstractChainedDescriptor) Descriptor(com.facebook.stetho.inspector.elements.Descriptor) View(android.view.View) Nullable(javax.annotation.Nullable)

Example 85 with Nullable

use of javax.annotation.Nullable in project error-prone by google.

the class UTypeVarIdent method defaultAction.

@Override
protected Choice<Unifier> defaultAction(Tree target, Unifier unifier) {
    JCExpression expr = (JCExpression) target;
    Type targetType = expr.type;
    if (targetType == null) {
        return Choice.none();
    }
    @Nullable TypeWithExpression boundType = unifier.getBinding(key());
    if (boundType == null) {
        unifier.putBinding(key(), expr.accept(QUALIFIED_FROM_PACKAGE, null) ? TypeWithExpression.create(targetType) : /* use the ImportPolicy to refer to this type */
        TypeWithExpression.create(targetType, expr));
        return Choice.of(unifier);
    } else if (unifier.types().isSameType(targetType, boundType.type())) {
        return Choice.of(unifier);
    }
    return Choice.none();
}
Also used : Type(com.sun.tools.javac.code.Type) JCExpression(com.sun.tools.javac.tree.JCTree.JCExpression) TypeWithExpression(com.google.errorprone.refaster.UTypeVar.TypeWithExpression) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)859 IOException (java.io.IOException)94 Map (java.util.Map)77 List (java.util.List)67 Test (org.junit.Test)62 Function (com.google.common.base.Function)60 File (java.io.File)53 ArrayList (java.util.ArrayList)52 HashMap (java.util.HashMap)47 ImmutableList (com.google.common.collect.ImmutableList)37 ItemStack (net.minecraft.item.ItemStack)35 ImmutableMap (com.google.common.collect.ImmutableMap)33 Nonnull (javax.annotation.Nonnull)31 Predicate (com.google.common.base.Predicate)29 SkyKey (com.google.devtools.build.skyframe.SkyKey)28 URL (java.net.URL)24 Collectors (java.util.stream.Collectors)24 HashSet (java.util.HashSet)22 Label (com.google.devtools.build.lib.cmdline.Label)21 Set (java.util.Set)20