nus-yam/ex-repair huggingface dataset:
Program: 125496
Project: 125496
Buggy source:
private static void getFoxTreeNodesForXmlMap(String filePath,List<FOXTreeNode> list) throws OdaException, URISyntaxException, IOException {
  ATreeNode treeNode=SchemaPopulationUtil.getSchemaTree(filePath,true,0);
  String rootName="String_Node_Str";
  if (treeNode.getValue() instanceof String) {
    rootName+="String_Node_Str" + treeNode.getValue();
  }
  FOXTreeNode root=cloneATreeNode(treeNode,rootName,XmlUtil.isXSDFile(filePath));
  if (root instanceof Element) {
    if (root instanceof Element) {
      root=((Element)root).getElementChildren().get(0);
      root.setParent(null);
      list.add(root);
      if (XmlUtil.isXMLFile(filePath)) {
        List<? extends FOXTreeNode> nameSpaceChildren=((Element)root).getNameSpaceChildren();
        for (        FOXTreeNode nameSpaceChild : nameSpaceChildren) {
          if (nameSpaceChild instanceof NameSpaceNode) {
            nameSpaceChild.setDataType(JavaDataTypeHelper.getTalendTypeOfValue(nameSpaceChild.getDataType()));
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void getFoxTreeNodesForXmlMap(String filePath,List<FOXTreeNode> list) throws OdaException, URISyntaxException, IOException {
  ATreeNode treeNode=SchemaPopulationUtil.getSchemaTree(filePath,true,0);
  FOXTreeNode root=cloneATreeNode(treeNode,XmlUtil.isXSDFile(filePath));
  if (root instanceof Element) {
    if (root instanceof Element) {
      root=((Element)root).getElementChildren().get(0);
      root.setParent(null);
      list.add(root);
      if (XmlUtil.isXMLFile(filePath)) {
        List<? extends FOXTreeNode> nameSpaceChildren=((Element)root).getNameSpaceChildren();
        for (        FOXTreeNode nameSpaceChild : nameSpaceChildren) {
          if (nameSpaceChild instanceof NameSpaceNode) {
            nameSpaceChild.setDataType(JavaDataTypeHelper.getTalendTypeOfValue(nameSpaceChild.getDataType()));
          }
        }
      }
    }
  }
}
Program: 125497
Project: 125497
Buggy source:
public void initialize(ERepositoryObjectType itemType) throws PersistenceException {
  if (!types.contains(itemType)) {
    types.add(itemType);
    List<IRepositoryViewObject> list=factory.getAll(itemType,true,false);
    List<IRepositoryViewObject> newList=new ArrayList<IRepositoryViewObject>();
    for (    IRepositoryViewObject obj : list) {
      IRepositoryViewObject newObject=new RepositoryViewObject(obj.getProperty(),true);
      List<IRepositoryViewObject> items=cache.get(newObject.getId());
      if (items == null) {
        items=new ArrayList<IRepositoryViewObject>();
        cache.put(newObject.getId(),items);
      }
      items.add(newObject);
      newList.add(newObject);
    }
    itemsFromRepository.put(itemType,newList);
  }
}

Fixed version (ground truth):
public void initialize(ERepositoryObjectType itemType) throws PersistenceException {
  if (!types.contains(itemType)) {
    types.add(itemType);
    List<IRepositoryViewObject> list=factory.getAll(itemType,true,false);
    if (list == null || list.isEmpty()) {
      ERepositoryObjectType newRepType=getNewRepType(itemType);
      if (newRepType != null) {
        list=factory.getAll(newRepType,true,false);
      }
    }
    List<IRepositoryViewObject> newList=new ArrayList<IRepositoryViewObject>();
    for (    IRepositoryViewObject obj : list) {
      IRepositoryViewObject newObject=new RepositoryViewObject(obj.getProperty(),true);
      List<IRepositoryViewObject> items=cache.get(newObject.getId());
      if (items == null) {
        items=new ArrayList<IRepositoryViewObject>();
        cache.put(newObject.getId(),items);
      }
      items.add(newObject);
      newList.add(newObject);
    }
    itemsFromRepository.put(itemType,newList);
  }
}
Program: 125500
Project: 125500
Buggy source:
public static List<Map<String,Object>> getColumnMappingValue(Connection connection,IMetadataTable metaTable){
  if (connection == null || metaTable == null) {
    return null;
  }
  List<Map<String,Object>> values=new ArrayList<Map<String,Object>>();
  List<IMetadataColumn> columns=metaTable.getListColumns();
  if (connection instanceof DatabaseConnection) {
    DatabaseConnection dbConn=(DatabaseConnection)connection;
    String databaseType=dbConn.getDatabaseType();
    if (EDatabaseTypeName.HBASE.getDisplayName().equals(databaseType)) {
      for (      IMetadataColumn column : columns) {
        Map<String,Object> row=new HashMap<String,Object>();
        row.put("String_Node_Str",column.getLabel());
        row.put("String_Node_Str",TalendQuoteUtils.addQuotes(column.getAdditionalField().get("String_Node_Str")));
        values.add(row);
      }
    }
  }
  return values;
}

Fixed version (ground truth):
public static List<Map<String,Object>> getColumnMappingValue(Connection connection,IMetadataTable metaTable){
  if (connection == null || metaTable == null) {
    return null;
  }
  List<Map<String,Object>> values=new ArrayList<Map<String,Object>>();
  List<IMetadataColumn> columns=metaTable.getListColumns();
  if (connection instanceof DatabaseConnection) {
    DatabaseConnection dbConn=(DatabaseConnection)connection;
    String databaseType=dbConn.getDatabaseType();
    if (EDatabaseTypeName.HBASE.getDisplayName().equals(databaseType) || EDatabaseTypeName.MAPRDB.getDisplayName().equals(databaseType)) {
      for (      IMetadataColumn column : columns) {
        Map<String,Object> row=new HashMap<String,Object>();
        row.put("String_Node_Str",column.getLabel());
        row.put("String_Node_Str",TalendQuoteUtils.addQuotes(column.getAdditionalField().get("String_Node_Str")));
        values.add(row);
      }
    }
  }
  return values;
}
Program: 125501
Project: 125501
Buggy source:
public Object getTypedValue(Property property,Object rawValue){
  if (GenericTypeUtils.isSchemaType(property)) {
    return rawValue;
  }
  String stringValue=String.valueOf(rawValue);
  if (GenericTypeUtils.isBooleanType(property)) {
    return new Boolean(stringValue);
  }
  if (GenericTypeUtils.isIntegerType(property) && rawValue != null && !stringValue.isEmpty()) {
    try {
      return Integer.valueOf(stringValue);
    }
 catch (    Exception e) {
      return 0;
    }
  }
  if (GenericTypeUtils.isEnumType(property)) {
    List<?> possibleValues=property.getPossibleValues();
    if (possibleValues != null) {
      Object firstValue=null;
      if (!possibleValues.isEmpty()) {
        firstValue=possibleValues.get(0);
      }
      String stringStoredValue=TalendQuoteUtils.removeQuotes(stringValue);
      for (      Object possibleValue : possibleValues) {
        if (possibleValue.toString().equals(stringStoredValue)) {
          return possibleValue;
        }
      }
      if (firstValue != null) {
        return firstValue;
      }
    }
  }
  if (GenericTypeUtils.isStringType(property)) {
    return TalendQuoteUtils.removeQuotes(StringEscapeUtils.unescapeJava(stringValue));
  }
  return rawValue;
}

Fixed version (ground truth):
public Object getTypedValue(Property property,Object rawValue){
  if (GenericTypeUtils.isSchemaType(property)) {
    return rawValue;
  }
  String stringValue=String.valueOf(rawValue);
  if (GenericTypeUtils.isBooleanType(property)) {
    return new Boolean(stringValue);
  }
  if (GenericTypeUtils.isIntegerType(property) && rawValue != null) {
    if (stringValue.isEmpty()) {
      return null;
    }
    try {
      return Integer.valueOf(stringValue);
    }
 catch (    Exception e) {
      return 0;
    }
  }
  if (GenericTypeUtils.isEnumType(property)) {
    List<?> possibleValues=property.getPossibleValues();
    if (possibleValues != null) {
      Object firstValue=null;
      if (!possibleValues.isEmpty()) {
        firstValue=possibleValues.get(0);
      }
      String stringStoredValue=TalendQuoteUtils.removeQuotes(stringValue);
      for (      Object possibleValue : possibleValues) {
        if (possibleValue.toString().equals(stringStoredValue)) {
          return possibleValue;
        }
      }
      if (firstValue != null) {
        return firstValue;
      }
    }
  }
  if (GenericTypeUtils.isStringType(property)) {
    return TalendQuoteUtils.removeQuotes(StringEscapeUtils.unescapeJava(stringValue));
  }
  return rawValue;
}
Program: 125502
Project: 125502
Buggy source:
@Test public void testGetTypedValue(){
  TestProperties props=(TestProperties)new TestProperties("String_Node_Str").init();
  Object value=evalutor.getTypedValue(props.stringProp,"String_Node_Str");
  assertEquals("String_Node_Str",value);
  value=evalutor.getTypedValue(props.booleanProp,"String_Node_Str");
  assertEquals(true,value);
  value=evalutor.getTypedValue(props.integerProp,"String_Node_Str");
  assertEquals(1,value);
  value=evalutor.getTypedValue(props.integerProp,"String_Node_Str");
  assertEquals(0,value);
  value=evalutor.getTypedValue(props.enumProp,"String_Node_Str");
  assertEquals(EnumType.E1,value);
  value=evalutor.getTypedValue(props.enumProp,"String_Node_Str");
  assertEquals(EnumType.E2,value);
}

Fixed version (ground truth):
@Test public void testGetTypedValue(){
  TestProperties props=(TestProperties)new TestProperties("String_Node_Str").init();
  Object value=evalutor.getTypedValue(props.stringProp,"String_Node_Str");
  assertEquals("String_Node_Str",value);
  value=evalutor.getTypedValue(props.booleanProp,"String_Node_Str");
  assertEquals(true,value);
  value=evalutor.getTypedValue(props.integerProp,"String_Node_Str");
  assertEquals(1,value);
  value=evalutor.getTypedValue(props.integerProp,"String_Node_Str");
  assertEquals(0,value);
  value=evalutor.getTypedValue(props.integerProp,"String_Node_Str");
  assertEquals(null,value);
  value=evalutor.getTypedValue(props.enumProp,"String_Node_Str");
  assertEquals(EnumType.E1,value);
  value=evalutor.getTypedValue(props.enumProp,"String_Node_Str");
  assertEquals(EnumType.E2,value);
}
Program: 125503
Project: 125503
Buggy source:
public synchronized void checkDeletedItems(){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    for (    ImportItem itemRecord : importedItemRecords) {
      if (itemRecord.isValid() && itemRecord.getItemId() != null) {
        IRepositoryViewObject obj=factory.getLastVersion(itemRecord.getItemId());
        Item item=obj.getProperty().getItem();
        ERepositoryStatus status=factory.getStatus(item);
        if (status != null && status == ERepositoryStatus.DELETED) {
          RecycleBinManager.getInstance().addToRecycleBin(ProjectManager.getInstance().getCurrentProject(),item);
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public synchronized void checkDeletedItems(){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    for (    ImportItem itemRecord : importedItemRecords) {
      if (itemRecord.isValid() && itemRecord.getItemId() != null) {
        IRepositoryViewObject obj=factory.getLastVersion(itemRecord.getItemId());
        if (obj != null && obj.getProperty() != null) {
          Item item=obj.getProperty().getItem();
          ERepositoryStatus status=factory.getStatus(item);
          if (status != null && status == ERepositoryStatus.DELETED) {
            RecycleBinManager.getInstance().addToRecycleBin(ProjectManager.getInstance().getCurrentProject(),item);
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
}
Program: 125505
Project: 125505
Buggy source:
private void collectImpalaContextParams(){
  if (isImpalaDBConnSelected()) {
    getConetxtParams().clear();
    addContextParams(EDBParamName.Server,true);
    addContextParams(EDBParamName.Port,true);
    addContextParams(EDBParamName.Database,true);
    addContextParams(EDBParamName.ImpalaPrincipal,useKerberosForImpala.getSelection());
  }
}

Fixed version (ground truth):
private void collectImpalaContextParams(){
  if (isImpalaDBConnSelected()) {
    getConetxtParams().clear();
    addContextParams(EDBParamName.Login,true);
    addContextParams(EDBParamName.Server,true);
    addContextParams(EDBParamName.Port,true);
    addContextParams(EDBParamName.Database,true);
    addContextParams(EDBParamName.ImpalaPrincipal,useKerberosForImpala.getSelection());
  }
}
Program: 125506
Project: 125506
Buggy source:
public void expansionStateChanging(ExpansionEvent e){
}

Fixed version (ground truth):
@Override public void expansionStateChanging(ExpansionEvent e){
}
Program: 125507
Project: 125507
Buggy source:
public void expansionStateChanged(ExpansionEvent e){
  int delta=300;
  if (!e.getState()) {
    delta=-delta;
  }
  Point shellSize=getShell().getSize();
  Point newSize=new Point(shellSize.x,shellSize.y + delta);
  getShell().setSize(newSize);
}

Fixed version (ground truth):
@Override public void expansionStateChanged(ExpansionEvent e){
  int delta=300;
  if (!e.getState()) {
    delta=-delta;
  }
  Point shellSize=getShell().getSize();
  Point newSize=new Point(shellSize.x,shellSize.y + delta);
  getShell().setSize(newSize);
}
Program: 125508
Project: 125508
Buggy source:
@Override protected Control createCustomArea(Composite parent){
  StringWriter stringWriter=new StringWriter();
  ex.printStackTrace(new PrintWriter(stringWriter));
  String exceptionString=stringWriter.toString();
  ExpandableComposite errorComposite=new ExpandableComposite(parent,ExpandableComposite.COMPACT);
  errorComposite.setLayoutData(new GridData(GridData.FILL,GridData.FILL,false,true,1,1));
  errorComposite.setText(Messages.getString("String_Node_Str"));
  errorComposite.addExpansionListener(new IExpansionListener(){
    public void expansionStateChanged(    ExpansionEvent e){
      int delta=300;
      if (!e.getState()) {
        delta=-delta;
      }
      Point shellSize=getShell().getSize();
      Point newSize=new Point(shellSize.x,shellSize.y + delta);
      getShell().setSize(newSize);
    }
    public void expansionStateChanging(    ExpansionEvent e){
    }
  }
);
  Text text=new Text(errorComposite,SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
  text.setText(exceptionString);
  text.setEditable(false);
  errorComposite.setClient(text);
  return errorComposite;
}

Fixed version (ground truth):
@Override protected Control createCustomArea(Composite parent){
  if (exceptionString == null || exceptionString.isEmpty()) {
    StringWriter stringWriter=new StringWriter();
    ex.printStackTrace(new PrintWriter(stringWriter));
    exceptionString=stringWriter.toString();
  }
  ExpandableComposite errorComposite=new ExpandableComposite(parent,ExpandableComposite.COMPACT);
  errorComposite.setLayoutData(new GridData(GridData.FILL,GridData.FILL,true,true,1,1));
  errorComposite.setText(Messages.getString("String_Node_Str"));
  errorComposite.addExpansionListener(new IExpansionListener(){
    @Override public void expansionStateChanged(    ExpansionEvent e){
      int delta=300;
      if (!e.getState()) {
        delta=-delta;
      }
      Point shellSize=getShell().getSize();
      Point newSize=new Point(shellSize.x,shellSize.y + delta);
      getShell().setSize(newSize);
    }
    @Override public void expansionStateChanging(    ExpansionEvent e){
    }
  }
);
  Text text=new Text(errorComposite,SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
  text.setText(exceptionString);
  text.setEditable(false);
  errorComposite.setClient(text);
  return errorComposite;
}
Program: 125509
Project: 125509
Buggy source:
@Test public void testInitializeAllColumns() throws Exception {
  File file=new File("String_Node_Str");
  assertTrue(file.exists());
  MetadataSchema ms=new MetadataSchema();
  List<IMetadataColumn> list=ms.initializeAllColumns(file);
  assertTrue(list.size() == 3);
  IMetadataColumn column1=list.get(0);
  assertEquals("String_Node_Str",column1.getLabel());
  assertEquals("String_Node_Str",column1.getTalendType());
  IMetadataColumn column2=list.get(1);
  assertEquals("String_Node_Str",column2.getLabel());
  assertEquals("String_Node_Str",column2.getTalendType());
  IMetadataColumn column3=list.get(2);
  assertEquals("String_Node_Str",column3.getLabel());
  assertEquals("String_Node_Str",column3.getTalendType());
}

Fixed version (ground truth):
@Test public void testInitializeAllColumns() throws Exception {
  URL xmlURL=FileLocator.find(Platform.getBundle("String_Node_Str"),new Path("String_Node_Str"),null);
  if (xmlURL != null) {
    xmlURL=FileLocator.toFileURL(xmlURL);
  }
  File file=new File(xmlURL.getFile());
  assertTrue(file.exists());
  MetadataSchema ms=new MetadataSchema();
  List<IMetadataColumn> list=ms.initializeAllColumns(file);
  assertTrue(list.size() == 3);
  IMetadataColumn column1=list.get(0);
  assertEquals("String_Node_Str",column1.getLabel());
  assertEquals("String_Node_Str",column1.getTalendType());
  IMetadataColumn column2=list.get(1);
  assertEquals("String_Node_Str",column2.getLabel());
  assertEquals("String_Node_Str",column2.getTalendType());
  IMetadataColumn column3=list.get(2);
  assertEquals("String_Node_Str",column3.getLabel());
  assertEquals("String_Node_Str",column3.getTalendType());
}
Program: 125510
Project: 125510
Buggy source:
protected void verifyConnection4ReturnColumns4DontCreateConnection(Connection conn) throws SQLException {
  verify(conn,times(4)).isClosed();
}

Fixed version (ground truth):
protected void verifyConnection4ReturnColumns4DontCreateConnection(Connection conn) throws SQLException {
  verify(conn,times(2)).isClosed();
}
Program: 125511
Project: 125511
Buggy source:
protected void verifyConnection4ReturnColumns4DontCreateConnection(Connection conn) throws SQLException {
  verify(conn,times(4)).isClosed();
}

Fixed version (ground truth):
protected void verifyConnection4ReturnColumns4DontCreateConnection(Connection conn) throws SQLException {
  verify(conn,times(2)).isClosed();
}
Program: 125512
Project: 125512
Buggy source:
public void buildDeletedItemsTree(RepositoryNode rootNode){
  List<String> folders=RecycleBinManager.getInstance().getDeletedFolders(ProjectManager.getInstance().getCurrentProject());
  Collections.sort(folders);
  for (  String fullPath : folders) {
    String path=null;
    ERepositoryObjectType currentType=null;
    for (    DynaEnum<? extends DynaEnum<?>> type : ERepositoryObjectType.values()) {
      ERepositoryObjectType objectType=(ERepositoryObjectType)type;
      if (objectType.isResouce() && fullPath.startsWith(objectType.getFolder())) {
        path=fullPath.substring(objectType.getFolder().length() + 1);
        currentType=objectType;
        break;
      }
    }
    if (currentType != null) {
      buildFolders(rootNode,currentType,path,rootNode);
    }
  }
  addDeletedElements(rootNode,rootNode.getChildren());
}

Fixed version (ground truth):
public void buildDeletedItemsTree(RepositoryNode rootNode){
  List<String> folders=RecycleBinManager.getInstance().getDeletedFolders(ProjectManager.getInstance().getCurrentProject());
  Collections.sort(folders);
  for (  String fullPath : folders) {
    String path=null;
    String comparePath=fullPath;
    if (fullPath != null) {
      String[] paths=fullPath.split("String_Node_Str");
      if (paths.length > 0) {
        comparePath=paths[0];
      }
    }
    ERepositoryObjectType currentType=null;
    for (    DynaEnum<? extends DynaEnum<?>> type : ERepositoryObjectType.values()) {
      ERepositoryObjectType objectType=(ERepositoryObjectType)type;
      if (objectType.isResouce() && comparePath.equals(objectType.getFolder())) {
        path=fullPath.substring(objectType.getFolder().length() + 1);
        currentType=objectType;
        break;
      }
    }
    if (currentType != null) {
      buildFolders(rootNode,currentType,path,rootNode);
    }
  }
  addDeletedElements(rootNode,rootNode.getChildren());
}
Program: 125513
Project: 125513
Buggy source:
@Override protected void createButtonsForButtonBar(Composite parent){
  super.createButtonsForButtonBar(parent);
  this.getOKButton().setEnabled(false);
}

Fixed version (ground truth):
@Override protected void createButtonsForButtonBar(Composite parent){
  super.createButtonsForButtonBar(parent);
  checkSelectedItems();
}
Program: 125514
Project: 125514
Buggy source:
/** 
 * DOC talend PastSelectorDialog constructor comment.
 * @param parentShell
 */
public PastSelectorDialog(Shell parentShell,List<IRepositoryViewObject> versions,RepositoryNode sourceNode){
  super(parentShell);
  setShellStyle(getShellStyle() | SWT.RESIZE);
  this.versions=versions;
  this.sourceNode=sourceNode;
}

Fixed version (ground truth):
/** 
 * DOC talend PastSelectorDialog constructor comment.
 * @param parentShell
 */
public PastSelectorDialog(Shell parentShell,List<IRepositoryViewObject> versions,RepositoryNode sourceNode){
  super(parentShell);
  setShellStyle(getShellStyle() | SWT.RESIZE);
  this.versions=versions;
  this.sourceNode=sourceNode;
  init();
}
Program: 125518
Project: 125518
Buggy source:
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String newStr,String replacement){
  return CHANGE(oldStr,newStr,replacement);
}

Fixed version (ground truth):
/** 
 * Substitutes all substrings that match the given regular expression in the given old string with the given replacement and returns a new string.
 * @param oldStr: the old string.
 * @param regex: the regular expression to match.
 * @param replacement: the string to be substituted for every match.{talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") regex: Regx. {param} string("guy") replacement: Replacement. {example} EREPLACE("hello world!","world","guy") # hello world
 */
public static String EREPLACE(String oldStr,String regex,String replacement){
  return CHANGE(oldStr,regex,replacement);
}
Program: 125519
Project: 125519
Buggy source:
/** 
 * Substitutes an element of a string with a replacement element. {talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") newStr: Regx. {param} string("guy") replacement: Replacement. {example} CHANGE("hello world!","world","guy") # hello world
 */
public static String CHANGE(String oldStr,String newStr,String replacement){
  if (oldStr == null || newStr == null || replacement == null)   return oldStr;
 else   return oldStr.replaceAll(newStr,replacement);
}

Fixed version (ground truth):
/** 
 * Substitutes all substrings that match the given regular expression in the given old string with the given replacement and returns a new string.
 * @param oldStr: the old string.
 * @param regex: the regular expression to match.
 * @param replacement: the string to be substituted for every match.{talendTypes} String {Category} StringHandling {param} string("hello world!") oldStr: The whole string. {param} string("world") regex: Regx. {param} string("guy") replacement: Replacement. {example} CHANGE("hello world!","world","guy") # hello world
 */
public static String CHANGE(String oldStr,String regex,String replacement){
  if (oldStr == null || regex == null || replacement == null)   return oldStr;
 else   return oldStr.replaceAll(regex,replacement);
}
Program: 125523
Project: 125523
Buggy source:
/** 
 * DOC ycbai Comment method "isInContextMode". <p> Estimate whether or not the item is in context mode. <br> Hadoop subconnections are in context mode even though it is not context mode itself if the hadoop cluster is in context mode.
 * @param connItem
 * @return
 */
public boolean isInContextMode(ConnectionItem connItem);

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "isInContextMode". <p> Estimate whether or not the connection is in context mode. <br> Hadoop subconnections are in context mode even though it is not context mode itself if the hadoop cluster is in context mode.
 * @param connection
 * @return
 */
public boolean isInContextMode(Connection connection);
Program: 125524
Project: 125524
Buggy source:
private static boolean isContextMode(Connection connection,String value){
  if (connection == null || value == null) {
    return false;
  }
  if (connection.isContextMode() && ContextParameterUtils.isContainContextParam(value)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean isContextMode(Connection connection,String value){
  IMetadataManagmentUiService mmService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IMetadataManagmentUiService.class)) {
    mmService=(IMetadataManagmentUiService)GlobalServiceRegister.getDefault().getService(IMetadataManagmentUiService.class);
  }
  if (mmService != null) {
    return mmService.isContextMode(connection,value);
  }
  return false;
}
Program: 125532
Project: 125532
Buggy source:
@Override public void expandNode(TreeViewer viewer,IRepositoryNode repoNode,int expandLevel){
  if (repoNode != null && validType(repoNode.getObjectType())) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      List<ERepositoryObjectType> preExpandTypes=getPreExpandTypes();
      if (preExpandTypes != null) {
        for (        ERepositoryObjectType preExpandType : preExpandTypes) {
          IRepositoryNode preExpandNode=root.getRootRepositoryNode(preExpandType);
          if (preExpandNode != null) {
            viewer.expandToLevel(preExpandNode,expandLevel);
          }
        }
      }
    }
  }
  RepositorySeekerManager seekerManager=RepositorySeekerManager.getInstance();
  seekerManager.expandNode(seekerManager.getRepoTreeViewer(),repoNode,1);
}

Fixed version (ground truth):
@Override public void expandNode(TreeViewer viewer,IRepositoryNode repoNode,int expandLevel){
  if (repoNode != null && validType(repoNode.getObjectType())) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      List<ERepositoryObjectType> preExpandTypes=getPreExpandTypes();
      if (preExpandTypes != null) {
        for (        ERepositoryObjectType preExpandType : preExpandTypes) {
          IRepositoryNode preExpandNode=root.getRootRepositoryNode(preExpandType);
          if (preExpandNode != null && viewer != null) {
            viewer.expandToLevel(preExpandNode,expandLevel);
          }
        }
      }
    }
  }
  RepositorySeekerManager seekerManager=RepositorySeekerManager.getInstance();
  seekerManager.expandNode(seekerManager.getRepoTreeViewer(),repoNode,1);
}
Program: 125533
Project: 125533
Buggy source:
@Override public void run(IProgressMonitor monitor) throws CoreException {
  DatabaseConnection connection=(DatabaseConnection)connectionItem.getConnection();
  saveMetaData();
  tableHelper.resetUUID(connection);
  ITDQRepositoryService tdqRepositoryService=null;
  boolean needUpdateAnalysis=false;
  if (PluginChecker.isTDQLoaded()) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      tdqRepositoryService=(ITDQRepositoryService)org.talend.core.GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
      needUpdateAnalysis=isNeedUpdateDQ(connection,oldCopiedConnection,tdqRepositoryService);
    }
    if (tdqRepositoryService != null && needUpdateAnalysis) {
      if (!tdqRepositoryService.confirmUpdateAnalysis(connectionItem)) {
        return;
      }
    }
  }
  saveMetaData();
  if (tdqRepositoryService != null && needUpdateAnalysis) {
    tdqRepositoryService.updateImpactOnAnalysis(connectionItem);
  }
  RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
  closeLockStrategy();
  List<IRepositoryViewObject> list=new ArrayList<IRepositoryViewObject>();
  list.add(repositoryObject);
  CoreRuntimePlugin.getInstance().getRepositoryService().notifySQLBuilder(list);
  oldCopiedConnection=null;
  tableHelper.clean();
}

Fixed version (ground truth):
@Override public void run(){
  RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
  closeLockStrategy();
}
Program: 125539
Project: 125539
Buggy source:
private void checkMDMConnection(){
  String username=mdmUsernameText.getText();
  String pass=mdmPasswordText.getText();
  String server=serverURLText.getText();
  if (username == null || pass == null || server == null) {
    page.setPageComplete(false);
    return;
  }
  AbsMdmConnectionHelper helper=null;
  helper=new S60MdmConnectionHelper();
  try {
    stub=helper.checkConnection(server,null,username,pass);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    stub=null;
  }
  if (stub != null) {
    page.setPageComplete(true);
    MessageBox box=new MessageBox(Display.getCurrent().getActiveShell(),SWT.ICON_WORKING | SWT.OK | SWT.CANCEL);
    box.setText(Messages.getString("String_Node_Str"));
    box.setMessage(Messages.getString("String_Node_Str"));
    box.open();
  }
 else {
    String titleMsg=Messages.getString("String_Node_Str");
    String mainMsg=Messages.getString("String_Node_Str");
    MessageDialog.openError(getShell(),titleMsg,mainMsg);
  }
}

Fixed version (ground truth):
private void checkMDMConnection(){
  String username=mdmUsernameText.getText();
  String pass=mdmPasswordText.getText();
  String server=serverURLText.getText();
  if (username == null || pass == null || server == null) {
    page.setPageComplete(false);
    return;
  }
  AbsMdmConnectionHelper helper=null;
  helper=new S60MdmConnectionHelper();
  try {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IMDMService.class)) {
      IMDMService mdmService=(IMDMService)GlobalServiceRegister.getDefault().getService(IMDMService.class);
      if (mdmService != null) {
        SSLContext sslContext=mdmService.getSSLContext();
        HttpsURLConnection.setDefaultHostnameVerifier(mdmService.getDefaultHostnameVerifier());
        HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
      }
    }
    stub=helper.checkConnection(server,null,username,pass);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
    stub=null;
  }
  if (stub != null) {
    page.setPageComplete(true);
    MessageBox box=new MessageBox(Display.getCurrent().getActiveShell(),SWT.ICON_WORKING | SWT.OK | SWT.CANCEL);
    box.setText(Messages.getString("String_Node_Str"));
    box.setMessage(Messages.getString("String_Node_Str"));
    box.open();
  }
 else {
    String titleMsg=Messages.getString("String_Node_Str");
    String mainMsg=Messages.getString("String_Node_Str");
    MessageDialog.openError(getShell(),titleMsg,mainMsg);
  }
}
Program: 125541
Project: 125541
Buggy source:
protected void doLoadDefault(){
  MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  ICoreService coreService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
    coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
    coreService.syncMappingsFileFromSystemToProject();
    tmpFileManager.reload();
    coreService.synchronizeMapptingXML();
  }
  super.load();
}

Fixed version (ground truth):
protected void doLoadDefault(){
  boolean confirm=MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  if (confirm) {
    ICoreService coreService=null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
      coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
      coreService.syncMappingsFileFromSystemToProject();
      tmpFileManager.reload();
      coreService.synchronizeMapptingXML();
    }
    super.load();
  }
}
Program: 125545
Project: 125545
Buggy source:
@Override public synchronized List<IMetadataColumn> getListColumns(boolean withUnselected){
  Iterator<IMetadataColumn> it=this.listColumns.iterator();
  while (it.hasNext()) {
    IMetadataColumn column=it.next();
    if (!column.isUsefulColumn()) {
      this.unusedColumns.add(column);
      it.remove();
    }
  }
  Iterator<IMetadataColumn> it2=this.unusedColumns.iterator();
  while (it2.hasNext()) {
    IMetadataColumn column=it2.next();
    if (column.isUsefulColumn()) {
      this.listColumns.add(column);
      it2.remove();
    }
  }
  if (withUnselected) {
    List<IMetadataColumn> temp=new ArrayList<IMetadataColumn>();
    temp.addAll(this.listColumns);
    temp.addAll(this.unusedColumns);
    if (originalColumns != null) {
      Collections.sort(temp,new Comparator<IMetadataColumn>(){
        @Override public int compare(        IMetadataColumn o1,        IMetadataColumn o2){
          int index1=originalColumns.indexOf(o1.getLabel());
          int index2=originalColumns.indexOf(o2.getLabel());
          return index1 - index2;
        }
      }
);
    }
    return temp;
  }
  return this.listColumns;
}

Fixed version (ground truth):
@Override public synchronized List<IMetadataColumn> getListColumns(boolean withUnselected){
  Iterator<IMetadataColumn> it=this.listColumns.iterator();
  while (it.hasNext()) {
    IMetadataColumn column=it.next();
    if (!column.isUsefulColumn()) {
      this.unusedColumns.add(column);
      it.remove();
    }
  }
  Iterator<IMetadataColumn> it2=this.unusedColumns.iterator();
  while (it2.hasNext()) {
    IMetadataColumn column=it2.next();
    if (column.isUsefulColumn()) {
      this.listColumns.add(column);
      it2.remove();
    }
  }
  if (withUnselected) {
    List<IMetadataColumn> temp=new ArrayList<IMetadataColumn>();
    temp.addAll(this.listColumns);
    temp.addAll(this.unusedColumns);
    if (isRepository && originalColumns != null) {
      Collections.sort(temp,new Comparator<IMetadataColumn>(){
        @Override public int compare(        IMetadataColumn o1,        IMetadataColumn o2){
          int index1=originalColumns.indexOf(o1.getLabel());
          int index2=originalColumns.indexOf(o2.getLabel());
          return index1 - index2;
        }
      }
);
    }
    return temp;
  }
  return this.listColumns;
}
Program: 125546
Project: 125546
Buggy source:
public IODataComponent getDataComponent(IConnection connection){
  for (  IODataComponent current : inputs) {
    if (current.getUniqueName().equals(connection.getUniqueName())) {
      return current;
    }
  }
  for (  IODataComponent current : ouputs) {
    if (current.getUniqueName().equals(connection.getUniqueName())) {
      return current;
    }
  }
  return null;
}

Fixed version (ground truth):
public IODataComponent getDataComponent(IConnection connection){
  for (  IODataComponent current : inputs) {
    if (current.getUniqueName().equals(connection.getUniqueName()) && current.getConnection().getSource().getUniqueName().equals(connection.getSource().getUniqueName()) && current.getConnection().getTarget().getUniqueName().equals(connection.getTarget().getUniqueName())) {
      return current;
    }
  }
  for (  IODataComponent current : ouputs) {
    if (current.getUniqueName().equals(connection.getUniqueName()) && current.getConnection().getSource().getUniqueName().equals(connection.getSource().getUniqueName()) && current.getConnection().getTarget().getUniqueName().equals(connection.getTarget().getUniqueName())) {
      return current;
    }
  }
  return null;
}
Program: 125547
Project: 125547
Buggy source:
public ELibraryInstallStatus getStatus(){
  String mvnUriStatusKey=getMavenUri(true);
  final ELibraryInstallStatus eLibraryInstallStatus=ModuleStatusProvider.getStatusMap().get(mvnUriStatusKey);
  if (eLibraryInstallStatus != null) {
    return eLibraryInstallStatus;
  }
 else {
    ILibraryManagerService libManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    Set<String> existLibraries=libManagerService.list();
    if (existLibraries.contains(getModuleName())) {
      status=ELibraryInstallStatus.INSTALLED;
    }
 else {
      String localMavenUri=mvnUriStatusKey.replace("String_Node_Str","String_Node_Str" + MavenConstants.LOCAL_RESOLUTION_URL + "String_Node_Str");
      try {
        getMavenResolver().resolve(localMavenUri);
        status=ELibraryInstallStatus.INSTALLED;
      }
 catch (      Exception e) {
        status=ELibraryInstallStatus.NOT_INSTALLED;
      }
    }
    ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey,status);
  }
  return this.status;
}

Fixed version (ground truth):
public ELibraryInstallStatus getStatus(){
  String mvnUriStatusKey=getMavenUri(true);
  final ELibraryInstallStatus eLibraryInstallStatus=ModuleStatusProvider.getStatusMap().get(mvnUriStatusKey);
  if (eLibraryInstallStatus != null) {
    return eLibraryInstallStatus;
  }
 else {
    ILibraryManagerService libManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    Set<String> existLibraries=libManagerService.list();
    if (existLibraries.contains(getModuleName())) {
      status=ELibraryInstallStatus.INSTALLED;
      ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey,status);
    }
 else {
      resolveStatusLocally(mvnUriStatusKey);
    }
  }
  return this.status;
}
Program: 125548
Project: 125548
Buggy source:
public static void reset(){
  statusMap.clear();
}

Fixed version (ground truth):
public static void reset(){
  statusMap.clear();
  deployStatusMap.clear();
}
Program: 125549
Project: 125549
Buggy source:
protected void addDependencies(Model model){
  Set<ModuleNeeded> runningModules=getDependenciesModules();
  if (runningModules != null) {
    List<Dependency> existedDependencies=model.getDependencies();
    if (existedDependencies == null) {
      existedDependencies=new ArrayList<Dependency>();
      model.setDependencies(existedDependencies);
    }
    for (    ModuleNeeded module : runningModules) {
      Dependency dependency=null;
      if (module.getStatus() != ELibraryInstallStatus.NOT_INSTALLED) {
        dependency=PomUtil.createModuleDependency(module.getMavenUri(true));
      }
      if (dependency != null) {
        existedDependencies.add(dependency);
      }
    }
  }
}

Fixed version (ground truth):
protected void addDependencies(Model model){
  Set<ModuleNeeded> runningModules=getDependenciesModules();
  if (runningModules != null) {
    List<Dependency> existedDependencies=model.getDependencies();
    if (existedDependencies == null) {
      existedDependencies=new ArrayList<Dependency>();
      model.setDependencies(existedDependencies);
    }
    for (    ModuleNeeded module : runningModules) {
      Dependency dependency=null;
      if (module.getDeployStatus() == ELibraryInstallStatus.DEPLOYED) {
        dependency=PomUtil.createModuleDependency(module.getMavenUri(true));
      }
      if (dependency != null) {
        existedDependencies.add(dependency);
      }
    }
  }
}
Program: 125550
Project: 125550
Buggy source:
public static boolean isAvailable(MavenArtifact artifact){
  String absArtifactPath=getAbsArtifactPath(artifact);
  if (absArtifactPath != null) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isAvailable(String mvnUri){
  MavenArtifact artifact=MavenUrlHelper.parseMvnUrl(mvnUri);
  if (artifact != null) {
    return isAvailable(artifact);
  }
  return false;
}
Program: 125553
Project: 125553
Buggy source:
public ELibraryInstallStatus getStatus(){
  String mvnUriStatusKey=getMavenUri(true);
  final ELibraryInstallStatus eLibraryInstallStatus=ModuleStatusProvider.getStatusMap().get(mvnUriStatusKey);
  if (eLibraryInstallStatus != null) {
    return eLibraryInstallStatus;
  }
 else {
    ILibraryManagerService libManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    Set<String> existLibraries=libManagerService.list();
    if (existLibraries.contains(getModuleName())) {
      status=ELibraryInstallStatus.INSTALLED;
      ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey,status);
    }
 else {
      resolveStatusLocally(mvnUriStatusKey);
    }
  }
  return this.status;
}

Fixed version (ground truth):
public ELibraryInstallStatus getStatus(){
  String mvnUriStatusKey=getMavenUri(true);
  final ELibraryInstallStatus eLibraryInstallStatus=ModuleStatusProvider.getStatusMap().get(mvnUriStatusKey);
  if (eLibraryInstallStatus != null) {
    return eLibraryInstallStatus;
  }
 else   if (mvnUriStatusKey != null) {
    ILibraryManagerService libManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
    Set<String> existLibraries=libManagerService.list();
    if (existLibraries.contains(getModuleName())) {
      status=ELibraryInstallStatus.INSTALLED;
      ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey,status);
    }
 else {
      resolveStatusLocally(mvnUriStatusKey);
    }
  }
  return this.status;
}
Program: 125554
Project: 125554
Buggy source:
public ELibraryInstallStatus getDeployStatus(){
  String mvnUriStatusKey=getMavenUri(true);
  final ELibraryInstallStatus eLibraryDeployStatus=ModuleStatusProvider.getDeployStatusMap().get(mvnUriStatusKey);
  if (eLibraryDeployStatus != null) {
    return eLibraryDeployStatus;
  }
 else {
    resolveStatusLocally(mvnUriStatusKey);
  }
  return this.installStatus;
}

Fixed version (ground truth):
public ELibraryInstallStatus getDeployStatus(){
  String mvnUriStatusKey=getMavenUri(true);
  final ELibraryInstallStatus eLibraryDeployStatus=ModuleStatusProvider.getDeployStatusMap().get(mvnUriStatusKey);
  if (eLibraryDeployStatus != null) {
    return eLibraryDeployStatus;
  }
 else   if (mvnUriStatusKey != null) {
    resolveStatusLocally(mvnUriStatusKey);
  }
  return this.installStatus;
}
Program: 125556
Project: 125556
Buggy source:
@Override public String getJarPathFromMaven(String jarNameOrMavenUri){
  String libPath=null;
  Set<String> mvnUris=new HashSet<String>();
  if (MavenUrlHelper.isMvnUrl(jarNameOrMavenUri)) {
    mvnUris.add(jarNameOrMavenUri);
  }
 else {
    EMap<String,String> jarsToMavenUri=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath();
    String mavenUri=jarsToMavenUri.get(jarNameOrMavenUri);
    if (mavenUri == null) {
      mvnUris.add(MavenUrlHelper.generateMvnUrlForJarName(jarNameOrMavenUri));
    }
 else {
      for (      String uri : mavenUri.split(MavenUrlHelper.MVN_INDEX_SPLITER)) {
        mvnUris.add(uri);
      }
    }
  }
  for (  String uriToCheck : mvnUris) {
    if (checkJarInstalledInMaven(uriToCheck)) {
      libPath=mavenJarInstalled.get(uriToCheck);
      if (libPath != null) {
        return libPath;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String getJarPathFromMaven(String jarNameOrMavenUri){
  if (jarNameOrMavenUri == null) {
    return null;
  }
  String libPath=null;
  Set<String> mvnUris=new HashSet<String>();
  if (MavenUrlHelper.isMvnUrl(jarNameOrMavenUri)) {
    mvnUris.add(jarNameOrMavenUri);
  }
 else {
    EMap<String,String> jarsToMavenUri=LibrariesIndexManager.getInstance().getMavenLibIndex().getJarsToRelativePath();
    String mavenUri=jarsToMavenUri.get(jarNameOrMavenUri);
    if (mavenUri == null) {
      mvnUris.add(MavenUrlHelper.generateMvnUrlForJarName(jarNameOrMavenUri));
    }
 else {
      for (      String uri : mavenUri.split(MavenUrlHelper.MVN_INDEX_SPLITER)) {
        mvnUris.add(uri);
      }
    }
  }
  for (  String uriToCheck : mvnUris) {
    if (checkJarInstalledInMaven(uriToCheck)) {
      libPath=mavenJarInstalled.get(uriToCheck);
      if (libPath != null) {
        return libPath;
      }
    }
  }
  return null;
}
Program: 125557
Project: 125557
Buggy source:
private void showIfAuthentication(){
  if (isHiveDBConnSelected()) {
    if (doSupportSecurity()) {
      updateAuthenticationForHive(isHiveEmbeddedMode());
      setHidAuthenticationForHive(false);
    }
 else {
      setHidAuthenticationForHive(true);
    }
  }
 else {
    setHidAuthenticationForHive(true);
  }
}

Fixed version (ground truth):
private void showIfAuthentication(){
  if (isHiveDBConnSelected()) {
    if (doSupportSecurity()) {
      updateAuthenticationForHive(isHiveEmbeddedMode());
      hideControlForKerbTickt();
      setHidAuthenticationForHive(false);
    }
 else {
      setHidAuthenticationForHive(true);
    }
  }
 else {
    setHidAuthenticationForHive(true);
  }
}
Program: 125558
Project: 125558
Buggy source:
private boolean doSupportSecurity(){
  return HiveMetadataHelper.doSupportSecurity(hiveDistributionCombo.getText(),hiveVersionCombo.getText(),hiveModeCombo.getText(),hiveServerVersionCombo.getText(),true);
}

Fixed version (ground truth):
private boolean doSupportSecurity(){
  return doSupportKerb() || doSupportTicket();
}
Program: 125559
Project: 125559
Buggy source:
private void initProperty(){
  JobInfo jobInfo=new JobInfo(processItem,processItem.getProcess().getDefaultContext(),processItem.getProperty().getVersion());
  Project currentProject=ProjectManager.getInstance().getCurrentProject();
  setProperty(PROJECT_ID,String.valueOf(currentProject.getEmfProject().getId()));
  setProperty(PROJECT_NAME,currentProject.getTechnicalLabel());
  String branchKey=IProxyRepositoryFactory.BRANCH_SELECTION + UNDER_LINE_CHAR + currentProject.getTechnicalLabel();
  Context ctx=CoreRuntimePlugin.getInstance().getContext();
  RepositoryContext rc=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  if (rc.getFields().containsKey(branchKey) && rc.getFields().get(branchKey) != null) {
    String branchSelection=rc.getFields().get(branchKey);
    setProperty(BRANCH,branchSelection);
  }
  setProperty(JOB_ID,jobInfo.getJobId());
  setProperty(JOB_NAME,jobInfo.getJobName());
  String jobType=processItem.getProcess().getJobType();
  if (jobType == null) {
    jobType="String_Node_Str";
  }
  setProperty(JOB_TYPE,jobType);
  setProperty(JOB_VERSION,jobInfo.getJobVersion());
  setProperty(CONTEXT_NAME,this.contextName);
  setProperty(DATE,DATAFORMAT.format(new Date()));
  setProperty(APPLY_CONTEXY_CHILDREN,String.valueOf(applyContextToChild));
  if (CommonsPlugin.isHeadless()) {
    setProperty(ADD_STATIC_CODE,String.valueOf(addStat));
  }
 else {
    setProperty(ADD_STATIC_CODE,Boolean.FALSE.toString());
  }
  setProperty(COMMANDLINE_VERSION,VersionUtils.getVersion());
}

Fixed version (ground truth):
private void initProperty(){
  JobInfo jobInfo=new JobInfo(processItem,processItem.getProcess().getDefaultContext(),processItem.getProperty().getVersion());
  Project currentProject=ProjectManager.getInstance().getCurrentProject();
  setProperty(PROJECT_ID,String.valueOf(currentProject.getEmfProject().getId()));
  setProperty(PROJECT_NAME,currentProject.getTechnicalLabel());
  String branchKey=IProxyRepositoryFactory.BRANCH_SELECTION + UNDER_LINE_CHAR + currentProject.getTechnicalLabel();
  Context ctx=CoreRuntimePlugin.getInstance().getContext();
  RepositoryContext rc=(RepositoryContext)ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
  if (rc.getFields().containsKey(branchKey) && rc.getFields().get(branchKey) != null) {
    String branchSelection=rc.getFields().get(branchKey);
    setProperty(BRANCH,branchSelection);
  }
  setProperty(JOB_ID,jobInfo.getJobId());
  setProperty(JOB_NAME,jobInfo.getJobName());
  String jobType=processItem.getProcess().getJobType();
  if (jobType == null) {
    jobType="String_Node_Str";
  }
  setProperty(JOB_TYPE,jobType);
  setProperty(JOB_VERSION,jobInfo.getJobVersion());
  setProperty(CONTEXT_NAME,this.contextName);
  setProperty(DATE,DATAFORMAT.format(new Date()));
  setProperty(APPLY_CONTEXY_CHILDREN,String.valueOf(applyContextToChild));
  if (CommonsPlugin.isHeadless()) {
    setProperty(ADD_STATIC_CODE,String.valueOf(addStat));
  }
 else {
    setProperty(ADD_STATIC_CODE,Boolean.TRUE.toString());
  }
  setProperty(COMMANDLINE_VERSION,VersionUtils.getVersion());
}