[Biojava-dev] Cleanups for 1.4

Matthew Pocock matthew_pocock at yahoo.co.uk
Wed May 14 11:56:27 EDT 2003


Hi,

So - drop Nested*, add 1.4-style constructors to all
BioJava exceptions, deprecate biojava-style
constructors & delegate all guts on to the 1.4
Throwable class?

More comments in-line...

> >   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

Should be throwing a BibRefException or something else
like 'ConnectionFailedException'

>   
> src/org/biojava/bio/annodb/IndexedAnnotationDB.java
>    src/org/biojava/bio/dist/DistributionTools.java
>    src/org/biojava/bio/program/indexdb/BioStore.java

Should definitely be throwing other things -
NoSuchElementException, AnnodbException, whatever

>   
> src/org/biojava/bio/program/indexdb/CacheList.java

Again - Should be throwing a CommitFailureException,
not NestedException. It implements
org.biojava.utils.Commitable, so that's where the real
fix should go. This goes for all other Commitables...

>   
> 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.

Most of these are mine, and are the symptoms of
laziness.

> 
> 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.

NestedException can go then.

Matthew


__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer


More information about the biojava-dev mailing list