Home
last modified time | relevance | path

Searched refs:list (Results 1 – 25 of 196) sorted by relevance

12345678

/libcore/ojluni/src/main/java/sun/nio/ch/
DFileLockTable.java125 List<FileLockReference> list = lockMap.get(fileKey); in add() local
130 if (list == null) { in add()
131 list = new ArrayList<FileLockReference>(2); in add()
133 synchronized (list) { in add()
134 prev = lockMap.putIfAbsent(fileKey, list); in add()
137 list.add(new FileLockReference(fl, queue, fileKey)); in add()
142 list = prev; in add()
149 synchronized (list) { in add()
151 if (list == current) { in add()
152 checkList(list, fl.position(), fl.size()); in add()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_ListTest.java27 List<Integer> list; // must contain the Integers 0 to 99 in order field in Support_ListTest
35 list = l; in Support_ListTest()
43 elem = list.get(counter); in runTest()
48 assertTrue("ListTest - hashCode failed", hashCode == list.hashCode()); in runTest()
50 list.add(50, new Integer(1000)); in runTest()
51 assertTrue("ListTest - a) add with index failed--did not insert", list in runTest()
55 list.get(51).equals(new Integer(50))); in runTest()
58 list.get(49).equals(new Integer(49))); in runTest()
60 list.set(50, new Integer(2000)); in runTest()
61 assertTrue("ListTest - a) set failed--did not set", list.get(50) in runTest()
[all …]
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DCopyOnWriteArrayListTest.java37 CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<String>(); in testIteratorAndNonStructuralChanges() local
38 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testIteratorAndNonStructuralChanges()
39 Iterator<String> abcde = list.iterator(); in testIteratorAndNonStructuralChanges()
41 list.set(1, "B"); in testIteratorAndNonStructuralChanges()
54 CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<String>(); in testSubListAndNonStructuralChanges() local
55 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testSubListAndNonStructuralChanges()
56 List<String> bcd = list.subList(1, 4); in testSubListAndNonStructuralChanges()
57 list.set(2, "C"); in testSubListAndNonStructuralChanges()
66 CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<String>(); in testSubListAndStructuralChanges() local
67 list.addAll(Arrays.asList("a", "b", "c", "d", "e")); in testSubListAndStructuralChanges()
[all …]
/libcore/ojluni/src/main/java/sun/security/jca/
DProviders.java166 ProviderList list = getThreadProviderList(); in getProviderList() local
167 if (list == null) { in getProviderList()
168 list = getSystemProviderList(); in getProviderList()
170 return list; in getProviderList()
191 ProviderList list; in getFullProviderList() local
193 list = getThreadProviderList(); in getFullProviderList()
194 if (list != null) { in getFullProviderList()
195 ProviderList newList = list.removeInvalid(); in getFullProviderList()
196 if (newList != list) { in getFullProviderList()
198 list = newList; in getFullProviderList()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DArrayListTest.java33 ArrayList<String> list = new ArrayList<>(Arrays.asList("zero", "one", "two")); in test_sublist_throws() local
36 list.subList(1, 2); in test_sublist_throws()
37 list.subList(0, 3); in test_sublist_throws()
38 list.subList(1, 1); in test_sublist_throws()
42 list.subList(-1, 1); // fromIndex out of bounds in test_sublist_throws()
48 list.subList(0, 4); // toIndex out of bounds in test_sublist_throws()
54 list.subList(-1, 4); // both fromIndex and toIndex out of bounds in test_sublist_throws()
60 list.subList(1, 0); // fromIndex > toIndex in test_sublist_throws()
67 List<String> list = new ArrayList<>(Arrays.asList("zero", "one", "two")); in test_sublist_set() local
68 list.subList(1, 2).set(0, "ONE"); in test_sublist_set()
[all …]
DArraysTest.java44 int[] list = new int[3]; in setAll$I() local
45 list[0] = 0; in setAll$I()
46 list[1] = 1; in setAll$I()
47 list[2] = 2; in setAll$I()
49 Arrays.setAll(list, x -> x + 1); in setAll$I()
50 assertEquals(1, list[0]); in setAll$I()
51 assertEquals(2, list[1]); in setAll$I()
52 assertEquals(3, list[2]); in setAll$I()
55 Arrays.setAll(list, null); in setAll$I()
72 int[] list = new int[3]; in parallelSetAll$I() local
[all …]
DListOfTest.java75 List<?> list = List.of("element", 42); in mixedTypes() local
76 assertEquals(asList("element", 42), list); in mixedTypes()
78 assertTrue(list.contains("element")); in mixedTypes()
79 assertTrue(list.contains(42)); in mixedTypes()
80 assertFalse(list.contains(new Object())); in mixedTypes()
81 assertFalse(list.contains(31)); in mixedTypes()
199 private static<T extends Comparable<T>> void assertUnmodifiable(List<T> list, T example) { in assertUnmodifiable() argument
201 assertThrowsUoe(() -> { list.add(example); } ); in assertUnmodifiable()
202 assertThrowsUoe(() -> { list.addAll(examples); } ); in assertUnmodifiable()
203 assertThrowsUoe(() -> { list.addAll(0, examples); } ); in assertUnmodifiable()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DHttpCookieTest.java611 List<HttpCookie> list = HttpCookie in test_Parse_locale() local
613 HttpCookie cookie = list.get(0); in test_Parse_locale()
617 list = HttpCookie in test_Parse_locale()
619 cookie = list.get(0); in test_Parse_locale()
623 list = HttpCookie in test_Parse_locale()
625 cookie = list.get(0); in test_Parse_locale()
631 list = HttpCookie in test_Parse_locale()
633 cookie = list.get(0); in test_Parse_locale()
639 list = HttpCookie.parse("Set-Cookie2:name=test;max-age=1000"); in test_Parse_locale()
640 cookie = list.get(0); in test_Parse_locale()
[all …]
/libcore/ojluni/src/main/java/java/lang/ref/
DReferenceQueue.java219 public static void enqueuePending(Reference<?> list) { in enqueuePending() argument
220 Reference<?> start = list; in enqueuePending()
222 ReferenceQueue queue = list.queue; in enqueuePending()
224 Reference<?> next = list.pendingNext; in enqueuePending()
229 list.pendingNext = list; in enqueuePending()
230 list = next; in enqueuePending()
238 Reference<?> next = list.pendingNext; in enqueuePending()
244 list.pendingNext = list; in enqueuePending()
245 queue.enqueueLocked(list); in enqueuePending()
246 list = next; in enqueuePending()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DAbstractListTest.java61 List list = new ArrayList(); in test_hashCode() local
62 list.add(new Integer(3)); in test_hashCode()
63 list.add(new Integer(15)); in test_hashCode()
64 list.add(new Integer(5)); in test_hashCode()
65 list.add(new Integer(1)); in test_hashCode()
66 list.add(new Integer(7)); in test_hashCode()
68 Iterator i = list.iterator(); in test_hashCode()
74 + " got: " + list.hashCode(), hashCode == list.hashCode()); in test_hashCode()
81 SimpleList list = new SimpleList(); in test_iterator() local
82 list.add(new Object()); in test_iterator()
[all …]
DArrayListTest.java98 ArrayList<String> list = new ArrayList<String>(collection); in testConstructorWithConcurrentCollection() local
99 assertFalse(list.contains(null)); in testConstructorWithConcurrentCollection()
453 List list = new ArrayList(); in testaddAllHarmony5839() local
454 list.add("a"); in testaddAllHarmony5839()
455 list.add(0, "b"); in testaddAllHarmony5839()
456 list.add(0, "c"); in testaddAllHarmony5839()
457 list.add(0, "d"); in testaddAllHarmony5839()
458 list.add(0, "e"); in testaddAllHarmony5839()
459 list.add(0, "f"); in testaddAllHarmony5839()
460 list.add(0, "g"); in testaddAllHarmony5839()
[all …]
DControlTest.java93 List<String> list = FORMAT_CLASS; in test_Constants() local
94 assertEquals(1, list.size()); in test_Constants()
95 assertEquals("java.class", list.get(0)); in test_Constants()
96 list = FORMAT_PROPERTIES; in test_Constants()
97 assertEquals(1, list.size()); in test_Constants()
98 assertEquals("java.properties", list.get(0)); in test_Constants()
99 list = FORMAT_DEFAULT; in test_Constants()
100 assertEquals(2, list.size()); in test_Constants()
101 assertEquals("java.class", list.get(0)); in test_Constants()
102 assertEquals("java.properties", list.get(1)); in test_Constants()
[all …]
DPriorityQueueTest.java261 List<Integer> list = Arrays.asList(array); in test_ConstructorILjava_util_Comparator_cast() local
262 integerQueue.addAll(list); in test_ConstructorILjava_util_Comparator_cast()
263 assertEquals(list.size(), integerQueue.size()); in test_ConstructorILjava_util_Comparator_cast()
272 List<Integer> list = Arrays.asList(array); in test_ConstructorLjava_util_Colleciton() local
273 PriorityQueue<Integer> integerQueue = new PriorityQueue<Integer>(list); in test_ConstructorLjava_util_Colleciton()
286 ArrayList<Object> list = new ArrayList<Object>(); in test_ConstructorLjava_util_Colleciton_null() local
287 list.add(new Float(11)); in test_ConstructorLjava_util_Colleciton_null()
288 list.add(null); in test_ConstructorLjava_util_Colleciton_null()
289 list.add(new Integer(10)); in test_ConstructorLjava_util_Colleciton_null()
291 new PriorityQueue<Object>(list); in test_ConstructorLjava_util_Colleciton_null()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/auth/x500/
DX500PrincipalTest.java2264 TestList list = new TestList(); in testValidDN() local
2266 list.add("", "", "", "", new byte[] { 0x30, 0x00 }); // empty RDN sequence in testValidDN()
2269 list.add("CN=A,C=B", "CN=A,C=B", "CN=A, C=B", "cn=a,c=b"); in testValidDN()
2270 list.add("C=B,CN=A", "C=B,CN=A", "C=B, CN=A", "c=b,cn=a"); in testValidDN()
2271 list.add("CN=A,CN=A", "CN=A,CN=A", "CN=A, CN=A", "cn=a,cn=a"); // duplicate RDNs in testValidDN()
2274 list.add("CN=A , C=B", "CN=A,C=B", "CN=A, C=B"); in testValidDN()
2275 list.add("CN=A , C=B", "CN=A,C=B", "CN=A, C=B"); in testValidDN()
2276 list.add("CN=A;C=B", "CN=A,C=B", "CN=A, C=B"); in testValidDN()
2277 list.add("CN=A ; C=B", "CN=A,C=B", "CN=A, C=B"); in testValidDN()
2279 list.add(" CN=A,C=B ", "CN=A,C=B", "CN=A, C=B"); // spaces at beg&end in testValidDN()
[all …]
/libcore/luni/src/test/java/libcore/libcore/util/
DCollectionUtilsTest.java78 List<String> list = new ArrayList<String>(); in testRemoveDuplicatesOnEmptyCollection() local
79 CollectionUtils.removeDuplicates(list, String.CASE_INSENSITIVE_ORDER); in testRemoveDuplicatesOnEmptyCollection()
80 assertTrue(list.isEmpty()); in testRemoveDuplicatesOnEmptyCollection()
84 List<String> list = Arrays.asList("A"); in testRemoveDuplicatesOnSingletonCollection() local
85 CollectionUtils.removeDuplicates(list, String.CASE_INSENSITIVE_ORDER); in testRemoveDuplicatesOnSingletonCollection()
86 assertEquals(Collections.singletonList("A"), list); in testRemoveDuplicatesOnSingletonCollection()
90 List<String> list = new ArrayList<String>(); in testRemoveDuplicates() local
91 list.add("A"); in testRemoveDuplicates()
92 list.add("A"); in testRemoveDuplicates()
93 list.add("A"); in testRemoveDuplicates()
[all …]
/libcore/luni/src/main/java/libcore/util/
DCollectionUtils.java85 public static <T> void removeDuplicates(List<T> list, Comparator<? super T> comparator) {
86 Collections.sort(list, comparator);
88 for (int i = 1; i < list.size(); i++) {
89 if (comparator.compare(list.get(j - 1), list.get(i)) != 0) {
90 T object = list.get(i);
91 list.set(j++, object);
94 if (j < list.size()) {
95 list.subList(j, list.size()).clear();
/libcore/luni/src/test/java/libcore/xml/
DSimpleBuilderTest.java67 NodeList list = root.getElementsByTagName("nestedStuff"); in testGoodFile1() local
68 assertNotNull(list); in testGoodFile1()
69 assertEquals(list.getLength(), 4); in testGoodFile1()
71 Element one = (Element) list.item(0); in testGoodFile1()
72 Element two = (Element) list.item(1); in testGoodFile1()
73 Element three = (Element) list.item(2); in testGoodFile1()
74 Element four = (Element) list.item(3); in testGoodFile1()
90 list = document.getChildNodes(); in testGoodFile1()
91 assertNotNull(list); in testGoodFile1()
96 for (int i = 0; i < list.getLength(); i++) { in testGoodFile1()
[all …]
/libcore/ojluni/src/main/java/java/util/logging/
DLevel.java551 List<KnownLevel> list = nameToLevels.get(l.name); in add() local
552 if (list == null) { in add()
553 list = new ArrayList<>(); in add()
554 nameToLevels.put(l.name, list); in add()
556 list.add(o); in add()
558 list = intToLevels.get(l.value); in add()
559 if (list == null) { in add()
560 list = new ArrayList<>(); in add()
561 intToLevels.put(l.value, list); in add()
563 list.add(o); in add()
[all …]
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DStreamTestDataProvider.java87 List<Object[]> list = new ArrayList<>();
93 list.add(arrayDataDescr("array:" + name, ints));
94 list.add(collectionDataDescr("ArrayList.asList:" + name, intsAsList));
95 list.add(collectionDataDescr("ArrayList:" + name, new ArrayList<>(intsAsList)));
96 list.add(streamDataDescr("DelegatingStream(ArrayList):" + name,
104 list.add(collectionDataDescr("ArrayList.Sublist:" + name,
107 list.add(collectionDataDescr("LinkedList:" + name, new LinkedList<>(intsAsList)));
108 list.add(collectionDataDescr("HashSet:" + name, new HashSet<>(intsAsList)));
109list.add(collectionDataDescr("LinkedHashSet:" + name, new LinkedHashSet<>(intsAsList)));
110 list.add(collectionDataDescr("TreeSet:" + name, new TreeSet<>(intsAsList)));
[all …]
DLoggingTestCase.java53 List<Object> list = new ArrayList<>(); in after() local
54 Collections.addAll(list, result.getParameters()); in after()
55 list.add(context.toString()); in after()
56 result.setParameters(list.toArray(new Object[list.size()])); in after()
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DStreamTestDataProvider.java93 List<Object[]> list = new ArrayList<>();
99 list.add(arrayDataDescr("array:" + name, ints));
100 list.add(collectionDataDescr("ArrayList.asList:" + name, intsAsList));
101 list.add(collectionDataDescr("ArrayList:" + name, new ArrayList<>(intsAsList)));
102 list.add(streamDataDescr("DelegatingStream(ArrayList):" + name,
110 list.add(collectionDataDescr("ArrayList.Sublist:" + name,
113 list.add(collectionDataDescr("LinkedList:" + name, new LinkedList<>(intsAsList)));
114 list.add(collectionDataDescr("HashSet:" + name, new HashSet<>(intsAsList)));
115list.add(collectionDataDescr("LinkedHashSet:" + name, new LinkedHashSet<>(intsAsList)));
116 list.add(collectionDataDescr("TreeSet:" + name, new TreeSet<>(intsAsList)));
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DAbstractCookiesTest.java873 List<HttpCookie> list = cookieStore.get(uri); in test_add_LURI_LHttpCookie() local
874 assertEquals(1, list.size()); in test_add_LURI_LHttpCookie()
875 assertTrue(list.contains(cookie)); in test_add_LURI_LHttpCookie()
879 list = cookieStore.get(uri); in test_add_LURI_LHttpCookie()
880 assertEquals(1, list.size()); in test_add_LURI_LHttpCookie()
881 assertEquals(" TESTVALUE1 ", list.get(0).getValue()); in test_add_LURI_LHttpCookie()
882 assertTrue(list.contains(cookie2)); in test_add_LURI_LHttpCookie()
889 list = cookieStore.get(uri); in test_add_LURI_LHttpCookie()
890 assertEquals(2, list.size()); in test_add_LURI_LHttpCookie()
891 assertNull(list.get(0).getDomain()); in test_add_LURI_LHttpCookie()
[all …]
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleMatcher.java80 ArrayList<LanguageRange> list; in filterTags() local
84 list = new ArrayList<>(); in filterTags()
97 list.add(new LanguageRange(range, lr.getWeight())); in filterTags()
104 list.add(lr); in filterTags()
108 return filterBasic(list, tags); in filterTags()
114 List<String> list = new ArrayList<>(); in filterBasic() local
125 && !list.contains(tag)) { in filterBasic()
126 list.add(tag); in filterBasic()
133 return list; in filterBasic()
138 List<String> list = new ArrayList<>(); in filterExtended() local
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DCopyOnWriteArrayListTest.java535 for (List list : lists) { in testGet1_IndexOutOfBoundsException()
537 list.get(-1); in testGet1_IndexOutOfBoundsException()
549 for (List list : lists) { in testGet2_IndexOutOfBoundsException()
551 list.get(list.size()); in testGet2_IndexOutOfBoundsException()
563 for (List list : lists) { in testSet1_IndexOutOfBoundsException()
565 list.set(-1, "qwerty"); in testSet1_IndexOutOfBoundsException()
577 for (List list : lists) { in testSet2()
579 list.set(list.size(), "qwerty"); in testSet2()
591 for (List list : lists) { in testAdd1_IndexOutOfBoundsException()
593 list.add(-1, "qwerty"); in testAdd1_IndexOutOfBoundsException()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DThreadGroup.java398 public int enumerate(Thread list[]) { in enumerate() argument
400 return enumerate(list, 0, true); in enumerate()
436 public int enumerate(Thread list[], boolean recurse) { in enumerate() argument
438 return enumerate(list, 0, recurse); in enumerate()
441 private int enumerate(Thread list[], int n, boolean recurse) { in enumerate() argument
449 if (nt > list.length - n) { in enumerate()
450 nt = list.length - n; in enumerate()
454 list[n++] = threads[i]; in enumerate()
468 n = groupsSnapshot[i].enumerate(list, n, true); in enumerate()
532 public int enumerate(ThreadGroup list[]) { in enumerate() argument
[all …]

12345678