nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TransactionDAO extends GenericDAO < TransactionBean > { public TransactionDAO ( ConnectionPool cp , String tableName ) throws DAOException { } public double getValidBalance ( String userName , double amount ) throws RollbackException { } public double getValidShares ( String userName , double shares ) throws RollbackException { } public TransactionBean [ ] getAllPendingTrans ( ) throws RollbackException { } public String getLastDate ( CustomerBean c ) throws RollbackException { <START_BUG> TransactionBean [ ] transaction = match ( MatchArg . equals ( "userName" , c . getUserName ( ) ) ) ; <END_BUG> if ( ( transaction . length ) == 0 ) return null ; Arrays . sort ( transaction ) ; return transaction [ ( ( transaction . length ) - 1 ) ] . getExecuteDate ( ) ; } public Date getLatestDate ( ) throws ParseException , RollbackException { } public TransactionBean [ ] getTransactions ( String userName ) throws RollbackException { } }

Fix:
TransactionBean [ ] transaction = match ( MatchArg . notEquals ( "executeDate" , null ) , MatchArg . equals ( "userName" , c . getUserName ( ) ) ) ;
Buggy code:
public class RedirectPageRequestTarget extends AbstractListenerInterfaceRequestTarget { public RedirectPageRequestTarget ( Page page ) { } public final void processEvents ( final RequestCycle requestCycle ) { <START_BUG> invokeInterface ( getComponent ( ) , getListenerMethod ( ) , getPage ( ) ) ; <END_BUG> } }

Fix:
invokeInterface ( getTarget ( ) , getListenerMethod ( ) , getPage ( ) ) ;
Buggy code:
public abstract class AbstractDistributionTest extends ContainerAbstractTestCase { protected IRemoteServiceContainerAdapter [ ] adapters = null ; protected abstract String getClientContainerName ( ) { } protected void tearDown ( ) throws Exception { } protected void setClientCount ( int count ) { } protected void setupRemoteServiceAdapters ( ) throws Exception { } protected BundleContext getContext ( ) { } protected IRemoteServiceContainerAdapter [ ] getRemoteServiceAdapters ( ) { } protected IRemoteServiceListener createRemoteServiceListener ( final boolean server ) { } protected void addRemoteServiceListeners ( ) { } protected IRemoteServiceRegistration registerRemoteService ( IRemoteServiceContainerAdapter adapter , String serviceInterface , Object service , Dictionary serviceProperties , int sleepTime ) { } protected IRemoteServiceReference [ ] getRemoteServiceReferences ( IRemoteServiceContainerAdapter adapter , String clazz , String filter ) { } protected IRemoteService getRemoteService ( IRemoteServiceContainerAdapter adapter , String clazz , String filter ) { } protected String getFilterFromServiceProperties ( Dictionary serviceProperties ) { } protected String [ ] getDefaultServiceClasses ( ) { } protected Object getDefaultService ( ) { } protected ServiceRegistration registerService ( String [ ] clazzes , Object service , Properties props ) throws Exception { } protected ServiceRegistration registerService ( String clazz , Object service , Properties props ) throws Exception { } protected ServiceRegistration registerDefaultService ( Properties props ) throws Exception { } public ServiceReference getReference ( ) { } protected void assertReferenceHasCorrectType ( ServiceReference sr , String classname ) { } protected void assertReferencesValidAndFirstHasCorrectType ( ServiceReference [ ] references , String classname ) { } protected void assertReferencesValid ( ServiceReference [ ] references ) { } protected void assertStringResultValid ( Object result , String compare ) { } protected void assertProxyValid ( Object proxy ) { } protected ServiceTracker createProxyServiceTracker ( String clazz ) throws InvalidSyntaxException { ServiceTracker st = new ServiceTracker ( getContext ( ) , getContext ( ) . createFilter ( ( ( ( ( ( ( "(&(" + ( Constants . OBJECTCLASS ) ) + "=" ) + clazz ) + ")(" ) + ( RemoteConstants . SERVICE_IMPORTED ) ) + "=*))" ) ) , new ServiceTrackerCustomizer ( ) { public Object addingService ( ServiceReference reference ) { Trace . trace ( PLUGIN_ID , ( "addingService=" + reference ) ) ; return getContext ( ) . getService ( reference ) ; } public void modifiedService ( ServiceReference reference , Object service ) { Trace . trace ( PLUGIN_ID , ( "modifiedService=" + reference ) ) ; } public void removedService ( ServiceReference reference , Object service ) { Trace . trace ( PLUGIN_ID , ( ( ( "removedService=" + reference ) + ",svc=" ) + service ) ) ; } } ) ; <START_BUG> st . open ( true ) ; <END_BUG> return st ; } protected IRemoteService getRemoteServiceFromProxy ( Object proxy ) { } }

Fix:
st . open ( ) ;
Buggy code:
public class ToolBar extends Composite { int itemCount ; ToolItem [ ] items ; public ToolBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { <START_BUG> state |= GRAB ; <END_BUG> super . createHandle ( handle ) ; } void createItem ( ToolItem item , int index ) { } void createWidget ( ) { } int defaultThemeFont ( ) { } void destroyItem ( ToolItem item ) { } void drawBackground ( int control , int context ) { } void enableWidget ( boolean enabled ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point pt ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } void invalidateChildrenVisibleRegion ( int control ) { } int [ ] layoutHorizontal ( int width , int height , boolean resize ) { } int [ ] layoutVertical ( int width , int height , boolean resize ) { } int [ ] layout ( int nWidth , int nHeight , boolean resize ) { } void relayout ( ) { } void releaseChildren ( boolean destroy ) { } void removeControl ( Control control ) { } void setBackground ( float [ ] color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } void setFontStyle ( Font font ) { } void setForeground ( float [ ] color ) { } public void setRedraw ( boolean redraw ) { } }

