This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: kawa use of java 2 collections


You may have received this message twice. The date of the previous
version
was wrong. Sorry
------------------------

Sun proviced Collection API for java 1.1
http://java.sun.com/products/javabeans/infobus/collectionsreadme.html

They've done it to let JavaBean Infobus compatible with 1.1 while taking

advantage of 1.2.

It is downloadable from:
http://java.sun.com/products/javabeans/infobus/
which give access to:
ftp://ftp.java.sun.com/pub/beans/586947a/collections1_1.zip

So, I think everybody (1.1ers ans 1.2ers) will be happy.

NOTE that 1.1 version of Kawa should use com.sun.java.util.collection
package
instead of java.util because of security issue with web browsers (look
in
README).
So you need to modify the code like that:

Consider a standards Java 2 code:

package mypackage;

import java.util.*;

class Test {
    int method() {
        Map a=new HashMap();  // HashMap come for Collection API
        a.put(this,this);    // do something
        return a.size()
    }
}

To make this code also 1.1 compatible :

import java.util.*;
import com.sun.java.util.collection.*; // ADD this magic line

class Test {
    int method() {
        Map a=new HashMap();  // READ comment below
        a.put(this,this);
        return a.size()
    }
}

To compile it for 1.1. Just add the collections.jar (coming from Sun),
then
HashMap will be seen as com.sun.java.util.collection.HashMap.

To compile it for 1.2. Just add an empty directory named
com/sun./java/util/collection in
your classpath to content javac, and HashMap will refer to
java.util.HashMap. I guess the empty
directory is not needed at runtime because it is not needed.

Long live Kawa with Collection API.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]