Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Useless cast
Useless cast [message #482152] Tue, 25 August 2009 10:20 Go to next message
Eclipse UserFriend
Originally posted by: none.domain.invalid

Hi, i found out that eclipse do not emit a warning for this code:

Vector<Integer> v= m.surligne;

if (v!=null)
for (int u = 0; u<v.size();u++)
if (((Integer) v.get(u))==1) // <= here
foo(u);

Should i report a bug ?
Re: Useless cast [message #482300 is a reply to message #482152] Wed, 26 August 2009 03:28 Go to previous messageGo to next message
Eclipse UserFriend
Name wrote:
> Hi, i found out that eclipse do not emit a warning for this code:
>
> Vector<Integer> v= m.surligne;
>
> if (v!=null)
> for (int u = 0; u<v.size();u++)
> if (((Integer) v.get(u))==1) // <= here
> foo(u);
>
> Should i report a bug ?
Yes, please file it against JDT Core and post the bug number here.
Simpler test case:
void test() {
Vector<Integer> v= new Vector(1);
if (((Integer) v.get(0))==1) // <= here
System.out.println();
}


Dani
Re: Useless cast [message #482341 is a reply to message #482300] Wed, 26 August 2009 06:07 Go to previous message
Eclipse UserFriend
Originally posted by: none.domain.invalid

Daniel Megert a écrit :
> Yes, please file it against JDT Core and post the bug number here.

http://bugs.eclipse.org/bugs/show_bug.cgi?id=287676
Previous Topic:Not able to register Debug adapter classes
Next Topic:Connection to JNDI datasource
Goto Forum:
  


Current Time: Thu Nov 06 23:48:42 EST 2025

Powered by FUDForum. Page generated in 0.03303 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top