/* Main method to lookup an entry
5385
public synchronized DownloadResponse getJnlpFile( JnlpResource jnlpres, DownloadRequest dreq )
            throws IOException
    {
        String path = jnlpres.getPath();
        URL resource = jnlpres.getResource();
        long lastModified = jnlpres.getLastModified();

        _log.addDebug( "lastModified: " + lastModified + " " + new Date( lastModified ) );
        if ( lastModified == 0 )
        {
            _log.addWarning( "servlet.log.warning.nolastmodified", path );
        }

        // fix for 4474854:  use the request URL as key to look up jnlp file
        // in hash map
        String reqUrl = HttpUtils.getRequestURL( dreq.getHttpRequest() ).toString();

        // Check if entry already exist in HashMap
        JnlpFileEntry jnlpFile = (JnlpFileEntry) _jnlpFiles.get( reqUrl );

        if ( jnlpFile != null && jnlpFile.getLastModified() == lastModified )
        {
            // Entry found in cache, so return it
            return jnlpFile.getResponse();
        }

        // Read information from WAR file
        long timeStamp = lastModified;
        String mimeType = _servletContext.getMimeType( path );
        if ( mimeType == null )
        {
            mimeType = JNLP_MIME_TYPE;
        }

        StringBuilder jnlpFileTemplate = new StringBuilder();
        URLConnection conn = resource.openConnection();
        BufferedReader br = new BufferedReader( new InputStreamReader( conn.getInputStream(), "UTF-8" ) );
        String line = br.readLine();
        if ( line != null && line.startsWith( "TS:" ) )
        {
            timeStamp = parseTimeStamp( line.substring( 3 ) );
            _log.addDebug( "Timestamp: " + timeStamp + " " + new Date( timeStamp ) );
            if ( timeStamp == 0 )
            {
                _log.addWarning( "servlet.log.warning.notimestamp", path );
                timeStamp = lastModified;
            }
            line = br.readLine();
        }
        while ( line != null )
        {
            jnlpFileTemplate.append( line );
            line = br.readLine();
        }

        String jnlpFileContent = specializeJnlpTemplate( dreq.getHttpRequest(), path, jnlpFileTemplate.toString() );

        // Convert to bytes as a UTF-8 encoding
        byte[] byteContent = jnlpFileContent.getBytes( "UTF-8" );

        // Create entry
        DownloadResponse resp =
                DownloadResponse.getFileDownloadResponse( byteContent, mimeType, timeStamp, jnlpres.getReturnVersionId() );
        jnlpFile = new JnlpFileEntry( resp, lastModified );
        _jnlpFiles.put( reqUrl, jnlpFile );

        return resp;
    }
879264
private HashtableEntry findEntry(Object key, int retrieveMode, boolean checkExpired)
                    throws IOException,
                    EOFException,
                    FileManagerException,
                    ClassNotFoundException,
                    HashtableOnDiskException {
        if (key == null) {
            return null;
        }

        int hashcode = key.hashCode();
        int index = header.getHtIndex(hashcode, header.currentTableId());
        long current = 0;
        HashtableEntry answer = null;

        if (header.rehashInProgress == 1) {

            if (debug)
                print("*");

            //
            // First search primary table.
            //
            if (htindex[index] != 0) {
                if (debug)
                    print("A");
                current = htindex[index];

                if (current == 0) {
                    throw new IllegalStateException("findEntry: ht pointer is null");
                }
                answer = findEntry(key, hashcode, retrieveMode, checkExpired, current, header.currentTableId());
                if (answer != null) {
                    return answer;
                }
            }

            //
            // Fell through, now search new table
            //
            index = header.getHtIndex(hashcode, header.alternateTableId());
            if (new_htindex[index] != 0) {
                if (debug)
                    print("B ");
                current = new_htindex[index];
                if (current == 0) {
                    throw new IllegalStateException("findEntry: ht pointer is null");
                }
                return findEntry(key, hashcode, retrieveMode, checkExpired, current, header.alternateTableId());
            }
            //
            // Fell through again, nothing here.
            //
            return null;
        } else {
            if (htindex[index] == 0) {
                return null;
            }
            int tableid = header.currentTableId();
            //current = header.calcOffset(index, tableid);
            current = htindex[index];
            if (current == 0) {
                throw new IllegalStateException("findEntry: ht pointer is null");
            }
            return findEntry(key, hashcode, retrieveMode, checkExpired, current, tableid);
        }
    }
1241111
private void registerEntry(String source,
                               String target,
                               String variant,
                               Object entry,
                               boolean visible) {
        String s = source;
        if (s.length() == 0) {
            s = ANY;
        }
        String ID = TransliteratorIDParser.STVtoID(source, target, variant);
        registerEntry(ID, s, target, variant, entry, visible);
    }
427722
private static <T extends Node> Map.Entry<CSNodeWrapper, T> findEntry(Map<CSNodeWrapper, T> map, Integer id) {
        if (id == null) return null;

        for (final Map.Entry<CSNodeWrapper, T> entry : map.entrySet()) {
            if (entry.getKey().getNextNode() != null && entry.getKey().getNextNode().getId().equals(id)) {
                return entry;
            }
        }

        return null;
    }
1061800
@Override
	public Object lookup(Name name) throws NamingException
    {
        if (name.isEmpty())
            return new FFMQJNDIContext(env, bindings);

        // Extract components that belong to this namespace
        String nm = name.toString();

        // Find object in internal hash table
        Object answer = bindings.get(nm);
        if (answer == null)
        {
        	// Dynamic queue or topic lookup
        	if (nm.startsWith("queue/") && nm.length() > 6)
        		return new QueueRef(nm.substring(nm.indexOf('/')+1));
        	if (nm.startsWith("topic/") && nm.length() > 6)
        		return new TopicRef(nm.substring(nm.indexOf('/')+1));
        	
            throw new NameNotFoundException(name + " not found");
        }

        return answer;
    }
1287824
DirectoryEntry lookUpWithLock(JimfsPath path, Set<? super LinkOption> options)
      throws IOException {
    store.readLock().lock();
    try {
      return lookUp(path, options);
    } finally {
      store.readLock().unlock();
    }
  }
1033454
public Map.Entry getEntry(String key,int offset, int length)
    {
        if (key==null)
            return _nullEntry;
        
        Node node = _root;
        int ni=-1;

        // look for best match
    charLoop:
        for (int i=0;i<length;i++)
        {
            char c=key.charAt(offset+i);

            // Advance node
            if (ni==-1)
            {
                ni=0;
                node=(node._children==null)?null:node._children[c%_width];
            }
            
            // Look through the node chain
            while (node!=null) 
            {
                // If it is a matching node, goto next char
                if (node._char[ni]==c || _ignoreCase&&node._ochar[ni]==c)
                {
                    ni++;
                    if (ni==node._char.length)
                        ni=-1;
                    continue charLoop;
                }

                // No char match, so if mid node then no match at all.
                if (ni>0) return null;

                // try next in chain
                node=node._next;                
            }
            return null;
        }
        
        if (ni>0) return null;
        if (node!=null && node._key==null)
            return null;
        return node;
    }
1120554
public void enter(Symbol sym, Scope s, Scope origin, boolean staticallyImported) {
        Assert.check(shared == 0);
        if (nelems * 3 >= hashMask * 2)
            dble();
        int hash = getIndex(sym.name);
        Entry old = table[hash];
        if (old == null) {
            old = sentinel;
            nelems++;
        }
        Entry e = makeEntry(sym, old, elems, s, origin, staticallyImported);
        table[hash] = e;
        elems = e;

        //notify listeners
        for (List<ScopeListener> l = listeners; l.nonEmpty(); l = l.tail) {
            l.head.symbolAdded(sym, this);
        }
    }
440314
@Override
    protected Entry<K, V> get(K k) {
        return mHashMap.get(k);
    }
266972
function walk(entrypoint) {
  try {
    if (!visited.has(entrypoint)) {
      debug(`finding requires for ${entrypoint}`);
      // This whole thing is *way* easier if we do it synchronously
      // eslint-disable-next-line no-sync
      const requires = detective(fs.readFileSync(entrypoint));

      visited.set(entrypoint, requires.reduce((acc, dep) => {
        debug(`found ${dep}`);
        if (dep.startsWith('.')) {
          debug(`${dep} is relative, descending`);
          const next = walk(path.resolve(path.dirname(entrypoint), dep));

          acc = new Set([...acc, ...next]);
        }
        else if (!builtins.includes(dep)) {
          debug(`found dependency ${dep}`);
          acc.add(requireToPackage(dep));
        }

        return acc;
      }, new Set()));
    }

    return visited.get(entrypoint);
  }
  catch (err) {
    if (err.code === 'EISDIR') {
      return walk(path.resolve(entrypoint, 'index.js'));
    }
    if (err.code === 'ENOENT' && !entrypoint.endsWith('.js')) {
      return walk(`${entrypoint}.js`);
    }
    throw err;
  }
}
1043578
@Nullable
  private DirectoryEntry lookUpLast(
      @Nullable File dir, Name name, Set<? super LinkOption> options, int linkDepth)
      throws IOException {
    Directory directory = toDirectory(dir);
    if (directory == null) {
      return null;
    }

    DirectoryEntry entry = directory.get(name);
    if (entry == null) {
      return new DirectoryEntry(directory, name, null);
    }

    File file = entry.file();
    if (!options.contains(LinkOption.NOFOLLOW_LINKS) && file.isSymbolicLink()) {
      return followSymbolicLink(dir, (SymbolicLink) file, linkDepth);
    }

    return getRealEntry(entry);
  }
268985
function Entry(name, hash, status, mode, deed, registrationDate, value, highestBid) {
  // TODO: improve Entry constructor so that unknown names can be handled via getEntry
  this.name = name;
  this.hash = hash;
  this.status = status;
  this.mode = mode;
  this.deed = deed;
  this.registrationDate = registrationDate;
  this.value = value;
  this.highestBid = highestBid;
}
792013
Entry<K, V> getEntry(Object key) {
	Object k = maskNull(key);
	int h = hash(k);
	Entry<K, V>[] tab = getTable();
	int index = indexFor(h, tab.length);
	Entry<K, V> e = tab[index];
	while (e != null && !(e.hash == h && eq(k, e.get())))
	    e = e.next;
	return e;
    }
825716
private int findIndex(Entry<?> entry) {
        int childrenSize = getChildren().size();

        for (int i = 0; i < childrenSize; i++) {
            Node node = getChildren().get(i);
            if (node instanceof DayEntryView) {
                DayEntryView view = (DayEntryView) node;
                Entry<?> viewEntry = view.getEntry();
                if (viewEntry.getStartAsZonedDateTime().isAfter(entry.getStartAsZonedDateTime())) {
                    return i;
                }
            }
        }

        return childrenSize;
    }
960998
private Entry<K, V> findEntry(final K key, Entry<K, V> def) {
        final int keyHash = key.hashCode();
        findResult = def;
        probe(keyHash, new BucketVisitor() {
            @Override
            public boolean visitAndGetContinuity(int pos) {
                if (bucket[pos] != null) {
                    if (isKeyInBucket(pos, key, keyHash)) {
                        findResult = bucket[pos];
                        return false;
                    } else {
                        return true;
                    }
                } else {
                    return false;
                }
            }
        });
        return findResult;
    }
702812
static Entry readEntry(final DataInput pInput) throws IOException {
        Entry p = new Entry();
        p.read(pInput);
        return p;
    }
1095691
@Override
    public FatLfnDirectoryEntry getEntry(String name) {
        name = name.trim().toLowerCase(Locale.ROOT);
        
        final FatLfnDirectoryEntry entry = longNameIndex.get(name);
        
        if (entry == null) {
            if (!ShortName.canConvert(name)) return null;
            return shortNameIndex.get(ShortName.get(name));
        } else {
            return entry;
        }
    }