text:
.class public final Lokhttp3/Headers;
.super Ljava/lang/Object;
.source "Headers.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lokhttp3/Headers$Builder;
    }
.end annotation

# instance fields
.field private final namesAndValues:[Ljava/lang/String;

# direct methods
.method constructor <init>(Lokhttp3/Headers$Builder;)V
    .locals 2
    .param p1, "builder"    # Lokhttp3/Headers$Builder;

    .prologue
    .line 53
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 54
    iget-object v0, p1, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;

    iget-object v1, p1, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    new-array v1, v1, [Ljava/lang/String;

    invoke-interface {v0, v1}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Ljava/lang/String;

    iput-object v0, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    .line 55
    return-void
.end method

.method private constructor <init>([Ljava/lang/String;)V
    .locals 0
    .param p1, "namesAndValues"    # [Ljava/lang/String;

    .prologue
    .line 57
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 58
    iput-object p1, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    .line 59
    return-void
.end method

.method private static get([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .param p0, "namesAndValues"    # [Ljava/lang/String;
    .param p1, "name"    # Ljava/lang/String;

    .prologue
    .line 177
    array-length v1, p0

    add-int/lit8 v0, v1, -0x2

    .local v0, "i":I
    :goto_0
    if-ltz v0, :cond_1

    .line 178
    aget-object v1, p0, v0

    invoke-virtual {p1, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 179
    add-int/lit8 v1, v0, 0x1

    aget-object v1, p0, v1

    .line 182
    :goto_1
    return-object v1

    .line 177
    :cond_0
    add-int/lit8 v0, v0, -0x2

    goto :goto_0

    .line 182
    :cond_1
    const/4 v1, 0x0

    goto :goto_1
.end method

.method public static of(Ljava/util/Map;)Lokhttp3/Headers;
    .locals 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)",
            "Lokhttp3/Headers;"
        }
    .end annotation

    .prologue
    .local p0, "headers":Ljava/util/Map;, "Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    const/4 v8, 0x0

    const/4 v7, -0x1

    .line 218
    if-nez p0, :cond_0

    new-instance v5, Ljava/lang/NullPointerException;

    const-string v6, "headers == null"

    invoke-direct {v5, v6}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 221
    :cond_0
    invoke-interface {p0}, Ljava/util/Map;->size()I

    move-result v5

    mul-int/lit8 v5, v5, 0x2

    new-array v3, v5, [Ljava/lang/String;

    .line 222
    .local v3, "namesAndValues":[Ljava/lang/String;
    const/4 v1, 0x0

    .line 223
    .local v1, "i":I
    invoke-interface {p0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v5

    invoke-interface {v5}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v6

    :goto_0
    invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_5

    invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 224
    .local v0, "header":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v5

    if-eqz v5, :cond_1

    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v5

    if-nez v5, :cond_2

    .line 225
    :cond_1
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "Headers cannot be null"

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 227
    :cond_2
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    .line 228
    .local v2, "name":Ljava/lang/String;
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v4

    .line 229
    .local v4, "value":Ljava/lang/String;
    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v5

    if-eqz v5, :cond_3

    invoke-virtual {v2, v8}, Ljava/lang/String;->indexOf(I)I

    move-result v5

    if-ne v5, v7, :cond_3

    invoke-virtual {v4, v8}, Ljava/lang/String;->indexOf(I)I

    move-result v5

    if-eq v5, v7, :cond_4

    .line 230
    :cond_3
    new-instance v5, Ljava/lang/IllegalArgumentException;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    const-string v7, "Unexpected header: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ": "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 232
    :cond_4
    aput-object v2, v3, v1

    .line 233
    add-int/lit8 v5, v1, 0x1

    aput-object v4, v3, v5

    .line 234
    add-int/lit8 v1, v1, 0x2

    .line 235
    goto :goto_0

    .line 237
    .end local v0    # "header":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    .end local v2    # "name":Ljava/lang/String;
    .end local v4    # "value":Ljava/lang/String;
    :cond_5
    new-instance v5, Lokhttp3/Headers;

    invoke-direct {v5, v3}, Lokhttp3/Headers;-><init>([Ljava/lang/String;)V

    return-object v5
.end method

.method public static varargs of([Ljava/lang/String;)Lokhttp3/Headers;
    .locals 6
    .param p0, "namesAndValues"    # [Ljava/lang/String;

    .prologue
    const/4 v5, 0x0

    const/4 v4, -0x1

    .line 190
    if-nez p0, :cond_0

    new-instance v3, Ljava/lang/NullPointerException;

    const-string v4, "namesAndValues == null"

    invoke-direct {v3, v4}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 191
    :cond_0
    array-length v3, p0

    rem-int/lit8 v3, v3, 0x2

    if-eqz v3, :cond_1

    .line 192
    new-instance v3, Ljava/lang/IllegalArgumentException;

    const-string v4, "Expected alternating header names and values"

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 196
    :cond_1
    invoke-virtual {p0}, [Ljava/lang/String;->clone()Ljava/lang/Object;

    move-result-object p0

    .end local p0    # "namesAndValues":[Ljava/lang/String;
    check-cast p0, [Ljava/lang/String;

    .line 197
    .restart local p0    # "namesAndValues":[Ljava/lang/String;
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    array-length v3, p0

    if-ge v0, v3, :cond_3

    .line 198
    aget-object v3, p0, v0

    if-nez v3, :cond_2

    new-instance v3, Ljava/lang/IllegalArgumentException;

    const-string v4, "Headers cannot be null"

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 199
    :cond_2
    aget-object v3, p0, v0

    invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v3

    aput-object v3, p0, v0

    .line 197
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 203
    :cond_3
    const/4 v0, 0x0

    :goto_1
    array-length v3, p0

    if-ge v0, v3, :cond_6

    .line 204
    aget-object v1, p0, v0

    .line 205
    .local v1, "name":Ljava/lang/String;
    add-int/lit8 v3, v0, 0x1

    aget-object v2, p0, v3

    .line 206
    .local v2, "value":Ljava/lang/String;
    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v3

    if-eqz v3, :cond_4

    invoke-virtual {v1, v5}, Ljava/lang/String;->indexOf(I)I

    move-result v3

    if-ne v3, v4, :cond_4

    invoke-virtual {v2, v5}, Ljava/lang/String;->indexOf(I)I

    move-result v3

    if-eq v3, v4, :cond_5

    .line 207
    :cond_4
    new-instance v3, Ljava/lang/IllegalArgumentException;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Unexpected header: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ": "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 203
    :cond_5
    add-int/lit8 v0, v0, 0x2

    goto :goto_1

    .line 211
    .end local v1    # "name":Ljava/lang/String;
    .end local v2    # "value":Ljava/lang/String;
    :cond_6
    new-instance v3, Lokhttp3/Headers;

    invoke-direct {v3, p0}, Lokhttp3/Headers;-><init>([Ljava/lang/String;)V

    return-object v3
.end method

# virtual methods
.method public equals(Ljava/lang/Object;)Z
    .locals 2
    .param p1, "other"    # Ljava/lang/Object;
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end param

    .prologue
    .line 146
    instance-of v0, p1, Lokhttp3/Headers;

    if-eqz v0, :cond_0

    check-cast p1, Lokhttp3/Headers;

    .end local p1    # "other":Ljava/lang/Object;
    iget-object v0, p1, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    iget-object v1, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    .line 147
    invoke-static {v0, v1}, Ljava/util/Arrays;->equals([Ljava/lang/Object;[Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    .line 146
    :goto_0
    return v0

    .line 147
    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public get(Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .param p1, "name"    # Ljava/lang/String;
    .annotation runtime Ljavax/annotation/Nullable;
    .end annotation

    .prologue
    .line 63
    iget-object v0, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    invoke-static {v0, p1}, Lokhttp3/Headers;->get([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getDate(Ljava/lang/String;)Ljava/util/Date;
    .locals 2
    .param p1, "name"    # Ljava/lang/String;
    .annotation runtime Ljavax/annotation/Nullable;
    .end annotation

    .prologue
    .line 71
    invoke-virtual {p0, p1}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 72
    .local v0, "value":Ljava/lang/String;
    if-eqz v0, :cond_0

    invoke-static {v0}, Lokhttp3/internal/http/HttpDate;->parse(Ljava/lang/String;)Ljava/util/Date;

    move-result-object v1

    :goto_0
    return-object v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public hashCode()I
    .locals 1

    .prologue
    .line 151
    iget-object v0, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    invoke-static {v0}, Ljava/util/Arrays;->hashCode([Ljava/lang/Object;)I

    move-result v0

    return v0
.end method

.method public name(I)Ljava/lang/String;
    .locals 2
    .param p1, "index"    # I

    .prologue
    .line 82
    iget-object v0, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    mul-int/lit8 v1, p1, 0x2

    aget-object v0, v0, v1

    return-object v0
.end method

.method public names()Ljava/util/Set;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 92
    new-instance v1, Ljava/util/TreeSet;

    sget-object v3, Ljava/lang/String;->CASE_INSENSITIVE_ORDER:Ljava/util/Comparator;

    invoke-direct {v1, v3}, Ljava/util/TreeSet;-><init>(Ljava/util/Comparator;)V

    .line 93
    .local v1, "result":Ljava/util/TreeSet;, "Ljava/util/TreeSet<Ljava/lang/String;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    invoke-virtual {p0}, Lokhttp3/Headers;->size()I

    move-result v2

    .local v2, "size":I
    :goto_0
    if-ge v0, v2, :cond_0

    .line 94
    invoke-virtual {p0, v0}, Lokhttp3/Headers;->name(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/util/TreeSet;->add(Ljava/lang/Object;)Z

    .line 93
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 96
    :cond_0
    invoke-static {v1}, Ljava/util/Collections;->unmodifiableSet(Ljava/util/Set;)Ljava/util/Set;

    move-result-object v3

    return-object v3
.end method

.method public newBuilder()Lokhttp3/Headers$Builder;
    .locals 3

    .prologue
    .line 114
    new-instance v0, Lokhttp3/Headers$Builder;

    invoke-direct {v0}, Lokhttp3/Headers$Builder;-><init>()V

    .line 115
    .local v0, "result":Lokhttp3/Headers$Builder;
    iget-object v1, v0, Lokhttp3/Headers$Builder;->namesAndValues:Ljava/util/List;

    iget-object v2, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    invoke-static {v1, v2}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z

    .line 116
    return-object v0
.end method

.method public size()I
    .locals 1

    .prologue
    .line 77
    iget-object v0, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    array-length v0, v0

    div-int/lit8 v0, v0, 0x2

    return v0
.end method

.method public toMultimap()Ljava/util/Map;
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;>;"
        }
    .end annotation

    .prologue
    .line 163
    new-instance v2, Ljava/util/TreeMap;

    sget-object v5, Ljava/lang/String;->CASE_INSENSITIVE_ORDER:Ljava/util/Comparator;

    invoke-direct {v2, v5}, Ljava/util/TreeMap;-><init>(Ljava/util/Comparator;)V

    .line 164
    .local v2, "result":Ljava/util/Map;, "Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/String;>;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    invoke-virtual {p0}, Lokhttp3/Headers;->size()I

    move-result v3

    .local v3, "size":I
    :goto_0
    if-ge v0, v3, :cond_1

    .line 165
    invoke-virtual {p0, v0}, Lokhttp3/Headers;->name(I)Ljava/lang/String;

    move-result-object v5

    sget-object v6, Ljava/util/Locale;->US:Ljava/util/Locale;

    invoke-virtual {v5, v6}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;

    move-result-object v1

    .line 166
    .local v1, "name":Ljava/lang/String;
    invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/util/List;

    .line 167
    .local v4, "values":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    if-nez v4, :cond_0

    .line 168
    new-instance v4, Ljava/util/ArrayList;

    .end local v4    # "values":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    const/4 v5, 0x2

    invoke-direct {v4, v5}, Ljava/util/ArrayList;-><init>(I)V

    .line 169
    .restart local v4    # "values":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    invoke-interface {v2, v1, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 171
    :cond_0
    invoke-virtual {p0, v0}, Lokhttp3/Headers;->value(I)Ljava/lang/String;

    move-result-object v5

    invoke-interface {v4, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 164
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 173
    .end local v1    # "name":Ljava/lang/String;
    .end local v4    # "values":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    :cond_1
    return-object v2
.end method

.method public toString()Ljava/lang/String;
    .locals 5

    .prologue
    .line 155
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    .line 156
    .local v1, "result":Ljava/lang/StringBuilder;
    const/4 v0, 0x0

    .local v0, "i":I
    invoke-virtual {p0}, Lokhttp3/Headers;->size()I

    move-result v2

    .local v2, "size":I
    :goto_0
    if-ge v0, v2, :cond_0

    .line 157
    invoke-virtual {p0, v0}, Lokhttp3/Headers;->name(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ": "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p0, v0}, Lokhttp3/Headers;->value(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\n"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 156
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 159
    :cond_0
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    return-object v3
.end method

.method public value(I)Ljava/lang/String;
    .locals 2
    .param p1, "index"    # I

    .prologue
    .line 87
    iget-object v0, p0, Lokhttp3/Headers;->namesAndValues:[Ljava/lang/String;

    mul-int/lit8 v1, p1, 0x2

    add-int/lit8 v1, v1, 0x1

    aget-object v0, v0, v1

    return-object v0
.end method

.method public values(Ljava/lang/String;)Ljava/util/List;
    .locals 4
    .param p1, "name"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 101
    const/4 v1, 0x0

    .line 102
    .local v1, "result":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    invoke-virtual {p0}, Lokhttp3/Headers;->size()I

    move-result v2

    .local v2, "size":I
    :goto_0
    if-ge v0, v2, :cond_2

    .line 103
    invoke-virtual {p0, v0}, Lokhttp3/Headers;->name(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p1, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 104
    if-nez v1, :cond_0

    new-instance v1, Ljava/util/ArrayList;

    .end local v1    # "result":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    const/4 v3, 0x2

    invoke-direct {v1, v3}, Ljava/util/ArrayList;-><init>(I)V

    .line 105
    .restart local v1    # "result":Ljava/util/List;, "Ljava/util/List<Ljava/lang/String;>;"
    :cond_0
    invoke-virtual {p0, v0}, Lokhttp3/Headers;->value(I)Ljava/lang/String;

    move-result-object v3

    invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 102
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 108
    :cond_2
    if-eqz v1, :cond_3

    .line 109
    invoke-static {v1}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;

    move-result-object v3

    .line 108
    :goto_1
    return-object v3

    .line 110
    :cond_3
    invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;

    move-result-object v3

    goto :goto_1
.end method


text:
// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// 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.

/**
 * @fileoverview Unit tests for the keyboard shortcut service.
 */
import Mousetrap from 'mousetrap';

import { ApplicationRef } from '@angular/core';
import { async, TestBed } from '@angular/core/testing';
import { KeyboardShortcutService } from 'services/keyboard-shortcut.service';
import { KeyboardShortcutHelpModalComponent } from
  // eslint-disable-next-line max-len
  'components/keyboard-shortcut-help/keyboard-shortcut-help-modal.component';
import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { WindowRef } from 'services/contextual/window-ref.service';

class MockActiveModal {
  dismiss(): void {
    return;
  }
}
describe('Keyboard Shortcuts', () => {
  let skipButton = document.createElement('button');
  let nextButton = document.createElement('button');
  let continueButton = document.createElement('button');
  let backButton = document.createElement('button');
  let searchBar = document.createElement('input');
  let categoryBar = document.createElement('select');

  let openQuickReferenceSpy;

  let mockWindow = {
    location: {
      href: ''
    }
  };

  let windowRef: WindowRef;
  let appRef: ApplicationRef;
  let keyboardShortcutService: KeyboardShortcutService;
  let ngbModal: NgbModal;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [KeyboardShortcutHelpModalComponent],
      providers: [
        {
          provide: NgbActiveModal,
          useClass: MockActiveModal
        }
      ]
    }).compileComponents();
  }));

  beforeEach(async() => {
    ngbModal = TestBed.get(NgbModal);
    windowRef = new WindowRef();
    appRef = TestBed.get(ApplicationRef);
    keyboardShortcutService = new KeyboardShortcutService(
      windowRef,
      ngbModal,
      appRef
    );
  });

  beforeAll(() => {
    skipButton.setAttribute('class', 'oppia-skip-to-content');
    backButton.setAttribute('class', 'oppia-back-button');
    nextButton.setAttribute('class', 'oppia-next-button');
    continueButton.setAttribute('class', 'oppia-learner-confirm-button');
    searchBar.setAttribute('class', 'oppia-search-bar-text-input');
    categoryBar.setAttribute('class', 'oppia-search-bar-dropdown-toggle');
    document.body.append(skipButton);
    document.body.append(continueButton);
    document.body.append(backButton);
    document.body.append(searchBar);
    document.body.append(categoryBar);
  });

  it('should navigate to the corresponding page' +
    ' when the navigation key is pressed', () => {
    spyOnProperty(windowRef, 'nativeWindow').and.returnValue(mockWindow);
    keyboardShortcutService.bindNavigationShortcuts();

    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');

    Mousetrap.trigger('ctrl+0');
    expect(windowRef.nativeWindow.location.href).toEqual('/get-started');
    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');

    Mousetrap.trigger('ctrl+1');
    expect(windowRef.nativeWindow.location.href).toEqual('/community-library');
    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');

    Mousetrap.trigger('ctrl+2');
    expect(windowRef.nativeWindow.location.href).toEqual('/learner-dashboard');
    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');

    Mousetrap.trigger('ctrl+3');
    expect(windowRef.nativeWindow.location.href).toEqual('/creator-dashboard');
    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');

    Mousetrap.trigger('ctrl+4');
    expect(windowRef.nativeWindow.location.href).toEqual('/about');
    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');

    Mousetrap.trigger('ctrl+5');
    expect(windowRef.nativeWindow.location.href).toEqual('/preferences');
    mockWindow.location.href = '';
    expect(windowRef.nativeWindow.location.href).toBe('');
  });

  it('should move the focus to the corresponding element' +
    ' when the action key is pressed', () => {
    openQuickReferenceSpy = spyOn(
      keyboardShortcutService, 'openQuickReference').and.callThrough();
    spyOn(ngbModal, 'open');
    spyOn(ngbModal, 'dismissAll');
    spyOn(appRef, 'tick');

    keyboardShortcutService.bindLibraryPageShortcuts();

    Mousetrap.trigger('s');
    expect(skipButton.isEqualNode(document.activeElement));

    Mousetrap.trigger('/');
    expect(searchBar.isEqualNode(document.activeElement));

    Mousetrap.trigger('c');
    expect(categoryBar.isEqualNode(document.activeElement));

    Mousetrap.trigger('?');
    expect(openQuickReferenceSpy).toHaveBeenCalled();

    keyboardShortcutService.bindExplorationPlayerShortcuts();

    Mousetrap.trigger('s');
    expect(skipButton.isEqualNode(document.activeElement));

    Mousetrap.trigger('k');
    expect(backButton.isEqualNode(document.activeElement));

    Mousetrap.trigger('j');
    expect(continueButton.isEqualNode(document.activeElement));

    document.body.append(nextButton);
    Mousetrap.trigger('j');
    expect(nextButton.isEqualNode(document.activeElement));

    Mousetrap.trigger('?');
    expect(openQuickReferenceSpy).toHaveBeenCalled();
  });
});

redpajama_set_name: RedPajamaGithub


text:
//---------------------------------------------------------------------
// <copyright file="StreamHelpers.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Test.Taupo.Astoria.Common
{
    using System.IO;
    using Microsoft.Test.Taupo.Astoria.Contracts.EntityModel;
    using Microsoft.Test.Taupo.Astoria.Contracts.Http;
    using Microsoft.Test.Taupo.Common;
    using Microsoft.Test.Taupo.Contracts;
    using Microsoft.Test.Taupo.Contracts.Wrappers;

    /// <summary>
    /// Collection of helpful utility functions for working with streams.
    /// </summary>
    public static class StreamHelpers
    {
        /// <summary>Copies content from one stream into another.</summary>
        /// <param name="source">Stream to read from.</param>
        /// <param name="destination">Stream to write to.</param>
        /// <remarks>The destination stream will have it's position reset to the beginning.</remarks>
        public static void CopyStream(Stream source, Stream destination)
        {
            if (source == null)
            {
                throw new TaupoArgumentNullException("source stream");
            }

            if (destination == null)
            {
                throw new TaupoArgumentNullException("destination stream");
            }

            source.CopyTo(destination);
            destination.Position = 0;
        }

        /// <summary>
        /// Compare the content of two streams.
        /// </summary>
        /// <param name="left">The stream 1</param>
        /// <param name="right">The stream 2</param>
        /// <returns>true if both streams are identical.</returns>
        public static bool CompareStream(Stream left, Stream right)
        {
            if (left == null || !left.CanRead)
            {
                throw new TaupoArgumentException("Must be a valid readable stream - left");
            }

            if (right == null || !right.CanRead)
            {
                throw new TaupoArgumentException("Must be a valid readable stream - right");
            }

            if (left == right)
            {
                return true;
            }

            int bufferSize = 64 * 1024;
            byte[] leftBuffer = new byte[bufferSize];
            byte[] rightBuffer = new byte[bufferSize];
            int leftReadCount = 0;
            int rightReadCount = 0;

            do
            {
                leftReadCount = FillBuffer(leftBuffer, left);
                rightReadCount = FillBuffer(rightBuffer, right);

                if (leftReadCount != rightReadCount)
                {
                    return false;
                }

                for (int idx = 0; idx < leftReadCount; idx++)
                {
                    if (leftBuffer[idx] != rightBuffer[idx])
                    {
                        return false;
                    }
                }
            }
            while (leftReadCount > 0);

            return true;
        }

        /// <summary>
        /// Set stream associated with entity in V1 stream support style.
        /// </summary>
        /// <param name="objectServices">IEntityModelObjectServices to get entity object adapter</param>
        /// <param name="wrappedEntity">entity to set stream</param>
        /// <param name="clientMediaEntryAnnotation">ClientMediaEntryAnnotation of the entity</param>
        /// <param name="streamValue">stream bytes</param>
        public static void SetSaveV1Stream(IEntityModelObjectServices objectServices, WrappedObject wrappedEntity, ClientMediaEntryAnnotation clientMediaEntryAnnotation, byte[] streamValue)
        {
            var objectAdapter = objectServices.GetObjectAdapter(wrappedEntity.Product.GetType().FullName);
            objectAdapter.SetMemberValue(wrappedEntity.Product, clientMediaEntryAnnotation.MediaEntryName, streamValue);
            objectAdapter.SetMemberValue(wrappedEntity.Product, clientMediaEntryAnnotation.MimeTypePropertyName, MimeTypes.TextPlain);
        }

        private static int FillBuffer(byte[] buffer, Stream stream)
        {
            int bufferSize = buffer.Length;
            int total = 0;
            int count = 0;

            do
            {
                count = stream.Read(buffer, total, bufferSize - total);
                total += count;
            }
            while (count > 0 && total < bufferSize);

            return total;
        }
    }
}


text:
package sc2toolkit.app.toolkit.overwolf;

import java.util.concurrent.CompletionStage;
import sc2toolkit.game.client.model.Player;

/**
 * The interface to the SC2 tool kit Overwolf application.
 */
public interface OverwolfAppConnector {

  /**
   * Sends game start information.
   *
   * @param opponent    The opponent.
   * @return A {@link CompletionStage} for the operation result.
   */
  CompletionStage<Void> startGame(Player opponent); // + BuildOrder

  /**
   * Sends game time information.
   *
   * @param displayTime The display time.
   * @return A {@link CompletionStage} for the operation result.
   */
  CompletionStage<Void> updateGameTime(double displayTime);

  /**
   * Sends game end information.
   *
   * @return A {@link CompletionStage} for the operation result.
   */
  CompletionStage<Void> endGame();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>writeDataToFile</title>
<link href="styles.css" type="text/css" rel="stylesheet">

 writeDataToFile

<fieldset class="taskDescription">
<legend>Description</legend>

Java type: org.apache.ddlutils.task.WriteDataToFileCommand

Reads the data currently in the table in the live database (as specified by the
 enclosing task), and writes it as XML to a file.

</fieldset>
<fieldset class="taskParameters">
<legend>Parameters</legend>

	  outputfile : File
   (required)

	Specifies the file to write the data XML to.

	  determineschema : boolean

	Specifies whether DdlUtils should try to find the schema of the tables when reading data
 from a live database.

	  encoding : String

	Specifies the encoding of the XML file.

        The default encoding is UTF-8.

	  failonerror : boolean

	Specifies whether the execution shall stop if an error has occurred during the task runs.

        By default execution will be stopped when an error is encountered.

</fieldset>
<fieldset class="taskNestedElements">
<legend>Nested elements</legend>
    </fieldset>

©2005-2007 Apache Software Foundation


text:
package bolianeducation.bolianchild.view.mall;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import bolianeducation.bolianchild.KeyList;
import bolianeducation.bolianchild.R;
import bolianeducation.bolianchild.custom.FlowLayout;
import bolianeducation.bolianchild.test.TestData;
import bolianeducation.bolianchild.view.BaseActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static bolianeducation.bolianchild.KeyList.IKEY_KEYWORD;

/**
 * Created by admin on 2017/8/23.
 */

public class MallSearchActivity extends BaseActivity {
    @BindView(R.id.tv_back)
    TextView tvBack;
    @BindView(R.id.et_search)
    EditText etSearch;
    @BindView(R.id.iv_right)
    ImageView ivRight;
    @BindView(R.id.tv_right_title)
    TextView tvRightTitle;
    @BindView(R.id.fl_hot)
    FlowLayout flHot;
    @BindView(R.id.fl_recommend)
    FlowLayout flRecommend;
    @BindView(R.id.tv_clear)
    TextView tvClear;
    @BindView(R.id.fl_history)
    FlowLayout flHistory;

    List<String> hots = new ArrayList<>();
    List<String> recommends = new ArrayList<>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mall_search);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
        //搜索监听
        etSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_SEARCH) {
                    String keyWord = etSearch.getText().toString().trim();
                    if (!TextUtils.isEmpty(keyWord)) {
                        Intent intent = new Intent(MallSearchActivity.this, MallSearchResultActivity.class);
                        intent.putExtra(IKEY_KEYWORD, keyWord);
                        startActivity(intent);
                        //保存历史记录(去重)
                        List<String> historys = preferences.getPrefStringList(KeyList.PKEY_SEARCH_HISTORY);
                        if (historys == null) {
                            historys = new ArrayList<>();
                        }
                        if (!historys.contains(keyWord)) {
                            historys.add(keyWord);
                            preferences.setPrefStringList(KeyList.PKEY_SEARCH_HISTORY, historys);
                        }
                        return true;
                    }
                }
                return false;
            }
        });

        //热门商品
        hots.addAll(TestData.getListString());
        initFlowlayout(flHot, hots);

        //猜你想要
        recommends.addAll(TestData.getListString());
        initFlowlayout(flRecommend, recommends);

        //最近查找
        initFlowlayout(flHistory, preferences.getPrefStringList(KeyList.PKEY_SEARCH_HISTORY));
    }

    private void initFlowlayout(FlowLayout flowLayout, List<String> data) {
        flowLayout.removeAllViews();
        if (data != null) {
            for (int i = 0; i < data.size(); i++) {
                String label = data.get(i);
                if (!TextUtils.isEmpty(label)) {
                    final TextView textView = new TextView(context);
                    textView.setAlpha(0.7f);
                    textView.setTextColor(context.getResources().getColor(android.R.color.black));
                    textView.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.general_bg_grayc));
                    textView.setPadding(24, 8, 24, 8);
                    ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
                    layoutParams.setMargins(24, 0, 24, 12);
                    textView.setLayoutParams(layoutParams);
                    textView.setText(label);
                    flowLayout.addView(textView);
                    //item点击事件
                    textView.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            etSearch.setText(textView.getText().toString());
                        }
                    });
                }
            }
        }
    }

    @OnClick({R.id.tv_back, R.id.iv_right, R.id.tv_clear})
    void onClick(View v) {
        switch (v.getId()) {
            //返回
            case R.id.tv_back:
                finish();
                break;
            case R.id.iv_right:
                break;
            //清除历史
            case R.id.tv_clear:
                List<String> his = preferences.getPrefStringList(KeyList.PKEY_SEARCH_HISTORY);
                if (his != null) {
                    his.clear();
                }
                preferences.setPrefStringList(KeyList.PKEY_SEARCH_HISTORY, his);
                initFlowlayout(flHistory, preferences.getPrefStringList(KeyList.PKEY_SEARCH_HISTORY));
                break;
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        initFlowlayout(flHistory, preferences.getPrefStringList(KeyList.PKEY_SEARCH_HISTORY));
    }
}


text:
package microsoft.aspnet.signalr.client.http;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Represents an HTTP Response
 */
public interface Response {

    /**
     * Returns the response headers
     */
    public Map<String, List<String>> getHeaders();

    /**
     * Return the header value
     *
     * @param headerName
     *            Header to retrieve
     * @return The header Values
     */
    public List<String> getHeader(String headerName);

    /**
     * Reads the response stream to the end and returns its value as a String
     *
     * @return The response content as a String
     * @throws IOException
     */
    public String readToEnd() throws IOException;

    /**
     * Reads one line from the response stream
     *
     * @return A line from the response stream
     * @throws IOException
     */
    public String readLine() throws IOException;

    /**
     * Returns the response HTTP Status code
     */
    public int getStatus();

    /**
     * Reads the response stream to the end and returns its value as a Byte[]
     *
     * @return The response content as a Byte[]
     * @throws IOException
     */
    public byte[] readAllBytes() throws IOException;
}


text:
module NodeRails
  module ModelHelpers
    def self.included(base)
      base.class_eval do
        base.extend ClassMethods
      end
    end

    module ClassMethods
      def acts_as_node(*args)
        puts "\n\nIT'S HAPPENING 1\n\n"
        after_create {|my_obj| my_obj.node_message 'create' }
        after_update {|my_obj| my_obj.node_message 'update' }
        after_destroy {|my_obj| my_obj.node_message 'destroy' }
        include InstanceMethods
      end
    end

    module InstanceMethods
      def node_message action
        puts "\n\nIT'S HAPPENING 2\n\n"
        msg = { resource: self.class.name.downcase,
                action: action,
                id: self.id,
                obj: self }

        $redis.publish "node-rails-change/#{self.user.id}", msg.to_json
      end
    end
  end
end
ActiveRecord::Base.send(:include, NodeRails::ModelHelpers)


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Using as: AArch64 Opcodes</title>

<meta name="description" content="Using as: AArch64 Opcodes">
<meta name="keywords" content="Using as: AArch64 Opcodes">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="AArch64_002dDependent.html#AArch64_002dDependent" rel="up" title="AArch64-Dependent">
<link href="AArch64-Mapping-Symbols.html#AArch64-Mapping-Symbols" rel="next" title="AArch64 Mapping Symbols">
<link href="AArch64-Directives.html#AArch64-Directives" rel="prev" title="AArch64 Directives">

Next: AArch64 Mapping Symbols, Previous: AArch64 Directives, Up: AArch64-Dependent   [Contents][Index]

9.1.6 Opcodes

GAS implements all the standard AArch64 opcodes.  It also
implements several pseudo opcodes, including several synthetic load
instructions.

LDR =

  ldr <register> , =<expression>

The constant expression will be placed into the nearest literal pool (if it not
already there) and a PC-relative LDR instruction will be generated.

For more information on the AArch64 instruction set and assembly language
notation, see ‘<samp>ARMv8 Instruction Set Overview</samp>’ available at
http://infocenter.arm.com.


text:
function onRequest(context) {
    var utility = require("/app/modules/utility.js").utility;
    var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"];
    var groupId = context.uriParams.id;
    var group = groupModule.getGroup(groupId);
    var devices = [];
    var deviceResponse = groupModule.getGroupDevices(groupId).responseText;

    if(deviceResponse != null) {
        var deviceResponseObj = parse(deviceResponse);
        devices = deviceResponseObj.devices;
    }
    var page = {
        "groupId": groupId,
        "groupName": group.name,
        "title": group.name + " Analytics"
    };
    if (devices) {
        var deviceTypes = [];
        for (var i = 0; i < devices.length; i++) {
            var hasDeviceType = false;
            for (var j = 0; j < deviceTypes.length; j++) {
                if (deviceTypes[j].type === devices[i].type) {
                    deviceTypes[j].devices.push(devices[i]);
                    hasDeviceType = true;
                    break;
                }
            }
            if (!hasDeviceType) {
                var deviceType = {};
                deviceType.type = devices[i].type;
                deviceType.devices = [];
                deviceType.devices.push(devices[i]);
                deviceType.deviceAnalyticsViewUnitName = utility.getTenantedDeviceUnitName(deviceType.type, "analytics-view");
                deviceTypes.push(deviceType);
            }
        }
        page.deviceTypes = deviceTypes;
        page.devices = devices;
    }

    return page;
}


text:
@interface EventInfoTableViewCellObject ()

@property (nonatomic, strong, readwrite) NSString *date;
@property (nonatomic, strong, readwrite) NSString *eventTitle;
@property (nonatomic, strong, readwrite) NSString *eventSubTitle;

@end

@implementation EventInfoTableViewCellObject

#pragma mark - Initialization

- (instancetype)initWithEvent:(EventPlainObject *)event andDate:(NSString *)date {
    self = [super init];
    if (self) {
        _eventTitle = event.name;
        _eventSubTitle = event.metaEvent.metaEventDescription;
        _date = date;
    }
    return self;
}

+ (instancetype)objectWithEvent:(EventPlainObject *)event andDate:(NSString *)date {
    return [[self alloc] initWithEvent:event andDate:date];
}

#pragma mark - NICellObject methods

- (Class)cellClass {
    return [EventInfoTableViewCell class];
}

- (UINib *)cellNib {
    return [UINib nibWithNibName:NSStringFromClass([EventInfoTableViewCell class]) bundle:[NSBundle mainBundle]];
}

@end