nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MainActivity extends Activity { private static final String TAG = MainActivity . class . getName ( ) ; private RemoteSensorManager remoteSensorManager ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; remoteSensorManager = RemoteSensorManager . getInstance ( this ) ; Button startButton = ( ( Button ) ( findViewById ( start_button ) ) ) ; Button stopButton = ( ( Button ) ( findViewById ( stop_button ) ) ) ; Button deleteButton = ( ( Button ) ( findViewById ( delete_button ) ) ) ; <START_BUG> TextView startTimeText = ( ( TextView ) ( findViewById ( start_time_text ) ) ) ; <END_BUG> startButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent startIntent = new Intent ( MainActivity . this , DataWriterService . class ) ; startIntent . setAction ( START_FOREGROUND ) ; startService ( startIntent ) ; remoteSensorManager . startSensorService ( ) ; startTimeText . setText ( String . valueOf ( System . currentTimeMillis ( ) ) ) ; } } ) ; stopButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent stopIntent = new Intent ( MainActivity . this , DataWriterService . class ) ; stopIntent . setAction ( STOP_FOREGROUND ) ; startService ( stopIntent ) ; remoteSensorManager . stopSensorService ( ) ; } } ) ; deleteButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { new AlertDialog . Builder ( MainActivity . this ) . setMessage ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>the<seq2seq4repair_space>gestures<seq2seq4repair_space>data?" ) . setCancelable ( false ) . setPositiveButton ( "Yes,<seq2seq4repair_space>Delete<seq2seq4repair_space>Data" , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int id ) { if ( FileUtil . deleteData ( ) ) { Toast . makeText ( getApplicationContext ( ) , "Data<seq2seq4repair_space>successfully<seq2seq4repair_space>deleted." , LENGTH_LONG ) . show ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , "Error:<seq2seq4repair_space>Directory<seq2seq4repair_space>may<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>deleted!" , LENGTH_LONG ) . show ( ) ; } } } ) . setNegativeButton ( "No,<seq2seq4repair_space>I<seq2seq4repair_space>misclicked" , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int id ) { } } ) . show ( ) ; } } ) ; } }

Fix:
final TextView startTimeText = ( ( TextView ) ( findViewById ( start_time_text ) ) ) ;
Buggy code:
public class ColorCoherentVector { private int [ ] [ ] coherencePair ; private int bins ; public ColorCoherentVector ( ) { } public ColorCoherentVector ( int n ) { } int getBins ( ) { } int [ ] [ ] getCoherencePair ( ) { } public boolean loadImage ( String imageFilePath ) { } public static int compareCCV ( ColorCoherentVector p , ColorCoherentVector q ) { if ( ( p == null ) || ( q == null ) ) { return - 1 ; } if ( ( p . getBins ( ) ) != ( q . getBins ( ) ) ) { return - 1 ; } int bins = p . getBins ( ) ; int value = 0 ; for ( int i = 0 ; i != ( ( bins * bins ) * bins ) ; i ++ ) { <START_BUG> value = ( Math . abs ( ( ( p . getCoherencePair ( ) [ i ] [ 0 ] ) - ( q . getCoherencePair ( ) [ i ] [ 0 ] ) ) ) ) + ( Math . abs ( ( ( p . getCoherencePair ( ) [ i ] [ 1 ] ) - ( q . getCoherencePair ( ) [ i ] [ 1 ] ) ) ) ) ; <END_BUG> } return value ; } }

Fix:
value += ( Math . abs ( ( ( p . getCoherencePair ( ) [ i ] [ 0 ] ) - ( q . getCoherencePair ( ) [ i ] [ 0 ] ) ) ) ) + ( Math . abs ( ( ( p . getCoherencePair ( ) [ i ] [ 1 ] ) - ( q . getCoherencePair ( ) [ i ] [ 1 ] ) ) ) ) ;
Buggy code:
public class UnresolvedReferenceBinding extends ReferenceBinding { ReferenceBinding resolvedType ; TypeBinding [ ] wrappers ; UnresolvedReferenceBinding ( char [ ] [ ] compoundName , PackageBinding packageBinding ) { } void addWrapper ( TypeBinding wrapper , LookupEnvironment environment ) { } public String debugName ( ) { } ReferenceBinding resolve ( LookupEnvironment environment , boolean convertGenericToRawType ) { } void setResolvedType ( ReferenceBinding targetType , LookupEnvironment environment ) { } public String toString ( ) { <START_BUG> return "Unresolved<seq2seq4repair_space>type<seq2seq4repair_space>" + ( ( compoundName ) != null ? CharOperation . toString ( compoundName ) : "UNNAMED" ) ; <END_BUG> } }

Fix:
return "Unresolved<seq2seq4repair_space>type<seq2seq4repair_space>" + ( ( this . compoundName ) != null ? CharOperation . toString ( this . compoundName ) : "UNNAMED" ) ;
Buggy code:
public class Commandline { private Vector arguments = new Vector ( ) ; private String executable = null ; public Commandline ( String to_process ) { } public Commandline ( ) { } public class Argument { private String [ ] parts ; private Reference pathRef ; public void setValue ( String value ) { } public void setLine ( String line ) { } public void setPath ( Path value ) { } public void setFile ( File value ) { } public String [ ] getParts ( ) { } } public Commandline . Argument createArgument ( ) { } public void setExecutable ( String executable ) { } public String getExecutable ( ) { } public void addArguments ( String [ ] line ) { } public String [ ] getCommandline ( ) { } public String [ ] getArguments ( ) { } public String toString ( ) { } public static String toString ( String [ ] line ) { } public static String [ ] translateCommandline ( String to_process ) { if ( ( to_process == null ) || ( ( to_process . length ( ) ) == 0 ) ) { return new String [ 0 ] ; } final int normal = 0 ; final int inQuote = 1 ; final int inDoubleQuote = 2 ; int state = normal ; StringTokenizer tok = new StringTokenizer ( to_process , "\\\"\'<seq2seq4repair_space>" , true ) ; Vector v = new Vector ( ) ; StringBuffer current = new StringBuffer ( ) ; while ( tok . hasMoreTokens ( ) ) { String nextTok = tok . nextToken ( ) ; switch ( state ) { case inQuote : if ( "\'" . equals ( nextTok ) ) { state = normal ; } else { current . append ( nextTok ) ; } break ; case inDoubleQuote : if ( "\"" . equals ( nextTok ) ) { state = normal ; } else { current . append ( nextTok ) ; } break ; default : if ( "\'" . equals ( nextTok ) ) { state = inQuote ; } else if ( "\"" . equals ( nextTok ) ) { state = inDoubleQuote ; } else if ( "<seq2seq4repair_space>" . equals ( nextTok ) ) { if ( ( current . length ( ) ) != 0 ) { v . addElement ( current . toString ( ) ) ; current . setLength ( 0 ) ; } } else if ( "\\" . equals ( nextTok ) ) { if ( tok . hasMoreTokens ( ) ) { String escapedToken = tok . nextToken ( ) ; char escapedChar = escapedToken . charAt ( 0 ) ; <START_BUG> if ( ( ( ( escapedChar == '\\' ) || ( escapedChar == '\'' ) ) || ( escapedChar == '\"' ) ) || ( escapedChar == '<seq2seq4repair_space>' ) ) { <END_BUG> current . append ( escapedToken ) ; } else { current . append ( ( "\\" + escapedToken ) ) ; } } else { current . append ( "\\" ) ; } } else { current . append ( nextTok ) ; } break ; } } if ( ( current . length ( ) ) != 0 ) { v . addElement ( current . toString ( ) ) ; } if ( ( state == inQuote ) || ( state == inDoubleQuote ) ) { throw new BuildException ( ( "unbalanced<seq2seq4repair_space>quotes<seq2seq4repair_space>in<seq2seq4repair_space>" + to_process ) ) ; } String [ ] args = new String [ v . size ( ) ] ; v . copyInto ( args ) ; return args ; } public int size ( ) { } }

Fix:
if ( ( ( escapedChar == '\\' ) || ( escapedChar == '\'' ) ) || ( escapedChar == '\"' ) ) {
Buggy code:
public class Canvas extends Composite { Caret caret ; static final int UNDERLINE_IME_INPUT = 1 << 16 ; static final int UNDERLINE_IME_TARGET_CONVERTED = 2 << 16 ; static final int UNDERLINE_IME_CONVERTED = 3 << 16 ; Canvas ( ) { } public Canvas ( Composite parent , int style ) { } public void drawBackground ( GC gc , int x , int y , int width , int height ) { } public Caret getCaret ( ) { } int kEventControlDraw ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { int result = super . kEventControlSetFocusPart ( nextHandler , theEvent , userData ) ; if ( result == ( OS . noErr ) ) { if ( ! ( isDisposed ( ) ) ) { <START_BUG> Shell shell = parent . getShell ( ) ; <END_BUG> short [ ] part = new short [ 1 ] ; OS . GetEventParameter ( theEvent , kEventParamControlPart , typeControlPartCode , null , 2 , null , part ) ; if ( ( part [ 0 ] ) != ( OS . kControlFocusNoPart ) ) { if ( ( caret ) != null ) caret . setFocus ( ) ; OS . ActivateTSMDocument ( shell . imHandle ) ; } else { if ( ( caret ) != null ) caret . killFocus ( ) ; OS . DeactivateTSMDocument ( shell . imHandle ) ; } } } return result ; } int kEventTextInputOffsetToPos ( int nextHandler , int theEvent , int userData ) { } int kEventTextInputPosToOffset ( int nextHandler , int theEvent , int userData ) { } int kEventTextInputUpdateActiveInputArea ( int nextHandler , int theEvent , int userData ) { } void redrawWidget ( int control , boolean children ) { } void redrawWidget ( int control , int x , int y , int width , int height , boolean all ) { } void releaseChildren ( boolean destroy ) { } public void scroll ( int destX , int destY , int x , int y , int width , int height , boolean all ) { } public void setCaret ( Caret caret ) { } public void setFont ( Font font ) { } }

Fix:
Shell shell = getShell ( ) ;
Buggy code:
public class Route { static PolylineOptions polylineOptions = null ; static boolean routing_mode = false ; private static LatLng lastPoint = null ; private static double distance = 0.0 ; static void start_routing ( ) { } static void stop_routing ( ) { } static boolean is_started ( ) { } public static double add_point ( LatLng currentLocation ) { if ( ( Route . lastPoint ) != null ) { float [ ] results = new float [ 1 ] ; Location . distanceBetween ( Route . lastPoint . latitude , Route . lastPoint . longitude , currentLocation . latitude , currentLocation . longitude , results ) ; <START_BUG> Route . distance += results [ 0 ] ; <END_BUG> } Route . lastPoint = new LatLng ( currentLocation . latitude , currentLocation . longitude ) ; Route . polylineOptions . add ( currentLocation ) ; return Route . distance ; } }

Fix:
Route . distance += ( results [ 0 ] ) // 1000 ;
Buggy code:
public class CoarseSessionFactory < L > implements SessionFactory < CoarseSessionEntry < L > , L > { private final SessionContext context ; private final Cache < String , CoarseSessionCacheEntry < L > > sessionCache ; private final Cache < SessionAttributesCacheKey , MarshalledValue < Map < String , Object > , MarshallingContext > > attributesCache ; private final CacheInvoker invoker ; private final SessionAttributeMarshaller < Map < String , Object > , MarshalledValue < Map < String , Object > , MarshallingContext > > marshaller ; private final LocalContextFactory < L > localContextFactory ; public CoarseSessionFactory ( Cache < String , CoarseSessionCacheEntry < L > > sessionCache , Cache < SessionAttributesCacheKey , MarshalledValue < Map < String , Object > , MarshallingContext > > attributesCache , CacheInvoker invoker , SessionContext context , SessionAttributeMarshaller < Map < String , Object > , MarshalledValue < Map < String , Object > , MarshallingContext > > marshaller , LocalContextFactory < L > localContextFactory ) { } @ Override public Session < L > createSession ( String id , CoarseSessionEntry < L > entry ) { } @ Override public ImmutableSession createImmutableSession ( String id , CoarseSessionEntry < L > entry ) { } @ Override public CoarseSessionEntry < L > createValue ( String id ) { } @ Override public CoarseSessionEntry < L > findValue ( String id ) { <START_BUG> CoarseSessionCacheEntry < L > entry = this . invoker . invoke ( this . sessionCache , new FindOperation < String , CoarseSessionCacheEntry < L > > ( id ) ) ; <END_BUG> if ( entry == null ) return null ; MarshalledValue < Map < String , Object > , MarshallingContext > value = this . invoker . invoke ( this . attributesCache , new FindOperation < SessionAttributesCacheKey , MarshalledValue < Map < String , Object > , MarshallingContext > > ( new SessionAttributesCacheKey ( id ) ) , SKIP_LOCKING ) ; return new CoarseSessionEntry ( entry , value ) ; } @ Override public void remove ( String id ) { } @ Override public void evict ( String id ) { } }

Fix:
CoarseSessionCacheEntry < L > entry = this . invoker . invoke ( this . sessionCache , new LockingFindOperation < String , CoarseSessionCacheEntry < L > > ( id ) ) ;
Buggy code:
public class RemotingLoginModule extends AbstractServerLoginModule { private static final SecurityLogger log = SecurityLogger . ROOT_LOGGER ; private Principal identity ; @ SuppressWarnings ( "unchecked" ) @ Override public boolean login ( ) throws LoginException { if ( ( super . login ( ) ) == true ) { RemotingLoginModule . log . debug ( "super.login()==true" ) ; return true ; } <START_BUG> Connection con = RemotingContext . getConnection ( ) ; <END_BUG> if ( con != null ) { UserPrincipal up = null ; for ( Principal current : con . getPrincipals ( ) ) { if ( current instanceof UserPrincipal ) { up = ( ( UserPrincipal ) ( current ) ) ; break ; } } if ( up != null ) { identity = up ; if ( getUseFirstPass ( ) ) { String userName = identity . getName ( ) ; if ( RemotingLoginModule . log . isDebugEnabled ( ) ) RemotingLoginModule . log . debug ( ( ( "Storing<seq2seq4repair_space>username<seq2seq4repair_space>'" + userName ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>empty<seq2seq4repair_space>password" ) ) ; sharedState . put ( "javax.security.auth.login.name" , identity ) ; sharedState . put ( "javax.security.auth.login.password" , "" ) ; } loginOk = true ; return true ; } else { throw MESSAGES . remotingConnectionWithNoUserPrincipal ( ) ; } } return false ; } @ Override protected Principal getIdentity ( ) { } @ Override protected Group [ ] getRoleSets ( ) throws LoginException { } }

Fix:
Connection con = SecurityActions . remotingContextGetConnection ( ) ;
Buggy code:
public class ConferenceFixture { public static final String JITSI_MEET_URL_PROP = "jitsi-meet.instance.url" ; public static String currentRoomName ; private static WebDriver focus ; private static WebDriver secondParticipant ; public static WebDriver getFocus ( ) { } public static WebDriver getSecondParticipant ( ) { } public static WebDriver getSecondParticipantInstance ( ) { } public static void startFocus ( ) { } public static void openRoom ( WebDriver participant ) { participant . get ( ( ( ( System . getProperty ( ConferenceFixture . JITSI_MEET_URL_PROP ) ) + "//" ) + ( ConferenceFixture . currentRoomName ) ) ) ; ( ( JavascriptExecutor ) ( participant ) ) . executeScript ( "try<seq2seq4repair_space>{<seq2seq4repair_space>jQuery.fx.off<seq2seq4repair_space>=<seq2seq4repair_space>true;<seq2seq4repair_space>}<seq2seq4repair_space>catch(e)<seq2seq4repair_space>{}" ) ; <START_BUG> ( ( JavascriptExecutor ) ( participant ) ) . executeScript ( "ToolbarToggler.dockToolbar(true);" ) ; <END_BUG> } private static WebDriver startChromeInstance ( ) { } public static void startParticipant ( ) { } public static void checkParticipantToJoinRoom ( WebDriver participant , long timeout ) { } public static void waitsParticipantToJoinConference ( WebDriver participant ) { } public static void quit ( WebDriver participant ) { } }

Fix:
( ( JavascriptExecutor ) ( participant ) ) . executeScript ( "UI.dockToolbar(true);" ) ;
Buggy code:
public class PatchResource extends AbstractModelResource { private final ModelNode model = new ModelNode ( ) ; protected PatchResource ( ServiceController < InstallationManager > imController ) { } @ Override public ModelNode getModel ( ) { } @ Override public void writeModel ( ModelNode newModel ) { } @ Override public boolean isModelDefined ( ) { } @ SuppressWarnings ( { "CloneDoesntCallSuperClone" } ) @ Override public Resource clone ( ) { } class LayerResourceProvider extends PatchResource . ElementProviderResourceProvider { LayerResourceProvider ( ServiceController < InstallationManager > imController ) { } @ Override protected Collection < ? extends PatchableTarget > getChildTargets ( InstalledIdentity identity ) { } } class AddOnResourceProvider extends PatchResource . ElementProviderResourceProvider { AddOnResourceProvider ( ServiceController < InstallationManager > imController ) { } @ Override protected Collection < ? extends PatchableTarget > getChildTargets ( InstalledIdentity identity ) { } } abstract class ElementProviderResourceProvider implements ResourceProvider { protected final ServiceController < InstallationManager > imController ; ElementProviderResourceProvider ( ServiceController < InstallationManager > imController ) { } protected abstract Collection < ? extends PatchableTarget > getChildTargets ( InstalledIdentity identity ) { } @ Override public boolean has ( String name ) { } @ Override public Resource get ( String name ) { } @ Override public boolean hasChildren ( ) { } @ Override public Set < String > children ( ) { final InstallationManager manager = imController . getValue ( ) ; <START_BUG> final Collection < ? extends PatchableTarget > targets = getChildTargets ( manager . getInstalledIdentity ( ) ) ; <END_BUG> if ( targets . isEmpty ( ) ) { return Collections . emptySet ( ) ; } if ( ( targets . size ( ) ) == 1 ) { final PatchableTarget target = targets . iterator ( ) . next ( ) ; return Collections . singleton ( target . getName ( ) ) ; } final Set < String > names = new HashSet < String > ( targets . size ( ) ) ; for ( PatchableTarget target : targets ) { names . add ( target . getName ( ) ) ; } return names ; } @ Override public void register ( String name , Resource resource ) { } @ Override public Resource remove ( String name ) { } } }

Fix:
final Collection < ? extends PatchableTarget > targets = getChildTargets ( manager ) ;
Buggy code:
public class DeleteJmsResourceHandler extends BatchModeCommandHandler { public DeleteJmsResourceHandler ( ) { } @ Override public ModelNode buildRequest ( CommandContext ctx ) throws OperationFormatException { try { <START_BUG> if ( ! ( ctx . getParsedArguments ( ) . hasArguments ( ) ) ) { <END_BUG> throw new OperationFormatException ( "Arguments<seq2seq4repair_space>are<seq2seq4repair_space>missing" ) ; } } catch ( CommandFormatException e ) { throw new OperationFormatException ( e . getLocalizedMessage ( ) ) ; } String jndiName = null ; String [ ] args = ctx . getArgumentsString ( ) . split ( "\\s+" ) ; int i = 0 ; while ( i < ( args . length ) ) { String arg = args [ ( i ++ ) ] ; if ( arg . equals ( "--target" ) ) { } else { jndiName = arg ; } } if ( jndiName == null ) { throw new OperationFormatException ( "name<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } ModelControllerClient client = ctx . getModelControllerClient ( ) ; final String resource ; if ( Util . isTopic ( client , jndiName ) ) { resource = "jms-topic" ; } else if ( Util . isQueue ( client , jndiName ) ) { resource = "jms-queue" ; } else if ( Util . isConnectionFactory ( client , jndiName ) ) { resource = "connection-factory" ; } else { throw new OperationFormatException ( ( ( "'" + jndiName ) + "'<seq2seq4repair_space>wasn't<seq2seq4repair_space>found<seq2seq4repair_space>among<seq2seq4repair_space>existing<seq2seq4repair_space>JMS<seq2seq4repair_space>resources." ) ) ; } DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; builder . addNode ( "subsystem" , "messaging" ) ; builder . addNode ( resource , jndiName ) ; builder . setOperationName ( "remove" ) ; return builder . buildRequest ( ) ; } }

Fix:
if ( ! ( ctx . getParsedArguments ( ) . hasProperties ( ) ) ) {
Buggy code:
public class Judge { public void startJanken ( Player player1 , Player player2 ) { System . out . println ( "【ジャンケン開始】\n" ) ; for ( int cnt = 0 ; cnt < 3 ; cnt ++ ) { System . out . println ( ( ( "【" + ( cnt + 1 ) ) + "回戦目" ) ) ; Player winner = judgeJanken ( player1 , player2 ) ; if ( winner != null ) { System . out . println ( ( ( "\n" + ( winner . getName ( ) ) ) + "が勝ちました１\n" ) ) ; winner . notifyResult ( true ) ; } else { System . out . println ( "\n引き分けです\n" ) ; } } System . out . println ( "【ジャンケン終了】\n" ) ; Player finalWinner = judgeFinalWinner ( player1 , player2 ) ; System . out . println ( ( ( ( ( player1 . getWinCount ( ) ) + "<seq2seq4repair_space>対<seq2seq4repair_space>" ) + ( player2 . getWinCount ( ) ) ) + "で" ) ) ; if ( finalWinner != null ) { System . out . println ( ( ( finalWinner . getName ( ) ) + "の勝ちです\n" ) ) ; } else { <START_BUG> System . out . println ( ( ( finalWinner . getName ( ) ) + "引き分けです\n" ) ) ; <END_BUG> } } private Player judgeJanken ( Player player1 , Player player2 ) { } private Player judgeFinalWinner ( Player player1 , Player player2 ) { } private void printHand ( int hand ) { } No newline ; at end ; of file ; }

Fix:
System . out . println ( "引き分けです\n" ) ;
Buggy code:
public abstract class AjaxLazyLoadPanel extends Panel { private static final String LAZY_LOAD_COMPONENT_ID = "content" ; private static final long serialVersionUID = 1L ; private byte state = 0 ; public AjaxLazyLoadPanel ( final String id ) { } public AjaxLazyLoadPanel ( final String id , final IModel < ? > model ) { } protected void handleCallbackScript ( final IHeaderResponse response , final String callbackScript ) { <START_BUG> response . renderOnDomReadyJavascript ( callbackScript ) ; <END_BUG> } @ Override protected void onBeforeRender ( ) { } private void setState ( byte state ) { } public abstract Component getLazyLoadComponent ( String markupId ) { } public Component getLoadingComponent ( final String markupId ) { } }

Fix:
response . renderOnDomReadyJavaScript ( callbackScript ) ;
Buggy code:
public abstract class AbstractLocalFolder extends AbstractMessageFolder { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.folder" ) ; protected int nextMessageUid ; protected ColumbaMessage aktMessage ; protected IDataStorage dataStorage ; protected PersistantHeaderList headerList ; public AbstractLocalFolder ( FolderItem item , String path ) { } public AbstractLocalFolder ( String name , String type , String path ) { } public void removeFolder ( ) throws Exception { } protected Object generateNextMessageUid ( ) { } public void setNextMessageUid ( int next ) { } public abstract IDataStorage getDataStorageInstance ( ) { } public MimeTree getMimePartTree ( Object uid ) throws Exception { } public InputStream getMessageSourceStream ( Object uid ) throws Exception { } public InputStream getMimePartBodyStream ( Object uid , Integer [ ] address ) throws Exception { } public InputStream getMimePartSourceStream ( Object uid , Integer [ ] address ) throws Exception { } public void innerCopy ( IMailbox destFolder , Object [ ] uids ) throws Exception { } public Object addMessage ( InputStream in ) throws Exception { } public Object addMessage ( InputStream in , Attributes attributes , Flags flags ) throws Exception { Object newUid = generateNextMessageUid ( ) ; getDataStorageInstance ( ) . saveMessage ( newUid , in ) ; in . close ( ) ; Source source = getDataStorageInstance ( ) . getMessageSource ( newUid ) ; int messageSize = source . length ( ) ; Header header = HeaderParser . parse ( source ) ; ColumbaHeader h ; if ( ( attributes != null ) && ( flags != null ) ) { h = new ColumbaHeader ( header , ( ( Attributes ) ( attributes . clone ( ) ) ) , new Flags ( flags . getFlags ( ) ) ) ; } else { h = new ColumbaHeader ( header ) ; h . set ( "columba.size" , new Integer ( ( messageSize // 1024 ) ) ) ; } source . close ( ) ; h . set ( "columba.uid" , newUid ) ; getHeaderList ( ) . add ( h , newUid ) ; <START_BUG> fireMessageAdded ( newUid ) ; <END_BUG> return newUid ; } public boolean isInboxFolder ( ) { } public boolean isTrashFolder ( ) { } public boolean supportsAddFolder ( String newFolderType ) { } public boolean supportsMove ( ) { } protected ColumbaMessage getMessage ( Object uid ) throws Exception { } protected IColumbaHeader getMessageHeader ( Object uid ) throws Exception { } public void removeMessage ( Object uid ) throws Exception { } protected void setFlags ( Object uid , Flags flags ) throws Exception { } public Header getHeaderFields ( Object uid , String [ ] keys ) throws Exception { } public void expungeFolder ( ) throws Exception { } public Header getAllHeaderFields ( Object uid ) throws Exception { } public IHeaderList getHeaderList ( ) throws Exception { } public void save ( ) throws Exception { } }

Fix:
fireMessageAdded ( newUid , getFlags ( newUid ) ) ;
Buggy code:
public class Client extends NetworkObject implements Runnable { private class KeepAliveThread extends Thread { private long max_timeout ; private PrintWriter outboundPlug ; public KeepAliveThread ( PrintWriter ir_outbound ) { } public void run ( ) { } } private String ip ; private int communicationPort ; private Socket communicationSocket ; private boolean powerSwitch = true ; private Client . KeepAliveThread keepAliveThread = null ; private String receivedCommand ; private int errorCount ; private ActionController actController ; private final int maxErrorCount = 2 ; public Client ( String iv_ip , int iv_port ) { } public String getIP ( ) { } public void addController ( ActionController actController ) { } public void switchOff ( ) { } private Socket initiateCommunicationSocket ( ) throws ConnectionIssueException { } private void listen ( ) throws ConnectionIssueException , ConnectionLostException { while ( ( this . powerSwitch ) == true ) { try { try { this . receivedCommand = this . readerIn . readLine ( ) ; this . errorCount = 0 ; } catch ( SocketException | SocketTimeoutException e ) { if ( ( this . errorCount ) < ( this . maxErrorCount ) ) { ( this . errorCount ) ++ ; } else { throw new ConnectionLostException ( ) ; } } switch ( this . receivedCommand ) { case Helper . resend : this . sendCommand ( sendBuffer ) ; break ; case Helper . ping : break ; case Helper . bye : this . writerOut . println ( "BYE" ) ; break ; default : <START_BUG> this . actController . handleEvent ( Helper . commandToEvent ( receivedCommand ) ) ; <END_BUG> } } catch ( IOException e ) { throw new ConnectionIssueException ( ) ; } } } public void finalize ( ) { } @ Override public void run ( ) { } No newline ; at end ; of file ; }

Fix:
this . actController . handleMessageEvent ( Helper . commandToEvent ( receivedCommand ) ) ;
Buggy code:
public class NutsUtils { private CSVParser parser ; private CSVRecord [ ] records ; private ShapefileDataStore dataStore ; private ContentFeatureSource featureSource ; public NutsUtils ( ) throws IOException , CQLException { } public String getNUTSCode ( double lon , double lat ) throws IOException , CQLException { } double [ ] getCoordinates ( String nutsCode ) throws IOException , CQLException { Filter filter = ECQL . toFilter ( ( ( "NUTS_ID<seq2seq4repair_space>=<seq2seq4repair_space>'" + nutsCode ) + "'" ) ) ; ContentFeatureCollection collection = featureSource . getFeatures ( filter ) ; SimpleFeatureIterator iterator = collection . features ( ) ; MultiPolygon mp = ( ( MultiPolygon ) ( iterator . next ( ) . getAttribute ( "the_geom" ) ) ) ; iterator . close ( ) ; if ( mp != null ) { Point p = mp . getCentroid ( ) ; <START_BUG> return new double [ ] { p . getX ( ) , p . getY ( ) } ; <END_BUG> } return null ; } public ArrayList < String > matchTweet ( String tweet ) { } public String getNUTSCode ( String word ) { } }

Fix:
return new double [ ] { p . getY ( ) , p . getX ( ) } ;
Buggy code:
public class TileEntityCarriageDirected extends TileEntityCarriageEngine { private Directions pointedDir = Directions . NegY ; public static SidedIcons helper ; @ Override public Directions getSignalDirection ( ) { } @ Override public void Setup ( EntityPlayer Player , ItemStack Item ) { super . Setup ( Player , Item ) ; int l = BlockPistonBase . determineOrientation ( Player . worldObj , xCoord , yCoord , zCoord , Player ) ; <START_BUG> pointedDir = Directions . values ( ) [ l ] ; <END_BUG> } @ Override public boolean onRightClicked ( int side , EntityPlayer player ) { } public void HandleNeighbourBlockChange ( ) { } public void WriteCommonRecord ( NBTTagCompound TagCompound ) { } public void ReadCommonRecord ( NBTTagCompound TagCompound ) { } public IIcon getIcon ( int side , int meta ) { } }

Fix:
pointedDir = Directions . values ( ) [ l ] . opposite ( ) ;
Buggy code:
public class AttrNSImpl extends AttrImpl { static final long serialVersionUID = - 781906615369795414L ; static final String xmlnsURI = "http:////www.w3.org//2000//xmlns//" ; static final String xmlURI = "http:////www.w3.org//XML//1998//namespace" ; protected String namespaceURI ; protected String localName ; public AttrNSImpl ( ) { } protected AttrNSImpl ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName ) { } private void setName ( String namespaceURI , String qname ) { } public AttrNSImpl ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName , String localName ) { } protected AttrNSImpl ( CoreDocumentImpl ownerDocument , String value ) { } void rename ( String namespaceURI , String qualifiedName ) { } public void setValues ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName , String localName ) { } public String getNamespaceURI ( ) { } public String getPrefix ( ) { } public void setPrefix ( String prefix ) throws DOMException { if ( needsSyncData ( ) ) { synchronizeData ( ) ; } if ( ownerDocument ( ) . errorChecking ) { if ( isReadOnly ( ) ) { String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "NO_MODIFICATION_ALLOWED_ERR" , null ) ; throw new DOMException ( DOMException . NO_MODIFICATION_ALLOWED_ERR , msg ) ; } if ( ( prefix != null ) && ( ( prefix . length ( ) ) != 0 ) ) { <START_BUG> if ( ! ( CoreDocumentImpl . isXMLName ( prefix ) ) ) { <END_BUG> String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "INVALID_CHARACTER_ERR" , null ) ; throw new DOMException ( DOMException . INVALID_CHARACTER_ERR , msg ) ; } if ( ( ( namespaceURI ) == null ) || ( ( prefix . indexOf ( ':' ) ) >= 0 ) ) { String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "NAMESPACE_ERR" , null ) ; throw new DOMException ( DOMException . NAMESPACE_ERR , msg ) ; } if ( prefix . equals ( "xmlns" ) ) { if ( ! ( namespaceURI . equals ( AttrNSImpl . xmlnsURI ) ) ) { String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "NAMESPACE_ERR" , null ) ; throw new DOMException ( DOMException . NAMESPACE_ERR , msg ) ; } } else if ( prefix . equals ( "xml" ) ) { if ( ! ( namespaceURI . equals ( AttrNSImpl . xmlURI ) ) ) { String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "NAMESPACE_ERR" , null ) ; throw new DOMException ( DOMException . NAMESPACE_ERR , msg ) ; } } else if ( name . equals ( "xmlns" ) ) { String msg = DOMMessageFormatter . formatMessage ( DOM_DOMAIN , "NAMESPACE_ERR" , null ) ; throw new DOMException ( DOMException . NAMESPACE_ERR , msg ) ; } } } if ( ( prefix != null ) && ( ( prefix . length ( ) ) != 0 ) ) { name = ( prefix + ":" ) + ( localName ) ; } else { name = localName ; } } public String getLocalName ( ) { } public String getTypeName ( ) { } public String getTypeNamespace ( ) { } }

Fix:
if ( ! ( CoreDocumentImpl . isXMLName ( prefix , ownerDocument ( ) . isXML11Version ( ) ) ) ) {
Buggy code:
public class ScreenDetailController implements Controller { private static final String TAG = ScreenDetailController . class . getSimpleName ( ) ; private static final String [ ] IMAGE_EXTENSIONS = new String [ ] { ".jpg" , ".png" , ".jpeg" } ; private static final String [ ] VIDEO_EXTENSIONS = new String [ ] { ".3gp" , ".mp4" , ".ts" , ".webm" , ".mkv" } ; public void deleteAllChildScreens ( final long screenId , Observer < Integer > observer ) { } public void loadScreen ( final long screenId , Observer < Screen > observer ) { } public void add ( final List < ScreenRelation > screenRelations , Observer < Object > observer ) { } public void loadParentScreens ( final long screenId , Observer < List < ScreenRelation > > observer ) { } public void loadChildrenScreens ( final long screenId , Observer < List < ScreenRelation > > observer ) { } public void addRelation ( final Screen parentScreen , final Screen childScreen , final String condition , Observer < ScreenRelation > observer ) { } public void addOrUpdateRelation ( final Screen parentScreen , final Screen childScreen , final String condition , Observer < ScreenRelation > observer ) { } public void removeRelation ( final Screen parentScreen , final Screen childScreen , Observer < Integer > observer ) { } public void saveScreen ( final Screen screen , final OnScreenDetailsSave event , final View screenContainer , Observer < Screen > observer ) { } public void uploadImage ( final Context context , final Uri uri , final String outputFolderLocation , Observer < File > observer ) { } private boolean isValidImage ( String filename ) { } @ SuppressLint ( "NewApi" ) public static String getPath ( Context context , Uri uri ) { } public static boolean isExternalStorageDocument ( Uri uri ) { } public static boolean isDownloadsDocument ( Uri uri ) { } public static boolean isMediaDocument ( Uri uri ) { } public static String getDataColumn ( Context context , Uri uri , String selection , String [ ] selectionArgs ) { String [ ] projection = new String [ ] { "_data" } ; Cursor cursor = null ; try { <START_BUG> cursor = context . getContentResolver ( ) . query ( uri , projection , null , null , null ) ; <END_BUG> int column_index = cursor . getColumnIndexOrThrow ( "_data" ) ; if ( cursor . moveToFirst ( ) ) { return cursor . getString ( column_index ) ; } } finally { ResourceUtils . close ( cursor ) ; } return null ; } public void uploadVideo ( final Context context , final Uri uri , final String outputFolderLocation , Observer < File > observer ) { } private boolean isValidVideo ( String filename ) { } private boolean isValidFile ( String filename , String [ ] supportedFileExtensions ) { } }

Fix:
cursor = context . getContentResolver ( ) . query ( uri , projection , selection , selectionArgs , null ) ;
Buggy code:
public class PPPatternItemRenderer implements IItemRenderer { private PPPatternItemModel ppPatternItemModel ; public PPPatternItemRenderer ( ) { } @ Override public boolean handleRenderType ( ItemStack item , ItemRenderType type ) { } @ Override public boolean shouldUseRenderHelper ( ItemRenderType type , ItemStack item , ItemRendererHelper helper ) { } @ Override public void renderItem ( ItemRenderType type , ItemStack item , Object ... data ) { switch ( type ) { case ENTITY : case EQUIPPED : case EQUIPPED_FIRST_PERSON : case INVENTORY : GL11 . glPushMatrix ( ) ; if ( item . hasTagCompound ( ) ) { <START_BUG> TextureDictionaryRenderer . bindTexture ( new net . minecraft . util . ResourceLocation ( ( ( ( Reference . TEXTURE_DICTIONARY_MAIN ) + ":" ) + ( item . stackTagCompound . getString ( "textureId" ) ) ) ) ) ; <END_BUG> } else { TextureDictionaryRenderer . bindTexture ( new net . minecraft . util . ResourceLocation ( ( ( Reference . TEXTURE_DICTIONARY_MAIN ) + ":sample" ) ) ) ; } GL11 . glRotatef ( 180.0F , 0.0F , 0.0F , 1.0F ) ; this . ppPatternItemModel . render ( null , 0.0F , 0.0F , ( - 0.1F ) , 0.0F , 0.0F , 0.0625F ) ; GL11 . glPopMatrix ( ) ; } } }

Fix:
TextureDictionaryRenderer . bindTexture ( new net . minecraft . util . ResourceLocation ( item . stackTagCompound . getString ( "resourceLocation" ) ) ) ;
Buggy code:
public class BusinessGoodAdapter extends BaseAdapter { private Context mContext ; private ArrayList < BusinessGoodListItemBean > mGoodList ; public BusinessGoodAdapter ( Context mContext , ArrayList < BusinessGoodListItemBean > mGoodList ) { } @ Override public int getCount ( ) { } @ Override public BusinessGoodListItemBean getItem ( int position ) { <START_BUG> return ( ( mGoodList ) == null ) || ( mGoodList . isEmpty ( ) ) ? null : mGoodList . get ( position ) ; <END_BUG> } @ Override public long getItemId ( int position ) { } @ SuppressLint ( "InflateParams" ) @ Override public View getView ( int position , View convertView , ViewGroup parent ) { } class BusinessGoodViewHolder { private ImageView imgGoodImg ; private TextView tvGoodName ; private TextView tvGoodPrice ; private View btnAddGood ; private View imgAddGoodBg ; public BusinessGoodViewHolder ( View v ) { } public void bindData ( final BusinessGoodListItemBean data ) { } } }

Fix:
return ( ( mGoodList ) == null ) || ( ( mGoodList . size ( ) ) <= position ) ? null : mGoodList . get ( position ) ;
Buggy code:
public abstract class AbstractMapper { protected static String getPlaceholder ( String s ) { } public AbstractMapper ( ) { } protected boolean urlStartsWith ( Url url , String ... segments ) { } protected PageParameters extractPageParameters ( Request request , int segmentsToSkip , IPageParametersEncoder encoder ) { Args . notNull ( request , "request" ) ; Args . notNull ( encoder , "encoder" ) ; Url urlCopy = new Url ( request . getUrl ( ) ) ; while ( ( segmentsToSkip > 0 ) && ( ( urlCopy . getSegments ( ) . isEmpty ( ) ) == false ) ) { urlCopy . getSegments ( ) . remove ( 0 ) ; -- segmentsToSkip ; } if ( ( ! ( urlCopy . getQueryParameters ( ) . isEmpty ( ) ) ) && ( Strings . isEmpty ( urlCopy . getQueryParameters ( ) . get ( 0 ) . getValue ( ) ) ) ) { removeMetaParameter ( urlCopy ) ; } <START_BUG> PageParameters decoded = encoder . decodePageParameters ( request . requestWithUrl ( urlCopy ) ) ; <END_BUG> return decoded ; } protected void removeMetaParameter ( final Url urlCopy ) { } protected Url encodePageParameters ( Url url , PageParameters pageParameters , IPageParametersEncoder encoder ) { } protected String [ ] getMountSegments ( String mountPath ) { } }

Fix:
PageParameters decoded = encoder . decodePageParameters ( request . cloneWithUrl ( urlCopy ) ) ;
Buggy code:
public class TestRussianAnalyzer extends BaseTokenStreamTestCase { public void testDigitsInRussianCharset ( ) throws IOException { } public void testReusableTokenStream ( ) throws Exception { } public void testWithStemExclusionSet ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new RussianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new RussianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "view" ) public class ContestManagementBaseController { @ RequestMapping ( params = "createContest=true" ) public String createContestController ( PortletRequest request , Model model , PortletResponse response ) { String view = "notFound" ; try { ThemeDisplay themeDisplay = ( ( ThemeDisplay ) ( request . getAttribute ( THEME_DISPLAY ) ) ) ; PermissionChecker portletPermissionChecker = themeDisplay . getPermissionChecker ( ) ; User currentUser = themeDisplay . getUser ( ) ; if ( ( ! ( currentUser . isDefaultUser ( ) ) ) && ( portletPermissionChecker . isOmniadmin ( ) ) ) { Contest contest = ContestLocalServiceUtil . createNewContest ( 10144L , "created<seq2seq4repair_space>contest" ) ; contest . setContestActive ( false ) ; contest . persist ( ) ; <START_BUG> contest . setPlanTemplateId ( 201L ) ; <END_BUG> String newContestLink = ( "//web//guest//cms//-//contestmanagement//contestId//" + ( contest . getContestPK ( ) ) ) + "//tab//DESCRIPTION" ; model . addAttribute ( "newContestLink" , newContestLink ) ; view = "newContestCreated" ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } return view ; } }

Fix:
contest . setPlanTemplateId ( 102L ) ;
Buggy code:
public final class ThreadFactoryService implements Service < ThreadFactory > { private String threadGroupName ; private Integer priority ; private String namePattern ; private ThreadFactory value ; public synchronized String getThreadGroupName ( ) { } public synchronized void setThreadGroupName ( final String threadGroupName ) { } public synchronized Integer getPriority ( ) { } public synchronized void setPriority ( final Integer priority ) { } public synchronized String getNamePattern ( ) { } public synchronized void setNamePattern ( final String namePattern ) { } public synchronized void start ( final StartContext context ) throws StartException { } public synchronized void stop ( final StopContext context ) { } public synchronized ThreadFactory getValue ( ) throws IllegalStateException { final ThreadFactory value = this . value ; if ( value == null ) { <START_BUG> throw ROOT_LOGGER . threadFactoryUninitialized ( ) ; <END_BUG> } return value ; } }

Fix:
throw MESSAGES . threadFactoryUninitialized ( ) ;
Buggy code:
public class SelectionJavadoc extends Javadoc { Expression selectedNode ; public SelectionJavadoc ( int sourceStart , int sourceEnd ) { } public StringBuffer print ( int indent , StringBuffer output ) { super . print ( indent , output ) ; if ( ( this . selectedNode ) != null ) { String selectedString = null ; if ( ( this . selectedNode ) instanceof JavadocFieldReference ) { JavadocFieldReference fieldRef = ( ( JavadocFieldReference ) ( this . selectedNode ) ) ; if ( ( fieldRef . methodBinding ) != null ) { selectedString = "<SelectOnMethod:" ; } else { selectedString = "<SelectOnField:" ; } } else if ( ( this . selectedNode ) instanceof JavadocMessageSend ) { selectedString = "<SelectOnMethod:" ; } else if ( ( this . selectedNode ) instanceof JavadocAllocationExpression ) { selectedString = "<SelectOnConstructor:" ; } else if ( ( this . selectedNode ) instanceof JavadocSingleNameReference ) { selectedString = "<SelectOnLocalVariable:" ; } else if ( ( this . selectedNode ) instanceof JavadocSingleTypeReference ) { JavadocSingleTypeReference typeRef = ( ( JavadocSingleTypeReference ) ( this . selectedNode ) ) ; if ( ( typeRef . packageBinding ) == null ) { selectedString = "<SelectOnType:" ; } } else if ( ( this . selectedNode ) instanceof JavadocQualifiedTypeReference ) { JavadocQualifiedTypeReference typeRef = ( ( JavadocQualifiedTypeReference ) ( this . selectedNode ) ) ; if ( ( typeRef . packageBinding ) == null ) { selectedString = "<SelectOnType:" ; } } else { selectedString = "<SelectOnType:" ; } int pos = ( output . length ( ) ) - 3 ; <START_BUG> output . replace ( ( pos - 2 ) , pos , ( ( selectedString + ( selectedNode ) ) + '>' ) ) ; <END_BUG> } return output ; } private void internalResolve ( Scope scope ) { } public void resolve ( ClassScope scope ) { } public void resolve ( MethodScope scope ) { } }

Fix:
output . replace ( ( pos - 2 ) , pos , ( ( selectedString + ( this . selectedNode ) ) + '>' ) ) ;
Buggy code:
public class RAMDirectory extends Directory implements Serializable { private static final long serialVersionUID = 1L ; HashMap < String , RAMFile > fileMap = new HashMap < String , RAMFile > ( ) ; final AtomicLong sizeInBytes = new AtomicLong ( ) ; public RAMDirectory ( ) { } public RAMDirectory ( Directory dir ) throws IOException { } private RAMDirectory ( Directory dir , boolean closeDir ) throws IOException { } @ Override public final synchronized String [ ] listAll ( ) { } @ Override public final boolean fileExists ( String name ) { } @ Override public final long fileModified ( String name ) throws IOException { } @ Override public void touchFile ( String name ) throws IOException { } @ Override public final long fileLength ( String name ) throws IOException { } public final synchronized long sizeInBytes ( ) { } @ Override public synchronized void deleteFile ( String name ) throws IOException { } @ Override public IndexOutput createOutput ( String name ) throws IOException { ensureOpen ( ) ; RAMFile file = new RAMFile ( this ) ; synchronized ( this ) { RAMFile existing = fileMap . get ( name ) ; if ( existing != null ) { <START_BUG> sizeInBytes . addAndGet ( existing . sizeInBytes ) ; <END_BUG> existing . directory = null ; } fileMap . put ( name , file ) ; } return new RAMOutputStream ( file ) ; } @ Override public IndexInput openInput ( String name ) throws IOException { } @ Override public void close ( ) { } }

Fix:
sizeInBytes . addAndGet ( ( - ( existing . sizeInBytes ) ) ) ;
Buggy code:
public final class ALC11 { public static final int ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 4114 ; public static final int ALC_ALL_DEVICES_SPECIFIER = 4115 ; public static final int ALC_CAPTURE_DEVICE_SPECIFIER = 784 ; public static final int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 785 ; public static final int ALC_CAPTURE_SAMPLES = 786 ; public static final int ALC_MONO_SOURCES = 4112 ; public static final int ALC_STEREO_SOURCES = 4113 ; public static ALCdevice alcCaptureOpenDevice ( String devicename , int frequency , int format , int buffersize ) { ByteBuffer buffer = MemoryUtil . encodeASCII ( devicename ) ; <START_BUG> long device_address = ALC11 . nalcCaptureOpenDevice ( MemoryUtil . getAddress ( buffer ) , frequency , format , buffersize ) ; <END_BUG> if ( device_address != 0 ) { ALCdevice device = new ALCdevice ( device_address ) ; synchronized ( ALC10 . devices ) { devices . put ( device_address , device ) ; } return device ; } return null ; } private static native long nalcCaptureOpenDevice ( long devicename , int frequency , int format , int buffersize ) { } public static boolean alcCaptureCloseDevice ( ALCdevice device ) { } static native boolean nalcCaptureCloseDevice ( long device ) { } public static void alcCaptureStart ( ALCdevice device ) { } static native void nalcCaptureStart ( long device ) { } public static void alcCaptureStop ( ALCdevice device ) { } static native void nalcCaptureStop ( long device ) { } public static void alcCaptureSamples ( ALCdevice device , ByteBuffer buffer , int samples ) { } static native void nalcCaptureSamples ( long device , long buffer , int samples ) { } static native void initNativeStubs ( ) throws LWJGLException { } static boolean initialize ( ) { } }

Fix:
long device_address = ALC11 . nalcCaptureOpenDevice ( ( buffer == null ? 0 : MemoryUtil . getAddress ( buffer ) ) , frequency , format , buffersize ) ;
Buggy code:
public class ImgUtils { public static ImagePlus zProject ( ImagePlus img ) { } public static ImagePlus unitCmToMicron ( ImagePlus img ) { } public static ImagePlus cropImgWithRoi ( ImagePlus img , Roi roi ) { } public static Roi centerCroppedRoi ( Roi roi ) { } public static double [ ] getRescaleFactor ( Calibration cal1 , Calibration cal2 ) { } public static Roi rescaleRoi ( Roi oldRoi , double [ ] factors ) { } public static ImagePlus loadFullFluoImgs ( String fluoDir ) { ImagePlus fluoImg = null ; ImagePlus zprojectImg = null ; ImageStack fieldStack = null ; Calibration fluoImgCalib = null ; String [ ] listAcqNames = new File ( fluoDir ) . list ( ) ; String pattern = "(\\d+)(_)(\\w+)" ; for ( String acqName : listAcqNames ) { if ( Pattern . matches ( pattern , acqName ) ) { <START_BUG> fluoImg = IJ . openImage ( ( acqName + "//MMStack.ome.tif" ) ) ; <END_BUG> zprojectImg = ImgUtils . zProject ( fluoImg ) ; if ( fluoImgCalib == null ) { fluoImgCalib = fluoImg . getCalibration ( ) ; } if ( fieldStack == null ) { fieldStack = new ImageStack ( zprojectImg . getWidth ( ) , zprojectImg . getHeight ( ) ) ; } fieldStack . addSlice ( acqName . split ( "_" , ( - 1 ) ) [ 1 ] , zprojectImg . getStack ( ) . getProcessor ( 1 ) . convertToFloatProcessor ( ) ) ; } } ImagePlus fieldImg = new ImagePlus ( "merged" , fieldStack ) ; fieldImg . setCalibration ( fluoImgCalib ) ; return fieldImg ; } public static HashMap < Integer , HashMap < String , ImagePlus > > cropMergedImpWithRois ( ArrayList < Cell > cellArray , ImagePlus mergedImg , Boolean splitChannel ) { } }

Fix:
fluoImg = IJ . openImage ( ( ( ( fluoDir + "//" ) + acqName ) + "//MMStack.ome.tif" ) ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { <START_BUG> int problemNum = 29 ; <END_BUG> Clock timer = new Clock ( ) ; ProblemTerminal . solveOneToFiveHundred ( problemNum ) ; long delta = timer . delta ( ) ; long milliseconds = delta % 1000 ; long seconds = ( delta // 1000 ) % 60 ; long minutes = ( delta // 1000 ) // 60 ; System . out . printf ( "Time<seq2seq4repair_space>taken<seq2seq4repair_space>to<seq2seq4repair_space>solve<seq2seq4repair_space>problem<seq2seq4repair_space>%d<seq2seq4repair_space>was:<seq2seq4repair_space>%d<seq2seq4repair_space>minutes,<seq2seq4repair_space>%d<seq2seq4repair_space>seconds,<seq2seq4repair_space>and<seq2seq4repair_space>%d<seq2seq4repair_space>milliseconds.\n" , problemNum , minutes , seconds , milliseconds ) ; } }

Fix:
int problemNum = 30 ;