nus-yam/ex-repair huggingface dataset:
Buggy code:
public class HostUpdateResult < R > implements Serializable { private static final long serialVersionUID = 4320577243229764829L ; private final boolean cancelled ; private final boolean rolledBack ; private final UpdateFailedException hostFailure ; private final Map < ServerIdentity , R > serverResults ; private final Map < ServerIdentity , Throwable > serverFailures ; private final Set < ServerIdentity > serverCancellations ; private final Set < ServerIdentity > serverTimeouts ; private final Set < ServerIdentity > serverRollbacks ; public HostUpdateResult ( ) { } public HostUpdateResult ( boolean cancelled ) { } public HostUpdateResult ( final UpdateFailedException hostFailure ) { } public HostUpdateResult ( final Map < ServerIdentity , R > serverResults , final Map < ServerIdentity , Throwable > serverFailures , final Set < ServerIdentity > serverCancellations , final Set < ServerIdentity > serverTimeouts , final Set < ServerIdentity > serverRollbacks ) { } public boolean isCancelled ( ) { } public boolean isRolledBack ( ) { } public UpdateFailedException getHostFailure ( ) { } public Map < ServerIdentity , R > getServerResults ( ) { } public Map < ServerIdentity , Throwable > getServerFailures ( ) { } public Set < ServerIdentity > getServerCancellations ( ) { } public Set < ServerIdentity > getServerTimeouts ( ) { } public Set < ServerIdentity > getServerRollbacks ( ) { } public boolean isSuccess ( ) { } public HostUpdateResult < R > newWithAddedResult ( ServerIdentity server , R result ) { } public HostUpdateResult < R > newWithAddedFailure ( ServerIdentity server , Throwable failure ) { } public HostUpdateResult < R > newWithAddedCancellation ( ServerIdentity server ) { } public HostUpdateResult < R > newWithAddedTimeout ( ServerIdentity server ) { } public HostUpdateResult < R > newWithAddedRollback ( ServerIdentity server ) { } private void checkAllowServer ( ) { if ( ( ( cancelled ) || ( rolledBack ) ) || ( ( hostFailure ) != null ) ) <START_BUG> throw new IllegalStateException ( "Cannot<seq2seq4repair_space>add<seq2seq4repair_space>server<seq2seq4repair_space>results<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>update<seq2seq4repair_space>that<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>successfully<seq2seq4repair_space>applied<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>server<seq2seq4repair_space>manager" ) ; <END_BUG> } }

Fix:
throw new IllegalStateException ( "Cannot<seq2seq4repair_space>add<seq2seq4repair_space>server<seq2seq4repair_space>results<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>update<seq2seq4repair_space>that<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>successfully<seq2seq4repair_space>applied<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>host<seq2seq4repair_space>controller" ) ;
Buggy code:
public class Project { private Long id ; private Boolean active ; private String code ; private Client client ; private Phases phases ; private Leader leader ; private String title ; private Customer customer ; private Type type ; private Currency currency ; private String modifiedDate ; private String creationDate ; public Project ( ) { } @ XmlElement ( name = "objid" ) public Long getId ( ) { } public void setId ( Long id ) { } @ XmlElement ( name = "aktiv" ) public Boolean getActive ( ) { } public void setActive ( Boolean active ) { } @ XmlElement ( name = "code" ) public String getCode ( ) { } public void setCode ( String code ) { } @ XmlElement ( name = "kunde" ) public Client getClient ( ) { } public void setClient ( Client client ) { } @ XmlElement ( name = "phasen" ) public Phases getPhases ( ) { } public void setPhases ( Phases phases ) { } <START_BUG> @ XmlElement ( name = "projektleiter" ) <END_BUG> public Leader getLeader ( ) { return leader ; } public void setLeader ( Leader leader ) { } @ XmlElement ( name = "projektnummer" ) public String getTitle ( ) { } public void setTitle ( String title ) { } @ XmlElement ( name = "auftraggeber" ) public Customer getCustomer ( ) { } public void setCustomer ( Customer customer ) { } @ XmlElement ( name = "typ" ) public Type getType ( ) { } public void setType ( Type type ) { } @ XmlElement ( name = "waehrung" ) public Currency getCurrency ( ) { } public void setCurrency ( Currency currency ) { } @ XmlElement ( name = "modifiedDateTime" ) public String getModifiedDate ( ) { } public void setModifiedDate ( String modifiedDate ) { } @ XmlElement ( name = "creationDateTime" ) public String getCreationDate ( ) { } public void setCreationDate ( String creationDate ) { } public String toJSONString ( ) { } }

Fix:
@ XmlElement ( name = "hB" )
Buggy code:
public class StringListAttributeDefinitionUnitTestCase { @ Test public void testExpressions ( ) throws OperationFailedException { <START_BUG> ListAttributeDefinition ld = new StringListAttributeDefinition . Builder ( "test" ) . setAllowExpression ( true ) . setElementValidator ( new StringLengthValidator ( 1 , false , true ) ) . build ( ) ; <END_BUG> ModelNode op = new ModelNode ( ) ; op . get ( "test" ) . add ( "abc" ) . add ( "${test:1}" ) ; ModelNode validated = ld . validateOperation ( op ) ; Assert . assertEquals ( op . get ( "test" ) . get ( 0 ) , validated . get ( 0 ) ) ; Assert . assertEquals ( new ModelNode ( ) . setExpression ( op . get ( "test" ) . get ( 1 ) . asString ( ) ) , validated . get ( 1 ) ) ; ModelNode model = new ModelNode ( ) ; ld . validateAndSet ( op , model ) ; Assert . assertEquals ( op . get ( "test" ) . get ( 0 ) , model . get ( "test" ) . get ( 0 ) ) ; Assert . assertEquals ( new ModelNode ( ) . setExpression ( op . get ( "test" ) . get ( 1 ) . asString ( ) ) , model . get ( "test" ) . get ( 1 ) ) ; } }

