nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ModuleJndiBindingProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } protected void addJndiBinding ( final EEModuleDescription module , final String componentName , final BindingDescription bindingDescription , final DeploymentPhaseContext phaseContext , final JndiInjectionPointStore injectionPointStore ) throws DeploymentUnitProcessingException { final String bindingName = bindingDescription . getBindingName ( ) ; final String bindingType = bindingDescription . getBindingType ( ) ; Value < ManagedReferenceFactory > resourceValue ; if ( bindingName != null ) { final String serviceBindingName ; int idx = bindingName . indexOf ( '//' ) ; if ( idx == ( - 1 ) ) { serviceBindingName = bindingName ; } else { serviceBindingName = bindingName . substring ( ( idx + 1 ) ) ; } final BinderService service = new BinderService ( serviceBindingName ) ; final ServiceName bindingServiceName = ContextNames . serviceNameOfContext ( module . getAppName ( ) , module . getModuleName ( ) , componentName , bindingName ) ; if ( bindingServiceName == null ) { throw new IllegalArgumentException ( ( ( "Invalid<seq2seq4repair_space>context<seq2seq4repair_space>name<seq2seq4repair_space>'" + bindingName ) + "'<seq2seq4repair_space>for<seq2seq4repair_space>binding" ) ) ; } ServiceBuilder < ManagedReferenceFactory > sourceServiceBuilder = phaseContext . getServiceTarget ( ) . addService ( bindingServiceName , service ) ; bindingDescription . getReferenceSourceDescription ( ) . getResourceValue ( bindingDescription , sourceServiceBuilder , phaseContext , service . getManagedObjectInjector ( ) ) ; resourceValue = sourceServiceBuilder . addDependency ( bindingServiceName . getParent ( ) , NamingStore . class , service . getNamingStoreInjector ( ) ) . install ( ) ; for ( final InjectionTargetDescription injectionTarget : bindingDescription . getInjectionTargetDescriptions ( ) ) { <START_BUG> injectionPointStore . addInjectedValue ( new JndiInjectedValue ( injectionTarget , resourceValue , bindingServiceName ) ) ; <END_BUG> } } else { throw new DeploymentUnitProcessingException ( ( "Binding<seq2seq4repair_space>name<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null:<seq2seq4repair_space>" + bindingDescription ) ) ; } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
injectionPointStore . addInjectedValue ( injectionTarget , resourceValue , bindingServiceName ) ;
Buggy code:
public interface VEXDocumentFragment { public static final String MIME_TYPE = "application//x-vex-document-fragment" ; public Content getContent ( ) { } public int getLength ( ) { } <START_BUG> public VEXElement [ ] getElements ( ) ; <END_BUG> public List < String > getNodeNames ( ) { } public List < VEXNode > getNodes ( ) { } }

Fix:
public List < VEXElement > getElements ( ) ;
Buggy code:
public class BcelCflowStackFieldAdder extends BcelTypeMunger { private ResolvedMember cflowStackField ; public BcelCflowStackFieldAdder ( ResolvedMember cflowStackField ) { } public boolean munge ( BcelClassWeaver weaver ) { LazyClassGen gen = weaver . getLazyClassGen ( ) ; if ( ! ( gen . getType ( ) . equals ( cflowStackField . getDeclaringType ( ) ) ) ) return false ; Field f = new org . apache . bcel . generic . FieldGen ( cflowStackField . getModifiers ( ) , BcelWorld . makeBcelType ( cflowStackField . getReturnType ( ) ) , cflowStackField . getName ( ) , gen . getConstantPoolGen ( ) ) . getField ( ) ; gen . addField ( f ) ; LazyMethodGen clinit = gen . getAjcPreClinit ( ) ; InstructionList setup = new InstructionList ( ) ; InstructionFactory fact = gen . getFactory ( ) ; setup . append ( fact . createNew ( new org . apache . bcel . generic . ObjectType ( NameMangler . CFLOW_STACK_TYPE ) ) ) ; <START_BUG> setup . append ( fact . createDup ( 1 ) ) ; <END_BUG> setup . append ( fact . createInvoke ( CFLOW_STACK_TYPE , "<init>" , VOID , new Type [ 0 ] , INVOKESPECIAL ) ) ; setup . append ( Utility . createSet ( fact , cflowStackField ) ) ; clinit . getBody ( ) . insert ( setup ) ; return true ; } public ResolvedMember getMatchingSyntheticMember ( Member member ) { } public ResolvedMember getSignature ( ) { } public boolean matches ( ResolvedTypeX onType ) { } }

Fix:
setup . append ( InstructionFactory . createDup ( 1 ) ) ;
Buggy code:
public class MethodLocator extends PatternLocator { protected MethodPattern pattern ; protected boolean isDeclarationOfReferencedMethodsPattern ; public char [ ] [ ] [ ] allSuperDeclaringTypeNames ; public MethodLocator ( MethodPattern pattern ) { } public void initializePolymorphicSearch ( MatchLocator locator ) { } protected boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int match ( MethodDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MessageSend node , MatchingNodeSet nodeSet ) { if ( ! ( this . pattern . findReferences ) ) return PatternLocator . IMPOSSIBLE_MATCH ; if ( ! ( matchesName ( this . pattern . selector , node . selector ) ) ) return PatternLocator . IMPOSSIBLE_MATCH ; <START_BUG> if ( ( this . pattern . parameterSimpleNames ) != null ) { <END_BUG> int length = this . pattern . parameterSimpleNames . length ; ASTNode [ ] args = node . arguments ; int argsLength = ( args == null ) ? 0 : args . length ; if ( length != argsLength ) return PatternLocator . IMPOSSIBLE_MATCH ; } return nodeSet . addMatch ( node , ( ( ( InternalSearchPattern ) ( this . pattern ) ) . mustResolve ? PatternLocator . POSSIBLE_MATCH : PatternLocator . ACCURATE_MATCH ) ) ; } protected int matchContainer ( ) { } protected int matchMethod ( MethodBinding method ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } protected int referenceType ( ) { } protected void reportDeclaration ( MethodBinding methodBinding , MatchLocator locator , SimpleSet knownMethods ) throws CoreException { } public int resolveLevel ( ASTNode possibleMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( MessageSend messageSend ) { } protected int resolveLevelAsSubtype ( char [ ] qualifiedPattern , ReferenceBinding type ) { } protected int resolveLevelForType ( char [ ] simpleNamePattern , char [ ] qualificationPattern , TypeBinding type ) { } protected void setUnitScope ( CompilationUnitScope unitScope ) { } public String toString ( ) { } }

Fix:
if ( ( ( this . pattern . parameterSimpleNames ) != null ) && ( ! ( this . pattern . varargs ) ) ) {
Buggy code:
@ Repository public class MTwitterMongoDao implements MTwitterDao { @ Autowired MongoClient mongoClient ; @ Value ( "${mongodb.dbname}" ) private String dbName ; @ Value ( "${mongodb.collectionName}" ) private String tweetCollection ; public void insertTweet ( MTweet tweet ) { } public List < MTweet > findTweetsByHashtag ( String hashtag ) { BasicDBObject query = new BasicDBObject ( "hashtags" , hashtag ) ; <START_BUG> BasicDBObject fields = new BasicDBObject ( "text" , 1 ) . append ( "timestamp" , 1 ) ; <END_BUG> return getMicroTweets ( query , fields ) ; } public List < MTweet > findTweetsByUser ( String user ) { } public List < MTweet > timeline ( String user ) { } private List < MTweet > getMicroTweets ( DBObject query , DBObject fields ) { } }

Fix:
BasicDBObject fields = new BasicDBObject ( "text" , 1 ) . append ( "timestamp" , 1 ) . append ( "user" , 1 ) ;
Buggy code:
public class JORClientTester { private final Display display ; private final Shell shell ; private final JavaOnRailsClient client ; private final JavaOnRailsServer server ; public JORClientTester ( ) { } public void run ( ) { shell . open ( ) ; <START_BUG> client . goToUrl ( "http:////localhost:3000//test_controller//test_stuf" ) ; <END_BUG> while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; client . dispose ( ) ; } static JORClientTester jorct ; public static void main ( String [ ] args ) throws URISyntaxException { } }

Fix:
client . goToUrl ( "http:////localhost:3000//test//test_method" ) ;
Buggy code:
class XidTransactionBeforeCompletionTask extends XidTransactionManagementTask { XidTransactionBeforeCompletionTask ( final TransactionRequestHandler txRequestHandler , final EJBRemoteTransactionsRepository transactionsRepository , final MarshallerFactory marshallerFactory , final XidTransactionID xidTransactionID , final ChannelAssociation channelAssociation , final short invocationId ) { } @ Override protected void manageTransaction ( ) throws Throwable { <START_BUG> final Transaction transaction = this . transactionsRepository . removeTransaction ( this . xidTransactionID ) ; <END_BUG> this . resumeTransaction ( transaction ) ; try { final Xid xid = this . xidTransactionID . getXid ( ) ; final SubordinateTransaction subordinateTransaction = SubordinationManager . getTransactionImporter ( ) . getImportedTransaction ( xid ) ; if ( subordinateTransaction == null ) { throw MESSAGES . noSubordinateTransactionPresentForXid ( xid ) ; } subordinateTransaction . doBeforeCompletion ( ) ; } finally { this . transactionsRepository . getTransactionManager ( ) . suspend ( ) ; } } }

Fix:
final Transaction transaction = this . transactionsRepository . getTransaction ( this . xidTransactionID ) ;
Buggy code:
public class Bubble { ArrayList < Bubble > bubbles ; ArrayList < Mubble > mubbles ; ArrayList < Field > dataFields ; String name ; Bubble parentBubble ; Pubble parentPubble ; boolean isBuilt = false ; boolean isFilled = false ; public Bubble ( String name ) { } public Bubble ( ) { } public boolean hasName ( String name ) { } public void addBubble ( Bubble b ) { } public void addField ( Field f ) { } public void addMubble ( Mubble m ) { } public void setName ( String name ) { } public Mubble findMethod ( String methodName , ArrayList < String > para ) { } public void setParentBubble ( Bubble b ) { } public void setParentPubble ( Pubble p ) { } public Bubble setIsBuilt ( boolean bool ) { } public Bubble setIsFilled ( boolean bool ) { } public boolean isBuilt ( ) { } public boolean isFilled ( ) { } public ArrayList < Bubble > getBubbles ( ) { } public ArrayList < Field > getDataFields ( ) { } public ArrayList < Mubble > getMubbles ( ) { } public String getName ( ) { } public Bubble getParentBubble ( ) { } public Pubble getParentPubble ( ) { } public String getPackageName ( ) { } public String getTypeDef ( ) { } public void inheritMethods ( ) { } public boolean paramMatch ( Mubble one , Mubble two ) { } public String getFDeclStruct ( ) { } public String getStruct ( ) { String ret = ( "struct<seq2seq4repair_space>_" + ( this . name ) ) + "<seq2seq4repair_space>{\n" ; ret += "////Data<seq2seq4repair_space>fields\n" ; ret += ( "_" + ( this . name ) ) + "_VT*<seq2seq4repair_space>__vptr;\n" ; for ( int i = 0 ; i < ( this . dataFields . size ( ) ) ; i ++ ) { } ret += "\n////Constructors\n" ; boolean encounteredConstructor = false ; for ( Mubble m : mubbles ) { if ( m . isConstructor ( ) ) encounteredConstructor = true ; } if ( ! encounteredConstructor ) { ret += ( "_" + ( name ) ) + "();<seq2seq4repair_space>\n\n" ; } else { for ( Mubble constructor : mubbles ) { if ( constructor . isConstructor ( ) ) ret += ( "_" + ( constructor . getName ( ) ) ) + "();\n" ; } } ret += "\n////The<seq2seq4repair_space>destructor\n" ; ret += ( "static<seq2seq4repair_space>void<seq2seq4repair_space>__delete(_" + ( this . name ) ) + "*);\n" ; ret += "\n////Forward<seq2seq4repair_space>declaration<seq2seq4repair_space>of<seq2seq4repair_space>methods\n" ; ret += ( ( "static<seq2seq4repair_space>Class<seq2seq4repair_space>__class();\n" + "static<seq2seq4repair_space>_" ) + ( this . name ) ) + "_VT<seq2seq4repair_space>__vtable;\n" ; for ( Mubble m : mubbles ) { <START_BUG> if ( ! ( m . isConstructor ( ) ) ) <END_BUG> ret += ( m . forward ( ) ) + "\n" ; } ret += "};\n" ; return ret ; } public String getStructVT ( ) { } public String getCC ( ) { } }

Fix:
if ( ( ( ! ( m . isConstructor ( ) ) ) && ( ( m . getFlag ( ) ) != 'i' ) ) && ( ! ( m . isDelete ( ) ) ) )
Buggy code:
public class JmeterHitsChartTemplate extends BaseChart2DTemplateWithInterval { @ Override public Chart2DConfig generateChartConfig ( ) { int interval = getInterval ( ) ; if ( interval < 1 ) interval = 10000 ; List < Chart2DSeriesConfigRule > rules ; FieldSelector timestampField = new IndexFieldSelector ( 1 ) ; FieldSelector yField = new IndexFieldSelector ( 2 ) ; rules = new ArrayList < Chart2DSeriesConfigRule > ( ) ; <START_BUG> rules . add ( new Chart2DSeriesConfigRule ( "^HIT$" , "Hits" , "" , getLabelField ( ) , timestampField , yField , new CountCalculation ( interval , ( 1000.0 // interval ) ) ) ) ; <END_BUG> return createConfig ( "Hits<seq2seq4repair_space>over<seq2seq4repair_space>Time" , "Time" , "Hits" , rules , TIME ) ; } }

Fix:
rules . add ( new Chart2DSeriesConfigRule ( "^HIT$" , "Hits" , "" , getLabelField ( ) , timestampField , yField , new CountCalculation ( interval ) ) ) ;
Buggy code:
public abstract class DataActivity extends ActionBarActivity implements DataActivityInterface { protected Storage storage ; public AppData data ; protected Subscription < AppData > dataLink ; protected ContactLoader contactLoader ; public User user ; @ Override public Storage getStorage ( ) { } @ Override public ContactLoader getContactLoader ( ) { } @ Override public Subscription < AppData > getDataLink ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; storage = StorageManager . getStorage ( this ) ; contactLoader = ContactLoader . getLoader ( this ) ; <START_BUG> dataLink = DataLinker . link ( storage . subscription , contactLoader . contactsLoaded ) ; <END_BUG> } @ Override protected void onStart ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } private DataActivity self = this ; private Callback < AppData > dataLoadedCallback = new Callback < AppData > ( ) { @ Override public void onCalled ( AppData data ) { } } ; private Callback < AppData > dataLinkedCallback = new Callback < AppData > ( ) { @ Override public void onCalled ( AppData data ) { } } ; private boolean userLoaded = false ; private Callback < User > userLoadedCallback = new Callback < User > ( ) { @ Override public void onCalled ( User user ) { } } ; protected void onDataReceived ( ) { } protected void onDataLinked ( ) { } protected void onUserLoaded ( ) { } }

Fix:
dataLink = new DataLinker ( ) . link ( storage . subscription , contactLoader . contactsLoaded ) ;
Buggy code:
public class Queue { private List < Request > list ; private Aircraft aircraft ; private OutputLogger logger ; private Signaler semaphore ; public Queue ( Aircraft ac , OutputLogger l ) { } public void push ( Request r ) { } private void pop ( ) { } public int size ( ) { } public boolean tick ( ) { if ( list . isEmpty ( ) ) { return false ; } Request r0 = list . get ( 0 ) ; List < Request > offlineList = new ArrayList < Request > ( ) ; if ( ( r0 . rORc ) == ( reqType . REQUEST ) ) { if ( ( aircraft . seatsNotTaken ( r0 . type ) ) >= ( r0 . seatNum ) ) { offlineList . add ( r0 ) ; int spareSeats = ( aircraft . seatsNotTaken ( r0 . type ) ) - ( r0 . seatNum ) ; int i = 1 ; while ( ( i < ( list . size ( ) ) ) && ( spareSeats > 0 ) ) { Request rx = list . get ( i ) ; if ( ! ( ( ( rx . rORc ) == ( r0 . rORc ) ) && ( ( rx . type ) == ( r0 . type ) ) ) ) { break ; } spareSeats = spareSeats - ( rx . seatNum ) ; if ( spareSeats >= 0 ) offlineList . add ( rx ) ; } } } else if ( ( r0 . rORc ) == ( reqType . CANCEL ) ) { offlineList . add ( r0 ) ; int i = 1 ; while ( i < ( list . size ( ) ) ) { Request rx = list . get ( i ) ; if ( ! ( ( rx . rORc ) == ( r0 . rORc ) ) ) { break ; } offlineList . add ( rx ) ; } } if ( offlineList . isEmpty ( ) ) { return false ; } else { logger . logAdmitBatch ( offlineList ) ; } List < ProcessThread > threadList = new ArrayList < ProcessThread > ( ) ; for ( Request r : offlineList ) { ProcessThread p = new ProcessThread ( r , aircraft , semaphore , logger ) ; threadList . add ( p ) ; p . start ( ) ; } while ( ( semaphore . sigNum ( ) ) != 1 ) { } <START_BUG> for ( int i = 0 ; i < offlineList ; i ++ ) { <END_BUG> this . pop ( ) ; } return true ; } No newline ; at end ; of file ; }

Fix:
for ( int i = 0 ; i < ( offlineList . size ( ) ) ; i ++ ) {
Buggy code:
public class splitmessages { private static TreeSet clientMessageIds = new TreeSet ( ) ; static void initClientMessageIds ( ) { splitmessages . clientMessageIds . add ( NO_CURRENT_CONNECTION ) ; splitmessages . clientMessageIds . add ( NOT_IMPLEMENTED ) ; <START_BUG> splitmessages . clientMessageIds . add ( CANNOT_CLOSE_ACTIVE_XA_CONNECTION ) ; <END_BUG> splitmessages . clientMessageIds . add ( XACT_SAVEPOINT_RELEASE_ROLLBACK_FAIL ) ; } public static void main ( String [ ] args ) throws Exception { } static boolean isClientMessage ( String messageId ) { } }

Fix:
splitmessages . clientMessageIds . add ( CANNOT_CLOSE_ACTIVE_CONNECTION ) ;
Buggy code:
public class StopTomcat { static final String DEFAULT_CONFIG = "conf//server.xml" ; private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.resources" ) ; String configFile ; String tomcatHome ; Log loghelper = new Log ( "tc_log" , "StopTomcat" ) ; public StopTomcat ( ) { } public void setConfig ( String s ) { } public void setF ( String s ) { } public void setH ( String s ) { } public void setHome ( String s ) { } public void execute ( ) throws Exception { } void stopTomcat ( ) throws TomcatException { } public void execute ( ContextManager cm ) throws TomcatException { int portInt = 8007 ; InetAddress address = null ; <START_BUG> BaseInterceptor [ ] ci = cm . getInterceptors ( ) ; <END_BUG> for ( int i = 0 ; i < ( ci . length ) ; i ++ ) { Object con = ci [ i ] ; if ( con instanceof Ajp12ConnectionHandler ) { PoolTcpConnector tcpCon = ( ( PoolTcpConnector ) ( con ) ) ; portInt = tcpCon . getPort ( ) ; address = tcpCon . getAddress ( ) ; } if ( con instanceof Ajp12Interceptor ) { Ajp12Interceptor tcpCon = ( ( Ajp12Interceptor ) ( con ) ) ; portInt = tcpCon . getPort ( ) ; address = tcpCon . getAddress ( ) ; } } try { if ( address == null ) address = InetAddress . getLocalHost ( ) ; Socket socket = new Socket ( address , portInt ) ; OutputStream os = socket . getOutputStream ( ) ; byte [ ] stopMessage = new byte [ 2 ] ; stopMessage [ 0 ] = ( ( byte ) ( 254 ) ) ; stopMessage [ 1 ] = ( ( byte ) ( 15 ) ) ; os . write ( stopMessage ) ; socket . close ( ) ; } catch ( Exception ex ) { throw new TomcatException ( ( ( ( "Error<seq2seq4repair_space>stopping<seq2seq4repair_space>Tomcat<seq2seq4repair_space>with<seq2seq4repair_space>Ajp12<seq2seq4repair_space>on<seq2seq4repair_space>" + address ) + ":" ) + portInt ) , ex ) ; } } }

Fix:
BaseInterceptor [ ] ci = cm . getContainer ( ) . getInterceptors ( ) ;
Buggy code:
public class SpanNotQuery extends SpanQuery { private SpanQuery include ; private SpanQuery exclude ; public SpanNotQuery ( SpanQuery include , SpanQuery exclude ) { } public SpanQuery getInclude ( ) { } public SpanQuery getExclude ( ) { } public String getField ( ) { } public Collection getTerms ( ) { } public void extractTerms ( Set terms ) { } public String toString ( String field ) { } public Spans getSpans ( final IndexReader reader ) throws IOException { return new Spans ( ) { private Spans includeSpans = include . getSpans ( reader ) ; private boolean moreInclude = true ; private Spans excludeSpans = exclude . getSpans ( reader ) ; <START_BUG> private boolean moreExclude = true ; <END_BUG> public boolean next ( ) throws IOException { if ( moreInclude ) moreInclude = includeSpans . next ( ) ; while ( ( moreInclude ) && ( moreExclude ) ) { if ( ( includeSpans . doc ( ) ) > ( excludeSpans . doc ( ) ) ) moreExclude = excludeSpans . skipTo ( includeSpans . doc ( ) ) ; while ( ( ( moreExclude ) && ( ( includeSpans . doc ( ) ) == ( excludeSpans . doc ( ) ) ) ) && ( ( excludeSpans . end ( ) ) <= ( includeSpans . start ( ) ) ) ) { moreExclude = excludeSpans . next ( ) ; } if ( ( ( ! ( moreExclude ) ) || ( ( includeSpans . doc ( ) ) != ( excludeSpans . doc ( ) ) ) ) || ( ( includeSpans . end ( ) ) <= ( excludeSpans . start ( ) ) ) ) break ; moreInclude = includeSpans . next ( ) ; } return moreInclude ; } public boolean skipTo ( int target ) throws IOException { if ( moreInclude ) moreInclude = includeSpans . skipTo ( target ) ; if ( ! ( moreInclude ) ) return false ; if ( ( moreExclude ) && ( ( includeSpans . doc ( ) ) > ( excludeSpans . doc ( ) ) ) ) moreExclude = excludeSpans . skipTo ( includeSpans . doc ( ) ) ; while ( ( ( moreExclude ) && ( ( includeSpans . doc ( ) ) == ( excludeSpans . doc ( ) ) ) ) && ( ( excludeSpans . end ( ) ) <= ( includeSpans . start ( ) ) ) ) { moreExclude = excludeSpans . next ( ) ; } if ( ( ( ! ( moreExclude ) ) || ( ( includeSpans . doc ( ) ) != ( excludeSpans . doc ( ) ) ) ) || ( ( includeSpans . end ( ) ) <= ( excludeSpans . start ( ) ) ) ) return true ; return next ( ) ; } public int doc ( ) { return includeSpans . doc ( ) ; } public int start ( ) { return includeSpans . start ( ) ; } public int end ( ) { return includeSpans . end ( ) ; } public String toString ( ) { return ( "spans(" + ( SpanNotQuery . this . toString ( ) ) ) + ")" ; } } ; } public Query rewrite ( IndexReader reader ) throws IOException { } public boolean equals ( Object o ) { } public int hashCode ( ) { } }

Fix:
private boolean moreExclude = excludeSpans . next ( ) ;
Buggy code:
public class AnnotatedEndpointConnectionManager extends ConnectionManagerSupport implements BeanFactoryAware { private final Object endpoint ; private final BeanCreatingHandlerProvider < Object > endpointProvider ; private WebSocketContainer webSocketContainer = ContainerProvider . getWebSocketContainer ( ) ; private Session session ; private TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor ( "AnnotatedEndpointConnectionManager-" ) ; public AnnotatedEndpointConnectionManager ( Object endpoint , String uriTemplate , Object ... uriVariables ) { } public AnnotatedEndpointConnectionManager ( Class < ? > endpointClass , String uriTemplate , Object ... uriVariables ) { } public void setWebSocketContainer ( WebSocketContainer webSocketContainer ) { } public WebSocketContainer getWebSocketContainer ( ) { } @ Override public void setBeanFactory ( BeanFactory beanFactory ) throws BeansException { } public void setTaskExecutor ( TaskExecutor taskExecutor ) { <START_BUG> Assert . notNull ( taskExecutor , "taskExecutor<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; <END_BUG> this . taskExecutor = taskExecutor ; } public TaskExecutor getTaskExecutor ( ) { } @ Override protected void openConnection ( ) { } @ Override protected void closeConnection ( ) throws Exception { } @ Override protected boolean isConnected ( ) { } }

Fix:
Assert . notNull ( taskExecutor , "TaskExecutor<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ;
Buggy code:
@ Slow public class FullSolrCloudDistribCmdsTest extends AbstractFullDistribZkTestBase { @ BeforeClass public static void beforeSuperClass ( ) { } public FullSolrCloudDistribCmdsTest ( ) { } @ Override public void doTest ( ) throws Exception { } private long testThatCantForwardToLeaderFails ( long docId ) throws Exception { } private long addTwoDocsInOneRequest ( long docId ) throws Exception { } private long addUpdateDelete ( ) throws IOException , Exception { } private void testDeleteByQueryDistrib ( ) throws Exception { } private long testIndexQueryDeleteHierarchical ( long docId ) throws Exception { } private long addChildren ( String prefix , SolrInputDocument topDocument , int childIndex , boolean lastLevel , long docId ) { } private long testIndexingDocPerRequestWithHttpSolrServer ( long docId ) throws Exception { } private long testIndexingBatchPerRequestWithHttpSolrServer ( long docId ) throws Exception { } private long addDoc ( long docId , UpdateRequest uReq ) { } private long addDoc ( String docId , UpdateRequest uReq ) { } private long testIndexingWithSuss ( long docId ) throws Exception { ConcurrentUpdateSolrServer suss = new ConcurrentUpdateSolrServer ( ( ( org . apache . solr . client . solrj . impl . HttpSolrServer ) ( clients . get ( 0 ) ) ) . getBaseURL ( ) , 10 , 2 ) ; QueryResponse results = query ( cloudClient ) ; long beforeCount = results . getResults ( ) . getNumFound ( ) ; int cnt = ( TEST_NIGHTLY ) ? 2933 : 313 ; try { <START_BUG> suss . setConnectionTimeout ( 15000 ) ; <END_BUG> for ( int i = 0 ; i < cnt ; i ++ ) { index_specific ( suss , id , ( docId ++ ) , "text_t" , "some<seq2seq4repair_space>text<seq2seq4repair_space>so<seq2seq4repair_space>that<seq2seq4repair_space>it<seq2seq4repair_space>not's<seq2seq4repair_space>negligent<seq2seq4repair_space>work<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>this<seq2seq4repair_space>doc,<seq2seq4repair_space>even<seq2seq4repair_space>though<seq2seq4repair_space>it's<seq2seq4repair_space>still<seq2seq4repair_space>a<seq2seq4repair_space>pretty<seq2seq4repair_space>short<seq2seq4repair_space>doc" ) ; } suss . blockUntilFinished ( ) ; commit ( ) ; checkShardConsistency ( ) ; assertDocCounts ( VERBOSE ) ; } finally { suss . shutdown ( ) ; } results = query ( cloudClient ) ; assertEquals ( ( beforeCount + cnt ) , results . getResults ( ) . getNumFound ( ) ) ; return docId ; } private void testOptimisticUpdate ( QueryResponse results ) throws Exception { } private QueryResponse query ( SolrServer server ) throws SolrServerException { } @ Override public void tearDown ( ) throws Exception { } protected SolrInputDocument addRandFields ( SolrInputDocument sdoc ) { } }

Fix:
suss . setConnectionTimeout ( 30000 ) ;
Buggy code:
public final class FileDialoger { private static String lastJFCDirectory = null ; private static JFileChooser jfc = new JFileChooser ( ) ; private FileDialoger ( ) { } public static JFileChooser promptToOpenFile ( String [ ] exts ) { } private static void clearFileFilters ( ) { } public static JFileChooser promptToOpenFile ( ) { } public static JFileChooser promptToSaveFile ( String filename ) { } public static JFileChooser promptToSaveFile ( String filename , String [ ] extensions ) { if ( ( FileDialoger . lastJFCDirectory ) == null ) { String start = System . getProperty ( "user.dir" , "" ) ; if ( ( start . length ( ) ) > 0 ) { FileDialoger . jfc = new JFileChooser ( new File ( start ) ) ; } FileDialoger . lastJFCDirectory = FileDialoger . jfc . getCurrentDirectory ( ) . getAbsolutePath ( ) ; } String ext = ".jmx" ; if ( filename != null ) { FileDialoger . jfc . setDialogTitle ( filename ) ; FileDialoger . jfc . setSelectedFile ( ( ( filename . lastIndexOf ( System . getProperty ( "file.separator" ) ) ) > 0 ? new File ( filename ) : new File ( FileDialoger . lastJFCDirectory , filename ) ) ) ; int i = - 1 ; <START_BUG> if ( ( i = filename . lastIndexOf ( "." ) ) > ( - 1 ) ) { <END_BUG> ext = filename . substring ( i ) ; } } FileDialoger . clearFileFilters ( ) ; if ( extensions != null ) { FileDialoger . jfc . addChoosableFileFilter ( new JMeterFileFilter ( extensions ) ) ; } else { FileDialoger . jfc . addChoosableFileFilter ( new JMeterFileFilter ( new String [ ] { ext } ) ) ; } int retVal = FileDialoger . jfc . showSaveDialog ( GuiPackage . getInstance ( ) . getMainFrame ( ) ) ; FileDialoger . jfc . setDialogTitle ( null ) ; FileDialoger . lastJFCDirectory = FileDialoger . jfc . getCurrentDirectory ( ) . getAbsolutePath ( ) ; if ( retVal == ( JFileChooser . APPROVE_OPTION ) ) { return FileDialoger . jfc ; } return null ; } }

Fix:
if ( ( i = filename . lastIndexOf ( '.' ) ) > ( - 1 ) ) {
Buggy code:
public class JSActionCompiler extends GenericImperativeActionCompiler { @ Override public void generate ( SendAction action , StringBuilder builder , Context ctx ) { } @ Override public void generate ( FunctionCallStatement action , StringBuilder builder , Context ctx ) { } @ Override public void generate ( LocalVariable action , StringBuilder builder , Context ctx ) { } @ Override public void generate ( ErrorAction action , StringBuilder builder , Context ctx ) { } @ Override public void generate ( PrintAction action , StringBuilder builder , Context ctx ) { } @ Override public void generate ( EventReference expression , StringBuilder builder , Context ctx ) { } @ Override public void generate ( PropertyReference expression , StringBuilder builder , Context ctx ) { <START_BUG> if ( ( ( expression . getProperty ( ) . isDefined ( "private" , "true" ) ) || ( ( expression . getProperty ( ) ) instanceof Parameter ) ) || ( ( expression . getProperty ( ) ) instanceof LocalVariable ) ) { <END_BUG> builder . append ( ctx . getVariableName ( expression . getProperty ( ) ) ) ; } else { builder . append ( ( "_this." + ( ctx . getVariableName ( expression . getProperty ( ) ) ) ) ) ; } } @ Override public void generate ( EnumLiteralRef expression , StringBuilder builder , Context ctx ) { } @ Override public void generate ( FunctionCallExpression expression , StringBuilder builder , Context ctx ) { } }

Fix:
if ( ( ( ( expression . getProperty ( ) . isDefined ( "private" , "true" ) ) || ( ! ( ( expression . getProperty ( ) . eContainer ( ) ) instanceof Thing ) ) ) || ( ( expression . getProperty ( ) ) instanceof Parameter ) ) || ( ( expression . getProperty ( ) ) instanceof LocalVariable ) ) {
Buggy code:
public class Assignment extends Expression { public Expression lhs ; public Expression expression ; public Assignment ( Expression lhs , Expression expression , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } void checkAssignmentEffect ( BlockScope scope ) { } void checkAssignment ( BlockScope scope , TypeBinding lhsType , TypeBinding rhsType ) { FieldBinding leftField = getLastField ( this . lhs ) ; if ( ( ( ( leftField != null ) && ( rhsType != ( NullBinding ) ) ) && ( lhsType . isWildcard ( ) ) ) && ( ( ( ( WildcardBinding ) ( lhsType ) ) . kind ) != ( Wildcard . SUPER ) ) ) { scope . problemReporter ( ) . wildcardAssignment ( lhsType , rhsType , this . expression ) ; } else if ( ( ( ( leftField != null ) && ( ( leftField . declaringClass ) != null ) ) && ( leftField . declaringClass . isRawType ( ) ) ) && ( ( rhsType . isParameterizedType ( ) ) || ( rhsType . isGenericType ( ) ) ) ) { scope . problemReporter ( ) . unsafeRawFieldAssignment ( leftField , rhsType , this . lhs ) ; } else <START_BUG> if ( ( rhsType . isRawType ( ) ) && ( ( lhsType . isBoundParameterizedType ( ) ) || ( lhsType . isGenericType ( ) ) ) ) { <END_BUG> scope . problemReporter ( ) . unsafeRawConversion ( this . expression , rhsType , lhsType ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } Binding getDirectBinding ( Expression someExpression ) { } FieldBinding getLastField ( Expression someExpression ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( rhsType . needsUncheckedConversion ( lhsType ) ) {
Buggy code:
public class DisableOverrideTest { static Category CAT = Category . getInstance ( DisableOverrideTest . class . getName ( ) ) ; public static void main ( String [ ] argv ) { String configFile = null ; if ( ( argv . length ) == 1 ) configFile = argv [ 0 ] ; else DisableOverrideTest . Usage ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>arguments." ) ; DOMConfigurator . configure ( configFile ) ; <START_BUG> DOMConfigurator . disableInfo ( ) ; <END_BUG> DisableOverrideTest . CAT . debug ( "Hello<seq2seq4repair_space>world" ) ; } static void Usage ( String msg ) { } }

Fix:
Category . getDefaultHierarchy ( ) . disableInfo ( ) ;
Buggy code:
public class Label extends Control { String text ; Image image ; boolean isImage ; NSTextField textView ; NSImageView imageView ; public Label ( Composite parent , int style ) { } int accessibilityAttributeNames ( int id , int sel ) { } boolean accessibilityIsIgnored ( int id , int sel ) { } void addRelation ( Control control ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { state |= THEME_BACKGROUND ; NSBox widget = ( ( NSBox ) ( new SWTBox ( ) . alloc ( ) ) ) ; widget . init ( ) ; <START_BUG> widget . setTitle ( NSString . stringWith ( "" ) ) ; <END_BUG> if ( ( ( style ) & ( SWT . SEPARATOR ) ) != 0 ) { widget . setBoxType ( NSBoxSeparator ) ; NSView child = ( ( NSView ) ( new SWTView ( ) . alloc ( ) . init ( ) ) ) ; widget . setContentView ( child ) ; child . release ( ) ; } else { widget . setBorderType ( NSNoBorder ) ; widget . setBorderWidth ( 0 ) ; widget . setBoxType ( NSBoxCustom ) ; NSSize offsetSize = new NSSize ( ) ; widget . setContentViewMargins ( offsetSize ) ; NSImageView imageWidget = ( ( NSImageView ) ( new SWTImageView ( ) . alloc ( ) ) ) ; imageWidget . init ( ) ; imageWidget . setImageScaling ( NSScaleNone ) ; NSTextField textWidget = ( ( NSTextField ) ( new SWTTextField ( ) . alloc ( ) ) ) ; textWidget . init ( ) ; textWidget . setBordered ( false ) ; textWidget . setEditable ( false ) ; textWidget . setDrawsBackground ( false ) ; NSTextFieldCell cell = new NSTextFieldCell ( textWidget . cell ( ) ) ; cell . setWraps ( ( ( ( style ) & ( SWT . WRAP ) ) != 0 ) ) ; widget . addSubview ( imageWidget ) ; widget . addSubview ( textWidget ) ; widget . setContentView ( textWidget ) ; imageView = imageWidget ; textView = textWidget ; _setAlignment ( ) ; } view = widget ; } void createWidget ( ) { } NSAttributedString createString ( ) { } NSFont defaultNSFont ( ) { } void deregister ( ) { } NSView eventView ( ) { } public int getAlignment ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } boolean isDescribedByLabel ( ) { } void register ( ) { } void releaseHandle ( ) { } void removeRelation ( ) { } public void setAlignment ( int alignment ) { } void setBackgroundColor ( NSColor nsColor ) { } void setBackgroundImage ( NSImage image ) { } void _setAlignment ( ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } boolean setTabItemFocus ( ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } }

Fix:
widget . setTitle ( NSString . string ( ) ) ;
Buggy code:
public class GoListToPosterToItem implements TreeModel { public Object getRoot ( ) { <START_BUG> throw new Error ( "getRoot<seq2seq4repair_space>should<seq2seq4repair_space>never<seq2seq4repair_space>be<seq2seq4repair_space>called" ) ; <END_BUG> } public void setRoot ( Object r ) { } public Object getChild ( Object parent , int index ) { } public int getChildCount ( Object parent ) { } public int getIndexOfChild ( Object parent , Object child ) { } public boolean isLeaf ( Object node ) { } public Vector getChildren ( Object parent ) { } public void valueForPathChanged ( TreePath path , Object newValue ) { } public void addTreeModelListener ( TreeModelListener l ) { } public void removeTreeModelListener ( TreeModelListener l ) { } }

Fix:
throw new UnsupportedOperationException ( "getRoot<seq2seq4repair_space>should<seq2seq4repair_space>never<seq2seq4repair_space>be<seq2seq4repair_space>called" ) ;
Buggy code:
public class JPADefaultDatasourceWriteHandler extends AbstractWriteAttributeHandler < String > { static final JPADefaultDatasourceWriteHandler INSTANCE = new JPADefaultDatasourceWriteHandler ( ) ; private JPADefaultDatasourceWriteHandler ( ) { } @ Override protected boolean applyUpdateToRuntime ( final OperationContext context , final ModelNode operation , String attributeName , final ModelNode resolvedValue , ModelNode currentValue , HandbackHolder < String > handbackHolder ) throws OperationFailedException { final String dataSourceName = resolvedValue . asString ( ) ; final ServiceRegistry registry = context . getServiceRegistry ( true ) ; ServiceController < ? > sc = registry . getRequiredService ( SERVICE_NAME ) ; <START_BUG> JPAService jpaService = JPAService . class . cast ( sc . getValue ( ) ) ; <END_BUG> handbackHolder . setHandback ( JPAService . getDefaultDataSourceName ( ) ) ; jpaService . setDefaultDataSourceName ( dataSourceName ) ; return false ; } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , String handback ) throws OperationFailedException { } }

Fix:
JPAService jpaService = JPAService . class . cast ( sc . getService ( ) ) ;
Buggy code:
public final class TuplePattern extends Pattern implements IPatternList { private IPattern [ ] patterns = new IPattern [ 3 ] ; private int patternCount ; private IType tupleType ; public TuplePattern ( ICodePosition position ) { } @ Override public int getPatternType ( ) { } @ Override public IType getType ( ) { } @ Override public IPattern withType ( IType type , MarkerList markers ) { IClass tupleClass = TupleType . getTupleClass ( this . patternCount ) ; <START_BUG> if ( ! ( tupleClass . isSubTypeOf ( type ) ) ) { <END_BUG> return null ; } this . tupleType = type ; for ( int i = 0 ; i < ( this . patternCount ) ; i ++ ) { IType elementType = type . resolveTypeSafely ( tupleClass . getTypeParameter ( i ) ) ; IPattern pattern = this . patterns [ i ] ; IPattern typedPattern = pattern . withType ( elementType , markers ) ; if ( typedPattern == null ) { Marker m = Markers . semantic ( pattern . getPosition ( ) , "pattern.tuple.element.type" ) ; m . addInfo ( Markers . getSemantic ( "pattern.type" , pattern . getType ( ) ) ) ; m . addInfo ( Markers . getSemantic ( "tuple.element.type" , elementType ) ) ; markers . add ( m ) ; } else { this . patterns [ i ] = typedPattern ; } } return this ; } @ Override public boolean isType ( IType type ) { } @ Override public int patternCount ( ) { } @ Override public void setPattern ( int index , IPattern pattern ) { } @ Override public void addPattern ( IPattern pattern ) { } @ Override public IPattern getPattern ( int index ) { } @ Override public IDataMember resolveField ( Name name ) { } @ Override public IPattern resolve ( MarkerList markers , IContext context ) { } @ Override public void writeInvJump ( MethodWriter writer , int varIndex , IType matchedType , Label elseLabel ) throws BytecodeException { } @ Override public void toString ( String prefix , StringBuilder buffer ) { } }

Fix:
if ( ( tupleClass == null ) || ( ! ( tupleClass . isSubTypeOf ( type ) ) ) ) {
Buggy code:
public class ChatBot implements IIMMessageListener { private IChatBotEntry bot ; private IContainer container ; private IChatRoomManager manager ; private Namespace namespace ; private IChatRoomMessageSender sender ; public ChatBot ( IChatBotEntry bot ) { } private void start ( ) { } protected void setup ( ) throws ECFException { } public void handleMessageEvent ( IIMMessageEvent event ) { if ( event instanceof IChatRoomMessageEvent ) { IChatRoomMessageEvent roomEvent = ( ( IChatRoomMessageEvent ) ( event ) ) ; IChatRoomMessage message = roomEvent . getChatRoomMessage ( ) ; List commands = bot . getCommands ( ) ; for ( int i = 0 ; i < ( commands . size ( ) ) ; i ++ ) { ICommandEntry entry = ( ( ICommandEntry ) ( commands . get ( i ) ) ) ; <START_BUG> entry . execute ( message . getMessage ( ) , sender ) ; <END_BUG> } } } }

Fix:
entry . execute ( message , sender ) ;
Buggy code:
public class ConnectorAdd extends AbstractAddStepHandler { static final ConnectorAdd INSTANCE = new ConnectorAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; final String connectorName = address . getLastElement ( ) . getValue ( ) ; <START_BUG> ServiceName tmpDirPath = JBOSS . append ( "server" , "path" , "jboss.server.temp.dir" ) ; <END_BUG> RemotingServices . installSecurityServices ( context . getServiceTarget ( ) , connectorName , null , null , tmpDirPath , verificationHandler , newControllers ) ; launchServices ( context , address , connectorName , model , verificationHandler , newControllers ) ; } void launchServices ( OperationContext context , PathAddress pathAddress , String connectorName , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } private Resource findResource ( Resource rootResource , PathAddress address ) { } static OptionMap createOptionMap ( final ModelNode parameters ) { } static Collection < String > asStringSet ( final ModelNode node ) { } static Collection < SaslQop > asQopSet ( final ModelNode node ) { } }

Fix:
ServiceName tmpDirPath = JBOSS . append ( "server" , "path" , "jboss.home.dir" ) ;
Buggy code:
public class Order { public static final String NAME = "order" ; private static RelationshipIndex INDEX ; public static void init ( IndexManager indexManager ) { } private static QueryContext sort ( String key , String ... additionalKeys ) { } public static void order ( Relationship r , int value ) { } public static void unorder ( Relationship r ) { } public static IndexHits < Relationship > queryDown ( Node node ) { } @ Deprecated public static IndexHits < Relationship > queryUp ( Node node ) { } public static Relationship [ ] first ( int qty , Node node ) { } public static IndexHits < Relationship > context ( Node node ) { <START_BUG> return new ContextHits ( Order . INDEX . query ( Order . NAME , Order . sort ( Order . NAME ) , node , null ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return new ContextHits ( node , Order . INDEX . query ( Order . NAME , Order . sort ( Order . NAME ) , node , null ) ) ;
Buggy code:
public class FlawFinder { public static RuleSet ruletest ( ) { } public static void addRulesAndInitialize ( ) { } public static void loadPatchInfoTest ( ) throws IOException { } public static void fileProcessorTest ( ) throws IOException { Arguments arguments = new Arguments ( ) ; <START_BUG> String fileName = "//home//afif//flawfinder//flawfinder-1.31//test.c" ; <END_BUG> RuleSet r = HelperFunctions . readRuleSet ( "//home//afif//flawfinder//flawfinder-1.31//rules.txt" ) ; r . expandRuleSet ( ) ; BufferedReader input = new BufferedReader ( new InputStreamReader ( new FileInputStream ( fileName ) ) ) ; String text = "" ; String line ; while ( ( line = input . readLine ( ) ) != null ) { text = ( text + line ) + "\n" ; } FileProcessor fileProcessor = new FileProcessor ( arguments , fileName , null , r ) ; fileProcessor . processCFile ( ) ; } public static void cExtractParametersTest ( ) throws FileNotFoundException , IOException { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
String fileName = "//home//afif//flawfinder//flawfinder-1.31//sloctest.c" ;
Buggy code:
public class AccountWizardLauncher { public AccountWizardLauncher ( ) { } public void launchWizard ( ) { DataModel data = new DataModel ( ) ; Step [ ] steps ; if ( ( MailConfig . getAccountList ( ) . count ( ) ) == 0 ) { steps = new Step [ ] { new WelcomeStep ( ) , new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , false ) , new FinishStep ( ) } ; } else { steps = new Step [ ] { new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , true ) } ; } WizardModel model = new DefaultWizardModel ( steps ) ; model . addWizardModelListener ( new AccountCreator ( data ) ) ; Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "accountwizard" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_preferences.png" ) ) ; CSH . setHelpIDString ( wizard , "getting_started_1" ) ; JavaHelpSupport . enableHelp ( wizard , HelpManager . getHelpBroker ( ) ) ; <START_BUG> wizard . setSize ( 700 , 500 ) ; <END_BUG> wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
wizard . pack ( ) ;
Buggy code:
public class ServletWebResponse extends WebResponse { private final HttpServletResponse httpServletResponse ; private final HttpServletRequest httpServletRequest ; public ServletWebResponse ( HttpServletRequest httpServletRequest , HttpServletResponse httpServletResponse ) { } public final HttpServletResponse getHttpServletResponse ( ) { } @ Override public void addCookie ( Cookie cookie ) { } @ Override public void clearCookie ( Cookie cookie ) { } @ Override public void setContentLength ( long length ) { <START_BUG> httpServletResponse . setContentLength ( ( ( int ) ( length ) ) ) ; <END_BUG> } @ Override public void setContentType ( String mimeType ) { } @ Override public void setDateHeader ( String name , long date ) { } @ Override public void setHeader ( String name , String value ) { } @ Override public void write ( CharSequence sequence ) { } @ Override public void write ( byte [ ] array ) { } @ Override public void setStatus ( int sc ) { } @ Override public void sendError ( int sc , String msg ) { } @ Override public String encodeURL ( CharSequence url ) { } private String getAbsolutePrefix ( ) { } private String getAbsoluteURL ( String url ) { } private boolean redirect = false ; @ Override public void sendRedirect ( String url ) { } @ Override public boolean isRedirect ( ) { } @ Override public void flush ( ) { } @ Override public void reset ( ) { } }

Fix:
httpServletResponse . addHeader ( "Content-Length" , Long . toString ( length ) ) ;
Buggy code:
class ProgressAnimationProcessor implements IAnimationProcessor { AnimationManager manager ; ProgressAnimationProcessor ( AnimationManager animationManager ) { } List items = Collections . synchronizedList ( new ArrayList ( ) ) ; public void startAnimationLoop ( IProgressMonitor monitor ) { } public void addItem ( AnimationItem item ) { } public boolean hasItems ( ) { } public void itemsInactiveRedraw ( ) { } public void animationStarted ( ) { } public int getPreferredWidth ( ) { <START_BUG> return 20 ; <END_BUG> } private ProgressAnimationItem [ ] getAnimationItems ( ) { } public void animationFinished ( ) { } public boolean isProcessorJob ( Job job ) { } }

Fix:
return 30 ;
Buggy code:
public class JavaSource { private static final Pattern propertyPattern = Pattern . compile ( ".*getLabelManager\\(\\).get\\(\"(.+?)\"\\).*" ) ; private final Path javaSourceFile ; private final String className ; public JavaSource ( Path javaSourceFile , String className ) { } public List < String > referencedProperties ( ) throws IOException { } public List < String > getLines ( ) throws IOException { } public Path getJavaSourceFile ( ) { } private String getSuperClass ( List < String > lines ) { } private void rewritePackageName ( List < String > lines ) { } private void addImportForSuperclass ( List < String > lines ) { } private void addImportForCategory ( List < String > lines ) { } private void addImport ( String importToAdd , List < String > lines ) { } public boolean containsReferenceToJavax ( ) throws IOException { <START_BUG> List < String > lines = Files . readAllLines ( javaSourceFile ) ; <END_BUG> return FluentIterable . from ( lines ) . anyMatch ( new Predicate < String > ( ) { @ Override public boolean apply ( String line ) { return ( ( line . contains ( "s.getRequest()" ) ) || ( line . contains ( "s.setRequest(" ) ) ) || ( line . contains ( "s.getResponse()" ) ) ; } } ) ; } private void replaceWebgoatI18N ( List < String > lines ) { } }

Fix:
List < String > lines = Files . readAllLines ( javaSourceFile , StandardCharsets . UTF_8 ) ;