Home
last modified time | relevance | path

Searched refs:cs (Results 1 – 25 of 118) sorted by relevance

12345

/libcore/ojluni/src/main/java/sun/misc/
DVersion.java274 CharSequence cs = System.getProperty("java.vm.version"); in initVersions() local
275 if (cs.length() >= 5 && in initVersions()
276 Character.isDigit(cs.charAt(0)) && cs.charAt(1) == '.' && in initVersions()
277 Character.isDigit(cs.charAt(2)) && cs.charAt(3) == '.' && in initVersions()
278 Character.isDigit(cs.charAt(4))) { in initVersions()
279 jvm_major_version = Character.digit(cs.charAt(0), 10); in initVersions()
280 jvm_minor_version = Character.digit(cs.charAt(2), 10); in initVersions()
281 jvm_micro_version = Character.digit(cs.charAt(4), 10); in initVersions()
282 cs = cs.subSequence(5, cs.length()); in initVersions()
283 if (cs.charAt(0) == '_' && cs.length() >= 3) { in initVersions()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DExecutorCompletionServiceTest.java88 CompletionService cs = new ExecutorCompletionService(cachedThreadPool); in testSubmitNullCallable() local
90 cs.submit((Callable) null); in testSubmitNullCallable()
99 CompletionService cs = new ExecutorCompletionService(cachedThreadPool); in testSubmitNullRunnable() local
101 cs.submit((Runnable) null, Boolean.TRUE); in testSubmitNullRunnable()
111 CompletionService cs = new ExecutorCompletionService(cachedThreadPool); in testTake() local
112 cs.submit(new StringTask()); in testTake()
113 Future f = cs.take(); in testTake()
122 CompletionService cs = new ExecutorCompletionService(cachedThreadPool); in testTake2() local
123 Future f1 = cs.submit(new StringTask()); in testTake2()
124 Future f2 = cs.take(); in testTake2()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/atomic/
DLongAdder.java86 Cell[] cs; long b, v; int m; Cell c; in add() local
87 if ((cs = cells) != null || !casBase(b = base, b + x)) { in add()
90 if (cs == null || (m = cs.length - 1) < 0 || in add()
91 (c = cs[index & m]) == null || in add()
121 Cell[] cs = cells; in sum() local
123 if (cs != null) { in sum()
124 for (Cell c : cs) in sum()
139 Cell[] cs = cells; in reset() local
141 if (cs != null) { in reset()
142 for (Cell c : cs) in reset()
[all …]
DDoubleAdder.java90 Cell[] cs; long b, v; int m; Cell c; in add() local
91 if ((cs = cells) != null || in add()
97 if (cs == null || (m = cs.length - 1) < 0 || in add()
98 (c = cs[index & m]) == null || in add()
119 Cell[] cs = cells; in sum() local
121 if (cs != null) { in sum()
122 for (Cell c : cs) in sum()
137 Cell[] cs = cells; in reset() local
139 if (cs != null) { in reset()
140 for (Cell c : cs) in reset()
[all …]
DLongAccumulator.java107 Cell[] cs; long b, v, r; int m; Cell c; in accumulate() local
108 if ((cs = cells) != null in accumulate()
113 if (cs == null in accumulate()
114 || (m = cs.length - 1) < 0 in accumulate()
115 || (c = cs[index & m]) == null in accumulate()
133 Cell[] cs = cells; in get() local
135 if (cs != null) { in get()
136 for (Cell c : cs) in get()
152 Cell[] cs = cells; in reset() local
154 if (cs != null) { in reset()
[all …]
DDoubleAccumulator.java109 Cell[] cs; long b, v, r; int m; Cell c; in accumulate() local
110 if ((cs = cells) != null in accumulate()
116 if (cs == null in accumulate()
117 || (m = cs.length - 1) < 0 in accumulate()
118 || (c = cs[index & m]) == null in accumulate()
138 Cell[] cs = cells; in get() local
140 if (cs != null) { in get()
141 for (Cell c : cs) in get()
158 Cell[] cs = cells; in reset() local
160 if (cs != null) { in reset()
[all …]
DStriped64.java238 Cell[] cs; Cell c; int n; long v; in longAccumulate() local
239 if ((cs = cells) != null && (n = cs.length) > 0) { in longAccumulate()
240 if ((c = cs[(n - 1) & index]) == null) { in longAccumulate()
265 else if (n >= NCPU || cells != cs) in longAccumulate()
271 if (cells == cs) // Expand table unless stale in longAccumulate()
272 cells = Arrays.copyOf(cs, n << 1); in longAccumulate()
281 else if (cellsBusy == 0 && cells == cs && casCellsBusy()) { in longAccumulate()
283 if (cells == cs) { in longAccumulate()
320 Cell[] cs; Cell c; int n; long v; in doubleAccumulate() local
321 if ((cs = cells) != null && (n = cs.length) > 0) { in doubleAccumulate()
[all …]
/libcore/ojluni/src/main/java/java/nio/charset/
DCharset.java34 import sun.nio.cs.ThreadLocalCoders;
333 private static void cache(String charsetName, Charset cs) { in cache() argument
335 String canonicalName = cs.name(); in cache()
339 cs = canonicalCharset; in cache()
341 cache2.put(canonicalName, cs); in cache()
343 for (String alias : cs.aliases()) { in cache()
344 cache2.put(alias, cs); in cache()
348 cache2.put(charsetName, cs); in cache()
351 cache1 = new AbstractMap.SimpleImmutableEntry<>(charsetName, cs); in cache()
430 Charset cs = cp.charsetForName(charsetName); in lookupViaProviders() local
[all …]
/libcore/ojluni/src/main/java/java/security/
DSecureClassLoader.java140 CodeSource cs) in defineClass() argument
142 return defineClass(name, b, off, len, getProtectionDomain(cs)); in defineClass()
172 CodeSource cs) in defineClass() argument
174 return defineClass(name, b, getProtectionDomain(cs)); in defineClass()
198 private ProtectionDomain getProtectionDomain(CodeSource cs) { in getProtectionDomain() argument
199 if (cs == null) in getProtectionDomain()
204 pd = pdcache.get(cs); in getProtectionDomain()
206 PermissionCollection perms = getPermissions(cs); in getProtectionDomain()
207 pd = new ProtectionDomain(cs, perms, this, null); in getProtectionDomain()
208 pdcache.put(cs, pd); in getProtectionDomain()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DCharsetTest.java48 Charset cs = Charset.forName(charsetName); in test_allAvailableCharsets() local
49 assertNotNull(cs.newDecoder()); in test_allAvailableCharsets()
50 if (cs.canEncode()) { in test_allAvailableCharsets()
51 CharsetEncoder enc = cs.newEncoder(); in test_allAvailableCharsets()
83 Charset cs = Charset.forName(name); in test_isRegistered() local
84 if (!cs.isRegistered()) { in test_isRegistered()
85 … System.err.println("isRegistered was false for " + name + " " + cs.name() + " " + cs.aliases()); in test_isRegistered()
87 …assertTrue("isRegistered was false for " + name + " " + cs.name() + " " + cs.aliases(), cs.isRegis… in test_isRegistered()
91 Charset cs = Charset.forName(name); in test_isRegistered() local
92 …assertFalse("isRegistered was true for " + name + " " + cs.name() + " " + cs.aliases(), cs.isRegis… in test_isRegistered()
[all …]
DCharsetEncoder2Test.java40 Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$ in test_ConstructorLjava_nio_charset_CharsetFF() local
41 new MockCharsetEncoderForHarmony141(cs, 1.1f, 1); in test_ConstructorLjava_nio_charset_CharsetFF()
48 Charset cs = Charset.forName("ISO8859-1"); //$NON-NLS-1$ in test_ConstructorLjava_nio_charset_CharsetFF() local
49 new MockCharsetEncoderForHarmony141(cs, 1.1f, 1, in test_ConstructorLjava_nio_charset_CharsetFF()
73 protected MockCharsetEncoderForHarmony141(Charset cs, in MockCharsetEncoderForHarmony141() argument
75 super(cs, averageBytesPerChar, maxBytesPerChar); in MockCharsetEncoderForHarmony141()
78 public MockCharsetEncoderForHarmony141(Charset cs, in MockCharsetEncoderForHarmony141() argument
81 super(cs, averageBytesPerChar, maxBytesPerChar, replacement); in MockCharsetEncoderForHarmony141()
109 MockMalfunctionCharset cs = new MockMalfunctionCharset("mock", null); in test_EncodeLjava_nio_CharBuffer() local
111 cs.encode(CharBuffer.wrap("AB")); in test_EncodeLjava_nio_CharBuffer()
[all …]
DCharsetDecoder2Test.java44 Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$ in test_ConstructorLjava_nio_charset_CharsetFF() local
45 new MockCharsetDecoderForHarmony142(cs, 1.1f, 1); in test_ConstructorLjava_nio_charset_CharsetFF()
56 protected MockCharsetDecoderForHarmony142(Charset cs, in MockCharsetDecoderForHarmony142() argument
58 super(cs, averageBytesPerChar, maxBytesPerChar); in MockCharsetDecoderForHarmony142()
137 public boolean contains(Charset cs) { in contains() argument
155 public MockMalfunctionDecoder(Charset cs) { in MockMalfunctionDecoder() argument
156 super(cs, 1, 10); in MockMalfunctionDecoder()
169 public MockMalfunctionEncoder(Charset cs) { in MockMalfunctionEncoder() argument
170 super(cs, 1, 3, new byte[] { (byte) '?' }); in MockMalfunctionEncoder()
184 Charset cs = Charset.forName("UTF-8"); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow() local
[all …]
/libcore/ojluni/src/test/java/lang/CharSequence/
DEmptiness.java97 public void checkEmpty(CharSequence cs) { in checkEmpty() argument
98 Assert.assertTrue(cs.isEmpty()); in checkEmpty()
99 Assert.assertTrue(consistentWithLength(cs)); in checkEmpty()
102 public void checkNotEmpty(CharSequence cs) { in checkNotEmpty() argument
103 Assert.assertTrue(!cs.isEmpty()); in checkNotEmpty()
104 Assert.assertTrue(consistentWithLength(cs)); in checkNotEmpty()
107 public boolean consistentWithLength(CharSequence cs) { in consistentWithLength() argument
108 return cs.isEmpty() == (cs.length() == 0); in consistentWithLength()
/libcore/ojluni/src/test/java/lang/StringBuffer/
DAppendCharSequence.java134 CharSequence cs = null; in checkNulls() local
136 sb1.append(cs); in checkNulls()
142 sb1.append(cs, 0, 2); in checkNulls()
147 sb1.insert(2, cs); in checkNulls()
152 sb1.insert(2, cs, 0, 2); in checkNulls()
163 CharSequence cs = (CharSequence)generateTestBuffer(0, 80); in checkOffsets() local
166 while (index <= cs.length() - len) { in checkOffsets()
175 sb.append(cs, index, index + len); in checkOffsets()
185 CharSequence cs = (CharSequence)new StringBuffer("test2"); in checkOffsets() local
193 sb.insert(index, cs); in checkOffsets()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DCollector.java272 Set<Characteristics> cs = (characteristics.length == 0) in of() local
276 return new Collectors.CollectorImpl<>(supplier, accumulator, combiner, cs); in of()
305 Set<Characteristics> cs = Collectors.CH_NOID; in of() local
307 cs = EnumSet.noneOf(Characteristics.class); in of()
308 Collections.addAll(cs, characteristics); in of()
309 cs = Collections.unmodifiableSet(cs); in of()
311 return new Collectors.CollectorImpl<>(supplier, accumulator, combiner, finisher, cs); in of()
/libcore/luni/src/test/java/libcore/java/net/
DOldDatagramPacketTest.java46 DatagramSocket cs = new DatagramSocket(); in test_getPort() local
50 cs.send(packet); in test_getPort()
51 cs.setSoTimeout(3000); in test_getPort()
52 cs.receive(packet); in test_getPort()
53 cs.close(); in test_getPort()
56 cs.close(); in test_getPort()
/libcore/luni/src/test/java/libcore/java/nio/charset/
DCharsetTest.java24 Charset cs = Charset.forName("UTF8"); in test_nonstandardCharsetName() local
25 assertNotNull(cs); in test_nonstandardCharsetName()
26 assertEquals("UTF-8", cs.name()); in test_nonstandardCharsetName()
44 Charset cs = Charset.forName(name); in run() local
45 if (!name.equals(cs.name())) { in run()
/libcore/ojluni/src/test/java/io/Writer/
DNullWriter.java73 CharSequence cs = "abc"; in testAppendCharSequence() local
74 assertSame(openWriter, openWriter.append(cs)); in testAppendCharSequence()
84 CharSequence cs = "abc"; in testAppendCharSequenceII() local
85 assertSame(openWriter, openWriter.append(cs, 0, 1)); in testAppendCharSequenceII()
125 CharSequence cs = "abc"; in testAppendCharSequenceClosed() local
126 closedWriter.append(cs); in testAppendCharSequenceClosed()
136 CharSequence cs = "abc"; in testAppendCharSequenceIIClosed() local
137 closedWriter.append(cs, 0, 1); in testAppendCharSequenceIIClosed()
/libcore/luni/src/test/java/libcore/java/io/
DOutputStreamWriterTest.java55 char[] cs = new char[8192/4 + 1]; in testFlush() local
56 Arrays.fill(cs, 'x'); in testFlush()
57 cs[cs.length - 1] = '\ud842'; // One half of a surrogate pair (the other being U+df9f). in testFlush()
58 writer.write(cs, 0, cs.length); in testFlush()
/libcore/ojluni/src/test/java/lang/Character/
DSupplementary.java255 static void test02(CharSequence cs) { in test02() argument
258 for (int i = 0; i < cs.length(); i += Character.charCount(ch)) { in test02()
259 ch = Character.codePointAt(cs, i); in test02()
273 for (int i = cs.length(); i > 0; i -= Character.charCount(ch)) { in test02()
274 ch = Character.codePointBefore(cs, i); in test02()
638 static void testExceptions01(CharSequence cs) { in testExceptions01() argument
642 callCodePoint(At, cs, -1, IndexOutOfBoundsException.class); in testExceptions01()
643 callCodePoint(At, cs, cs.length(), IndexOutOfBoundsException.class); in testExceptions01()
644 callCodePoint(At, cs, cs.length()*3, IndexOutOfBoundsException.class); in testExceptions01()
648 callCodePoint(Before, cs, -1, IndexOutOfBoundsException.class); in testExceptions01()
[all …]
/libcore/luni/src/test/java/tests/java/security/
DSecureClassLoaderTest.java191 CodeSource cs = new CodeSource(url, (Certificate[]) null); in testGetPermissions() local
194 ldr.getPerms(cs); in testGetPermissions()
235 public Class define(String name, ByteBuffer b, CodeSource cs) { in define() argument
236 return defineClass(name, b, cs); in define()
240 CodeSource cs) { in define() argument
241 return defineClass(name, b, off, len, cs); in define()
/libcore/ojluni/src/main/java/sun/nio/cs/
DStreamDecoder.java30 package sun.nio.cs;
79 Charset cs) in forInputStreamReader() argument
81 return new StreamDecoder(in, lock, cs); in forInputStreamReader()
225 private Charset cs; field in StreamDecoder
233 StreamDecoder(InputStream in, Object lock, Charset cs) { in StreamDecoder() argument
235 cs.newDecoder() in StreamDecoder()
242 this.cs = dec.charset(); in StreamDecoder()
263 this.cs = dec.charset(); in StreamDecoder()
401 return ((cs instanceof HistoricallyNamedCharset) in encodingName()
402 ? ((HistoricallyNamedCharset)cs).historicalName() in encodingName()
[all …]
DStreamEncoder.java29 package sun.nio.cs;
66 Charset cs) in forOutputStreamWriter() argument
68 return new StreamEncoder(out, lock, cs); in forOutputStreamWriter()
173 private Charset cs; field in StreamEncoder
186 private StreamEncoder(OutputStream out, Object lock, Charset cs) { in StreamEncoder() argument
188 cs.newEncoder() in StreamEncoder()
197 this.cs = enc.charset(); in StreamEncoder()
214 this.cs = enc.charset(); in StreamEncoder()
346 return ((cs instanceof HistoricallyNamedCharset) in encodingName()
347 ? ((HistoricallyNamedCharset)cs).historicalName() in encodingName()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DZipCoder.java147 private final Charset cs; field in ZipCoder
151 private ZipCoder(Charset cs) { in ZipCoder() argument
152 this.cs = cs; in ZipCoder()
157 dec = cs.newDecoder() in decoder()
166 enc = cs.newEncoder() in encoder()
183 byte[] slash = "/".getBytes(cs); in slashBytes()
184 byte[] doubleSlash = "//".getBytes(cs); in slashBytes()
/libcore/luni/src/test/java/libcore/java/lang/
DStringTest.java50 public EvilCharsetDecoder(Charset cs) { in EvilCharsetDecoder() argument
51 super(cs, 1.0f, 1.0f); in EvilCharsetDecoder()
72 public EvilCharsetEncoder(Charset cs) { in EvilCharsetEncoder() argument
73 super(cs, 1.0f, 1.0f); in EvilCharsetEncoder()
124 Charset cs = EVIL_CHARSET; in testStringFromCharset_MaliciousCharset() local
126 final String result = new String(bytes, cs); in testStringFromCharset_MaliciousCharset()
142 Charset cs = Charset.forName("UTF-8"); in test_getBytes_UTF_8() local
145 assertEquals("[]", Arrays.toString("".getBytes(cs))); in test_getBytes_UTF_8()
148 assertEquals("[0]", Arrays.toString("\u0000".getBytes(cs))); in test_getBytes_UTF_8()
149 assertEquals("[127]", Arrays.toString("\u007f".getBytes(cs))); in test_getBytes_UTF_8()
[all …]

12345