* @param modelElement
* @return
*/
private IMethod getProperMethod(IMethod modelElement) {
if (modelElement instanceof FakeConstructor) {
FakeConstructor fc = (FakeConstructor) modelElement;
if (fc.getParent() instanceof AliasType) {
AliasType aliasType = (AliasType) fc.getParent();
alias = aliasType.getAlias();
if (aliasType.getParent() instanceof IType) {
fc = FakeConstructor.createFakeConstructor(null,
(IType) aliasType.getParent(), false);
}
}
IType type = fc.getDeclaringType();
IMethod[] ctors = FakeConstructor.getConstructors(type,
fc.isEnclosingClass());
// here we must make sure ctors[1] != null,
// it means there is an available FakeConstructor for ctors[0]
if (ctors != null && ctors.length == 2 && ctors[0] != null
&& ctors[1] != null) {
return ctors[0];