[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems compiling jcsp examples and demos with Java 2 JDK 1.3



Ramon,

> Which Timer class is the correct one? <<output.txt>> 

Sun introduced in JDK1.3 their own Timer class in the package java.util.
This is a pain!

Either I have to change the name of the JCSP Timer class (don't want to -
there are historical reasons for the name!) or make people aware that if
you have an application that:

  import java.util.*;
  import jcsp.lang.*;

there will be a name clash on Timer that the compiler can't resolve.

To resolve the clash, all you need do is use the full name of the class
that you want - e.g.

    jcsp.lang.Timer tim = new jcsp.lang.Timer ();

which will give you the JCSP Timer - or use "java.util.Timer" if you want
the JDK1.3 one.

For the moment, I'll edit the JCSP demos to do the above and put them in
the next release.

Cheers,

Peter.

PS. the JDK1.3 java.util.Timer is different to the jcsp.lang.Timer.  It's
    another class binding of a simple regular event thread pattern that
    saves users thinking directly through the threading code themselves.
    It would be trivial to emulate using the JCSP primitives - maybe the
    library should grow some of these ...