|Re: Strange-looking code in EMF [message #422945 is a reply to message #422938]
||Fri, 19 September 2008 13:22
Originally posted by: cdamus.zeligsoft.com|
This works because EClassifiers intern() their instance-class names, and
Java ensures that string constants are interned, so this is actually
more efficient than .equals() and it's correct.
protected void basicSetInstanceClassName(String value)
if (instanceClassName == null && generatedInstanceClassName != null)
instanceClassName = generatedInstanceClassName;
generatedInstanceClassName = null;
setInstanceClassNameGen(value == null ? null : value.intern());
if (instanceClass != null)
Stefan Winkler wrote:
> just by chance I came over this code:
> if (eType.getInstanceClassName() == "java.util.Map$Entry")
> I haven't worked with maps in EMF, but this looks strongly suspicious?
> shouldn't == be .equals() ?!
Powered by FUDForum
. Page generated in 0.02128 seconds