Community
Participate
Working Groups
Build Identifier: 20110916-0149 EMF's EMap is actually a EList<java.util.Map.Entry<K,V>>, so it's obvious to use map to do something with entries. But there is compiler error when trying to use map method on EMap instance. Code example: val l = new BasicEMap<String, String>() val ll = l.map(e | e.key) // error here error message: Incompatible receiver type. Expected java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> or java.util.Map.Entry<java.lang.String,java.lang.String>[] but was org.eclipse.emf.common.util.BasicEMap<java.lang.String,java.lang.String> this code works: val l = new BasicEList<Entry<String, String>>() val ll = l.map(e | e.key) Reproducible: Always
Don't you mean val ll = l.entrySet.map( e | e.key ) ?
(In reply to comment #1) > Don't you mean > > val ll = l.entrySet.map( e | e.key ) > > ? thanks, this works. But isn't it strange that "map" can't be used directly with EMap class which implements List interface?
Works now. val l = new BasicEMap<String, String>() val ll = l.map(e | e.key) // No error here
Requested via bug 522520. -M.