nus-yam/ex-repair huggingface dataset:
Buggy code:
public class HandMT implements Parcelable , Hand { private static final boolean enableExperimentalUndoHistory = true ; private ArrayList < Domino > dominoHandHistory ; private ArrayList < Domino > currentHand ; private RunController runController ; private int totalPointsHand = 0 ; private int totalDominos ; private final int MAXIMUM_DOUBLE ; private final int ORIGINAL_TRAIN_HEAD ; private int trainHead ; private Stack < Domino > playHistory = new Stack < > ( ) ; private Stack < Integer > trainHeadHistory = new Stack < > ( ) ; private Stack < Integer > positionsAffectedHistory = new Stack < > ( ) ; private Stack < Pair < DominoRun , DominoRun > > runsHistory = new Stack < > ( ) ; private Stack < HandMT . PlayType > undoTypeHistory = new Stack < > ( ) ; private enum PlayType { ADDED_DOMINO , PLAYED_DOMINO , CHANGED_TRAIN_HEAD , CHANGED_DOMINO ; } public HandMT ( List < Domino > dominoes , int largestDouble , int startHead ) { } public HandMT ( int largestDouble , int startHead ) { } public HandMT ( Parcel p ) { } public void addDomino ( Domino d ) { } public void replaceDomino ( Domino oldDomino , Domino newDomino ) { } public static int findDomino ( ArrayList < Domino > list , Domino d ) { } public boolean existsInCurrentHand ( Domino d ) { } private void removeDomino ( Domino d ) { } public Domino getDomino ( int position , GameWindowMT . WindowContext playContext ) { } public void dominoPlayed ( int position , GameWindowMT . WindowContext playContext ) { Domino toRemove = getDomino ( position , playContext ) ; playHistory . push ( toRemove ) ; <START_BUG> positionsAffectedHistory . push ( position ) ; <END_BUG> trainHeadHistory . push ( trainHead ) ; undoTypeHistory . push ( HandMT . PlayType . PLAYED_DOMINO ) ; rememberRuns ( ) ; if ( ( toRemove . getVal1 ( ) ) == ( trainHead ) ) { trainHead = toRemove . getVal2 ( ) ; } else if ( ( toRemove . getVal2 ( ) ) == ( trainHead ) ) { trainHead = toRemove . getVal1 ( ) ; } removeDomino ( toRemove ) ; } public boolean undo ( ) { } public DominoRun getLongestRun ( ) { } public DominoRun getMostPointRun ( ) { } public boolean runsAreUpToDate ( ) { } @ Override public int getTotalPointsHand ( ) { } public int getTotalDominos ( ) { } public Domino [ ] toArray ( ) { } public int [ ] [ ] smallArray ( ) { } public int getMaxDouble ( ) { } public int getTrainHead ( ) { } public void setTrainHead ( int head ) { } private void rememberRuns ( ) { } @ Override public int describeContents ( ) { } @ Override public void writeToParcel ( Parcel dest , int flags ) { } public static Creator CREATOR = new Parcelable . Creator ( ) { @ Override public HandMT createFromParcel ( Parcel source ) { } @ Override public HandMT [ ] newArray ( int size ) { } } ; }

Fix:
positionsAffectedHistory . push ( HandMT . findDomino ( currentHand , toRemove ) ) ;
Buggy code:
public class CompressionTools { private CompressionTools ( ) { } public static byte [ ] compress ( byte [ ] value , int offset , int length , int compressionLevel ) { } public static byte [ ] compress ( byte [ ] value , int offset , int length ) { } public static byte [ ] compress ( byte [ ] value ) { } public static byte [ ] compressString ( String value ) { } public static byte [ ] compressString ( String value , int compressionLevel ) { <START_BUG> BytesRef result = new BytesRef ( 10 ) ; <END_BUG> UnicodeUtil . UTF16toUTF8 ( value , 0 , value . length ( ) , result ) ; return CompressionTools . compress ( result . bytes , 0 , result . length , compressionLevel ) ; } public static byte [ ] decompress ( byte [ ] value ) throws DataFormatException { } public static String decompressString ( byte [ ] value ) throws DataFormatException { } }

