Program: 74355
Project: 74355
Buggy source:
/** 
 * Provides the definition of a data set to Data Engine. A data set must be defined using this method prior to preparing any report query that uses such data set. <br> Data sets are uniquely identified name. If specified data set has already been defined, its definition will be updated with the content of the provided DataSetDesign
 */
public void defineDataSet(IBaseDataSetDesign dataSet) throws DataException {
  logger.entering(DataEngineImpl.class.getName(),"String_Node_Str",dataSet == null ? null : dataSet.getName());
  if (dataSet == null) {
    NullPointerException e=new NullPointerException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  if (dataSources == null) {
    IllegalStateException e=new IllegalStateException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  String name=dataSet.getName();
  if (name == null || name.length() == 0) {
    IllegalArgumentException e=new IllegalArgumentException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  if (logger.isLoggable(Level.FINE))   logger.logp(Level.FINE,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(dataSet));
  if (!(dataSet instanceof IJointDataSetDesign)) {
    String dataSourceName=dataSet.getDataSourceName();
    DataSourceRuntime dsource=this.getDataSourceRuntime(dataSourceName);
    if (dsource == null) {
      DataException e=new DataException(ResourceConstants.UNDEFINED_DATA_SOURCE,dataSourceName);
      logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + dataSourceName + "String_Node_Str",e);
      throw e;
    }
    Class dSourceClass;
    if (dataSet instanceof IOdaDataSetDesign)     dSourceClass=IOdaDataSourceDesign.class;
 else     if (dataSet instanceof IScriptDataSetDesign)     dSourceClass=IScriptDataSourceDesign.class;
 else {
      DataException e=new DataException(ResourceConstants.UNSUPPORTED_DATASET_TYPE);
      logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + dataSet.getName(),e);
      throw e;
    }
    if (!dSourceClass.isInstance(dsource.getDesign())) {
      DataException e=new DataException(ResourceConstants.UNSUPPORTED_DATASOURCE_TYPE,dsource.getName());
      logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + dsource.getName(),e);
      throw e;
    }
  }
  dataSetDesigns.put(name,dataSet);
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Provides the definition of a data set to Data Engine. A data set must be defined using this method prior to preparing any report query that uses such data set. <br> Data sets are uniquely identified name. If specified data set has already been defined, its definition will be updated with the content of the provided DataSetDesign
 */
public void defineDataSet(IBaseDataSetDesign dataSet) throws DataException {
  logger.entering(DataEngineImpl.class.getName(),"String_Node_Str",dataSet == null ? "String_Node_Str" : dataSet.getName());
  if (dataSet == null) {
    NullPointerException e=new NullPointerException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  if (dataSources == null) {
    IllegalStateException e=new IllegalStateException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  String name=dataSet.getName();
  if (name == null || name.length() == 0) {
    IllegalArgumentException e=new IllegalArgumentException("String_Node_Str");
    logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  if (logger.isLoggable(Level.FINE))   logger.logp(Level.FINE,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + LogUtil.toString(dataSet));
  if (!(dataSet instanceof IJointDataSetDesign)) {
    String dataSourceName=dataSet.getDataSourceName();
    DataSourceRuntime dsource=this.getDataSourceRuntime(dataSourceName);
    if (dsource == null) {
      DataException e=new DataException(ResourceConstants.UNDEFINED_DATA_SOURCE,dataSourceName);
      logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + dataSourceName + "String_Node_Str",e);
      throw e;
    }
    Class dSourceClass;
    if (dataSet instanceof IOdaDataSetDesign)     dSourceClass=IOdaDataSourceDesign.class;
 else     if (dataSet instanceof IScriptDataSetDesign)     dSourceClass=IScriptDataSourceDesign.class;
 else {
      DataException e=new DataException(ResourceConstants.UNSUPPORTED_DATASET_TYPE);
      logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + dataSet.getName(),e);
      throw e;
    }
    if (!dSourceClass.isInstance(dsource.getDesign())) {
      DataException e=new DataException(ResourceConstants.UNSUPPORTED_DATASOURCE_TYPE,dsource.getName());
      logger.logp(Level.WARNING,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str" + dsource.getName(),e);
      throw e;
    }
  }
  dataSetDesigns.put(name,dataSet);
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
}