/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ |
D | NullCipherTest.java | 102 byte [] r = c.update(b); in testUpdatebyteArray() 103 assertEquals("different length", b.length, r.length); in testUpdatebyteArray() 104 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArray() 112 byte [] r = c.update(b, 0, 5); in testUpdatebyteArrayintint() 113 assertEquals("different length", b.length, r.length); in testUpdatebyteArrayintint() 114 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArrayintint() 116 r = c.update(b, 1, 3); in testUpdatebyteArrayintint() 117 assertEquals("different length", 3, r.length); in testUpdatebyteArrayintint() 119 assertEquals("different content", b[i + 1], r[i]); in testUpdatebyteArrayintint() 128 byte [] r = new byte[5]; in testUpdatebyteArrayintintbyteArray() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | ThreadLocalRandom8Test.java | 43 ThreadLocalRandom r = ThreadLocalRandom.current(); in testBadStreamSize() local 45 () -> r.ints(-1L), in testBadStreamSize() 46 () -> r.ints(-1L, 2, 3), in testBadStreamSize() 47 () -> r.longs(-1L), in testBadStreamSize() 48 () -> r.longs(-1L, -1L, 1L), in testBadStreamSize() 49 () -> r.doubles(-1L), in testBadStreamSize() 50 () -> r.doubles(-1L, .5, .6), in testBadStreamSize() 60 ThreadLocalRandom r = ThreadLocalRandom.current(); in testBadStreamBounds() local 62 () -> r.ints(2, 1), in testBadStreamBounds() 63 () -> r.ints(10, 42, 42), in testBadStreamBounds() [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | ThreadLocalRandom8Test.java | 66 ThreadLocalRandom r = ThreadLocalRandom.current(); in testBadStreamSize() local 68 () -> r.ints(-1L), in testBadStreamSize() 69 () -> r.ints(-1L, 2, 3), in testBadStreamSize() 70 () -> r.longs(-1L), in testBadStreamSize() 71 () -> r.longs(-1L, -1L, 1L), in testBadStreamSize() 72 () -> r.doubles(-1L), in testBadStreamSize() 73 () -> r.doubles(-1L, .5, .6), in testBadStreamSize() 83 ThreadLocalRandom r = ThreadLocalRandom.current(); in testBadStreamBounds() local 85 () -> r.ints(2, 1), in testBadStreamBounds() 86 () -> r.ints(10, 42, 42), in testBadStreamBounds() [all …]
|
D | SplittableRandomTest.java | 359 SplittableRandom r = new SplittableRandom(); 361 () -> { java.util.stream.IntStream x = r.ints(-1L); }, 362 () -> { java.util.stream.IntStream x = r.ints(-1L, 2, 3); }, 363 () -> { java.util.stream.LongStream x = r.longs(-1L); }, 364 () -> { java.util.stream.LongStream x = r.longs(-1L, -1L, 1L); }, 365 () -> { java.util.stream.DoubleStream x = r.doubles(-1L); }, 366 () -> { java.util.stream.DoubleStream x = r.doubles(-1L, .5, .6); }, 376 SplittableRandom r = new SplittableRandom(); 378 () -> { java.util.stream.IntStream x = r.ints(2, 1); }, 379 () -> { java.util.stream.IntStream x = r.ints(10, 42, 42); }, [all …]
|
/libcore/ojluni/src/main/java/java/util/ |
D | AbstractCollection.java | 136 Object[] r = new Object[size()]; in toArray() local 138 for (int i = 0; i < r.length; i++) { in toArray() 140 return Arrays.copyOf(r, i); in toArray() 141 r[i] = it.next(); in toArray() 143 return it.hasNext() ? finishToArray(r, it) : r; in toArray() 177 T[] r = a.length >= size ? a : in toArray() local 182 for (int i = 0; i < r.length; i++) { in toArray() 184 if (a == r) { in toArray() 185 r[i] = null; // null-terminate in toArray() 187 return Arrays.copyOf(r, i); in toArray() [all …]
|
D | SplittableRandom.java | 292 long r = mix64(nextSeed()); in internalNextLong() local 296 r = (r & m) + origin; in internalNextLong() 298 for (long u = r >>> 1; // ensure nonnegative in internalNextLong() 299 u + m - (r = u % n) < 0L; // rejection check in internalNextLong() 302 r += origin; in internalNextLong() 305 while (r < origin || r >= bound) in internalNextLong() 306 r = mix64(nextSeed()); in internalNextLong() 309 return r; in internalNextLong() 321 int r = mix32(nextSeed()); in internalNextInt() local 325 r = (r & m) + origin; in internalNextInt() [all …]
|
D | Random.java | 245 long r = nextLong(); in internalNextLong() local 249 r = (r & m) + origin; in internalNextLong() 251 for (long u = r >>> 1; // ensure nonnegative in internalNextLong() 252 u + m - (r = u % n) < 0L; // rejection check in internalNextLong() 255 r += origin; in internalNextLong() 258 while (r < origin || r >= bound) in internalNextLong() 259 r = nextLong(); in internalNextLong() 262 return r; in internalNextLong() 282 int r; in internalNextInt() local 284 r = nextInt(); in internalNextInt() [all …]
|
/libcore/luni/src/test/java/libcore/java/io/ |
D | OldAndroidStringReaderTest.java | 42 int r; in read() local 45 r = a.read(); in read() 46 if (r != -1) in read() 47 builder.append((char) r); in read() 48 } while (r != -1); in read() 62 int r; in skipRead() local 66 r = a.read(); in skipRead() 67 if (r != -1) in skipRead() 68 builder.append((char) r); in skipRead() 69 } while (r != -1); in skipRead() [all …]
|
D | OldAndroidCharArrayReaderTest.java | 44 int r; in read() local 47 r = a.read(); in read() 48 if (r != -1) in read() 49 builder.append((char) r); in read() 50 } while (r != -1); in read() 64 int r; in skipRead() local 68 r = a.read(); in skipRead() 69 if (r != -1) in skipRead() 70 builder.append((char) r); in skipRead() 71 } while (r != -1); in skipRead() [all …]
|
D | OldAndroidByteArrayInputStreamTest.java | 45 int r; in read() local 48 r = a.read(); in read() 49 if (r != -1) in read() 50 builder.append((char) r); in read() 51 } while (r != -1); in read() 65 int r; in skipRead() local 69 r = a.read(); in skipRead() 70 if (r != -1) in skipRead() 71 builder.append((char) r); in skipRead() 72 } while (r != -1); in skipRead() [all …]
|
D | OldBufferedReaderTest.java | 147 int r = br.read(); in test_read() local 148 assertTrue("Char read improperly", testString.charAt(0) == r); in test_read() 328 BufferedReader r = new BufferedReader(new StringReader("1\r2\n3\r\n4")); in test_readLine_all_line_endings() local 329 assertEquals("1", r.readLine()); in test_readLine_all_line_endings() 330 assertEquals("2", r.readLine()); in test_readLine_all_line_endings() 331 assertEquals("3", r.readLine()); in test_readLine_all_line_endings() 332 assertEquals("4", r.readLine()); in test_readLine_all_line_endings() 333 assertNull(r.readLine()); in test_readLine_all_line_endings() 337 BufferedReader r = new BufferedReader(new StringReader("1\r\n2")); in test_readLine_interaction_with_read() local 338 assertEquals('1', r.read()); in test_readLine_interaction_with_read() [all …]
|
D | OldAndroidBufferedReaderTest.java | 67 int r; in read() local 70 r = a.read(); in read() 71 if (r != -1) in read() 72 builder.append((char) r); in read() 73 } while (r != -1); in read() 87 int r; in skipRead() local 91 r = a.read(); in skipRead() 92 if (r != -1) in skipRead() 93 builder.append((char) r); in skipRead() 94 } while (r != -1); in skipRead() [all …]
|
D | OldAndroidPushbackInputStreamTest.java | 59 int r; in read() local 62 r = a.read(); in read() 63 if (r != -1) in read() 64 builder.append((char) r); in read() 65 } while (r != -1); in read() 79 int r; in skipRead() local 83 r = a.read(); in skipRead() 84 if (r != -1) in skipRead() 85 builder.append((char) r); in skipRead() 86 } while (r != -1); in skipRead() [all …]
|
D | OldAndroidLineNumberReaderTest.java | 81 int r; in read() local 84 r = a.read(); in read() 85 if (r != -1) in read() 86 builder.append((char) r); in read() 87 } while (r != -1); in read() 101 int r; in skipRead() local 105 r = a.read(); in skipRead() 106 if (r != -1) in skipRead() 107 builder.append((char) r); in skipRead() 108 } while (r != -1); in skipRead() [all …]
|
D | OldAndroidDataInputStreamTest.java | 109 int r; in read() local 112 r = a.read(); in read() 113 if (r != -1) in read() 114 builder.append((char) r); in read() 115 } while (r != -1); in read() 129 int r; in skipRead() local 133 r = a.read(); in skipRead() 134 if (r != -1) in skipRead() 135 builder.append((char) r); in skipRead() 136 } while (r != -1); in skipRead() [all …]
|
D | OldAndroidPushbackReaderTest.java | 59 int r; in read() local 62 r = a.read(); in read() 63 if (r != -1) in read() 64 builder.append((char) r); in read() 65 } while (r != -1); in read() 79 int r; in skipRead() local 83 r = a.read(); in skipRead() 84 if (r != -1) in skipRead() 85 builder.append((char) r); in skipRead() 86 } while (r != -1); in skipRead()
|
/libcore/luni/src/test/java/libcore/java/util/logging/ |
D | OldFileHandlerTest.java | 48 LogRecord r; field in OldFileHandlerTest 77 r = new LogRecord(Level.CONFIG, "msg"); in setUp() 104 handler.publish(r); in testFileHandler() 110 handler.publish(r); in testFileHandler() 114 new LogRecord[] { r, null, r, null, r, null, r }, in testFileHandler() 127 handler.publish(r); in testFileHandler_1params() 134 handler.publish(r); in testFileHandler_1params() 138 r, null, r, null, r, null, r }, new MockFormatter()); in testFileHandler_1params() 146 h.publish(r); in testFileHandler_1params() 147 h2.publish(r); in testFileHandler_1params() [all …]
|
/libcore/ojluni/src/main/java/java/lang/ref/ |
D | ReferenceQueue.java | 66 private boolean enqueueLocked(Reference<? extends T> r) { in enqueueLocked() argument 68 if (r.queueNext != null) { in enqueueLocked() 72 if (r instanceof Cleaner) { in enqueueLocked() 76 Cleaner cl = (sun.misc.Cleaner) r; in enqueueLocked() 81 r.queueNext = sQueueNextUnenqueued; in enqueueLocked() 86 head = r; in enqueueLocked() 88 tail.queueNext = r; in enqueueLocked() 90 tail = r; in enqueueLocked() 91 tail.queueNext = r; in enqueueLocked() 125 Reference<? extends T> r = head; in reallyPollLocked() local [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | ThreadLocalRandom.java | 190 Thread t; long r; // read and update per-thread seed in nextSeed() local 192 r = U.getLong(t, SEED) + GAMMA); in nextSeed() 193 return r; in nextSeed() 211 long r = mix64(nextSeed()); in internalNextLong() local 215 r = (r & m) + origin; in internalNextLong() 217 for (long u = r >>> 1; // ensure nonnegative in internalNextLong() 218 u + m - (r = u % n) < 0L; // rejection check in internalNextLong() 221 r += origin; in internalNextLong() 224 while (r < origin || r >= bound) in internalNextLong() 225 r = mix64(nextSeed()); in internalNextLong() [all …]
|
D | CompletableFuture.java | 225 final boolean internalComplete(Object r) { // CAS from null to r in internalComplete() argument 226 return U.compareAndSwapObject(this, RESULT, null, r); in internalComplete() 294 static Object encodeThrowable(Throwable x, Object r) { in encodeThrowable() argument 297 else if (r instanceof AltResult && x == ((AltResult)r).ex) in encodeThrowable() 298 return r; in encodeThrowable() 310 final boolean completeThrowable(Throwable x, Object r) { in completeThrowable() argument 312 encodeThrowable(x, r)); in completeThrowable() 328 static Object encodeRelay(Object r) { in encodeRelay() argument 330 return (((r instanceof AltResult) && in encodeRelay() 331 (x = ((AltResult)r).ex) != null && in encodeRelay() [all …]
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | BigIntegerBenchmark.java | 24 Random r = new Random(); in timeRandomDivision() local 25 BigInteger x = new BigInteger(1024, r); in timeRandomDivision() 26 BigInteger y = new BigInteger(1024, r); in timeRandomDivision() 33 Random r = new Random(); in timeRandomGcd() local 34 BigInteger x = new BigInteger(1024, r); in timeRandomGcd() 35 BigInteger y = new BigInteger(1024, r); in timeRandomGcd() 42 Random r = new Random(); in timeRandomMultiplication() local 43 BigInteger x = new BigInteger(1024, r); in timeRandomMultiplication() 44 BigInteger y = new BigInteger(1024, r); in timeRandomMultiplication()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | RandomTest.java | 27 private Random r; field in RandomTest 41 Random r = new Random(8409238L); in test_ConstructorJ() local 44 assertTrue("Values from randoms with same seed don't match", r in test_ConstructorJ() 49 Random r = new Random(); in test_setSeed() local 50 r.setSeed(1337); in test_setSeed() 54 assertTrue("Values from randoms with same seed don't match", r in test_setSeed() 66 if (r.nextBoolean()) in test_nextBoolean() 83 r.nextBytes(randomBytes); in test_nextBytes$B() 98 double lastNum = r.nextDouble(); in test_nextDouble() 103 nextNum = r.nextDouble(); in test_nextDouble() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/locks/ |
D | LockSupport.java | 395 int r; in nextSecondarySeed() local 397 if ((r = U.getInt(t, SECONDARY)) != 0) { in nextSecondarySeed() 398 r ^= r << 13; // xorshift in nextSecondarySeed() 399 r ^= r >>> 17; in nextSecondarySeed() 400 r ^= r << 5; in nextSecondarySeed() 402 else if ((r = java.util.concurrent.ThreadLocalRandom.current().nextInt()) == 0) in nextSecondarySeed() 403 r = 1; // avoid zero in nextSecondarySeed() 404 U.putInt(t, SECONDARY, r); in nextSecondarySeed() 405 return r; in nextSecondarySeed()
|
/libcore/luni/src/test/java/tests/java/sql/ |
D | UpdateFunctionalityTest2.java | 189 ResultSet r = statement.executeQuery("SELECT COUNT(*) " + "FROM " in testUpdate5() local 191 r.next(); in testUpdate5() 192 assertEquals("Should be 2 rows", 2, r.getInt(1)); in testUpdate5() 193 r = statement.executeQuery("SELECT COUNT(*) " + "FROM " in testUpdate5() 195 r.next(); in testUpdate5() 196 assertEquals("Should be 0 rows", 0, r.getInt(1)); in testUpdate5() 197 r.close(); in testUpdate5() 232 ResultSet r = statement.executeQuery("SELECT COUNT(*) FROM " in testUpdate7() local 234 r.next(); in testUpdate7() 235 assertEquals("Should be 1 row", 1, r.getInt(1)); in testUpdate7() [all …]
|
/libcore/ojluni/src/main/java/java/lang/ |
D | Math.java | 683 int r = ((intBits & FloatConsts.SIGNIF_BIT_MASK) in round() local 686 r = -r; in round() 694 return ((r >> shift) + 1) >> 1; in round() 732 long r = ((longBits & DoubleConsts.SIGNIF_BIT_MASK) in round() local 735 r = -r; in round() 743 return ((r >> shift) + 1) >> 1; in round() 823 int r = x + y; in addExact() local 825 if (((x ^ r) & (y ^ r)) < 0) { in addExact() 828 return r; in addExact() 842 long r = x + y; in addExact() local [all …]
|