[Biojava-dev] Cleanups for 1.4

Thomas Down thomas at derkholm.net
Wed May 14 10:35:32 EDT 2003


Once upon a time, Matthew Pocock wrote:
>  
> > The only remaining bit of pre-1.4-ism that I can
> > think of is
> > the biojava-specific implementation of nested
> > throwables.
> 
> I'm happy to be responsible for this. The options are:
> 
>   1) leave well alone
> 
>   2) add 1.4-style constructors to all these
> throwables, deprecate our constructors (args the other
> way round) and chain onto the 1.4 throwable
> functionality
> 
>   3) drop Nested* from the tree, and inherit
> exceptions as needed
> 
> I personaly favour option 2, since we will still have
> things like BioException that need fixing.

I'm not actually that keen on (2).  It means keeping the
Nested* classes in the tree as dummy things, which don't
provide any interesting semantics *or* any useful functionality.
The only reason to do this is backwards compatibility.  I'd
actually assumed that NestedExceptions were never used directly.
In practice, there do seem to be a few files with methods marked
"throws NestedException":


   src/org/biojava/bibliography/BibRefQuery.java
   src/org/biojava/bibliography/BibRefSupport.java
   src/org/biojava/bio/annodb/IndexedAnnotationDB.java
   src/org/biojava/bio/dist/DistributionTools.java
   src/org/biojava/bio/program/indexdb/BioStore.java
   src/org/biojava/bio/program/indexdb/CacheList.java
   src/org/biojava/bio/program/indexdb/IndexTools.java
   src/org/biojava/bio/program/indexdb/PrimaryIDList.java
   src/org/biojava/bio/program/ssaha/DataStore.java
   src/org/biojava/bio/program/ssaha/NIODataStore.java
   src/org/biojava/bio/program/unigene/FlatFileUnigeneFactory.java
   src/org/biojava/utils/candy/CandyFinder.java
   src/org/biojava/utils/candy/CandyVocabulary.java
   src/org/biojava/utils/Commitable.java
   src/org/biojava/utils/FileAsList.java

But only three of these contain concrete code which actually
throws NestedExceptions.

Anyway, this is enough code that you probably can make a case
for keeping NestedException around.  On the other hand, I notice
several recently-added packages in that list, and it seems likely
that a lot of these classes are going to see more development in
bj1.4 anyway.  So I'm not sure if maintaining compatibility with
the current ssaha or annodb code counts as a good argument or
not.

Does anyone know of any userland code which catches NestedException?
If I'm going for something that general, I usually just catch
Exception.

Anybody else?

     Thomas.


More information about the biojava-dev mailing list