Program: 152675
Project: 152675
Buggy source:
public static void merge(JBossWebMetaData dest,JBossWebMetaData override,WebMetaData original,String overrideFile,String overridenFile,boolean mustOverride){
  NamedModuleImplMerger.merge(dest,override,original);
  if (override != null && override.getServletVersion() != null)   dest.setServletVersion(override.getServletVersion());
 else   if (original != null && original.getVersion() != null)   dest.setServletVersion(original.getVersion());
  if (override != null && override.getDistributable() != null)   dest.setDistributable(override.getDistributable());
 else   if (original != null && original.getDistributable() != null)   dest.setDistributable(original.getDistributable());
  if (override != null && override.isMetadataComplete() != false)   dest.setMetadataComplete(override.isMetadataComplete());
  if (original instanceof Web25MetaData) {
    Web25MetaData web25MD=(Web25MetaData)original;
    dest.setMetadataComplete(web25MD.isMetadataComplete());
  }
 else   if (original instanceof Web30MetaData) {
    Web30MetaData web30MetaData=(Web30MetaData)original;
    dest.setMetadataComplete(web30MetaData.isMetadataComplete());
  }
  if (override != null && override.isDisableCrossContext())   dest.setDisableCrossContext(override.isDisableCrossContext());
  if (override != null && override.getModuleName() != null)   dest.setModuleName(override.getModuleName());
 else   if (original instanceof NamedModule && ((NamedModule)original).getModuleName() != null)   dest.setModuleName(((NamedModule)original).getModuleName());
  if (override != null && override.getContextParams() != null)   dest.setContextParams(override.getContextParams());
 else   if (original != null && original.getContextParams() != null)   dest.setContextParams(original.getContextParams());
  if (override != null && override.getSessionConfig() != null)   dest.setSessionConfig(override.getSessionConfig());
 else   if (original != null && original.getSessionConfig() != null)   dest.setSessionConfig(original.getSessionConfig());
  if (override != null && override.getFilters() != null)   dest.setFilters(override.getFilters());
 else   if (original != null && original.getFilters() != null)   dest.setFilters(original.getFilters());
  if (override != null && override.getFilterMappings() != null)   dest.setFilterMappings(override.getFilterMappings());
 else   if (original != null && original.getFilterMappings() != null)   dest.setFilterMappings(original.getFilterMappings());
  if (override != null && override.getErrorPages() != null)   dest.setErrorPages(override.getErrorPages());
 else   if (original != null && original.getErrorPages() != null)   dest.setErrorPages(original.getErrorPages());
  if (override != null && override.getJspConfig() != null)   dest.setJspConfig(override.getJspConfig());
 else   if (original != null && original.getJspConfig() != null)   dest.setJspConfig(original.getJspConfig());
  if (override != null && override.getListeners() != null)   dest.setListeners(override.getListeners());
 else   if (original != null && original.getListeners() != null)   dest.setListeners(original.getListeners());
  if (override != null && override.getLoginConfig() != null)   dest.setLoginConfig(override.getLoginConfig());
 else   if (original != null && original.getLoginConfig() != null)   dest.setLoginConfig(original.getLoginConfig());
  if (override != null && override.getMimeMappings() != null)   dest.setMimeMappings(override.getMimeMappings());
 else   if (original != null && original.getMimeMappings() != null)   dest.setMimeMappings(original.getMimeMappings());
  if (override != null && override.getServletMappings() != null)   dest.setServletMappings(override.getServletMappings());
 else   if (original != null && original.getServletMappings() != null)   dest.setServletMappings(original.getServletMappings());
  if (override != null && override.getSecurityConstraints() != null)   dest.setSecurityConstraints(override.getSecurityConstraints());
 else   if (original != null && original.getSecurityConstraints() != null)   dest.setSecurityConstraints(original.getSecurityConstraints());
  if (override != null && override.getWelcomeFileList() != null)   dest.setWelcomeFileList(override.getWelcomeFileList());
 else   if (original != null && original.getWelcomeFileList() != null)   dest.setWelcomeFileList(original.getWelcomeFileList());
  if (override != null && override.getLocalEncodings() != null)   dest.setLocalEncodings(override.getLocalEncodings());
 else   if (original != null && original.getLocalEncodings() != null)   dest.setLocalEncodings(original.getLocalEncodings());
  if (override != null && override.getJaccAllStoreRole() != null)   dest.setJaccAllStoreRole(override.isJaccAllStoreRole());
  if (override != null && override.getDtdPublicId() != null)   dest.setDtdPublicId(override.getDtdPublicId());
  if (override != null && override.getDtdSystemId() != null)   dest.setDtdSystemId(override.getDtdSystemId());
  if (override != null && override.getVersion() != null)   dest.setVersion(override.getVersion());
 else   if (original != null && original.getVersion() != null)   dest.setVersion(original.getVersion());
  if (override != null && override.getContextRoot() != null)   dest.setContextRoot(override.getContextRoot());
  if (override != null && override.getAlternativeDD() != null)   dest.setAlternativeDD(override.getAlternativeDD());
  if (override != null && override.getSecurityDomain() != null)   dest.setSecurityDomain(override.getSecurityDomain());
  if (override != null && override.getJaccContextID() != null)   dest.setJaccContextID(override.getJaccContextID());
  if (override != null && override.getClassLoading() != null)   dest.setClassLoading(override.getClassLoading());
  if (override != null && override.getDepends() != null)   dest.setDepends(override.getDepends());
  if (override != null && override.getRunAsIdentity() != null)   dest.setRunAsIdentity(override.getRunAsIdentity());
  if (dest.getSecurityRoles() == null)   dest.setSecurityRoles(new SecurityRolesMetaData());
  SecurityRolesMetaData overrideRoles=null;
  SecurityRolesMetaData originalRoles=null;
  if (override != null)   overrideRoles=override.getSecurityRoles();
  if (original != null)   originalRoles=original.getSecurityRoles();
  SecurityRolesMetaDataMerger.merge(dest.getSecurityRoles(),overrideRoles,originalRoles);
  JBossServletsMetaData soverride=null;
  ServletsMetaData soriginal=null;
  if (override != null)   soverride=override.getServlets();
  if (original != null)   soriginal=original.getServlets();
  dest.setServlets(JBossServletsMetaDataMerger.merge(soverride,soriginal));
  MessageDestinationsMetaData overrideMsgDests=null;
  MessageDestinationsMetaData originalMsgDests=null;
  if (override != null && override.getMessageDestinations() != null)   overrideMsgDests=override.getMessageDestinations();
  if (original != null && original.getMessageDestinations() != null)   originalMsgDests=original.getMessageDestinations();
  dest.setMessageDestinations(MessageDestinationsMetaDataMerger.merge(overrideMsgDests,originalMsgDests,overridenFile,overrideFile));
  if (dest.getJndiEnvironmentRefsGroup() == null)   dest.setJndiEnvironmentRefsGroup(new EnvironmentRefsGroupMetaData());
  Environment env=null;
  EnvironmentRefsGroupMetaData jenv=null;
  if (override != null)   jenv=(EnvironmentRefsGroupMetaData)override.getJndiEnvironmentRefsGroup();
  if (original != null)   env=original.getJndiEnvironmentRefsGroup();
  EnvironmentRefsGroupMetaDataMerger.merge((EnvironmentRefsGroupMetaData)dest.getJndiEnvironmentRefsGroup(),jenv,env,overrideFile,overridenFile,mustOverride);
  if (override != null && override.getVirtualHosts() != null)   dest.setVirtualHosts(override.getVirtualHosts());
  if (override != null && override.isFlushOnSessionInvalidation())   dest.setFlushOnSessionInvalidation(override.isFlushOnSessionInvalidation());
  if (override != null && override.getReplicationConfig() != null)   dest.setReplicationConfig(override.getReplicationConfig());
  if (override != null && override.getPassivationConfig() != null)   dest.setPassivationConfig(override.getPassivationConfig());
  if (override != null && override.getWebserviceDescriptions() != null)   dest.setWebserviceDescriptions(override.getWebserviceDescriptions());
  if (override != null && override.getArbitraryMetadata() != null)   dest.setArbitraryMetadata(override.getArbitraryMetadata());
  if (override != null && override.getMaxActiveSessions() != null)   dest.setMaxActiveSessions(override.getMaxActiveSessions());
  if (override != null && override.getSessionCookies() != -1)   dest.setSessionCookies(override.getSessionCookies());
  JBossAnnotationsMetaData aoverride=null;
  AnnotationsMetaData aoriginal=null;
  if (override != null)   aoverride=override.getAnnotations();
  if (original != null)   aoriginal=original.getAnnotations();
  dest.setAnnotations(JBossAnnotationsMetaDataMerger.merge(aoverride,aoriginal));
  if (override != null && override.getContainerListeners() != null)   dest.setContainerListeners(override.getContainerListeners());
  if (override != null && override.getValves() != null)   dest.setValves(override.getValves());
  if (override != null && override.getOverlays() != null)   dest.setOverlays(override.getOverlays());
  if (override != null && override.isUseJBossAuthorization())   dest.setUseJBossAuthorization(override.isUseJBossAuthorization());
  if (override != null && !override.isDisableAudit())   dest.setDisableAudit(override.isDisableAudit());
}

