nus-yam/ex-repair huggingface dataset:
Buggy code:
public class IncCompilerRun implements IAjcRun { final IncCompilerRun . Spec spec ; Sandbox sandbox ; public IncCompilerRun ( IncCompilerRun . Spec spec ) { } public boolean setupAjcRun ( Sandbox sandbox , Validator validator ) { } boolean doStaging ( final Validator validator ) { } public boolean run ( IRunStatus status ) { } private boolean hasFile ( ArrayList changed , File f ) { } public String toString ( ) { } public static class Spec extends AbstractRunSpec { public static final String XMLNAME = "inc-compile" ; protected ArrayList classesAdded ; protected ArrayList classesRemoved ; protected ArrayList classesUpdated ; private static final XMLNames NAMES = new XMLNames ( XMLNames . DEFAULT , "" , "" , null , "" , "classes" , null , false , false , true ) ; String tag ; public Spec ( ) { } public void setTag ( String input ) { } public String toString ( ) { } public void addDirChanges ( DirChanges . Spec spec ) { } public IRunIterator makeRunIterator ( Sandbox sandbox , Validator validator ) { } public void writeXml ( XMLWriter out ) { <START_BUG> String attr = out . makeAttribute ( "tag" , tag ) ; <END_BUG> out . startElement ( xmlElementName , attr , false ) ; super . writeAttributes ( out ) ; out . endAttributes ( ) ; if ( ! ( LangUtil . isEmpty ( dirChanges ) ) ) { DirChanges . Spec . writeXml ( out , dirChanges ) ; } List messages = getMessages ( ) ; if ( 0 < ( messages . size ( ) ) ) { SoftMessage . writeXml ( out , messages ) ; } out . endElement ( xmlElementName ) ; } public void setClassesAdded ( String items ) { } public void setClassesUpdated ( String items ) { } public void setClassesRemoved ( String items ) { } private void addItems ( ArrayList list , String items ) { } } }

