nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RestController @ RequestMapping ( "//users" ) public class UserController { @ Autowired private UserDao userDao ; @ Autowired private PasswordEncoder passwordEncoder ; @ RequestMapping ( method = RequestMethod . POST ) public User add ( @ RequestBody User user ) throws DuplicatedEntryException { } @ PreAuthorize ( "hasRole('ROLE_ADMIN')" ) @ RequestMapping ( value = "//{uid}" , method = RequestMethod . GET , params = "!by" ) public User get ( @ PathVariable Long uid ) { } <START_BUG> @ PreAuthorize ( "hasRole('ROLE_USER')<seq2seq4repair_space>and<seq2seq4repair_space>#n<seq2seq4repair_space>==<seq2seq4repair_space>authentication.name" ) <END_BUG> @ RequestMapping ( value = "//{name:.+}" , method = RequestMethod . GET , params = "by=name" ) public User getByName ( @ Param ( "n" ) @ PathVariable String name ) { return userDao . getUserByName ( name ) ; } @ RequestMapping ( value = "//auth" , method = RequestMethod . GET ) public User getAuth ( Principal principal ) { } @ RequestMapping ( value = "//active" , method = RequestMethod . PUT , params = "code" ) public User activeByCode ( @ RequestParam ( value = "code" , required = true ) String code ) { } @ PreAuthorize ( "hasRole('ROLE_ADMIN')" ) @ RequestMapping ( method = RequestMethod . GET ) public List < User > getAll ( ) { } @ PreAuthorize ( "hasRole('ROLE_ADMIN')" ) @ RequestMapping ( value = "//{uid}//active" , method = RequestMethod . PUT ) public User active ( @ PathVariable Long uid ) { } @ PreAuthorize ( "hasRole('ROLE_ADMIN')" ) @ RequestMapping ( value = "//{uid}//inactive" , method = RequestMethod . PUT ) public User inactive ( @ PathVariable Long uid ) { } @ ExceptionHandler ( DuplicatedEntryException . class ) public FailedResult handleCustomException ( DuplicatedEntryException ex ) { } }

Fix:
@ PreAuthorize ( "(hasRole('ROLE_USER')<seq2seq4repair_space>and<seq2seq4repair_space>#n<seq2seq4repair_space>==<seq2seq4repair_space>authentication.name)<seq2seq4repair_space>or<seq2seq4repair_space>hasRole('ROLE_ADMIN')" )
Buggy code:
public final class ExecutorRemove extends AbstractThreadsSubsystemUpdate < Void > { private static final long serialVersionUID = 3661832034337989182L ; private final String name ; protected ExecutorRemove ( final String name ) { } public String getName ( ) { } public AbstractThreadsSubsystemUpdate < Void > getCompensatingUpdate ( final ThreadsSubsystemElement original ) { } protected void applyUpdate ( final ThreadsSubsystemElement element ) throws UpdateFailedException { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { <START_BUG> final ServiceController < ? > controller = updateContext . getServiceContainer ( ) . getService ( ThreadsServices . executorName ( name ) ) ; <END_BUG> if ( controller == null ) { handler . handleSuccess ( null , param ) ; return ; } controller . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( handler , param ) ) ; return ; } }