Fix:
state |= ( GRAB ) | ( THEME_BACKGROUND ) ;
Buggy code:
public class KeyphraseTrainingSetGenerator extends TrainingSetGenerator { public KeyphraseTrainingSetGenerator ( GenericDataset goldStandard ) { } @ Override public List < Pair < String , GenericSheetPrinter > > generateTrainingSet ( Distiller pipeline ) { } @ Override public List < Pair < String , GenericSheetPrinter > > generateTestSet ( Distiller pipeline ) { } private List < Pair < String , GenericSheetPrinter > > doWork ( Distiller pipeline , Map < String , String > workingSet , Map < String , String [ ] > workingAnswers ) { int docIndex = 0 ; List < Pair < String , GenericSheetPrinter > > outputFiles = new ArrayList < > ( ) ; for ( Map . Entry < String , String > documentEntry : workingSet . entrySet ( ) ) { String document = documentEntry . getValue ( ) . replace ( "\\n" , "<seq2seq4repair_space>" ) ; System . out . println ( ( ( ( ( "Evaluating<seq2seq4repair_space>document<seq2seq4repair_space>" + ( ++ docIndex ) ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( workingSet . size ( ) ) ) + "..." ) ) ; System . out . println ( ( "Document<seq2seq4repair_space>identifier:<seq2seq4repair_space>" + ( documentEntry . getKey ( ) ) ) ) ; System . out . println ( ( ( "Document's<seq2seq4repair_space>first<seq2seq4repair_space>40<seq2seq4repair_space>chars:<seq2seq4repair_space>" + ( document . substring ( 0 , 40 ) ) ) + "..." ) ) ; String [ ] answers = workingAnswers . get ( documentEntry . getKey ( ) ) ; IOBlackboard . setCurrentDocument ( ( ( ( IOBlackboard . getDocumentsFolder ( ) ) + ( FileSystem . getSeparator ( ) ) ) + ( documentEntry . getKey ( ) ) ) ) ; Blackboard b = pipeline . distillToBlackboard ( document ) ; Collection < Gram > candidates = b . getKeyphrases ( ) ; for ( Gram gram : candidates ) { Keyphrase candidate = ( ( Keyphrase ) ( gram ) ) ; candidate . putFeature ( goldStandard . getIdentifier ( ) , 0 ) ; boolean found = false ; for ( int i = 0 ; ( ! found ) && ( i < ( answers . length ) ) ; i ++ ) { String answer = answers [ i ] ; if ( ( goldStandard . compare ( gram . getSurface ( ) , answer ) ) == 0 ) { candidate . putFeature ( goldStandard . getIdentifier ( ) , 1 ) ; found = true ; } } } CsvPrinter printer = new CsvPrinter ( ) ; <START_BUG> printer . loadGrams ( b ) ; <END_BUG> printer . addToAll ( "DocID" , documentEntry . getKey ( ) ) ; outputFiles . add ( new Pair ( documentEntry . getKey ( ) , printer ) ) ; } return outputFiles ; } }

Fix:
printer . loadKeyphrases ( b ) ;
Buggy code:
public interface CacheGroupConfiguration { Cache < ? , ? > getCache ( ) { } <START_BUG> CacheNodeFactory getNodeFactory ( ) ; <END_BUG> }

Fix:
InfinispanNodeFactory getNodeFactory ( ) ;
Buggy code:
public class LoginModulesAttributeDefinition extends ListAttributeDefinition { public static final ParameterValidator validator ; public static final ParameterValidator fieldValidator ; public LoginModulesAttributeDefinition ( String name , String xmlName ) { } @ Override protected void addValueTypeDescription ( ModelNode node , ResourceBundle bundle ) { } @ Override protected void addAttributeValueTypeDescription ( ModelNode node , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { } @ Override protected void addOperationParameterValueTypeDescription ( ModelNode node , String operationName , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { } public static ModelNode parseField ( String name , String value , XMLStreamReader reader ) throws XMLStreamException { } @ Override public void marshallAsElement ( ModelNode resourceModel , XMLStreamWriter writer ) throws XMLStreamException { if ( ( resourceModel . hasDefined ( getName ( ) ) ) && ( ( resourceModel . asInt ( ) ) > 0 ) ) { final ModelNode modules = resourceModel . get ( getName ( ) ) ; for ( ModelNode module : modules . asList ( ) ) { writer . writeStartElement ( getXmlName ( ) ) ; writer . writeAttribute ( CODE . getLocalName ( ) , module . get ( CODE ) . asString ( ) ) ; <START_BUG> writer . writeAttribute ( FLAG . getLocalName ( ) , module . get ( Constants . FLAG ) . asString ( ) . toLowerCase ( ) ) ; <END_BUG> if ( module . hasDefined ( MODULE ) ) { writer . writeAttribute ( Attribute . MODULE . getLocalName ( ) , module . get ( MODULE ) . asString ( ) ) ; } if ( module . hasDefined ( MODULE_OPTIONS ) ) { for ( ModelNode option : module . get ( MODULE_OPTIONS ) . asList ( ) ) { writer . writeEmptyElement ( MODULE_OPTION . getLocalName ( ) ) ; writer . writeAttribute ( NAME . getLocalName ( ) , option . asProperty ( ) . getName ( ) ) ; writer . writeAttribute ( VALUE . getLocalName ( ) , option . asProperty ( ) . getValue ( ) . asString ( ) ) ; } } writer . writeEndElement ( ) ; } } } private ModelNode getNoTextValueTypeDescription ( final ModelNode parent ) { } }

Fix:
writer . writeAttribute ( FLAG . getLocalName ( ) , module . get ( Constants . FLAG ) . asString ( ) . toLowerCase ( Locale . ENGLISH ) ) ;
Buggy code:
public class AuthenticatorActivity extends AccountAuthenticatorActivity { public static final String ARG_ACCOUNT_TYPE = "ACCOUNT_TYPE" ; public static final String ARG_AUTH_TYPE = "AUTH_TYPE" ; public static final String ARG_ACCOUNT_NAME = "ACCOUNT_NAME" ; public static final String ARG_IS_ADDING_NEW_ACCOUNT = "IS_ADDING_ACCOUNT" ; public static final String KEY_ERROR_MESSAGE = "ERR_MSG" ; public static final String PARAM_USER_PASS = "USER_PASS" ; private final int REQ_SIGNUP = 1 ; private final String TAG = this . getClass ( ) . getSimpleName ( ) ; private AccountManager mAccountManager ; private String mAuthTokenType ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; <START_BUG> setContentView ( act_login ) ; <END_BUG> mAccountManager = AccountManager . get ( getBaseContext ( ) ) ; String accountName = getIntent ( ) . getStringExtra ( AuthenticatorActivity . ARG_ACCOUNT_NAME ) ; mAuthTokenType = getIntent ( ) . getStringExtra ( AuthenticatorActivity . ARG_AUTH_TYPE ) ; if ( ( mAuthTokenType ) == null ) mAuthTokenType = AccountGeneral . AUTHTOKEN_TYPE_FULL_ACCESS ; if ( accountName != null ) { ( ( android . widget . TextView ) ( findViewById ( R . id . accountName ) ) ) . setText ( accountName ) ; } findViewById ( submit ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { submit ( ) ; } } ) ; } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void submit ( ) { } private void finishLogin ( Intent intent ) { } No newline ; at end ; of file ; }

Fix:
setContentView ( activity_kolab_login ) ;
Buggy code:
@ Repeat ( iterations = 5 ) public class TestCompressingStoredFieldsFormat extends BaseStoredFieldsFormatTestCase { @ Override protected Codec getCodec ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testDeletePartiallyWrittenFilesIfAbort ( ) throws IOException { Directory dir = newDirectory ( ) ; IndexWriterConfig iwConf = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; iwConf . setMaxBufferedDocs ( RandomInts . randomIntBetween ( random ( ) , 2 , 30 ) ) ; iwConf . setCodec ( CompressingCodec . randomInstance ( random ( ) ) ) ; iwConf . setMergePolicy ( newLogMergePolicy ( false ) ) ; iwConf . setUseCompoundFile ( false ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir , iwConf ) ; final Document validDoc = new Document ( ) ; validDoc . add ( new org . apache . lucene . document . IntField ( "id" , 0 , Store . YES ) ) ; iw . addDocument ( validDoc ) ; iw . commit ( ) ; final Document invalidDoc = new Document ( ) ; FieldType fieldType = new FieldType ( ) ; fieldType . setStored ( true ) ; invalidDoc . add ( new Field ( "invalid" , fieldType ) { @ Override public String stringValue ( ) { return null ; } } ) ; try { iw . addDocument ( invalidDoc ) ; iw . commit ( ) ; } finally { int counter = 0 ; for ( String fileName : dir . listAll ( ) ) { if ( ( fileName . endsWith ( ".fdt" ) ) || ( fileName . endsWith ( ".fdx" ) ) ) { counter ++ ; } } assertEquals ( 2 , counter ) ; <START_BUG> iw . close ( ) ; <END_BUG> dir . close ( ) ; } } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class PersonalInfoEditFragment extends BaseHomeFragment implements OnClickListener , IsUploadImageListener , IsUpdateUserListener { private ImageView mUserIcon ; private EditText mUserName ; private EditText mUserSignature ; private CheckBox mSexSwitch ; private TextView mUpdatetv ; private EditText mUserPhone ; private UserLogic mUserLogic ; private User mCurrentUser ; private CreateBmpFactory mBmpFactory ; private ThingsImageLogic mImageLogic ; private RelativeLayout mLocationLayout ; private TextView mLocationNameTv ; private String mImagePath ; private Location mLocation ; private String mLocationName ; public static final int GO_LOGIN = 13 ; @ Override protected int getLayoutId ( ) { } @ Override protected void findViews ( View view ) { } @ Override protected void setupViews ( Bundle bundle ) { } @ Override protected void initListeners ( ) { } @ Override protected void initData ( ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } private void initPersonalInfo ( ) { } private void uplaodImage ( String imagePath ) { } private User initUserInfo ( ThingsImage image ) { } private void updateUserInfo ( User user ) { } @ Override public void onClick ( View v ) { switch ( v . getId ( ) ) { case id . user_info_update : uplaodImage ( mImagePath ) ; break ; case id . user_icon_image : mBmpFactory . OpenGallery ( ) ; break ; case id . user_location_rl : Intent intent = new Intent ( mContext , MyLoactionActivity . class ) ; <START_BUG> mContext . startActivityForResult ( intent , GET_LOCATION ) ; <END_BUG> default : break ; } } @ Override public void onUpdateSuccess ( ) { } @ Override public void onUpdateFailure ( String msg ) { } @ Override public void onUploadImageSuccess ( ThingsImage image ) { } @ Override public void onUploadImageProgress ( Integer arg0 ) { } @ Override public void onUploadImageFailure ( String msg ) { } }

Fix:
startActivityForResult ( intent , GET_LOCATION ) ;
Buggy code:
public class ArgsParser { private final StateKeeper state ; private final HttpWrapper wrapper ; @ Inject public ArgsParser ( StateKeeper state , HttpWrapper wrapper ) { } public void run ( String [ ] args ) throws Exception { state . begin ( ) ; try { wrapper . authenticate ( args [ 0 ] , args [ 1 ] ) ; <START_BUG> Welcome welcome = wrapper . requestNoCookies ( "http:////localhost:9006//rest//users//welcome" , Welcome . class ) ; <END_BUG> System . out . println ( welcome . getMessage ( ) ) ; } catch ( Exception ex ) { System . out . println ( String . format ( "%s:<seq2seq4repair_space>%s" , ex . getClass ( ) . getSimpleName ( ) , ex . getMessage ( ) ) ) ; } finally { state . end ( ) ; } } }

Fix:
Welcome welcome = wrapper . request ( "http:////localhost:9006//rest//users//welcome" , Welcome . class ) ;
Buggy code:
public class AHPlayer extends AHBase < Player > { @ Override public Player parse ( String str , String style , CommandSender sender , MPlugin p ) { this . error = null ; if ( str == null ) return null ; <START_BUG> if ( style . equals ( "match" ) ) { <END_BUG> List < Player > players = Bukkit . getServer ( ) . matchPlayer ( str ) ; if ( ( players . size ( ) ) > 0 ) { return players . get ( 0 ) ; } this . error = ( "<b>No<seq2seq4repair_space>online<seq2seq4repair_space>player\'s<seq2seq4repair_space>name<seq2seq4repair_space>begins<seq2seq4repair_space>with<seq2seq4repair_space>\"<p>" + str ) + "<b>\"." ; } else { Player player = Bukkit . getServer ( ) . getPlayer ( str ) ; if ( player != null ) { return player ; } this . error = ( "<b>No<seq2seq4repair_space>player<seq2seq4repair_space>online<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>exact<seq2seq4repair_space>name<seq2seq4repair_space>\"<p>" + str ) + "<b>\"." ; } return null ; } }

Fix:
if ( ( style != null ) && ( style . equals ( "match" ) ) ) {
Buggy code:
public class ColumbaCmdLineParser { private static final String RESOURCE_PATH = "org.columba.core.i18n.global" ; private static CmdLineParser parser ; private static Option help ; private static Option version ; private static Option debug ; private static Option path ; protected String pathOption ; public ColumbaCmdLineParser ( ) { } public void parseCmdLine ( String [ ] args ) throws IllegalArgumentException { } private void checkHelp ( ) { } private void checkVersion ( ) { } private void checkDebug ( ) { Boolean debugValue = ( ( Boolean ) ( ColumbaCmdLineParser . parser . getOptionValue ( ColumbaCmdLineParser . debug ) ) ) ; if ( debugValue != null ) { <START_BUG> MainInterface . DEBUG = debugValue . booleanValue ( ) ; <END_BUG> } } private void checkPath ( ) { } public String getPathOption ( ) { } public void setPathOption ( String string ) { } public static void printUsage ( ) { } public static void printVersionInfo ( ) { } }

Fix:
Main . DEBUG = debugValue . booleanValue ( ) ;
Buggy code:
public class EdgesState { int [ ] [ ] pos ; EdgesState ( ) { } public String toString ( ) { } public int encode ( int group ) { int [ ] aux1 = new int [ 6 ] ; int aux2 = 0 ; for ( int i = 0 ; i < 6 ; ++ i ) { int x = pos [ i ] [ 0 ] ; <START_BUG> int y = pos [ i ] [ 0 ] ; <END_BUG> for ( int j = 0 ; j < 12 ; ++ j ) { int a = Cube . edgePairs [ j ] [ 0 ] ; if ( x == a ) { aux1 [ i ] = j ; aux2 = aux2 * 2 ; } else if ( y == a ) { aux1 [ i ] = j ; aux2 = ( aux2 * 2 ) + 1 ; } } } boolean [ ] used = new boolean [ 12 ] ; int ret = 0 ; for ( int i = 0 ; i < 6 ; ++ i ) { int cont = 0 ; for ( int j = 0 ; j < ( aux1 [ i ] ) ; ++ j ) if ( ! ( used [ j ] ) ) ++ cont ; used [ aux1 [ i ] ] = true ; aux1 [ i ] = cont ; } int count = 1 ; for ( int i = 1 ; i <= 12 ; ++ i ) count *= i ; for ( int i = 1 ; i <= 6 ; ++ i ) count //= i ; for ( int i = 0 ; i < 6 ; ++ i ) { count = count // ( 12 - i ) ; ret += count * ( aux1 [ i ] ) ; } for ( int i = 0 ; i < 6 ; ++ i ) ret *= 2 ; ret += aux2 ; return ret ; } static EdgesState decode ( int coded ) { } }

Fix:
int y = pos [ i ] [ 1 ] ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class UndeployWildcardTestCase { @ ArquillianResource URL url ; private static File [ ] appFiles ; private CommandContext ctx ; @ Deployment public static Archive < ? > getDeployment ( ) { } @ BeforeClass public static void before ( ) throws Exception { } @ AfterClass public static void after ( ) throws Exception { } private Set < String > afterTestDeployments ; @ Before public void beforeTest ( ) throws Exception { } @ After public void afterTest ( ) throws Exception { StringBuilder buf = null ; for ( File f : UndeployWildcardTestCase . appFiles ) { ctx . handleSafe ( ( "undeploy<seq2seq4repair_space>" + ( f . getName ( ) ) ) ) ; if ( ( ctx . getExitCode ( ) ) == 0 ) { if ( ! ( afterTestDeployments . remove ( f . getName ( ) ) ) ) { if ( buf == null ) { buf = new StringBuilder ( ) ; <START_BUG> buf . append ( "Undeployment<seq2seq4repair_space>unexpected<seq2seq4repair_space>content:<seq2seq4repair_space>" ) ; <END_BUG> buf . append ( f . getName ( ) ) ; } else { buf . append ( ",<seq2seq4repair_space>" ) . append ( f . getName ( ) ) ; } } } } ctx . terminateSession ( ) ; if ( buf != null ) { fail ( buf . toString ( ) ) ; } if ( ( afterTestDeployments . size ( ) ) > 0 ) { fail ( ( "Expected<seq2seq4repair_space>to<seq2seq4repair_space>undeploy<seq2seq4repair_space>but<seq2seq4repair_space>failed<seq2seq4repair_space>to:<seq2seq4repair_space>" + ( afterTestDeployments ) ) ) ; } } @ Test public void testUndeployAllWars ( ) throws Exception { } @ Test public void testUndeployCliTestApps ( ) throws Exception { } @ Test public void testUndeployTestAps ( ) throws Exception { } @ Test public void testUndeployTestAs ( ) throws Exception { } @ Test public void testUndeployTestAWARs ( ) throws Exception { } }

Fix:
buf . append ( "Undeployed<seq2seq4repair_space>unexpected<seq2seq4repair_space>content:<seq2seq4repair_space>" ) ;
Buggy code:
public class ScrollBar extends Widget { int handle ; int visibleRgn ; int oldActionProc ; Scrollable parent ; boolean dragging ; int increment = 1 ; int pageIncrement = 10 ; ScrollBar ( ) { } ScrollBar ( Scrollable parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } int actionProc ( int theControl , int partCode ) { } void destroyWidget ( ) { } void enableWidget ( boolean enabled ) { } void createHandle ( ) { } void createWidget ( ) { } void deregister ( ) { } int getDrawCount ( int control ) { } public boolean getEnabled ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public Scrollable getParent ( ) { } public int getSelection ( ) { } public Point getSize ( ) { } public int getThumb ( ) { } public boolean getVisible ( ) { } int getVisibleRegion ( int control , boolean clipChildren ) { } void hookEvents ( ) { super . hookEvents ( ) ; if ( ! ( OS . HIVIEW ) ) { int controlProc = display . controlProc ; int [ ] mask = new int [ ] { OS . kEventClassControl , OS . kEventControlDraw } ; int controlTarget = OS . GetControlEventTarget ( handle ) ; OS . InstallEventHandler ( controlTarget , controlProc , ( ( mask . length ) // 2 ) , mask , handle , null ) ; } <START_BUG> if ( ( parent . scrolledHandle ) == 0 ) { <END_BUG> oldActionProc = OS . GetControlAction ( handle ) ; OS . SetControlAction ( handle , actionProc ) ; } } void invalidateVisibleRegion ( int control ) { } void invalWindowRgn ( int window , int rgn ) { } boolean isDrawing ( int control ) { } public boolean isEnabled ( ) { } boolean isTrimHandle ( int trimHandle ) { } public boolean isVisible ( ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { } void redraw ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void register ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } void resetVisibleRegion ( int control ) { } public void setIncrement ( int value ) { } public void setEnabled ( boolean enabled ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } public void setSelection ( int value ) { } public void setThumb ( int value ) { } public void setValues ( int selection , int minimum , int maximum , int thumb , int increment , int pageIncrement ) { } public void setVisible ( boolean visible ) { } void setZOrder ( ) { } }

Fix:
if ( ( ( parent . state ) & ( CANVAS ) ) == 0 ) {
Buggy code:
public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator { private static final Comparator DEFAULT_PRECEDENCE_COMPARATOR = new AspectJPrecedenceComparator ( ) ; @ Override protected List sortAdvisors ( List advisors ) { } @ Override protected void extendAdvisors ( List candidateAdvisors ) { } @ Override protected boolean shouldSkip ( Class beanClass , String beanName ) { } private static class PartiallyComparableAdvisorHolder implements PartialComparable { private final Advisor advisor ; private final Comparator comparator ; public PartiallyComparableAdvisorHolder ( Advisor advisor , Comparator comparator ) { } public int compareTo ( Object obj ) { } public int fallbackCompareTo ( Object obj ) { } public Advisor getAdvisor ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> Advice advice = this . advisor . getAdvice ( ) ; sb . append ( ClassUtils . getShortName ( advice . getClass ( ) ) ) ; sb . append ( ":<seq2seq4repair_space>" ) ; if ( ( this . advisor ) instanceof Ordered ) { sb . append ( ( ( "order<seq2seq4repair_space>" + ( ( ( Ordered ) ( this . advisor ) ) . getOrder ( ) ) ) + ",<seq2seq4repair_space>" ) ) ; } if ( advice instanceof AbstractAspectJAdvice ) { AbstractAspectJAdvice ajAdvice = ( ( AbstractAspectJAdvice ) ( advice ) ) ; sb . append ( ajAdvice . getAspectName ( ) ) ; sb . append ( ",<seq2seq4repair_space>declaration<seq2seq4repair_space>order<seq2seq4repair_space>" ) ; sb . append ( ajAdvice . getDeclarationOrder ( ) ) ; } return sb . toString ( ) ; } } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class RequestResponseBodyMethodProcessor extends AbstractMessageConverterMethodProcessor { public RequestResponseBodyMethodProcessor ( List < HttpMessageConverter < ? > > messageConverters ) { } public boolean supportsParameter ( MethodParameter parameter ) { } public boolean supportsReturnType ( MethodParameter returnType ) { } public Object resolveArgument ( MethodParameter parameter , ModelAndViewContainer mavContainer , NativeWebRequest webRequest , WebDataBinderFactory binderFactory ) throws Exception { } protected boolean isValidationApplicable ( Object argumentValue , MethodParameter parameter ) { } public void handleReturnValue ( Object returnValue , MethodParameter returnType , ModelAndViewContainer mavContainer , NativeWebRequest webRequest ) throws IOException , HttpMediaTypeNotAcceptableException { <START_BUG> mavContainer . setResolveView ( false ) ; <END_BUG> if ( returnValue != null ) { writeWithMessageConverters ( returnValue , returnType , webRequest ) ; } } }

Fix:
mavContainer . setRequestHandled ( true ) ;
Buggy code:
public class TestArbitraryIndexDir extends AbstractSolrTestCase { static String savedFactory ; @ BeforeClass public static void beforeClass ( ) { } @ AfterClass public static void afterClass ( ) { } @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } @ Test public void testLoadNewIndexDir ( ) throws IOException , ParserConfigurationException , SAXException { assertU ( adoc ( "id" , String . valueOf ( 1 ) , "name" , ( "name" + ( String . valueOf ( 1 ) ) ) ) ) ; File idxprops = new File ( ( ( h . getCore ( ) . getDataDir ( ) ) + ( SnapPuller . INDEX_PROPERTIES ) ) ) ; Properties p = new Properties ( ) ; File newDir = new File ( ( ( h . getCore ( ) . getDataDir ( ) ) + "index_temp" ) ) ; newDir . mkdirs ( ) ; p . put ( "index" , newDir . getName ( ) ) ; Writer os = null ; try { os = new OutputStreamWriter ( new FileOutputStream ( idxprops ) , IOUtils . CHARSET_UTF_8 ) ; p . store ( os , "index<seq2seq4repair_space>properties" ) ; } catch ( Exception e ) { throw new org . apache . solr . common . SolrException ( ErrorCode . SERVER_ERROR , ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>" + ( SnapPuller . INDEX_PROPERTIES ) ) , e ) ; } finally { IOUtils . closeWhileHandlingException ( os ) ; } Directory dir = newFSDirectory ( newDir ) ; <START_BUG> IndexWriter iw = new IndexWriter ( dir , new org . apache . lucene . index . IndexWriterConfig ( Version . LUCENE_40 , new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_40 ) ) ) ; <END_BUG> Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . TextField ( "id" , "2" , Store . YES ) ) ; doc . add ( new org . apache . lucene . document . TextField ( "name" , "name2" , Store . YES ) ) ; iw . addDocument ( doc ) ; iw . commit ( ) ; iw . close ( ) ; assertU ( commit ( ) ) ; assertQ ( "return<seq2seq4repair_space>doc<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>2" , req ( "id:2" ) , "*[count(////doc)=1]" ) ; dir . close ( ) ; newDir . delete ( ) ; } }

Fix:
IndexWriter iw = new IndexWriter ( dir , new org . apache . lucene . index . IndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . standard . StandardAnalyzer ( TEST_VERSION_CURRENT ) ) ) ;
Buggy code:
public class PropertyPopulator implements ICellPopulator { private static final long serialVersionUID = 1L ; private String property ; public PropertyPopulator ( String property ) { } public void populateItem ( Item cellItem , String componentId , IModel rowModel ) { <START_BUG> cellItem . add ( new wicket . markup . html . basic . Label ( cellItem , componentId , new wicket . model . PropertyModel ( rowModel , property ) ) ) ; <END_BUG> } }

Fix:
new wicket . markup . html . basic . Label ( cellItem , componentId , new wicket . model . PropertyModel ( rowModel , property ) ) ;
Buggy code:
public class MapImage extends MapObject { protected boolean useCache ; protected byte [ ] cachedImage ; protected Image image ; protected ImageIcon imageIcon ; protected int width = 0 ; protected int height = 0 ; protected String fileTag ; protected String actualFile = null ; public MapImage ( String xTag , String yTag , String visibilityTag , boolean debug , String fileTag , int width , int height ) { } public MapImage ( String xTag , String yTag , String visibilityTag , boolean debug , String fileTag , int width , int height , boolean useCache ) { } protected void setImage ( Image image ) { } @ Override public Map < String , Object > getSaveData ( ) { } @ Override public void render ( MapView mapView , MapCanvas mapCanvas , dPlayer player , UUID uuid ) { } private static final Color [ ] bukkitColors ; private static byte [ ] imageToBytes ( Image image , int width , int height ) { <START_BUG> BufferedImage temp = new BufferedImage ( width , height , BufferedImage . TYPE_INT_ARGB ) ; <END_BUG> Graphics2D graphics = temp . createGraphics ( ) ; graphics . drawImage ( image , 0 , 0 , width , height , null ) ; graphics . dispose ( ) ; int [ ] pixels = new int [ width * height ] ; temp . getRGB ( 0 , 0 , width , height , pixels , 0 , width ) ; byte [ ] result = new byte [ width * height ] ; for ( int i = 0 ; i < ( pixels . length ) ; i ++ ) { result [ i ] = MapImage . matchColor ( new Color ( pixels [ i ] ) ) ; } return result ; } private static byte matchColor ( Color color ) { } private static double getDistance ( Color c1 , Color c2 ) { } }

Fix:
BufferedImage temp = new BufferedImage ( image . getWidth ( null ) , image . getHeight ( null ) , BufferedImage . TYPE_INT_ARGB ) ;
Buggy code:
class WikiLinkTokenizerMap extends Mapper < LongWritable , Text , Text , Text > { Logger log = Logger . getLogger ( "de.tudarmstadt.lt.wiki" ) ; Map < String , String > redirects = new HashMap < > ( ) ; AnalysisEngine engine ; JCas jCas ; public AnalysisEngineDescription buildAnalysisEngine ( ) throws ResourceInitializationException { } @ Override public void setup ( Context context ) throws IOException { } @ Override public void map ( LongWritable key , Text value , Context context ) throws IOException , InterruptedException { try { String [ ] valueParts = value . toString ( ) . split ( "\t" ) ; String linkTextLemma = valueParts [ 0 ] ; String text = valueParts [ 1 ] ; String link = valueParts [ 2 ] ; <START_BUG> String target = link . split ( "@@" ) [ 0 ] . split ( "@" ) [ 0 ] ; <END_BUG> jCas . reset ( ) ; jCas . setDocumentText ( text ) ; jCas . setDocumentLanguage ( "en" ) ; engine . process ( jCas ) ; List < Token > tokens = new ArrayList < Token > ( JCasUtil . select ( jCas , Token . class ) ) ; StringBuilder tokenizedText = new StringBuilder ( ) ; for ( int i = 0 ; i < ( tokens . size ( ) ) ; i ++ ) { Token token = tokens . get ( i ) ; String tokenLemma = token . getLemma ( ) . getValue ( ) ; tokenizedText . append ( tokenLemma ) ; if ( i != ( ( tokens . size ( ) ) - 1 ) ) { tokenizedText . append ( "<seq2seq4repair_space>" ) ; } } context . write ( new Text ( linkTextLemma ) , new Text ( ( ( target + "\t" ) + tokenizedText ) ) ) ; } catch ( RuntimeException | UIMAException e ) { log . error ( ( "Can't<seq2seq4repair_space>process<seq2seq4repair_space>line:<seq2seq4repair_space>" + ( value . toString ( ) ) ) , e ) ; } } No newline ; at end ; of file ; }

Fix:
String target = link . split ( "@@" ) [ 1 ] . split ( "@" ) [ 0 ] ;
Buggy code:
public class __TestStandaloneClient { public static void main ( String [ ] args ) throws Exception { System . out . println ( "Creating<seq2seq4repair_space>client" ) ; StandaloneClient client = Factory . create ( InetAddress . getByName ( "localhost" ) , 9999 ) ; System . out . println ( "Created<seq2seq4repair_space>client,<seq2seq4repair_space>getting<seq2seq4repair_space>model..." ) ; ServerModel model = client . getServerModel ( ) ; System . out . println ( ( "Got<seq2seq4repair_space>model<seq2seq4repair_space>" + model ) ) ; List < AbstractServerModelUpdate < ? > > updates = new ArrayList < AbstractServerModelUpdate < ? > > ( ) ; updates . add ( new org . jboss . as . model . ServerPathAdd ( new PathElementUpdate ( "org.jboss.test" , "//home//emuckenh//Downloads" , null ) ) ) ; for ( final StandaloneUpdateResult < ? > result : client . applyUpdates ( updates ) ) { if ( result . isSuccess ( ) ) { System . out . println ( result . getResult ( ) ) ; } else { result . getFailure ( ) . printStackTrace ( System . out ) ; } } System . out . println ( "Created<seq2seq4repair_space>client,<seq2seq4repair_space>getting<seq2seq4repair_space>dm..." ) ; ServerDeploymentManager manager = client . getDeploymentManager ( ) ; System . out . println ( ( "Got<seq2seq4repair_space>manager<seq2seq4repair_space>" + manager ) ) ; File file = new File ( "sar-example.sar" ) ; if ( ! ( file . exists ( ) ) ) { throw new IllegalStateException ( "No<seq2seq4repair_space>file<seq2seq4repair_space>sar-example.sar" ) ; } String deployment = manager . addDeploymentContent ( file . toURL ( ) ) ; System . out . println ( ( "Added<seq2seq4repair_space>deployment<seq2seq4repair_space>" + deployment ) ) ; <START_BUG> Future < ServerDeploymentPlanResult > deploymentResult = manager . execute ( manager . newDeploymentPlan ( ) . deploy ( deployment ) . build ( ) ) ; <END_BUG> System . out . println ( ( "Deployment<seq2seq4repair_space>result:" + deploymentResult ) ) ; System . out . println ( ( "Contained<seq2seq4repair_space>deployment<seq2seq4repair_space>result:" + ( deploymentResult . get ( ) ) ) ) ; } }

Fix:
Future < ServerDeploymentPlanResult > deploymentResult = manager . execute ( manager . newDeploymentPlan ( ) . add ( deployment , file ) . deploy ( deployment ) . build ( ) ) ;
Buggy code:
public class JsonQuerySubmitTest extends SystemTestBase { static Logger LOGGER = LoggerFactory . getLogger ( JsonQuerySubmitTest . class ) ; private HttpURLConnection submitQuery ( final QueryEncoding query ) throws IOException { } public static String emptyIngest ( ) throws JsonProcessingException { } public static String ingest ( final RelationKey key , final Schema schema , final DataSource source , @ Nullable final Character delimiter ) throws JsonProcessingException { } @ Override public Map < Integer , SocketInfo > getWorkers ( ) { } @ Test public void emptySubmitTest ( ) throws Exception { } @ Test public void datasetPutTest ( ) throws Exception { } @ Test public void ingestTest ( ) throws Exception { } @ Test public void jsonQuerySubmitTest ( ) throws Exception { File queryJson = new File ( ".//jsonQueries//sample_queries//single_join.json" ) ; File ingestJson = new File ( ".//jsonQueries//globalJoin_jwang//ingest_smallTable.json" ) ; HttpURLConnection conn = JsonAPIUtils . submitQuery ( "localhost" , masterDaemonPort , queryJson ) ; <START_BUG> assertEquals ( conn . getResponseCode ( ) , HttpURLConnection . HTTP_BAD_REQUEST ) ; <END_BUG> conn . disconnect ( ) ; conn = JsonAPIUtils . ingestData ( "localhost" , masterDaemonPort , ingestJson ) ; if ( null != ( conn . getErrorStream ( ) ) ) { throw new IllegalStateException ( getContents ( conn ) ) ; } assertEquals ( HttpURLConnection . HTTP_CREATED , conn . getResponseCode ( ) ) ; conn . disconnect ( ) ; String data = JsonAPIUtils . download ( "localhost" , masterDaemonPort , "jwang" , "global_join" , "smallTable" , "json" ) ; String subStr = "{\"follower\":46,\"followee\":17}" ; assertTrue ( data . contains ( subStr ) ) ; conn = JsonAPIUtils . submitQuery ( "localhost" , masterDaemonPort , queryJson ) ; if ( null != ( conn . getErrorStream ( ) ) ) { throw new IllegalStateException ( getContents ( conn ) ) ; } assertEquals ( HttpURLConnection . HTTP_ACCEPTED , conn . getResponseCode ( ) ) ; long queryId = getQueryStatus ( conn ) . queryId ; conn . disconnect ( ) ; while ( ! ( server . getQueryManager ( ) . queryCompleted ( queryId ) ) ) { Thread . sleep ( 100 ) ; } QueryStatusEncoding status = server . getQueryManager ( ) . getQueryStatus ( queryId ) ; assertEquals ( SUCCESS , status . status ) ; assertTrue ( status . language . equals ( "datalog" ) ) ; assertEquals ( status . ftMode , NONE ) ; assertEquals ( status . profilingMode . size ( ) , 0 ) ; assertTrue ( ( ( status . plan ) instanceof SubQueryEncoding ) ) ; assertEquals ( ( ( SubQueryEncoding ) ( status . plan ) ) . fragments . size ( ) , 3 ) ; } @ Test public void joinChainResultTest ( ) throws Exception { } @ Test public void abortedDownloadTest ( ) throws Exception { } @ Test public void multiwayBetweenSingletonTest693 ( ) throws Exception { } @ Test public void severalMultiwayBetweenSingletonTest ( ) throws Exception { } @ Test public void severalMultiwayBetweenSingletonTestNewOpIds ( ) throws Exception { } }

Fix:
assertEquals ( HttpURLConnection . HTTP_BAD_REQUEST , conn . getResponseCode ( ) ) ;
Buggy code:
public class AtomicStack < T > implements Stack < T > { private static final long serialVersionUID = - 8663234127316351574L ; private static final int DEFAULT_CAPACITY = 16 ; private final Semaphore permissionToModifyStack = new Semaphore ( 1 ) ; @ SuppressWarnings ( "unchecked" ) private T [ ] stackVector = ( ( T [ ] ) ( new Object [ AtomicStack . DEFAULT_CAPACITY ] ) ) ; private int head = - 1 ; @ Override public boolean empty ( ) { } @ Override public T peek ( ) { } @ Override public T pop ( ) throws InterruptedException { try { permissionToModifyStack . acquire ( ) ; if ( empty ( ) ) throw new EmptyStackException ( ) ; final T element = stackVector [ head ] ; <START_BUG> stackVector [ ( ( head ) ++ ) ] = null ; <END_BUG> return element ; } finally { permissionToModifyStack . release ( ) ; } } @ Override public T push ( T item ) throws InterruptedException { } private void expand ( ) { } private boolean hasReachedCapacity ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
stackVector [ ( ( head ) -- ) ] = null ;
Buggy code:
public class TimerServiceAdd extends AbstractBoottimeAddStepHandler { private static final Logger logger = Logger . getLogger ( TimerServiceAdd . class ) ; public static final TimerServiceAdd INSTANCE = new TimerServiceAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode timerServiceModel ) throws OperationFailedException { } protected void performBoottime ( final OperationContext context , ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { final ModelNode rootResource = context . getRootResource ( ) . getChild ( PathElement . pathElement ( SUBSYSTEM , SUBSYSTEM_NAME ) ) . getModel ( ) ; final boolean lite = ( rootResource . hasDefined ( LITE ) ) && ( rootResource . get ( LITE ) . asBoolean ( ) ) ; if ( ! lite ) { final ModelNode pathNode = PATH . validateResolvedOperation ( model ) ; final String path = ( pathNode . isDefined ( ) ) ? pathNode . asString ( ) : null ; final ModelNode relativeToNode = RELATIVE_TO . validateResolvedOperation ( model ) ; final String relativeTo = ( relativeToNode . isDefined ( ) ) ? relativeToNode . asString ( ) : null ; final int coreThreadCount = CORE_THREADS . validateResolvedOperation ( model ) . asInt ( ) ; final int maxThreadCount = CORE_THREADS . validateResolvedOperation ( model ) . asInt ( Runtime . getRuntime ( ) . availableProcessors ( ) ) ; context . addStep ( new AbstractDeploymentChainStep ( ) { protected void execute ( DeploymentProcessorTarget processorTarget ) { TimerServiceAdd . logger . debug ( "Configuring<seq2seq4repair_space>timers" ) ; ModelNode timerServiceModel = model ; if ( path != null ) { if ( relativeTo != null ) { <START_BUG> RelativePathService . addService ( PATH_SERVICE_NAME , path , relativeTo , context . getServiceTarget ( ) , newControllers , verificationHandler ) ; <END_BUG> } else { AbsolutePathService . addService ( PATH_SERVICE_NAME , path , context . getServiceTarget ( ) , newControllers , verificationHandler ) ; } } processorTarget . addDeploymentProcessor ( PARSE , PARSE_TIMEOUT_ANNOTATION , new TimerServiceAnnotationProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( PARSE , PARSE_AROUNDTIMEOUT_ANNOTATION , new AroundTimeoutAnnotationParsingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( POST_MODULE , POST_MODULE_EJB_TIMER_METADATA_MERGE , new TimerMethodMergingProcessor ( ) ) ; processorTarget . addDeploymentProcessor ( POST_MODULE , POST_MODULE_EJB_TIMER_SERVICE , new TimerServiceDeploymentProcessor ( coreThreadCount , maxThreadCount , true ) ) ; } } , RUNTIME ) ; } } }

Fix:
RelativePathService . addService ( PATH_SERVICE_NAME , path , false , relativeTo , context . getServiceTarget ( ) , newControllers , verificationHandler ) ;
Buggy code:
public class TestDoc extends LuceneTestCase { private File workDir ; private File indexDir ; private LinkedList < File > files ; @ Override public void setUp ( ) throws Exception { } private File createOutput ( String name , String text ) throws IOException { } public void testIndexAndMerge ( ) throws Exception { } private SegmentInfoPerCommit indexDoc ( IndexWriter writer , String fileName ) throws Exception { File file = new File ( workDir , fileName ) ; Document doc = new Document ( ) ; InputStreamReader is = new InputStreamReader ( new FileInputStream ( file ) , "UTF-8" ) ; <START_BUG> doc . add ( new org . apache . lucene . document . TextField ( "contents" , is , Store . NO ) ) ; <END_BUG> writer . addDocument ( doc ) ; writer . commit ( ) ; is . close ( ) ; return writer . newestSegment ( ) ; } private SegmentInfoPerCommit merge ( Directory dir , SegmentInfoPerCommit si1 , SegmentInfoPerCommit si2 , String merged , boolean useCompoundFile ) throws Exception { } private void printSegment ( PrintWriter out , SegmentInfoPerCommit si ) throws Exception { } }

Fix:
doc . add ( new TextField ( "contents" , is ) ) ;
Buggy code:
public class Polynomial { Vector < PolyTerm > terms ; public Polynomial ( Collection < PolyTerm > terms ) { } public Polynomial ( String expr ) { } public Polynomial add ( Polynomial poly ) { } public Polynomial mul ( Polynomial poly ) { } public Scalar evaluate ( Scalar scalar ) { } public Polynomial derivate ( ) { } @ Override public boolean equals ( Object obj ) { } private void sortTerms ( ) { terms . sort ( new Comparator < PolyTerm > ( ) { @ Override public int compare ( PolyTerm o1 , PolyTerm o2 ) { return ( o1 . getExponent ( ) ) - ( o2 . getExponent ( ) ) ; } } ) ; for ( int i = 0 ; i < ( terms . size ( ) ) ; i ++ ) { if ( terms . get ( i ) . getCoefficient ( ) . isZero ( ) ) <START_BUG> terms . remove ( i ) ; <END_BUG> while ( ( ( i + 1 ) < ( terms . size ( ) ) ) && ( ( terms . get ( ( i + 1 ) ) . getExponent ( ) ) == ( terms . get ( i ) . getExponent ( ) ) ) ) { PolyTerm sum = terms . get ( i ) . add ( terms . get ( ( i + 1 ) ) ) ; terms . remove ( i ) ; terms . remove ( i ) ; terms . add ( sum ) ; } } } @ Override public String toString ( ) { } }

Fix:
terms . remove ( ( i -- ) ) ;
Buggy code:
public class SOWrapper { protected ISharedObject sharedObject ; private SOConfig sharedObjectConfig ; ID sharedObjectID ; private SOContainer container ; private ID containerID ; private Thread thread ; SimpleFIFOQueue queue ; protected SOWrapper ( SOContainer . LoadingSharedObject obj , SOContainer cont ) { } public SOWrapper ( SOConfig aConfig , ISharedObject obj , SOContainer cont ) { } protected void init ( ) throws SharedObjectInitException { } protected ID getObjID ( ) { } protected ID getHomeID ( ) { } protected SOConfig getConfig ( ) { } protected void activated ( ) { } protected void deactivated ( ) { } protected void destroyed ( ) { } protected void otherChanged ( ID otherID , boolean activated ) { } protected void memberChanged ( Member m , boolean add ) { } protected Thread getThread ( ) { } private void send ( Event evt ) { } public static class ProcEvent implements Event { private static final long serialVersionUID = 3257002142513378616L ; Event theEvent = null ; public ProcEvent ( Event event ) { } Event getEvent ( ) { } } protected static class DisposeEvent implements Event { private static final long serialVersionUID = 3688503311859135536L ; DisposeEvent ( ) { } } protected void svc ( Event evt ) { } protected void doDestroy ( ) { } protected void deliverSharedObjectMessage ( ID fromID , Serializable data ) { } protected void deliverCreateResponse ( ID fromID , ContainerMessage . CreateResponseMessage resp ) { } public void deliverEvent ( Event evt ) { } protected void destroySelf ( ) { } public String toString ( ) { } protected void debug ( String msg ) { <START_BUG> Trace . trace ( PLUGIN_ID , DEBUG , ( ( ( ( ( "SOWrapper:oID=" + ( sharedObjectID ) ) + ":" ) + msg ) + ":cID=" ) + ( container . getID ( ) ) ) ) ; <END_BUG> } protected void traceStack ( String msg , Throwable e ) { } protected void handleRuntimeException ( Throwable except ) { } protected ISharedObject getSharedObject ( ) { } public SimpleFIFOQueue getQueue ( ) { } }

Fix:
Trace . trace ( PLUGIN_ID , SHAREDOBJECTWRAPPER , ( ( ( ( msg + ":oID=" ) + ( sharedObjectID ) ) + ":cID=" ) + ( container . getID ( ) ) ) ) ;
Buggy code:
public class IncrementalStateManager { public static boolean recordIncrementalStates = false ; public static boolean debugIncrementalStates = false ; private static Hashtable incrementalStates = new Hashtable ( ) ; public static void recordSuccessfulBuild ( String buildConfig , AjState state ) { } public static boolean removeIncrementalStateInformationFor ( String buildConfig ) { } public static void clearIncrementalStates ( ) { for ( Iterator iter = IncrementalStateManager . incrementalStates . values ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { AjState element = ( ( AjState ) ( iter . next ( ) ) ) ; element . wipeAllKnowledge ( ) ; } IncrementalStateManager . incrementalStates . clear ( ) ; <START_BUG> AsmManager . getDefault ( ) . createNewASM ( null ) ; <END_BUG> } public static Set getConfigFilesKnown ( ) { } public static AjState retrieveStateFor ( String configFile ) { } public static AjState findStateManagingOutputLocation ( File location ) { } }

Fix:
AsmManager . getDefault ( ) . createNewASM ( ) ;