Program: 127393
Project: 127393
Buggy source:
/** 
 * Test method for  {@link org.talend.core.model.metadata.MetadataToolHelper#validateColumnName(java.lang.String,int)}.
 */
@Test public void testValidateColumnName(){
  CoreRuntimePlugin.getInstance().getPreferenceStore().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().getPreferenceStore().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().getPreferenceStore().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(){
  IEclipsePreferences preferences=new InstanceScope().getNode(ITalendCorePrefConstants.CoreUIPlugin_ID);
  preferences.putBoolean(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);
  preferences.putBoolean(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);
}