text:
package org.scalatest.exceptions

import org.scalatest.matchers.ShouldMatchers
import org.scalatest.FunSpec

class TestCanceledExceptionSpec extends FunSpec with ShouldMatchers {

  val baseLineNumber = 23

  describe("The TestCanceledException") {

    it("should give the proper line on cancel()") {
      try {
        cancel()
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 6))
            case None => fail("cancel() didn't produce a file name and line number string: " + e.failedCodeFileNameAndLineNumberString, e)
          }
        case e: Throwable =>
          cancel("cancel() didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on cancel(\"message\")") {
      try {
        cancel("some message")
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 21))
            case None => fail("cancel(\"some message\") didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("cancel(\"some message\") didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on cancel(throwable)") {
      try {
        cancel(new RuntimeException)
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 36))
            case None => fail("cancel(throwable) didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("cancel(throwable) didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on cancel(\"some message\", throwable)") {
      try {
        cancel("some message", new RuntimeException)
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 51))
            case None => fail("cancel(\"some message\", throwable) didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("cancel(\"some message\", throwable) didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on assume(false)") {
      try {
        assume(false)
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 66))
            case None => fail("assume(false) didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("assume(false) didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on assume(false, \"some message\")") {
      try {
        assume(false, "some message")
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 81))
            case None => fail("assume(false, \"some message\") didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("assume(false, \"some message\") didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on assume(1 === 2)") {
      try {
        assume(1 === 2)
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 96))
            case None => fail("assume(1 === 2) didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("assume(1 === 2) didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on assume(1 === 2, \"some message\")") {
      try {
        assume(1 === 2, "some message")
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 111))
            case None => fail("assume(1 === 2, \"some message\") didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("assume(1 === 2, \"some message\") didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on assertResult(1) { 2 }") {
      try {
        assertResult(1) {
          2
        }
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 126))
            case None => fail("assertResult(1) { 2 } didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("assertResult(1) { 2 } didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on assertResult(1, \"some message\") { 2 }") {
      try {
        assertResult(1, "some message") {
          2
        }
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 141))
            case None => fail("assertResult(1, \"some message\") { 2 } didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("assertResult(1, \"some message\") { 2 } didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on intercept[IllegalArgumentException] {}") {
      try {
        intercept[IllegalArgumentException] {}
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 156))
            case None => fail("intercept[IllegalArgumentException] {} didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("intercept[IllegalArgumentException] {} didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on intercept[IllegalArgumentException] { throw new RuntimeException }") {
      try {
        intercept[IllegalArgumentException] {
          if (false) 1 else throw new RuntimeException
        }
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 171))
            case None => fail("intercept[IllegalArgumentException] { throw new RuntimeException } didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("intercept[IllegalArgumentException] { throw new RuntimeException } didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on 1 should be === 2") {
      try {
        1 should be === 2
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) =>
              if (s != ("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 186))) {
                cancel("s was: " + s, e)
              }
            case None => fail("1 should be === 2 didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("1 should be === 2 didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on evaluating {} should produce [IllegalArgumentException] {}") {
      try {
        evaluating {} should produce[IllegalArgumentException]
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => // s should equal ("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 204))
              if (s != ("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 204))) {
                cancel("s was: " + s, e)
              }
            case None => fail("evaluating {} should produce [IllegalArgumentException] didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("evaluating {} should produce [IllegalArgumentException] didn't produce a TestCanceledException", e)
      }
    }

    it("should give the proper line on evaluating { throw new RuntimeException } should produce [IllegalArgumentException]") {
      try {
        evaluating {
          if (false) 1 else throw new RuntimeException
        } should produce[IllegalArgumentException]
      }
      catch {
        case e: TestCanceledException =>
          e.failedCodeFileNameAndLineNumberString match {
            case Some(s) => s should equal("TestCanceledExceptionSpec.scala:" + (baseLineNumber + 222))
            case None => fail("evaluating { throw new RuntimeException } should produce [IllegalArgumentException] didn't produce a file name and line number string", e)
          }
        case e: Throwable =>
          cancel("evaluating { throw new RuntimeException } should produce [IllegalArgumentException] didn't produce a TestCanceledException", e)
      }
    }

    it("should return the cause in both cause and getCause") {
      val theCause = new IllegalArgumentException("howdy")
      val tfe = new TestCanceledException(Some("doody"), Some(theCause), 3)
      assume(tfe.cause.isDefined)
      assume(tfe.cause.get === theCause)
      assume(tfe.getCause == theCause)
    }

    it("should return None in cause and null in getCause if no cause") {
      val tfe = new TestCanceledException(Some("doody"), None, 3)
      assume(tfe.cause.isEmpty)
      assume(tfe.getCause == null)
    }

    it("should be equal to itself") {
      val tfe = new TestCanceledException(Some("doody"), None, 3)
      assume(tfe equals tfe)
    }
  }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.Common.Core.Threading {
    /// <summary>
    /// Async version of the ManualResetEvent
    /// </summary>
    public class AsyncManualResetEvent {
        private TaskCompletionSource<bool> _tcs;
        public bool IsSet => _tcs.Task.IsCompleted;

        public Task WaitAsync() => _tcs.Task;
        public void Set() => _tcs.TrySetResult(true);

        public Task WaitAsync(CancellationToken cancellationToken) {
            if (cancellationToken.IsCancellationRequested) {
                return Task.FromCanceled(cancellationToken);
            }

            var tcs = new TaskCompletionSource<bool>();
            cancellationToken.Register(CancelTcs, tcs);
            _tcs.Task.ContinueWith(WaitContinuation, tcs, TaskContinuationOptions.ExecuteSynchronously);
            return tcs.Task;
        }

        private void WaitContinuation(Task<bool> task, object state) {
            var tcs = (TaskCompletionSource<bool>) state;
            switch (task.Status) {
                case TaskStatus.Faulted:
                    tcs.TrySetException(task.Exception);
                    break;
                case TaskStatus.Canceled:
                    tcs.TrySetCanceled();
                    break;
                case TaskStatus.RanToCompletion:
                    tcs.TrySetResult(task.Result);
                    break;
            }
        }

        public AsyncManualResetEvent(bool isSet = false) {
            _tcs = new TaskCompletionSource<bool>();
            if (isSet) {
                _tcs.SetResult(true);
            }
        }

        public void Reset() {
            while (true) {
                var tcs = _tcs;
                if (!tcs.Task.IsCompleted) {
                    return;
                }

                if (Interlocked.CompareExchange(ref _tcs, new TaskCompletionSource<bool>(), tcs) == tcs) {
                    return;
                }
            }
        }

        private static void CancelTcs(object obj) {
            var tcs = (TaskCompletionSource<bool>) obj;
            tcs.TrySetCanceled();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import { IHttpClient } from "./IHttpClient";

export class BatchHandler {
    public static readonly maxRetries = 5;
    constructor(protected baseClient: IHttpClient, protected registeredPromises: Map<string, { resolve, error }[]>, protected batch: { id: string; url: string; method: "GET" }[], protected retries: number = 0) { }

    public async executeBatch() {
        let betaRequests = this.batch.filter(req => req.url.indexOf("v1.0/") < 0);
        let v1Requests = this.batch.filter(req => req.url.indexOf("v1.0/") >= 0);
        let batchBody = JSON.stringify({ requests: betaRequests });
        let batchBodyV1 = JSON.stringify({
            requests: v1Requests.map(req => ({
                ...req,
                url: req.url.replace("v1.0/", "")
            }))
        });
        let responses = [];
        if (betaRequests.length > 0) {
            let betaResponse = await this.requestBatch(batchBody);
            responses.push(...betaResponse.responses);
        }
        if (v1Requests.length > 0) {
            let v1Response = await this.requestBatch(batchBodyV1, "v1.0");
            responses.push(...v1Response.responses);
        }
        this.processBatchResponse(responses);
        if (this.batch.length > 0 && this.retries > 0) {
            this.retries--;
            this.executeBatch();
        }
    }

    private processBatchResponse(responses) {
        const retryBatch = [];
        const retryRegisteredPromises: Map<string, { resolve, error }[]> = new Map<string, { resolve, error }[]>();

        this.registeredPromises.forEach((promises: { resolve; error; }[], url: string) => {
            let promiseResponse = responses.filter(resp => resp.id === url)[0];
            if (promiseResponse && promiseResponse.status === 429 && this.retries > 0) {
                retryBatch.push({
                    url,
                    id: url,
                    method: "GET"
                });
                retryRegisteredPromises.set(url, promises);
            } else {
                this.handleSingleResponse(promiseResponse, promises);
            }
        });

        if (retryBatch.length > 0) {
            this.registeredPromises = retryRegisteredPromises;
            this.batch = retryBatch;
        } else {
            this.batch = [];
            this.registeredPromises.clear();
        }
    }

    private handleSingleResponse(promiseResponse: any, promises: { resolve: any; error: any; }[]) {
        if (promiseResponse) {
            promises.forEach(promise => {
                promise.resolve({
                    json: () => Promise.resolve(promiseResponse.body),
                    ok: promiseResponse.status === 200,
                    text: () => Promise.resolve(JSON.stringify(promiseResponse.body))
                });
            });
        }
        else {
            promises.forEach(promise => {
                promise.error({
                    json: () => Promise.resolve(promiseResponse),
                    ok: false,
                    text: () => Promise.resolve(JSON.stringify(promiseResponse))
                });
            });
        }
    }

    protected requestBatch = async (batchBody: string, version: string = "beta") => {
        const options = {
            headers: {
                Accept: "application/json",
                ConsistencyLevel: "eventual",
                "Content-Type": "application/json"
            }, body: batchBody
        };
        const response = await this.baseClient.post(`https://graph.microsoft.com/${version}/$batch`, options);
        if (response.ok) {
            let batchResponse = await response.json();
            return batchResponse;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RecordUniqueNames
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var result = new HashSet<string>();
            for (int i = 0; i < n; i++)
            {
                var name = Console.ReadLine();
                result.Add(name);
            }
            foreach (var name in result)
            {
                Console.WriteLine(name);
            }
        }
    }
}


text:
package org.apache.ignite.ml.math.decompositions;

import org.apache.ignite.ml.math.Destroyable;
import org.apache.ignite.ml.math.Matrix;
import org.apache.ignite.ml.math.Vector;
import org.apache.ignite.ml.math.exceptions.CardinalityException;
import org.apache.ignite.ml.math.exceptions.SingularMatrixException;

import static org.apache.ignite.ml.math.util.MatrixUtil.copy;
import static org.apache.ignite.ml.math.util.MatrixUtil.like;
import static org.apache.ignite.ml.math.util.MatrixUtil.likeVector;

/**
 * Calculates the LU-decomposition of a square matrix.
 *

 * This class is inspired by class from Apache Common Math with similar name.

 *
 * @see MathWorld
 * @see Wikipedia
 *
 * TODO: Maybe we should make this class (and other decompositions) Externalizable.
 */
public class LUDecomposition implements Destroyable {
    /** Default bound to determine effective singularity in LU decomposition. */
    private static final double DEFAULT_TOO_SMALL = 1e-11;

    /** Pivot permutation associated with LU decomposition. */
    private final Vector pivot;

    /** Parity of the permutation associated with the LU decomposition. */
    private boolean even;
    /** Singularity indicator. */
    private boolean singular;

    /** Cached value of L. */
    private Matrix cachedL;
    /** Cached value of U. */
    private Matrix cachedU;
    /** Cached value of P. */
    private Matrix cachedP;

    /** Original matrix. */
    private Matrix matrix;

    /** Entries of LU decomposition. */
    private Matrix lu;

    /**
     * Calculates the LU-decomposition of the given matrix.
     * This constructor uses 1e-11 as default value for the singularity
     * threshold.
     *
     * @param matrix Matrix to decompose.
     * @throws CardinalityException if matrix is not square.
     */
    public LUDecomposition(Matrix matrix) {
        this(matrix, DEFAULT_TOO_SMALL);
    }

    /**
     * Calculates the LUP-decomposition of the given matrix.
     *
     * @param matrix Matrix to decompose.
     * @param singularityThreshold threshold (based on partial row norm).
     * @throws CardinalityException if matrix is not square.
     */
    public LUDecomposition(Matrix matrix, double singularityThreshold) {
        assert matrix != null;

        int rows = matrix.rowSize();
        int cols = matrix.columnSize();

        if (rows != cols)
            throw new CardinalityException(rows, cols);

        this.matrix = matrix;

        lu = copy(matrix);

        pivot = likeVector(matrix);

        for (int i = 0; i < pivot.size(); i++)
            pivot.setX(i, i);

        even = true;
        singular = false;

        cachedL = null;
        cachedU = null;
        cachedP = null;

        for (int col = 0; col < cols; col++) {

            //upper
            for (int row = 0; row < col; row++) {
                Vector luRow = lu.viewRow(row);
                double sum = luRow.get(col);

                for (int i = 0; i < row; i++)
                    sum -= luRow.getX(i) * lu.getX(i, col);

                luRow.setX(col, sum);
            }

            // permutation row
            int max = col;

            double largest = Double.NEGATIVE_INFINITY;

            // lower
            for (int row = col; row < rows; row++) {
                Vector luRow = lu.viewRow(row);
                double sum = luRow.getX(col);

                for (int i = 0; i < col; i++)
                    sum -= luRow.getX(i) * lu.getX(i, col);

                luRow.setX(col, sum);

                if (Math.abs(sum) > largest) {
                    largest = Math.abs(sum);
                    max = row;
                }
            }

            // Singularity check
            if (Math.abs(lu.getX(max, col)) < singularityThreshold) {
                singular = true;
                return;
            }

            // Pivot if necessary
            if (max != col) {
                double tmp;
                Vector luMax = lu.viewRow(max);
                Vector luCol = lu.viewRow(col);

                for (int i = 0; i < cols; i++) {
                    tmp = luMax.getX(i);
                    luMax.setX(i, luCol.getX(i));
                    luCol.setX(i, tmp);
                }

                int temp = (int)pivot.getX(max);
                pivot.setX(max, pivot.getX(col));
                pivot.setX(col, temp);

                even = !even;
            }

            // Divide the lower elements by the "winning" diagonal elt.
            final double luDiag = lu.getX(col, col);

            for (int row = col + 1; row < cols; row++) {
                double val = lu.getX(row, col) / luDiag;
                lu.setX(row, col, val);
            }
        }
    }

    /**
     * Destroys decomposition components and other internal components of decomposition.
     */
    @Override public void destroy() {
        if (cachedL != null)
            cachedL.destroy();
        if (cachedU != null)
            cachedU.destroy();
        if (cachedP != null)
            cachedP.destroy();
        lu.destroy();
    }

    /**
     * Returns the matrix L of the decomposition.
     *
L is a lower-triangular matrix

     *
     * @return the L matrix (or null if decomposed matrix is singular).
     */
    public Matrix getL() {
        if ((cachedL == null) && !singular) {
            final int m = pivot.size();

            cachedL = like(matrix);
            cachedL.assign(0.0);

            for (int i = 0; i < m; ++i) {
                for (int j = 0; j < i; ++j)
                    cachedL.setX(i, j, lu.getX(i, j));

                cachedL.setX(i, i, 1.0);
            }
        }

        return cachedL;
    }

    /**
     * Returns the matrix U of the decomposition.
     *
U is an upper-triangular matrix

     *
     * @return the U matrix (or null if decomposed matrix is singular).
     */
    public Matrix getU() {
        if ((cachedU == null) && !singular) {
            final int m = pivot.size();

            cachedU = like(matrix);
            cachedU.assign(0.0);

            for (int i = 0; i < m; ++i)
                for (int j = i; j < m; ++j)
                    cachedU.setX(i, j, lu.getX(i, j));
        }

        return cachedU;
    }

    /**
     * Returns the P rows permutation matrix.
     *
P is a sparse matrix with exactly one element set to 1.0 in
     * each row and each column, all other elements being set to 0.0.

     *
The positions of the 1 elements are given by the {@link #getPivot()
     * pivot permutation vector}.

     *
     * @return the P rows permutation matrix (or null if decomposed matrix is singular).
     * @see #getPivot()
     */
    public Matrix getP() {
        if ((cachedP == null) && !singular) {
            final int m = pivot.size();

            cachedP = like(matrix);
            cachedP.assign(0.0);

            for (int i = 0; i < m; ++i)
                cachedP.setX(i, (int)pivot.get(i), 1.0);
        }

        return cachedP;
    }

    /**
     * Returns the pivot permutation vector.
     *
     * @return the pivot permutation vector.
     * @see #getP()
     */
    public Vector getPivot() {
        return pivot.copy();
    }

    /**
     * Return the determinant of the matrix.
     *
     * @return determinant of the matrix.
     */
    public double determinant() {
        if (singular)
            return 0;

        final int m = pivot.size();
        double determinant = even ? 1 : -1;

        for (int i = 0; i < m; i++)
            determinant *= lu.getX(i, i);

        return determinant;
    }

    /**
     * @param b Vector to solve using this decomposition.
     * @return Solution vector.
     */
    public Vector solve(Vector b) {
        final int m = pivot.size();

        if (b.size() != m)
            throw new CardinalityException(b.size(), m);

        if (singular)
            throw new SingularMatrixException();

        final double[] bp = new double[m];

        // Apply permutations to b
        for (int row = 0; row < m; row++)
            bp[row] = b.get((int)pivot.get(row));

        // Solve LY = b
        for (int col = 0; col < m; col++) {
            final double bpCol = bp[col];

            for (int i = col + 1; i < m; i++)
                bp[i] -= bpCol * lu.get(i, col);
        }

        // Solve UX = Y
        for (int col = m - 1; col >= 0; col--) {
            bp[col] /= lu.get(col, col);
            final double bpCol = bp[col];

            for (int i = 0; i < col; i++)
                bp[i] -= bpCol * lu.get(i, col);
        }

        return b.like(m).assign(bp);
    }

    /**
     * @param b Matrix to solve using this decomposition.
     * @return Solution matrix.
     */
    public Matrix solve(Matrix b) {
        final int m = pivot.size();

        if (b.rowSize() != m)
            throw new CardinalityException(b.rowSize(), m);

        if (singular)
            throw new SingularMatrixException();

        final int nColB = b.columnSize();

        // Apply permutations to b
        final double[][] bp = new double[m][nColB];
        for (int row = 0; row < m; row++) {
            final double[] bpRow = bp[row];
            final int pRow = (int)pivot.get(row);

            for (int col = 0; col < nColB; col++)
                bpRow[col] = b.get(pRow, col);
        }

        // Solve LY = b
        for (int col = 0; col < m; col++) {
            final double[] bpCol = bp[col];
            for (int i = col + 1; i < m; i++) {
                final double[] bpI = bp[i];
                final double luICol = lu.get(i, col);

                for (int j = 0; j < nColB; j++)
                    bpI[j] -= bpCol[j] * luICol;
            }
        }

        // Solve UX = Y
        for (int col = m - 1; col >= 0; col--) {
            final double[] bpCol = bp[col];
            final double luDiag = lu.getX(col, col);

            for (int j = 0; j < nColB; j++)
                bpCol[j] /= luDiag;

            for (int i = 0; i < col; i++) {
                final double[] bpI = bp[i];
                final double luICol = lu.get(i, col);

                for (int j = 0; j < nColB; j++)
                    bpI[j] -= bpCol[j] * luICol;
            }
        }

        return b.like(b.rowSize(), b.columnSize()).assign(bp);
    }
}


text:
package qub;

/**
 * A collection of functions that help when interacting with Strings.
 */
public interface Strings
{
    /**
     * Get an Iterable for the characters in the provided text.
     * @param text The text to create an Iterable for.
     * @return The Iterable over the characters in the provided text.
     */
    static Iterable<Character> iterable(String text)
    {
        final CharacterList result = CharacterList.create();
        if (!Strings.isNullOrEmpty(text))
        {
            result.addAll(text);
        }

        PostCondition.assertNotNull(result, "result");

        return result;
    }

    /**
     * Get an Iterator for the characters in the provided text.
     * @param text The text to iterate.
     * @return The Iterator over the characters in the provided text.
     */
    static Iterator<Character> iterate(String text)
    {
        return StringIterator.create(text);
    }

    /**
     * Get the number of characters in the provided String.
     * @param value The value.
     * @return The number of characters.
     */
    static int getLength(String value)
    {
        return value == null ? 0 : value.length();
    }

    static boolean startsWith(String text, String prefix)
    {
        return !Strings.isNullOrEmpty(text) && !Strings.isNullOrEmpty(prefix) && text.startsWith(prefix);
    }

    static boolean startsWith(String text, String prefix, CharacterComparer characterComparer)
    {
        PreCondition.assertNotNull(characterComparer, "characterComparer");

        boolean result = false;
        if (!Strings.isNullOrEmpty(text) && !Strings.isNullOrEmpty(prefix))
        {
            final int textLength = text.length();
            final int prefixLength = prefix.length();
            if (prefixLength <= textLength)
            {
                result = true;
                for (int i = 0; i < prefixLength; ++i)
                {
                    if (!characterComparer.equal(text.charAt(i), prefix.charAt(i)))
                    {
                        result = false;
                        break;
                    }
                }
            }
        }
        return result;
    }

    /**
     * Get whether or not the provided text ends with the provided suffix.
     * @param text The text to check.
     * @param suffix The suffix to check for.
     * @return Whether or not the provided text ends with the provided suffix.
     */
    static boolean endsWith(String text, char suffix)
    {
        return Strings.endsWith(text, Characters.toString(suffix));
    }

    /**
     * Get whether or not the provided text ends with the provided suffix.
     * @param text The text to check.
     * @param suffix The suffix to check for.
     * @return Whether or not the provided text ends with the provided suffix.
     */
    static boolean endsWith(String text, String suffix)
    {
        PreCondition.assertNotNull(text, "text");
        PreCondition.assertNotNullAndNotEmpty(suffix, "suffix");

        return text.endsWith(suffix);
    }

    /**
     * Ensure that the provided text ends with the provided suffix. If it does, then return the
     * provided text. If it doesn't, then return the text with the provided suffix appended at the
     * end.
     * @param text The text to check.
     * @param suffix The suffix to check for.
     * @return The text with the provided suffix at the end.
     */
    static String ensureEndsWith(String text, char suffix)
    {
        return Strings.ensureEndsWith(text, Characters.toString(suffix));
    }

    /**
     * Ensure that the provided text ends with the provided suffix. If it does, then return the
     * provided text. If it doesn't, then return the text with the provided suffix appended at the
     * end.
     * @param text The text to check.
     * @param suffix The suffix to check for.
     * @return The text with the provided suffix at the end.
     */
    static String ensureEndsWith(String text, String suffix)
    {
        PreCondition.assertNotNull(text, "text");
        PreCondition.assertNotNullAndNotEmpty(suffix, "suffix");

        return text.endsWith(suffix) ? text : text + suffix;
    }

    static boolean contains(String text, String substring)
    {
        return !Strings.isNullOrEmpty(text) && !Strings.isNullOrEmpty(substring) && text.contains(substring);
    }

    /**
     * Check if the provided text String contains any of the provided characters.
     * @param text The text to traverse in.
     * @param characters The characters to traverse for.
     * @return Whether or not the provided text String contains any of the provided characters.
     */
    static boolean containsAny(String text, char[] characters)
    {
        boolean result = false;
        if (text != null && !text.isEmpty() && characters != null && characters.length > 0)
        {
            final int textLength = text.length();
            search: for (int i = 0; i < textLength; ++i)
            {
                final char currentCharacter = text.charAt(i);
                for (final char searchCharacter : characters)
                {
                    if (currentCharacter == searchCharacter)
                    {
                        result = true;
                        break search;
                    }
                }
            }
        }
        return result;
    }

    /**
     * Escape any escaped characters (such as '\n' or '\t') in the provided text.
     * @param text The text to escape.
     * @return The escaped text.
     */
    static String escape(String text)
    {
        String result;
        if (text == null || text.isEmpty())
        {
            result = text;
        }
        else
        {
            final CharacterList builder = CharacterList.create();
            final int textLength = text.length();
            for (int i = 0; i < textLength; ++i)
            {
                builder.addAll(Characters.escape(text.charAt(i)));
            }
            result = builder.toString(true);
        }
        return result;
    }

    /**
     * Unescape any escaped characters (such as '\n' or '\t') in the provided text.
     * @param text The text to unescape.
     * @return The unescaped text.
     */
    static String unescape(String text)
    {
        String result;
        if (text == null || text.isEmpty())
        {
            result = text;
        }
        else
        {
            final SaveableIterator<Character> characters = SaveableIterator.create(Strings.iterate(text).start());
            final CharacterList builder = CharacterList.create();
            while (characters.hasCurrent())
            {
                builder.add(Characters.unescapeNextCharacter(characters));
            }
            result = builder.toString();
        }
        return result;
    }

    /**
     * Get whether or not the provided text is surrounded by quotes.
     * @param text The text to check.
     * @return Whether or not the provided text is surrounded by quotes.
     */
    static boolean isQuoted(String text)
    {
        boolean result = false;

        if (text != null)
        {
            final int textLength = text.length();
            if (textLength >= 2)
            {
                final char firstCharacter = text.charAt(0);
                if (Characters.isQuote(firstCharacter) && firstCharacter == text.charAt(textLength - 1))
                {
                    if (textLength == 2)
                    {
                        result = true;
                    }
                    else
                    {
                        int escapeSlashCount = 0;
                        while (text.charAt(textLength - 2 - escapeSlashCount) == '\\')
                        {
                            ++escapeSlashCount;
                        }
                        result = Math.isEven(escapeSlashCount);
                    }
                }
            }
        }

        return result;
    }

    /**
     * Unquote the provided text if it is quoted. If it isn't quoted, then return it as it is.
     * @param text The text to unquote.
     * @return The unquoted text.
     */
    static String unquote(String text)
    {
        return Strings.isQuoted(text) ? text.substring(1, text.length() - 1) : text;
    }

    /**
     * Surround the provided text with double quotes.
     * @param text The text to quote.
     * @return The quoted text.
     */
    static String quote(String text)
    {
        return text == null ? null : '\"' + text + '\"';
    }

    /**
     * Surround the String representation of the provided value with quotes and textualize any
     * escaped characters.
     * @param value The object to quote and escape.
     * @return The quoted and escaped String representation of the provided value.
     */
    static String escapeAndQuote(Object value)
    {
        return escapeAndQuote(value == null ? null : value.toString());
    }

    /**
     * Surround the provided text with quotes and textualize any escaped characters.
     * @param text The text to quote and escape.
     * @return The quoted and escaped text.
     */
    static String escapeAndQuote(String text)
    {
        return Strings.quote(Strings.escape(text));
    }

    static String unescapeAndUnquote(String text)
    {
        return Strings.unquote(Strings.unescape(text));
    }

    /**
     * Get whether or not the provided text is null or empty.
     * @param text The text to check.
     * @return Whether or not the provided text is null or empty.
     */
    static boolean isNullOrEmpty(String text)
    {
        return text == null || text.isEmpty();
    }

    /**
     * Repeat the provided value String a specified number of times.
     * @param value The value to repeat.
     * @param repetitions The number of times to repeat the value.
     * @return The repeated string.
     */
    static String repeat(String value, int repetitions)
    {
        PreCondition.assertNotNull(value, "value");
        PreCondition.assertGreaterThanOrEqualTo(repetitions, 0, "repetitions");

        final CharacterList list = CharacterList.create();
        if (!Strings.isNullOrEmpty(value))
        {
            for (int i = 0; i < repetitions; ++i)
            {
                list.addAll(value);
            }
        }
        final String result = list.toString();

        PostCondition.assertNotNull(result, "result");
        PostCondition.assertEqual(Strings.getLength(value) * repetitions, result.length(), "result.length()");

        return result;
    }

    /**
     * Repeat the provided value String a specified number of times.
     * @param value The value to repeat.
     * @param repetitions The number of times to repeat the value.
     * @return The repeated string.
     */
    static String repeat(char value, int repetitions)
    {
        PreCondition.assertGreaterThanOrEqualTo(repetitions, 0, "repetitions");

        final CharacterList list = CharacterList.create();
        for (int i = 0; i < repetitions; ++i)
        {
            list.add(value);
        }
        final String result = list.toString();

        PostCondition.assertNotNull(result, "result");
        PostCondition.assertEqual(repetitions, result.length(), "result.length()");

        return result;
    }

    /**
     * Concatenate the two strings together into a single string. Null values will be treated as an
     * empty string.
     * @param lhs The first string.
     * @param rhs The second string.
     * @return The concatenated string.
     */
    static String concatenate(String lhs, String rhs)
    {
        final CharacterList list = CharacterList.create();
        if (lhs != null)
        {
            list.addAll(lhs);
        }
        if (rhs != null)
        {
            list.addAll(rhs);
        }
        final String result = list.toString(true);

        PostCondition.assertNotNull(result, "result");

        return result;
    }

    /**
     * Join the provided String values with the provided separator character between them.
     * @param values The String values to join together.
     * @return The joined string values.
     */
    static String join(java.lang.Iterable<String> values)
    {
        PreCondition.assertNotNull(values, "values");

        final CharacterList list = CharacterList.create();
        for (final String value : values)
        {
            if (!Strings.isNullOrEmpty(value))
            {
                list.addAll(value);
            }
        }
        final String result = list.toString();

        PostCondition.assertNotNull(result, "result");

        return result;
    }

    /**
     * Join the provided String values with the provided separator character between them.
     * @param separator The character to insert between the string values.
     * @param values The String values to join together.
     * @return The joined string values.
     */
    static String join(char separator, java.lang.Iterable<String> values)
    {
        PreCondition.assertNotNull(values, "values");

        final CharacterList list = CharacterList.create();
        for (final String value : values)
        {
            if (list.any())
            {
                list.add(separator);
            }
            if (value != null)
            {
                list.addAll(value);
            }
        }
        final String result = list.toString();

        PostCondition.assertNotNull(result, "result");

        return result;
    }

    /**
     * Join the provided String values with the provided separator String between them.
     * @param separator The String to insert between the string values.
     * @param values The String values to join together.
     * @return The joined string values.
     */
    static String join(String separator, java.lang.Iterable<String> values)
    {
        PreCondition.assertNotNull(separator, "separator");
        PreCondition.assertNotNull(values, "values");

        final CharacterList list = CharacterList.create();
        for (final String value : values)
        {
            if (list.any())
            {
                list.addAll(separator);
            }
            if (value != null)
            {
                list.addAll(value);
            }
        }
        final String result = list.toString();

        PostCondition.assertNotNull(result, "result");

        return result;
    }

    static boolean equal(String lhs, String rhs)
    {
        return Comparer.equal(lhs, rhs);
    }

    static String format(String formattedString, Object... formattedStringArguments)
    {
        String result;
        if (formattedString != null && !formattedString.isEmpty() && formattedStringArguments != null && formattedStringArguments.length > 0)
        {
            result = java.lang.String.format(formattedString, formattedStringArguments);
        }
        else
        {
            result = formattedString;
        }
        return result;
    }

    /**
     * Pad on the left side the provided String value with the provided padCharacter until it is at
     * least the provided minimumLength long.
     * @param value The value to pad.
     * @param minimumLength The minimum number of characters that the resulting String will be.
     * @param padCharacter The character to use to pad the provided value.
     * @return The padded String that is at least the provided minimumLength long.
     */
    static String padLeft(Object value, int minimumLength, char padCharacter)
    {
        String result = Objects.toString(value == null ? "" : value);
        final int charactersToAdd = minimumLength - Strings.getLength(result);
        if (charactersToAdd > 0)
        {
            result = Strings.concatenate(Strings.repeat(padCharacter, charactersToAdd), result);
        }
        return result;
    }

    /**
     * Pad on the right side the provided String value with the provided padCharacter until it is at
     * least the provided minimumLength long.
     * @param value The value to pad.
     * @param minimumLength The minimum number of characters that the resulting String will be.
     * @param padCharacter The character to use to pad the provided value.
     * @return The padded String that is at least the provided minimumLength long.
     */
    static String padRight(Object value, int minimumLength, char padCharacter)
    {
        String result = Objects.toString(value == null ? "" : value);
        final int charactersToAdd = minimumLength - Strings.getLength(result);
        if (charactersToAdd > 0)
        {
            result = Strings.concatenate(result, Strings.repeat(padCharacter, charactersToAdd));
        }
        return result;
    }

    static boolean isOneOf(String value, String... possibilities)
    {
        return Strings.isOneOf(value, Iterable.create(possibilities));
    }

    static boolean isOneOf(String value, Iterable<String> possibilities)
    {
        PreCondition.assertNotNull(possibilities, "possibilities");

        return possibilities.contains(value);
    }

    static Iterator<String> iterateWords(String value)
    {
        return Strings.iterateWords(Strings.iterate(value));
    }

    static Iterator<String> iterateWords(Iterator<Character> characters)
    {
        PreCondition.assertNotNull(characters, "characters");

        final CharacterList list = CharacterList.create();
        return Iterator.create((IteratorActions<String> actions) ->
        {
            characters.start();

            while (characters.hasCurrent() && !Characters.isLetterOrDigit(characters.getCurrent()))
            {
                characters.next();
            }

            while (characters.hasCurrent() && Characters.isLetterOrDigit(characters.getCurrent()))
            {
                list.add(characters.getCurrent());
                characters.next();
            }

            if (list.any())
            {
                actions.returnValue(list.toString());
                list.clear();
            }
        });
    }

    static Comparison compare(String lhs, String rhs)
    {
        Comparison result;
        if (lhs == rhs)
        {
            result = Comparison.Equal;
        }
        else if (lhs == null)
        {
            result = Comparison.LessThan;
        }
        else if (rhs == null)
        {
            result = Comparison.GreaterThan;
        }
        else
        {
            result = Comparison.create(lhs.compareTo(rhs));
        }
        return result;
    }

    static boolean lessThan(String lhs, String rhs)
    {
        return Strings.compare(lhs, rhs) == Comparison.LessThan;
    }

    static boolean greaterThan(String lhs, String rhs)
    {
        return Strings.compare(lhs, rhs) == Comparison.GreaterThan;
    }

    static Iterator<String> iterateLines(String value)
    {
        return Strings.iterateLines(Strings.iterate(value));
    }

    static Iterator<String> iterateLines(String value, boolean includeNewLines)
    {
        return Strings.iterateLines(Strings.iterate(value), includeNewLines);
    }

    static Iterator<String> iterateLines(Iterator<Character> characters)
    {
        return Strings.iterateLines(characters, false);
    }

    static Iterator<String> iterateLines(Iterator<Character> characters, boolean includeNewLines)
    {
        PreCondition.assertNotNull(characters, "characters");

        final CharacterList list = CharacterList.create();
        return Iterator.create((IteratorActions<String> actions) ->
        {
            characters.start();

            boolean foundLine = false;
            while (characters.hasCurrent())
            {
                foundLine = true;

                list.add(characters.takeCurrent());

                if (list.endsWith('\n'))
                {
                    if (!includeNewLines)
                    {
                        list.removeLast();
                        if (list.endsWith('\r'))
                        {
                            list.removeLast();
                        }
                    }
                    break;
                }
            }

            if (foundLine)
            {
                actions.returnValue(list.toString());
                list.clear();
            }
        });
    }
}


text:
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc

package android.support.v4.view;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.ViewConfiguration;

// Referenced classes of package android.support.v4.view:
//            MotionEventCompat, VelocityTrackerCompat

public class GestureDetectorCompat
{
    static interface GestureDetectorCompatImpl
    {

        public abstract boolean isLongpressEnabled();

        public abstract boolean onTouchEvent(MotionEvent motionevent);

        public abstract void setIsLongpressEnabled(boolean flag);

        public abstract void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener ondoubletaplistener);
    }

    static class GestureDetectorCompatImplBase
        implements GestureDetectorCompatImpl
    {

        private static final int DOUBLE_TAP_TIMEOUT = 0;
        private static final int LONGPRESS_TIMEOUT = 0;
        private static final int LONG_PRESS = 2;
        private static final int SHOW_PRESS = 1;
        private static final int TAP = 3;
        private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
        private boolean mAlwaysInBiggerTapRegion;
        private boolean mAlwaysInTapRegion;
        private MotionEvent mCurrentDownEvent;
        private boolean mDeferConfirmSingleTap;
        private android.view.GestureDetector.OnDoubleTapListener mDoubleTapListener;
        private int mDoubleTapSlopSquare;
        private float mDownFocusX;
        private float mDownFocusY;
        private final Handler mHandler;
        private boolean mInLongPress;
        private boolean mIsDoubleTapping;
        private boolean mIsLongpressEnabled;
        private float mLastFocusX;
        private float mLastFocusY;
        private final android.view.GestureDetector.OnGestureListener mListener;
        private int mMaximumFlingVelocity;
        private int mMinimumFlingVelocity;
        private MotionEvent mPreviousUpEvent;
        private boolean mStillDown;
        private int mTouchSlopSquare;
        private VelocityTracker mVelocityTracker;

        private void cancel()
        {
            mHandler.removeMessages(1);
            mHandler.removeMessages(2);
            mHandler.removeMessages(3);
            mVelocityTracker.recycle();
            mVelocityTracker = null;
            mIsDoubleTapping = false;
            mStillDown = false;
            mAlwaysInTapRegion = false;
            mAlwaysInBiggerTapRegion = false;
            mDeferConfirmSingleTap = false;
            if (mInLongPress)
            {
                mInLongPress = false;
            }
        }

        private void cancelTaps()
        {
            mHandler.removeMessages(1);
            mHandler.removeMessages(2);
            mHandler.removeMessages(3);
            mIsDoubleTapping = false;
            mAlwaysInTapRegion = false;
            mAlwaysInBiggerTapRegion = false;
            mDeferConfirmSingleTap = false;
            if (mInLongPress)
            {
                mInLongPress = false;
            }
        }

        private void dispatchLongPress()
        {
            mHandler.removeMessages(3);
            mDeferConfirmSingleTap = false;
            mInLongPress = true;
            mListener.onLongPress(mCurrentDownEvent);
        }

        private void init(Context context)
        {
            if (context == null)
            {
                throw new IllegalArgumentException("Context must not be null");
            }
            if (mListener == null)
            {
                throw new IllegalArgumentException("OnGestureListener must not be null");
            } else
            {
                mIsLongpressEnabled = true;
                ViewConfiguration viewconfiguration = ViewConfiguration.get(context);
                int i = viewconfiguration.getScaledTouchSlop();
                int j = viewconfiguration.getScaledDoubleTapSlop();
                mMinimumFlingVelocity = viewconfiguration.getScaledMinimumFlingVelocity();
                mMaximumFlingVelocity = viewconfiguration.getScaledMaximumFlingVelocity();
                mTouchSlopSquare = i * i;
                mDoubleTapSlopSquare = j * j;
                return;
            }
        }

        private boolean isConsideredDoubleTap(MotionEvent motionevent, MotionEvent motionevent1, MotionEvent motionevent2)
        {
            if (mAlwaysInBiggerTapRegion && motionevent2.getEventTime() - motionevent1.getEventTime() <= (long)DOUBLE_TAP_TIMEOUT)
            {
                int i = (int)motionevent.getX() - (int)motionevent2.getX();
                int j = (int)motionevent.getY() - (int)motionevent2.getY();
                if (i * i + j * j < mDoubleTapSlopSquare)
                {
                    return true;
                }
            }
            return false;
        }

        public boolean isLongpressEnabled()
        {
            return mIsLongpressEnabled;
        }

        public boolean onTouchEvent(MotionEvent motionevent)
        {
            int k;
            float f2;
            float f3;
            boolean flag1;
            int i = motionevent.getAction();
            if (mVelocityTracker == null)
            {
                mVelocityTracker = VelocityTracker.obtain();
            }
            mVelocityTracker.addMovement(motionevent);
            boolean flag;
            int j;
            float f;
            float f1;
            int l;
            if ((i & 0xff) == 6)
            {
                flag = true;
            } else
            {
                flag = false;
            }
            if (flag)
            {
                j = MotionEventCompat.getActionIndex(motionevent);
            } else
            {
                j = -1;
            }
            f = 0.0F;
            f1 = 0.0F;
            k = MotionEventCompat.getPointerCount(motionevent);
            l = 0;
            while (l < k)
            {
                if (j != l)
                {
                    f += MotionEventCompat.getX(motionevent, l);
                    f1 += MotionEventCompat.getY(motionevent, l);
                }
                l++;
            }
            int i1;
            int j1;
            if (flag)
            {
                i1 = k - 1;
            } else
            {
                i1 = k;
            }
            f2 = f / (float)i1;
            f3 = f1 / (float)i1;
            j1 = i & 0xff;
            flag1 = false;
            j1;
            JVM INSTR tableswitch 0 6: default 200
        //                       0 392
        //                       1 911
        //                       2 663
        //                       3 1186
        //                       4 200
        //                       5 210
        //                       6 240;
               goto _L1 _L2 _L3 _L4 _L5 _L1 _L6 _L7
_L1:
            return flag1;
_L6:
            mLastFocusX = f2;
            mDownFocusX = f2;
            mLastFocusY = f3;
            mDownFocusY = f3;
            cancelTaps();
            return false;
_L7:
            int j3;
            float f8;
            float f9;
            int l3;
            mLastFocusX = f2;
            mDownFocusX = f2;
            mLastFocusY = f3;
            mDownFocusY = f3;
            mVelocityTracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
            j3 = MotionEventCompat.getActionIndex(motionevent);
            int k3 = MotionEventCompat.getPointerId(motionevent, j3);
            f8 = VelocityTrackerCompat.getXVelocity(mVelocityTracker, k3);
            f9 = VelocityTrackerCompat.getYVelocity(mVelocityTracker, k3);
            l3 = 0;
_L9:
            int i4 = l3;
            flag1 = false;
            if (i4 >= k)
            {
                continue; /* Loop/switch isn't completed */
            }
            if (l3 != j3)
            {
                break; /* Loop/switch isn't completed */
            }
_L11:
            l3++;
            int j4;
            if (true) goto _L9; else goto _L8
_L8:
            if (f8 * VelocityTrackerCompat.getXVelocity(mVelocityTracker, j4 = MotionEventCompat.getPointerId(motionevent, l3)) + f9 * VelocityTrackerCompat.getYVelocity(mVelocityTracker, j4) >= 0.0F) goto _L11; else goto _L10
_L10:
            mVelocityTracker.clear();
            return false;
_L2:
            android.view.GestureDetector.OnDoubleTapListener ondoubletaplistener = mDoubleTapListener;
            boolean flag5 = false;
            if (ondoubletaplistener != null)
            {
                boolean flag6 = mHandler.hasMessages(3);
                if (flag6)
                {
                    mHandler.removeMessages(3);
                }
                if (mCurrentDownEvent != null && mPreviousUpEvent != null && flag6 && isConsideredDoubleTap(mCurrentDownEvent, mPreviousUpEvent, motionevent))
                {
                    mIsDoubleTapping = true;
                    flag5 = false | mDoubleTapListener.onDoubleTap(mCurrentDownEvent) | mDoubleTapListener.onDoubleTapEvent(motionevent);
                } else
                {
                    mHandler.sendEmptyMessageDelayed(3, DOUBLE_TAP_TIMEOUT);
                    flag5 = false;
                }
            }
            mLastFocusX = f2;
            mDownFocusX = f2;
            mLastFocusY = f3;
            mDownFocusY = f3;
            if (mCurrentDownEvent != null)
            {
                mCurrentDownEvent.recycle();
            }
            mCurrentDownEvent = MotionEvent.obtain(motionevent);
            mAlwaysInTapRegion = true;
            mAlwaysInBiggerTapRegion = true;
            mStillDown = true;
            mInLongPress = false;
            mDeferConfirmSingleTap = false;
            if (mIsLongpressEnabled)
            {
                mHandler.removeMessages(2);
                mHandler.sendEmptyMessageAtTime(2, mCurrentDownEvent.getDownTime() + (long)TAP_TIMEOUT + (long)LONGPRESS_TIMEOUT);
            }
            mHandler.sendEmptyMessageAtTime(1, mCurrentDownEvent.getDownTime() + (long)TAP_TIMEOUT);
            return flag5 | mListener.onDown(motionevent);
_L4:
            float f6;
            float f7;
            boolean flag3 = mInLongPress;
            flag1 = false;
            if (flag3)
            {
                continue; /* Loop/switch isn't completed */
            }
            f6 = mLastFocusX - f2;
            f7 = mLastFocusY - f3;
            if (mIsDoubleTapping)
            {
                return false | mDoubleTapListener.onDoubleTapEvent(motionevent);
            }
            if (!mAlwaysInTapRegion)
            {
                break; /* Loop/switch isn't completed */
            }
            int j2 = (int)(f2 - mDownFocusX);
            int k2 = (int)(f3 - mDownFocusY);
            int l2 = j2 * j2 + k2 * k2;
            int i3 = mTouchSlopSquare;
            flag1 = false;
            if (l2 > i3)
            {
                flag1 = mListener.onScroll(mCurrentDownEvent, motionevent, f6, f7);
                mLastFocusX = f2;
                mLastFocusY = f3;
                mAlwaysInTapRegion = false;
                mHandler.removeMessages(3);
                mHandler.removeMessages(1);
                mHandler.removeMessages(2);
            }
            if (l2 > mTouchSlopSquare)
            {
                mAlwaysInBiggerTapRegion = false;
                return flag1;
            }
            if (true) goto _L1; else goto _L12
_L12:
            int i2;
            if (Math.abs(f6) >= 1.0F)
            {
                break; /* Loop/switch isn't completed */
            }
            i2 = Math.abs(f7) != 1.0F;
            flag1 = false;
            if (i2 < 0) goto _L1; else goto _L13
_L13:
            boolean flag4 = mListener.onScroll(mCurrentDownEvent, motionevent, f6, f7);
            mLastFocusX = f2;
            mLastFocusY = f3;
            return flag4;
_L3:
            MotionEvent motionevent1;
            mStillDown = false;
            motionevent1 = MotionEvent.obtain(motionevent);
            if (!mIsDoubleTapping) goto _L15; else goto _L14
_L14:
            boolean flag2 = false | mDoubleTapListener.onDoubleTapEvent(motionevent);
_L18:
            if (mPreviousUpEvent != null)
            {
                mPreviousUpEvent.recycle();
            }
            mPreviousUpEvent = motionevent1;
            if (mVelocityTracker != null)
            {
                mVelocityTracker.recycle();
                mVelocityTracker = null;
            }
            mIsDoubleTapping = false;
            mDeferConfirmSingleTap = false;
            mHandler.removeMessages(1);
            mHandler.removeMessages(2);
            return flag2;
_L15:
            if (!mInLongPress) goto _L17; else goto _L16
_L16:
            mHandler.removeMessages(3);
            mInLongPress = false;
            flag2 = false;
              goto _L18
_L17:
            if (!mAlwaysInTapRegion) goto _L20; else goto _L19
_L19:
            flag2 = mListener.onSingleTapUp(motionevent);
            if (mDeferConfirmSingleTap && mDoubleTapListener != null)
            {
                mDoubleTapListener.onSingleTapConfirmed(motionevent);
            }
              goto _L18
_L20:
            float f4;
            float f5;
            VelocityTracker velocitytracker = mVelocityTracker;
            int k1 = MotionEventCompat.getPointerId(motionevent, 0);
            velocitytracker.computeCurrentVelocity(1000, mMaximumFlingVelocity);
            f4 = VelocityTrackerCompat.getYVelocity(velocitytracker, k1);
            f5 = VelocityTrackerCompat.getXVelocity(velocitytracker, k1);
            if (Math.abs(f4) > (float)mMinimumFlingVelocity) goto _L22; else goto _L21
_L21:
            int l1;
            l1 = Math.abs(f5) != (float)mMinimumFlingVelocity;
            flag2 = false;
            if (l1 <= 0) goto _L18; else goto _L22
_L22:
            flag2 = mListener.onFling(mCurrentDownEvent, motionevent, f5, f4);
              goto _L18
_L5:
            cancel();
            return false;
        }

        public void setIsLongpressEnabled(boolean flag)
        {
            mIsLongpressEnabled = flag;
        }

        public void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener ondoubletaplistener)
        {
            mDoubleTapListener = ondoubletaplistener;
        }

        static
        {
            LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout();
            DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout();
        }

/*
        static boolean access$502(GestureDetectorCompatImplBase gesturedetectorcompatimplbase, boolean flag)
        {
            gesturedetectorcompatimplbase.mDeferConfirmSingleTap = flag;
            return flag;
        }

*/

        public GestureDetectorCompatImplBase(Context context, android.view.GestureDetector.OnGestureListener ongesturelistener, Handler handler)
        {
            if (handler != null)
            {
                mHandler = new GestureHandler(handler);
            } else
            {
                mHandler = new GestureHandler();
            }
            mListener = ongesturelistener;
            if (ongesturelistener instanceof android.view.GestureDetector.OnDoubleTapListener)
            {
                setOnDoubleTapListener((android.view.GestureDetector.OnDoubleTapListener)ongesturelistener);
            }
            init(context);
        }
    }

    private class GestureDetectorCompatImplBase.GestureHandler extends Handler
    {

        final GestureDetectorCompatImplBase this$0;

        public void handleMessage(Message message)
        {
            message.what;
            JVM INSTR tableswitch 1 3: default 32
        //                       1 59
        //                       2 79
        //                       3 87;
               goto _L1 _L2 _L3 _L4
_L1:
            throw new RuntimeException((new StringBuilder()).append("Unknown message ").append(message).toString());
_L2:
            mListener.onShowPress(mCurrentDownEvent);
_L6:
            return;
_L3:
            dispatchLongPress();
            return;
_L4:
            if (mDoubleTapListener != null)
            {
                if (!mStillDown)
                {
                    mDoubleTapListener.onSingleTapConfirmed(mCurrentDownEvent);
                    return;
                } else
                {
                    mDeferConfirmSingleTap = true;
                    return;
                }
            }
            if (true) goto _L6; else goto _L5
_L5:
        }

        GestureDetectorCompatImplBase.GestureHandler()
        {
            this$0 = GestureDetectorCompatImplBase.this;
            super();
        }

        GestureDetectorCompatImplBase.GestureHandler(Handler handler)
        {
            this$0 = GestureDetectorCompatImplBase.this;
            super(handler.getLooper());
        }
    }

    static class GestureDetectorCompatImplJellybeanMr2
        implements GestureDetectorCompatImpl
    {

        private final GestureDetector mDetector;

        public boolean isLongpressEnabled()
        {
            return mDetector.isLongpressEnabled();
        }

        public boolean onTouchEvent(MotionEvent motionevent)
        {
            return mDetector.onTouchEvent(motionevent);
        }

        public void setIsLongpressEnabled(boolean flag)
        {
            mDetector.setIsLongpressEnabled(flag);
        }

        public void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener ondoubletaplistener)
        {
            mDetector.setOnDoubleTapListener(ondoubletaplistener);
        }

        public GestureDetectorCompatImplJellybeanMr2(Context context, android.view.GestureDetector.OnGestureListener ongesturelistener, Handler handler)
        {
            mDetector = new GestureDetector(context, ongesturelistener, handler);
        }
    }

    private final GestureDetectorCompatImpl mImpl;

    public GestureDetectorCompat(Context context, android.view.GestureDetector.OnGestureListener ongesturelistener)
    {
        this(context, ongesturelistener, null);
    }

    public GestureDetectorCompat(Context context, android.view.GestureDetector.OnGestureListener ongesturelistener, Handler handler)
    {
        if (android.os.Build.VERSION.SDK_INT > 17)
        {
            mImpl = new GestureDetectorCompatImplJellybeanMr2(context, ongesturelistener, handler);
            return;
        } else
        {
            mImpl = new GestureDetectorCompatImplBase(context, ongesturelistener, handler);
            return;
        }
    }

    public boolean isLongpressEnabled()
    {
        return mImpl.isLongpressEnabled();
    }

    public boolean onTouchEvent(MotionEvent motionevent)
    {
        return mImpl.onTouchEvent(motionevent);
    }

    public void setIsLongpressEnabled(boolean flag)
    {
        mImpl.setIsLongpressEnabled(flag);
    }

    public void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener ondoubletaplistener)
    {
        mImpl.setOnDoubleTapListener(ondoubletaplistener);
    }
}


text:
package com.vmware.vim25;

/**
@author Steve Jin (sjin@vmware.com)
*/

public class DrsVmMigratedEvent extends VmMigratedEvent
{
}