Searched defs:cache (Results 1 - 25 of 25) sorted by relevance

/libcore/luni/src/test/java/libcore/util/
H A DBasicLruCacheTest.java28 BasicLruCache<String, String> cache = newCreatingCache();
29 String created = cache.get("aa");
34 BasicLruCache<String, String> cache = newCreatingCache();
35 cache.put("aa", "put-aa");
36 assertEquals("put-aa", cache.get("aa"));
48 BasicLruCache<String, String> cache = new BasicLruCache<String, String>(3);
50 cache.put(null, "A");
57 BasicLruCache<String, String> cache = new BasicLruCache<String, String>(3);
59 cache.put("a", null);
66 BasicLruCache<String, String> cache
136 assertSnapshot(BasicLruCache<T, T> cache, T... keysAndValues) argument
[all...]
/libcore/support/src/test/java/tests/support/
H A DSupport_GetLocal.java35 static Hashtable<String, File> cache = new Hashtable<String, File>(20); field in class:Support_GetLocal
40 File temp = cache.get(url);
53 cache.put(url, temp);
60 File temp = cache.get(url);
73 cache.put(url, temp);
/libcore/ojluni/src/main/java/sun/net/www/protocol/http/
H A DAuthCacheValue.java32 * AuthCacheValue: interface to minimise exposure to authentication cache
48 static protected AuthCache cache = new AuthCacheImpl(); field in class:AuthCacheValue
51 cache = map;
H A DNegotiateAuthentication.java54 // if it's true, a cached Negotiator is put into <code>cache</code>.
55 // the cache can be used only once, so after the first use, it's cleaned.
57 static HashMap <String, Negotiator> cache = null; field in class:NegotiateAuthentication
89 * the same hostname, the answer is retrieved from cache.
96 cache = new HashMap <String, Negotiator>();
107 // the only place cache.put is called. here we can make sure
109 cache.put(hostname, neg);
174 if (cache != null) {
175 synchronized(cache) {
176 negotiator = cache
[all...]
/libcore/ojluni/src/main/java/sun/nio/cs/
H A DThreadLocalCoders.java44 private ThreadLocal cache = new ThreadLocal(); field in class:ThreadLocalCoders.Cache
63 Object[] oa = (Object[])cache.get();
66 cache.set(oa);
/libcore/ojluni/src/main/java/sun/security/provider/certpath/
H A DCertStoreHelper.java63 private static Cache<String, CertStoreHelper> cache field in class:CertStoreHelper
69 CertStoreHelper helper = cache.get(type);
85 cache.put(type, csh);
H A DX509CertificatePair.java82 private static final Cache<Object, X509CertificatePair> cache field in class:X509CertificatePair
129 * Clear the cache for debugging.
132 cache.clear();
136 * Create a X509CertificatePair from its encoding. Uses cache lookup
142 X509CertificatePair pair = cache.get(key);
148 cache.put(key, pair);
/libcore/luni/src/main/java/java/net/
H A DAddressCache.java22 * Implements caching for {@code InetAddress}. We use a unified cache for both positive and negative
23 * cache entries.
31 * When the cache contains more entries than this, we start dropping the oldest ones.
36 // The TTL for the Java-level cache is short, just 2s.
39 // The actual cache.
40 private final BasicLruCache<AddressCacheKey, AddressCacheEntry> cache field in class:AddressCache
91 * Removes all entries from the cache.
94 cache.evictAll();
103 AddressCacheEntry entry = cache.get(new AddressCacheKey(hostname, netId));
104 // Do we have a valid cache entr
[all...]
/libcore/luni/src/main/java/libcore/reflect/
H A DAnnotationFactory.java51 private static final transient Map<Class<? extends Annotation>, AnnotationMember[]> cache = field in class:AnnotationFactory
59 synchronized (cache) {
60 AnnotationMember[] desc = cache.get(annotationType);
80 synchronized (cache) {
81 cache.put(annotationType, desc);
/libcore/luni/src/main/java/libcore/util/
H A DZoneInfoDB.java70 private final BasicLruCache<String, ZoneInfo> cache = field in class:ZoneInfoDB.TzData
234 // This creates a TimeZone, which is quite expensive. Hence the cache.
235 // Note that icu4c does the same (without the cache), so if you're
239 rawUtcOffsetsCache[i] = cache.get(ids[i]).getRawOffset();
253 ZoneInfo zoneInfo = cache.get(id);
254 // The object from the cache is cloned because TimeZone / ZoneInfo are mutable.
259 return cache.get(id) != null;
/libcore/ojluni/src/main/java/java/lang/
H A DByte.java80 static final Byte cache[] = new Byte[-(-128) + 127 + 1]; field in class:Byte.ByteCache
83 for(int i = 0; i < cache.length; i++)
84 cache[i] = new Byte((byte)(i - 128));
103 return ByteCache.cache[(int)b + offset];
H A DShort.java206 static final Short cache[] = new Short[-(-128) + 127 + 1]; field in class:Short.ShortCache
209 for(int i = 0; i < cache.length; i++)
210 cache[i] = new Short((short)(i - 128));
223 * This method will always cache values in the range -128 to 127,
224 * inclusive, and may cache other values outside of this range.
233 if (sAsInt >= -128 && sAsInt <= 127) { // must cache
234 return ShortCache.cache[sAsInt + offset];
H A DLong.java548 static final Long cache[] = new Long[-(-128) + 127 + 1]; field in class:Long.LongCache
551 for(int i = 0; i < cache.length; i++)
552 cache[i] = new Long(i - 128);
567 * is <em>not</em> required to cache values within a particular
576 if (l >= -128 && l <= 127) { // will cache
577 return LongCache.cache[(int)l + offset];
H A DInteger.java335 // Android-changed: cache the string literal for small values.
618 * The cache is initialized on first usage. The size of the cache
628 static final Integer cache[]; field in class:Integer.IntegerCache
643 cache = new Integer[(high - low) + 1];
645 for(int k = 0; k < cache.length; k++)
646 cache[k] = new Integer(j++);
660 * This method will always cache values in the range -128 to 127,
661 * inclusive, and may cache other values outside of this range.
670 return IntegerCache.cache[
[all...]
H A DCharacter.java4388 static final Character cache[] = new Character[127 + 1]; field in class:Character.CharacterCache
4391 for (int i = 0; i < cache.length; i++)
4392 cache[i] = new Character((char)i);
4405 * This method will always cache values in the range {@code
4407 * cache other values outside of this range.
4414 if (c <= 127) { // must cache
4415 return CharacterCache.cache[(int)c];
/libcore/ojluni/src/main/java/java/nio/charset/
H A DCoderResult.java197 private Map<Integer,WeakReference<CoderResult>> cache = null; field in class:CoderResult.Cache
207 if (cache == null) {
208 cache = new HashMap<Integer,WeakReference<CoderResult>>();
209 } else if ((w = cache.get(k)) != null) {
214 cache.put(k, new WeakReference<CoderResult>(e));
H A DCharset.java337 private static volatile Map.Entry<String, Charset> cache1 = null; // "Level 1" cache
338 private static final HashMap<String, Charset> cache2 = new HashMap<>(); // "Level 2" cache
340 private static void cache(String charsetName, Charset cs) { method in class:Charset
490 // instance is stored in the level 1 cache. We convey a hint to this effect to the VM by putting
491 // the level 1 cache miss code in a separate method. Since charsetName is not necessarily in
493 // instance in a map for level 2 cache.
519 cache(charsetName, cs);
843 * except that it is potentially more efficient because it can cache
879 * except that it is potentially more efficient because it can cache
/libcore/ojluni/src/main/java/sun/security/provider/
H A DX509Factory.java132 * in the cert cache, the cached object is returned. Otherwise,
134 * Then the X509CertImpl is added to the cache and returned.
199 * Get the X509CertImpl or X509CRLImpl from the cache.
201 private static synchronized Object getFromCache(Cache cache, argument
204 Object value = cache.get(key);
209 * Add the X509CertImpl or X509CRLImpl to the cache.
211 private static synchronized void addToCache(Cache cache, byte[] encoding, argument
217 cache.put(key, value);
357 // clear the cache (for debugging)
/libcore/ojluni/src/main/java/sun/util/calendar/
H A DJulianCalendar.java148 public long getFixedDate(int jyear, int month, int dayOfMonth, BaseCalendar.Date cache) { argument
151 // Look up the one year cache
152 if (cache != null && cache.hit(jyear)) {
154 return cache.getCachedJan1();
156 return cache.getCachedJan1() + getDayOfYear(jyear, month, dayOfMonth) - 1;
177 // If it's January 1, update the cache.
178 if (cache != null && isJan1) {
179 cache.setCache(jyear, days, CalendarUtils.isJulianLeapYear(jyear) ? 366 : 365);
226 // as cache tabl
[all...]
H A DBaseCalendar.java164 // improvement with >90% cache hit. The initial values are for Gregorian.
364 public long getFixedDate(int year, int month, int dayOfMonth, BaseCalendar.Date cache) { argument
367 // Look up the one year cache
368 if (cache != null && cache.hit(year)) {
370 return cache.getCachedJan1();
372 return cache.getCachedJan1() + getDayOfYear(year, month, dayOfMonth) - 1;
379 if (cache != null) {
380 cache.setCache(year, jan1, isLeapYear(year) ? 366 : 365);
406 // If it's January 1, update the cache
[all...]
/libcore/ojluni/src/main/java/java/io/
H A DUnixFileSystem.java134 // The first cache handles repeated canonicalizations of the same path
135 // name. The prefix cache handles repeated canonicalizations within the
138 // prefix cache is conservative and is not used for complex path names.
139 private ExpiringCache cache = new ExpiringCache(); field in class:UnixFileSystem
149 String res = cache.get(path);
161 // Hit only in prefix cache; full path is canonical
164 cache.put(dir + slash + filename, res);
171 cache.put(path, res);
177 // prefix cache (java.home prefix cache coul
[all...]
/libcore/ojluni/src/main/native/
H A Dzip_util.h219 cencache cencache; /* CEN header cache */
230 jzentry *cache; /* we cache the most recently freed jzentry */ member in struct:jzfile
H A Dzip_util.c797 * Returns the jzfile corresponding to the given file name from the cache of
798 * zip files, or NULL if the file is not in the cache. If the name is longer
843 * jzfile in a cache, and returns that jzfile. Returns NULL in case of error.
998 cencache *cache = &zip->cencache; local
1000 if (cache->data != NULL
1001 && (cenpos >= cache->pos)
1002 && (cenpos + CENHDR <= cache->pos + CENCACHE_PAGESIZE))
1004 cen = cache->data + cenpos - cache->pos;
1005 if (cenpos + CENSIZE(cen) <= cache
[all...]
/libcore/luni/src/test/java/libcore/java/net/
H A DURLConnectionTest.java102 private AndroidShimResponseCache cache; field in class:URLConnectionTest
122 if (cache != null) {
123 cache.delete();
124 cache = null;
802 cache = AndroidShimResponseCache.create(cacheDir, Integer.MAX_VALUE);
803 ResponseCache.setDefault(cache);
807 * Test Etag headers are returned correctly when a client-side cache is not installed.
842 // Check the client did not cache.
848 * Test Etag headers are returned correctly when a client-side cache is installed and the server
891 * Test Etag headers are returned correctly when a client-side cache i
[all...]
/libcore/support/src/test/java/tests/resources/
H A Djunit4-4.3.1.jarMETA-INF/ META-INF/MANIFEST.MF junit/ junit/extensions/ junit/framework/ junit/runner/ junit/textui/ org/ ...

Completed in 788 milliseconds