Program: 127561
Project: 127561
Buggy source:
/** 
 * Test method for  {@link org.talend.core.model.metadata.MetadataToolHelper#validateColumnName(java.lang.String,int)}.
 */
@Test public void testValidateColumnName(){
  CoreRuntimePlugin.getInstance().getDesignerCoreService().getDesignerCorePreferenceStore().setValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,false);
  String columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  CoreRuntimePlugin.getInstance().getDesignerCoreService().getDesignerCorePreferenceStore().setValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,true);
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  CoreRuntimePlugin.getInstance().getDesignerCoreService().getDesignerCorePreferenceStore().setToDefault(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.core.model.metadata.MetadataToolHelper#validateColumnName(java.lang.String,int)}.
 */
@Test public void testValidateColumnName(){
  CoreRuntimePlugin.getInstance().getDesignerCoreService().setPreferenceStoreValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,false);
  String columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals(columnName,"String_Node_Str");
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  CoreRuntimePlugin.getInstance().getDesignerCoreService().setPreferenceStoreValue(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS,true);
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  columnName=MetadataToolHelper.validateColumnName("String_Node_Str",0);
  assertEquals("String_Node_Str",columnName);
  CoreRuntimePlugin.getInstance().getDesignerCoreService().setPreferenceStoreToDefault(IRepositoryPrefConstants.ALLOW_SPECIFIC_CHARACTERS_FOR_SCHEMA_COLUMNS);
}