[Biojava-l] [Q]jdk1.3 support

Thomas Down td2@sanger.ac.uk
Tue, 8 Aug 2000 10:27:28 +0100


On Mon, Aug 07, 2000 at 08:24:25PM -0500, pvlad@bigfoot.com wrote:
> Hello,
> just downloaded the latest biojava source (I am a new user)
> and when trying to compile, I get:

Welcome!

> [errors in `case CONSTANT:' statements]

Okay, I think I can see what the problem is.  That code uses
a pattern like:

  public final static int CONSTANT_A = 1;
  public final static int CONSTANT_B = 2;

  public void someMethod(int var) {
    switch (var) {
      case CONSTANT_A:
        // do something
        break;
      case CONSTANT_B;
        // do something else
        break;
    }
  }

The use of Java constants (final static variables) in case
statements was supported in the old Java compiler, but has
been removed in the new compiler sun ship with JDK1.3.  I know
BioJava compiled in 1.3 a few weeks ago, but that bit of GUI
code is quite new :(.  Ooops.  I'll make sure it's fixed when
1.01 comes out.  It's just a matter of replacing the switch
blocks with equivalent if -- else if constructs.

For now, you could:

  1. (if you don't want to use the GUI components) just delete
     the directory src/org/biojava/bio/gui, and rebuild -- this
     should work fine.
 
  2. Download the binary release from our web site.  The compiled
     bytecode works fine under 1.3 (indeed, I was using it on my
     Linux laptop last night) -- it's just a compiler issue.

Thanks for the report.
Happy hacking,
    Thomas.
-- 
One of the advantages of being disorderly is that one is
constantly making exciting discoveries.
                                       -- A. A. Milne