if ( !isInitialized() ) throw new IllegalStateException("Database must be initialized before use!");  if ( url == null ) throw new IllegalArgumentException("Parameter 'url' is not allowed to be null");  boolean closeReader = false; TermDocs docs = null; try { LOG.debug("Getting Entry with URL: "+url);  if ( reader == null ) { reader = getReader(); closeReader = true; }  Term term = new Term( URLHASH, computeHash(url) ); docs = reader.termDocs(term);  List entries = new ArrayList(); while ( docs.next() ) { entries.add( new Entry( reader.document(docs.doc()), 0) ); }  LOG.debug("Found "+entries.size()+" entries for URL "+url);  return (Entry[]) entries.toArray(new Entry[0]);  } finally {  if  ( closeReader && reader != null ) reader.close();  if ( docs != null ) docs.close(); }
return getEntries(getOffset(), getLimit(), pub);
    private Entry[] getEntries(URL url, IndexReader reader) throws IOException    {        if ( !isInitialized() )            throw new IllegalStateException("Database must be initialized before use!");        if ( url == null )            throw new IllegalArgumentException("Parameter 'url' is not allowed to be null");        boolean closeReader = false;        TermDocs docs = null;        try {            LOG.debug("Getting Entry with URL: "+url);            if ( reader == null ) {                reader = getReader();                closeReader = true;            }            Term term = new Term( URLHASH, computeHash(url) );            docs = reader.termDocs(term);            List entries = new ArrayList();            while ( docs.next() ) {                entries.add( new Entry( reader.document(docs.doc()), 0) );            }            LOG.debug("Found "+entries.size()+" entries for URL "+url);            return (Entry[]) entries.toArray(new Entry[0]);        } finally {            if  ( closeReader && reader != null )                reader.close();            if ( docs != null )                docs.close();        }    }