Program: 136197
Project: 136197
Buggy source:
/** 
 * Create new Library Member Interface Node based on the passed TL object. <p> The TL LibraryMember listeners are used to look up the node. If the node doesn't exist, one is created. <p> For OTM version 1.6 and later, ContextualFacets are modeled as top-level ContextualFacetNodes. In version OTM version 1.5 contextual facets are skipped.
 * @return newly created node or null
 */
public static LibraryMemberInterface newLibraryMember(final LibraryMember mbr){
  LibraryMemberInterface lm=null;
  if (mbr == null)   return lm;
  Node n=Node.GetNode(mbr);
  if (n instanceof LibraryMemberInterface)   return (LibraryMemberInterface)n;
  if (n instanceof ContextualFacet15Node)   return null;
  if (mbr instanceof TLValueWithAttributes)   lm=new VWA_Node((TLValueWithAttributes)mbr);
 else   if (mbr instanceof TLBusinessObject)   lm=new BusinessObjectNode((TLBusinessObject)mbr);
 else   if (mbr instanceof TLCoreObject)   lm=new CoreObjectNode((TLCoreObject)mbr);
 else   if (mbr instanceof TLChoiceObject)   lm=new ChoiceObjectNode((TLChoiceObject)mbr);
 else   if (mbr instanceof TLSimple)   lm=new SimpleTypeNode((TLSimple)mbr);
 else   if (mbr instanceof TLOpenEnumeration)   lm=new EnumerationOpenNode((TLOpenEnumeration)mbr);
 else   if (mbr instanceof TLClosedEnumeration)   lm=new EnumerationClosedNode((TLClosedEnumeration)mbr);
 else   if (mbr instanceof TLExtensionPointFacet)   lm=new ExtensionPointNode((TLExtensionPointFacet)mbr);
 else   if (mbr instanceof TLResource)   lm=new ResourceNode((TLResource)mbr);
 else   if (mbr instanceof TLService)   lm=new ServiceNode((TLService)mbr,null);
 else   if (mbr instanceof TLContextualFacet) {
    if (OTM16Upgrade.otm16Enabled)     lm=createFacet((TLContextualFacet)mbr);
  }
 else   if (mbr instanceof XSDSimpleType)   lm=null;
 else   if (mbr instanceof XSDComplexType)   lm=null;
 else   if (mbr instanceof XSDElement)   lm=null;
 else {
    assert(false);
  }
  return lm;
}

Fixed version (ground truth):
/** 
 * Create new Library Member Interface Node based on the passed TL object. <p> The TL LibraryMember listeners are used to look up the node. If the node doesn't exist, one is created. <p> For OTM version 1.6 and later, ContextualFacets are modeled as top-level ContextualFacetNodes. In version OTM version 1.5 contextual facets are skipped.
 * @return newly created node or null
 */
public static LibraryMemberInterface newLibraryMember(final LibraryMember mbr){
  LibraryMemberInterface lm=null;
  if (mbr == null)   return lm;
  Node n=Node.GetNode(mbr);
  if (n instanceof LibraryMemberInterface)   return (LibraryMemberInterface)n;
  if (n instanceof ContextualFacet15Node)   return null;
  if (mbr instanceof TLValueWithAttributes)   lm=new VWA_Node((TLValueWithAttributes)mbr);
 else   if (mbr instanceof TLBusinessObject)   lm=new BusinessObjectNode((TLBusinessObject)mbr);
 else   if (mbr instanceof TLCoreObject)   lm=new CoreObjectNode((TLCoreObject)mbr);
 else   if (mbr instanceof TLChoiceObject)   lm=new ChoiceObjectNode((TLChoiceObject)mbr);
 else   if (mbr instanceof TLSimple)   lm=new SimpleTypeNode((TLSimple)mbr);
 else   if (mbr instanceof TLOpenEnumeration)   lm=new EnumerationOpenNode((TLOpenEnumeration)mbr);
 else   if (mbr instanceof TLClosedEnumeration)   lm=new EnumerationClosedNode((TLClosedEnumeration)mbr);
 else   if (mbr instanceof TLExtensionPointFacet)   lm=new ExtensionPointNode((TLExtensionPointFacet)mbr);
 else   if (mbr instanceof TLResource)   lm=new ResourceNode((TLResource)mbr);
 else   if (mbr instanceof TLService)   lm=new ServiceNode((TLService)mbr);
 else   if (mbr instanceof TLContextualFacet) {
    if (OTM16Upgrade.otm16Enabled)     lm=createFacet((TLContextualFacet)mbr);
  }
 else   if (mbr instanceof XSDSimpleType)   lm=null;
 else   if (mbr instanceof XSDComplexType)   lm=null;
 else   if (mbr instanceof XSDElement)   lm=null;
 else {
    assert(false);
  }
  return lm;
}