Fix:
BytesRef result = new BytesRef ( ) ;
Buggy code:
public class FieldView implements CodeView < Field > , AnnotableView < Field > , DocumentableView < Field > , ModifiableView < Field > , NameableView < Field > , TypeableView < Field > , ValuableView < Field > { @ Override public Optional < String > render ( CodeGenerator cg , Field model ) { <START_BUG> return Optional . of ( ( ( ( ( ( ( renderJavadoc ( cg , model ) ) + ( renderAnnotation ( cg , model ) ) ) + ( renderModifiers ( cg , model ) ) ) + ( renderType ( cg , model ) ) ) + ( renderName ( cg , model ) ) ) + ( renderValue ( cg , model ) ) ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return Optional . of ( ( ( ( ( ( ( renderJavadoc ( cg , model ) ) + ( renderAnnotations ( cg , model ) ) ) + ( renderModifiers ( cg , model ) ) ) + ( renderType ( cg , model ) ) ) + ( renderName ( cg , model ) ) ) + ( renderValue ( cg , model ) ) ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class ProjectPanel extends JPanel { private static BufferedImage imgPlay ; private static BufferedImage imgEdit ; private static BufferedImage imgDelete ; private static BufferedImage imgRed ; private static BufferedImage imgYellow ; private static BufferedImage imgGreen ; static JFileChooser fileChooser ; int noOfStacks ; private Box b ; JLabel lblStatus ; JLabel lblText ; private JButton btnPlay ; private JButton btnEdit ; private JButton btnDelete ; private Status status ; private String name ; private JPopupMenu popupEdit ; private JMenuItem popupEditChangeName ; private JMenuItem popupEditChangeNoOfStacks ; private JMenuItem popupEditAddCards ; private JMenuItem popupEditOrganizeCards ; private JMenuItem popupEditResetProgress ; private MainWindow parentWindow ; private ProjectsController ctl ; private LearningProject project ; private ArrayList < FlashCard > cards ; public enum DialogType { EDIT , ADD , RESET , PLAY , CHANGE_STACKS ; } ProjectPanel ( LearningProject project , MainWindow parentWindow , ProjectsController ctl ) { } MainWindow getOwner ( ) { } LearningProject getProject ( ) { } private void addWidgets ( ) { } private void createWidgets ( ) { } JFileChooser getFileChooser ( ) { } void addCard ( FlashCard card ) { } void removeCard ( FlashCard card ) { } Status getStatus ( ) { } private void setStatus ( Status s ) { } void changeStatus ( Status s ) { } private void setListeners ( ) { } private void showAddFlashcardsDialog ( ) { cards = project . getAllCards ( ) ; AddFlashcardDialog d ; try { <START_BUG> d = new AddFlashcardDialog ( project , this ) ; <END_BUG> d . setVisible ( true ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } private void showEditFlashcardsDialog ( ) { } private void resetProgress ( ) { } private void prepareLearningSession ( ) { } private void showChangeStacksDialog ( ) { } public void resume ( ProjectPanel . DialogType type ) { } }

Fix:
d = new AddFlashcardDialog ( null , project , this ) ;
Buggy code:
public class Initializer extends FieldDeclaration { public Block block ; public int lastFieldID ; public int bodyStart ; public Initializer ( Block block , int modifiers ) { } public FlowInfo analyseCode ( MethodScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public boolean isField ( ) { } public boolean isStatic ( ) { } public void parseStatements ( Parser parser , TypeDeclaration type , CompilationUnitDeclaration unit ) { } public void resolve ( MethodScope scope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , MethodScope scope ) { if ( visitor . visit ( this , scope ) ) { block . traverse ( visitor , scope ) ; } <START_BUG> visitor . visit ( this , scope ) ; <END_BUG> } }

Fix:
visitor . endVisit ( this , scope ) ;
Buggy code:
public final class ConfigEventHandler { private final File configFile ; private final ConfigSyncable sync ; private final Configuration configuration ; private final String configVersion ; private final String modID ; private final Logger logger ; public ConfigEventHandler ( String modID , File configFile , ConfigSyncable sync , String configVersion ) { } private static String getModName ( String modID ) { } private static boolean isConfigVersionMismatch ( Configuration configuration ) { } public void activate ( ) { } private void backup ( File fileRef ) { final File fileBak = new File ( ( ( ( ( fileRef . getAbsolutePath ( ) ) + '_' ) + ( new SimpleDateFormat ( "yyyyMMdd_HHmmss" ) . format ( new Date ( ) ) ) ) + ".old" ) ) ; logger . warning ( "Your<seq2seq4repair_space>%s<seq2seq4repair_space>config<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>date<seq2seq4repair_space>and<seq2seq4repair_space>could<seq2seq4repair_space>cause<seq2seq4repair_space>issues.<seq2seq4repair_space>The<seq2seq4repair_space>existing<seq2seq4repair_space>file<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>renamed<seq2seq4repair_space>to<seq2seq4repair_space>%s<seq2seq4repair_space>and<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>one<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>generated." , ConfigEventHandler . getModName ( modID ) , fileBak . getName ( ) ) ; <START_BUG> logger . warning ( "%s<seq2seq4repair_space>will<seq2seq4repair_space>attempt<seq2seq4repair_space>to<seq2seq4repair_space>copy<seq2seq4repair_space>your<seq2seq4repair_space>old<seq2seq4repair_space>settings,<seq2seq4repair_space>but<seq2seq4repair_space>custom<seq2seq4repair_space>mod//tree<seq2seq4repair_space>settings<seq2seq4repair_space>will<seq2seq4repair_space>have<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>migrated<seq2seq4repair_space>manually." , ConfigEventHandler . getModName ( modID ) ) ; <END_BUG> final boolean success = fileRef . renameTo ( fileBak ) ; logger . warning ( "Rename<seq2seq4repair_space>%s<seq2seq4repair_space>successful." , ( success ? "was" : "was<seq2seq4repair_space>not" ) ) ; } public Configuration configuration ( ) { } private void loadConfig ( ) { } @ SubscribeEvent public void onConfigChanged ( OnConfigChangedEvent event ) { } private void saveConfig ( ) { } void syncConfig ( ) { } private void syncConfig ( boolean doLoad , Optional < Configuration > oldConfig ) { } @ Override public String toString ( ) { } }

Fix:
logger . warning ( "%s<seq2seq4repair_space>will<seq2seq4repair_space>attempt<seq2seq4repair_space>to<seq2seq4repair_space>copy<seq2seq4repair_space>your<seq2seq4repair_space>old<seq2seq4repair_space>settings." , ConfigEventHandler . getModName ( modID ) ) ;
Buggy code:
public class Test_org_eclipse_swt_widgets_FileDialog extends Test_org_eclipse_swt_widgets_Dialog { public Test_org_eclipse_swt_widgets_FileDialog ( String name ) { } public static void main ( String [ ] args ) { } protected void setUp ( ) { } protected void tearDown ( ) { } public void test_ConstructorLorg_eclipse_swt_widgets_Shell ( ) { <START_BUG> FileDialog fd = new FileDialog ( shell ) ; <END_BUG> try { new FileDialog ( null ) ; fail ( "No<seq2seq4repair_space>exception<seq2seq4repair_space>thrown<seq2seq4repair_space>for<seq2seq4repair_space>parent<seq2seq4repair_space>==<seq2seq4repair_space>null" ) ; } catch ( IllegalArgumentException e ) { } } public void test_ConstructorLorg_eclipse_swt_widgets_ShellI ( ) { } public void test_getFileName ( ) { } public void test_getFileNames ( ) { } public void test_getFilterExtensions ( ) { } public void test_getFilterNames ( ) { } public void test_getFilterPath ( ) { } public void test_open ( ) { } public void test_setFileNameLjava_lang_String ( ) { } public void test_setFilterExtensions$Ljava_lang_String ( ) { } public void test_setFilterNames$Ljava_lang_String ( ) { } public void test_setFilterPathLjava_lang_String ( ) { } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } FileDialog fileDialog ; }

Fix:
new FileDialog ( shell ) ;
Buggy code:
public interface KeyStore { KeyStoreAccessToken getAccessToken ( KeyStoreCredential credential ) throws CredentialInvalidException , KeyStoreAccessException { } <START_BUG> < X extends Key > Key getKey ( Class < X > keyClass , String keyLabel , KeyStoreAccessToken keyStoreAccessToken ) throws KeyNotFoundException , KeyStoreAccessException , InvalidKeyException ; <END_BUG> Key getKey ( String keyLabel , KeyStoreAccessToken keyStoreAccessToken ) throws KeyNotFoundException , KeyStoreAccessException , InvalidKeyException { } Key getKey ( String keyLabel ) throws KeyNotFoundException , KeyStoreAccessException , InvalidKeyException { } < X extends Key > void importKey ( String label , EncodedKey encodedKey , Class < X > keyType , KeyStoreAccessToken keyStoreAccessToken ) throws KeyStoreAccessException , InvalidKeyException { } void importKey ( String label , com . kloudtek . kryptotek . Key key , KeyStoreAccessToken keyStoreAccessToken ) throws KeyStoreAccessException { } void importKey ( String label , com . kloudtek . kryptotek . Key key ) throws KeyStoreAccessException { } void deleteKey ( String label ) throws KeyStoreAccessException { } @ NotNull RSAKeyPair generateRSAKeyPair ( String keyLabel , int keySize ) throws KeyStoreAccessException { } @ NotNull AESKey generateAESKey ( String keyLabel , int keySize ) throws KeyStoreAccessException { } @ NotNull AESKey generateAESKey ( String keyLabel , int keySize , DHPrivateKey dhPrivateKey , DHPublicKey dhPublicKey ) throws KeyStoreAccessException , InvalidKeyException { } @ NotNull AESKey generatePBEAESKey ( String keyLabel , char [ ] credential , int iterations , byte [ ] salt , int keyLen ) throws KeyStoreAccessException { } @ NotNull HMACKey generateHMACKey ( String keyLabel , DigestAlgorithm digestAlgorithm ) throws KeyStoreAccessException { } @ NotNull HMACKey generateHMACKey ( String keyLabel , DigestAlgorithm digestAlgorithm , DHPrivateKey dhPrivateKey , DHPublicKey dhPublicKey ) throws KeyStoreAccessException , InvalidKeyException { } @ NotNull DHKeyPair generateDHKeyPair ( String keyLabel , DHParameters parameterSpec ) throws KeyStoreAccessException { } }

Fix:
< X extends Key > X getKey ( Class < X > keyClass , String keyLabel , KeyStoreAccessToken keyStoreAccessToken ) throws KeyNotFoundException , KeyStoreAccessException , InvalidKeyException ;
Buggy code:
public class MessageDrivenComponentCreateService extends EJBComponentCreateService { private final Class < ? > messageListenerInterface ; private String resourceAdapterName ; private final Properties activationProps ; private final InjectedValue < PoolConfig > poolConfig = new InjectedValue < PoolConfig > ( ) ; private final InjectedValue < DefaultResourceAdapterService > defaultRANameService = new InjectedValue < DefaultResourceAdapterService > ( ) ; public MessageDrivenComponentCreateService ( final ComponentConfiguration componentConfiguration , final ApplicationExceptions ejbJarConfiguration ) { } @ Override protected BasicComponent createComponent ( ) { } PoolConfig getPoolConfig ( ) { } public InjectedValue < PoolConfig > getPoolConfigInjector ( ) { } public InjectedValue < DefaultResourceAdapterService > getDefaultRANameServiceInjector ( ) { } String getDefaultResourceAdapterName ( ) { } private ClassLoader getDeploymentClassLoader ( ) { } private EndpointDeployer getEndpointDeployer ( ) { } private < S > ServiceController < S > getRequiredService ( final ServiceName serviceName , final Class < S > expectedType ) { } private ServiceRegistry getServiceRegistry ( ) { } ServiceName getResourceAdapterServiceName ( ) { <START_BUG> final Collection < ServiceName > serviceNames = ConnectorServices . getResourceAdapterServiceNames ( this . resourceAdapterName ) ; <END_BUG> if ( ( serviceNames == null ) || ( serviceNames . isEmpty ( ) ) ) { throw EjbMessages . MESSAGES . failToFindResourceAdapter ( this . resourceAdapterName ) ; } return serviceNames . iterator ( ) . next ( ) ; } private String stripDotRarSuffix ( final String raName ) { } }

Fix:
final Collection < ServiceName > serviceNames = ConnectorServices . getResourceAdapterDependencies ( this . resourceAdapterName ) ;
Buggy code:
public class ValidatePasswordState extends AbstractValidationState { private final StateValues stateValues ; private final ConsoleWrapper theConsole ; public ValidatePasswordState ( ConsoleWrapper theConsole , final StateValues stateValues ) { } @ Override protected Collection < State > getValidationStates ( ) { } private State getRetryState ( ) { } private State getDetailedCheckState ( ) { return new State ( ) { @ Override public State execute ( ) { PasswordCheckResult result = stateValues . getOptions ( ) . getCheckUtil ( ) . check ( false , stateValues . getUserName ( ) , stateValues . getPassword ( ) ) ; final boolean warnResult = WARN . equals ( result . getResult ( ) ) ; final boolean rejectResult = REJECT . equals ( result . getResult ( ) ) ; switch ( stateValues . getOptions ( ) . getCheckUtil ( ) . getRestrictionLevel ( ) ) { case WARN : if ( ( warnResult || rejectResult ) && ( ! ( stateValues . isSilentOrNonInteractive ( ) ) ) ) { return confirmWeakPassword ( result ) ; } break ; case REJECT : if ( warnResult && ( ! ( stateValues . isSilentOrNonInteractive ( ) ) ) ) { return confirmWeakPassword ( result ) ; } if ( rejectResult ) { <START_BUG> return new ErrorState ( theConsole , result . getMessage ( ) , getRetryState ( ) ) ; <END_BUG> } break ; default : break ; } return ValidatePasswordState . this ; } } ; } private State confirmWeakPassword ( PasswordCheckResult result ) { } @ Override protected State getSuccessState ( ) { } }

Fix:
return new ErrorState ( theConsole , result . getMessage ( ) , getRetryState ( ) , stateValues ) ;
Buggy code:
public class CacheManager { private static final String LOGTAG = "CacheManager" ; private static final String cachedir = ( ( Simple . getCacheDir ( ) ) + "//" ) + "iconcache" ; @ Nullable public static Bitmap getIcon ( String filename ) { } @ Nullable public static Bitmap getIcon ( String filename , String src ) { } @ Nullable public static Drawable getAppIcon ( String packagename ) { String iconfile = ( "app." + packagename ) + ".icon" ; Bitmap icon = CacheManager . getIcon ( iconfile ) ; if ( icon != null ) return Simple . getDrawable ( icon ) ; try { String url = "https:////play.google.com//store//apps//details?id=" + packagename ; Log . d ( CacheManager . LOGTAG , ( "getIconFromAppStore:" + url ) ) ; String content = StaticUtils . getContentFromUrl ( url ) ; if ( content == null ) return null ; Pattern pattern = Pattern . compile ( "class=\"cover-image\"<seq2seq4repair_space>src=\"([^\"]*)\"" ) ; Matcher matcher = pattern . matcher ( content ) ; if ( ! ( matcher . find ( ) ) ) return null ; String iconurl = matcher . group ( 1 ) ; if ( iconurl . startsWith ( "////" ) ) iconurl = "http:" + iconurl ; Log . d ( CacheManager . LOGTAG , ( "getIconFromAppStore:" + iconurl ) ) ; <START_BUG> return Simple . getDrawable ( CacheManager . getIcon ( iconurl , iconfile ) ) ; <END_BUG> } catch ( Exception oops ) { OopsService . log ( CacheManager . LOGTAG , oops ) ; } return null ; } @ Nullable public static Drawable getWebIcon ( String website , String src ) { } }

Fix:
return Simple . getDrawable ( CacheManager . getIcon ( iconfile , iconurl ) ) ;
Buggy code:
public class LegendreRuleFactory extends BaseRuleFactory < Double > { @ Override protected Pair < Double [ ] , Double [ ] > computeRule ( int numberOfPoints ) { if ( numberOfPoints <= 0 ) { throw new org . apache . commons . math3 . exception . NotStrictlyPositiveException ( LocalizedFormats . NUMBER_OF_POINTS , numberOfPoints ) ; } if ( numberOfPoints == 1 ) { return new Pair < Double [ ] , Double [ ] > ( new Double [ ] { 0.0 } , new Double [ ] { 2.0 } ) ; } final Double [ ] previousPoints = getRuleInternal ( ( numberOfPoints - 1 ) ) . getFirst ( ) ; final Double [ ] points = new Double [ numberOfPoints ] ; final Double [ ] weights = new Double [ numberOfPoints ] ; final int iMax = numberOfPoints // 2 ; for ( int i = 0 ; i < iMax ; i ++ ) { double a = ( i == 0 ) ? - 1 : previousPoints [ ( i - 1 ) ] . doubleValue ( ) ; double b = ( iMax == 1 ) ? 1 : previousPoints [ i ] . doubleValue ( ) ; double pma = 1 ; double pa = a ; double pmb = 1 ; double pb = b ; for ( int j = 1 ; j < numberOfPoints ; j ++ ) { final int two_j_p_1 = ( 2 * j ) + 1 ; final int j_p_1 = j + 1 ; final double ppa = ( ( ( two_j_p_1 * a ) * pa ) - ( j * pma ) ) // j_p_1 ; final double ppb = ( ( ( two_j_p_1 * b ) * pb ) - ( j * pmb ) ) // j_p_1 ; pma = pa ; pa = ppa ; pmb = pb ; pb = ppb ; } double c = 0.5 * ( a + b ) ; double pmc = 1 ; double pc = c ; boolean done = false ; while ( ! done ) { done = ( b - a ) <= ( Math . ulp ( c ) ) ; pmc = 1 ; pc = c ; for ( int j = 1 ; j < numberOfPoints ; j ++ ) { final double ppc = ( ( ( ( ( 2 * j ) + 1 ) * c ) * pc ) - ( j * pmc ) ) // ( j + 1 ) ; pmc = pc ; pc = ppc ; } if ( ! done ) { if ( ( pa * pc ) <= 0 ) { b = c ; pmb = pmc ; pb = pc ; } else { a = c ; pma = pmc ; pa = pc ; } c = 0.5 * ( a + b ) ; } } final double d = numberOfPoints * ( pmc - ( c * pc ) ) ; final double w = ( 2 * ( 1 - ( c * c ) ) ) // ( d * d ) ; points [ i ] = c ; weights [ i ] = w ; final int idx = ( numberOfPoints - i ) - 1 ; points [ idx ] = - c ; weights [ idx ] = w ; } <START_BUG> if ( ( numberOfPoints % 2 ) == 1 ) { <END_BUG> double pmc = 1 ; for ( int j = 1 ; j < numberOfPoints ; j += 2 ) { pmc = ( ( - j ) * pmc ) // ( j + 1 ) ; } final double d = numberOfPoints * pmc ; final double w = 2 // ( d * d ) ; points [ iMax ] = 0.0 ; weights [ iMax ] = w ; } return new Pair < Double [ ] , Double [ ] > ( points , weights ) ; } }

Fix:
if ( ( numberOfPoints % 2 ) != 0 ) {
Buggy code:
public class BodyFilter extends AbstractFilter { private String pattern ; private int condition ; public boolean process ( IFolder folder , Object uid ) throws Exception { InputStream messageSourceStream = ( ( org . columba . mail . folder . IMailbox ) ( folder ) ) . getMessageSourceStream ( uid ) ; <START_BUG> StringBuffer body = StreamUtils . readInString ( messageSourceStream ) ; <END_BUG> String bodyText = pattern ; boolean result = false ; switch ( condition ) { case FilterCriteria . CONTAINS : if ( ( body . indexOf ( bodyText ) ) != ( - 1 ) ) { result = true ; } break ; case FilterCriteria . CONTAINS_NOT : if ( ( body . indexOf ( bodyText ) ) == ( - 1 ) ) { result = true ; } break ; } return result ; } public void setUp ( FilterCriteria f ) { } }

Fix:
StringBuffer body = StreamUtils . readCharacterStream ( messageSourceStream ) ;
Buggy code:
public class WaitFor extends ConditionBase { private long maxWaitMillis = ( 1000L * 60L ) * 3L ; private long maxWaitMultiplier = 1L ; private long checkEveryMillis = 500L ; private long checkEveryMultiplier = 1L ; private String timeoutProperty ; public void setCheckEvery ( long time ) { } public void setCheckEveryUnit ( WaitFor . Unit unit ) { } public void setMaxWait ( long time ) { } public void setMaxWaitUnit ( WaitFor . Unit unit ) { } public void setTimeoutProperty ( String p ) { } public void execute ( ) throws TaskException { if ( ( countConditions ( ) ) > 1 ) { throw new TaskException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>nest<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>condition<seq2seq4repair_space>into<seq2seq4repair_space><waitfor>" ) ; } if ( ( countConditions ( ) ) < 1 ) { throw new TaskException ( "You<seq2seq4repair_space>must<seq2seq4repair_space>nest<seq2seq4repair_space>a<seq2seq4repair_space>condition<seq2seq4repair_space>into<seq2seq4repair_space><waitfor>" ) ; } Condition c = ( ( Condition ) ( getConditions ( ) . nextElement ( ) ) ) ; maxWaitMillis *= maxWaitMultiplier ; checkEveryMillis *= checkEveryMultiplier ; long start = System . currentTimeMillis ( ) ; long end = start + ( maxWaitMillis ) ; while ( ( System . currentTimeMillis ( ) ) < end ) { if ( c . eval ( ) ) { return ; } try { Thread . sleep ( checkEveryMillis ) ; } catch ( InterruptedException e ) { } } if ( ( timeoutProperty ) != null ) { <START_BUG> project . setNewProperty ( timeoutProperty , "true" ) ; <END_BUG> } } public static class Unit extends EnumeratedAttribute { private static final String MILLISECOND = "millisecond" ; private static final String SECOND = "second" ; private static final String MINUTE = "minute" ; private static final String HOUR = "hour" ; private static final String DAY = "day" ; private static final String WEEK = "week" ; private static final String [ ] units = new String [ ] { WaitFor . Unit . MILLISECOND , WaitFor . Unit . SECOND , WaitFor . Unit . MINUTE , WaitFor . Unit . HOUR , WaitFor . Unit . DAY , WaitFor . Unit . WEEK } ; private Hashtable timeTable = new Hashtable ( ) ; public Unit ( ) { } public long getMultiplier ( ) { } public String [ ] getValues ( ) { } } }

Fix:
setProperty ( timeoutProperty , "true" ) ;
Buggy code:
public class AccessWrapper < T > { private T target ; public AccessWrapper ( T target ) { } @ SuppressWarnings ( "unchecked" ) public < V > V get ( String fieldName ) { } public < V > void set ( String fieldName , V value ) { } @ SuppressWarnings ( { "unchecked" } ) public < V > V invoke ( String methodName , Object ... params ) { V value = null ; <START_BUG> Class < ? > [ ] signature = SignatureToolkit . getSignature ( params . length ) ; <END_BUG> Method m = null ; try { m = target . getClass ( ) . getDeclaredMethod ( methodName , signature ) ; } catch ( NoSuchMethodException e ) { m = SignatureToolkit . findCompatibleMethod ( methodName , signature , target . getClass ( ) ) ; if ( m == null ) { throw new AccessException ( e ) ; } } catch ( SecurityException | IllegalArgumentException e ) { throw new AccessException ( e ) ; } try { m . setAccessible ( true ) ; value = ( ( V ) ( m . invoke ( target , params ) ) ) ; } catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { throw new AccessException ( e ) ; } return value ; } }

Fix:
Class < ? > [ ] signature = SignatureToolkit . getSignature ( params ) ;
Buggy code:
public class MpiFHIRAdapterImpl { private final AdapterFHIRClient client = new AdapterFHIRClient ( ) ; private final ResourceTransformer transformer = new ResourceTransformer ( ) ; private static final Logger LOG = Logger . getLogger ( MpiFHIRAdapterImpl . class ) ; public PRPAIN201306UV02 query ( PRPAIN201305UV02 findCandidatesRequest ) { PRPAMT201306UV02ParameterList queryParams = HL7Parser201305 . extractHL7QueryParamsFromMessage ( findCandidatesRequest ) ; if ( queryParams != null ) { try { Patient sourcePatient = HL7Parser201305 . extractMpiPatientFromQueryParams ( queryParams ) ; Map < String , String > fhirParams = buildFhirParams ( sourcePatient ) ; if ( fhirParams != null ) { AtomFeed patientFeed = client . getFhirResource ( "FHIRPatientResource" , fhirParams , Patient . class ) ; <START_BUG> return transformer . getPatientResponse ( patientFeed , findCandidatesRequest ) ; <END_BUG> } } catch ( URISyntaxException | ConnectionManagerException ex ) { MpiFHIRAdapterImpl . LOG . error ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>Patient<seq2seq4repair_space>Resource<seq2seq4repair_space>due<seq2seq4repair_space>to:<seq2seq4repair_space>" + ( ex . getLocalizedMessage ( ) ) ) , ex ) ; } } return HL7Parser201306 . buildMessageFromMpiPatient ( null , findCandidatesRequest ) ; } private Map < String , String > buildFhirParams ( Patient sourcePatient ) { } }

Fix:
return transformer . buildPatientResponse ( patientFeed , findCandidatesRequest ) ;
Buggy code:
public abstract class AlertDialogUtility { public static AlertDialog showAlertDialog ( Context context , int messageId , OnClickListener positiveAction ) { AlertDialog . Builder adb = new AlertDialog . Builder ( context ) ; <START_BUG> adb . setTitle ( msg_removeAllHistoryEntries ) ; <END_BUG> adb . setNegativeButton ( context . getString ( cancel ) , null ) ; adb . setPositiveButton ( context . getString ( ok ) , positiveAction ) ; return adb . show ( ) ; } }

Fix:
adb . setTitle ( messageId ) ;
Buggy code:
public class PlaceApiRequest { private static final String LOG_TAG = "PlaceApiRequest" ; public static final String PLACES_API_BASE = "https:////maps.googleapis.com//maps//api//place" ; public static final String TYPE_AUTOCOMPLETE = "//autocomplete" ; public static final String TYPE_DETAILS = "//details" ; public static final String OUT_JSON = "//json" ; public static void autocomplete ( String apiKey , String extraQuery , String input , AutocompleteTask . OnTaskCompleted onTaskCompleted ) { AutocompleteTask autocompleteTask = new AutocompleteTask ( apiKey , extraQuery ) ; autocompleteTask . setOnTaskCompleted ( onTaskCompleted ) ; <START_BUG> autocompleteTask . execute ( input , apiKey , extraQuery ) ; <END_BUG> } public static void details ( String apiKey , String placeId , PlaceDetailTask . OnTaskCompleted onTaskCompleted ) { } }

Fix:
autocompleteTask . execute ( input ) ;
Buggy code:
public class HttpInterceptor extends BaseInterceptor implements TcpConnectionHandler { boolean enabled = true ; PoolTcpEndpoint ep ; private ServerSocketFactory socketFactory ; int port ; InetAddress address ; String keystore ; String keypass ; boolean secure = false ; ContextManager contextM ; public HttpInterceptor ( ) { } public void setPort ( int port ) { } public int getPort ( ) { } public InetAddress getAddress ( ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public void engineShutdown ( ContextManager cm ) throws TomcatException { } public void setKeystore ( String k ) { } <START_BUG> public void getKeystore ( ) { <END_BUG> return keystore ; } public void setSecure ( boolean b ) { } public void setServer ( Object o ) { } public void setAttribute ( String s , Object o ) { } public Object [ ] init ( ) { } public void processConnection ( TcpConnection connection , Object [ ] thData ) { } }

Fix:
public String getKeystore ( ) {
Buggy code:
public class Main { public static void main ( String [ ] args ) { } public static SourceParser createSourceParser ( List < String > sources ) { } private static String flattenList ( List < String > list ) { } public static Logger createLogger ( String main , String args , String whitelist , String blacklist ) { <START_BUG> Logger logger = new PrintLogger ( ) ; <END_BUG> logger . logProgramStart ( main , args , whitelist , blacklist ) ; return logger ; } public static VirtualMachine createVirtualMachine ( String main , String args ) { } }

Fix:
Logger logger = new SQLiteLogger ( ) ;
Buggy code:
public class LayoutHelper { public static final int NORTH = 0 ; public static final int NORTHEAST = 1 ; public static final int EAST = 2 ; public static final int SOUTHEAST = 4 ; public static final int SOUTH = 8 ; public static final int SOUTHWEST = 16 ; public static final int WEST = 32 ; public static final int NORTHWEST = 64 ; public static Point getPointOnPerimeter ( Rectangle rect , int direction ) { <START_BUG> return LayoutHelper . getPointOnPerimeter ( rect , direction ) ; <END_BUG> } public static Point getPointOnPerimeter ( Rectangle rect , int direction , double xOff , double yOff ) { } public static Polygon getRoutingPolygonStraightLine ( Point start , Point end ) { } public static Polygon getRoutingPolygonStraightLineWithOffset ( Point start , Point end , int offset ) { } }

Fix:
return LayoutHelper . getPointOnPerimeter ( rect , direction , 0 , 0 ) ;
Buggy code:
public final class PFPGrowthTest extends MahoutTestCase { private static final Logger log = LoggerFactory . getLogger ( PFPGrowthTest . class ) ; private final Parameters params = new Parameters ( ) ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; params . set ( MIN_SUPPORT , "3" ) ; params . set ( MAX_HEAPSIZE , "4" ) ; params . set ( NUM_GROUPS , "2" ) ; params . set ( ENCODING , "UTF-8" ) ; File inputDir = getTestTempDir ( "transactions" ) ; File outputDir = getTestTempDir ( "frequentpatterns" ) ; File input = new File ( inputDir , "test.txt" ) ; params . set ( INPUT , input . getAbsolutePath ( ) ) ; params . set ( OUTPUT , outputDir . getAbsolutePath ( ) ) ; Writer writer = Files . newWriter ( input , Charsets . UTF_8 ) ; try { Collection < List < String > > transactions = Lists . newArrayList ( ) ; transactions . add ( Arrays . asList ( "E" , "A" , "D" , "B" ) ) ; transactions . add ( Arrays . asList ( "D" , "A" , "C" , "E" , "B" ) ) ; transactions . add ( Arrays . asList ( "C" , "A" , "B" , "E" ) ) ; transactions . add ( Arrays . asList ( "B" , "A" , "D" ) ) ; <START_BUG> transactions . add ( Arrays . asList ( "D" ) ) ; <END_BUG> transactions . add ( Arrays . asList ( "D" , "B" ) ) ; transactions . add ( Arrays . asList ( "A" , "D" , "E" ) ) ; transactions . add ( Arrays . asList ( "B" , "C" ) ) ; for ( List < String > transaction : transactions ) { String sep = "" ; for ( String item : transaction ) { writer . write ( ( sep + item ) ) ; sep = "," ; } writer . write ( "\n" ) ; } } finally { Closeables . closeQuietly ( writer ) ; } } @ Test public void testStartParallelFPGrowth ( ) throws Exception { } @ Test public void testStartParallelFPGrowthInSteps ( ) throws Exception { } }

Fix:
transactions . add ( Arrays . asList ( "D" , "D" , "" , "D" , "D" ) ) ;
Buggy code:
public class SWT_AWT { public static String embeddedFrameClass ; static boolean loaded ; static boolean swingInitialized ; static native final int getAWTHandle ( Canvas canvas ) { } static synchronized void loadLibrary ( ) { } static synchronized void initializeSwing ( ) { } public static Frame new_Frame ( final Composite parent ) { if ( parent == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; if ( ( ( parent . getStyle ( ) ) & ( SWT . EMBEDDED ) ) == 0 ) { SWT . error ( ERROR_INVALID_ARGUMENT ) ; } int handle = parent . embeddedHandle ; Class clazz = null ; try { String className = ( ( SWT_AWT . embeddedFrameClass ) != null ) ? SWT_AWT . embeddedFrameClass : "sun.awt.X11.XEmbeddedFrame" ; clazz = Class . forName ( className ) ; } catch ( Throwable e ) { <START_BUG> SWT . error ( ERROR_NOT_IMPLEMENTED , e ) ; <END_BUG> } Constructor constructor = null ; try { constructor = clazz . getConstructor ( new Class [ ] { int . class } ) ; } catch ( Throwable e1 ) { try { constructor = clazz . getConstructor ( new Class [ ] { long . class } ) ; } catch ( Throwable e2 ) { SWT . error ( ERROR_NOT_IMPLEMENTED , e2 ) ; } } SWT_AWT . initializeSwing ( ) ; Object value = null ; try { value = constructor . newInstance ( new Object [ ] { new Integer ( handle ) } ) ; } catch ( Throwable e ) { SWT . error ( ERROR_NOT_IMPLEMENTED , e ) ; } final Frame frame = ( ( Frame ) ( value ) ) ; try { Method method = clazz . getMethod ( "registerListeners" , null ) ; if ( method != null ) method . invoke ( value , null ) ; } catch ( Throwable e ) { } parent . addListener ( Dispose , new Listener ( ) { public void handleEvent ( Event event ) { parent . setVisible ( false ) ; EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { frame . dispose ( ) ; } } ) ; } } ) ; parent . getDisplay ( ) . asyncExec ( new Runnable ( ) { public void run ( ) { if ( parent . isDisposed ( ) ) return ; final Rectangle clientArea = parent . getClientArea ( ) ; EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { frame . setSize ( clientArea . width , clientArea . height ) ; frame . validate ( ) ; } } ) ; } } ) ; return frame ; } public static Shell new_Shell ( final Display display , final Canvas parent ) { } }

Fix:
SWT . error ( ERROR_NOT_IMPLEMENTED , e , "<seq2seq4repair_space>[need<seq2seq4repair_space>JDK<seq2seq4repair_space>1.5<seq2seq4repair_space>or<seq2seq4repair_space>greater]" ) ;
Buggy code:
public class JbossDeploymentTool extends GenericDeploymentTool { protected static final String JBOSS_DD = "jboss.xml" ; protected static final String JBOSS_CMP10D = "jaws.xml" ; protected static final String JBOSS_CMP20D = "jbosscmp-jdbc.xml" ; private String jarSuffix = ".jar" ; public void setSuffix ( String inString ) { } protected void addVendorFiles ( Hashtable ejbFiles , String ddPrefix ) { File jbossDD = new File ( getConfig ( ) . descriptorDir , ( ddPrefix + ( JbossDeploymentTool . JBOSS_DD ) ) ) ; if ( jbossDD . exists ( ) ) { ejbFiles . put ( ( ( META_DIR ) + ( JbossDeploymentTool . JBOSS_DD ) ) , jbossDD ) ; } else { log ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>jboss<seq2seq4repair_space>deployment<seq2seq4repair_space>descriptor.<seq2seq4repair_space>" + "It<seq2seq4repair_space>was<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( jbossDD . getPath ( ) ) ) , MSG_WARN ) ; return ; } String descriptorFileName = JbossDeploymentTool . JBOSS_CMP10D ; if ( CMP2_0 . equals ( getParent ( ) . getCmpversion ( ) ) ) { descriptorFileName = JbossDeploymentTool . JBOSS_CMP20D ; } File jbossCMPD = new File ( getConfig ( ) . descriptorDir , ( ddPrefix + descriptorFileName ) ) ; if ( jbossCMPD . exists ( ) ) { ejbFiles . put ( ( ( META_DIR ) + descriptorFileName ) , jbossCMPD ) ; } else { <START_BUG> log ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>jboss<seq2seq4repair_space>cmp<seq2seq4repair_space>descriptor.<seq2seq4repair_space>" + "It<seq2seq4repair_space>was<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( jbossCMPD . getPath ( ) ) ) , MSG_WARN ) ; <END_BUG> return ; } } File getVendorOutputJarFile ( String baseName ) { } public void validateConfigured ( ) throws BuildException { } private EjbJar getParent ( ) { } }

Fix:
log ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>jboss<seq2seq4repair_space>cmp<seq2seq4repair_space>descriptor.<seq2seq4repair_space>" + "It<seq2seq4repair_space>was<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( jbossCMPD . getPath ( ) ) ) , MSG_VERBOSE ) ;
Buggy code:
public class UserServiceException extends YonaException { private static final long serialVersionUID = - 4519219401062670885L ; private UserServiceException ( String messageId , Object ... parameters ) { } public static UserServiceException notFoundByMobileNumber ( String mobileNumber ) { } public static UserServiceException notFoundByID ( UUID id ) { <START_BUG> return new UserServiceException ( "error.user.not.found.mobile" , id ) ; <END_BUG> } public static UserServiceException missingPasswordHeader ( ) { } }

Fix:
return new UserServiceException ( "error.user.not.found.id" , id ) ;
Buggy code:
public class Enemy extends BetterActor { Force force = new Force ( ) ; private int speed = 2 ; private double healthEnemy = 2 ; private GreenfootImage walking1 = new GreenfootImage ( "Alien.Still.png" ) ; private GreenfootImage walking2 = new GreenfootImage ( "Alien.Walking.png" ) ; private int moveTime = 1 ; public void act ( ) { } public Enemy ( ) { } public void enemyMovement ( ) { } public void decrementPlayersHealth ( ) { if ( force . canSee ( Player . class , this ) ) { <START_BUG> Player . setHealth ( ( ( Player . getHealth ( ) ) - 0.5 ) ) ; <END_BUG> } } public void enemyAnimation ( ) { } }

Fix:
Health . setHealth ( ( ( Health . getHealth ( ) ) - 0.5 ) ) ;
Buggy code:
public class AutoCommitTest extends AbstractSolrTestCase { public String getSchemaFile ( ) { } public String getSolrConfigFile ( ) { } public static Collection < ContentStream > toContentStreams ( final String str , final String contentType ) { } public void testMaxDocs ( ) throws Exception { DirectUpdateHandler2 updater = ( ( DirectUpdateHandler2 ) ( SolrCore . getSolrCore ( ) . getUpdateHandler ( ) ) ) ; DirectUpdateHandler2 . CommitTracker tracker = updater . tracker ; <START_BUG> tracker . timeUpperBound = - 1 ; <END_BUG> tracker . docsUpperBound = 14 ; XmlUpdateRequestHandler handler = new XmlUpdateRequestHandler ( ) ; handler . init ( null ) ; SolrCore core = SolrCore . getSolrCore ( ) ; MapSolrParams params = new MapSolrParams ( new HashMap < String , String > ( ) ) ; SolrQueryResponse rsp = new SolrQueryResponse ( ) ; SolrQueryRequestBase req = new SolrQueryRequestBase ( core , params ) { } ; for ( int i = 0 ; i < 14 ; i ++ ) { req . setContentStreams ( AutoCommitTest . toContentStreams ( adoc ( "id" , ( "A" + i ) , "subject" , "info" ) , null ) ) ; handler . handleRequest ( req , rsp ) ; } assertQ ( "shouldn't<seq2seq4repair_space>find<seq2seq4repair_space>any" , req ( "id:A1" ) , "////result[@numFound=0]" ) ; assertEquals ( 0 , tracker . autoCommitCount ) ; req . setContentStreams ( AutoCommitTest . toContentStreams ( adoc ( "id" , "A14" , "subject" , "info" ) , null ) ) ; handler . handleRequest ( req , rsp ) ; Thread . sleep ( 500 ) ; req . setContentStreams ( AutoCommitTest . toContentStreams ( adoc ( "id" , "A15" , "subject" , "info" ) , null ) ) ; handler . handleRequest ( req , rsp ) ; assertQ ( "should<seq2seq4repair_space>find<seq2seq4repair_space>one" , req ( "id:A14" ) , "////result[@numFound=1]" ) ; assertEquals ( 1 , tracker . autoCommitCount ) ; assertQ ( "should<seq2seq4repair_space>find<seq2seq4repair_space>one" , req ( "id:A15" ) , "////result[@numFound=0]" ) ; assertEquals ( 1 , tracker . autoCommitCount ) ; for ( int i = 0 ; i < 14 ; i ++ ) { req . setContentStreams ( AutoCommitTest . toContentStreams ( adoc ( "id" , ( "B" + i ) , "subject" , "info" ) , null ) ) ; handler . handleRequest ( req , rsp ) ; } assertQ ( "shouldn't<seq2seq4repair_space>find<seq2seq4repair_space>any" , req ( "id:B1" ) , "////result[@numFound=0]" ) ; assertEquals ( 1 , tracker . autoCommitCount ) ; req . setContentStreams ( AutoCommitTest . toContentStreams ( adoc ( "id" , "B14" , "subject" , "info" ) , null ) ) ; handler . handleRequest ( req , rsp ) ; Thread . sleep ( 500 ) ; req . setContentStreams ( AutoCommitTest . toContentStreams ( adoc ( "id" , "B15" , "subject" , "info" ) , null ) ) ; handler . handleRequest ( req , rsp ) ; assertQ ( "should<seq2seq4repair_space>find<seq2seq4repair_space>one" , req ( "id:B14" ) , "////result[@numFound=1]" ) ; assertEquals ( 2 , tracker . autoCommitCount ) ; assertQ ( "should<seq2seq4repair_space>find<seq2seq4repair_space>none" , req ( "id:B15" ) , "////result[@numFound=0]" ) ; assertEquals ( 2 , tracker . autoCommitCount ) ; } public void testMaxTime ( ) throws Exception { } }

Fix:
tracker . timeUpperBound = 100000 ;
Buggy code:
public class Student extends User { public Student ( int uid ) { } public Response attendExam ( int courseId , int examId ) { } public Response submitSourceCode ( int courseId , int examId , int problemId , String sourceCode , String sourceCodeFileName ) { } public Response sendSnapshot ( int courseId , int examId , byte [ ] snapshot ) { } public Response sendTestResult ( int courseId , int examId , int problemId , String result ) { } public Response sendKeyEvent ( int courseId , int examId , KeyEvent keyEvent ) { } public Response queryExamResults ( int courseId , int examId ) { <START_BUG> String uri = String . format ( "//course//%d//exam//%d//student//%d//score" , courseId , examId , super . userId ) ; <END_BUG> return Utils . get ( CLIENT , uri ) ; } }

Fix:
String uri = String . format ( "//course//%d//exam//%d//student//%d//score-and-comment" , courseId , examId , super . userId ) ;
Buggy code:
public class LANDriver extends UserDriver { private InetAddress m_address ; public LANDriver ( InetAddress address ) { } public static long sizeOf ( File file ) { } public static long sizeOf ( File [ ] files ) { } private long m_totalSize = 0 ; private long m_totalRead = 0 ; private void recursiveZip ( String root , File file , ZipOutputStream zos , TransferTracker tracker ) throws FileNotFoundException { System . out . println ( ( "LANDriver:<seq2seq4repair_space>zipping<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; if ( file . isDirectory ( ) ) { File [ ] files = file . listFiles ( ) ; for ( File f : files ) { recursiveZip ( ( ( root + ( file . getName ( ) ) ) + "//" ) , f , zos , tracker ) ; } } else { FileInputStream fis = new FileInputStream ( file ) ; ZipEntry entry = new ZipEntry ( ( root + ( file . getName ( ) ) ) ) ; try { zos . putNextEntry ( entry ) ; byte [ ] buffer = new byte [ 1024 ] ; int len ; while ( ( len = fis . read ( buffer ) ) > 0 ) { zos . write ( buffer , 0 , len ) ; <START_BUG> m_totalRead += 1024 ; <END_BUG> tracker . setPercentage ( ( ( ( ( double ) ( 100 ) ) * ( m_totalRead ) ) // ( m_totalSize ) ) ) ; } fis . close ( ) ; zos . closeEntry ( ) ; zos . flush ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } @ Override public TransferTracker sendFiles ( final File [ ] files , final User from ) { } }

Fix:
m_totalRead += len ;
Buggy code:
public class RModuleIssueType extends org . tigris . scarab . om . BaseRModuleIssueType implements Persistent { public ScarabModule getScarabModule ( ) { } public void setScarabModule ( ScarabModule module ) { } public void setModule ( Module me ) throws TorqueException { } public Module getModule ( ) throws TorqueException { } public void delete ( ScarabUser user ) throws Exception { Module module = getModule ( ) ; if ( user . hasPermission ( MODULE__CONFIGURE , module ) ) { List attGroups = module . getAttributeGroups ( getIssueType ( ) ) ; for ( int j = 0 ; j < ( attGroups . size ( ) ) ; j ++ ) { AttributeGroup attGroup = ( ( AttributeGroup ) ( attGroups . get ( j ) ) ) ; <START_BUG> attGroup . delete ( user ) ; <END_BUG> } Criteria c = new Criteria ( ) . add ( MODULE_ID , getModuleId ( ) ) . add ( ISSUE_TYPE_ID , getIssueTypeId ( ) ) ; RModuleIssueTypePeer . doDelete ( c ) ; RModuleIssueTypeManager . removeFromCache ( this ) ; List rmits = module . getRModuleIssueTypes ( ) ; rmits . remove ( this ) ; } else { throw new org . tigris . scarab . util . ScarabException ( ScarabConstants . NO_PERMISSION_MESSAGE ) ; } } public String getDisplayName ( ) { } public String getDisplayText ( ) { } public String getDisplayDescription ( ) { } public RModuleIssueType copy ( ) throws TorqueException { } }

Fix:
attGroup . delete ( user , module ) ;
Buggy code:
public class LikeExpression extends BinaryExpressionPredicate { private final Object _echar ; private final boolean _escaped ; public LikeExpression ( Expression e , Expression pattern , Object echar ) { } public LikeExpression ( Expression e , Expression pattern ) { } @ Override public String asExpression ( AliasContext ctx ) { <START_BUG> return ( super . asExpression ( ctx ) ) + ( _escaped ? "ESCAPE<seq2seq4repair_space>" + ( JPQLHelper . toJPQL ( ctx , _echar ) ) : "" ) ; <END_BUG> } }

Fix:
return ( super . asExpression ( ctx ) ) + ( _escaped ? "ESCAPE<seq2seq4repair_space>" + ( JPQLHelper . toJPQL ( ctx , _echar ) ) : EMPTY ) ;
Buggy code:
public class MethodData extends ItemData { Method method ; public MethodData ( Method method , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { "no_gen" , "address" , "const" , "dynamic" , "jni" , "cpp" , "new" , "delete" } ; <END_BUG> } public Method getMethod ( ) { } public String getAccessor ( ) { } public String getExclude ( ) { } public void setAccessor ( String str ) { } public void setExclude ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_DYNAMIC , FLAG_JNI , FLAG_CPP , FLAG_NEW , FLAG_DELETE } ;
Buggy code:
public class SpecifiedInterfaceRemoveHandler extends InterfaceRemoveHandler { public static SpecifiedInterfaceRemoveHandler INSTANCE = new SpecifiedInterfaceRemoveHandler ( ) ; protected SpecifiedInterfaceRemoveHandler ( ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return true ; <END_BUG> } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) { } }

Fix:
return context . getProcessType ( ) . isServer ( ) ;
Buggy code:
@ SuppressWarnings ( "WeakerAccess" ) public class Server { private static String rootDir ; private static String debug ; private static final Logger log = LoggerFactory . getLogger ( "Server" ) ; public static void main ( String [ ] args ) throws Exception { Server . configureServer ( args ) ; <START_BUG> ExecutorTaskService threadPool = new ExecutorTaskService ( 4 ) ; <END_BUG> ServerSocket ss = new ServerSocket ( 8080 ) ; while ( true ) { Socket s = ss . accept ( ) ; threadPool . execute ( new Task ( s , Server . rootDir ) ) ; } } private static void configureServer ( String [ ] args ) { } private static void setLoggingLevel ( Level level ) { } }

Fix:
ExecutorTaskService threadPool = new ExecutorTaskService ( 10 ) ;