Re: hi,wired problem? add 0 into alist but get 1 as a result!
En l'instant précis du 22/05/07 05:21, Peter s'exprimait en ces termes: hi all; only get problem when put 0 into the list, put 1 or any number is ok, put new Integer(0) is ok as well; Ide not recompiling or tomcat not reloading class, while you think you are running the 0 case, you are in fact running the 1 case. did you try successfully storing 3 then switch back to 0. If It does not compile at 0, your test case will still show 3. i think it may be a bug. does anyone has a idea? regards On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0 generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: hi,wired problem? add 0 into alist but get 1 as a result!
Do a clean and build in your IDE. Run the test case in the IDE if possible. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 22, 2007 2:35 AM To: Tomcat Users List Subject: [Norton AntiSpam] Re: hi,wired problem? add 0 into alist but get 1 as a result! En l'instant précis du 22/05/07 05:21, Peter s'exprimait en ces termes: hi all; only get problem when put 0 into the list, put 1 or any number is ok, put new Integer(0) is ok as well; Ide not recompiling or tomcat not reloading class, while you think you are running the 0 case, you are in fact running the 1 case. did you try successfully storing 3 then switch back to 0. If It does not compile at 0, your test case will still show 3. i think it may be a bug. does anyone has a idea? regards On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0 generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later hmm, do you use this code in a jsp? Could you possible check the source code generated by tomcat for this jsp and inspect it / send it to us? Sounds like your jsp compiler is buggy. regards Leon but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
Never heard of such problem. Check your code. Either you add 1 to list, not 0, either you badly display result, either it's not the same list. Peter a écrit : 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
hi all i put it in the jsp, and here is the code generate by tomcat i did not see if there is any wrong there. package org.apache.jsp; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import java.util.*; public final class jsp1_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static java.util.List _jspx_dependants; public Object getDependants() { return _jspx_dependants; } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { JspFactory _jspxFactory = null; PageContext pageContext = null; HttpSession session = null; ServletContext application = null; ServletConfig config = null; JspWriter out = null; Object page = this; JspWriter _jspx_out = null; PageContext _jspx_page_context = null; try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType(text/html; charset=GB2312); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write(\r\n); out.write(\r\n); out.write(\r\n); out.write(\r\n); out.write(html\r\n); out.write(head\r\n); out.write(title\r\n); out.write(jsp1\r\n); out.write(/title\r\n); out.write(/head\r\n); out.write(body bgcolor=\#ff\\r\n); out.write(h1\r\n); out.write(JBuilder Generated JSP\r\n); List alist =new ArrayList(); alist.add(0); out.print(alist.get(0)); //Gentest gt=new Gentest(); //gt.addalist(); //gt.addlist(); out.write(\r\n); out.write(/h1\r\n); out.write(form method=\post\ action=\jsp1.jsp\\r\n); out.write(brbr\r\n); out.write(input type=\submit\ name=\Submit\ value=\Submit\\r\n); out.write(input type=\reset\ value=\Reset\\r\n); out.write(/form\r\n); out.write(/body\r\n); out.write(/html\r\n); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null out.getBufferSize() != 0) out.clearBuffer(); if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); } } finally { if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context); } } } On 5/21/07, Leon Rosenberg [EMAIL PROTECTED] wrote: On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later hmm, do you use this code in a jsp? Could you possible check the source code generated by tomcat for this jsp and inspect it / send it to us? Sounds like your jsp compiler is buggy. regards Leon but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
in the mail before, i put 0 in a list and get 1 as result. On 5/21/07, Leon Rosenberg [EMAIL PROTECTED] wrote: On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later hmm, do you use this code in a jsp? Could you possible check the source code generated by tomcat for this jsp and inspect it / send it to us? Sounds like your jsp compiler is buggy. regards Leon but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
thanks i am sure that i put 0 in to a list and i am not badly display result and it is the same list and it is only occur in this project. thanks for any idea On 5/21/07, David Delbecq [EMAIL PROTECTED] wrote: Never heard of such problem. Check your code. Either you add 1 to list, not 0, either you badly display result, either it's not the same list. Peter a écrit : 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
hi all i try to do like List alist =new ArrayList(); alist.add(0L); alist.get(0); and it is fine. donot know why? On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0 generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced!
RE: hi,wired problem? add 0 into alist but get 1 as a result!
Try creating your List like this and see what happens. Listint alist =new ArrayListint(); -Original Message- From: Peter [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 2:29 AM To: Tomcat Users List Subject: Re: hi,wired problem? add 0 into alist but get 1 as a result! thanks i am sure that i put 0 in to a list and i am not badly display result and it is the same list and it is only occur in this project. thanks for any idea On 5/21/07, David Delbecq [EMAIL PROTECTED] wrote: Never heard of such problem. Check your code. Either you add 1 to list, not 0, either you badly display result, either it's not the same list. Peter a écrit : 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
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. Bye Felix - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hi,wired problem? add 0 into alist but get 1 as a result!
Try creating your List like this and see what happens. Listint alist =new ArrayListint(); -Original Message- From: Peter [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 2:29 AM To: Tomcat Users List Subject: Re: hi,wired problem? add 0 into alist but get 1 as a result! thanks i am sure that i put 0 in to a list and i am not badly display result and it is the same list and it is only occur in this project. thanks for any idea On 5/21/07, David Delbecq [EMAIL PROTECTED] wrote: Never heard of such problem. Check your code. Either you add 1 to list, not 0, either you badly display result, either it's not the same list. Peter a écrit : 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
On 5/21/07, David Short [EMAIL PROTECTED] wrote: Try creating your List like this and see what happens. Listint alist =new ArrayListint(); and you get this compiled? -Original Message- From: Peter [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 2:29 AM To: Tomcat Users List Subject: Re: hi,wired problem? add 0 into alist but get 1 as a result! thanks i am sure that i put 0 in to a list and i am not badly display result and it is the same list and it is only occur in this project. thanks for any idea On 5/21/07, David Delbecq [EMAIL PROTECTED] wrote: Never heard of such problem. Check your code. Either you add 1 to list, not 0, either you badly display result, either it's not the same list. Peter a écrit : 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
On 5/21/07, Felix Schumacher [EMAIL PROTECTED] wrote: 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. Autoboxing is the magic word here. The compiler generates alist.add(new Integer(0)); if it sees alias.add(0); regards Leon Bye Felix - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
David Short wrote: Try creating your List like this and see what happens. Listint alist =new ArrayListint(); Won't work, you can't use primitives, instead do: ListInteger alist = new ArrayListInteger(); -Original Message- From: Peter [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 2:29 AM To: Tomcat Users List Subject: Re: hi,wired problem? add 0 into alist but get 1 as a result! thanks i am sure that i put 0 in to a list and i am not badly display result and it is the same list and it is only occur in this project. thanks for any idea On 5/21/07, David Delbecq [EMAIL PROTECTED] wrote: Never heard of such problem. Check your code. Either you add 1 to list, not 0, either you badly display result, either it's not the same list. Peter a écrit : 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature
RE: hi,wired problem? add 0 into alist but get 1 as a result!
Yes. It declares that the List is going to hold integers. See http://www.onjava.com/lpt/a/6014. -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Monday, May 21, 2007 1:10 PM To: Tomcat Users List Subject: Re: hi,wired problem? add 0 into alist but get 1 as a result! On 5/21/07, Felix Schumacher [EMAIL PROTECTED] wrote: 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. Autoboxing is the magic word here. The compiler generates alist.add(new Integer(0)); if it sees alias.add(0); regards Leon Bye Felix - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
-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]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
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.ArrayListInteger(); 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]
Re: hi,wired problem? add 0 into alist but get 1 as a result!
hi all; only get problem when put 0 into the list, put 1 or any number is ok, put new Integer(0) is ok as well; i think it may be a bug. does anyone has a idea? regards On 5/21/07, Peter [EMAIL PROTECTED] wrote: 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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0 generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced!
hi,wired problem? add 0 into alist but get 1 as a result!
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. it occurs when i using JBuilder2006 to complie it and run under tomcat 5.5.20. i choose Jbuilder 2006 builder property: language features ( java 2 SDK V5.0generic enable) ; target VM java 2 SDK V5.0 and later but if i choose target VM target VM java 2 SDK V1.4 and later it works fine, put 0 get 0. and if i donot run under the tomcat it still fine so i create another small project, in a jsp only doing List alist =new ArrayList(); alist.add(0); alist.get(0); and it works fine as well under the same tomcat. i wonder what happens here? my project using many other jar file , i wonder if there is something wrong there. does anyone has a idea? thanks in advanced!