Fix:
ListAttributeDefinition ld = new StringListAttributeDefinition . Builder ( "test" ) . setAllowExpression ( true ) . setValidator ( new StringLengthValidator ( 1 , false , true ) ) . build ( ) ;
Buggy code:
public class Event implements Serializable , SQLPersistancy { private Integer id ; private Date created ; private Date modified ; private Date eventDate ; private String name ; private Set eventrequests = new HashSet ( 0 ) ; private Set items = new HashSet ( 0 ) ; private Set eventUserses = new HashSet ( 0 ) ; public Event ( ) { } public Event ( Date created , Date modified , Date eventDate , String name ) { } public Event ( Date created , Date modified , Date eventDate , String name , Set eventrequests , Set items , Set eventUserses ) { } public Integer getId ( ) { } public void setId ( Integer id ) { } public Date getCreated ( ) { } public void setCreated ( Date created ) { } public Date getModified ( ) { } public void setModified ( Date modified ) { } public Date getEventDate ( ) { } public void setEventDate ( Date eventDate ) { } public String getName ( ) { } public void setName ( String name ) { } public Set getEventrequests ( ) { } public void setEventrequests ( Set eventrequests ) { } public Set getItems ( ) { } public void setItems ( Set items ) { } public Set getEventUserses ( ) { } public void setEventUserses ( Set eventUserses ) { } @ Override public void save ( ) throws SQLException { } @ Override public void insert ( ) throws SQLException { } @ Override public void delete ( ) throws SQLException { } @ Override public void update ( ) throws SQLException { <START_BUG> String query = String . format ( "UPDATE<seq2seq4repair_space>%s<seq2seq4repair_space>SET<seq2seq4repair_space>%s=?,<seq2seq4repair_space>%s=?<seq2seq4repair_space>WHERE<seq2seq4repair_space>%s<seq2seq4repair_space>=?" , "event" , "event_date" , eventDate , "name" , name , "id" , id ) ; <END_BUG> ArrayList < ParamSQL > aLP = new ArrayList < ParamSQL > ( ) ; aLP . add ( new ParamSQL ( SQLConstants . SQL_TYPE_DATE , eventDate ) ) ; aLP . add ( new ParamSQL ( SQLConstants . SQL_TYPE_STRING , name ) ) ; aLP . add ( new ParamSQL ( SQLConstants . SQL_TYPE_INT , id ) ) ; int ret = Query . executeStatement ( query , aLP ) ; } @ Override public void load ( ) throws SQLException { } public ArrayList < Event > getAllEvents ( ) throws SQLException { } public String getAllEventsJSON ( ) throws SQLException { } public ArrayList < Item > getItems ( int pEventId ) { } public String getItemsJSON ( int pEventId ) { } }

Fix:
String query = String . format ( "UPDATE<seq2seq4repair_space>%s<seq2seq4repair_space>SET<seq2seq4repair_space>%s=?,<seq2seq4repair_space>%s=?<seq2seq4repair_space>WHERE<seq2seq4repair_space>%s<seq2seq4repair_space>=?" , "event" , "event_date" , "name" , "id" ) ;
Buggy code:
public class CaesarCryptography { private final int ASCII_DIGIT_0 = 48 ; private final int ASCII_UPPER_A = 65 ; private final int ASCII_LOWER_A = 97 ; private final int ALPHABET_LENGTH = 26 ; private final int NUMERALS_SIZE = 10 ; public String encode ( String inputMessage , int key ) { } public String decode ( String codedMessage , int key ) { } public static char encodedCycleOfProcessingData ( char character , int firstSymbolInASCII , int alphabetSize , int key ) { StringBuilder stringBuilder = new StringBuilder ( ) ; <START_BUG> int asciiCodeOfCharacter = ( ( character - firstSymbolInASCII ) - key ) % alphabetSize ; <END_BUG> int myCodeOfCharacter = asciiCodeOfCharacter + firstSymbolInASCII ; if ( asciiCodeOfCharacter >= 0 ) { stringBuilder . appendCodePoint ( myCodeOfCharacter ) ; } else { stringBuilder . appendCodePoint ( ( myCodeOfCharacter + alphabetSize ) ) ; } return stringBuilder . charAt ( 0 ) ; } public static char decodedCycleOfProcessingData ( char character , int firstSymbolInASCII , int alphabetSize , int key ) { } No newline ; at end ; of file ; }

Fix:
int asciiCodeOfCharacter = ( ( character - firstSymbolInASCII ) + key ) % alphabetSize ;
Buggy code:
public class AnnotationBeanNameGenerator implements BeanNameGenerator { private static final String COMPONENT_ANNOTATION_CLASSNAME = "org.springframework.stereotype.Component" ; @ Override public String generateBeanName ( BeanDefinition definition , BeanDefinitionRegistry registry ) { } protected String determineBeanNameFromAnnotation ( AnnotatedBeanDefinition annotatedDef ) { AnnotationMetadata amd = annotatedDef . getMetadata ( ) ; Set < String > types = amd . getAnnotationTypes ( ) ; String beanName = null ; for ( String type : types ) { <START_BUG> AnnotationAttributes attributes = MetadataUtils . attributesFor ( amd , type ) ; <END_BUG> if ( isStereotypeWithNameValue ( type , amd . getMetaAnnotationTypes ( type ) , attributes ) ) { String value = ( ( String ) ( attributes . get ( "value" ) ) ) ; if ( StringUtils . hasLength ( value ) ) { if ( ( beanName != null ) && ( ! ( value . equals ( beanName ) ) ) ) { throw new IllegalStateException ( ( ( ( ( ( "Stereotype<seq2seq4repair_space>annotations<seq2seq4repair_space>suggest<seq2seq4repair_space>inconsistent<seq2seq4repair_space>" + "component<seq2seq4repair_space>names:<seq2seq4repair_space>'" ) + beanName ) + "'<seq2seq4repair_space>versus<seq2seq4repair_space>'" ) + value ) + "'" ) ) ; } beanName = value ; } } } return beanName ; } protected boolean isStereotypeWithNameValue ( String annotationType , Set < String > metaAnnotationTypes , Map < String , Object > attributes ) { } protected String buildDefaultBeanName ( BeanDefinition definition , BeanDefinitionRegistry registry ) { } protected String buildDefaultBeanName ( BeanDefinition definition ) { } }

Fix:
AnnotationAttributes attributes = AnnotationConfigUtils . attributesFor ( amd , type ) ;
Buggy code:
public class SearchWebApp extends HttpServlet { static String host = "localhost" ; static String user = "admin" ; static String password = "jabberw0cky" ; static int dbPort = 27017 ; public static int wsPort = 8080 ; static String webRoot = "//var//www" ; Repository repository = Repository . MONGO ; private int getInteger ( String value , int def ) { } private Repository getRepository ( String value , Repository def ) { } @ Override protected void service ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { try { String method = req . getMethod ( ) ; String target = req . getRequestURI ( ) ; if ( ! ( Connector . isOpen ( ) ) ) { Enumeration params = getServletConfig ( ) . getInitParameterNames ( ) ; while ( params . hasMoreElements ( ) ) { String param = ( ( String ) ( params . nextElement ( ) ) ) ; String value = getServletConfig ( ) . getInitParameter ( param ) ; if ( param . equals ( "webRoot" ) ) SearchWebApp . webRoot = value ; else if ( param . equals ( "dbPort" ) ) SearchWebApp . dbPort = getInteger ( value , 27017 ) ; else if ( param . equals ( "wsPort" ) ) SearchWebApp . wsPort = getInteger ( value , 8080 ) ; else if ( param . equals ( "username" ) ) SearchWebApp . user = value ; else if ( param . equals ( "password" ) ) SearchWebApp . password = value ; else if ( param . equals ( "repository" ) ) repository = getRepository ( value , MONGO ) ; else if ( param . equals ( "indexRoot" ) ) JettyServer . indexRoot = value ; else if ( param . equals ( "host" ) ) SearchWebApp . host = value ; } Connector . init ( repository , SearchWebApp . user , SearchWebApp . password , SearchWebApp . host , SearchWebApp . dbPort , SearchWebApp . wsPort , SearchWebApp . webRoot ) ; } target = Utils . pop ( target ) ; SearchHandler handler ; String service = Utils . first ( target ) ; <START_BUG> if ( service . equals ( BUILD ) ) { <END_BUG> if ( method . equals ( "GET" ) ) handler = new SearchGetHandler ( ) ; else if ( method . equals ( "POST" ) ) handler = new SearchPostHandler ( ) ; else throw new SearchException ( ( "Unknown<seq2seq4repair_space>http<seq2seq4repair_space>method<seq2seq4repair_space>" + method ) ) ; resp . setStatus ( SC_OK ) ; handler . handle ( req , resp , target ) ; } else throw new SearchException ( ( "Unknown<seq2seq4repair_space>service<seq2seq4repair_space>" + service ) ) ; } catch ( Exception e ) { resp . setStatus ( SC_BAD_REQUEST ) ; CalliopeException he = new CalliopeException ( e ) ; resp . setContentType ( "text//html" ) ; try { resp . getWriter ( ) . println ( new calliope . core . exception . CalliopeExceptionMessage ( he ) . toString ( ) ) ; } catch ( Exception e2 ) { e . printStackTrace ( System . out ) ; } } } No newline ; at end ; of file ; }

