/libcore/jsr166-tests/src/test/java/jsr166/ |
D | ThreadLocalRandom8Test.java | 78 long size = 0; in testIntsCount() local 81 r.ints(size).parallel().forEach(x -> counter.increment()); in testIntsCount() 82 assertEquals(size, counter.sum()); in testIntsCount() 83 size += 524959; in testIntsCount() 93 long size = 0; in testLongsCount() local 96 r.longs(size).parallel().forEach(x -> counter.increment()); in testLongsCount() 97 assertEquals(size, counter.sum()); in testLongsCount() 98 size += 524959; in testLongsCount() 108 long size = 0; in testDoublesCount() local 111 r.doubles(size).parallel().forEach(x -> counter.increment()); in testDoublesCount() [all …]
|
/libcore/ojluni/src/test/java/lang/StringBuffer/ |
D | Capacity.java | 44 for (int size : sizes) { in test() 47 StringBuffer buff = new StringBuffer(size); in test() 48 StringBuilder bild = new StringBuilder(size); in test() 49 equal(size, buff.capacity()); in test() 50 equal(size, bild.capacity()); in test() 51 buff.ensureCapacity(size); in test() 52 bild.ensureCapacity(size); in test() 53 equal(size, buff.capacity()); in test() 54 equal(size, bild.capacity()); in test() 55 buff.ensureCapacity(size+1); in test() [all …]
|
/libcore/luni/src/main/java/libcore/util/ |
D | NativeAllocationRegistry.java | 64 private final long size; field in NativeAllocationRegistry 94 @NonNull ClassLoader classLoader, long freeFunction, long size) { in createNonmalloced() argument 95 return new NativeAllocationRegistry(classLoader, freeFunction, size, false); in createNonmalloced() 126 @NonNull ClassLoader classLoader, long freeFunction, long size) { in createMalloced() argument 127 return new NativeAllocationRegistry(classLoader, freeFunction, size, true); in createMalloced() 180 private NativeAllocationRegistry(ClassLoader classLoader, long freeFunction, long size, in NativeAllocationRegistry() argument 182 if (size < 0) { in NativeAllocationRegistry() 183 throw new IllegalArgumentException("Invalid native allocation size: " + size); in NativeAllocationRegistry() 187 this.size = mallocAllocation ? (size | IS_MALLOCED) : (size & ~IS_MALLOCED); in NativeAllocationRegistry() 219 … public NativeAllocationRegistry(@NonNull ClassLoader classLoader, long freeFunction, long size) { in NativeAllocationRegistry() argument [all …]
|
/libcore/ojluni/src/main/java/java/nio/channels/ |
D | FileLock.java | 127 private final long size; field in FileLock 152 long position, long size, boolean shared) in FileLock() argument 161 if (size < 0) in FileLock() 163 if (position + size < 0) in FileLock() 167 this.size = size; in FileLock() 195 long position, long size, boolean shared) in FileLock() argument 204 if (size < 0) in FileLock() 206 if (position + size < 0) in FileLock() 210 this.size = size; in FileLock() 261 public final long size() { in size() method in FileLock [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | ThreadLocalRandom8Test.java | 101 long size = 0; in testIntsCount() local 104 r.ints(size).parallel().forEach(x -> counter.increment()); in testIntsCount() 105 assertEquals(size, counter.sum()); in testIntsCount() 106 size += 524959; in testIntsCount() 116 long size = 0; in testLongsCount() local 119 r.longs(size).parallel().forEach(x -> counter.increment()); in testLongsCount() 120 assertEquals(size, counter.sum()); in testLongsCount() 121 size += 524959; in testLongsCount() 131 long size = 0; in testDoublesCount() local 134 r.doubles(size).parallel().forEach(x -> counter.increment()); in testDoublesCount() [all …]
|
/libcore/luni/src/main/java/libcore/io/ |
D | MemoryMappedFile.java | 37 private final int size; field in MemoryMappedFile 40 public MemoryMappedFile(long address, long size) { in MemoryMappedFile() argument 43 if (size < 0 || size > Integer.MAX_VALUE) { in MemoryMappedFile() 44 throw new IllegalArgumentException("Unsupported file size=" + size); in MemoryMappedFile() 46 this.size = (int) size; in MemoryMappedFile() 56 long size = Libcore.os.fstat(fd).st_size; in mmapRO() local 57 long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0); in mmapRO() 58 return new MemoryMappedFile(address, size); in mmapRO() 75 Libcore.os.munmap(address, size); in close() 89 this, address, size, ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN); in bigEndianIterator() [all …]
|
/libcore/ojluni/src/test/java/util/IdentityHashMap/ |
D | Capacity.java | 66 for (int size = 0; size < 200; size++) 67 sizes.add(new Object[] { size }); in sizes.add() argument 70 for (int size : new int[] {682, 683, 1365, 2730, 2731, 5461}) 71 sizes.add(new Object[] { size }); in sizes.add() argument 118 public void canInsertExpectedItemsWithoutResizing(int size) in canInsertExpectedItemsWithoutResizing() argument 121 IdentityHashMap<Object,Object> m = new IdentityHashMap<>(size); in canInsertExpectedItemsWithoutResizing() 123 growUsingPut(m, size); in canInsertExpectedItemsWithoutResizing() 128 if (size > 1) { in canInsertExpectedItemsWithoutResizing() 129 growUsingPut(m, size); in canInsertExpectedItemsWithoutResizing() 134 m = new IdentityHashMap<>(size); in canInsertExpectedItemsWithoutResizing() [all …]
|
/libcore/ojluni/src/main/java/java/util/ |
D | ReverseOrderListView.java | 82 final ListIterator<E> it = base.listIterator(base.size()); 95 DescendingListIterator(int size, int pos) { in DescendingListIterator() argument 96 if (pos < 0 || pos > size) in DescendingListIterator() 98 it = base.listIterator(size - pos); in DescendingListIterator() 118 return base.size() - it.nextIndex(); in nextIndex() 277 public int size() { in size() method in ReverseOrderListView 278 return base.size(); in size() 319 int size = base.size(); in add() local 320 checkClosedRange(index, size); in add() 321 base.add(size - index, element); in add() [all …]
|
D | ArrayList.java | 152 private int size; field in ArrayList 189 if ((size = a.length) != 0) { in ArrayList() 193 elementData = Arrays.copyOf(a, size, Object[].class); in ArrayList() 208 if (size < elementData.length) { in trimToSize() 209 elementData = (size == 0) in trimToSize() 211 : Arrays.copyOf(elementData, size); in trimToSize() 251 return grow(size + 1); in grow() 259 public int size() { in size() method in ArrayList 260 return size; in size() 269 return size == 0; in isEmpty() [all …]
|
D | ImmutableCollections.java | 272 int size = size(); in subList() local 273 subListRangeCheck(fromIndex, toIndex, size); in subList() 277 static void subListRangeCheck(int fromIndex, int toIndex, int size) { in subListRangeCheck() argument 280 if (toIndex > size) in subListRangeCheck() 289 return new ListItr<E>(this, size()); in iterator() 299 int size = size(); in listIterator() local 300 if (index < 0 || index > size) { in listIterator() 303 return new ListItr<E>(this, size, index); in listIterator() 317 for (int i = 0, s = size(); i < s; i++) { in equals() 328 for (int i = 0, s = size(); i < s; i++) { in hashCode() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | SplittableRandomTest.java | 89 var size = 10; in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_boundedStream() local 91 var splitRandom1 = random1.splits(size, new SplittableRandom(sourceSeed)).toList(); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_boundedStream() 92 var splitRandom2 = random2.splits(size, new SplittableRandom(sourceSeed)).toList(); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_boundedStream() 94 assertEquals(size, splitRandom1.size()); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_boundedStream() 95 assertEquals(size, splitRandom2.size()); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_boundedStream() 97 for (int i = 0; i < size; ++i) { in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_boundedStream() 111 var size = 10; in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_unboundedStream() local 113 var splitRandom1 = random1.splits(new SplittableRandom(sourceSeed)).limit(size).toList(); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_unboundedStream() 114 var splitRandom2 = random2.splits(new SplittableRandom(sourceSeed)).limit(size).toList(); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_unboundedStream() 116 assertEquals(size, splitRandom1.size()); in splitsInstances_areTheSame_whenTheyAreSplitWithIdenticalSource_unboundedStream() [all …]
|
D | RandomTest.java | 82 final int size = 32; in test_ints$L() local 85 int[] rands = new int[size]; in test_ints$L() 86 for(int i = 0; i < size; ++i) { in test_ints$L() 90 int[] streamRands = new Random(0).ints(size).toArray(); in test_ints$L() 92 assertEquals(size, new Random(0).ints(size).count()); in test_ints$L() 124 final int size = 32; in test_ints$LII() local 128 int[] rands = new int[size]; in test_ints$LII() 129 for(int i = 0; i < size; ++i) { in test_ints$LII() 133 int[] streamRands = new Random(0).ints(size, origin, bound).toArray(); in test_ints$LII() 135 assertEquals(size, new Random(0).ints(size, origin, bound).count()); in test_ints$LII() [all …]
|
/libcore/luni/src/test/java/libcore/libcore/io/ |
D | MemoryTest.java | 148 final int size = 100; in testMemmove() local 149 checkPartialMemmove(size, 0, 0, size); in testMemmove() 150 checkPartialMemmove(size, 0, 0, size / 2); in testMemmove() 151 checkPartialMemmove(size, size / 2, size / 2, size - size / 2); in testMemmove() 152 checkPartialMemmove(size, 10, 20, 20); in testMemmove() 154 checkOverlappingMemmove(size, 0, 0, size); in testMemmove() 155 checkOverlappingMemmove(size, 10, 20, 30); in testMemmove() 156 checkOverlappingMemmove(size, 20, 10, 30); in testMemmove() 159 private void checkPartialMemmove(int size, int offsetDst, int offsetSrc, int count) { in checkPartialMemmove() argument 160 byte[] src = new byte[size]; in checkPartialMemmove() [all …]
|
/libcore/ojluni/src/test/java/util/Random/ |
D | RandomTest.java | 234 long size = 0; in testIntsCount() local 237 r.ints(size).forEach(x -> { in testIntsCount() 240 assertEquals(counter.sum(), size); in testIntsCount() local 241 size += 524959; in testIntsCount() 251 long size = 0; in testLongsCount() local 254 r.longs(size).forEach(x -> { in testLongsCount() 257 assertEquals(counter.sum(), size); in testLongsCount() local 258 size += 524959; in testLongsCount() 268 long size = 0; in testDoublesCount() local 271 r.doubles(size).forEach(x -> { in testDoublesCount() [all …]
|
/libcore/ojluni/src/test/java/util/Collection/ |
D | BiggernYours.java | 196 static int randomize(int size) { 197 return rnd.nextInt(size + 2); 205 public int size() { 206 return randomize(super.size()); 216 public int size() { 217 return randomize(super.size()); 227 public int size() { 228 return randomize(super.size()); 238 public int size() { 239 return randomize(super.size()); [all …]
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | WhileOpTest.java | 61 for (int size : sizes(data.size())) { in testTakeWhileOps() 62 setContext("takeWhile", size); in testTakeWhileOps() 65 whileResultAsserter(data, WhileOp.Take, e -> e < size), in testTakeWhileOps() 66 s -> s.takeWhile(e -> e < size), in testTakeWhileOps() 67 s -> s.takeWhile(e -> e < size), in testTakeWhileOps() 68 s -> s.takeWhile(e -> e < size), in testTakeWhileOps() 69 s -> s.takeWhile(e -> e < size)); in testTakeWhileOps() 73 whileResultAsserter(data, WhileOp.Take, e -> e < size / 2), in testTakeWhileOps() 74 s -> s.takeWhile(e -> e < size).takeWhile(e -> e < size / 2), in testTakeWhileOps() 75 s -> s.takeWhile(e -> e < size).takeWhile(e -> e < size / 2), in testTakeWhileOps() [all …]
|
D | StreamBuilderTest.java | 99 public void testAfterBuilding(int size) { in testAfterBuilding() argument 101 IntStream.range(0, size).boxed().forEach(sb); in testAfterBuilding() 111 public void testStreamBuilder(int size) { in testStreamBuilder() argument 112 testStreamBuilder(size, (s) -> { in testStreamBuilder() 118 testStreamBuilder(size, (s) -> { in testStreamBuilder() 128 private void testStreamBuilder(int size, Function<Integer, Stream<Integer>> supplier) { in testStreamBuilder() argument 129 TestData.OfRef<Integer> data = TestData.Factory.ofSupplier(String.format("[0, %d)", size), in testStreamBuilder() 130 () -> supplier.apply(size)); in testStreamBuilder() 134 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder() 139 expectedResult(IntStream.range(0, size).boxed().collect(toList())). in testStreamBuilder() [all …]
|
/libcore/ojluni/src/main/java/java/text/ |
D | CharacterIteratorFieldDelegate.java | 49 private int size; field in CharacterIteratorFieldDelegate 59 if (start < size) { in formatted() 61 int index = size; in formatted() 62 int asIndex = attributedStrings.size() - 1; in formatted() 76 if (size < start) { in formatted() 79 buffer.substring(size, start))); in formatted() 80 size = start; in formatted() 82 if (size < end) { in formatted() 84 int aStart = Math.max(start, size); in formatted() 90 size = end; in formatted() [all …]
|
/libcore/ojluni/src/test/java/util/Arrays/ |
D | SortingNearlySortedPrimitive.java | 147 public void testShapes(String testName, IntFunction<int[]> dataMethod, int size) { in testShapes() argument 148 int[] intSourceArray = dataMethod.apply(size); in testShapes() 253 private int[] zeroHiData(int size) { in zeroHiData() argument 254 int[] array = new int[size]; in zeroHiData() 256 int threeQuarters = (int) (size * 0.75); in zeroHiData() 261 for (int i = threeQuarters; i < size; i++) { in zeroHiData() 269 private int[] hiZeroLowData(int size) { in hiZeroLowData() argument 270 int[] array = new int[size]; in hiZeroLowData() 272 int oneThird = size / 3; in hiZeroLowData() 280 for (int i = twoThirds; i < size; i++) { in hiZeroLowData() [all …]
|
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/ |
D | NodeBuilderTest.java | 51 for (int size : sizes) { in createNodeBuilders() 52 ls.add(countTo(size)); in createNodeBuilders() 60 Object[][] params = new Object[ls.size() * ms.size()][]; in createNodeBuilders() 73 Node.Builder<Integer> nb = m.apply(l.size()); in testIteration() 74 nb.begin(l.size()); in testIteration() 81 assertEquals(n.count(), l.size()); in testIteration() 96 for (int size : sizes) { in createIntNodeBuilders() 97 ls.add(countTo(size)); in createIntNodeBuilders() 105 Object[][] params = new Object[ls.size() * ms.size()][]; in createIntNodeBuilders() 118 Node.Builder.OfInt nb = m.apply(l.size()); in testIntIteration() [all …]
|
/libcore/ojluni/src/main/java/sun/nio/fs/ |
D | NativeBuffers.java | 46 static NativeBuffer allocNativeBuffer(int size) { in allocNativeBuffer() argument 48 if (size < 2048) size = 2048; in allocNativeBuffer() 49 return new NativeBuffer(size); in allocNativeBuffer() 56 static NativeBuffer getNativeBufferFromCache(int size) { in getNativeBufferFromCache() argument 62 if (buffer != null && buffer.size() >= size) { in getNativeBufferFromCache() 76 static NativeBuffer getNativeBuffer(int size) { in getNativeBuffer() argument 77 NativeBuffer buffer = getNativeBufferFromCache(size); in getNativeBuffer() 82 return allocNativeBuffer(size); in getNativeBuffer() 109 if (existing.size() < buffer.size()) { in releaseNativeBuffer() 128 assert buffer.size() >= (len + 1); in copyCStringToNativeBuffer()
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | CopyOnWriteArrayList.java | 174 public int size() { in size() method in CopyOnWriteArrayList 184 return size() == 0; in isEmpty() 397 static String outOfBounds(int index, int size) { in outOfBounds() argument 398 return "Index: " + index + ", Size: " + size; in outOfBounds() 574 int size = getArray().length; in removeLast() local 575 if (size == 0) in removeLast() 578 return remove(size - 1); in removeLast() 1236 final int size = snapshot.length; in forEachRemaining() local 1238 cursor = size; in forEachRemaining() 1239 for (; i < size; i++) in forEachRemaining() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
D | ArrayDequeTest.java | 69 assertEquals(0, new ArrayDeque<Object>().size()); in test_Constructor() 76 assertEquals(0, new ArrayDeque<Object>(new ArrayList<Object>()).size()); in test_Constructor_LCollection() 89 assertEquals(0, new ArrayDeque<Object>(8).size()); in test_Constructor_Int() 91 assertEquals(0, zeroCapQue.size()); in test_Constructor_Int() 93 assertEquals(1, zeroCapQue.size()); in test_Constructor_Int() 94 assertEquals(0, new ArrayDeque<Object>(0).size()); in test_Constructor_Int() 96 assertEquals(0, negCapQue.size()); in test_Constructor_Int() 98 assertEquals(1, negCapQue.size()); in test_Constructor_Int() 100 assertEquals(0, oneCapQue.size()); in test_Constructor_Int() 102 assertEquals(1, oneCapQue.size()); in test_Constructor_Int() [all …]
|
D | TreeMapTest.java | 128 assertTrue("Map is incorrect size", myTreeMap.size() == objArray.length); in test_ConstructorLjava_util_Map() 160 assertEquals("Cleared map returned non-zero size", 0, tm.size()); in test_clear() 247 anEntrySet.size() == objArray.length); in test_entrySet() 281 assertEquals(2, tm.values().size()); in test_getLjava_lang_Object() 282 assertEquals(2, tm.keySet().size()); in test_getLjava_lang_Object() 295 assertEquals("Returned map of incorrect size", 3, head.size()); in test_headMapLjava_lang_Object() 310 assertEquals(0, smap.size()); in test_headMapLjava_lang_Object() 313 assertEquals(0, keySet.size()); in test_headMapLjava_lang_Object() 316 assertEquals(0, entrySet.size()); in test_headMapLjava_lang_Object() 319 assertEquals(0, valueCollection.size()); in test_headMapLjava_lang_Object() [all …]
|
/libcore/ojluni/src/main/java/sun/nio/ch/ |
D | IOVecWrapper.java | 55 private final int size; field in IOVecWrapper 85 private IOVecWrapper(int size) { in IOVecWrapper() argument 86 this.size = size; in IOVecWrapper() 87 this.buf = new ByteBuffer[size]; in IOVecWrapper() 88 this.position = new int[size]; in IOVecWrapper() 89 this.remaining = new int[size]; in IOVecWrapper() 90 this.shadow = new ByteBuffer[size]; in IOVecWrapper() 91 this.vecArray = new AllocatedNativeObject(size * SIZE_IOVEC, false); in IOVecWrapper() 95 static IOVecWrapper get(int size) { in get() argument 97 if (wrapper != null && wrapper.size < size) { in get() [all …]
|