/libcore/ojluni/src/main/java/java/util/ |
D | DualPivotQuicksort.java | 123 for (int k = left; k < right; run[count] = k) { 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() 128 for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { in sort() 132 for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { in sort() 184 for (int k = (last = 0) + 2; k <= count; k += 2) { in sort() 185 int hi = run[k], mi = run[k - 1]; in sort() 186 for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { in sort() [all …]
|
D | PriorityQueue.java | 643 private void siftUp(int k, E x) { in siftUp() argument 645 siftUpUsingComparator(k, x); in siftUp() 647 siftUpComparable(k, x); in siftUp() 651 private void siftUpComparable(int k, E x) { in siftUpComparable() argument 653 while (k > 0) { in siftUpComparable() 654 int parent = (k - 1) >>> 1; in siftUpComparable() 658 queue[k] = e; in siftUpComparable() 659 k = parent; in siftUpComparable() 661 queue[k] = key; in siftUpComparable() 665 private void siftUpUsingComparator(int k, E x) { in siftUpUsingComparator() argument [all …]
|
D | Timer.java | 686 private void fixUp(int k) { 687 while (k > 1) { 688 int j = k >> 1; 689 if (queue[j].nextExecutionTime <= queue[k].nextExecutionTime) 691 TimerTask tmp = queue[j]; queue[j] = queue[k]; queue[k] = tmp; 692 k = j; 706 private void fixDown(int k) { 708 while ((j = k << 1) <= size && j > 0) { 712 if (queue[k].nextExecutionTime <= queue[j].nextExecutionTime) 714 TimerTask tmp = queue[j]; queue[j] = queue[k]; queue[k] = tmp; [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | MapOfTest.java | 256 private<K,V> K k(int index, Map.Entry<K, V>... entries) { in k() method 267 case 1: return Map.of(k(0, e), v(0, e)); in create() 268 case 2: return Map.of(k(0, e), v(0, e), k(1, e), v(1, e)); in create() 269 case 3: return Map.of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e)); in create() 270 … case 4: return Map.of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e), k(3, e), v(3, e)); in create() 271 …case 5: return Map.of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e), k(3, e), v(3, e), k(4,… in create() 272 …case 6: return Map.of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e), k(3, e), v(3, e), k(4,… in create() 273 …case 7: return Map.of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e), k(3, e), v(3, e), k(4,… in create() 274 …eturn Map.of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e), k(3, e), v(3, e), k(4, e), v(4,… in create() 275 ….of(k(0, e), v(0, e), k(1, e), v(1, e), k(2, e), v(2, e), k(3, e), v(3, e), k(4, e), v(4, e), k(5,… in create() [all …]
|
D | MapDefaultMethodTester.java | 303 assertEquals(5.0, m.computeIfAbsent(1, (k) -> 5.0 * k)); in test_computeIfAbsent() 308 assertEquals(1.0, m.computeIfAbsent(1, k -> 6.0 * k)); in test_computeIfAbsent() 313 assertEquals(1.0, m.computeIfAbsent(1, k -> null)); in test_computeIfAbsent() 317 assertNull(m.computeIfAbsent(100, k-> null)); in test_computeIfAbsent() 328 assertEquals(1.0, m.computeIfAbsent(1, k -> 1.0)); in test_computeIfAbsent() 334 assertEquals(1.0, m.computeIfAbsent(null, (k) -> 5.0 * k)); in test_computeIfAbsent() 337 m.computeIfAbsent(null, k -> 5.0); in test_computeIfAbsent() 345 assertNull(m.computeIfPresent(1, (k, v) -> 5.0 * k + v)); in test_computeIfPresent() 349 assertEquals(11.0, m.computeIfPresent(1, (k, v) -> 6.0 * k + v)); in test_computeIfPresent() 353 assertNull(m.computeIfPresent(1, (k, v) -> null)); in test_computeIfPresent() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/ |
D | OldSHA1PRNGSecureRandomTest.java | 132 for (int k = 1; k < LENGTH; k += INCR) { in testNextBytesbyteArray02() 133 myBytes1 = new byte[k]; in testNextBytesbyteArray02() 134 myBytes2 = new byte[k]; in testNextBytesbyteArray02() 138 for (int l = 0; l < k; l++) { in testNextBytesbyteArray02() 139 assertFalse("unexpected: myBytes1[l] != myBytes2[l] :: l==" + l + " k=" + k in testNextBytesbyteArray02() 154 for (int k = 0; k < bytes1.length; k++) { in testNextBytesbyteArray02() 155 sr.nextBytes(bytes1[k]); in testNextBytesbyteArray02() 157 for (int k = 0; k < bytes2.length; k++) { in testNextBytesbyteArray02() 158 sr2.nextBytes(bytes2[k]); in testNextBytesbyteArray02() 161 for (int k = 0; k < n3; k++) { in testNextBytesbyteArray02() [all …]
|
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/ |
D | DigestOutputStreamTest.java | 145 for (int k=0; k<algorithmName.length; k++) { in testWriteint01() 147 MessageDigest md = MessageDigest.getInstance(algorithmName[k]); in testWriteint01() 157 MDGoldenData.getDigest(algorithmName[k]))); in testWriteint01() 177 for (int k=0; k<algorithmName.length; k++) { in testWriteint02() 179 MessageDigest md = MessageDigest.getInstance(algorithmName[k]); in testWriteint02() 194 MDGoldenData.getDigest(algorithmName[k]+"_NU"))); in testWriteint02() 211 for (int k=0; k<algorithmName.length; k++) { in testWriteint03() 213 MessageDigest md = MessageDigest.getInstance(algorithmName[k]); in testWriteint03() 284 for (int k=0; k<algorithmName.length; k++) { in test_write$BII_1() 287 MessageDigest md = MessageDigest.getInstance(algorithmName[k]); in test_write$BII_1() [all …]
|
/libcore/ojluni/src/main/java/sun/net/www/ |
D | MessageHeader.java | 84 public synchronized String findValue(String k) { in findValue() argument 85 if (k == null) { in findValue() 91 if (k.equalsIgnoreCase(keys[i])) in findValue() 98 public synchronized int getKey(String k) { in getKey() argument 100 if ((keys[i] == k) || in getKey() 101 (k != null && k.equalsIgnoreCase(keys[i]))) in getKey() 127 public synchronized String findNextValue(String k, String v) { in findNextValue() argument 129 if (k == null) { in findNextValue() 138 if (k.equalsIgnoreCase(keys[i])) in findNextValue() 151 public boolean filterNTLMResponses(String k) { in filterNTLMResponses() argument [all …]
|
/libcore/ojluni/src/main/java/java/nio/channels/spi/ |
D | AbstractSelectableChannel.java | 95 private void addKey(SelectionKey k) { in addKey() argument 114 keys[i] = k; in addKey() 129 void removeKey(SelectionKey k) { // package-private in removeKey() argument 132 if (keys[i] == k) { in removeKey() 136 ((AbstractSelectionKey)k).invalidate(); in removeKey() 202 SelectionKey k = findKey(sel); in register() local 203 if (k != null) { in register() 204 k.interestOps(ops); in register() 205 k.attach(att); in register() 207 if (k == null) { in register() [all …]
|
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/ |
D | KeyGeneratorThread.java | 32 Key k = kg.generateKey(); in test() local 33 if(kg.getAlgorithm().toLowerCase().equals(k.getAlgorithm().toLowerCase()) != true) { in test() 41 byte[] array1 = k.getEncoded(); in test() 42 k = kg.generateKey(); in test() 43 byte[] array2 = k.getEncoded(); in test() 56 k = kg.generateKey(); in test() 57 array1 = k.getEncoded(); in test() 60 k = kg.generateKey(); in test() 61 array2 = k.getEncoded(); in test()
|
/libcore/ojluni/annotations/hiddenapi/sun/net/www/ |
D | MessageHeader.java | 57 public synchronized java.lang.String findValue(java.lang.String k) { in findValue() argument 61 public synchronized int getKey(java.lang.String k) { in getKey() argument 73 public synchronized java.lang.String findNextValue(java.lang.String k, java.lang.String v) { in findNextValue() argument 77 public boolean filterNTLMResponses(java.lang.String k) { in filterNTLMResponses() argument 81 public java.util.Iterator<java.lang.String> multiValueIterator(java.lang.String k) { in multiValueIterator() argument 108 public synchronized void add(java.lang.String k, java.lang.String v) { in add() argument 113 public synchronized void prepend(java.lang.String k, java.lang.String v) { in prepend() argument 117 public synchronized void set(int i, java.lang.String k, java.lang.String v) { in set() argument 125 public synchronized void remove(java.lang.String k) { in remove() argument 130 public synchronized void set(java.lang.String k, java.lang.String v) { in set() argument [all …]
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | TCKZoneOffset.java | 254 for (int k = -59; k <= 59; k++) { in test_factory_string_hours_minutes_seconds_noColon() 255 if ((i < 0 && j <= 0 && k <= 0) || (i > 0 && j >= 0 && k >= 0) || in test_factory_string_hours_minutes_seconds_noColon() 256 (i == 0 && ((j < 0 && k <= 0) || (j > 0 && k >= 0) || j == 0))) { in test_factory_string_hours_minutes_seconds_noColon() 257 String str = (i < 0 || j < 0 || k < 0 ? "-" : "+") + in test_factory_string_hours_minutes_seconds_noColon() 260 Integer.toString(Math.abs(k) + 100).substring(1); in test_factory_string_hours_minutes_seconds_noColon() 262 doTestOffset(test, i, j, k); in test_factory_string_hours_minutes_seconds_noColon() 277 for (int k = -59; k <= 59; k++) { in test_factory_string_hours_minutes_seconds_colon() 278 if ((i < 0 && j <= 0 && k <= 0) || (i > 0 && j >= 0 && k >= 0) || in test_factory_string_hours_minutes_seconds_colon() 279 (i == 0 && ((j < 0 && k <= 0) || (j > 0 && k >= 0) || j == 0))) { in test_factory_string_hours_minutes_seconds_colon() 280 String str = (i < 0 || j < 0 || k < 0 ? "-" : "+") + in test_factory_string_hours_minutes_seconds_colon() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | TreeSubMapTest.java | 180 Integer k = (Integer)i.next(); in testKeySetOrder() local 181 assertTrue(last.compareTo(k) < 0); in testKeySetOrder() 182 last = k; in testKeySetOrder() 469 Object k; 470 k = (Integer)(i.next()); 471 assertEquals(two, k); 472 k = (Integer)(i.next()); 473 assertEquals(three, k); 500 Object k; 501 k = (Integer)(i.next()); [all …]
|
D | TreeSubSetTest.java | 513 Object k; in testSubSetContents() local 514 k = (Integer)(i.next()); in testSubSetContents() 515 assertEquals(two, k); in testSubSetContents() 516 k = (Integer)(i.next()); in testSubSetContents() 517 assertEquals(three, k); in testSubSetContents() 544 Object k; in testSubSetContents2() local 545 k = (Integer)(i.next()); in testSubSetContents2() 546 assertEquals(two, k); in testSubSetContents2() 571 Object k; in testHeadSetContents() local 572 k = (Integer)(i.next()); in testHeadSetContents() [all …]
|
D | ConcurrentSkipListSubSetTest.java | 516 Object k; in testSubSetContents() local 517 k = (Integer)(i.next()); in testSubSetContents() 518 assertEquals(two, k); in testSubSetContents() 519 k = (Integer)(i.next()); in testSubSetContents() 520 assertEquals(three, k); in testSubSetContents() 547 Object k; in testSubSetContents2() local 548 k = (Integer)(i.next()); in testSubSetContents2() 549 assertEquals(two, k); in testSubSetContents2() 574 Object k; in testHeadSetContents() local 575 k = (Integer)(i.next()); in testHeadSetContents() [all …]
|
D | TreeMapTest.java | 188 Integer k = (Integer)i.next(); in testKeySetOrder() local 189 assertTrue(last.compareTo(k) < 0); in testKeySetOrder() 190 last = k; in testKeySetOrder() 207 Integer k = (Integer)i.next(); 208 assertTrue(last.compareTo(k) > 0); 209 last = k; 226 Integer k = (Integer)i.next(); in testDescendingKeySetOrder() local 227 assertTrue(last.compareTo(k) > 0); in testDescendingKeySetOrder() 228 last = k; in testDescendingKeySetOrder() 245 Integer k = (Integer)i.next(); in testDescendingKeySetDescendingIteratorOrder() local [all …]
|
D | ConcurrentSkipListSubMapTest.java | 181 Integer k = (Integer)i.next(); in testKeySetOrder() local 182 assertTrue(last.compareTo(k) < 0); in testKeySetOrder() 183 last = k; in testKeySetOrder() 634 Object k; 635 k = (Integer)(i.next()); 636 assertEquals(two, k); 637 k = (Integer)(i.next()); 638 assertEquals(three, k); 665 Object k; 666 k = (Integer)(i.next()); [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | TreeSubMapTest.java | 203 Integer k = (Integer)i.next(); in testKeySetOrder() local 204 assertTrue(last.compareTo(k) < 0); in testKeySetOrder() 205 last = k; in testKeySetOrder() 492 Object k; 493 k = (Integer)(i.next()); 494 assertEquals(two, k); 495 k = (Integer)(i.next()); 496 assertEquals(three, k); 523 Object k; 524 k = (Integer)(i.next()); [all …]
|
D | TreeSubSetTest.java | 536 Object k; in testSubSetContents() local 537 k = (Integer)(i.next()); in testSubSetContents() 538 assertEquals(two, k); in testSubSetContents() 539 k = (Integer)(i.next()); in testSubSetContents() 540 assertEquals(three, k); in testSubSetContents() 567 Object k; in testSubSetContents2() local 568 k = (Integer)(i.next()); in testSubSetContents2() 569 assertEquals(two, k); in testSubSetContents2() 594 Object k; in testHeadSetContents() local 595 k = (Integer)(i.next()); in testHeadSetContents() [all …]
|
D | ConcurrentSkipListSubSetTest.java | 539 Object k; in testSubSetContents() local 540 k = (Integer)(i.next()); in testSubSetContents() 541 assertEquals(two, k); in testSubSetContents() 542 k = (Integer)(i.next()); in testSubSetContents() 543 assertEquals(three, k); in testSubSetContents() 570 Object k; in testSubSetContents2() local 571 k = (Integer)(i.next()); in testSubSetContents2() 572 assertEquals(two, k); in testSubSetContents2() 597 Object k; in testHeadSetContents() local 598 k = (Integer)(i.next()); in testHeadSetContents() [all …]
|
D | TreeMapTest.java | 211 Integer k = (Integer)i.next(); in testKeySetOrder() local 212 assertTrue(last.compareTo(k) < 0); in testKeySetOrder() 213 last = k; in testKeySetOrder() 230 Integer k = (Integer)i.next(); 231 assertTrue(last.compareTo(k) > 0); 232 last = k; 249 Integer k = (Integer)i.next(); in testDescendingKeySetOrder() local 250 assertTrue(last.compareTo(k) > 0); in testDescendingKeySetOrder() 251 last = k; in testDescendingKeySetOrder() 268 Integer k = (Integer)i.next(); in testDescendingKeySetDescendingIteratorOrder() local [all …]
|
D | ConcurrentSkipListMapTest.java | 212 Integer k = (Integer)i.next(); in testKeySetOrder() local 213 assertTrue(last.compareTo(k) < 0); in testKeySetOrder() 214 last = k; in testKeySetOrder() 231 Integer k = (Integer)i.next(); 232 assertTrue(last.compareTo(k) > 0); 233 last = k; 250 Integer k = (Integer)i.next(); in testDescendingKeySetOrder() local 251 assertTrue(last.compareTo(k) > 0); in testDescendingKeySetOrder() 252 last = k; in testDescendingKeySetOrder() 269 Integer k = (Integer)i.next(); in testDescendingKeySetDescendingIteratorOrder() local [all …]
|
/libcore/luni/src/test/java/tests/java/security/ |
D | IdentityTest.java | 67 for (int k=0; k<value.length; k+=2) { in testEquals() 68 assertEquals(value[k+1], new Boolean(i1.equals(value[k]))); in testEquals() 69 if (Boolean.TRUE.equals(value[k+1])) assertEquals(i1.hashCode(), value[k].hashCode()); in testEquals() 230 for (int k=0; k<value.length; k+=2){ in testIdentityEquals() 231 assertEquals(value[k+1], new Boolean(i.identityEquals((Identity)value[k]))); in testIdentityEquals() 232 if (Boolean.TRUE.equals(value[k+1])) assertEquals(i.hashCode(), value[k].hashCode()); in testIdentityEquals()
|
/libcore/ojluni/src/main/java/java/io/ |
D | ByteArrayInputStream.java | 212 long k = count - pos; in skip() local 213 if (n < k) { in skip() 214 k = n < 0 ? 0 : n; in skip() 217 pos += k; in skip() 218 return k; in skip()
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | PriorityBlockingQueue.java | 355 private static <T> void siftUpComparable(int k, T x, Object[] array) { in siftUpComparable() argument 357 while (k > 0) { in siftUpComparable() 358 int parent = (k - 1) >>> 1; in siftUpComparable() 362 array[k] = e; in siftUpComparable() 363 k = parent; in siftUpComparable() 365 array[k] = key; in siftUpComparable() 368 private static <T> void siftUpUsingComparator(int k, T x, Object[] array, in siftUpUsingComparator() argument 370 while (k > 0) { in siftUpUsingComparator() 371 int parent = (k - 1) >>> 1; in siftUpUsingComparator() 375 array[k] = e; in siftUpUsingComparator() [all …]
|