Fixed version (ground truth):
public static void merge(JBossWebMetaData dest,JBossWebMetaData override,WebMetaData original,String overrideFile,String overridenFile,boolean mustOverride){
  NamedModuleImplMerger.merge(dest,override,original);
  if (override != null && override.getServletVersion() != null)   dest.setServletVersion(override.getServletVersion());
 else   if (original != null && original.getVersion() != null)   dest.setServletVersion(original.getVersion());
  if (override != null && override.getDistributable() != null)   dest.setDistributable(override.getDistributable());
 else   if (original != null && original.getDistributable() != null)   dest.setDistributable(original.getDistributable());
  if (override != null && override.isMetadataComplete() != false)   dest.setMetadataComplete(override.isMetadataComplete());
  if (original instanceof Web25MetaData) {
    Web25MetaData web25MD=(Web25MetaData)original;
    dest.setMetadataComplete(web25MD.isMetadataComplete());
  }
 else   if (original instanceof Web30MetaData) {
    Web30MetaData web30MetaData=(Web30MetaData)original;
    dest.setMetadataComplete(web30MetaData.isMetadataComplete());
  }
  if (override != null && override.isDisableCrossContext())   dest.setDisableCrossContext(override.isDisableCrossContext());
  if (override != null && override.getModuleName() != null)   dest.setModuleName(override.getModuleName());
 else   if (original instanceof NamedModule && ((NamedModule)original).getModuleName() != null)   dest.setModuleName(((NamedModule)original).getModuleName());
  if (override != null && override.getContextParams() != null)   dest.setContextParams(override.getContextParams());
 else   if (original != null && original.getContextParams() != null)   dest.setContextParams(original.getContextParams());
  if (override != null && override.getSessionConfig() != null)   dest.setSessionConfig(override.getSessionConfig());
 else   if (original != null && original.getSessionConfig() != null)   dest.setSessionConfig(original.getSessionConfig());
  if (override != null && override.getFilters() != null)   dest.setFilters(override.getFilters());
 else   if (original != null && original.getFilters() != null)   dest.setFilters(original.getFilters());
  if (override != null && override.getFilterMappings() != null)   dest.setFilterMappings(override.getFilterMappings());
 else   if (original != null && original.getFilterMappings() != null)   dest.setFilterMappings(original.getFilterMappings());
  if (override != null && override.getErrorPages() != null)   dest.setErrorPages(override.getErrorPages());
 else   if (original != null && original.getErrorPages() != null)   dest.setErrorPages(original.getErrorPages());
  if (override != null && override.getJspConfig() != null)   dest.setJspConfig(override.getJspConfig());
 else   if (original != null && original.getJspConfig() != null)   dest.setJspConfig(original.getJspConfig());
  if (override != null && override.getListeners() != null)   dest.setListeners(override.getListeners());
 else   if (original != null && original.getListeners() != null)   dest.setListeners(original.getListeners());
  if (override != null && override.getLoginConfig() != null)   dest.setLoginConfig(override.getLoginConfig());
 else   if (original != null && original.getLoginConfig() != null)   dest.setLoginConfig(original.getLoginConfig());
  if (override != null && override.getMimeMappings() != null)   dest.setMimeMappings(override.getMimeMappings());
 else   if (original != null && original.getMimeMappings() != null)   dest.setMimeMappings(original.getMimeMappings());
  if (override != null && override.getServletMappings() != null)   dest.setServletMappings(override.getServletMappings());
 else   if (original != null && original.getServletMappings() != null)   dest.setServletMappings(original.getServletMappings());
  if (override != null && override.getSecurityConstraints() != null)   dest.setSecurityConstraints(override.getSecurityConstraints());
 else   if (original != null && original.getSecurityConstraints() != null)   dest.setSecurityConstraints(original.getSecurityConstraints());
  if (override != null && override.getWelcomeFileList() != null)   dest.setWelcomeFileList(override.getWelcomeFileList());
 else   if (original != null && original.getWelcomeFileList() != null)   dest.setWelcomeFileList(original.getWelcomeFileList());
  if (override != null && override.getLocalEncodings() != null)   dest.setLocalEncodings(override.getLocalEncodings());
 else   if (original != null && original.getLocalEncodings() != null)   dest.setLocalEncodings(original.getLocalEncodings());
  if (override != null && override.getJaccAllStoreRole() != null)   dest.setJaccAllStoreRole(override.isJaccAllStoreRole());
  if (override != null && override.getDtdPublicId() != null)   dest.setDtdPublicId(override.getDtdPublicId());
  if (override != null && override.getDtdSystemId() != null)   dest.setDtdSystemId(override.getDtdSystemId());
  if (override != null && override.getVersion() != null)   dest.setVersion(override.getVersion());
 else   if (original != null && original.getVersion() != null)   dest.setVersion(original.getVersion());
  if (override != null && override.getContextRoot() != null)   dest.setContextRoot(override.getContextRoot());
  if (override != null && override.getAlternativeDD() != null)   dest.setAlternativeDD(override.getAlternativeDD());
  if (override != null && override.getSecurityDomain() != null)   dest.setSecurityDomain(override.getSecurityDomain());
  if (override != null && override.getJaccContextID() != null)   dest.setJaccContextID(override.getJaccContextID());
  if (override != null && override.getClassLoading() != null)   dest.setClassLoading(override.getClassLoading());
  if (override != null && override.getDepends() != null)   dest.setDepends(override.getDepends());
  if (override != null && override.getRunAsIdentity() != null)   dest.setRunAsIdentity(override.getRunAsIdentity());
  if (dest.getSecurityRoles() == null)   dest.setSecurityRoles(new SecurityRolesMetaData());
  SecurityRolesMetaData overrideRoles=null;
  SecurityRolesMetaData originalRoles=null;
  if (override != null)   overrideRoles=override.getSecurityRoles();
  if (original != null)   originalRoles=original.getSecurityRoles();
  SecurityRolesMetaDataMerger.merge(dest.getSecurityRoles(),overrideRoles,originalRoles);
  JBossServletsMetaData soverride=null;
  ServletsMetaData soriginal=null;
  if (override != null)   soverride=override.getServlets();
  if (original != null)   soriginal=original.getServlets();
  dest.setServlets(JBossServletsMetaDataMerger.merge(soverride,soriginal));
  MessageDestinationsMetaData overrideMsgDests=null;
  MessageDestinationsMetaData originalMsgDests=null;
  if (override != null && override.getMessageDestinations() != null)   overrideMsgDests=override.getMessageDestinations();
  if (original != null && original.getMessageDestinations() != null)   originalMsgDests=original.getMessageDestinations();
  dest.setMessageDestinations(MessageDestinationsMetaDataMerger.merge(overrideMsgDests,originalMsgDests,overridenFile,overrideFile));
  if (dest.getJndiEnvironmentRefsGroup() == null)   dest.setJndiEnvironmentRefsGroup(new EnvironmentRefsGroupMetaData());
  Environment env=null;
  EnvironmentRefsGroupMetaData jenv=null;
  if (override != null)   jenv=(EnvironmentRefsGroupMetaData)override.getJndiEnvironmentRefsGroup();
  if (original != null)   env=original.getJndiEnvironmentRefsGroup();
  EnvironmentRefsGroupMetaDataMerger.merge((EnvironmentRefsGroupMetaData)dest.getJndiEnvironmentRefsGroup(),jenv,env,overrideFile,overridenFile,mustOverride);
  if (override != null && override.getVirtualHosts() != null)   dest.setVirtualHosts(override.getVirtualHosts());
  if (override != null && override.isFlushOnSessionInvalidation())   dest.setFlushOnSessionInvalidation(override.isFlushOnSessionInvalidation());
  if (override != null && override.getReplicationConfig() != null)   dest.setReplicationConfig(override.getReplicationConfig());
  if (override != null && override.getPassivationConfig() != null)   dest.setPassivationConfig(override.getPassivationConfig());
  if (override != null && override.getWebserviceDescriptions() != null)   dest.setWebserviceDescriptions(override.getWebserviceDescriptions());
  if (override != null && override.getArbitraryMetadata() != null)   dest.setArbitraryMetadata(override.getArbitraryMetadata());
  if (override != null && override.getMaxActiveSessions() != null)   dest.setMaxActiveSessions(override.getMaxActiveSessions());
  if (override != null && override.getSessionCookies() != -1)   dest.setSessionCookies(override.getSessionCookies());
  JBossAnnotationsMetaData aoverride=null;
  AnnotationsMetaData aoriginal=null;
  if (override != null)   aoverride=override.getAnnotations();
  if (original != null)   aoriginal=original.getAnnotations();
  dest.setAnnotations(JBossAnnotationsMetaDataMerger.merge(aoverride,aoriginal));
  if (override != null && override.getContainerListeners() != null)   dest.setContainerListeners(override.getContainerListeners());
  if (override != null && override.getValves() != null)   dest.setValves(override.getValves());
  if (override != null && override.getOverlays() != null)   dest.setOverlays(override.getOverlays());
  if (override != null && override.isUseJBossAuthorization())   dest.setUseJBossAuthorization(override.isUseJBossAuthorization());
  if (override != null && !override.isDisableAudit())   dest.setDisableAudit(override.isDisableAudit());
  if (override != null && override.isSymbolicLinkingEnabled())   dest.setSymbolicLinkingEnabled(override.isSymbolicLinkingEnabled());
}