hi all
thanks for the reply;
things getting a litter  clear.
when i remove the jar file 'antlr-2.7.5H3.jar' , it work fine, put 0 in and
get 0 out.
but when i put the jar file back, it still put 0 in and get 1 out.

the jar is in the \tomcat\webapps\'myproject'\WEB-INF\lib\

it seems like the there is something wrong in the jar file.this jar is
shipped with hibernate. And i try the newest jar file from the newest
hiberbate,but it is still has the same problem.

does anyone has a idea?

the test code in a jsp file in my project:

java.util.List alist =new java.util.ArrayList<Integer>();
alist.add(0);
out.print(alist.get(0));

Regards

On 5/22/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Felix,

Felix Schumacher wrote:
> Am Montag, den 21.05.2007, 13:54 +0800 schrieb Peter:
>> hi all,
>>
>> I have come into a very wired problem.
>>
>> here it is.
>> my project using JBuilder 2006 and tomcat 5.5.20.
>> when i put a 0 into a list and get 1 as a result.
>> simple code for testing!
>>
>> List alist =new ArrayList();
>> alist.add(0);  put 0 into it
>> alist.get(0);   get 1 as result.
> Have you tried to put an Object into ArrayList?
> Like
> alist.add(Integer.valueOf(0));
> System.out.println((Integer)alist.get(0));
>
> I don't think it is possible to store an int into an ArrayList.

Generics + autoboxing ought to allow you to put ints into an ArrayList
(at least syntactically, though it's really just syntactic sugar).

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUhdv9CaO5/Lv0PARAmKMAJ9DjxpSf4zZmIdM+WQx8+q0fSRf7ACgjTAl
MBXxUu/ld4Aanpt9gQ8IXGg=
=38QU
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to