Closed asfimport closed 18 years ago
Otis Gospodnetic (migrated from JIRA)
And if one declares 'throws IOException' for next() method in IteratorAdapter, the compile-time error is:
compile: [javac] Compiling 1 source file to /mnt/disk2/cvs-repositories/jakarta/jakarta-lucene-sandbox/contributions/searchbean/bin/classes [javac] /mnt/disk2/cvs-repositories/jakarta/jakarta-lucene-sandbox/contributions/searchbean/src/java/org/apache/lucene/beans/IteratorAdapter.java:27: next() in org.apache.lucene.beans.IteratorAdapter cannot implement next() in java.util.Iterator; overridden method does not throw java.io.IOException [javac] public Object next() [javac] ^ [javac] 1 error
BUILD FAILED
From CVS log:
Although HitsIterator doesn't implement Iterator, it follows the Iterator idiom so this is just a simple adapter (really more of a wrapper) which does implement Iterator.
Hmm, did this ever compile? Did you ever get this to compile, Erik?
Erik Hatcher (@erikhatcher) (migrated from JIRA)
Yes, I got it to compile locally by tweaking things until it worked. My use case was merely to learn what SearchBean could do - so I never committed my changes back. I did just commit them though, along with a fix to the build file.
From the jakarta-lucene-sandbox in the contributions/searchbean area:
compile: [javac] Compiling 3 source files to /Users/erik/dev/jakarta/jakarta-lucene-sandbox/contributions/searchbean/bin/classes [javac] /Users/erik/dev/jakarta/jakarta-lucene-sandbox/contributions/searchbean/src/java/org/apache/lucene/beans/IteratorAdapter.java:28: unreported exception java.io.IOException; must be caught or declared to be thrown [javac] return hitsIterator.next(); [javac] ^ [javac] 1 error
BUILD FAILED
Migrated from LUCENE-76 by Erik Hatcher (@erikhatcher), resolved May 27 2006 Environment: