nus-yam/ex-repair huggingface dataset:
Buggy code:
public class RussianLetterDecoderEncoder implements LetterDecoderEncoder { public static final int RUSSIAN_SMALL_LETTER_OFFSET = 1071 ; public static final int WORD_PART_LENGHT = 6 ; public static final int EE_CHAR = 34 ; public static final int E_CHAR = 6 ; public static final int DASH_CHAR = 45 ; public static final int DASH_CODE = 33 ; public Integer encode ( String string ) { if ( ( string . length ( ) ) > ( RussianLetterDecoderEncoder . WORD_PART_LENGHT ) ) throw new SuffixToLongException ( ( ( ( "Suffix<seq2seq4repair_space>length<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>greater<seq2seq4repair_space>then<seq2seq4repair_space>" + ( RussianLetterDecoderEncoder . WORD_PART_LENGHT ) ) + "<seq2seq4repair_space>" ) + string ) ) ; int result = 0 ; for ( int i = 0 ; i < ( string . length ( ) ) ; i ++ ) { int c = ( 0 + ( string . charAt ( i ) ) ) - ( RussianLetterDecoderEncoder . RUSSIAN_SMALL_LETTER_OFFSET ) ; if ( c == ( 45 - ( RussianLetterDecoderEncoder . RUSSIAN_SMALL_LETTER_OFFSET ) ) ) { c = RussianLetterDecoderEncoder . DASH_CODE ; } if ( c == ( RussianLetterDecoderEncoder . EE_CHAR ) ) c = RussianLetterDecoderEncoder . E_CHAR ; if ( ( c < 0 ) || ( c > 33 ) ) <START_BUG> throw new WrongCharaterException ( ( ( "Symblo<seq2seq4repair_space>" + ( string . charAt ( i ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>small<seq2seq4repair_space>cirillic<seq2seq4repair_space>letter" ) ) ; <END_BUG> result = ( result * 34 ) + c ; } for ( int i = string . length ( ) ; i < ( RussianLetterDecoderEncoder . WORD_PART_LENGHT ) ; i ++ ) { result *= 34 ; } return result ; } public int [ ] encodeToArray ( String s ) { } public String decodeArray ( int [ ] array ) { } public String decode ( Integer suffixN ) { } public boolean checkCharacter ( char c ) { } public boolean checkString ( String word ) { } public String cleanString ( String s ) { } }

Fix:
throw new WrongCharaterException ( ( ( "Symbol<seq2seq4repair_space>" + ( string . charAt ( i ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>small<seq2seq4repair_space>cirillic<seq2seq4repair_space>letter" ) ) ;
Buggy code:
public class Close implements Command { private static Set commands = new HashSet ( ) ; public Close ( ) { } public Set getActionNames ( ) { } public void doAction ( ActionEvent e ) { ActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , CheckDirty . CHECK_DIRTY ) ) ; GuiPackage guiPackage = GuiPackage . getInstance ( ) ; if ( guiPackage . isDirty ( ) ) { if ( ( JOptionPane . showConfirmDialog ( GuiPackage . getInstance ( ) . getMainFrame ( ) , JMeterUtils . getResString ( "cancel_new_to_save" ) , JMeterUtils . getResString ( "Save?" ) , JOptionPane . YES_NO_OPTION , JOptionPane . QUESTION_MESSAGE ) ) == ( JOptionPane . YES_OPTION ) ) { <START_BUG> ActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , CheckDirty . SAVE_ALL ) ) ; <END_BUG> } } guiPackage . getTreeModel ( ) . clearTestPlan ( ) ; guiPackage . getTreeListener ( ) . getJTree ( ) . setSelectionRow ( 1 ) ; Save save = ( ( Save ) ( ActionRouter . getInstance ( ) . getAction ( "save" , "org.apache.jmeter.gui.action.Save" ) ) ) ; save . setTestPlanFile ( null ) ; ActionRouter . getInstance ( ) . actionPerformed ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , CheckDirty . ADD_ALL ) ) ; } }

Fix:
ActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , Save . SAVE ) ) ;
Buggy code:
public class SobolSequenceGenerator implements RandomVectorGenerator { private static final int BITS = 52 ; private static final double SCALE = FastMath . pow ( 2 , SobolSequenceGenerator . BITS ) ; private static final int MAX_DIMENSION = 1000 ; private static final String RESOURCE_NAME = "//assets//org//apache//commons//math3//random//new-joe-kuo-6.1000" ; private final int dimension ; private int count = 0 ; private final long [ ] [ ] direction ; private final long [ ] x ; public SobolSequenceGenerator ( final int dimension ) throws OutOfRangeException { } public SobolSequenceGenerator ( final int dimension , final InputStream is ) throws IOException , MathParseException , NotStrictlyPositiveException { } private int initFromStream ( final InputStream is ) throws IOException , MathParseException { } private void initDirectionVector ( final int d , final int a , final int [ ] m ) { } public double [ ] nextVector ( ) { } public double [ ] skipTo ( final int index ) throws NotPositiveException { if ( index == 0 ) { Arrays . fill ( x , 0 ) ; } else { final int i = index - 1 ; <START_BUG> final long grayCode = i ^ ( i // 2 ) ; <END_BUG> for ( int j = 0 ; j < ( dimension ) ; j ++ ) { long result = 0 ; for ( int k = 1 ; k <= ( SobolSequenceGenerator . BITS ) ; k ++ ) { final long shift = grayCode > > ( k - 1 ) ; if ( shift == 0 ) { break ; } final long ik = shift & 1 ; result ^= ik * ( direction [ j ] [ k ] ) ; } x [ j ] = result ; } } count = index ; return nextVector ( ) ; } public int getNextIndex ( ) { } }

Fix:
final long grayCode = i ^ ( i > > 1 ) ;
Buggy code:
public class AptanaDB { private static final String DATABASE_NAME = "aptanaDB" ; private static final String DRIVER = "org.apache.derby.jdbc.EmbeddedDriver" ; private static final String PROTOCOL = "jdbc:derby:" ; private static AptanaDB INSTANCE ; private boolean _driverLoaded ; private AptanaDB ( ) { } public static AptanaDB getInstance ( ) { } public void execute ( String query ) { } public void execute ( String query , IResultSetHandler handler ) { } public Connection getConnection ( ) { } public void shutdown ( ) { if ( _driverLoaded ) { try { DriverManager . getConnection ( ( ( ( AptanaDB . PROTOCOL ) + ( AptanaDB . DATABASE_NAME ) ) + ";shutdown=true" ) ) ; } catch ( SQLException e ) { if ( ( ( ( e . getErrorCode ( ) ) != 45000 ) && ( ! ( "XJ015" . equals ( e . getSQLState ( ) ) ) ) ) && ( ! ( "08006" . equals ( e . getSQLState ( ) ) ) ) ) { <START_BUG> IdeLog . logError ( UsagePlugin . getDefault ( ) , AptanaDB_ErrorShutdown , e ) ; <END_BUG> } } } } public static boolean tableExists ( String tableName ) { } private void loadDriver ( ) { } }

Fix:
IdeLog . logWarning ( UsagePlugin . getDefault ( ) , AptanaDB_ErrorShutdown , e ) ;
Buggy code:
public class ArrayExpression extends ExpressionImpl { private final Object [ ] _values ; public ArrayExpression ( Object [ ] values ) { } @ Override public String asExpression ( AliasContext ctx ) { <START_BUG> StringBuffer tmp = new StringBuffer ( OPEN_BRACE ) ; <END_BUG> for ( int i = 0 ; i < ( _values . length ) ; i ++ ) { Object v = _values [ i ] ; tmp . append ( ( v instanceof Visitable ? ( ( Visitable ) ( v ) ) . asExpression ( ctx ) : JPQLHelper . toJPQL ( ctx , v ) ) ) . append ( ( i == ( ( _values . length ) - 1 ) ? EMPTY : ( COMMA ) + ( SPACE ) ) ) ; } tmp . append ( CLOSE_BRACE ) ; return tmp . toString ( ) ; } @ Override public String asProjection ( AliasContext ctx ) { } }

Fix:
StringBuilder tmp = new StringBuilder ( OPEN_BRACE ) ;
Buggy code:
public interface AuthDao { Account getAdminAccount ( ) { } Account getAccountById ( Long id ) { } Account getAccountByKeys ( String access , String secretKey ) { } <START_BUG> Account getAccountByExternalId ( String externalId , String exteralType ) ; <END_BUG> Account getAccountByUuid ( String uuid ) { } Account createAccount ( String name , String kind , String externalId , String externalType ) { } Identity getIdentity ( Long id ) { } Account createProject ( String name , String description ) { } void updateAccount ( Account account , String name , String kind , String externalId , String externalType ) { } List < Account > getAccessibleProjects ( Set < Identity > identitySet , boolean isAdmin , Long usingAccount ) { } boolean hasAccessToProject ( long projectId , Long usingAccount , boolean isAdmin , Set < Identity > identitySet ) { } boolean isProjectOwner ( long projectId , Long usingAccount , boolean isAdmin , Set < Identity > identitySet ) { } boolean isProjectMember ( long projectId , Long usingAccount , boolean isAdmin , Set < Identity > identitySet ) { } List < ? extends ProjectMember > getActiveProjectMembers ( long projectId ) { } List < ? extends ProjectMember > getProjectMembersByIdentity ( long projectId , Set < Identity > identities ) { } ProjectMember getProjectMember ( long id ) { } boolean hasAccessToAnyProject ( Set < Identity > identities , boolean isAdmin , Long usingAccount ) { } List < ? extends ProjectMember > setProjectMembers ( final Account project , final Set < Member > membersTransformed ) { } ProjectMember createProjectMember ( Account project , Member member ) { } void ensureAllProjectsHaveNonRancherIdMembers ( Identity identity ) { } List < Account > searchUsers ( String name ) { } Account getByUsername ( String username ) { } Account getAccountByLogin ( String publicValue , String secretValue ) { } }

Fix:
Account getAccountByExternalId ( String externalId , String externalType ) ;
Buggy code:
public class TLSSyslogServer extends TCPSyslogServer { private static final Logger LOGGER = Logger . getLogger ( TLSSyslogServer . class ) ; private SSLContext sslContext ; @ Override public void initialize ( ) throws SyslogRuntimeException { super . initialize ( ) ; Security . removeProvider ( "BC" ) ; final SSLTCPNetSyslogServerConfigIF config = ( ( SSLTCPNetSyslogServerConfigIF ) ( this . tcpNetSyslogServerConfig ) ) ; try { final char [ ] keystorePwd = config . getKeyStorePassword ( ) . toCharArray ( ) ; final KeyStore keystore = TLSSyslogServer . loadKeyStore ( config . getKeyStore ( ) , keystorePwd ) ; final char [ ] truststorePassword = config . getTrustStorePassword ( ) . toCharArray ( ) ; final KeyStore truststore = TLSSyslogServer . loadKeyStore ( config . getTrustStore ( ) , truststorePassword ) ; final KeyManagerFactory keyManagerFactory = KeyManagerFactory . getInstance ( KeyManagerFactory . getDefaultAlgorithm ( ) ) ; keyManagerFactory . init ( keystore , keystorePwd ) ; final TrustManagerFactory trustManagerFactory = TrustManagerFactory . getInstance ( TrustManagerFactory . getDefaultAlgorithm ( ) ) ; trustManagerFactory . init ( truststore ) ; sslContext = SSLContext . getInstance ( "TLS" ) ; sslContext . init ( keyManagerFactory . getKeyManagers ( ) , trustManagerFactory . getTrustManagers ( ) , null ) ; } catch ( Exception e ) { <START_BUG> TLSSyslogServer . LOGGER . error ( "Exception<seq2seq4repair_space>occured<seq2seq4repair_space>during<seq2seq4repair_space>SSLContext<seq2seq4repair_space>for<seq2seq4repair_space>TLS<seq2seq4repair_space>syslog<seq2seq4repair_space>server<seq2seq4repair_space>initialization" , e ) ; <END_BUG> throw new SyslogRuntimeException ( e ) ; } } @ Override protected ServerSocketFactory getServerSocketFactory ( ) throws IOException { } private static KeyStore loadKeyStore ( final String keystoreFile , final char [ ] keystorePwd ) throws IOException , KeyStoreException , NoSuchAlgorithmException , CertificateException { } }

Fix:
TLSSyslogServer . LOGGER . error ( "Exception<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>SSLContext<seq2seq4repair_space>for<seq2seq4repair_space>TLS<seq2seq4repair_space>syslog<seq2seq4repair_space>server<seq2seq4repair_space>initialization" , e ) ;
Buggy code:
public class TestFieldCache extends LuceneTestCase { protected IndexReader reader ; private static final int NUM_DOCS = 1000 ; public TestFieldCache ( String s ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; RAMDirectory directory = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; long theLong = Long . MAX_VALUE ; double theDouble = Double . MAX_VALUE ; byte theByte = Byte . MAX_VALUE ; short theShort = Short . MAX_VALUE ; int theInt = Integer . MAX_VALUE ; float theFloat = Float . MAX_VALUE ; for ( int i = 0 ; i < ( TestFieldCache . NUM_DOCS ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( "theLong" , String . valueOf ( ( theLong -- ) ) , Store . NO , Index . NOT_ANALYZED ) ) ; doc . add ( new org . apache . lucene . document . Field ( "theDouble" , String . valueOf ( ( theDouble -- ) ) , Store . NO , Index . NOT_ANALYZED ) ) ; doc . add ( new org . apache . lucene . document . Field ( "theByte" , String . valueOf ( ( theByte -- ) ) , Store . NO , Index . NOT_ANALYZED ) ) ; doc . add ( new org . apache . lucene . document . Field ( "theShort" , String . valueOf ( ( theShort -- ) ) , Store . NO , Index . NOT_ANALYZED ) ) ; doc . add ( new org . apache . lucene . document . Field ( "theInt" , String . valueOf ( ( theInt -- ) ) , Store . NO , Index . NOT_ANALYZED ) ) ; doc . add ( new org . apache . lucene . document . Field ( "theFloat" , String . valueOf ( ( theFloat -- ) ) , Store . NO , Index . NOT_ANALYZED ) ) ; writer . addDocument ( doc ) ; } writer . close ( ) ; <START_BUG> reader = IndexReader . open ( directory ) ; <END_BUG> } public void testInfoStream ( ) throws Exception { } public void test ( ) throws IOException { } }

Fix:
reader = IndexReader . open ( directory , true ) ;
Buggy code:
public class TCLogParser implements LogParser { static Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String GET = "GET" ; public static final String POST = "POST" ; protected String RMETHOD = null ; protected String URL_PATH = null ; protected boolean useFILE = true ; protected File SOURCE = null ; protected String FILENAME = null ; protected BufferedReader READER = null ; protected Filter FILTER = null ; public TCLogParser ( ) { } public TCLogParser ( String source ) { } public void setUseParsedFile ( boolean file ) { } public void setFilter ( Filter filter ) { } public void setSourceFile ( String source ) { } public File openFile ( String filename ) { } public int parse ( TestElement el , int parseCount ) { if ( ( this . SOURCE ) == null ) { this . SOURCE = this . openFile ( this . FILENAME ) ; } try { if ( ( this . READER ) == null ) { this . READER = new BufferedReader ( new FileReader ( this . SOURCE ) ) ; } return parse ( this . READER , el , parseCount ) ; } catch ( Exception exception ) { TCLogParser . log . error ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>samples" , exception ) ; } <START_BUG> return 0 ; <END_BUG> } public int parseAndConfigure ( int count , TestElement el ) { } protected int parse ( BufferedReader breader , TestElement el , int parseCount ) { } protected int parseLine ( String line , TestElement el ) { } private void createUrl ( String line , TestElement el ) { } public String cleanURL ( String entry ) { } public boolean checkMethod ( String text ) { } public String stripFile ( String url , TestElement el ) { } public boolean checkURL ( String url ) { } public boolean checkParamFormat ( String text ) { } public void convertStringToJMRequest ( String text , TestElement el ) { } public NVPair [ ] convertStringtoNVPair ( String stringparams ) { } protected NVPair parseOneParameter ( String parameter ) { } protected Vector parseParameters ( String parameters ) { } public StringTokenizer tokenize ( String line , String delim ) { } public void close ( ) { } public static class Test extends JMeterTestCase { private static final TCLogParser tclp = new TCLogParser ( ) ; private static final String URL1 = "127.0.0.1<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>[08//Jan//2003:07:03:54<seq2seq4repair_space>-0500]<seq2seq4repair_space>\"GET<seq2seq4repair_space>//addrbook//<seq2seq4repair_space>HTTP//1.1\"<seq2seq4repair_space>200<seq2seq4repair_space>1981" ; private static final String URL2 = "127.0.0.1<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>[08//Jan//2003:07:03:54<seq2seq4repair_space>-0500]<seq2seq4repair_space>\"GET<seq2seq4repair_space>//addrbook?x=y<seq2seq4repair_space>HTTP//1.1\"<seq2seq4repair_space>200<seq2seq4repair_space>1981" ; public void testConstruct ( ) throws Exception { } public void testcleanURL ( ) throws Exception { } public void testcheckURL ( ) throws Exception { } } }

Fix:
return - 1 ;
Buggy code:
public class ModClusterRemoveProxy implements OperationStepHandler , DescriptionProvider { static final ModClusterRemoveProxy INSTANCE = new ModClusterRemoveProxy ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "remove-proxy:<seq2seq4repair_space>%s" , operation ) ; Proxy proxy = new Proxy ( operation ) ; modcluster . removeProxy ( proxy . host , proxy . port ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class ModuleDependencyProcessor implements DeploymentUnitProcessor { public static final long PRIORITY = MODULE_DEPENDENCIES . plus ( 100L ) ; public void processDeployment ( DeploymentUnitContext context ) throws DeploymentUnitProcessingException { final Manifest manifest = ManifestAttachment . getManifestAttachment ( context ) ; if ( manifest == null ) return ; final String dependencyString = manifest . getMainAttributes ( ) . getValue ( "Dependencies" ) ; if ( dependencyString == null ) return ; final String [ ] dependencyDefs = dependencyString . split ( "," ) ; for ( String dependencyDef : dependencyDefs ) { final String [ ] dependencyParts = dependencyDef . split ( "<seq2seq4repair_space>" ) ; final int dependencyPartsLength = dependencyParts . length ; if ( dependencyPartsLength == 0 ) throw new RuntimeException ( ( "Invalid<seq2seq4repair_space>dependency:<seq2seq4repair_space>" + dependencyString ) ) ; final ModuleIdentifier dependencyId = ModuleIdentifier . fromString ( dependencyParts [ 0 ] ) ; boolean export = parseOptionalExportParams ( dependencyParts , "export" ) ; <START_BUG> boolean optional = parseOptionalExportParams ( dependencyParts , "export" ) ; <END_BUG> ModuleConfig . Dependency dependency = new ModuleConfig . Dependency ( dependencyId , true , optional , export ) ; ModuleDependencies . addDependency ( context , dependency ) ; } } private boolean parseOptionalExportParams ( final String [ ] parts , final String expected ) { } }

Fix:
boolean optional = parseOptionalExportParams ( dependencyParts , "optional" ) ;
Buggy code:
public class Htmldata { public String workingDir = "" ; public String HtmlfilesPath = "" ; public String username = "" ; public String reponame = "" ; public String HtmlFolderPath = "C:////apache-tomcat-7.0.59-windows-x64////apache-tomcat-7.0.59////webapps////unusualenhanced" ; public void initiate ( String username1 , String reponame1 ) { workingDir = System . getProperty ( "user.dir" ) ; workingDir = workingDir . replace ( "\\" , "////" ) ; <START_BUG> HtmlfilesPath = ( workingDir ) + "////src////html////" ; <END_BUG> username = username1 ; reponame = reponame1 ; } public void addheader ( StringBuilder sb ) throws IOException { } public void addfooter ( StringBuilder sb ) throws IOException { } public void addend ( StringBuilder sb ) throws IOException { } public void addtag ( StringBuilder sb , String [ ] fil ) throws IOException { } public void createhtml ( File data ) throws IOException { } }

Fix:
HtmlfilesPath = "C:////Users////Raman<seq2seq4repair_space>Workstation////workspace////UnusualGitCommit////src////html////" ;
Buggy code:
public class MutableBoolean implements Serializable , Comparable < MutableBoolean > , Mutable < Boolean > { private static final long serialVersionUID = - 4830728138360036487L ; private boolean value ; public MutableBoolean ( ) { } public MutableBoolean ( final boolean value ) { } public MutableBoolean ( final Boolean value ) { } @ Override public Boolean getValue ( ) { } public void setValue ( final boolean value ) { } @ Override public void setValue ( final Boolean value ) { } public boolean isTrue ( ) { } public boolean isFalse ( ) { } public boolean booleanValue ( ) { } public Boolean toBoolean ( ) { } @ Override public boolean equals ( final Object obj ) { } @ Override public int hashCode ( ) { } @ Override public int compareTo ( final MutableBoolean other ) { <START_BUG> boolean anotherVal = other . value ; <END_BUG> return ( value ) == anotherVal ? 0 : value ? 1 : - 1 ; } @ Override public String toString ( ) { } }

Fix:
final boolean anotherVal = other . value ;
Buggy code:
public class ModClusterRefresh implements OperationStepHandler , DescriptionProvider { static final ModClusterRefresh INSTANCE = new ModClusterRefresh ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; modcluster . refresh ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class RelationalExpression extends TranslationVisitor { private RelationalExpression relationalExpression ; private String relationalOperator ; private ShiftExpression shiftExpression ; public RelationalExpression ( GNode n ) { } <START_BUG> public void visitRelationalExpression ( Gnode n ) { <END_BUG> relationalExpression = new RelationalExpression ( n ) ; } public void visitSymbol ( GNode n ) { } public void visitShiftExpression ( GNode n ) { } }

Fix:
public void visitRelationalExpression ( GNode n ) {
Buggy code:
public class Script extends Task { private String script = "" ; private Hashtable beans = new Hashtable ( ) ; private String language ; public void setLanguage ( String language ) { } public void setSrc ( String fileName ) { } public void addContent ( String text ) { } public void execute ( ) throws TaskException { try { addBeans ( getProject ( ) . getProperties ( ) ) ; <START_BUG> beans . put ( "project" , getProject ( ) ) ; <END_BUG> beans . put ( "self" , this ) ; BSFManager manager = new BSFManager ( ) ; for ( Iterator e = beans . keys ( ) ; e . hasNext ( ) ; ) { String key = ( ( String ) ( e . next ( ) ) ) ; Object value = beans . get ( key ) ; manager . declareBean ( key , value , value . getClass ( ) ) ; } manager . exec ( language , "<ANT>" , 0 , 0 , script ) ; } catch ( BSFException be ) { Throwable t = be ; Throwable te = be . getTargetException ( ) ; if ( te != null ) { if ( te instanceof TaskException ) { throw ( ( TaskException ) ( te ) ) ; } else { t = te ; } } throw new TaskException ( "Error" , t ) ; } } private void addBeans ( Hashtable dictionary ) { } }

Fix:
beans . put ( "context" , getContext ( ) ) ;
Buggy code:
public class EditorTest extends TestCase { IEditorService editor ; Staff user ; public EditorTest ( String name ) { } public static Test suite ( ) { } public void setUp ( ) { } public void testCreation ( ) { <START_BUG> assertTrue ( ( ( editor . getClass ( ) ) == ( IEditorService . class ) ) ) ; <END_BUG> assertTrue ( user . equals ( editor . getUser ( ) ) ) ; } }

Fix:
assertTrue ( ( ( editor ) instanceof IEditorService ) ) ;
Buggy code:
public class Recycler < RecyclableObject extends Recyclable > { public static final int MIN_RECYCLABLES = 100 ; private ArrayList < RecyclableObject > recyclables ; private Class recyclableClass ; public Recycler ( int minRecyclables , Class cls ) { } public Recycler ( Class cls ) { } public void trackRecyclable ( RecyclableObject obj ) { } public RecyclableObject getRecyclable ( Object ... args ) { } public RecyclableObject getRecyclable ( Class cls , Object ... args ) { for ( RecyclableObject r : recyclables ) { if ( r . isSafeToRecycle ( ) ) { r . onRecycle ( args ) ; return r ; } } try { <START_BUG> RecyclableObject obj = ( ( RecyclableObject ) ( recyclableClass . newInstance ( ) ) ) ; <END_BUG> obj . onRecycle ( args ) ; recyclables . add ( obj ) ; return obj ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; } }

Fix:
RecyclableObject obj = ( ( RecyclableObject ) ( cls . newInstance ( ) ) ) ;
Buggy code:
public class HandleConnections implements Runnable { private Socket client ; private HTTP http ; private final String webroot = Config . getWebroot ( ) ; private final String errorPage = Config . getErrorPage ( ) ; public static final Object LOCK = new Object ( ) ; @ Override public void run ( ) { Print . deb ( ( "NEUER<seq2seq4repair_space>THREAD:<seq2seq4repair_space>" + ( Thread . currentThread ( ) ) ) ) ; Print . deb ( ( ( ( ( ( ( Thread . currentThread ( ) ) + "<seq2seq4repair_space>Neue<seq2seq4repair_space>Verbindung!<seq2seq4repair_space>IP:<seq2seq4repair_space>'" ) + ( client . getInetAddress ( ) ) ) + "'<seq2seq4repair_space>Port:<seq2seq4repair_space>'" ) + ( client . getPort ( ) ) ) + "'" ) ) ; String empfang = "" ; try { empfang = TCP . recv ( client ) ; } catch ( IOException e ) { Print . err ( ( ( ( ( Thread . currentThread ( ) ) + "<seq2seq4repair_space>Empfangen<seq2seq4repair_space>der<seq2seq4repair_space>Daten<seq2seq4repair_space>von<seq2seq4repair_space>" ) + ( client . getInetAddress ( ) ) ) + "<seq2seq4repair_space>fehlgeschlagen!" ) ) ; e . printStackTrace ( ) ; return ; } catch ( NoSuchElementException e2 ) { Print . deberr ( ( ( ( ( Thread . currentThread ( ) ) + "<seq2seq4repair_space>Empfangen<seq2seq4repair_space>der<seq2seq4repair_space>Daten<seq2seq4repair_space>von<seq2seq4repair_space>" ) + ( client . getInetAddress ( ) ) ) + "<seq2seq4repair_space>fehlgeschlagen!" ) ) ; return ; } Print . deb ( ( ( ( ( ( Thread . currentThread ( ) ) + "<seq2seq4repair_space>Empfangene<seq2seq4repair_space>Daten:<seq2seq4repair_space>'" ) + empfang ) + "'<seq2seq4repair_space>von<seq2seq4repair_space>" ) + ( client . getInetAddress ( ) ) ) ) ; if ( empfang == "" ) { Print . deb ( ( ( Thread . currentThread ( ) ) + "Es<seq2seq4repair_space>wurde<seq2seq4repair_space>nichts<seq2seq4repair_space>gesendet!" ) ) ; http . error ( client , SYNTAX_ERROR , Thread . currentThread ( ) ) ; } String [ ] split = null ; try { split = empfang . split ( "<seq2seq4repair_space>" ) ; if ( split [ 0 ] . equalsIgnoreCase ( "GET" ) ) { http . get ( client , split , Thread . currentThread ( ) ) ; } else <START_BUG> if ( split [ 1 ] . equalsIgnoreCase ( "POST" ) ) { <END_BUG> Print . deb ( "POST<seq2seq4repair_space>REQEST!" ) ; } else { Print . deb ( ( ( Thread . currentThread ( ) ) + "Es<seq2seq4repair_space>wurde<seq2seq4repair_space>ein<seq2seq4repair_space>unbekannter<seq2seq4repair_space>HTTP-Request<seq2seq4repair_space>gesendet!" ) ) ; http . error ( client , SYNTAX_ERROR , Thread . currentThread ( ) ) ; } } catch ( PatternSyntaxException e ) { Print . deb ( ( ( Thread . currentThread ( ) ) + "Es<seq2seq4repair_space>wurde<seq2seq4repair_space>kein<seq2seq4repair_space>HTTP-Request<seq2seq4repair_space>gesendet!" ) ) ; http . error ( client , SYNTAX_ERROR , Thread . currentThread ( ) ) ; } try { client . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public HandleConnections ( Socket client ) throws SocketException { } }

Fix:
if ( split [ 0 ] . equalsIgnoreCase ( "POST" ) ) {
Buggy code:
public interface Serializer < T > extends Serializable { byte [ ] serialize ( T obj ) { } <START_BUG> Object deserialize ( byte [ ] b ) ; <END_BUG> }

Fix:
T deserialize ( byte [ ] b ) ;
Buggy code:
public class Main extends Application { private BorderPane layout ; private GridPane summary ; private Button login ; private TextField user ; private PasswordField password ; private Label userLabel ; private Label passwordLabel ; @ Override public void start ( Stage primaryStage ) throws Exception { InetAddress checkConn = InetAddress . getByName ( "159.203.0.22" ) ; if ( ! ( checkConn . isReachable ( 9001 ) ) ) { Alert alert = new Alert ( Alert . AlertType . ERROR ) ; alert . setTitle ( "No<seq2seq4repair_space>Internet<seq2seq4repair_space>Connection" ) ; alert . setHeaderText ( null ) ; alert . setContentText ( "\nCannot<seq2seq4repair_space>continue<seq2seq4repair_space>without<seq2seq4repair_space>an<seq2seq4repair_space>internet<seq2seq4repair_space>connection.\n" ) ; alert . showAndWait ( ) ; System . exit ( 69 ) ; } Parent root = FXMLLoader . load ( getClass ( ) . getResource ( "sample.fxml" ) ) ; primaryStage . setTitle ( "TeamHype" ) ; <START_BUG> primaryStage . setScene ( new Scene ( root , 800 , 600 ) ) ; <END_BUG> primaryStage . show ( ) ; } private void getDependencies ( Group group ) { } public static void main ( String [ ] args ) { } }

Fix:
primaryStage . setScene ( new Scene ( root ) ) ;
Buggy code:
public class StringLiteralNode extends LirNode { private String stringLiteral ; private Label stringLabel ; public StringLiteralNode ( String stringLiteral , LabelGenerator labelGen ) { } @ Override public String emit ( ) { <START_BUG> return String . format ( "%s:<seq2seq4repair_space>\"%s\"" , stringLabel , stringLiteral ) ; <END_BUG> } }

Fix:
return String . format ( "%s:<seq2seq4repair_space>%s" , stringLabel , stringLiteral ) ;
Buggy code:
public class XpandComponent extends AbstractExpressionsUsingWorkflowComponent { private String _genPath = null ; private String _srcPath = null ; private String _expand = null ; private String _fileEncoding = null ; private boolean _automaticHyphens = false ; private Output _output = null ; private final List < Outlet > _outlets = new ArrayList < Outlet > ( ) ; private List < PostProcessor > _postprocessors = new ArrayList < PostProcessor > ( ) ; private List < Outlet > _initializedOutlets = new ArrayList < Outlet > ( ) ; public List < PostProcessor > getBeautifier ( ) { } public void addBeautifier ( PostProcessor beautifier ) { } public List < PostProcessor > getPostprocessors ( ) { } public void addPostprocessor ( PostProcessor postprocessor ) { } public void setAutomaticHyphens ( boolean automaticHyphens ) { } @ Override public String getLogMessage ( ) { } public void setFileEncoding ( final String fileEncoding ) { } public String getFileEncoding ( ) { } public void setExpand ( String invoke ) { } @ Deprecated public void setGenPath ( final String genPath ) { } @ Deprecated public void setSrcPath ( final String srcPath ) { } private String fixPath ( final String p ) { } @ Override protected void invokeInternal2 ( WorkflowContext wfContext , ProgressMonitor monitor , Issues issues ) { XpandExecutionContextImpl executionContext = new XpandExecutionContextImpl ( getOutput ( ) , null , getGlobalVars ( wfContext ) , null , getNullEvaluationHandler ( ) ) ; if ( ( _fileEncoding ) != null ) executionContext . setFileEncoding ( _fileEncoding ) ; final String code = ( ( ( XpandTokens . LT ) + "EXPAND<seq2seq4repair_space>" ) + ( _expand ) ) + ( XpandTokens . RT ) ; final Map < String , Object > variables = new HashMap < String , Object > ( ) ; for ( String name : wfContext . getSlotNames ( ) ) variables . put ( name , wfContext . get ( name ) ) ; <START_BUG> XpandBackendFacade . executeStatement ( code , code , metaModels , variables , _outlets , _advice ) ; <END_BUG> } public void addOutlet ( Outlet outlet ) { } public void setOutput ( Output output ) { } private Output getOutput ( ) { } private List < Outlet > getInitializedOutlets ( ) { } private ExpandStatement getStatement ( ) { } @ Override public void checkConfiguration ( final Issues issues ) { } }

Fix:
XpandBackendFacade . executeStatement ( code , _fileEncoding , metaModels , variables , _outlets , _advice ) ;
Buggy code:
public class MacGenerator { String [ ] xmls ; Document [ ] documents ; String outputDir ; String mainClassName ; PrintStream out ; public MacGenerator ( String [ ] xmls ) { } public void generateAll ( ) { } void generateClasses ( ) { } void generateExtraAttributes ( ) { } void generateMainClass ( ) { } void generateMetadata ( ) { } public Document [ ] getDocuments ( ) { } public String [ ] getXmls ( ) { } private Hashtable loadExtraAttributes ( String xmlPath ) { } private void saveExtraAttributes ( String xmlPath , Document document ) { } public void setOutputDir ( String dir ) { } public void setMainClass ( String mainClassName ) { } private Document getDocument ( String xmlPath ) { } public String [ ] getExtraAttributeNames ( ) { } public String getFileName ( String xmlPath ) { } private String getKey ( Node node ) { } public Node getIDAttribute ( Node node ) { NamedNodeMap attributes = node . getAttributes ( ) ; if ( attributes == null ) return null ; String [ ] names = getIDAttributeNames ( ) ; for ( int i = 0 ; i < ( names . length ) ; i ++ ) { <START_BUG> Node nameAttrib = attributes . getNamedItem ( "name" ) ; <END_BUG> if ( nameAttrib != null ) return nameAttrib ; } return null ; } public String [ ] getIDAttributeNames ( ) { } void merge ( Document document , Node node , Hashtable extras ) { } private void out ( String str ) { } private void outln ( ) { } void generateConstants ( ) { } void generateConstantsMetaData ( ) { } void generateEnums ( ) { } boolean isStruct ( Node node ) { } boolean isFloatingPoint ( Node node ) { } boolean isObject ( Node node ) { } boolean isBoolean ( Node node ) { } String getExtraAttributesDir ( ) { } void buildExtrasLookup ( Node node , Hashtable table ) { } boolean isUnique ( Node method , NodeList methods ) { } void generateSelectorsConst ( ) { } void generateSends ( ) { } void generateSendsMetaData ( ) { } String getSelConst ( String sel ) { } void generateClassesConst ( ) { } void generateProtocolsConst ( ) { } Node getReturnNode ( NodeList list ) { } String getType ( Node node ) { } String getJNIType ( Node node ) { } String getJavaType ( Node node ) { } void generateFunctions ( ) { } boolean compare ( InputStream is1 , InputStream is2 ) throws IOException { } void output ( byte [ ] bytes , String fileName ) throws IOException { } public static void main ( String [ ] args ) { } }

Fix:
Node nameAttrib = attributes . getNamedItem ( names [ i ] ) ;
Buggy code:
public class PeerListFragment extends Fragment implements StudentFragment { private final List < Peer > peerList = new ArrayList < > ( ) ; private final PeerAdapter adapter = new PeerAdapter ( peerList ) ; private RecyclerView recyclerView ; private SwipeRefreshLayout refreshLayout ; private Comparator < Student > comparator ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void sortBy ( Comparator < Student > comparator ) { this . comparator = comparator ; Collections . sort ( peerList , comparator ) ; <START_BUG> adapter . notifyDataSetChanged ( ) ; <END_BUG> } @ Override public void filter ( String text ) { } @ Override public void scrollToTop ( ) { } private final class ListUpdater extends AsyncTask < Void , Void , Void > { @ Override protected Void doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( Void result ) { } } }

Fix:
adapter . setModel ( peerList ) ;
Buggy code:
public class OpenAttachmentCommand extends SaveAttachmentCommand { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.gui.message.attachment.command" ) ; private File tempFile ; private boolean inline = false ; private TempFolder tempFolder ; private Object tempMessageUid ; private MimeHeader header ; public OpenAttachmentCommand ( ICommandReference reference ) { } public void updateGUI ( ) throws Exception { if ( ( header . getMimeType ( ) . getType ( ) . toLowerCase ( ) . indexOf ( "message" ) ) != ( - 1 ) ) { MessageFrameController c = new MessageFrameController ( ) ; new org . columba . core . gui . frame . DefaultContainer ( c ) ; Object [ ] uidList = new Object [ 1 ] ; uidList [ 0 ] = tempMessageUid ; MailFolderCommandReference r = new MailFolderCommandReference ( tempFolder , uidList ) ; c . setTreeSelection ( r ) ; c . setTableSelection ( r ) ; CommandProcessor . getInstance ( ) . addOp ( new ViewMessageCommand ( c , r ) ) ; } else { try { Desktop . open ( tempFile ) ; } catch ( DesktopException e ) { <START_BUG> JOptionPane . showMessageDialog ( null , GlobalResourceLoader . getString ( "dialog" , "error" , "no_viewer" ) , "Error" , JOptionPane . ERROR_MESSAGE ) ; <END_BUG> File saveToFile = getDestinationFile ( header ) ; if ( saveToFile . exists ( ) ) saveToFile . delete ( ) ; tempFile . renameTo ( saveToFile ) ; } } } public void execute ( WorkerStatusController worker ) throws Exception { } protected File getDestinationFile ( MimeHeader header ) { } }

Fix:
JOptionPane . showMessageDialog ( null , GlobalResourceLoader . getString ( "org.columba.core.i18n.dialog" , "error" , "no_viewer" ) , "Error" , JOptionPane . ERROR_MESSAGE ) ;
Buggy code:
public class HistogramTest { Histogram hst ; @ Before public void setup ( ) { } @ Test public void testStringForBin ( ) { assertEquals ( DEFAULT_WIDTH , Histogram . stringForBin ( 50 , 10 , DEFAULT_WIDTH ) . length ( ) ) ; assertEquals ( 50 , binLength ( Histogram . stringForBin ( 50 , 100 , 100 ) ) ) ; <START_BUG> assertEquals ( 14 , binLength ( Histogram . stringForBin ( 50 , 100 , 30 ) ) ) ; <END_BUG> assertEquals ( 27 , binLength ( Histogram . stringForBin ( 72 , 80 , 30 ) ) ) ; } @ Test public void testHistogram ( ) { } private int binLength ( String bin ) { } }

Fix:
assertEquals ( 15 , binLength ( Histogram . stringForBin ( 50 , 100 , 30 ) ) ) ;
Buggy code:
public abstract class ProjectComponent { protected Project project ; public ProjectComponent ( ) { } public void setProject ( Project project ) { } public Project getProject ( ) { } public void log ( String msg ) { } public void log ( String msg , int msgLevel ) { if ( ( project ) != null ) { project . log ( msg , msgLevel ) ; } else { <START_BUG> if ( msgLevel >= ( Project . MSG_INFO ) ) { <END_BUG> System . err . println ( msg ) ; } } } }

Fix:
if ( msgLevel <= ( Project . MSG_INFO ) ) {
Buggy code:
public class AjStateTest extends TestCase { private AjState aRightState ; private AjBuildConfig oldConfig ; private AjBuildConfig newConfig ; public void testNoChange ( ) { } public void testAddEntryToClasspath ( ) { } public void testRemoveEntryFromClasspath ( ) { } public void testReorderClasspath ( ) { } public void testAddEntryToAspectpath ( ) { } public void testRemoveEntryFromAspectpath ( ) { } public void testReorderAspectpath ( ) { } public void testAddEntryToInpath ( ) { } public void testRemoveEntryFromInpath ( ) { } public void testReorderInpath ( ) { } public void testAddEntryToInjars ( ) { } public void testRemoveEntryFromInjars ( ) { } public void testReorderInjars ( ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; aRightState = new AjState ( null ) ; oldConfig = new AjBuildConfig ( ) ; newConfig = new AjBuildConfig ( ) ; List cp = new ArrayList ( ) ; cp . add ( "adir" ) ; cp . add ( "ajar.jar" ) ; oldConfig . setClasspath ( cp ) ; newConfig . setClasspath ( new ArrayList ( cp ) ) ; List ap = new ArrayList ( ) ; ap . add ( new File ( "aLib.jar" ) ) ; ap . add ( new File ( "anotherLib.jar" ) ) ; oldConfig . setAspectpath ( ap ) ; newConfig . setAspectpath ( new ArrayList ( ap ) ) ; List ip = new ArrayList ( ) ; ip . add ( new File ( "adir" ) ) ; ip . add ( new File ( "ajar.jar" ) ) ; oldConfig . setInPath ( ip ) ; newConfig . setInPath ( new ArrayList ( ip ) ) ; List ij = new ArrayList ( ) ; ij . add ( new File ( "aLib.jar" ) ) ; ij . add ( new File ( "anotherLib.jar" ) ) ; oldConfig . setInJars ( ij ) ; newConfig . setInJars ( new ArrayList ( ij ) ) ; aRightState . prepareForNextBuild ( oldConfig ) ; <START_BUG> aRightState . successfulCompile ( oldConfig ) ; <END_BUG> } }

Fix:
aRightState . successfulCompile ( oldConfig , true ) ;
Buggy code:
public class CompletionOnExceptionReference extends CompletionOnSingleTypeReference { public CompletionOnExceptionReference ( char [ ] source , long pos ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { <START_BUG> return output . append ( "<CompleteOnException:" ) . append ( token ) . append ( '>' ) ; <END_BUG> } }

Fix:
return output . append ( "<CompleteOnException:" ) . append ( this . token ) . append ( '>' ) ;
Buggy code:
public class ChannelOpenListenerService implements Service < Void > , OpenListener { private final InjectedValue < Endpoint > endpointValue = new InjectedValue < Endpoint > ( ) ; private final InjectedValue < ManagementOperationHandler > operationHandlerValue = new InjectedValue < ManagementOperationHandler > ( ) ; private final String channelName ; private final OptionMap optionMap ; private volatile Registration registration ; public ChannelOpenListenerService ( final String channelName , OptionMap optionMap ) { } public ServiceName getServiceName ( ) { } public InjectedValue < Endpoint > getEndpointInjector ( ) { } public InjectedValue < ManagementOperationHandler > getOperationHandlerInjector ( ) { } @ Override public Void getValue ( ) throws IllegalArgumentException , IllegalStateException { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public void channelOpened ( Channel channel ) { <START_BUG> final ManagementChannel protocolChannel = new ManagementChannelFactory ( ) . create ( channelName , channel ) ; <END_BUG> protocolChannel . startReceiving ( ) ; channel . addCloseHandler ( new org . jboss . remoting3 . CloseHandler < Channel > ( ) { @ Override public void handleClose ( Channel closed ) { protocolChannel . stopReceiving ( ) ; } } ) ; } @ Override public void registrationTerminated ( ) { } }

Fix:
final ManagementChannel protocolChannel = new org . jboss . as . protocol . mgmt . ManagementChannelFactory ( operationHandlerValue . getValue ( ) ) . create ( channelName , channel ) ;
Buggy code:
public class ManagerHandler extends ContextHandler { private static final Logger LOG = Log . getLogger ( ManagerHandler . class ) ; private final String baseURL ; private final Server server ; private final ContextHandlerCollection handlers ; private final ConnectorStatistics connectorStats ; private int noDataSets = 0 ; private long sizeDataSets = 0 ; private final String thumbnailsDirectoryName ; private long totalSentBytes = 0 ; private Buffer fifo = BufferUtils . synchronizedBuffer ( new CircularFifoBuffer ( ( 12 * 60 ) ) ) ; public ManagerHandler ( final String baseURL , final Server server , final ConnectorStatistics connectorStats , final StatisticsHandler statHandler , final ContextHandlerCollection handlers , final String thumbnailsDirectoryName ) throws IOException , URISyntaxException { } @ Override public void doHandle ( final String target , final Request baseRequest , final HttpServletRequest request , final HttpServletResponse response ) throws IOException , ServletException { } public String getByteSizeString ( final long size ) { } public void computeDatasetStat ( ) { } private void deploy ( final String datasetName , final String fileLocation , final Request baseRequest , final HttpServletResponse response ) throws IOException { } private void undeploy ( final String datasetName , final Request baseRequest , final HttpServletResponse response ) throws IOException { } private void getTraffic ( final int tf , final Request baseRequest , final HttpServletResponse response ) throws IOException { } private void getJsonTrafficData ( final int tf , final PrintWriter out ) throws IOException { } private void getDatasets ( final Request baseRequest , final HttpServletResponse response ) throws IOException { } private void getJsonDatasets ( final PrintWriter out ) throws IOException { final JsonWriter writer = new JsonWriter ( out ) ; writer . setIndent ( "\t" ) ; writer . beginObject ( ) ; writer . name ( "data" ) ; writer . beginArray ( ) ; for ( final Handler handler : server . getChildHandlersByClass ( CellHandler . class ) ) { final CellHandler contextHandler = ( ( CellHandler ) ( handler ) ) ; writer . beginObject ( ) ; <START_BUG> writer . name ( "active" ) . value ( true ) ; <END_BUG> writer . name ( "name" ) . value ( contextHandler . getContextPath ( ) . replaceFirst ( "//" , "" ) ) ; writer . name ( "path" ) . value ( contextHandler . getXmlFile ( ) ) ; writer . endObject ( ) ; } writer . endArray ( ) ; writer . endObject ( ) ; writer . flush ( ) ; writer . close ( ) ; } private void getServerInfo ( Request baseRequest , HttpServletResponse response ) throws IOException { } private void activateDataset ( String datasetName , String activated , Request baseRequest , HttpServletResponse response ) throws IOException { } }

Fix:
writer . name ( "active" ) . value ( contextHandler . isActive ( ) ) ;
Buggy code:
public class TimeFormatter { public static final String [ ] MONTH = new String [ ] { "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" } ; public static final String [ ] WEEK = new String [ ] { "Sun" , "Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" } ; public static final String [ ] MONTH_FULL = new String [ ] { "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" } ; public static final String [ ] WEEK_FULL = new String [ ] { "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" } ; private static TimeRaw timeRaw ; private TimeFormatter ( ) { } public static void register ( TimeLevelObserver observer ) { } public static void unregister ( TimeLevelObserver observer ) { } public static String getDate ( boolean full , boolean upper , String split ) { } public static String getMonth ( boolean full , boolean upper ) { <START_BUG> if ( ( ( TimeFormatter . timeRaw . getMonth ( ) ) < 1 ) || ( ( TimeFormatter . timeRaw . getMonth ( ) ) > 12 ) ) { <END_BUG> return "ERROR" ; } String monthStr ; if ( full ) { monthStr = TimeFormatter . MONTH_FULL [ TimeFormatter . timeRaw . getMonth ( ) ] ; } else { monthStr = TimeFormatter . MONTH [ TimeFormatter . timeRaw . getMonth ( ) ] ; } if ( upper ) { monthStr = monthStr . toUpperCase ( Locale . ENGLISH ) ; } return monthStr ; } public static String getDay ( boolean has2digits ) { } public static String getWeek ( boolean full , boolean upper ) { } public static boolean isAM ( ) { } public static String getAM ( boolean upper ) { } public static String getHour ( boolean is24 ) { } public static String getMinute ( ) { } public static String getSecond ( ) { } public static String getTime ( boolean is24 , boolean showSecond , String split ) { } }

Fix:
if ( ( ( TimeFormatter . timeRaw . getMonth ( ) ) < 0 ) || ( ( TimeFormatter . timeRaw . getMonth ( ) ) > 11 ) ) {
Buggy code:
public class DataGraphSharingManager implements IDataGraphSharingManager { public synchronized IDataGraphSharing getInstance ( ISharedObjectContainer container ) throws ECFException { ISharedObjectManager mgr = container . getSharedObjectManager ( ) ; <START_BUG> ID id = IDFactory . makeStringID ( DATA_GRAPH_SHARING_ID ) ; <END_BUG> DataGraphSharing result = ( ( DataGraphSharing ) ( mgr . getSharedObject ( id ) ) ) ; if ( result == null ) { result = new DataGraphSharing ( ) ; mgr . addSharedObject ( id , result , null ) ; } return result ; } }

Fix:
ID id = IDFactory . getDefault ( ) . makeStringID ( DATA_GRAPH_SHARING_ID ) ;