Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] Problem with generics, Map.Entry




Thanks for reporting these directly to our bugzilla database (against
JDT/Core).
https://bugs.eclipse.org/bugs/enter_bug.cgi



                                                                           
             David Hovemeyer                                               
             <daveho@xxxxxxxxx                                             
             u>                                                         To 
             Sent by:                  jdt-core-dev@xxxxxxxxxxx            
             jdt-core-dev-admi                                          cc 
             n@xxxxxxxxxxx                                                 
                                                                   Subject 
                                       [jdt-core-dev] Problem with         
             09/16/2004 04:43          generics, Map.Entry                 
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
               jdt-core-dev                                                
                                                                           
                                                                           




Howdy,

Please accept my apologies if this is the wrong mailing list,
or if this is a known problem.

I'm using Eclipse 3.0 with the org.eclipse.jdt.core and
org.eclipse.jdt.ui plugins upgraded to HEAD, and the
org.eclipse.jdt.debug plugin upgraded to JDK_1_5.  (I built these
yesterday.)  My hope is to be able to use Eclipse to work on a
fairly large project that uses generics, but no other 1.5 language
features.

Almost all of the project built fine within Eclipse (!).  However,
I'm getting compile errors in places where entrySet().iterator()
is called on a Map with type parameters.  The following
code (which compiles fine using 1.5 beta2 javac) demonstrates the
problem:

package edu.umd.cs.daveho;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class CheetahBug {
             public static void main(String[] args) {
                         Map<String, String> map = new HashMap<String,
String>();

                         map.put("foo", "bar");

                         // Error reported on the following line
                         Iterator<Map.Entry<String,String>> i =
map.entrySet().iterator();
                         while (i.hasNext()) {
                                     Map.Entry<String, String> entry =
i.next();
                                     System.out.println(entry.getKey() + ",
" + entry.getValue());
                         }
             }
}

There are a few other places where Eclipse flags errors on things
that compile fine in 1.5.  I'll try to distill these as small test
cases.

-Dave
_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-core-dev




Back to the top