/libcore/luni/src/test/java/libcore/dalvik/system/ |
D | JniTest.java | 95 final Object[] a = new Object[16]; in testPassingObjectReferences() local 99 a[i] = literal; in testPassingObjectReferences() 102 assertEquals(a[i], returnObjectArgFrom16(i, a[0], a[1], a[2], a[3], a[4], in testPassingObjectReferences() 103 a[5], a[6], a[7], a[8], a[9], a[10], in testPassingObjectReferences() 104 a[11], a[12], a[13], a[14], a[15])); in testPassingObjectReferences() 110 a[i] = literals[(i + j) % literals.length]; in testPassingObjectReferences() 113 assertEquals(a[i], returnObjectArgFrom16(i, a[0], a[1], a[2], a[3], a[4], in testPassingObjectReferences() 114 a[5], a[6], a[7], a[8], a[9], a[10], in testPassingObjectReferences() 115 a[11], a[12], a[13], a[14], a[15])); in testPassingObjectReferences() 123 final boolean[] a = new boolean[16]; in testPassingBooleans() [all …]
|
/libcore/ojluni/src/main/java/java/util/ |
D | DualPivotQuicksort.java | 107 static void sort(int[] a, int left, int right, in sort() argument 111 sort(a, left, right, true); in sort() 124 if (a[k] < a[k + 1]) { // ascending in sort() 125 while (++k <= right && a[k - 1] <= a[k]); in sort() 126 } else if (a[k] > a[k + 1]) { // descending in sort() 127 while (++k <= right && a[k - 1] >= a[k]); in sort() 129 int t = a[lo]; a[lo] = a[hi]; a[hi] = t; in sort() 132 for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { in sort() 134 sort(a, left, right, true); in sort() 145 sort(a, left, right, true); in sort() [all …]
|
D | Arrays.java | 146 public static void sort(int[] a) { in sort() argument 147 DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0); in sort() 170 public static void sort(int[] a, int fromIndex, int toIndex) { in sort() argument 171 rangeCheck(a.length, fromIndex, toIndex); in sort() 172 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0); in sort() 186 public static void sort(long[] a) { in sort() argument 187 DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0); in sort() 210 public static void sort(long[] a, int fromIndex, int toIndex) { in sort() argument 211 rangeCheck(a.length, fromIndex, toIndex); in sort() 212 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0); in sort() [all …]
|
D | ComparableTimSort.java | 65 private final Object[] a; field in ComparableTimSort 120 private ComparableTimSort(Object[] a, Object[] work, int workBase, int workLen) { in ComparableTimSort() argument 121 this.a = a; in ComparableTimSort() 124 int len = a.length; in ComparableTimSort() 179 static void sort(Object[] a, int lo, int hi, Object[] work, int workBase, int workLen) { in sort() argument 180 assert a != null && lo >= 0 && lo <= hi && hi <= a.length; in sort() 188 int initRunLen = countRunAndMakeAscending(a, lo, hi); in sort() 189 binarySort(a, lo, hi, lo + initRunLen); in sort() 198 ComparableTimSort ts = new ComparableTimSort(a, work, workBase, workLen); in sort() 202 int runLen = countRunAndMakeAscending(a, lo, hi); in sort() [all …]
|
D | TimSort.java | 85 private final T[] a; field in TimSort 146 private TimSort(T[] a, Comparator<? super T> c, T[] work, int workBase, int workLen) { in TimSort() argument 147 this.a = a; in TimSort() 151 int len = a.length; in TimSort() 157 (a.getClass().getComponentType(), tlen); in TimSort() 210 static <T> void sort(T[] a, int lo, int hi, Comparator<? super T> c, in sort() argument 212 assert c != null && a != null && lo >= 0 && lo <= hi && hi <= a.length; in sort() 220 int initRunLen = countRunAndMakeAscending(a, lo, hi, c); in sort() 221 binarySort(a, lo, hi, lo + initRunLen, c); in sort() 230 TimSort<T> ts = new TimSort<>(a, c, work, workBase, workLen); in sort() [all …]
|
/libcore/ojluni/src/main/native/ |
D | jlong_md.h | 33 #define jlong_high(a) ((jint)((a)>>32)) argument 34 #define jlong_low(a) ((jint)(a)) argument 35 #define jlong_add(a, b) ((a) + (b)) argument 36 #define jlong_and(a, b) ((a) & (b)) argument 37 #define jlong_div(a, b) ((a) / (b)) argument 38 #define jlong_mul(a, b) ((a) * (b)) argument 39 #define jlong_neg(a) (-(a)) argument 40 #define jlong_not(a) (~(a)) argument 41 #define jlong_or(a, b) ((a) | (b)) argument 42 #define jlong_shl(a, n) ((a) << (n)) argument [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | AtomicIntegerFieldUpdaterTest.java | 36 AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a = in checkPrivateAccess() local 46 AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a = in checkCompareAndSetProtectedSub() local 50 assertTrue(a.compareAndSet(this, 1, 2)); in checkCompareAndSetProtectedSub() 51 assertTrue(a.compareAndSet(this, 2, -4)); in checkCompareAndSetProtectedSub() 52 assertEquals(-4, a.get(this)); in checkCompareAndSetProtectedSub() 53 assertFalse(a.compareAndSet(this, -5, 7)); in checkCompareAndSetProtectedSub() 54 assertEquals(-4, a.get(this)); in checkCompareAndSetProtectedSub() 55 assertTrue(a.compareAndSet(this, -4, 7)); in checkCompareAndSetProtectedSub() 56 assertEquals(7, a.get(this)); in checkCompareAndSetProtectedSub() 63 AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a = in checkPackageAccess() local [all …]
|
D | AtomicLongFieldUpdaterTest.java | 36 AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = in checkPrivateAccess() local 46 AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = in checkCompareAndSetProtectedSub() local 50 assertTrue(a.compareAndSet(this, 1, 2)); in checkCompareAndSetProtectedSub() 51 assertTrue(a.compareAndSet(this, 2, -4)); in checkCompareAndSetProtectedSub() 52 assertEquals(-4, a.get(this)); in checkCompareAndSetProtectedSub() 53 assertFalse(a.compareAndSet(this, -5, 7)); in checkCompareAndSetProtectedSub() 54 assertEquals(-4, a.get(this)); in checkCompareAndSetProtectedSub() 55 assertTrue(a.compareAndSet(this, -4, 7)); in checkCompareAndSetProtectedSub() 56 assertEquals(7, a.get(this)); in checkCompareAndSetProtectedSub() 63 AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a = in checkPackageAccess() local [all …]
|
D | Atomic8Test.java | 73 AtomicLong a = new AtomicLong(1L); in testLongGetAndUpdate() local 74 assertEquals(1L, a.getAndUpdate(Atomic8Test::addLong17)); in testLongGetAndUpdate() 75 assertEquals(18L, a.getAndUpdate(Atomic8Test::addLong17)); in testLongGetAndUpdate() 76 assertEquals(35L, a.get()); in testLongGetAndUpdate() 84 AtomicLong a = new AtomicLong(1L); in testLongUpdateAndGet() local 85 assertEquals(18L, a.updateAndGet(Atomic8Test::addLong17)); in testLongUpdateAndGet() 86 assertEquals(35L, a.updateAndGet(Atomic8Test::addLong17)); in testLongUpdateAndGet() 94 AtomicLong a = new AtomicLong(1L); in testLongGetAndAccumulate() local 95 assertEquals(1L, a.getAndAccumulate(2L, Long::sum)); in testLongGetAndAccumulate() 96 assertEquals(3L, a.getAndAccumulate(3L, Long::sum)); in testLongGetAndAccumulate() [all …]
|
D | AtomicReferenceFieldUpdaterTest.java | 38 AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Integer> a = in checkPrivateAccess() local 48 AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Integer> a = in checkCompareAndSetProtectedSub() local 52 assertTrue(a.compareAndSet(this, one, two)); in checkCompareAndSetProtectedSub() 53 assertTrue(a.compareAndSet(this, two, m4)); in checkCompareAndSetProtectedSub() 54 assertSame(m4, a.get(this)); in checkCompareAndSetProtectedSub() 55 assertFalse(a.compareAndSet(this, m5, seven)); in checkCompareAndSetProtectedSub() 56 assertFalse(seven == a.get(this)); in checkCompareAndSetProtectedSub() 57 assertTrue(a.compareAndSet(this, m4, seven)); in checkCompareAndSetProtectedSub() 58 assertSame(seven, a.get(this)); in checkCompareAndSetProtectedSub() 65 AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Integer> a = in checkPackageAccess() local [all …]
|
D | CountedCompleterTest.java | 55 private void testInvokeOnPool(ForkJoinPool pool, ForkJoinTask a) { in testInvokeOnPool() argument 57 assertFalse(a.isDone()); in testInvokeOnPool() 58 assertFalse(a.isCompletedNormally()); in testInvokeOnPool() 59 assertFalse(a.isCompletedAbnormally()); in testInvokeOnPool() 60 assertFalse(a.isCancelled()); in testInvokeOnPool() 61 assertNull(a.getException()); in testInvokeOnPool() 62 assertNull(a.getRawResult()); in testInvokeOnPool() 64 assertNull(pool.invoke(a)); in testInvokeOnPool() 66 assertTrue(a.isDone()); in testInvokeOnPool() 67 assertTrue(a.isCompletedNormally()); in testInvokeOnPool() [all …]
|
D | ForkJoinTaskTest.java | 57 private void testInvokeOnPool(ForkJoinPool pool, RecursiveAction a) { in testInvokeOnPool() argument 59 assertFalse(a.isDone()); in testInvokeOnPool() 60 assertFalse(a.isCompletedNormally()); in testInvokeOnPool() 61 assertFalse(a.isCompletedAbnormally()); in testInvokeOnPool() 62 assertFalse(a.isCancelled()); in testInvokeOnPool() 63 assertNull(a.getException()); in testInvokeOnPool() 64 assertNull(a.getRawResult()); in testInvokeOnPool() 66 assertNull(pool.invoke(a)); in testInvokeOnPool() 68 assertTrue(a.isDone()); in testInvokeOnPool() 69 assertTrue(a.isCompletedNormally()); in testInvokeOnPool() [all …]
|
D | CopyOnWriteArraySetTest.java | 35 CopyOnWriteArraySet<Integer> a = new CopyOnWriteArraySet<Integer>(); in populatedSet() local 36 assertTrue(a.isEmpty()); in populatedSet() 38 a.add(i); in populatedSet() 39 assertEquals(n == 0, a.isEmpty()); in populatedSet() 40 assertEquals(n, a.size()); in populatedSet() 41 return a; in populatedSet() 45 CopyOnWriteArraySet<Integer> a = new CopyOnWriteArraySet<Integer>(); in populatedSet() local 46 assertTrue(a.isEmpty()); in populatedSet() 48 a.add(elements[i]); in populatedSet() 49 assertFalse(a.isEmpty()); in populatedSet() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | MathTest.java | 37 private void testIntExact(int a, int b) { in testIntExact() argument 38 testAddExactI(a, b); in testIntExact() 39 testSubtractExactI(a, b); in testIntExact() 40 testMultiplyExactI(a, b); in testIntExact() 41 testIncrementExactI(a); in testIntExact() 42 testDecrementExactI(a); in testIntExact() 43 testNegateExactI(a); in testIntExact() 46 private void testAddExactI(int a, int b) { in testAddExactI() argument 47 long expected = (long) a + (long) b; in testAddExactI() 49 assertEquals(expected, Math.addExact(a, b)); in testAddExactI() [all …]
|
D | StrictMathTest.java | 37 private void testIntExact(int a, int b) { in testIntExact() argument 38 testAddExactI(a, b); in testIntExact() 39 testSubtractExactI(a, b); in testIntExact() 40 testMultiplyExactI(a, b); in testIntExact() 43 private void testAddExactI(int a, int b) { in testAddExactI() argument 44 long expected = (long) a + (long) b; in testAddExactI() 46 assertEquals(expected, StrictMath.addExact(a, b)); in testAddExactI() 48 if (expected == a + b) { in testAddExactI() 54 private void testSubtractExactI(int a, int b) { in testSubtractExactI() argument 55 long expected = (long) a - (long) b; in testSubtractExactI() [all …]
|
/libcore/ojluni/src/main/java/java/lang/ |
D | StrictMath.java | 110 public static native double sin(double a); in sin() argument 120 public static native double cos(double a); in cos() argument 132 public static native double tan(double a); in tan() argument 145 public static native double asin(double a); in asin() argument 156 public static native double acos(double a); in acos() argument 168 public static native double atan(double a); in atan() argument 215 public static native double exp(double a); in exp() argument 231 public static native double log(double a); in log() argument 252 public static native double log10(double a); in log10() argument 270 public static native double sqrt(double a); in sqrt() argument [all …]
|
D | Math.java | 148 public static native double sin(double a); in sin() argument 162 public static native double cos(double a); in cos() argument 178 public static native double tan(double a); in tan() argument 195 public static native double asin(double a); in asin() argument 210 public static native double acos(double a); in acos() argument 226 public static native double atan(double a); in atan() argument 275 public static native double exp(double a); in exp() argument 295 public static native double log(double a); in log() argument 319 public static native double log10(double a); in log10() argument 339 public static native double sqrt(double a); in sqrt() argument [all …]
|
/libcore/ojluni/src/main/java/java/nio/ |
D | Bits.java | 73 static char getCharL(long a) { in getCharL() argument 74 return makeChar(_get(a + 1), in getCharL() 75 _get(a )); in getCharL() 83 static char getCharB(long a) { in getCharB() argument 84 return makeChar(_get(a ), in getCharB() 85 _get(a + 1)); in getCharB() 92 static char getChar(long a, boolean bigEndian) { in getChar() argument 93 return bigEndian ? getCharB(a) : getCharL(a); in getChar() 104 static void putCharL(long a, char x) { in putCharL() argument 105 _put(a , char0(x)); in putCharL() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/math/ |
D | BigDecimalConvertTest.java | 37 String a = "-123809648392384754573567356745735.63567890295784902768787678287E+21"; in testDoubleValueNeg() local 38 BigDecimal aNumber = new BigDecimal(a); in testDoubleValueNeg() 47 String a = "123809648392384754573567356745735.63567890295784902768787678287E+21"; in testDoubleValuePos() local 48 BigDecimal aNumber = new BigDecimal(a); in testDoubleValuePos() 57 String a = "123809648392384754573567356745735.63567890295784902768787678287E+400"; in testDoubleValuePosInfinity() local 58 BigDecimal aNumber = new BigDecimal(a); in testDoubleValuePosInfinity() 67 String a = "-123809648392384754573567356745735.63567890295784902768787678287E+400"; in testDoubleValueNegInfinity() local 68 BigDecimal aNumber = new BigDecimal(a); in testDoubleValueNegInfinity() 77 String a = "-123809648392384754573567356745735.63567890295784902768787678287E-400"; in testDoubleValueMinusZero() local 78 BigDecimal aNumber = new BigDecimal(a); in testDoubleValueMinusZero() [all …]
|
D | BigIntegerConvertTest.java | 36 String a = "0"; in testDoubleValueZero() local 38 double aNumber = new BigInteger(a).doubleValue(); in testDoubleValueZero() 47 String a = "27467238945"; in testDoubleValuePositive1() local 49 double aNumber = new BigInteger(a).doubleValue(); in testDoubleValuePositive1() 58 String a = "2746723894572364578265426346273456972"; in testDoubleValuePositive2() local 60 double aNumber = new BigInteger(a).doubleValue(); in testDoubleValuePositive2() 69 String a = "-27467238945"; in testDoubleValueNegative1() local 71 double aNumber = new BigInteger(a).doubleValue(); in testDoubleValueNegative1() 80 String a = "-2746723894572364578265426346273456972"; in testDoubleValueNegative2() local 82 double aNumber = new BigInteger(a).doubleValue(); in testDoubleValueNegative2() [all …]
|
/libcore/luni/src/main/java/java/math/ |
D | NativeBN.java | 24 public static native void BN_free(long a); in BN_free() argument 27 public static native int BN_cmp(long a, long b); in BN_cmp() argument 33 public static native void putLongInt(long a, long dw); in putLongInt() argument 34 public static native void putULongInt(long a, long dw, boolean neg); in putULongInt() argument 36 public static native int BN_dec2bn(long a, String str); in BN_dec2bn() argument 39 public static native int BN_hex2bn(long a, String str); in BN_hex2bn() argument 52 public static native long longInt(long a); in longInt() argument 55 public static native String BN_bn2dec(long a); in BN_bn2dec() argument 58 public static native String BN_bn2hex(long a); in BN_bn2hex() argument 61 public static native byte[] BN_bn2bin(long a); in BN_bn2bin() argument [all …]
|
/libcore/ojluni/annotations/mmodule/java/lang/ |
D | Math.annotated.java | 37 public static native double sin(double a); in sin() argument 39 public static native double cos(double a); in cos() argument 41 public static native double tan(double a); in tan() argument 43 public static native double asin(double a); in asin() argument 45 public static native double acos(double a); in acos() argument 47 public static native double atan(double a); in atan() argument 53 public static native double exp(double a); in exp() argument 55 public static native double log(double a); in log() argument 57 public static native double log10(double a); in log10() argument 59 public static native double sqrt(double a); in sqrt() argument [all …]
|
/libcore/ojluni/src/main/java/java/net/ |
D | Authenticator.java | 122 public synchronized static void setDefault(Authenticator a) { in setDefault() argument 130 theAuthenticator = a; in setDefault() 174 Authenticator a = theAuthenticator; in requestPasswordAuthentication() local 175 if (a == null) { in requestPasswordAuthentication() 178 synchronized(a) { in requestPasswordAuthentication() 179 a.reset(); in requestPasswordAuthentication() 180 a.requestingSite = addr; in requestPasswordAuthentication() 181 a.requestingPort = port; in requestPasswordAuthentication() 182 a.requestingProtocol = protocol; in requestPasswordAuthentication() 183 a.requestingPrompt = prompt; in requestPasswordAuthentication() [all …]
|
/libcore/ojluni/annotations/hiddenapi/java/util/ |
D | Arrays.java | 42 public static void sort(int[] a) { in sort() argument 46 public static void sort(int[] a, int fromIndex, int toIndex) { in sort() argument 50 public static void sort(long[] a) { in sort() argument 54 public static void sort(long[] a, int fromIndex, int toIndex) { in sort() argument 58 public static void sort(short[] a) { in sort() argument 62 public static void sort(short[] a, int fromIndex, int toIndex) { in sort() argument 66 public static void sort(char[] a) { in sort() argument 70 public static void sort(char[] a, int fromIndex, int toIndex) { in sort() argument 74 public static void sort(byte[] a) { in sort() argument 78 public static void sort(byte[] a, int fromIndex, int toIndex) { in sort() argument [all …]
|
/libcore/luni/src/test/java/libcore/java/math/ |
D | OldBigDecimalArithmeticTest.java | 30 BigDecimal a, b, res; in testAddMathContextNonTrivial() local 33 a = new BigDecimal("123456789012345.678"); in testAddMathContextNonTrivial() 36 a.round(mc).toString()); in testAddMathContextNonTrivial() 40 a.round(mc).add(b.round(mc)).toString()); in testAddMathContextNonTrivial() 41 res = a.add(b, mc); in testAddMathContextNonTrivial() 45 a = new BigDecimal("1234567890123456789012345678.9012395"); in testAddMathContextNonTrivial() 47 res = a.add(b, mc); in testAddMathContextNonTrivial() 55 BigDecimal a, b, res; in testSubtractMathContextNonTrivial() local 58 a = new BigDecimal("12345678901234567.8"); in testSubtractMathContextNonTrivial() 61 a.round(mc).subtract(b.round(mc)).toString()); in testSubtractMathContextNonTrivial() [all …]
|