Fix:
if ( ( service . equals ( BUILD ) ) || ( service . equals ( FIND ) ) ) {
Buggy code:
public abstract class AbstractTestCase extends TestCase { protected File dir ; protected void setUp ( ) throws Exception { } protected File getFile ( String path ) throws IOException { URL url = getClass ( ) . getResource ( path ) ; if ( url == null ) { throw new FileNotFoundException ( ( path + "<seq2seq4repair_space>doesn't<seq2seq4repair_space>exist" ) ) ; } try { return new File ( new URI ( url . toString ( ) ) ) ; } catch ( URISyntaxException ex ) { <START_BUG> throw new IOException ( ex . getMessage ( ) , ex ) ; <END_BUG> } } protected void tearDown ( ) throws Exception { } public void addURL ( URL url ) throws Exception { } protected File createArchive ( String archivename ) throws Exception { } protected void checkArchiveContent ( File archive , List expected ) throws Exception { } protected void checkArchiveContent ( ArchiveInputStream in , List expected ) throws Exception { } }

Fix:
throw new IOException ( ex . getMessage ( ) ) ;
Buggy code:
; private ArrayList < String > array_sort ; int textlength = 0 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_search_page ) ; Firebase . setAndroidContext ( this ) ; et = ( ( EditText ) ( findViewById ( EditText01 ) ) ) ; lv = ( ( ListView ) ( findViewById ( list ) ) ) ; array_sort = new ArrayList < String > ( Arrays . asList ( listview_names ) ) ; setListAdapter ( new SearchPage . bsAdapter ( this ) ) ; et . addTextChangedListener ( new TextWatcher ( ) { @ Override public void afterTextChanged ( Editable s ) { } @ Override public void beforeTextChanged ( CharSequence s , int start , int count , int after ) { } @ SuppressLint ( "DefaultLocale" ) @ Override public void onTextChanged ( CharSequence s , int start , int before , int count ) { textlength = et . getText ( ) . length ( ) ; array_sort . clear ( ) ; for ( int i = 0 ; i < ( listview_names . length ) ; i ++ ) { if ( ( textlength ) <= ( listview_names [ i ] . length ( ) ) ) { if ( listview_names [ i ] . toLowerCase ( ) . contains ( et . getText ( ) . toString ( ) . toLowerCase ( ) . trim ( ) ) ) { array_sort . add ( listview_names [ i ] ) ; } } } AppendList ( array_sort ) ; } } ) ; lv . setOnItemClickListener ( new OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > arg0 , View arg1 , int position , long arg3 ) { Intent activityIntent = new Intent ( SearchPage . this , MainDetailRecipePage . class ) ; activityIntent . putExtra ( "item" , array_sort . get ( position ) ) ; <START_BUG> activityIntent . putExtra ( "backButton" , "back" ) ; <END_BUG> startActivity ( activityIntent ) ; finish ( ) ; } } ) ; } public void AppendList ( ArrayList < String > str ) { } public class bsAdapter extends BaseAdapter { Activity cntx ; public bsAdapter ( Activity context ) { } @ Override public int getCount ( ) { } @ Override public Object getItem ( int position ) { } @ Override public long getItemId ( int position ) { } @ SuppressLint ( { "ViewHolder" , "InflateParams" }

Fix:
activityIntent . putExtra ( "backButton" , "backSearch" ) ;
Buggy code:
public class SelectionOnExplicitConstructorCall extends ExplicitConstructorCall { public SelectionOnExplicitConstructorCall ( int accessMode ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void resolve ( BlockScope scope ) { super . resolve ( scope ) ; if ( ( ( binding ) == null ) || ( ! ( ( binding . isValidBinding ( ) ) || ( ( binding . problemId ( ) ) == ( ProblemReasons . NotVisible ) ) ) ) ) throw new SelectionNodeFound ( ) ; else <START_BUG> throw new SelectionNodeFound ( this , binding ) ; <END_BUG> } }

Fix:
throw new SelectionNodeFound ( binding ) ;
Buggy code:
class CSVLexer extends Lexer { public CSVLexer ( CSVFormat format , ExtendedBufferedReader in ) { } @ Override Token nextToken ( Token tkn ) throws IOException { int lastChar = in . readAgain ( ) ; int c = in . read ( ) ; boolean eol = isEndOfLine ( c ) ; c = in . readAgain ( ) ; if ( emptyLinesIgnored ) { while ( ( eol && ( ( ( lastChar == '\n' ) || ( lastChar == '\r' ) ) || ( lastChar == ( ExtendedBufferedReader . UNDEFINED ) ) ) ) && ( ! ( isEndOfFile ( lastChar ) ) ) ) { lastChar = c ; c = in . read ( ) ; eol = isEndOfLine ( c ) ; c = in . readAgain ( ) ; if ( isEndOfFile ( c ) ) { tkn . type = EOF ; return tkn ; } } } if ( ( isEndOfFile ( lastChar ) ) || ( ( ! ( isDelimiter ( lastChar ) ) ) && ( isEndOfFile ( c ) ) ) ) { tkn . type = EOF ; return tkn ; } while ( ( tkn . type ) == ( INVALID ) ) { if ( surroundingSpacesIgnored ) { while ( ( isWhitespace ( c ) ) && ( ! eol ) ) { c = in . read ( ) ; eol = isEndOfLine ( c ) ; } } if ( isCommentStart ( c ) ) { in . readLine ( ) ; <START_BUG> tkn = nextToken ( tkn . reset ( ) ) ; <END_BUG> } else if ( isDelimiter ( c ) ) { tkn . type = TOKEN ; } else if ( eol ) { tkn . type = EORECORD ; } else if ( isEncapsulator ( c ) ) { encapsulatedTokenLexer ( tkn ) ; } else if ( isEndOfFile ( c ) ) { tkn . type = EOF ; tkn . isReady = true ; } else { simpleTokenLexer ( tkn , c ) ; } } return tkn ; } private Token simpleTokenLexer ( Token tkn , int c ) throws IOException { } private Token encapsulatedTokenLexer ( Token tkn ) throws IOException { } }

Fix:
tkn . type = COMMENT ;
Buggy code:
} <START_BUG> subtitleUrl = ( ( ( ( ( ( "http:////" + ( PMS . get ( ) . getServer ( ) . getHost ( ) ) ) + ':' ) + ( PMS . get ( ) . getServer ( ) . getPort ( ) ) ) + "//get//" ) + id ) + "//subtitle0000" ) + subExtension ; <END_BUG>

Fix:
subtitleUrl = ( ( ( ( ( ( "http:////" + ( PMS . get ( ) . getServer ( ) . getHost ( ) ) ) + ':' ) + ( PMS . get ( ) . getServer ( ) . getPort ( ) ) ) + "//get//" ) + ( id . substring ( 0 , id . indexOf ( '//' ) ) ) ) + "//subtitle0000" ) + subExtension ;
Buggy code:
public class DDCreator extends MatchingTask { private File descriptorDirectory ; private File generatedFilesDirectory ; private String classpath ; public void execute ( ) throws BuildException { if ( ( ( descriptorDirectory ) == null ) || ( ! ( descriptorDirectory . isDirectory ( ) ) ) ) { throw new BuildException ( ( ( "descriptors<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( descriptorDirectory . getPath ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ) ; } if ( ( ( generatedFilesDirectory ) == null ) || ( ! ( generatedFilesDirectory . isDirectory ( ) ) ) ) { throw new BuildException ( ( ( "dest<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( generatedFilesDirectory . getPath ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ) ; } String args = ( ( descriptorDirectory ) + "<seq2seq4repair_space>" ) + ( generatedFilesDirectory ) ; DirectoryScanner ds = super . getDirectoryScanner ( descriptorDirectory ) ; String [ ] files = ds . getIncludedFiles ( ) ; for ( int i = 0 ; i < ( files . length ) ; ++ i ) { args += "<seq2seq4repair_space>" + ( files [ i ] ) ; } String systemClassPath = System . getProperty ( "java.class.path" ) ; String execClassPath = project . translatePath ( ( ( systemClassPath + ":" ) + ( classpath ) ) ) ; Java ddCreatorTask = ( ( Java ) ( project . createTask ( "java" ) ) ) ; <START_BUG> ddCreatorTask . setFork ( "yes" ) ; <END_BUG> ddCreatorTask . setClassname ( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ) ; ddCreatorTask . setArgs ( args ) ; ddCreatorTask . setClasspath ( new org . apache . tools . ant . types . Path ( project , execClassPath ) ) ; if ( ( ddCreatorTask . executeJava ( ) ) != 0 ) { throw new BuildException ( "Execution<seq2seq4repair_space>of<seq2seq4repair_space>ddcreator<seq2seq4repair_space>helper<seq2seq4repair_space>failed" ) ; } } public void setDescriptors ( String dirName ) { } public void setDest ( String dirName ) { } public void setClasspath ( String s ) { } }

Fix:
ddCreatorTask . setFork ( true ) ;
Buggy code:
public class Module extends DefUnit implements IModuleNode , IScopeElement , IConcreteNamedElement , IImportableUnit { public static class ModuleDefSymbol extends DefSymbol { protected Module module ; public ModuleDefSymbol ( String id ) { } @ Override protected ASTNode getParent_Concrete ( ) { } @ Override public DefUnit getDefUnit ( ) { } @ Override protected CommonASTNode doCloneTree ( ) { } } public static class DeclarationModule extends ASTNode { public final Token [ ] comments ; public final ArrayView < IToken > packageList ; public final String [ ] packages ; public final Module . ModuleDefSymbol moduleName ; public DeclarationModule ( Token [ ] comments , ArrayView < IToken > packageList , BaseLexElement moduleDefUnit ) { } public DeclarationModule ( Token [ ] comments , ArrayView < IToken > packageList , Module . ModuleDefSymbol moduleDefUnit ) { } protected static Module . ModuleDefSymbol createModuleDefSymbol ( BaseLexElement moduleDefUnit ) { } public Module . ModuleDefSymbol getModuleSymbol ( ) { } @ Override public ASTNodeTypes getNodeType ( ) { } @ Override public void visitChildren ( IASTVisitor visitor ) { } @ Override protected CommonASTNode doCloneTree ( ) { } @ Override public void toStringAsCode ( ASTCodePrinter cp ) { } } public static Module createModuleNoModuleDecl ( String moduleName , NodeVector < ASTNode > members , Path compilationUnitPath , SourceRange modRange ) { } public final Module . DeclarationModule md ; public final NodeVector < ASTNode > members ; public final Path compilationUnitPath ; public Module ( Module . ModuleDefSymbol defSymbol , Module . DeclarationModule md , NodeVector < ASTNode > members , Path compilationUnitPath ) { } @ Override public ASTNodeTypes getNodeType ( ) { } @ Override public void visitChildren ( IASTVisitor visitor ) { } @ Override protected CommonASTNode doCloneTree ( ) { } @ Override public void toStringAsCode ( ASTCodePrinter cp ) { } @ Override public EArcheType getArcheType ( ) { } @ Override public String getFullyQualifiedName ( ) { } @ Override public String getModuleFullName ( ) { } public String [ ] getDeclaredPackages ( ) { } @ Override public Token [ ] getDocComments ( ) { } @ Override public Path getCompilationUnitPath ( ) { } @ Override public ILanguageElement getOwnerElement ( ) { } @ Override public Path getSemanticContainerKey ( ) { } protected final NamedElementsScope topLevelScope ; protected NamedElementsScope createTopLevelScope ( ) { } protected INamedElement createTopLevelElement ( ) { if ( ( ( ( md ) == null ) || ( ( md . packages . length ) == 0 ) ) || ( ( md . packages [ 0 ] ) == "" ) ) { return this ; } else { String [ ] packNames = md . packages ; <START_BUG> return PackageNamespace . createNamespaceElement ( packNames , this , this ) ; <END_BUG> } } @ Override public ScopeTraverser getScopeTraverser ( ) { } @ Override public IScopeElement getImportableScope ( ) { } protected final IScopeElement importableScope ; @ Override protected NamedElementSemantics doCreateSemantics ( PickedElement < ? > pickedElement ) { } No newline ; at end ; of file ; }

Fix:
return PackageNamespace . createNamespaceElement ( packNames , this ) ;
Buggy code:
public class OrmExample { public static void main ( String [ ] args ) { ResourceSet resourceSet = new ResourceSetImpl ( ) ; resourceSet . getResourceFactoryRegistry ( ) . getExtensionToFactoryMap ( ) . put ( DEFAULT_EXTENSION , new XMIResourceFactoryImpl ( ) ) ; resourceSet . getPackageRegistry ( ) . put ( eNS_URI , eINSTANCE ) ; if ( ( args . length ) == 0 ) { System . out . println ( "Enter<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>file<seq2seq4repair_space>paths<seq2seq4repair_space>or<seq2seq4repair_space>URIs<seq2seq4repair_space>that<seq2seq4repair_space>have<seq2seq4repair_space>content<seq2seq4repair_space>like<seq2seq4repair_space>this:" ) ; try { <START_BUG> Resource resource = resourceSet . createResource ( URI . createURI ( "http://////My.graphical.crom" ) ) ; <END_BUG> NamedElement root = OrmFactory . eINSTANCE . createNamedElement ( ) ; resource . getContents ( ) . add ( root ) ; resource . save ( System . out , null ) ; } catch ( IOException exception ) { exception . printStackTrace ( ) ; } } else { for ( int i = 0 ; i < ( args . length ) ; ++ i ) { File file = new File ( args [ i ] ) ; URI uri = ( file . isFile ( ) ) ? URI . createFileURI ( file . getAbsolutePath ( ) ) : URI . createURI ( args [ i ] ) ; try { Resource resource = resourceSet . getResource ( uri , true ) ; System . out . println ( ( "Loaded<seq2seq4repair_space>" + uri ) ) ; for ( EObject eObject : resource . getContents ( ) ) { Diagnostic diagnostic = INSTANCE . validate ( eObject ) ; if ( ( diagnostic . getSeverity ( ) ) != ( Diagnostic . OK ) ) { OrmExample . printDiagnostic ( diagnostic , "" ) ; } } } catch ( RuntimeException exception ) { System . out . println ( ( "Problem<seq2seq4repair_space>loading<seq2seq4repair_space>" + uri ) ) ; exception . printStackTrace ( ) ; } } } } protected static void printDiagnostic ( Diagnostic diagnostic , String indent ) { } }

Fix:
Resource resource = resourceSet . createResource ( URI . createURI ( "http://////My.crom_dia" ) ) ;
Buggy code:
public class LogMessage extends NestedRoutine { public static final DateFormat formatter = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ) ; private final IDataProvider < String > logNameDP ; private final Collection < IDataProvider < String > > messages ; private LogMessage ( ScriptLine scriptLine , IDataProvider < String > logNameDP , Collection < IDataProvider < String > > messages ) { } @ Override public void run ( EventData data ) throws BailException { } public static void register ( ) { } protected static class RoutineFactory extends NestedRoutine . RoutineFactory { @ Override public IRoutineBuilder getNew ( Matcher matcher , ScriptLine scriptLine , EventInfo info ) { } } private static class MessageRoutineBuilder implements ScriptLineHandler , IRoutineBuilder { ScriptLine scriptLine ; IDataProvider < String > logNameDP ; EventInfo info ; List < IDataProvider < String > > messages = new ArrayList < IDataProvider < String > > ( ) ; public MessageRoutineBuilder ( ScriptLine scriptLine , IDataProvider < String > logNameDP , EventInfo info ) { } public void addString ( String str ) { IDataProvider < String > msgDP = DataProvider . parse ( info , String . class , str ) ; if ( msgDP != null ) { messages . add ( msgDP ) ; <START_BUG> LogUtil . info ( msgDP . toString ( ) . replaceAll ( "%" , "%%" ) ) ; <END_BUG> } } @ Override public ScriptLineHandler handleLine ( ScriptLine line , boolean hasChildren ) { } @ Override public void done ( ) { } @ Override public ScriptLineHandler getScriptLineHandler ( ) { } @ Override public Routine buildRoutine ( ) { } } No newline ; at end ; of file ; }

Fix:
LogUtil . info ( msgDP . toString ( ) ) ;
Buggy code:
public class SystemMenuMovePane extends Action implements ISelfUpdatingAction { IStackPresentationSite site ; public SystemMenuMovePane ( IStackPresentationSite site ) { } public void run ( ) { } public void update ( ) { IPresentablePart part = site . getSelectedPart ( ) ; <START_BUG> setEnabled ( ( ( part != null ) && ( site . isMoveable ( part ) ) ) ) ; <END_BUG> } public boolean shouldBeVisible ( ) { } }

Fix:
setEnabled ( ( ( part != null ) && ( site . isPartMoveable ( part ) ) ) ) ;
Buggy code:
public class SormSession { private final Connection _connection ; private final String _dialect ; private final Map < Class < ? extends SormObject > , Map < Object , WeakReference < Object > > > _weakCache = new HashMap < Class < ? extends SormObject > , Map < Object , WeakReference < Object > > > ( ) ; private final CacheMode _cacheMode ; private boolean _closed = false ; protected SormSession ( final Connection connection , final String dialect , final CacheMode cacheMode ) { } public Connection getConnection ( ) { } public String getDialect ( ) { } public CacheMode getCacheMode ( ) { } public boolean isClosed ( ) { } public void close ( ) throws SQLException { } public void cacheAdd ( final Class < ? extends SormObject > type , final Object key , final Object value ) { } public < T > T cacheGet ( final Class < T > type , final Object key ) { if ( isClosed ( ) ) { throw new IllegalStateException ( ( ( getClass ( ) . getSimpleName ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>closed." ) ) ; } if ( ( CacheMode . None ) == ( getCacheMode ( ) ) ) { return null ; } final Map < Object , WeakReference < Object > > typemap ; synchronized ( _weakCache ) { typemap = _weakCache . get ( type ) ; } if ( null == typemap ) { return null ; } <START_BUG> final WeakReference < Object > ref = typemap . get ( type ) ; <END_BUG> if ( null == ref ) { return null ; } return SormSession . cast ( type , ref . get ( ) ) ; } public void cacheDel ( final Class < ? extends SormObject > type , final Object key ) { } @ SuppressWarnings ( "unchecked" ) private static < T > T cast ( final Class < T > type , final Object o ) { } }

Fix:
final WeakReference < Object > ref = typemap . get ( key ) ;
Buggy code:
public class NumericFieldInfo { public int precisionStep = 8 ; public boolean store = true ; public boolean index = true ; public void setPrecisionStep ( int p ) { } public IndexableField createDouble ( String name , double v ) { if ( ( ! ( store ) ) && ( ! ( index ) ) ) throw new IllegalArgumentException ( "field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>indexed<seq2seq4repair_space>or<seq2seq4repair_space>stored" ) ; <START_BUG> FieldType fieldType = new FieldType ( DoubleField . TYPE ) ; <END_BUG> fieldType . setStored ( store ) ; fieldType . setIndexed ( index ) ; fieldType . setNumericPrecisionStep ( precisionStep ) ; return new DoubleField ( name , v , fieldType ) ; } }

Fix:
FieldType fieldType = new FieldType ( DoubleField . TYPE_NOT_STORED ) ;
Buggy code:
final class Command implements ICommand { private static final boolean DEBUG_HANDLERS = ( Policy . DEBUG_HANDLERS ) && ( Policy . DEBUG_HANDLERS_VERBOSE ) ; private static final String DEBUG_HANDLERS_COMMAND_ID = Policy . DEBUG_HANDLERS_VERBOSE_COMMAND_ID ; private static final int HASH_FACTOR = 89 ; private static final int HASH_INITIAL = Command . class . getName ( ) . hashCode ( ) ; private String categoryId ; private List commandListeners ; private Set commandsWithListeners ; private boolean defined ; private String description ; private IHandler handler ; private transient int hashCode ; private transient boolean hashCodeComputed ; private String id ; private List keySequenceBindings ; private IKeySequenceBinding [ ] keySequenceBindingsAsArray ; private String name ; private transient String string ; Command ( Set commandsWithListeners , String id ) { } public void addCommandListener ( ICommandListener commandListener ) { } public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } public Object execute ( Map parameterValuesByName ) throws ExecutionException , NotHandledException { } void fireCommandChanged ( CommandEvent commandEvent ) { } public Map getAttributeValuesByName ( ) throws NotHandledException { } public String getCategoryId ( ) throws NotDefinedException { } public String getDescription ( ) throws NotDefinedException { } public String getId ( ) { } public List getKeySequenceBindings ( ) { } public String getName ( ) throws NotDefinedException { } public int hashCode ( ) { } public boolean isDefined ( ) { } public boolean isHandled ( ) { } public void removeCommandListener ( ICommandListener commandListener ) { } boolean setCategoryId ( String categoryId ) { } boolean setDefined ( boolean defined ) { } boolean setDescription ( String description ) { } boolean setHandler ( IHandler handler ) { if ( handler != ( this . handler ) ) { this . handler = handler ; hashCodeComputed = false ; hashCode = 0 ; string = null ; if ( ( Command . DEBUG_HANDLERS ) && ( ( ( Command . DEBUG_HANDLERS_COMMAND_ID ) == null ) || ( Command . DEBUG_HANDLERS_COMMAND_ID . equals ( id ) ) ) ) { <START_BUG> System . out . print ( ( ( "HANDLERS<seq2seq4repair_space>>><seq2seq4repair_space>Command('" + ( id ) ) + "'<seq2seq4repair_space>has<seq2seq4repair_space>changed<seq2seq4repair_space>to<seq2seq4repair_space>" ) ) ; <END_BUG> if ( handler == null ) { System . out . println ( "no<seq2seq4repair_space>handler" ) ; } else { System . out . print ( "'" ) ; System . out . print ( handler ) ; System . out . println ( "'<seq2seq4repair_space>as<seq2seq4repair_space>its<seq2seq4repair_space>handler" ) ; } } return true ; } return false ; } boolean setKeySequenceBindings ( List keySequenceBindings ) { } boolean setName ( String name ) { } public String toString ( ) { } }

Fix:
System . out . print ( ( ( "HANDLERS<seq2seq4repair_space>>>><seq2seq4repair_space>Command('" + ( id ) ) + "'<seq2seq4repair_space>has<seq2seq4repair_space>changed<seq2seq4repair_space>to<seq2seq4repair_space>" ) ) ;
Buggy code:
public class FieldSignatureImpl extends MemberSignatureImpl implements FieldSignature { Class fieldType ; private Field field ; FieldSignatureImpl ( int modifiers , String name , Class declaringType , Class fieldType ) { } FieldSignatureImpl ( String stringRep ) { } public Class getFieldType ( ) { } protected String createToString ( StringMaker sm ) { } public Field getField ( ) { if ( ( field ) == null ) { try { <START_BUG> field = declaringType . getDeclaredField ( getName ( ) ) ; <END_BUG> } catch ( Exception ex ) { } } return field ; } }

Fix:
field = getDeclaringType ( ) . getDeclaredField ( getName ( ) ) ;
Buggy code:
public interface CategoryService { @ GET ( "//myeventmanager//categories//" ) Call < Categories > getCategories ( ) { } @ Headers ( "Content-Type:<seq2seq4repair_space>application//json" ) <START_BUG> @ POST ( "//myeventmanager//categories//" ) <END_BUG> Call < Category > postCategory ( @ Header ( "Authorization" ) String authorization , @ Body Category category ) ; @ GET ( "//myeventmanager//categories//{id}" ) Call < List < Category > > getCategory ( @ Header ( "Authorization" ) String authorization , @ Query ( "id" ) String id ) { } @ PUT ( "//myeventmanager//categories//{id}" ) Call < Category > updateCategory ( @ Header ( "Authorization" ) String authorization , @ Query ( "id" ) String id ) { } @ DELETE ( "//myeventmanager//categories//{id}" ) Call < Category > deleteCategory ( @ Header ( "Authorization" ) String authorization , @ Query ( "id" ) String id ) { } }

Fix:
@ POST ( "//myeventmanager//categories" )
Buggy code:
public class TestEarlyTermination extends LuceneTestCase { Directory dir ; RandomIndexWriter writer ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { super . tearDown ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> dir . close ( ) ; } public void testEarlyTermination ( ) throws IOException { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class InGameMenu { private ImageEntity _background ; private OPTION _option ; private int SCREENWIDTH ; private int SCREENHEIGHT ; private Random random = new Random ( ) ; private LinkedList < Item > items ; private LinkedList < Item > equipment ; private int [ ] counts ; private Item [ ] shownEquipment ; private Item [ ] shownItems ; private int itemLocation ; private int sectionLoc ; private int totalItems ; private int totalEquipment ; private int level = 1 ; private int maxHealth = 35 ; private int currHealth = maxHealth ; private int magic = 5 ; private int attack = 8 ; private int defense = 4 ; private int experience ; private int nextLevel = 20 ; private int nextExp = 25 ; public InGameMenu ( ImageEntity background , int screenWidth , int screenHeight ) { } public void update ( OPTION option , int sectionLocation , int health ) { } public void addItem ( Item item ) { } public void addEquipment ( Item item ) { } private void countItems ( ) { } private void setItems ( ) { } public void render ( JFrame frame , Graphics2D g2d , int inX , int inY ) { } public void renderItems ( JFrame frame , Graphics2D g2d , Item [ ] array , LinkedList < Item > list ) { int start = getStart ( itemLocation , array ) ; int y = 0 ; for ( int i = start ; i < ( start + 4 ) ; i ++ ) { if ( ( array [ i ] ) == null ) { start ++ ; if ( start == ( ( array . length ) - 1 ) ) break ; if ( i == ( ( array . length ) - 1 ) ) break ; continue ; } g2d . setColor ( Color . YELLOW ) ; if ( ! ( list . isEmpty ( ) ) ) <START_BUG> g2d . drawLine ( 670 , ( 410 + ( ( sectionLoc ) * 110 ) ) , ( 670 + ( ( array [ ( ( itemLocation ) + ( sectionLoc ) ) ] . getName ( ) . length ( ) ) * 37 ) ) , ( 410 + ( ( sectionLoc ) * 110 ) ) ) ; <END_BUG> g2d . setColor ( Color . BLACK ) ; g2d . drawString ( array [ i ] . getName ( ) , 670 , ( 400 + ( y * 110 ) ) ) ; g2d . drawString ( ( "<seq2seq4repair_space>x<seq2seq4repair_space>" + ( new Integer ( counts [ i ] ) . toString ( ) ) ) , ( 700 + ( ( array [ i ] . getName ( ) . length ( ) ) * 37 ) ) , ( 400 + ( y * 110 ) ) ) ; array [ i ] . render ( frame , g2d , 600 , ( 340 + ( y * 110 ) ) ) ; y ++ ; } } private void levelUp ( ) { } public void getExp ( int exp ) { } private int getStart ( int amount , Item [ ] array ) { } public void loadNextItems ( ) { } public void loadNextEquipment ( ) { } public void loadOldItems ( ) { } public int getTotalItems ( ) { } public int getTotalEquipment ( ) { } public void setItemLoc ( int location ) { } public void useItem ( ) { } public int checkCount ( ) { } public int getHealth ( ) { } public int getMagic ( ) { } public void setmagic ( int magic ) { } }

Fix:
g2d . drawLine ( 670 , ( 410 + ( ( sectionLoc ) * 110 ) ) , ( 670 + ( ( array [ i ] . getName ( ) . length ( ) ) * 37 ) ) , ( 410 + ( ( sectionLoc ) * 110 ) ) ) ;
Buggy code:
abstract class AddFileToIndex extends IndexRequest { IFile resource ; public AddFileToIndex ( IFile resource , IPath indexPath , IndexManager manager ) { } public boolean execute ( IProgressMonitor progressMonitor ) { <START_BUG> if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) <END_BUG> return true ; IIndex index = manager . getIndex ( this . indexPath , true , true ) ; if ( index == null ) return true ; ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; if ( monitor == null ) return true ; try { monitor . enterWrite ( ) ; if ( ! ( indexDocument ( index ) ) ) return false ; } catch ( IOException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>index<seq2seq4repair_space>" + ( this . resource ) ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } return false ; } finally { monitor . exitWrite ( ) ; } return true ; } protected abstract boolean indexDocument ( IIndex index ) throws IOException { } public String toString ( ) { } }

Fix:
if ( ( this . isCancelled ) || ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) )
Buggy code:
@ ParentPackage ( "admin" ) @ Namespace ( "//admin" ) public class LoginAction extends ActionSupport { private static final long serialVersionUID = - 1681627584146722465L ; @ Setter private String username ; @ Setter private String password ; @ Autowired private UserService userService ; @ Action ( value = "login" , results = { @ Result ( name = "success" , location = "//WEB-INF//views//admin//login.jsp" ) } ) public String login ( ) { } @ Action ( value = "auth" , results = { @ Result ( name = "success" , type = "redirectAction" , location = "home" ) , @ Result ( name = "login" , location = "//WEB-INF//views//admin//login.jsp" ) } ) public String Authenticate ( ) { if ( ( ( username ) == null ) || ( ( password ) == null ) ) { return LOGIN ; } User admin = userService . loadByNameAndPwd ( username , password ) ; <START_BUG> if ( ( admin == null ) || ( ( admin . getIsAdmin ( ) ) == ( UserConst . IS_NOT_ADMIN ) ) ) { <END_BUG> addActionError ( USER_OR_PASSWORD_WRONG ) ; return LOGIN ; } Map < String , Object > session = ServletActionContext . getContext ( ) . getSession ( ) ; session . put ( "admin" , admin ) ; return SUCCESS ; } @ Action ( value = "logout" , results = { @ Result ( name = "success" , location = "//WEB-INF//views//admin//login.jsp" ) } ) public String logout ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( admin == null ) || ( ( admin . getIsAdmin ( ) ) == null ) ) || ( ( admin . getIsAdmin ( ) ) == ( UserConst . IS_NOT_ADMIN ) ) ) {
Buggy code:
public abstract class Loop extends AbstractRepeater { private static final long serialVersionUID = 1L ; public Loop ( final String id , final int iterations ) { } public Loop ( final String id , final IModel < Integer > model ) { } public final int getIterations ( ) { } @ Override protected final void onPopulate ( ) { } protected LoopItem newItem ( int iteration ) { } @ Override protected Iterator < Component > renderIterator ( ) { } protected abstract void populateItem ( LoopItem item ) { } @ Override protected final void renderChild ( Component child ) { } protected void renderItem ( final LoopItem item ) { <START_BUG> item . render ( getMarkupStream ( ) ) ; <END_BUG> } }

Fix:
item . render ( ) ;
Buggy code:
public class BasicComponentCreateService implements Service < Component > { private final InjectedValue < DeploymentUnit > deploymentUnit = new InjectedValue < DeploymentUnit > ( ) ; private final String componentName ; private final Class < ? > componentClass ; private final InterceptorFactory instantiationInterceptorFactory ; private final InterceptorFactory postConstruct ; private final InterceptorFactory preDestroy ; private final Map < Method , InterceptorFactory > componentInterceptors ; private final ManagedReferenceFactory componentInstantiator ; private BasicComponent component ; public BasicComponentCreateService ( final ComponentConfiguration componentConfiguration ) { } public synchronized void start ( final StartContext context ) throws StartException { } protected BasicComponent createComponent ( ) { } public synchronized void stop ( final StopContext context ) { } public synchronized Component getValue ( ) throws IllegalArgumentException , IllegalStateException { } <START_BUG> public Injector < DeploymentUnit > getDeploymentUnitInjector ( ) { <END_BUG> return deploymentUnit ; } public String getComponentName ( ) { } public InterceptorFactory getInstantiationInterceptorFactory ( ) { } public InterceptorFactory getPostConstruct ( ) { } public InterceptorFactory getPreDestroy ( ) { } public Map < Method , InterceptorFactory > getComponentInterceptors ( ) { } public ManagedReferenceFactory getComponentInstantiator ( ) { } public Class < ? > getComponentClass ( ) { } }

Fix:
public InjectedValue < DeploymentUnit > getDeploymentUnitInjector ( ) {
Buggy code:
public class Snippet228 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; shell . setText ( "Show<seq2seq4repair_space>results<seq2seq4repair_space>as<seq2seq4repair_space>a<seq2seq4repair_space>bar<seq2seq4repair_space>chart<seq2seq4repair_space>in<seq2seq4repair_space>Table" ) ; <START_BUG> final Table table = new Table ( shell , ( ( SWT . BORDER ) | ( SWT . FULL_SELECTION ) ) ) ; <END_BUG> table . setHeaderVisible ( true ) ; table . setLinesVisible ( true ) ; TableColumn column1 = new TableColumn ( table , SWT . NONE ) ; column1 . setText ( "Bug<seq2seq4repair_space>Status" ) ; column1 . setWidth ( 100 ) ; final TableColumn column2 = new TableColumn ( table , SWT . NONE ) ; column2 . setText ( "Percent" ) ; column2 . setWidth ( 200 ) ; String [ ] labels = new String [ ] { "Resolved" , "New" , "Won't<seq2seq4repair_space>Fix" , "Invalid" } ; for ( int i = 0 ; i < ( labels . length ) ; i ++ ) { TableItem item = new TableItem ( table , SWT . NONE ) ; item . setText ( labels [ i ] ) ; } table . addListener ( PaintItem , new Listener ( ) { int [ ] percents = new int [ ] { 50 , 30 , 5 , 15 } ; public void handleEvent ( Event event ) { if ( ( event . index ) == 1 ) { GC gc = event . gc ; TableItem item = ( ( TableItem ) ( event . item ) ) ; int index = table . indexOf ( item ) ; int percent = percents [ index ] ; Color foreground = gc . getForeground ( ) ; Color background = gc . getBackground ( ) ; gc . setForeground ( display . getSystemColor ( COLOR_RED ) ) ; gc . setBackground ( display . getSystemColor ( COLOR_YELLOW ) ) ; int width = ( ( ( column2 . getWidth ( ) ) - 1 ) * percent ) // 100 ; gc . fillGradientRectangle ( event . x , event . y , width , event . height , true ) ; Rectangle rect2 = new Rectangle ( event . x , event . y , ( width - 1 ) , ( ( event . height ) - 1 ) ) ; gc . drawRectangle ( rect2 ) ; gc . setForeground ( display . getSystemColor ( COLOR_LIST_FOREGROUND ) ) ; String text = percent + "%" ; Point size = event . gc . textExtent ( text ) ; int offset = Math . max ( 0 , ( ( ( event . height ) - ( size . y ) ) // 2 ) ) ; gc . drawText ( text , ( ( event . x ) + 2 ) , ( ( event . y ) + offset ) , true ) ; gc . setForeground ( background ) ; gc . setBackground ( foreground ) ; } } } ) ; shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
final Table table = new Table ( shell , SWT . BORDER ) ;
Buggy code:
public class SharedGroupsInfo extends IQ { private List groups = new ArrayList ( ) ; public List getGroups ( ) { } public String getChildElementXML ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( ) ; <END_BUG> buf . append ( "<sharedgroup<seq2seq4repair_space>xmlns=\"http:////www.jivesoftware.org//protocol//sharedgroup\">" ) ; for ( Iterator it = groups . iterator ( ) ; it . hasNext ( ) ; ) { buf . append ( "<group>" ) . append ( it . next ( ) ) . append ( "<//group>" ) ; } buf . append ( "<//sharedgroup>" ) ; return buf . toString ( ) ; } public static class Provider implements IQProvider { public Provider ( ) { } public IQ parseIQ ( XmlPullParser parser ) throws Exception { } } }

Fix:
StringBuilder buf = new StringBuilder ( ) ;