Fix:
String attr = XMLWriter . makeAttribute ( "tag" , tag ) ;
Buggy code:
public class SearchIOHelper { public static char [ ] [ ] generate2DArrayMazeFromInput ( String fileName ) throws Exception { } public static void printMaze ( char [ ] [ ] maze ) { } public static void printMazeWithSolution ( char [ ] [ ] maze , List < Index > solutionPath ) { for ( int i = 0 ; i < ( maze . length ) ; i ++ ) { for ( int j = 0 ; j < ( maze [ 0 ] . length ) ; j ++ ) { Index ind = new Index ( i , j , null ) ; <START_BUG> if ( ( ( solutionPath . contains ( ind ) ) && ( ( maze [ i ] [ j ] ) != 'S' ) ) && ( ( maze [ i ] [ j ] ) != 'G' ) ) { <END_BUG> System . out . print ( '.' ) ; } else { System . out . print ( maze [ i ] [ j ] ) ; } } System . out . println ( ) ; } } public static void printSearchResults ( char [ ] [ ] maze , List < Index > solutionPath ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( solutionPath . contains ( ind ) ) && ( ( maze [ i ] [ j ] ) != ( SearchUtils . START ) ) ) && ( ( maze [ i ] [ j ] ) != ( SearchUtils . GOAL ) ) ) {
Buggy code:
public class GetUserStatusThread implements Runnable { public static void getUserStatus ( ) throws ClassNotFoundException , InterruptedException , SQLException , WeiboException { int pageNum = 1 ; System . out . println ( "<seq2seq4repair_space>Will<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>database<seq2seq4repair_space>and<seq2seq4repair_space>get<seq2seq4repair_space>users......." ) ; Connection conUser = PublicMethods . getConnection ( ) ; Statement stmt = conUser . createStatement ( ResultSet . TYPE_SCROLL_INSENSITIVE , ResultSet . CONCUR_UPDATABLE ) ; System . out . println ( "<seq2seq4repair_space>Okay<seq2seq4repair_space>the<seq2seq4repair_space>connnection<seq2seq4repair_space>to<seq2seq4repair_space>mysql<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>established..we<seq2seq4repair_space>are<seq2seq4repair_space>going<seq2seq4repair_space>to<seq2seq4repair_space>select<seq2seq4repair_space>id<seq2seq4repair_space>from<seq2seq4repair_space>users....." ) ; ResultSet rset = stmt . executeQuery ( "select<seq2seq4repair_space>id<seq2seq4repair_space>from<seq2seq4repair_space>users<seq2seq4repair_space>where<seq2seq4repair_space>isStatusDone<seq2seq4repair_space>=<seq2seq4repair_space>false;" ) ; long userId = ( ( long ) ( 0 ) ) ; while ( rset . next ( ) ) { userId = rset . getLong ( 1 ) ; Paging pag = new Paging ( ) ; pag . setCount ( 200 ) ; pageNum = 1 ; do { pag . setPage ( pageNum ) ; List < Status > statuses = weibo . getUserTimeline ( ( userId + "" ) , pag ) ; if ( statuses . isEmpty ( ) ) { PublicMethods . UpdateUserStatus ( conUser , userId ) ; Thread . sleep ( 3200 ) ; break ; } else { StringBuilder ids = new StringBuilder ( ) ; int statusNum = 0 ; int perRoundNum = 0 ; int roundNum = 0 ; int roundIndex = 0 ; int statusIndex = 0 ; statusNum = statuses . size ( ) ; if ( statusNum < 100 ) { roundNum = 1 ; perRoundNum = statusNum ; } else { roundNum = 2 ; perRoundNum = 100 ; } for ( int i = 0 ; i < roundNum ; i ++ ) { List < Count > counts = null ; ids = new StringBuilder ( ) ; for ( ; roundIndex < perRoundNum ; roundIndex ++ ) { ids . append ( statuses . get ( roundIndex ) . getId ( ) ) . append ( ',' ) ; } if ( ( ids . length ( ) ) != 0 ) { ids . deleteCharAt ( ( ( ids . length ( ) ) - 1 ) ) ; counts = weibo . getCounts ( ids . toString ( ) ) ; } int rtCounts = 0 ; int commentCounts = 0 ; <START_BUG> if ( ( counts . isEmpty ( ) ) == false ) { <END_BUG> for ( Count count : counts ) { rtCounts = ( ( int ) ( count . getRt ( ) ) ) ; commentCounts = ( ( int ) ( count . getComments ( ) ) ) ; PublicMethods . InsertStatusSql ( conUser , statuses . get ( statusIndex ) , rtCounts , commentCounts ) ; statusIndex ++ ; } } if ( roundNum == 2 ) { perRoundNum = statusNum ; statusIndex = 100 ; } } pageNum ++ ; } Thread . sleep ( 4900 ) ; } while ( true ) ; System . out . println ( "Oops,<seq2seq4repair_space>Empty~~" ) ; } conUser . close ( ) ; } public void run ( ) { } }

Fix:
if ( ( counts != null ) && ( ( counts . isEmpty ( ) ) == false ) ) {
Buggy code:
class BasicResourceReferenceMapper extends AbstractResourceReferenceMapper { private final IPageParametersEncoder pageParametersEncoder ; public BasicResourceReferenceMapper ( IPageParametersEncoder pageParametersEncoder ) { } public BasicResourceReferenceMapper ( ) { } public IRequestHandler mapRequest ( Request request ) { Url url = request . getUrl ( ) ; if ( ( ( url . getSegments ( ) . size ( ) ) >= 4 ) && ( urlStartsWith ( url , getContext ( ) . getNamespace ( ) , getContext ( ) . getResourceIdentifier ( ) ) ) ) { String className = url . getSegments ( ) . get ( 2 ) ; StringBuilder name = new StringBuilder ( ) ; for ( int i = 3 ; i < ( url . getSegments ( ) . size ( ) ) ; ++ i ) { if ( ( name . length ( ) ) > 0 ) { name . append ( "//" ) ; } name . append ( url . getSegments ( ) . get ( i ) ) ; } ResourceReference . UrlAttributes attributes = getResourceReferenceAttributes ( url ) ; PageParameters pageParameters = extractPageParameters ( request , url . getSegments ( ) . size ( ) , pageParametersEncoder ) ; Class < ? > scope = resolveClass ( className ) ; if ( scope != null ) { <START_BUG> ResourceReference res = getContext ( ) . getResourceReferenceRegistry ( ) . getResourceReference ( scope , name . toString ( ) , attributes . getLocale ( ) , attributes . getStyle ( ) , attributes . getVariation ( ) , true ) ; <END_BUG> if ( res != null ) { return new org . apache . wicket . request . handler . resource . ResourceReferenceRequestHandler ( res , pageParameters ) ; } } } return null ; } protected Class < ? > resolveClass ( String name ) { } protected String getClassName ( Class < ? > scope ) { } public Url mapHandler ( IRequestHandler requestHandler ) { } public int getCompatibilityScore ( Request request ) { } }

Fix:
ResourceReference res = getContext ( ) . getResourceReferenceRegistry ( ) . getResourceReference ( scope , name . toString ( ) , attributes . getLocale ( ) , attributes . getStyle ( ) , attributes . getVariation ( ) , true , true ) ;
Buggy code:
public class FileSystemPublisher extends BasePublisher { private static final Logger logger = Logger . getLogger ( FileSystemPublisher . class ) ; private String publishPath ; @ Override public boolean initialize ( Job job , Provider provider ) { } public boolean publish ( Job job ) { File path = new File ( publishPath ) . getAbsoluteFile ( ) ; if ( ! ( path . exists ( ) ) ) { job . addMessage ( "Specified<seq2seq4repair_space>publishPath<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ; return false ; } else if ( ! ( path . isDirectory ( ) ) ) { job . addMessage ( "Specified<seq2seq4repair_space>publishPath<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>directory." ) ; return false ; } else if ( ! ( path . canWrite ( ) ) ) { job . addMessage ( "Cannot<seq2seq4repair_space>write<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>specified<seq2seq4repair_space>publishPath." ) ; return false ; } <START_BUG> File report = getReport ( path ) ; <END_BUG> return report != null ; } public String getName ( ) { } public String getDescription ( ) { } }

Fix:
File report = getResult ( path ) ;
Buggy code:
public class MySuggestionDisplay extends DefaultSuggestionDisplay { private boolean paletteShouldIgnoreMouseClicks = false ; private final Timer popupHideTimer ; @ Override protected PopupPanel createPopup ( ) { } @ Override protected void showSuggestions ( SuggestBox suggestBox , Collection < ? extends Suggestion > suggestions , boolean isDisplayStringHTML , boolean isAutoSelectEnabled , SuggestionCallback callback ) { super . showSuggestions ( suggestBox , suggestions , isDisplayStringHTML , isAutoSelectEnabled , callback ) ; <START_BUG> getPopupPanel ( ) . getWidget ( ) . setWidth ( ( ( ( ( suggestBox . getElement ( ) . getAbsoluteRight ( ) ) - ( suggestBox . getAbsoluteLeft ( ) ) ) - 40 ) + ( PX . getType ( ) ) ) ) ; <END_BUG> if ( isSuggestionListShowing ( ) ) { popupHideTimer . cancel ( ) ; paletteShouldIgnoreMouseClicks = true ; } } @ Override protected Widget decorateSuggestionList ( Widget suggestionList ) { } public boolean getPaletteShouldIgnoreMouseClicks ( ) { } No newline ; at end ; of file ; }

Fix:
getPopupPanel ( ) . getWidget ( ) . setWidth ( ( ( suggestBox . getElement ( ) . getScrollWidth ( ) ) + ( PX . getType ( ) ) ) ) ;
Buggy code:
class InstanceofExpression implements Exp { private final PCPath _path ; private final Class _cls ; private Joins _joins = null ; private Discriminator _dsc = null ; private Class _relCls = null ; private ClassMapping _mapping = null ; public InstanceofExpression ( PCPath path , Class cls ) { } public void initialize ( Select sel , JDBCStore store , Object [ ] params , Map contains ) { _path . initialize ( sel , store , false ) ; _path . joinRelation ( ) ; _joins = _path . getJoins ( ) ; ClassMapping rel = _path . getClassMapping ( ) ; if ( rel == null ) { FieldMapping field = _path . getFieldMapping ( ) ; switch ( field . getTypeCode ( ) ) { case JavaTypes . MAP : if ( _path . isKey ( ) ) _relCls = field . getKey ( ) . getDeclaredType ( ) ; case JavaTypes . ARRAY : case JavaTypes . COLLECTION : _relCls = field . getElement ( ) . getDeclaredType ( ) ; break ; default : _relCls = field . getDeclaredType ( ) ; } } else _relCls = rel . getDescribedType ( ) ; _dsc = ( ( rel == null ) || ( ! ( rel . getDescribedType ( ) . isAssignableFrom ( _cls ) ) ) ) ? null : rel . getDiscriminator ( ) ; if ( ( _dsc ) != null ) { <START_BUG> MappingRepository repos = store . getConfiguration ( ) . getMappingRepository ( ) ; <END_BUG> _mapping = repos . getMapping ( _cls , store . getContext ( ) . getClassLoader ( ) , false ) ; if ( ( _mapping ) == null ) _dsc = null ; else { ClassMapping owner = _dsc . getClassMapping ( ) ; ClassMapping from ; ClassMapping to ; if ( rel . getDescribedType ( ) . isAssignableFrom ( owner . getDescribedType ( ) ) ) { from = owner ; to = rel ; } else { from = rel ; to = owner ; } for ( ; ( from != null ) && ( from != to ) ; from = from . getJoinablePCSuperclassMapping ( ) ) _joins = from . joinSuperclass ( _joins , false ) ; } } } public void appendTo ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchState fetchState ) { } public void selectColumns ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchState fetchState ) { } public Joins getJoins ( ) { } public boolean hasContainsExpression ( ) { } public boolean hasVariable ( Variable var ) { } }

Fix:
MappingRepository repos = store . getConfiguration ( ) . getMappingRepositoryInstance ( ) ;
Buggy code:
public class BeanShell extends AbstractFunction { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final List < String > desc = new LinkedList < String > ( ) ; private static final String KEY = "__BeanShell" ; public static final String INIT_FILE = "beanshell.function.init" ; private Object [ ] values ; private BeanShellInterpreter bshInterpreter = null ; public BeanShell ( ) { } @ Override public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { } public void log_info ( String s ) { } @ Override public synchronized void setParameters ( Collection < CompoundVariable > parameters ) throws InvalidVariableException { checkParameterCount ( parameters , 1 , 2 ) ; values = parameters . toArray ( ) ; try { bshInterpreter = new BeanShellInterpreter ( JMeterUtils . getProperty ( BeanShell . INIT_FILE ) , BeanShell . log ) ; } catch ( ClassNotFoundException e ) { <START_BUG> throw new InvalidVariableException ( "BeanShell<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; <END_BUG> } } @ Override public String getReferenceKey ( ) { } public List < String > getArgumentDesc ( ) { } }

Fix:
throw new InvalidVariableException ( "BeanShell<seq2seq4repair_space>not<seq2seq4repair_space>found" , e ) ;
Buggy code:
public class DriveTrain { Joystick j ; Talon leftDrive ; Talon rightDrive ; private RobotDrive rd ; private double power ; private double turnRate ; public DriveTrain ( Joystick joyStick ) { } public void drive ( ) { if ( j . getRawButton ( 5 ) ) { power = 0 ; turnRate = 0 ; } else if ( j . getRawButton ( 7 ) ) { power = 0.8 ; turnRate = 0.6 ; } else if ( j . getRawButton ( 6 ) ) { power = 0.5 ; turnRate = 0.4 ; } else if ( j . getRawButton ( 8 ) ) { power = 1.0 ; turnRate = 0.8 ; } <START_BUG> rd . arcadeDrive ( ( ( j . getY ( ) ) * ( power ) ) , ( ( - ( j . getX ( ) ) ) * ( turnRate ) ) , true ) ; <END_BUG> } public double getPower ( ) { } public double getTurnRate ( ) { } }

Fix:
rd . arcadeDrive ( ( ( - ( j . getY ( ) ) ) * ( power ) ) , ( ( - ( j . getX ( ) ) ) * ( turnRate ) ) , true ) ;
Buggy code:
public class Application extends Controller { private static Map < String , TransferExtractor > transferExtractorPool = new HashMap < String , TransferExtractor > ( ) ; public static Result index ( ) { } public static Result transfers ( String file , String route , int direction ) { if ( ! ( Application . transferExtractorPool . containsKey ( file ) ) ) return notFound ( "No<seq2seq4repair_space>such<seq2seq4repair_space>GTFS<seq2seq4repair_space>feed" ) ; TransferExtractor t = Application . transferExtractorPool . get ( file ) ; Route r = t . feed . routes . get ( route ) ; if ( r == null ) return notFound ( "no<seq2seq4repair_space>such<seq2seq4repair_space>route" ) ; if ( ( direction != 0 ) && ( direction != 1 ) ) return badRequest ( "direction<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>0<seq2seq4repair_space>or<seq2seq4repair_space>1" ) ; RouteDirection rd = new RouteDirection ( r , Direction . fromGtfs ( direction ) ) ; <START_BUG> Transfer [ ] xfers = t . getTransfers ( rd , 100 ) ; <END_BUG> List < Transfer > ret = new ArrayList < Transfer > ( ) ; Stop [ ] fromStops = t . stopsForRouteDirection ( rd ) ; String destName = fromStops [ ( ( fromStops . length ) - 1 ) ] . stop_name ; for ( Transfer xfer : xfers ) { xfer . transferTimes = t . transferTimes ( xfer ) ; if ( ( xfer . transferTimes . length ) > 0 ) ret . add ( xfer ) ; Stop [ ] stops = t . stopsForRouteDirection ( xfer . toRouteDirection ) ; xfer . toRouteDirection . destination = stops [ ( ( stops . length ) - 1 ) ] . stop_name ; xfer . fromRouteDirection . destination = destName ; } return ok ( Json . toJson ( ret ) ) ; } public static Result routes ( String file ) { } }

Fix:
Transfer [ ] xfers = t . getTransfers ( rd , 400 ) ;
Buggy code:
public abstract class UserMapper { private static final String getUserAttributesSqlString ( User user ) { } public static final void createUser ( User user ) { } public static final boolean checkUserData ( String attribute , String value ) { } public static final void follows ( User follower , User toBeFollowed ) { } public static final void unfollows ( User follower , User toBeUnfollowed ) { } public static final void addAUserToUserList ( User listOwner , UserList list , User toBeAdded ) { } public static final List < User > getFollowers ( User user ) { List < User > followers = new ArrayList < User > ( ) ; Connection connection = DBConnection . getConnection ( ) ; Statement stmt = null ; String sql = ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>luser<seq2seq4repair_space>where<seq2seq4repair_space>id<seq2seq4repair_space>in<seq2seq4repair_space>(select<seq2seq4repair_space>luser_id_follower<seq2seq4repair_space>from<seq2seq4repair_space>luser_follows_luser<seq2seq4repair_space>where<seq2seq4repair_space>luser_id_followed<seq2seq4repair_space>=<seq2seq4repair_space>'" + ( user . getId ( ) ) ) + "'" ; try { stmt = connection . createStatement ( ) ; ResultSet result = stmt . executeQuery ( sql ) ; while ( result . next ( ) ) { followers . add ( new User ( result . getString ( "id" ) , null ) ) ; } return followers ; } catch ( SQLException ex ) { <START_BUG> Logger . getLogger ( UserMapper . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; <END_BUG> } finally { if ( stmt != null ) stmt = null ; if ( connection != null ) { try { connection . close ( ) ; } catch ( SQLException e ) { } connection = null ; } } return null ; } public static final List < User > getFollowing ( User user ) { } public static final User getUserInfo ( User user ) { } }

Fix:
Logger . getLogger ( UserMapper . class . getName ( ) ) . log ( Level . SEVERE , ex . getMessage ( ) , ex ) ;
Buggy code:
public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { <START_BUG> if ( ( ( originalMethod . typeVariables ) == ( NoTypeVariables ) ) || ( originalMethod . isStatic ( ) ) ) { <END_BUG> return super . createParameterizedMethod ( originalMethod ) ; } return new ParameterizedGenericMethodBinding ( originalMethod , this , this . environment ) ; } public int kind ( ) { } public String debugName ( ) { } public char [ ] genericTypeSignature ( ) { } public boolean isEquivalentTo ( TypeBinding otherType ) { } public boolean isIntersectingWith ( TypeBinding otherType ) { } public boolean isParameterizedType ( ) { } public boolean isRawType ( ) { } protected void initializeArguments ( ) { } public char [ ] readableName ( ) { } public char [ ] shortReadableName ( ) { } }

Fix:
if ( ( ( originalMethod . typeVariables ) == ( Binding . NO_TYPE_VARIABLES ) ) || ( originalMethod . isStatic ( ) ) ) {
Buggy code:
public interface SortAlgorithm { public void sort ( final int [ ] array ) { } public int getNumberOfKeyComparisons ( ) { } <START_BUG> public int getRuntimeMilliseconds ( ) ; <END_BUG> public void reset ( ) { } }

Fix:
public long getRuntimeMilliseconds ( ) ;
Buggy code:
public class ModClusterStop implements OperationStepHandler , DescriptionProvider { static final ModClusterStop INSTANCE = new ModClusterStop ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; List < Property > list = operation . asPropertyList ( ) ; Iterator < Property > it = list . iterator ( ) ; int waittime = 10 ; while ( it . hasNext ( ) ) { Property prop = it . next ( ) ; if ( prop . getName ( ) . equals ( "waittime" ) ) { waittime = Integer . parseInt ( ContextHost . RemoveQuotes ( prop . getValue ( ) . toString ( ) ) ) ; } } modcluster . stop ( waittime ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class Response { public String status ; public List < byte [ ] > raw ; public List < byte [ ] > keys = new ArrayList < byte [ ] > ( ) ; public Map < byte [ ] , byte [ ] > items = new LinkedHashMap < byte [ ] , byte [ ] > ( ) ; public Response ( List < byte [ ] > raw ) { } public Object exception ( ) throws Exception { } public boolean ok ( ) { } public boolean not_found ( ) { } public void buildMap ( ) { <START_BUG> for ( int i = 1 ; i < ( raw . size ( ) ) ; i += 2 ) { <END_BUG> byte [ ] k = raw . get ( i ) ; byte [ ] v = raw . get ( ( i + 1 ) ) ; keys . add ( k ) ; items . put ( k , v ) ; } } public void print ( ) { } }

Fix:
for ( int i = 1 ; i < ( ( raw . size ( ) ) + 1 ) ; i += 2 ) {
Buggy code:
public class Block extends Statement { public Statement [ ] statements ; public int explicitDeclarations ; public BlockScope scope ; public Block ( int explicitDeclarations ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public boolean isEmptyBlock ( ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope upperScope ) { } public void resolveUsing ( BlockScope givenScope ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } <START_BUG> public void branchChainTo ( Label label ) { <END_BUG> if ( ( this . statements ) != null ) { this . statements [ ( ( statements . length ) - 1 ) ] . branchChainTo ( label ) ; } } }

Fix:
public void branchChainTo ( BranchLabel label ) {
Buggy code:
public class GameLoadingScreen extends AbstractScreen { Logo logo ; Sunrays sunrays ; TextItem loadingTextItem ; public GameLoadingScreen ( MBreak game , Logo givenLogo , Sunrays givenSunrays ) { } private boolean finishedLoading = false ; private boolean finishedTweening = false ; @ Override public void render ( float delta ) { super . render ( delta ) ; if ( ( Assets . getAssetManager ( ) . update ( ) ) && ( ! ( finishedLoading ) ) ) { sunrays . removeTarget ( ) ; Timeline . createSequence ( ) . push ( Tween . to ( logo , POSITION_Y , 0.5F ) . target ( ( ( graphics . getHeight ( ) ) + ( logo . getHeight ( ) ) ) ) . ease ( easeInExpo ) ) . setCallback ( new TweenCallback ( ) { @ Override public void onEvent ( int type , BaseTween < ? > source ) { finishedTweening = true ; } } ) . start ( getTweenManager ( ) ) ; loadingTextItem . remove ( ) ; finishedLoading = true ; } if ( ! ( finishedLoading ) ) { <START_BUG> loadingTextItem . setString ( ( ( "Now<seq2seq4repair_space>Loading<seq2seq4repair_space>" + ( ( int ) ( ( Assets . getAssetManager ( ) . getProgress ( ) ) * 100 ) ) ) + "%" ) ) ; <END_BUG> loadingTextItem . setX ( ( ( ( graphics . getWidth ( ) ) - ( loadingTextItem . getWidth ( ) ) ) // 2 ) ) ; } } @ Override public void postRender ( float delta ) { } }

Fix:
loadingTextItem . setText ( ( ( "Now<seq2seq4repair_space>Loading<seq2seq4repair_space>" + ( ( int ) ( ( Assets . getAssetManager ( ) . getProgress ( ) ) * 100 ) ) ) + "%" ) ) ;
Buggy code:
public class LoopHoleConnectionTask implements IPieEventTask < LoopHoleConnectionMessage > { private LoopHoleConnectionMessage msg ; private ILoopHoleService loopHoleService ; private boolean isWaitingForAck = false ; private boolean stop = false ; private String host ; private int port ; private IBeanService beanService ; @ Override public void setEvent ( LoopHoleConnectionMessage msg ) { } public IBeanService getBeanService ( ) { } public void setBeanService ( IBeanService beanService ) { } public void setLoopHoleService ( ILoopHoleService longHoleService ) { } public void setMsg ( LoopHoleConnectionMessage msg ) { } @ Override public void run ( ) { LoopHoleAckMessage ackMsg = beanService . getBean ( LoopHoleAckMessage . class ) ; <START_BUG> loopHoleService . sendToServer ( msg ) ; <END_BUG> int endpoint = 0 ; while ( ! ( stop ) ) { if ( endpoint == 0 ) { host = msg . getClientPrivateIP ( ) ; port = msg . getClientPrivatePort ( ) ; endpoint ++ ; } else { host = msg . getClientPublicIP ( ) ; port = msg . getClientPublicPort ( ) ; endpoint = 0 ; } LoopHolePunchMessage punchMsg = beanService . getBean ( LoopHolePunchMessage . class ) ; punchMsg . setTo ( msg . getFromId ( ) ) ; punchMsg . setFrom ( loopHoleService . getClientID ( ) ) ; punchMsg . setName ( loopHoleService . getName ( ) ) ; loopHoleService . addInWaitFromAckQueu ( msg . getFromId ( ) , this ) ; loopHoleService . send ( punchMsg , host , port ) ; isWaitingForAck = true ; try { Thread . sleep ( 500 ) ; } catch ( InterruptedException ex ) { PieLogger . error ( this . getClass ( ) , "Error<seq2seq4repair_space>while<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>ACK" , ex ) ; } isWaitingForAck = false ; loopHoleService . removeTaskFromAckWaitQueue ( msg . getFromId ( ) ) ; } } public void ackArrived ( ) { } }

Fix:
loopHoleService . sendToServer ( ackMsg ) ;
Buggy code:
public class SimpleSecurityManager implements ServerSecurityManager { private ThreadLocalStack < SecurityContext > contexts = new ThreadLocalStack < SecurityContext > ( ) ; private boolean propagate = true ; public SimpleSecurityManager ( ) { } public SimpleSecurityManager ( SimpleSecurityManager delegate ) { } private ISecurityManagement securityManagement = null ; private PrivilegedAction < SecurityContext > securityContext ( ) { } private SecurityContext establishSecurityContext ( final String securityDomain ) { } public void setSecurityManagement ( ISecurityManagement iSecurityManagement ) { } public Principal getCallerPrincipal ( ) { } public Subject getSubject ( ) { } private Principal getPrincipal ( Subject subject ) { } @ Override public boolean isCallerInRole ( String ejbName , Object mappedRoles , Map < String , Collection < String > > roleLinks , String ... roleNames ) { } public boolean isCallerInRole ( final String ejbName , final String policyContextID , final Object incommingMappedRoles , final Map < String , Collection < String > > roleLinks , final String ... roleNames ) { } public boolean authorize ( String ejbName , CodeSource ejbCodeSource , String ejbMethodIntf , Method ejbMethod , Set < Principal > methodRoles , String contextID ) { } public void push ( final String securityDomain ) { } public void push ( final String securityDomain , String userName , char [ ] password , final Subject subject ) { } public void authenticate ( ) { } public void authenticate ( final String runAs , final String runAsPrincipal , final Set < String > extraRoles ) { } private boolean authenticate ( SecurityContext context , Subject subject ) { } private Identity getUnauthenticatedIdentity ( ) { } public void pop ( ) { } private void audit ( String level , AuditManager auditManager , Principal userPrincipal ) { <START_BUG> AuditEvent auditEvent = new AuditEvent ( AuditLevel . SUCCESS ) ; <END_BUG> Map < String , Object > ctxMap = new HashMap < String , Object > ( ) ; ctxMap . put ( "principal" , ( userPrincipal != null ? userPrincipal . getName ( ) : "null" ) ) ; ctxMap . put ( "Source" , getClass ( ) . getCanonicalName ( ) ) ; ctxMap . put ( "Action" , "authentication" ) ; auditEvent . setContextMap ( ctxMap ) ; auditManager . audit ( auditEvent ) ; } private SubjectInfo getSubjectInfo ( final SecurityContext context ) { } private RoleGroup getSubjectRoles ( final AuthorizationManager am , final SecurityContextCallbackHandler scb , final Subject authenticatedSubject ) { } private Map < String , Set < String > > setSecurityRolesAssociation ( Map < String , Set < String > > mappedRoles ) { } private static class SetSecurityRolesAssociationAction implements PrivilegedAction < Map < String , Set < String > > > { private final Map < String , Set < String > > mappedRoles ; SetSecurityRolesAssociationAction ( Map < String , Set < String > > mappedRoles ) { } @ Override public Map < String , Set < String > > run ( ) { } } }

Fix:
AuditEvent auditEvent = new AuditEvent ( level ) ;
Buggy code:
final class EndpointConfigRemove extends AbstractRemoveStepHandler { static final EndpointConfigRemove INSTANCE = new EndpointConfigRemove ( ) ; private EndpointConfigRemove ( ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { final ServerConfig config = PackageUtils . getServerConfig ( context ) ; if ( config != null ) { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; EndpointConfig target = null ; for ( EndpointConfig epConfig : config . getEndpointConfigs ( ) ) { if ( epConfig . getConfigName ( ) . equals ( name ) ) { target = epConfig ; } } if ( target != null ) { config . getEndpointConfigs ( ) . remove ( target ) ; <START_BUG> context . restartRequired ( ) ; <END_BUG> } } } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
context . reloadRequired ( ) ;
Buggy code:
public class ScrollPopupShareUtil { static boolean device = BrowserAgent . isDevice ( ) ; static Widget widgetContainer ; public static void ScrollPopupUtilWidget ( Widget widget ) { } public static class ResizeEvent implements ResizeHandler { @ Override public void onResize ( com . google . gwt . event . logical . shared . ResizeEvent event ) { } } static void setAddTagesPopupOnResize ( ) { if ( ScrollPopupShareUtil . device ) { if ( ( ( Window . getClientHeight ( ) ) - 150 ) <= 564 ) { ScrollPopupShareUtil . widgetContainer . getElement ( ) . getStyle ( ) . setHeight ( ( ( Window . getClientHeight ( ) ) - 150 ) , PX ) ; ScrollPopupShareUtil . widgetContainer . getElement ( ) . getStyle ( ) . setOverflowY ( AUTO ) ; ScrollPopupShareUtil . widgetContainer . getElement ( ) . getStyle ( ) . setOverflowX ( AUTO ) ; } else { <START_BUG> ScrollPopupShareUtil . widgetContainer . getElement ( ) . getStyle ( ) . setHeight ( 564 , PX ) ; <END_BUG> ScrollPopupShareUtil . widgetContainer . getElement ( ) . getStyle ( ) . setOverflow ( AUTO ) ; } } } }

Fix:
ScrollPopupShareUtil . widgetContainer . getElement ( ) . getStyle ( ) . setHeight ( 500 , PX ) ;
Buggy code:
public class Request implements Serializable { private static final long serialVersionUID = - 6428866228973362178L ; private static long nextRequestId = 0 ; long requestId ; ID requestContainerID ; long serviceId ; RemoteCallImpl call ; Response response ; boolean done = false ; transient IRemoteCallListener listener = null ; public Request ( ID requestContainerID , long serviceId , RemoteCallImpl call ) { } public Request ( ID requestContainerID , long serviceId , RemoteCallImpl call , IRemoteCallListener listener ) { } public long getRequestId ( ) { } public ID getRequestContainerID ( ) { } public long getServiceId ( ) { } public RemoteCallImpl getCall ( ) { } protected void setResponse ( Response response ) { } protected Response getResponse ( ) { } protected boolean isDone ( ) { } protected void setDone ( boolean val ) { } protected IRemoteCallListener getListener ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "Request[" ) ; <END_BUG> buf . append ( "requestId=" ) . append ( requestId ) . append ( ";cont=" ) . append ( requestContainerID ) . append ( ";serviceId=" ) . append ( serviceId ) . append ( ";call=" ) . append ( call ) . append ( ";done=" ) . append ( done ) . append ( ";response=" ) . append ( response ) . append ( ";listener=" ) . append ( listener ) . append ( "]" ) ; return buf . toString ( ) ; } }

Fix:
final StringBuffer buf = new StringBuffer ( "Request[" ) ;
Buggy code:
class ManagedSocketBinding extends Socket implements ManagedBinding { private final String name ; private final ManagedBindingRegistry socketBindings ; ManagedSocketBinding ( final ManagedBindingRegistry socketBindings ) { } ManagedSocketBinding ( final String name , final ManagedBindingRegistry socketBindings ) { } @ Override public String getSocketBindingName ( ) { } public InetSocketAddress getBindAddress ( ) { <START_BUG> return InetSocketAddress . class . cast ( getLocalAddress ( ) ) ; <END_BUG> } public void bind ( SocketAddress bindpoint ) throws IOException { } public synchronized void close ( ) throws IOException { } }

Fix:
return new InetSocketAddress ( getLocalAddress ( ) , getPort ( ) ) ;
Buggy code:
public class Goldaxe extends Resource { public Goldaxe ( String name ) { } @ Override public ArrayList < String > neededToCraft ( ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return resourcesNeeded ;
Buggy code:
public class SimpleType extends Type { public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( SimpleType . class , "name" , Name . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Name typeName = null ; SimpleType ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { SimpleType result = new SimpleType ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setName ( ( ( Name ) ( getName ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Name getName ( ) { } public void setName ( Name typeName ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class PatternReplaceCharFilter extends BaseCharFilter { private final Pattern pattern ; private final String replacement ; private Reader transformedInput ; public PatternReplaceCharFilter ( Pattern pattern , String replacement , Reader in ) { } @ Override public int read ( char [ ] cbuf , int off , int len ) throws IOException { } private void fill ( ) throws IOException { StringBuilder buffered = new StringBuilder ( ) ; char [ ] temp = new char [ 1024 ] ; <START_BUG> for ( int cnt = in . read ( temp ) ; cnt > 0 ; cnt = in . read ( temp ) ) { <END_BUG> buffered . append ( temp , 0 , cnt ) ; } transformedInput = new StringReader ( processPattern ( buffered ) . toString ( ) ) ; } @ Override public int read ( ) throws IOException { } @ Override protected int correct ( int currentOff ) { } CharSequence processPattern ( CharSequence input ) { } }

Fix:
for ( int cnt = input . read ( temp ) ; cnt > 0 ; cnt = input . read ( temp ) ) {
Buggy code:
public final class WicketParamTagHandler extends AbstractMarkupFilter { private static final Log log = LogFactory . getLog ( WicketParamTagHandler . class ) ; private ComponentTag componentTag ; private ComponentTag lastTag ; private IXmlPullParser xmlParser ; private boolean stripWicketTag = true ; public WicketParamTagHandler ( final IMarkupFilter parent ) { } public void setStripWicketTag ( final boolean strip ) { } public final MarkupElement nextTag ( ) throws ParseException { } private ComponentTag handleNext ( ComponentTag tag ) throws ParseException { if ( tag . isClose ( ) ) { return tag ; } <START_BUG> if ( ( tag . getComponentId ( ) ) == null ) { <END_BUG> componentTag = null ; return tag ; } if ( ( ! ( tag instanceof ComponentWicketTag ) ) || ( ! ( ( ( ComponentWicketTag ) ( tag ) ) . isParamTag ( ) ) ) ) { componentTag = tag ; return tag ; } final CharSequence rawMarkup = xmlParser . getInputSubsequence ( ( ( lastTag . getPos ( ) ) + ( lastTag . getLength ( ) ) ) , tag . getPos ( ) ) ; if ( ( rawMarkup . length ( ) ) > 0 ) { String text = rawMarkup . toString ( ) ; text = text . replaceAll ( "[\\r\\n]+" , "" ) . trim ( ) ; if ( ( text . length ( ) ) > 0 ) { throw new MarkupException ( ( "There<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>any<seq2seq4repair_space>text<seq2seq4repair_space>between<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>tag<seq2seq4repair_space>and<seq2seq4repair_space>" + "it's<seq2seq4repair_space>related<seq2seq4repair_space>param<seq2seq4repair_space>tag.<seq2seq4repair_space>Only<seq2seq4repair_space>spaces<seq2seq4repair_space>and<seq2seq4repair_space>line<seq2seq4repair_space>breaks<seq2seq4repair_space>are<seq2seq4repair_space>allowed." ) ) ; } } lastTag . putAll ( tag . getAttributes ( ) ) ; if ( ( stripWicketTag ) == true ) { tag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ; } else { WicketParamTagHandler . log . debug ( "Be<seq2seq4repair_space>careful.<seq2seq4repair_space>Not<seq2seq4repair_space>stripping<seq2seq4repair_space><wicket:param><seq2seq4repair_space>may<seq2seq4repair_space>cause<seq2seq4repair_space>subtle<seq2seq4repair_space>errors." ) ; } return tag ; } }

Fix:
if ( ( tag . getId ( ) ) == null ) {
Buggy code:
class PathElement { private String m_location ; private String m_path ; public void setLocation ( final File location ) { } <START_BUG> public void setPath ( String path ) { <END_BUG> m_path = path ; } protected String [ ] getParts ( final File baseDirectory ) throws TaskException { } }

Fix:
public void setPath ( final String path ) {
Buggy code:
public final class EEModuleInitialProcessor implements DeploymentUnitProcessor { public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final String deploymentUnitName = deploymentUnit . getName ( ) ; final String moduleName ; <START_BUG> if ( ( ( ( deploymentUnitName . endsWith ( ".war" ) ) || ( deploymentUnitName . endsWith ( ".jar" ) ) ) || ( deploymentUnitName . endsWith ( ".ear" ) ) ) || ( deploymentUnitName . endsWith ( ".rar" ) ) ) { <END_BUG> moduleName = deploymentUnitName . substring ( 0 , ( ( deploymentUnitName . length ( ) ) - 4 ) ) ; } else { moduleName = deploymentUnitName ; } final String appName ; final String earApplicationName = deploymentUnit . getAttachment ( EAR_APPLICATION_NAME ) ; if ( earApplicationName != null ) { appName = earApplicationName ; } else { appName = null ; } deploymentUnit . putAttachment ( EE_MODULE_DESCRIPTION , new EEModuleDescription ( appName , moduleName , earApplicationName ) ) ; } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
if ( ( ( ( ( deploymentUnitName . endsWith ( ".war" ) ) || ( deploymentUnitName . endsWith ( ".wab" ) ) ) || ( deploymentUnitName . endsWith ( ".jar" ) ) ) || ( deploymentUnitName . endsWith ( ".ear" ) ) ) || ( deploymentUnitName . endsWith ( ".rar" ) ) ) {
Buggy code:
public class APIServer { public String executeRequest ( String command ) { <START_BUG> if ( command . substring ( 0 , 5 ) . equals ( "LOGIN" ) ) { <END_BUG> if ( checkLoginMessage ( command ) ) { return "SUCCESSUSER" ; } else { return "FAILURE" ; } } return "INVALID" ; } public boolean checkLoginMessage ( String msg ) { } public boolean checkLogin ( String username , String password ) { } }

Fix:
if ( command . startsWith ( "LOGIN" ) ) {
Buggy code:
public class ListActivity extends AppCompatActivity { private ListView studentsListView ; private List < Student > studentList = new ArrayList < > ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initView ( ) { } private void initFunction ( ) { Intent intent = getIntent ( ) ; <START_BUG> if ( ( intent != null ) && ( ( intent . getAction ( ) ) == ( VariableConstants . SEARCH_FILTER ) ) ) { <END_BUG> viewListWithFilter ( intent ) ; } else { } viewFullList ( ) ; } private void viewFullList ( ) { } private void viewListWithFilter ( Intent intent ) { } }

Fix:
if ( ( intent != null ) && ( intent . getAction ( ) . equalsIgnoreCase ( SEARCH_FILTER ) ) ) {
Buggy code:
public class InstantiatingServiceManagerTest extends AbstractComponentTest { private static final Resources REZ = ResourceManager . getPackageResources ( InstantiatingServiceManagerTest . class ) ; private InstantiatingServiceManager m_serviceManager ; private Parameters m_parameters = new Parameters ( ) ; public InstantiatingServiceManagerTest ( final String name ) { } protected void setUp ( ) throws Exception { } public void testCreateService ( ) throws Exception { } public void testLookup ( ) throws Exception { } public void testLifecycle ( ) throws Exception { } public void testUnknownService ( ) throws Exception { } private void registerFactory ( final String serviceRoleName , final Class serviceType , final Class factoryClass ) throws Exception { final RoleManager roleManager = ( ( RoleManager ) ( getServiceManager ( ) . lookup ( ROLE ) ) ) ; roleManager . addRole ( new RoleInfo ( serviceRoleName , null , serviceType ) ) ; final DefaultTypeFactory typeFactory = new DefaultTypeFactory ( getClass ( ) . getClassLoader ( ) ) ; typeFactory . addNameClassMapping ( serviceRoleName , factoryClass . getName ( ) ) ; final TypeManager typeManager = ( ( TypeManager ) ( getServiceManager ( ) . lookup ( TypeManager . ROLE ) ) ) ; <START_BUG> typeManager . registerType ( ServiceFactory . class , serviceRoleName , typeFactory ) ; <END_BUG> } }

Fix:
typeManager . registerType ( ServiceFactory . ROLE , serviceRoleName , typeFactory ) ;
Buggy code:
public class ByteArrayKeyAnalyzer extends AbstractKeyAnalyzer < byte [ ] > { private static final long serialVersionUID = 7382825097492285877L ; public static final ByteArrayKeyAnalyzer INSTANCE = new ByteArrayKeyAnalyzer ( Integer . MAX_VALUE ) ; public static final int LENGTH = Byte . SIZE ; private static final int MSB = 128 ; private static final byte [ ] NULL = new byte [ 0 ] ; private final int maxLengthInBits ; public ByteArrayKeyAnalyzer ( final int maxLengthInBits ) { } private static int mask ( final int bit ) { } public int getMaxLengthInBits ( ) { } public int bitsPerElement ( ) { } public int lengthInBits ( final byte [ ] key ) { } public boolean isBitSet ( final byte [ ] key , final int bitIndex , final int lengthInBits ) { } public int bitIndex ( final byte [ ] key , final int offsetInBits , final int lengthInBits , byte [ ] other , final int otherOffsetInBits , final int otherLengthInBits ) { } public boolean isPrefix ( final byte [ ] prefix , final int offsetInBits , final int lengthInBits , final byte [ ] key ) { } @ Override public int compare ( final byte [ ] o1 , final byte [ ] o2 ) { if ( o1 == null ) { return o2 == null ? 0 : - 1 ; } else if ( o2 == null ) { <START_BUG> return o1 == null ? 0 : 1 ; <END_BUG> } if ( ( o1 . length ) != ( o2 . length ) ) { return ( o1 . length ) - ( o2 . length ) ; } for ( int i = 0 ; i < ( o1 . length ) ; i ++ ) { final int diff = ( ( o1 [ i ] ) & 255 ) - ( ( o2 [ i ] ) & 255 ) ; if ( diff != 0 ) { return diff ; } } return 0 ; } }

Fix:
return 1 ;
Buggy code:
public class TestEntityAsIdentityFields extends SingleEMFTestCase { public void setUp ( ) { <START_BUG> setUp ( Account . class , AccountGroup . class , Person . class ) ; <END_BUG> } public void testEntityAsIdentityField001 ( ) { } public void testEntityAsIdentityField002A ( ) { } public void testEntityAsIdentityField002B ( ) { } public void testEntityAsIdentityField002C ( ) { } public void testEntityAsIdentityField003A ( ) { } public void testEntityAsIdentityField004A ( ) { } private void createPopulation ( EntityManager em ) { } }

Fix:
setUp ( CLEAR_TABLES , Account . class , AccountGroup . class , Person . class ) ;
Buggy code:
public class TestSampleResult extends TestCase { public TestSampleResult ( String name ) { } public void testElapsed ( ) throws Exception { } public void testPause ( ) throws Exception { } private static final Formatter fmt = new RawFormatter ( ) ; private StringWriter wr = null ; private void divertLog ( ) { } public void testPause2 ( ) throws Exception { divertLog ( ) ; SampleResult res = new SampleResult ( ) ; res . sampleStart ( ) ; res . samplePause ( ) ; <START_BUG> assertTrue ( ( ( wr . toString ( ) . length ( ) ) == 0 ) ) ; <END_BUG> res . samplePause ( ) ; assertFalse ( ( ( wr . toString ( ) . length ( ) ) == 0 ) ) ; } public void testByteCount ( ) throws Exception { } private static long sampleClock ( ) { } public void testSubResults ( ) throws Exception { } public void testEncodingAndType ( ) throws Exception { } }

Fix:
assertEquals ( 0 , wr . toString ( ) . length ( ) ) ;
Buggy code:
final class YearView extends DatePane { private static final String CSS_CALENDAR_YEAR_VIEW = "calendar-year-view" ; private static final String CSS_CALENDAR_MONTH_BUTTON = "calendar-month-button" ; public YearView ( final CalendarView calendarView ) { } @ Override protected void buildContent ( ) { int numberOfMonths = ( calendarView . getCalendar ( ) . getMaximum ( Calendar . MONTH ) ) + 1 ; int numberOfColumns = 3 ; for ( int i = 0 ; i < numberOfMonths ; i ++ ) { final int j = i ; Button button = new Button ( ) ; button . getStyleClass ( ) . add ( YearView . CSS_CALENDAR_MONTH_BUTTON ) ; button . setMinHeight ( 58.0 ) ; button . setMaxWidth ( Double . MAX_VALUE ) ; button . setMaxHeight ( Double . MAX_VALUE ) ; GridPane . setVgrow ( button , Priority . ALWAYS ) ; GridPane . setHgrow ( button , Priority . ALWAYS ) ; button . setOnAction ( new EventHandler < ActionEvent > ( ) { @ Override public void handle ( ActionEvent actionEvent ) { if ( ( currentlyViewing . get ( ) ) == ( Calendar . YEAR ) ) { calendarView . getCalendar ( ) . set ( Calendar . MONTH , j ) ; currentlyViewing . set ( Calendar . YEAR ) ; selectedDate . set ( calendarView . getCalendar ( ) . getTime ( ) ) ; <START_BUG> calendarView . setOldSelectedDate ( selectedDate . get ( ) ) ; <END_BUG> } } } ) ; int rowIndex = i % numberOfColumns ; int colIndex = ( i - rowIndex ) // numberOfColumns ; add ( button , rowIndex , colIndex ) ; } } @ Override protected void updateContent ( ) { } }

Fix:
calendarView . setLastSelectedDate ( selectedDate . get ( ) ) ;
Buggy code:
public class StoryElementActivity extends ActionBarActivity { DatabaseHandler databaseHandler ; Button nextStoryElementButton ; Button previousStoryElementButton ; Button backToMapButton ; String nextStoryElementId ; String previousStoryElementId ; int positionInStory = - 1 ; int originPosition ; private final int BACK_TO_MAP = 55 ; private final int SWITCH_ELEMENT = 66 ; private ImageButton btnSpeak ; private final int REQ_CODE_SPEECH_INPUT = 100 ; private StoryElementSpeechInputHandler speechInputHandler ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void promptSpeechInput ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { super . onActivityResult ( requestCode , resultCode , data ) ; switch ( requestCode ) { case REQ_CODE_SPEECH_INPUT : { if ( ( resultCode == ( RESULT_OK ) ) && ( null != data ) ) { ArrayList < String > result = data . getStringArrayListExtra ( EXTRA_RESULTS ) ; speechInputHandler . handleSpeech ( result ) ; } break ; } <START_BUG> case BACK_TO_MAP : <END_BUG> setResult ( BACK_TO_MAP ) ; finish ( ) ; break ; } } public void goToPreviousStory ( ) { } public void goToNextStory ( ) { } public void goBackToMapStory ( ) { } public void render ( StoryElement storyElement ) { } }

Fix:
default :