Fix:
final ServiceController < ? > controller = updateContext . getServiceRegistry ( ) . getService ( ThreadsServices . executorName ( name ) ) ;
Buggy code:
public class WeldBeanManagerServiceProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final DeploymentUnit topLevelDeployment = ( ( deploymentUnit . getParent ( ) ) == null ) ? deploymentUnit : deploymentUnit . getParent ( ) ; final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; if ( ! ( WeldDeploymentMarker . isPartOfWeldDeployment ( topLevelDeployment ) ) ) { return ; } if ( ( ! ( deploymentUnit . getName ( ) . endsWith ( ".war" ) ) ) && ( ! ( deploymentUnit . getName ( ) . endsWith ( ".jar" ) ) ) ) { return ; } if ( moduleDescription == null ) { return ; } BeanDeploymentArchiveImpl rootBda = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE ) ; if ( rootBda == null ) { rootBda = topLevelDeployment . getAttachment ( DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE ) ; } if ( rootBda == null ) { throw new RuntimeException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>BeanManager<seq2seq4repair_space>for<seq2seq4repair_space>deployment<seq2seq4repair_space>" + ( deploymentUnit . getName ( ) ) ) ) ; } final ServiceName weldServiceName = topLevelDeployment . getServiceName ( ) . append ( SERVICE_NAME ) ; <START_BUG> final ServiceName beanManagerServiceName = deploymentUnit . getServiceName ( ) . append ( NAME ) ; <END_BUG> BeanManagerService beanManagerService = new BeanManagerService ( rootBda . getId ( ) ) ; serviceTarget . addService ( beanManagerServiceName , beanManagerService ) . addDependency ( weldServiceName , WeldContainer . class , beanManagerService . getWeldContainer ( ) ) . install ( ) ; final ServiceName moduleContextServiceName = ContextNames . contextServiceNameOfModule ( moduleDescription . getApplicationName ( ) , moduleDescription . getModuleName ( ) ) ; bindBeanManager ( serviceTarget , beanManagerServiceName , moduleContextServiceName ) ; for ( ComponentDescription component : moduleDescription . getComponentDescriptions ( ) ) { if ( ( component . getNamingMode ( ) ) == ( ComponentNamingMode . CREATE ) ) { final ServiceName compContextServiceName = ContextNames . contextServiceNameOfComponent ( moduleDescription . getApplicationName ( ) , moduleDescription . getModuleName ( ) , component . getComponentName ( ) ) ; bindBeanManager ( serviceTarget , beanManagerServiceName , compContextServiceName ) ; } } deploymentUnit . addToAttachmentList ( SETUP_ACTIONS , new WeldContextSetup ( ) ) ; } private void bindBeanManager ( ServiceTarget serviceTarget , ServiceName beanManagerServiceName , ServiceName contextServiceName ) { } @ Override public void undeploy ( DeploymentUnit deploymentUnit ) { } }

Fix:
final ServiceName beanManagerServiceName = BeanManagerService . serviceName ( deploymentUnit ) ;
Buggy code:
public class JocolateModel { private final String type ; private final String size ; private final String logo ; private final String text ; private final int amount ; public JocolateModel ( String type , String size , String logo , String text , int amount ) { } public JocolateModel ( String type , String size , String logo , int amount ) { } public String getType ( ) { } public String getSize ( ) { } public String getLogo ( ) { } public String getText ( ) { } public int getAmount ( ) { } @ Override public String toString ( ) { } public ShoppingCartItem toShoppingCartItem ( ) { <START_BUG> if ( logo . equals ( "Text" ) ) { <END_BUG> return new ShoppingCartItem ( "Chocolate" , type , size , text , amount ) ; } else { return new ShoppingCartItem ( "Chocolate" , type , size , logo , amount ) ; } } }

Fix:
if ( ( ( ( ! ( logo . equals ( "Default" ) ) ) || ( ! ( logo . equals ( "PetritzDesigns" ) ) ) ) || ( ! ( logo . equals ( "jCorn" ) ) ) ) || ( ! ( logo . equals ( "Happy<seq2seq4repair_space>Birthday" ) ) ) ) {
Buggy code:
public class DoubleLiteral extends NumberLiteral { double value ; public DoubleLiteral ( char [ ] token , int s , int e ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) if ( ( ( implicitConversion ) > > 4 ) == ( TypeIds . T_double ) ) codeStream . generateInlinedValue ( value ) ; else codeStream . generateConstant ( constant , implicitConversion ) ; <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public TypeBinding literalType ( BlockScope scope ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class InlinePanelPage_5 extends WebPage { private static final long serialVersionUID = 1L ; public InlinePanelPage_5 ( ) { } public static class FragmentWithAssociatedMarkupStream extends Fragment { private static final long serialVersionUID = 1L ; public FragmentWithAssociatedMarkupStream ( final String id , final String markupId ) { } @ Override protected MarkupStream chooseMarkupStream ( MarkupStream markupStream ) { } @ Override public IMarkupFragment getMarkup ( Component child ) { IMarkupFragment markup = getAssociatedMarkup ( ) ; if ( markup == null ) { return null ; } if ( child == null ) { return markup ; } <START_BUG> return markup . find ( null , child . getId ( ) , 0 ) ; <END_BUG> } } }

Fix:
return markup . find ( child . getId ( ) , 0 ) ;
Buggy code:
@ Path ( "dbFixtures" ) public class DbFixturesResource { @ Inject DbFixtures dbFixtures ; @ GET @ Path ( "reset" ) @ Produces ( "text//plain" ) public String reset ( ) throws Exception { <START_BUG> dbFixtures . clearDbFixtures ( ) ; <END_BUG> return "Success!!!" ; } }

Fix:
dbFixtures . resetDbFixtures ( ) ;
Buggy code:
public class TriangularDistribution extends AbstractRealDistribution { private static final long serialVersionUID = 20120112L ; private final double a ; private final double b ; private final double c ; private final double solverAbsoluteAccuracy ; public TriangularDistribution ( double a , double c , double b ) throws NumberIsTooLargeException , NumberIsTooSmallException { } public double getMode ( ) { } @ Override protected double getSolverAbsoluteAccuracy ( ) { } public double probability ( double x ) { } public double density ( double x ) { } public double cumulativeProbability ( double x ) { } public double getNumericalMean ( ) { } public double getNumericalVariance ( ) { } public double getSupportLowerBound ( ) { } public double getSupportUpperBound ( ) { } public boolean isSupportLowerBoundInclusive ( ) { } public boolean isSupportUpperBoundInclusive ( ) { } public boolean isSupportConnected ( ) { } @ Override public double inverseCumulativeProbability ( double p ) throws OutOfRangeException { if ( ( p < 0 ) || ( p > 1 ) ) { throw new OutOfRangeException ( p , 0 , 1 ) ; } if ( p == 0 ) { return a ; } if ( p == 1 ) { return b ; } <START_BUG> if ( p <= ( ( ( c ) - ( a ) ) // ( ( b ) - ( a ) ) ) ) { <END_BUG> return ( a ) + ( FastMath . sqrt ( ( ( p * ( ( b ) - ( a ) ) ) * ( ( c ) - ( a ) ) ) ) ) ; } return ( b ) - ( FastMath . sqrt ( ( ( ( 1 - p ) * ( ( b ) - ( a ) ) ) * ( ( b ) - ( c ) ) ) ) ) ; } }

Fix:
if ( p < ( ( ( c ) - ( a ) ) // ( ( b ) - ( a ) ) ) ) {
Buggy code:
public class FormTesterTest extends WicketTestCase { private Book [ ] books ; private ChoicePage choicePage ; private FormTester formTester ; public FormTesterTest ( String name ) { } @ Override protected void setUp ( ) throws Exception { } public void testSingleChoice ( ) throws Exception { } public void testSingleChoice_toggle ( ) throws Exception { } public void testSingleChoiceComponentNotAllowSelectMuliple ( ) throws Exception { } public void testSelectMultiple ( ) throws Exception { } public void testMultipleChoiceComponent_cumulate ( ) throws Exception { } <START_BUG> private void assertBooksEquals ( Book [ ] expectBooks , List actualBooks ) { <END_BUG> assertEquals ( expectBooks . length , actualBooks . size ( ) ) ; assertTrue ( Arrays . asList ( expectBooks ) . containsAll ( actualBooks ) ) ; } public void testMultipleButtonSubmit ( ) throws Exception { } public void testInitialValues ( ) { } private void assertInitialValues ( ) { } }

Fix:
private void assertBooksEquals ( Book [ ] expectBooks , List < Book > actualBooks ) {
Buggy code:
public class SetColumnMap extends DMLPlan { private static final Logger logger_ = Logger . getLogger ( SetUniqueKey . class ) ; private CFMetaData cfMetaData_ ; private OperandDef rowKey_ ; private OperandDef superColumnKey_ ; private ColumnMapExpr columnMapExpr_ ; public SetColumnMap ( CFMetaData cfMetaData , OperandDef rowKey , ColumnMapExpr columnMapExpr ) { } public SetColumnMap ( CFMetaData cfMetaData , OperandDef rowKey , OperandDef superColumnKey , ColumnMapExpr columnMapExpr ) { } public CqlResult execute ( ) { } public String explainPlan ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> String prefix = String . format ( ( "%s<seq2seq4repair_space>Column<seq2seq4repair_space>Family:<seq2seq4repair_space>Batch<seq2seq4repair_space>SET<seq2seq4repair_space>a<seq2seq4repair_space>set<seq2seq4repair_space>of<seq2seq4repair_space>columns:<seq2seq4repair_space>\n" + ( ( ( "<seq2seq4repair_space>Table<seq2seq4repair_space>Name:<seq2seq4repair_space>%s\n" + "<seq2seq4repair_space>Column<seq2seq4repair_space>Famly:<seq2seq4repair_space>%s\n" ) + "<seq2seq4repair_space>RowKey:<seq2seq4repair_space>%s\n" ) + "%s" ) ) , cfMetaData_ . columnType , cfMetaData_ . tableName , cfMetaData_ . cfName , rowKey_ . explain ( ) , ( ( superColumnKey_ ) == null ? "" : ( "<seq2seq4repair_space>SuperColumnKey:<seq2seq4repair_space>" + ( superColumnKey_ . explain ( ) ) ) + "\n" ) ) ; for ( Pair < OperandDef , OperandDef > entry : columnMapExpr_ ) { OperandDef columnKey = entry . getFirst ( ) ; OperandDef value = entry . getSecond ( ) ; sb . append ( String . format ( ( "<seq2seq4repair_space>ColumnKey:<seq2seq4repair_space>%s\n" + "<seq2seq4repair_space>Value:<seq2seq4repair_space>%s\n" ) , columnKey . explain ( ) , value . explain ( ) ) ) ; } return prefix + ( sb . toString ( ) ) ; } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
class TableModelUseCaseByProps extends TableModelComposite { public TableModelUseCaseByProps ( ) { } public void initColumns ( ) { } public Vector rowObjectsFor ( Object t ) { if ( ! ( t instanceof UMLUseCaseDiagram ) ) return new Vector ( ) ; UMLUseCaseDiagram d = ( ( UMLUseCaseDiagram ) ( t ) ) ; <START_BUG> Vector nodes = d . getGraphModel ( ) . getNodes ( ) ; <END_BUG> Vector res = new Vector ( ) ; int size = nodes . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { Object node = nodes . elementAt ( i ) ; if ( node instanceof UseCase ) res . addElement ( node ) ; } return res ; } public String toString ( ) { } }

Fix:
Vector nodes = d . getNodes ( ) ;
Buggy code:
@ FacesValidator ( "urlValidator" ) public class UrlValidator implements Validator { @ Override public void validate ( FacesContext context , UIComponent component , Object value ) throws ValidatorException { StringBuilder url = new StringBuilder ( ) ; String urlValue = value . toString ( ) ; if ( ( urlValue . length ( ) ) == 0 ) { <START_BUG> throw new ValidatorException ( new FacesMessage ( "Invalid<seq2seq4repair_space>format<seq2seq4repair_space>of<seq2seq4repair_space>URL<seq2seq4repair_space>address" , "URL<seq2seq4repair_space>string<seq2seq4repair_space>is<seq2seq4repair_space>empty" ) ) ; <END_BUG> } if ( ! ( urlValue . matches ( "^[a-z]+:////.*" ) ) ) { url . append ( "http:////" ) ; } else { String protocol = urlValue . replaceFirst ( "^([a-z]+):////.*" , "$1" ) ; switch ( protocol ) { case "http" : case "https" : case "ftp" : break ; default : throw new ValidatorException ( new FacesMessage ( "Invalid<seq2seq4repair_space>format<seq2seq4repair_space>of<seq2seq4repair_space>URL<seq2seq4repair_space>address" , ( "Unsupported<seq2seq4repair_space>protocol:<seq2seq4repair_space>" + protocol ) ) ) ; } } url . append ( urlValue ) ; try { URI uri = new URI ( url . toString ( ) ) ; int port = uri . getPort ( ) ; if ( port == ( - 1 ) ) { return ; } if ( ( port <= 0 ) || ( port >= 65536 ) ) { throw new URISyntaxException ( url . toString ( ) , ( "Invalid<seq2seq4repair_space>port:<seq2seq4repair_space>" + port ) ) ; } } catch ( URISyntaxException e ) { FacesMessage msg = new FacesMessage ( "Invalid<seq2seq4repair_space>format<seq2seq4repair_space>of<seq2seq4repair_space>URL<seq2seq4repair_space>address" , "Invalid<seq2seq4repair_space>URL<seq2seq4repair_space>format" ) ; msg . setSeverity ( SEVERITY_ERROR ) ; throw new ValidatorException ( msg ) ; } } }

Fix:
return ;
Buggy code:
public abstract class Statement extends ASTNode { public abstract FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void branchChainTo ( Label label ) { } public boolean complainIfUnreachable ( FlowInfo flowInfo , BlockScope scope , boolean didAlreadyComplain ) { } public void generateArguments ( MethodBinding binding , Expression [ ] arguments , BlockScope currentScope , CodeStream codeStream ) { if ( binding . isVarargs ( ) ) { TypeBinding [ ] params = binding . parameters ; int paramLength = params . length ; int varArgIndex = paramLength - 1 ; for ( int i = 0 ; i < varArgIndex ; i ++ ) { arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; } ArrayBinding varArgsType = ( ( ArrayBinding ) ( params [ varArgIndex ] ) ) ; <START_BUG> ArrayBinding codeGenVarArgsType = ( ( ArrayBinding ) ( binding . original ( ) . parameters [ varArgIndex ] . erasure ( ) ) ) ; <END_BUG> int elementsTypeID = varArgsType . elementsType ( ) . id ; int argLength = ( arguments == null ) ? 0 : arguments . length ; if ( argLength > paramLength ) { codeStream . generateInlinedValue ( ( argLength - varArgIndex ) ) ; codeStream . newArray ( codeGenVarArgsType ) ; for ( int i = varArgIndex ; i < argLength ; i ++ ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( ( i - varArgIndex ) ) ; arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } else if ( argLength == paramLength ) { TypeBinding lastType = arguments [ varArgIndex ] . resolvedType ; if ( ( lastType == ( NullBinding ) ) || ( ( ( varArgsType . dimensions ( ) ) == ( lastType . dimensions ( ) ) ) && ( lastType . isCompatibleWith ( varArgsType ) ) ) ) { arguments [ varArgIndex ] . generateCode ( currentScope , codeStream , true ) ; } else { codeStream . generateInlinedValue ( 1 ) ; codeStream . newArray ( codeGenVarArgsType ) ; codeStream . dup ( ) ; codeStream . generateInlinedValue ( 0 ) ; arguments [ varArgIndex ] . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } else { codeStream . generateInlinedValue ( 0 ) ; codeStream . newArray ( codeGenVarArgsType ) ; } } else if ( arguments != null ) { for ( int i = 0 , max = arguments . length ; i < max ; i ++ ) arguments [ i ] . generateCode ( currentScope , codeStream , true ) ; } } public abstract void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public boolean isEmptyBlock ( ) { } public boolean isValidJavaStatement ( ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public abstract StringBuffer printStatement ( int indent , StringBuffer output ) { } public abstract void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding testType , SwitchStatement switchStatement ) { } }

Fix:
ArrayBinding codeGenVarArgsType = ( ( ArrayBinding ) ( binding . parameters [ varArgIndex ] . erasure ( ) ) ) ;
Buggy code:
public class BroadCastTask { private static final String [ ] messages = new String [ ] { ( "Need<seq2seq4repair_space>a<seq2seq4repair_space>world<seq2seq4repair_space>map?<seq2seq4repair_space>" + ( ChatColor . DARK_BLUE ) ) + "http:////www.minegusta.com//map.php" , ( "You<seq2seq4repair_space>are<seq2seq4repair_space>playing<seq2seq4repair_space>Wasteland!<seq2seq4repair_space>To<seq2seq4repair_space>return<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>hub,<seq2seq4repair_space>use:<seq2seq4repair_space>" + ( ChatColor . YELLOW ) ) + "//Hub" , ( "To<seq2seq4repair_space>see<seq2seq4repair_space>your<seq2seq4repair_space>stats,<seq2seq4repair_space>use<seq2seq4repair_space>:<seq2seq4repair_space>" + ( ChatColor . YELLOW ) ) + "//Menu" , ( "Upgrade<seq2seq4repair_space>your<seq2seq4repair_space>perks!<seq2seq4repair_space>Use:<seq2seq4repair_space>" + ( ChatColor . YELLOW ) ) + "//Perk" , ( "Want<seq2seq4repair_space>cool<seq2seq4repair_space>donor<seq2seq4repair_space>perks?<seq2seq4repair_space>" + ( ChatColor . YELLOW ) ) + "http:////store.minegusta.com" } ; private static int index = 0 ; public static int start ( ) { return Bukkit . getScheduler ( ) . scheduleSyncRepeatingTask ( PLUGIN , ( ) -> { Bukkit . getOnlinePlayers ( ) . forEach ( ( p ) -> { p . sendMessage ( ( ( ( ( ( ChatColor . RED + "-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ChatColor . GOLD ) + "WasteLand" ) + ChatColor . RED ) + "<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-" ) ) ; p . sendMessage ( messages [ BroadCastTask . index ] ) ; p . sendMessage ( ( ChatColor . RED + "-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-<seq2seq4repair_space>-" ) ) ; ( BroadCastTask . index ) ++ ; } ) ; <START_BUG> if ( ( BroadCastTask . index ) > messages . length ) <END_BUG> BroadCastTask . index = 0 ; } , ( 20 * 30 ) , ( 20 * 180 ) ) ; } }

Fix:
if ( ( BroadCastTask . index ) >= messages . length )
Buggy code:
public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator { protected double [ ] scaled ; protected Array2DRowRealMatrix nordsieck ; private FirstOrderIntegrator starter ; private final int nSteps ; private double exp ; private double safety ; private double minReduction ; private double maxGrowth ; protected MultistepIntegrator ( final String name , final int nSteps , final int order , final double minStep , final double maxStep , final double scalAbsoluteTolerance , final double scalRelativeTolerance ) { } protected MultistepIntegrator ( final String name , final int nSteps , final int order , final double minStep , final double maxStep , final double [ ] vecAbsoluteTolerance , final double [ ] vecRelativeTolerance ) { } public ODEIntegrator getStarterIntegrator ( ) { } public void setStarterIntegrator ( FirstOrderIntegrator starterIntegrator ) { } protected void start ( final double t0 , final double [ ] y0 , final double t ) throws MathIllegalStateException { } protected abstract Array2DRowRealMatrix initializeHighOrderDerivatives ( final double h , final double [ ] t , final double [ ] [ ] y , final double [ ] [ ] yDot ) { } public double getMinReduction ( ) { } public void setMinReduction ( final double minReduction ) { } public double getMaxGrowth ( ) { } public void setMaxGrowth ( final double maxGrowth ) { } public double getSafety ( ) { } public void setSafety ( final double safety ) { } protected double computeStepGrowShrinkFactor ( final double error ) { } public interface NordsieckTransformer { Array2DRowRealMatrix initializeHighOrderDerivatives ( final double h , final double [ ] t , final double [ ] [ ] y , final double [ ] [ ] yDot ) { } } private class NordsieckInitializer implements StepHandler { private int count ; private final double [ ] t ; private final double [ ] [ ] y ; private final double [ ] [ ] yDot ; public NordsieckInitializer ( final int nSteps , final int n ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } <START_BUG> public void init ( double t0 , double [ ] y0 , double t ) { <END_BUG> } } private static class InitializationCompletedMarkerException extends RuntimeException { private static final long serialVersionUID = - 1914085471038046418L ; public InitializationCompletedMarkerException ( ) { } } private class CountingDifferentialEquations implements FirstOrderDifferentialEquations { private final int dimension ; public CountingDifferentialEquations ( final int dimension ) { } public void computeDerivatives ( double t , double [ ] y , double [ ] dot ) { } public int getDimension ( ) { } } }

Fix:
public void init ( double t0 , double [ ] y0 , double time ) {
Buggy code:
public class SuperFieldAccess extends Expression { public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor ( SuperFieldAccess . class , "qualifier" , Name . class , ASTNode . OPTIONAL , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( SuperFieldAccess . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Name optionalQualifier = null ; private SimpleName fieldName = null ; SuperFieldAccess ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Name getQualifier ( ) { } public void setQualifier ( Name name ) { } public SimpleName getName ( ) { if ( ( this . fieldName ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . fieldName ) == null ) { preLazyInit ( ) ; this . fieldName = new SimpleName ( this . ast ) ; postLazyInit ( this . fieldName , SuperFieldAccess . NAME_PROPERTY ) ; } } } return this . fieldName ; } public IVariableBinding resolveFieldBinding ( ) { } public void setName ( SimpleName fieldName ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class ConstraintUpdateManager extends AbstractUpdateManager { private static final Localizer _loc = Localizer . forPackage ( ConstraintUpdateManager . class ) ; public boolean orderDirty ( ) { <START_BUG> return false ; <END_BUG> } protected PreparedStatementManager newPreparedStatementManager ( JDBCStore store , Connection conn ) { } protected RowManager newRowManager ( ) { } protected Collection flush ( RowManager rowMgr , PreparedStatementManager psMgr , Collection exceps ) { } private void analyzeForeignKeys ( Collection inserts , Collection updates , Collection deletes , RowManagerImpl rowMgr , Graph [ ] graphs ) { } private Row getInsertRow ( Map insertMap , RowManagerImpl rowMgr , Row row ) { } private Graph analyzeAgainstInserts ( Collection rows , RowManagerImpl rowMgr , Graph graph ) { } private static Table getBaseTable ( OpenJPAStateManager sm ) { } private Graph addEdge ( Graph graph , PrimaryRow row1 , PrimaryRow row2 , Object fk ) { } protected void flushGraph ( Graph graph , PreparedStatementManager psMgr , boolean autoAssign ) throws SQLException { } protected void flush ( Collection deleteUpdates , Collection nodes , PreparedStatementManager psMgr ) { } private void addDeleteUpdate ( Edge edge , Collection deleteUpdates ) throws SQLException { } private void addInsertUpdate ( PrimaryRow row , Edge edge , Collection insertUpdates ) throws SQLException { } private Edge findBreakableLink ( List cycle ) { } private DepthFirstAnalysis recalculateDepthFirstAnalysis ( Graph graph , boolean autoAssign ) { } private boolean resolveCycles ( Graph graph , Collection edges , Collection deleteUpdates , Collection insertUpdates ) throws SQLException { } protected DepthFirstAnalysis newDepthFirstAnalysis ( Graph graph , boolean autoAssign ) { } protected void flush ( Collection rows , PreparedStatementManager psMgr ) { } }

Fix:
return true ;
Buggy code:
public class ViewLabelProvider extends LabelProvider { private HashMap images ; Image cacheImage ( ImageDescriptor desc ) { } public void dispose ( ) { } public Image getImage ( Object element ) { } public String getText ( Object element ) { <START_BUG> String label = WorkbenchMessages . getString ( "ViewLabel.unknown" ) ; <END_BUG> if ( element instanceof Category ) label = ( ( Category ) ( element ) ) . getLabel ( ) ; else if ( element instanceof IViewDescriptor ) label = ( ( org . eclipse . ui . internal . registry . ViewDescriptor ) ( element ) ) . getLabel ( ) ; return DialogUtil . removeAccel ( label ) ; } }

Fix:
String label = WorkbenchMessages . ViewLabel_unknown ;
Buggy code:
public class SlotManager { private static SlotManager slotManager = new SlotManager ( ) ; private IMap < String , TreeSet < Slot > > unAssignedSlotMap ; private IMap < String , TreeSet < Long > > slotIDMap ; private IMap < String , Long > queueToLastAssignedIDMap ; private IMap < String , HashMap < String , List < Slot > > > slotAssignmentMap ; private static Log log = LogFactory . getLog ( SlotManager . class ) ; private SlotManager ( ) { } public static SlotManager getInstance ( ) { } public Slot getSlot ( String queueName , String nodeId ) { } private Slot getFreshSlot ( String queueName ) { } private void updateSlotAssignmentMap ( String queueName , Slot allocatedSlot , String nodeId ) { } public void updateMessageID ( String queueName , Long lastMessageIdInTheSlot ) { boolean isMessageIdRangeOutdated = false ; TreeSet < Long > messageIdSet = slotIDMap . get ( queueName ) ; if ( messageIdSet == null ) { messageIdSet = new TreeSet < Long > ( ) ; slotIDMap . putIfAbsent ( queueName , messageIdSet ) ; messageIdSet = slotIDMap . get ( queueName ) ; } String lockKey = queueName + ( SlotManager . class ) ; synchronized ( lockKey . intern ( ) ) { Long lastAssignedMessageId = queueToLastAssignedIDMap . get ( queueName ) ; if ( lastAssignedMessageId != null ) { <START_BUG> if ( lastMessageIdInTheSlot < lastAssignedMessageId ) { <END_BUG> isMessageIdRangeOutdated = true ; } } if ( ! isMessageIdRangeOutdated ) { messageIdSet . add ( lastMessageIdInTheSlot ) ; slotIDMap . set ( queueName , messageIdSet ) ; if ( SlotManager . log . isDebugEnabled ( ) ) { SlotManager . log . debug ( ( ( ( lastMessageIdInTheSlot + "<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>slotIdMap.<seq2seq4repair_space>CUrrent<seq2seq4repair_space>values<seq2seq4repair_space>in<seq2seq4repair_space>" ) + "map<seq2seq4repair_space>" ) + messageIdSet ) ) ; } } } } public void reAssignSlotsWhenMemberLeaves ( String nodeId ) { } public void deleteSlot ( String queueName , Slot emptySlot , String nodeId ) { } public void reAssignSlotWhenNoSubscribers ( String nodeId , String queueName ) { } public void deleteAllSlots ( String queueName ) { } public void clearAllActiveSlotRelationsToQueue ( String queueName ) { } }

Fix:
if ( lastMessageIdInTheSlot <= lastAssignedMessageId ) {
Buggy code:
class JsonUtils { private static long [ ] fractionalShift ; static int trimRight ( char [ ] s , int from , int to ) { } static boolean isNull ( char [ ] s , int from , int length ) { } static boolean isTrue ( char [ ] s , int from , int length ) { } static boolean isFalse ( char [ ] s , int from , int length ) { } static int skipSpaces ( char [ ] s , int from , int to ) { } static int parseNumber ( JsonBinder binder , char [ ] s , int from , int to ) { int i = from ; boolean minus = ( s [ from ] ) == '-' ; if ( minus ) i ++ ; if ( i == to ) throw new IllegalStateException ( "no<seq2seq4repair_space>number<seq2seq4repair_space>found,<seq2seq4repair_space>only<seq2seq4repair_space>'-'" ) ; boolean floatValue = false ; long l = 0 ; char ch = 0 ; while ( i < to ) { ch = s [ i ] ; if ( ( ch >= '0' ) && ( ch <= '9' ) ) { l = ( l * 10 ) + ( ch - '0' ) ; } else if ( ch == '.' ) { floatValue = true ; break ; } else break ; i ++ ; } if ( binder == null ) return i ; double d = 0 ; if ( floatValue ) { long number = l ; i ++ ; int fractionalPartStart = i ; while ( i < to ) { ch = s [ i ] ; if ( ( ch >= '0' ) && ( ch <= '9' ) ) number = ( number * 10 ) + ( ch - '0' ) ; else break ; i ++ ; } if ( minus ) d = ( - ( ( double ) ( number ) ) ) // ( JsonUtils . fractionalShift [ ( i - fractionalPartStart ) ] ) ; else d = ( ( double ) ( number ) ) // ( JsonUtils . fractionalShift [ ( i - fractionalPartStart ) ] ) ; } if ( minus ) l = - l ; if ( ( ch == 'e' ) || ( ch == 'E' ) ) { if ( ! floatValue ) { d = l ; floatValue = true ; } i ++ ; int degree = 0 ; minus = ( s [ i ] ) == '-' ; if ( minus ) i ++ ; while ( i < to ) { ch = s [ i ] ; if ( ( ch >= '0' ) && ( ch <= '9' ) ) degree = ( degree * 10 ) + ( ch - '0' ) ; else break ; i ++ ; } d = ( minus ) ? d // ( Math . pow ( 10 , degree ) ) : d * ( Math . pow ( 10 , degree ) ) ; } JsonFieldSetter setter = binder . getFieldSetter ( ) ; <START_BUG> if ( ( setter != null ) && ( ( setter . getType ( ) ) != ( Type . OBJECT ) ) ) { <END_BUG> JsonUtils . setNumber ( setter , binder . getObject ( ) , l , d , floatValue ) ; return i ; } if ( ! floatValue ) JsonUtils . set ( setter , binder , l ) ; else JsonUtils . set ( setter , binder , d ) ; return i ; } private static void setNumber ( FieldReflection setter , Object object , long l , double d , boolean floatValue ) { } static int parseValue ( JsonBinder binder , char [ ] s , int from , int to , char end ) { } private static void set ( JsonFieldSetter setter , JsonBinder binder , Object value ) { } private static void setBoolean ( JsonFieldSetter setter , JsonBinder binder , boolean value ) { } static int parseKey ( JsonBinder binder , char [ ] s , int from , int to ) { } }

Fix:
if ( setter != null ) {
Buggy code:
public class JavaModelCache { public static final int DEFAULT_PROJECT_SIZE = 5 ; public static final int DEFAULT_ROOT_SIZE = 50 ; public static final int DEFAULT_PKG_SIZE = 500 ; public static final int DEFAULT_OPENABLE_SIZE = 500 ; public static final int DEFAULT_CHILDREN_SIZE = 500 * 20 ; protected double memoryRatio = - 1 ; protected JavaModelInfo modelInfo ; protected HashMap projectCache ; protected ElementCache rootCache ; protected ElementCache pkgCache ; protected ElementCache openableCache ; protected Map childrenCache ; public JavaModelCache ( ) { } public Object getInfo ( IJavaElement element ) { } protected double getMemoryRatio ( ) { if ( ( this . memoryRatio ) == ( - 1 ) ) { long maxMemory = Runtime . getRuntime ( ) . maxMemory ( ) ; <START_BUG> this . memoryRatio = ( maxMemory == ( Long . MAX_VALUE ) ) ? 4.0 : ( ( double ) ( maxMemory ) ) // ( ( 64 * 1024 ) * 1024 ) ; <END_BUG> } return this . memoryRatio ; } protected Object peekAtInfo ( IJavaElement element ) { } protected void putInfo ( IJavaElement element , Object info ) { } protected void removeInfo ( IJavaElement element ) { } public String toStringFillingRation ( String prefix ) { } }

Fix:
this . memoryRatio = ( maxMemory == ( Long . MAX_VALUE ) ) ? 4.0 : ( ( double ) ( maxMemory ) ) // ( 64 * 1048576 ) ;
Buggy code:
public class dir { static final String [ ] months = new String [ ] { "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" } ; public static String usage ( ) { } public static void invoke ( Interpreter env , NameSpace namespace ) { } public static void invoke ( Interpreter env , NameSpace namespace , String dir ) { File file ; try { file = env . pathToFile ( dir ) ; } catch ( IOException e ) { env . println ( ( "error<seq2seq4repair_space>reading<seq2seq4repair_space>path:<seq2seq4repair_space>" + e ) ) ; return ; } if ( ( ! ( file . exists ( ) ) ) || ( ! ( file . canRead ( ) ) ) ) { env . println ( ( "Can't<seq2seq4repair_space>read<seq2seq4repair_space>" + file ) ) ; return ; } if ( ! ( file . isDirectory ( ) ) ) { env . println ( ( ( "'" + dir ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory" ) ) ; } String [ ] files = file . list ( ) ; files = dir . bubbleSort ( files ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { File f = new File ( ( ( dir + ( File . separator ) ) + ( files [ i ] ) ) ) ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( ( f . canRead ( ) ? "r" : "-" ) ) ; sb . append ( ( f . canWrite ( ) ? "w" : "-" ) ) ; sb . append ( "_" ) ; sb . append ( "<seq2seq4repair_space>" ) ; Date d = new Date ( f . lastModified ( ) ) ; GregorianCalendar c = new GregorianCalendar ( ) ; c . setTime ( d ) ; int day = c . get ( Calendar . DAY_OF_MONTH ) ; sb . append ( ( ( ( dir . months [ c . get ( Calendar . MONTH ) ] ) + "<seq2seq4repair_space>" ) + day ) ) ; if ( day < 10 ) sb . append ( "<seq2seq4repair_space>" ) ; sb . append ( "<seq2seq4repair_space>" ) ; int fieldlen = 8 ; StringBuffer len = new StringBuffer ( ) ; for ( int j = 0 ; j < fieldlen ; j ++ ) len . append ( "<seq2seq4repair_space>" ) ; len . insert ( 0 , f . length ( ) ) ; len . setLength ( fieldlen ) ; int si = len . toString ( ) . indexOf ( "<seq2seq4repair_space>" ) ; if ( si != ( - 1 ) ) { String pad = len . toString ( ) . substring ( si ) ; len . setLength ( si ) ; len . insert ( 0 , pad ) ; } <START_BUG> sb . append ( len ) ; <END_BUG> sb . append ( ( "<seq2seq4repair_space>" + ( f . getName ( ) ) ) ) ; if ( f . isDirectory ( ) ) sb . append ( "//" ) ; env . println ( sb . toString ( ) ) ; } } public static String [ ] bubbleSort ( String [ ] in ) { } }

Fix:
sb . append ( len . toString ( ) ) ;
Buggy code:
public interface StoreManager extends Closeable { public static final int VERSION_LATER = 1 ; public static final int VERSION_EARLIER = 2 ; public static final int VERSION_SAME = 3 ; public static final int VERSION_DIFFERENT = 4 ; public static final int FORCE_LOAD_NONE = 0 ; public static final int FORCE_LOAD_DFG = 1 ; public static final int FORCE_LOAD_REFRESH = 3 ; public static final int FORCE_LOAD_ALL = 2 ; public void setContext ( StoreContext ctx ) { } public void beginOptimistic ( ) { } public void rollbackOptimistic ( ) { } public void begin ( ) { } public void commit ( ) { } public void rollback ( ) { } public boolean exists ( OpenJPAStateManager sm , Object edata ) { } public boolean syncVersion ( OpenJPAStateManager sm , Object edata ) { } public boolean initialize ( OpenJPAStateManager sm , PCState state , FetchState fetchState , Object edata ) { } public boolean load ( OpenJPAStateManager sm , BitSet fields , FetchState fetchState , int lockLevel , Object edata ) { } <START_BUG> public Collection loadAll ( Collection sms , PCState state , int load , FetchState fetchState , Object edata ) ; <END_BUG> public void beforeStateChange ( OpenJPAStateManager sm , PCState fromState , PCState toState ) { } public Collection flush ( Collection sms ) { } public boolean assignObjectId ( OpenJPAStateManager sm , boolean preFlush ) { } public boolean assignField ( OpenJPAStateManager sm , int field , boolean preFlush ) { } public Class getManagedType ( Object oid ) { } public Class getDataStoreIdType ( ClassMetaData meta ) { } public Object copyDataStoreId ( Object oid , ClassMetaData meta ) { } public Object newDataStoreId ( Object oidVal , ClassMetaData meta ) { } public Object getClientConnection ( ) { } public void retainConnection ( ) { } public void releaseConnection ( ) { } public boolean cancelAll ( ) { } public ResultObjectProvider executeExtent ( ClassMetaData meta , boolean subclasses , FetchConfiguration fetch ) { } public StoreQuery newQuery ( String language ) { } public FetchConfiguration newFetchConfiguration ( ) { } public int compareVersion ( OpenJPAStateManager state , Object v1 , Object v2 ) { } public Seq getDataStoreIdSequence ( ClassMetaData forClass ) { } public Seq getValueSequence ( FieldMetaData forField ) { } public void close ( ) { } }

Fix:
public Collection loadAll ( Collection sms , PCState state , int load , FetchConfiguration fetch , Object edata ) ;
Buggy code:
public class FileUploadFieldTest extends WicketTestCase { public FileUploadFieldTest ( ) { } public void testInternalDetach ( ) throws Exception { final MockPageWithFormAndUploadField page = new MockPageWithFormAndUploadField ( ) ; FileUploadField field = new FileUploadField ( "upload" ) ; page . getForm ( ) . add ( field ) ; tester . startPage ( new ITestPageSource ( ) { private static final long serialVersionUID = 1L ; public Page getTestPage ( ) { return page ; } } ) ; RequestCycle requestCycle = tester . createRequestCycle ( ) ; MockHttpServletRequest servletRequest = tester . getServletRequest ( ) ; servletRequest . setMethod ( "POST" ) ; servletRequest . setParameter ( "form2:hf:fs" , "" ) ; servletRequest . setParameter ( "wicketState" , "" ) ; File tmp = null ; try { tmp = new File ( File . createTempFile ( this . getClass ( ) . getName ( ) , ".txt" ) ) ; OutputStream os = new BufferedOutputStream ( new FileOutputStream ( tmp ) ) ; for ( int i = 0 ; i < 1000 ; i ++ ) { os . write ( "test<seq2seq4repair_space>test<seq2seq4repair_space>test<seq2seq4repair_space>test<seq2seq4repair_space>test\n" . getBytes ( ) ) ; } os . close ( ) ; servletRequest . addFile ( "upload" , tmp , "text//plain" ) ; requestCycle . setRequest ( new wicket . protocol . http . servlet . MultipartServletWebRequest ( servletRequest , Bytes . MAX ) ) ; FileUpload fileUpload = field . getFileUpload ( ) ; assertNotNull ( fileUpload ) ; InputStream is = fileUpload . getInputStream ( ) ; assertTrue ( ( ( is . read ( ) ) != ( - 1 ) ) ) ; <START_BUG> field . internalOnDetach ( ) ; <END_BUG> try { is . read ( ) ; fail ( ) ; } catch ( IOException e ) { } catch ( Exception e ) { fail ( ) ; } } finally { if ( ( tmp != null ) && ( tmp . exists ( ) ) ) { tmp . delete ( ) ; } } } }

Fix:
field . detach ( ) ;
Buggy code:
public class UtilsTester { private static Logger logger = Logger . getLogger ( UtilsTester . class ) ; private Utils utils ; @ Before public void setup ( ) { } @ Test public void testEncryptData ( ) throws UnsupportedEncodingException , NoSuchAlgorithmException { int clusterID = Utils . getClusterID ( "127.0.0.1" , 3343 , 3 ) ; <START_BUG> Assert . assertNotNull ( clusterID ) ; <END_BUG> UtilsTester . logger . info ( clusterID ) ; } }

Fix:
Assert . assertEquals ( 2 , clusterID ) ;
Buggy code:
public class CloneTransformer < T > implements Serializable , Transformer < T , T > { private static final long serialVersionUID = - 8188742709499652567L ; public static final Transformer < Object , Object > INSTANCE = new CloneTransformer < Object > ( ) ; @ SuppressWarnings ( "unchecked" ) public static < T > Transformer < T , T > cloneTransformer ( ) { } private CloneTransformer ( ) { } <START_BUG> public T transform ( T input ) { <END_BUG> if ( input == null ) { return null ; } return PrototypeFactory . prototypeFactory ( input ) . create ( ) ; } private Object readResolve ( ) { } }

Fix:
public T transform ( final T input ) {
Buggy code:
public class ServerModelDeploymentStopUpdate extends AbstractServerModelUpdate < Void > { private static final long serialVersionUID = 5773083013951607950L ; private ServerGroupDeploymentElement deploymentElement ; private final String deploymentUnitName ; public ServerModelDeploymentStopUpdate ( final String deploymentUnitName ) { } public String getDeploymentUnitName ( ) { } @ Override public ServerModelDeploymentStartUpdate getCompensatingUpdate ( ServerModel original ) { } @ Override public void applyUpdate ( ServerModel serverModel ) throws UpdateFailedException { } @ Override public < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > resultHandler , final P param ) { <START_BUG> final ServiceName deploymentUnitServiceName = JBOSS_DEPLOYMENT . append ( deploymentUnitName ) ; <END_BUG> final ServiceRegistry serviceRegistry = updateContext . getServiceRegistry ( ) ; if ( ( deploymentElement ) != null ) { final ServiceController < ? > controller = serviceRegistry . getService ( deploymentUnitServiceName ) ; controller . setMode ( NEVER ) ; if ( resultHandler != null ) resultHandler . handleSuccess ( null , param ) ; } else if ( resultHandler != null ) { resultHandler . handleSuccess ( null , param ) ; } } }

Fix:
final ServiceName deploymentUnitServiceName = Services . deploymentUnitName ( deploymentUnitName ) ;
Buggy code:
public class HangmanApplication extends WicketExampleApplication { public HangmanApplication ( ) { } public Class getHomePage ( ) { } public Session newSession ( Request request , Response response ) { <START_BUG> return new HangmanSession ( this , request , response ) ; <END_BUG> } }

Fix:
return new HangmanSession ( this , request ) ;
Buggy code:
public class NewEventActivity extends Activity { private EditText mTitleEditText ; private EditText mLocationEditText ; private EditText mCommentsEditText ; private Button mSaveButton ; private Button mCancelButton ; private int mEventHour ; private int mEventMinute ; private int mEventDay ; private int mEventMonth ; private int mEventYear ; private EventDataSource mEventDataSource ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private boolean isValidInput ( ) { } public void showDatePicker ( View view ) { Calendar calendar = Calendar . getInstance ( ) ; int curYear = calendar . get ( Calendar . YEAR ) ; int curMonth = calendar . get ( Calendar . MONTH ) ; int curDay = calendar . get ( Calendar . DAY_OF_MONTH ) ; DatePickerDialog datePickerDialog = new DatePickerDialog ( this , new DatePickerDialog . OnDateSetListener ( ) { @ Override public void onDateSet ( DatePicker view , int year , int monthOfYear , int dayOfMonth ) { mEventDay = dayOfMonth ; <START_BUG> mEventMonth = monthOfYear ; <END_BUG> mEventYear = year ; } } , curYear , curMonth , curDay ) ; datePickerDialog . setMessage ( getString ( eventDatePickerMessage ) ) ; datePickerDialog . show ( ) ; } public void showTimePicker ( View view ) { } private OnClickListener mSaveClickListener = new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { } } ; private OnClickListener mCancelClickListener = new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { } } ; }

Fix:
mEventMonth = monthOfYear + 1 ;
Buggy code:
public class ShellBolt implements IBolt { public static Logger LOG = LoggerFactory . getLogger ( ShellBolt . class ) ; Process _subprocess ; OutputCollector _collector ; Map < String , Tuple > _inputs = new ConcurrentHashMap < String , Tuple > ( ) ; private String [ ] _command ; private ShellProcess _process ; private volatile boolean _running = true ; private volatile Throwable _exception ; private LinkedBlockingQueue _pendingWrites = new LinkedBlockingQueue ( ) ; private Random _rand ; private Thread _readerThread ; private Thread _writerThread ; public ShellBolt ( ShellComponent component ) { } public ShellBolt ( String ... command ) { } public void prepare ( Map stormConf , TopologyContext context , final OutputCollector collector ) { Object maxPending = stormConf . get ( TOPOLOGY_SHELLBOLT_MAX_PENDING ) ; <START_BUG> if ( ( maxPending != null ) && ( maxPending instanceof Number ) ) { <END_BUG> this . _pendingWrites = new LinkedBlockingQueue ( ( ( Number ) ( maxPending ) ) . intValue ( ) ) ; } _rand = new Random ( ) ; _process = new ShellProcess ( _command ) ; _collector = collector ; try { Number subpid = _process . launch ( stormConf , context ) ; ShellBolt . LOG . info ( ( "Launched<seq2seq4repair_space>subprocess<seq2seq4repair_space>with<seq2seq4repair_space>pid<seq2seq4repair_space>" + subpid ) ) ; } catch ( IOException e ) { throw new RuntimeException ( ( "Error<seq2seq4repair_space>when<seq2seq4repair_space>launching<seq2seq4repair_space>multilang<seq2seq4repair_space>subprocess\n" + ( _process . getErrorsString ( ) ) ) , e ) ; } _readerThread = new Thread ( new Runnable ( ) { public void run ( ) { while ( _running ) { try { JSONObject action = _process . readMessage ( ) ; if ( action == null ) { } String command = ( ( String ) ( action . get ( "command" ) ) ) ; if ( command . equals ( "ack" ) ) { handleAck ( action ) ; } else if ( command . equals ( "fail" ) ) { handleFail ( action ) ; } else if ( command . equals ( "error" ) ) { handleError ( action ) ; } else if ( command . equals ( "log" ) ) { String msg = ( ( String ) ( action . get ( "msg" ) ) ) ; ShellBolt . LOG . info ( ( "Shell<seq2seq4repair_space>msg:<seq2seq4repair_space>" + msg ) ) ; } else if ( command . equals ( "emit" ) ) { handleEmit ( action ) ; } } catch ( InterruptedException e ) { } catch ( Throwable t ) { die ( t ) ; } } } } ) ; _readerThread . start ( ) ; _writerThread = new Thread ( new Runnable ( ) { public void run ( ) { while ( _running ) { try { Object write = _pendingWrites . poll ( 1 , TimeUnit . SECONDS ) ; if ( write != null ) { _process . writeMessage ( write ) ; } _process . drainErrorStream ( ) ; } catch ( InterruptedException e ) { } catch ( Throwable t ) { die ( t ) ; } } } } ) ; _writerThread . start ( ) ; } public void execute ( Tuple input ) { } public void cleanup ( ) { } private void handleAck ( Map action ) { } private void handleFail ( Map action ) { } private void handleError ( Map action ) { } private void handleEmit ( Map action ) throws InterruptedException { } private void die ( Throwable exception ) { } }

Fix:
if ( maxPending != null ) {