nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TypeValidatorTest extends WicketTestCase { public static class DateField extends TextField { private static final long serialVersionUID = 1L ; public DateField ( MarkupContainer parent , String id ) { } @ Override public String getInput ( ) { } } public static class Person { private Date birthdate = new Date ( ) ; public void setBirthdate ( Date date ) { } public Date getBirthdate ( ) { } } public TypeValidatorTest ( String name ) { } public void testDateField ( ) { RequestCycle cycle = application . createRequestCycle ( ) ; MockPage page = new MockPage ( ) ; <START_BUG> Form form = new Form ( page , "form" , new CompoundPropertyModel ( new TypeValidatorTest . Person ( ) ) ) ; <END_BUG> TypeValidatorTest . DateField dateField = new TypeValidatorTest . DateField ( form , "birthdate" ) ; form . onFormSubmitted ( ) ; } }

Fix:
Form form = new Form < TypeValidatorTest . Person > ( page , "form" , new wicket . model . CompoundPropertyModel < TypeValidatorTest . Person > ( new TypeValidatorTest . Person ( ) ) ) ;
Buggy code:
public class Shell { private static final Logger LOG = Logger . getLogger ( Shell . class ) ; private final HelpContent help ; private final IDriverResultHandler resultHandler ; private ConsoleReader console = null ; private File historyFile = null ; private BasicDriver crossdataDriver = null ; private SimpleDateFormat dateFormat = new SimpleDateFormat ( "dd//M//yyyy" ) ; private boolean useAsync = false ; private static final String DEFAULT_PROMPT = "xdsh:" ; private static final char DEFAULT_TEMP_PROMPT = '»' ; private String sessionId ; public Shell ( boolean useAsync ) { } public static void main ( String [ ] args ) { boolean async = true ; String initScript = null ; int index = 0 ; while ( index < ( args . length ) ) { if ( "--sync" . equals ( args [ index ] ) ) { async = false ; Shell . LOG . info ( "Using<seq2seq4repair_space>synchronous<seq2seq4repair_space>behaviour" ) ; } else if ( "--script" . equals ( args [ index ] ) ) { if ( ( index + 1 ) < ( args . length ) ) { Shell . LOG . info ( ( "Load<seq2seq4repair_space>script:<seq2seq4repair_space>" + ( args [ ( index + 1 ) ] ) ) ) ; initScript = args [ ( index + 1 ) ] ; index ++ ; } else { Shell . LOG . error ( "Invalid<seq2seq4repair_space>--script<seq2seq4repair_space>syntax,<seq2seq4repair_space>file<seq2seq4repair_space>path<seq2seq4repair_space>missing" ) ; } } index ++ ; } Shell sh = new Shell ( async ) ; <START_BUG> Character mask = ( ( args . length ) == 0 ) ? new Character ( ( ( char ) ( 0 ) ) ) : new Character ( args [ 0 ] . charAt ( 0 ) ) ; <END_BUG> String user = "" ; String pass = "" ; if ( sh . isAuthEnable ( ) ) { try { ConsoleReader reader = new ConsoleReader ( ) ; user = reader . readLine ( "user>" ) ; pass = reader . readLine ( "Enter<seq2seq4repair_space>password><seq2seq4repair_space>" , mask ) ; } catch ( IOException e ) { Shell . LOG . error ( e . getMessage ( ) ) ; } } if ( sh . connect ( user , pass ) ) { boolean enterLoop = true ; if ( initScript != null ) { enterLoop = sh . executeScript ( initScript ) ; } if ( enterLoop ) { sh . loop ( ) ; } } sh . closeConsole ( ) ; } private boolean isAuthEnable ( ) { } private void initialize ( ) { } public void println ( String msg ) { } protected void flush ( ) { } public void setPrompt ( String currentCatalog ) { } private HelpStatement parseHelp ( String inputText ) { } private void showHelp ( String inputText ) { } protected void removeResultsHandler ( String queryId ) { } protected void updatePrompt ( Result result ) { } public boolean connect ( String user , String pass ) { } public void closeConsole ( ) { } public void loop ( ) { } public boolean executeScript ( String scriptPath ) { } private String getWelcomeScreen ( ) { } }

Fix:
Character mask = ( ( args . length ) == 0 ) ? Character . valueOf ( ( ( char ) ( 0 ) ) ) : Character . valueOf ( args [ 0 ] . charAt ( 0 ) ) ;
Buggy code:
public class NiiDatePickerFragment extends DialogFragment implements DatePickerDialog . OnDateSetListener { public abstract interface OnNiiDateChosenListener { public abstract void onNiiDateChosen ( String date , Calendar cal ) { } } private DatePickerDialog pickerDlg ; private Calendar currentDate ; private static SimpleDateFormat mDateFormat ; private NiiDatePickerFragment . OnNiiDateChosenListener onNiiDateChosenListener ; static NiiDatePickerFragment newInstance ( NiiDatePickerFragment . OnNiiDateChosenListener listener ) { } public void setOnNiiDateChosenListener ( NiiDatePickerFragment . OnNiiDateChosenListener listener ) { } @ Override public Dialog onCreateDialog ( Bundle savedInstanceState ) { super . onCreateDialog ( savedInstanceState ) ; if ( ( currentDate ) == null ) { currentDate = Calendar . getInstance ( ) ; } if ( ( pickerDlg ) == null ) { pickerDlg = new DatePickerDialog ( getActivity ( ) , this , currentDate . get ( Calendar . YEAR ) , currentDate . get ( Calendar . MONTH ) , currentDate . get ( Calendar . DAY_OF_MONTH ) ) ; <START_BUG> pickerDlg . getDatePicker ( ) . setMaxDate ( currentDate . getTimeInMillis ( ) ) ; <END_BUG> } else { pickerDlg . getDatePicker ( ) . updateDate ( currentDate . get ( Calendar . YEAR ) , currentDate . get ( Calendar . MONTH ) , currentDate . get ( Calendar . DAY_OF_MONTH ) ) ; } return pickerDlg ; } @ Override public void onDateSet ( DatePicker view , int year , int month , int day ) { } public String getCurrentDate ( ) { } public void setCurrentDate ( Calendar date ) { } public Calendar getCurrentDateCalendar ( ) { } public void moveToNextDay ( ) { } public void moveToPreviousDay ( ) { } }

Fix:
pickerDlg . getDatePicker ( ) . setMaxDate ( Calendar . getInstance ( ) . getTimeInMillis ( ) ) ;
Buggy code:
public class DatacenterShardStategy extends AbstractReplicationStrategy { private static Map < String , List < Token > > dcMap = new HashMap < String , List < Token > > ( ) ; private static Map < String , Integer > dcReplicationFactor = new HashMap < String , Integer > ( ) ; private static Map < String , Integer > quorumRepFactor = new HashMap < String , Integer > ( ) ; private static int locQFactor = 0 ; ArrayList < Token > tokens ; private List < InetAddress > localEndPoints = new ArrayList < InetAddress > ( ) ; private List < InetAddress > getLocalEndPoints ( ) { } private Map < String , Integer > getQuorumRepFactor ( ) { } private synchronized void loadEndPoints ( TokenMetadata metadata ) throws IOException { <START_BUG> this . tokens = new ArrayList < Token > ( tokens ) ; <END_BUG> String localDC = ( ( DatacenterEndPointSnitch ) ( snitch_ ) ) . getLocation ( InetAddress . getLocalHost ( ) ) ; DatacenterShardStategy . dcMap = new HashMap < String , List < Token > > ( ) ; for ( Token token : this . tokens ) { InetAddress endPoint = metadata . getEndPoint ( token ) ; String dataCenter = ( ( DatacenterEndPointSnitch ) ( snitch_ ) ) . getLocation ( endPoint ) ; if ( dataCenter . equals ( localDC ) ) { localEndPoints . add ( endPoint ) ; } List < Token > lst = DatacenterShardStategy . dcMap . get ( dataCenter ) ; if ( lst == null ) { lst = new ArrayList < Token > ( ) ; } lst . add ( token ) ; DatacenterShardStategy . dcMap . put ( dataCenter , lst ) ; } for ( Map . Entry < String , List < Token > > entry : DatacenterShardStategy . dcMap . entrySet ( ) ) { List < Token > valueList = entry . getValue ( ) ; Collections . sort ( valueList ) ; DatacenterShardStategy . dcMap . put ( entry . getKey ( ) , valueList ) ; } DatacenterShardStategy . dcReplicationFactor = ( ( DatacenterEndPointSnitch ) ( snitch_ ) ) . getMapReplicationFactor ( ) ; for ( Map . Entry < String , Integer > entry : DatacenterShardStategy . dcReplicationFactor . entrySet ( ) ) { String datacenter = entry . getKey ( ) ; int qFactor = ( ( entry . getValue ( ) ) // 2 ) + 1 ; DatacenterShardStategy . quorumRepFactor . put ( datacenter , qFactor ) ; if ( datacenter . equals ( localDC ) ) { DatacenterShardStategy . locQFactor = qFactor ; } } } public DatacenterShardStategy ( TokenMetadata tokenMetadata , IEndPointSnitch snitch ) throws UnknownHostException { } public ArrayList < InetAddress > getNaturalEndpoints ( Token token , TokenMetadata metadata , String table ) { } private ArrayList < InetAddress > getNaturalEndpointsInternal ( Token searchToken , TokenMetadata metadata ) throws IOException { } @ Override public WriteResponseHandler getWriteResponseHandler ( int blockFor , ConsistencyLevel consistency_level , String table ) { } }

Fix:
this . tokens = new ArrayList < Token > ( metadata . sortedTokens ( ) ) ;
Buggy code:
final class WifiReceiver extends BroadcastReceiver { private static final String TAG = WifiReceiver . class . getSimpleName ( ) ; private final WifiManager mWifiManager ; private final WifiActivity parent ; private final TextView statusView ; WifiReceiver ( WifiManager wifiManager , WifiActivity wifiActivity , TextView statusView , String ssid ) { } @ Override public void onReceive ( Context context , Intent intent ) { if ( intent . getAction ( ) . equals ( SUPPLICANT_STATE_CHANGED_ACTION ) ) { handleChange ( ( ( SupplicantState ) ( intent . getParcelableExtra ( EXTRA_NEW_STATE ) ) ) , intent . hasExtra ( EXTRA_SUPPLICANT_ERROR ) ) ; } else if ( intent . getAction ( ) . equals ( NETWORK_STATE_CHANGED_ACTION ) ) { handleNetworkStateChanged ( ( ( NetworkInfo ) ( intent . getParcelableExtra ( EXTRA_NETWORK_INFO ) ) ) ) ; } else if ( intent . getAction ( ) . equals ( CONNECTIVITY_ACTION ) ) { ConnectivityManager con = ( ( ConnectivityManager ) ( parent . getSystemService ( CONNECTIVITY_SERVICE ) ) ) ; NetworkInfo [ ] s = con . getAllNetworkInfo ( ) ; for ( NetworkInfo i : s ) { if ( i . getTypeName ( ) . contentEquals ( "WIFI" ) ) { NetworkInfo . State state = i . getState ( ) ; String ssid = mWifiManager . getConnectionInfo ( ) . getSSID ( ) ; if ( ( state == ( State . CONNECTED ) ) && ( ssid != null ) ) { mWifiManager . saveConfiguration ( ) ; String label = parent . getString ( wifi_connected ) ; statusView . setText ( ( ( label + '\n' ) + ssid ) ) ; Runnable delayKill = new Killer ( parent ) ; delayKill . run ( ) ; } if ( state == ( State . DISCONNECTED ) ) { Log . d ( WifiReceiver . TAG , ( ( ( "Got<seq2seq4repair_space>state:<seq2seq4repair_space>" + state ) + "<seq2seq4repair_space>for<seq2seq4repair_space>ssid:<seq2seq4repair_space>" ) + ssid ) ) ; <START_BUG> ( ( WifiActivity ) ( parent ) ) . gotError ( ) ; <END_BUG> } } } } } private void handleNetworkStateChanged ( NetworkInfo networkInfo ) { } private void handleChange ( SupplicantState state , boolean hasError ) { } }

Fix:
parent . gotError ( ) ;
Buggy code:
public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { private String comment = null ; private String platform = null ; private String resolver = null ; private String release = null ; private String subSystem = null ; private String task = null ; public CCMCreateTask ( ) { } public void execute ( ) throws BuildException { Commandline commandLine = new Commandline ( ) ; Project aProj = getProject ( ) ; int result = 0 ; commandLine . setExecutable ( getCcmCommand ( ) ) ; commandLine . createArgument ( ) . setValue ( getCcmAction ( ) ) ; checkOptions ( commandLine ) ; result = run ( commandLine , this ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine . toString ( ) ) ; throw new BuildException ( msg , location ) ; } Commandline commandLine2 = new Commandline ( ) ; commandLine2 . setExecutable ( getCcmCommand ( ) ) ; commandLine2 . createArgument ( ) . setValue ( COMMAND_DEFAULT_TASK ) ; commandLine2 . createArgument ( ) . setValue ( getTask ( ) ) ; <START_BUG> log ( commandLine . toString ( ) , MSG_DEBUG ) ; <END_BUG> result = run ( commandLine2 ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine2 . toString ( ) ) ; throw new BuildException ( msg , location ) ; } } private void checkOptions ( Commandline cmd ) { } public String getComment ( ) { } public void setComment ( String v ) { } public String getPlatform ( ) { } public void setPlatform ( String v ) { } public String getResolver ( ) { } public void setResolver ( String v ) { } public String getRelease ( ) { } public void setRelease ( String v ) { } public String getSubSystem ( ) { } public void setSubSystem ( String v ) { } public String getTask ( ) { } public void setTask ( String v ) { } public static final String FLAG_COMMENT = "//synopsis" ; public static final String FLAG_PLATFORM = "//plat" ; public static final String FLAG_RESOLVER = "//resolver" ; public static final String FLAG_RELEASE = "//release" ; public static final String FLAG_SUBSYSTEM = "//subsystem" ; public static final String FLAG_TASK = "//task" ; public void start ( ) throws IOException { } public void stop ( ) { } public void setProcessInputStream ( OutputStream param1 ) throws IOException { } public void setProcessErrorStream ( InputStream is ) throws IOException { } public void setProcessOutputStream ( InputStream is ) throws IOException { } }

Fix:
log ( commandLine . describeCommand ( ) , MSG_DEBUG ) ;
Buggy code:
public class NetCommand { private static final int DEFAULT_RESPONSE_THRESHOLD = 64 ; private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; protected Task owner ; protected Execute executable ; protected Commandline commandLine ; protected String title ; protected String program ; protected boolean traceCommandLine = false ; protected boolean failOnError ; private File directory ; private boolean useResponseFile = false ; private File temporaryCommandFile ; private int automaticResponseFileThreshold = NetCommand . DEFAULT_RESPONSE_THRESHOLD ; public NetCommand ( Task owner , String title , String program ) { } public void setTraceCommandLine ( boolean b ) { } public void setFailOnError ( boolean b ) { } public boolean getFailFailOnError ( ) { } public void setDirectory ( File directory ) { } protected void logVerbose ( String msg ) { } protected void logError ( String msg ) { } public void addArgument ( String argument ) { } public void addArguments ( String [ ] arguments ) { } public void addArgument ( String argument1 , String argument2 ) { } public boolean isUseResponseFile ( ) { } public void setUseResponseFile ( boolean useResponseFile ) { } public int getAutomaticResponseFileThreshold ( ) { } public void setAutomaticResponseFileThreshold ( int automaticResponseFileThreshold ) { } protected void prepareExecutor ( ) { } public void runCommand ( ) throws BuildException { } private void setExecutableCommandLine ( ) { String [ ] commands = commandLine . getCommandline ( ) ; if ( ( ( automaticResponseFileThreshold ) > 0 ) && ( ( commands . length ) > ( automaticResponseFileThreshold ) ) ) { useResponseFile = true ; } if ( ( ! ( useResponseFile ) ) || ( ( commands . length ) <= 1 ) ) { executable . setCommandline ( commands ) ; } else { FileOutputStream fos = null ; <START_BUG> temporaryCommandFile = NetCommand . FILE_UTILS . createTempFile ( "cmd" , ".txt" , null ) ; <END_BUG> owner . log ( ( "Using<seq2seq4repair_space>response<seq2seq4repair_space>file<seq2seq4repair_space>" + ( temporaryCommandFile ) ) , MSG_VERBOSE ) ; try { fos = new FileOutputStream ( temporaryCommandFile ) ; PrintWriter out = new PrintWriter ( new BufferedOutputStream ( fos ) ) ; for ( int i = 1 ; i < ( commands . length ) ; ++ i ) { out . println ( commands [ i ] ) ; } out . flush ( ) ; out . close ( ) ; } catch ( IOException ex ) { throw new BuildException ( ( "saving<seq2seq4repair_space>command<seq2seq4repair_space>stream<seq2seq4repair_space>to<seq2seq4repair_space>" + ( temporaryCommandFile ) ) , ex ) ; } String [ ] newCommandLine = new String [ 2 ] ; newCommandLine [ 0 ] = commands [ 0 ] ; newCommandLine [ 1 ] = "@" + ( temporaryCommandFile . getAbsolutePath ( ) ) ; logVerbose ( Commandline . describeCommand ( newCommandLine ) ) ; executable . setCommandline ( newCommandLine ) ; } } public int scanOneFileset ( DirectoryScanner scanner , Hashtable filesToBuild , long outputTimestamp ) { } }

Fix:
temporaryCommandFile = NetCommand . FILE_UTILS . createTempFile ( "cmd" , ".txt" , null , false , true ) ;
Buggy code:
public class ProblemResponse extends Response { public static final ProblemResponse NO_MORE_PROBLEMS = new ProblemResponse ( true , false , false ) ; public static final ProblemResponse NO_MORE_REVIEW_PROBLEMS = new ProblemResponse ( false , true , false ) ; public static final ProblemResponse NO_MORE_CHALLENGE_PROBLEMS = new ProblemResponse ( false , false , true ) ; protected Problem prob ; private String endPage = null ; private Intervention intervention = null ; private String params = null ; private boolean noMoreProblems = false ; private boolean noMoreReviewProblems = false ; private boolean noMoreChallengeProblems = false ; public ProblemResponse ( Problem p , List < TopicMastery > topicMasteryLevels , int curTopic ) { } public ProblemResponse ( Problem p ) { } public ProblemResponse ( boolean noMoreProblems , boolean noMoreReviewProblems , boolean noMoreChallengeProblems ) { } public ProblemResponse ( ) { } public Intervention getIntervention ( ) { } public void setIntervention ( Intervention intervention ) { } public String logEventName ( ) { } public JSONObject buildJSON ( ) { } public Problem getProblem ( ) { } private String chooseAnswerPosition ( Problem p , String oldAnswer ) { if ( ! ( ( ( ( ( oldAnswer . equals ( "a" ) ) || ( oldAnswer . equals ( "b" ) ) ) || ( oldAnswer . equals ( "c" ) ) ) || ( oldAnswer . equals ( "d" ) ) ) || ( oldAnswer . equals ( "e" ) ) ) ) { return "" ; } String newAns = "" ; Random randomGenerator = new Random ( ) ; int randomIndex = - 1 ; <START_BUG> if ( ( p . getForm ( ) . equals ( QUICK_AUTH ) ) && ( p . isMultiChoice ( ) ) ) { <END_BUG> randomIndex = randomGenerator . nextInt ( p . getAnswers ( ) . size ( ) ) ; } else { randomIndex = randomGenerator . nextInt ( 4 ) ; } switch ( randomIndex ) { case 0 : newAns = "a" ; break ; case 1 : newAns = "b" ; break ; case 2 : newAns = "c" ; break ; case 3 : newAns = "d" ; break ; } return newAns ; } public void shuffleAnswers ( StudentState state ) throws SQLException { } public void setEndPage ( String endPage ) { } public String getEndPage ( ) { } public void setParams ( String params ) { } public String getParams ( ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ( p . getForm ( ) ) != null ) && ( p . getForm ( ) . equals ( QUICK_AUTH ) ) ) && ( p . isMultiChoice ( ) ) ) {
Buggy code:
public abstract class WebSocketAppender extends AppenderBase < ILoggingEvent > { protected static List < WebSocketAppender > appenders = new ArrayList < > ( ) ; protected PatternLayoutEncoder encoder ; protected Session session ; public static List < WebSocketAppender > getAppenders ( ) { } public static void setAppenders ( List < WebSocketAppender > appenders ) { } public PatternLayoutEncoder getEncoder ( ) { } public void setEncoder ( PatternLayoutEncoder encoder ) { } public void sendMessage ( String message ) { try { this . session . getBasicRemote ( ) . sendText ( message ) ; } catch ( IOException e ) { <START_BUG> WebSocketAppender . appenders . add ( this ) ; <END_BUG> } } @ OnOpen public void onOpen ( Session session ) { } @ OnClose public void onClose ( ) { } @ OnError public void onError ( Throwable t ) { } @ Override protected void append ( ILoggingEvent eventObject ) { } }

Fix:
WebSocketAppender . appenders . remove ( this ) ;
Buggy code:
public class TokenUpdater { private static final int port_ = 7000 ; private static final long waitTime_ = 10000 ; public static void main ( String [ ] args ) throws Throwable { if ( ( args . length ) != 3 ) { System . out . println ( "Usage<seq2seq4repair_space>:<seq2seq4repair_space>java<seq2seq4repair_space>com.facebook.infrastructure.tools.TokenUpdater<seq2seq4repair_space><ip:port><seq2seq4repair_space><token><seq2seq4repair_space><file<seq2seq4repair_space>containing<seq2seq4repair_space>node<seq2seq4repair_space>token<seq2seq4repair_space>info>" ) ; System . exit ( 1 ) ; } String ipPort = args [ 0 ] ; IPartitioner p = StorageService . getPartitioner ( ) ; Token token = p . getTokenFactory ( ) . fromString ( args [ 1 ] ) ; String file = args [ 2 ] ; String [ ] ipPortPair = ipPort . split ( ":" ) ; EndPoint target = new EndPoint ( ipPortPair [ 0 ] , Integer . valueOf ( ipPortPair [ 1 ] ) ) ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; Token . serializer ( ) . serialize ( token , dos ) ; <START_BUG> Message tokenUpdateMessage = new Message ( new EndPoint ( FBUtilities . getHostAddress ( ) , TokenUpdater . port_ ) , "" , StorageService . tokenVerbHandler_ , new Object [ ] { bos . toByteArray ( ) } ) ; <END_BUG> BufferedReader bufReader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) ) ) ; String line = null ; while ( ( line = bufReader . readLine ( ) ) != null ) { String [ ] nodeTokenPair = line . split ( "<seq2seq4repair_space>" ) ; Token nodeToken = p . getTokenFactory ( ) . fromString ( nodeTokenPair [ 1 ] ) ; tokenUpdateMessage . addHeader ( nodeTokenPair [ 0 ] , p . getTokenFactory ( ) . toByteArray ( nodeToken ) ) ; } System . out . println ( ( "Sending<seq2seq4repair_space>a<seq2seq4repair_space>token<seq2seq4repair_space>update<seq2seq4repair_space>message<seq2seq4repair_space>to<seq2seq4repair_space>" + target ) ) ; MessagingService . getMessagingInstance ( ) . sendOneWay ( tokenUpdateMessage , target ) ; Thread . sleep ( TokenUpdater . waitTime_ ) ; System . out . println ( "Done<seq2seq4repair_space>sending<seq2seq4repair_space>the<seq2seq4repair_space>update<seq2seq4repair_space>message" ) ; } }

Fix:
Message tokenUpdateMessage = new Message ( new EndPoint ( FBUtilities . getHostAddress ( ) , TokenUpdater . port_ ) , "" , StorageService . tokenVerbHandler_ , bos . toByteArray ( ) ) ;
Buggy code:
public abstract class Pack extends AbstractTask { private File m_src ; private File m_zipFile ; public void setSrc ( final File src ) { } public void setZipfile ( final File zipFile ) { } public void execute ( ) throws TaskException { } private void pack ( ) throws TaskException { OutputStream output = null ; try { final FileOutputStream fileOutput = new FileOutputStream ( getZipFile ( ) ) ; output = getPackingStream ( fileOutput ) ; copy ( getSrc ( ) , output ) ; } catch ( final IOException ioe ) { <START_BUG> final String message = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( getName ( ) ) ) + ":" ) + ( ioe . getMessage ( ) ) ; <END_BUG> throw new TaskException ( message , ioe ) ; } finally { IOUtil . shutdownStream ( output ) ; } } protected abstract OutputStream getPackingStream ( OutputStream output ) throws IOException , TaskException { } protected final void copy ( final File file , final OutputStream output ) throws IOException { } private void validate ( ) throws TaskException { } protected final File getSrc ( ) { } protected final File getZipFile ( ) { } }

Fix:
final String message = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( getContext ( ) . getName ( ) ) ) + ":" ) + ( ioe . getMessage ( ) ) ;
Buggy code:
public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegression { private QRDecomposition qr = null ; private final double threshold ; public OLSMultipleLinearRegression ( ) { } public OLSMultipleLinearRegression ( final double threshold ) { } public void newSampleData ( double [ ] y , double [ ] [ ] x ) throws MathIllegalArgumentException { } @ Override public void newSampleData ( double [ ] data , int nobs , int nvars ) { } public RealMatrix calculateHat ( ) { } public double calculateTotalSumOfSquares ( ) throws MathIllegalArgumentException { } public double calculateResidualSumOfSquares ( ) { } public double calculateRSquared ( ) throws MathIllegalArgumentException { } public double calculateAdjustedRSquared ( ) throws MathIllegalArgumentException { } @ Override protected void newXSampleData ( double [ ] [ ] x ) { super . newXSampleData ( x ) ; <START_BUG> qr = new QRDecomposition ( getX ( ) ) ; <END_BUG> } @ Override protected RealVector calculateBeta ( ) { } @ Override protected RealMatrix calculateBetaVariance ( ) { } }

Fix:
qr = new QRDecomposition ( getX ( ) , threshold ) ;
Buggy code:
public class QueueManager extends SingleCategoryManager implements Constants , Constants . Data , Constants . Models , Constants . MusicService , Constants . SongConstants { @ Override protected int setType ( ) { } @ Override protected String setTitle ( ) { } @ Override public String modelToString ( ModelInterface model ) { } public void replaceQueue ( ArrayList < Song > songs ) { JSONArray array = new JSONArray ( ) ; for ( Song song : songs ) { <START_BUG> JSONObject songObject = createSongJSONObject ( song . getAttribute ( "song_id" ) ) ; <END_BUG> array . put ( songObject ) ; } try { this . models . get ( 0 ) . getJSONObject ( ) . put ( "songs" , array ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } storeData ( ) ; } @ Override public void removeSongFromCategory ( Song song ) { } public void clearQueue ( ) { } }

Fix:
JSONObject songObject = createSongJSONObject ( song . getId ( ) ) ;
Buggy code:
public class AbstractFolderTstCase extends TestCase { private AddressbookFolder sourceFolder ; private AddressbookFolder destFolder ; private Set folders ; private static int folderId = 0 ; public AbstractFolderTstCase ( String arg0 ) { } protected void setUp ( ) throws Exception { File file = new File ( "test_config" ) ; file . mkdir ( ) ; new Config ( file ) ; Logging . DEBUG = true ; Logging . createDefaultHandler ( ) ; ShutdownManager . getInstance ( ) ; new AddressbookMain ( ) ; <START_BUG> PluginManager . getInstance ( ) . initCorePlugins ( ) ; <END_BUG> folders = new HashSet ( ) ; sourceFolder = FolderTstFactory . createFolder ( ( ( AbstractFolderTstCase . folderId ) ++ ) ) ; folders . add ( sourceFolder ) ; destFolder = FolderTstFactory . createFolder ( ( ( AbstractFolderTstCase . folderId ) ++ ) ) ; folders . add ( destFolder ) ; } protected void tearDown ( ) throws Exception { } public AddressbookFolder getDestFolder ( ) { } public AddressbookFolder getSourceFolder ( ) { } }

Fix:
PluginManager . getInstance ( ) . initExternalPlugins ( ) ;
Buggy code:
public class FullImage extends Activity implements OnDownloadImageComplete { ArrayList < String > image = new ArrayList < String > ( ) ; public static ArrayList < Bitmap > imageList = null ; ProgressDialog progressDialog ; int curIndex = 0 ; int downX ; int upX ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onStart ( ) { } @ Override public void onImageDownload ( ArrayList < Bitmap > imgList ) { } public void showImage ( ArrayList < Bitmap > imgList ) { FullImage . imageList = imgList ; final ImageSwitcher imageSwitcher = ( ( ImageSwitcher ) ( findViewById ( imageSwitcher ) ) ) ; imageSwitcher . setFactory ( new ViewSwitcher . ViewFactory ( ) { @ Override public View makeView ( ) { ImageView imageView = new ImageView ( FullImage . this ) ; imageView . isFocusable ( ) ; return imageView ; } } ) ; imageSwitcher . setInAnimation ( this , fade_in ) ; imageSwitcher . setOutAnimation ( this , fade_out ) ; if ( ( FullImage . imageList ) != null ) { Drawable d = new android . graphics . drawable . BitmapDrawable ( FullImage . imageList . get ( curIndex ) ) ; imageSwitcher . setImageDrawable ( d ) ; imageSwitcher . setOnTouchListener ( new View . OnTouchListener ( ) { @ Override public boolean onTouch ( View v , MotionEvent event ) { switch ( event . getAction ( ) ) { case MotionEvent . ACTION_DOWN : { downX = ( ( int ) ( event . getX ( ) ) ) ; break ; } case MotionEvent . ACTION_UP : { upX = ( ( int ) ( event . getX ( ) ) ) ; if ( ( downX ) < ( upX ) ) { ( curIndex ) -- ; if ( ( curIndex ) < 0 ) { curIndex = ( FullImage . imageList . size ( ) ) - 1 ; } imageSwitcher . setInAnimation ( getBaseContext ( ) , fade_in ) ; imageSwitcher . setOutAnimation ( getBaseContext ( ) , fade_out ) ; Drawable d = new android . graphics . drawable . BitmapDrawable ( FullImage . imageList . get ( curIndex ) ) ; imageSwitcher . setImageDrawable ( d ) ; } else if ( ( downX ) > ( upX ) ) { ( curIndex ) ++ ; if ( ( curIndex ) == ( FullImage . imageList . size ( ) ) ) { curIndex = 0 ; } imageSwitcher . setInAnimation ( getBaseContext ( ) , fade_in ) ; imageSwitcher . setOutAnimation ( getBaseContext ( ) , fade_out ) ; Drawable d = new android . graphics . drawable . BitmapDrawable ( FullImage . imageList . get ( curIndex ) ) ; imageSwitcher . setImageDrawable ( d ) ; } break ; } } return true ; } } ) ; curIndex = ( ( curIndex ) + 1 ) % ( FullImage . imageList . size ( ) ) ; } else { Toast . makeText ( this , "No<seq2seq4repair_space>Internet<seq2seq4repair_space>Connection<seq2seq4repair_space>\n<seq2seq4repair_space>Check<seq2seq4repair_space>Your<seq2seq4repair_space>Internet<seq2seq4repair_space>Connection" , LENGTH_LONG ) . show ( ) ; <START_BUG> FullImage . imageList = null ; <END_BUG> } } }

Fix:
finish ( ) ;
Buggy code:
public class barChart extends JPanel { private double [ ] values ; private String [ ] name ; int topNCount ; int count ; int barCount ; private String title ; Color [ ] colors = new Color [ ] { Color . BLUE , Color . CYAN , Color . GREEN , Color . MAGENTA , Color . ORANGE , Color . RED , Color . YELLOW , Color . PINK , Color . GRAY , Color . DARK_GRAY , Color . LIGHT_GRAY } ; public barChart ( String [ ] lang , double [ ] val , String t , int topn , int cn ) { } public void paintComponent ( Graphics graphics ) { super . paintComponent ( graphics ) ; if ( ( ( values ) == null ) || ( ( values . length ) == 0 ) ) return ; if ( ( count ) < ( topNCount ) ) { barCount = count ; } else { barCount = topNCount ; } double minValue = 0 ; double maxValue = 0 ; for ( int i = 0 ; i < ( barCount ) ; i ++ ) { if ( minValue > ( values [ i ] ) ) minValue = values [ i ] ; if ( maxValue < ( values [ i ] ) ) maxValue = values [ i ] ; } Dimension dim = getSize ( ) ; int clientWidth = dim . width ; int clientHeight = dim . height ; int barWidth = clientWidth // ( barCount ) ; Font titleFont = new Font ( "Book<seq2seq4repair_space>Antiqua" , Font . BOLD , 15 ) ; FontMetrics titleFontMetrics = graphics . getFontMetrics ( titleFont ) ; Font labelFont = new Font ( "Book<seq2seq4repair_space>Antiqua" , Font . PLAIN , 10 ) ; FontMetrics labelFontMetrics = graphics . getFontMetrics ( labelFont ) ; int titleWidth = titleFontMetrics . stringWidth ( title ) ; int q = titleFontMetrics . getAscent ( ) ; int p = ( clientWidth - titleWidth ) // 2 ; graphics . setFont ( titleFont ) ; graphics . drawString ( title , p , q ) ; int top = titleFontMetrics . getHeight ( ) ; int bottom = labelFontMetrics . getHeight ( ) ; if ( maxValue == minValue ) return ; double scale = ( ( clientHeight - top ) - bottom ) // ( maxValue - minValue ) ; q = clientHeight - ( labelFontMetrics . getDescent ( ) ) ; graphics . setFont ( labelFont ) ; for ( int j = 0 ; j < ( barCount ) ; j ++ ) { int valueP = ( j * barWidth ) + 1 ; int valueQ = top ; int height = ( ( int ) ( ( values [ j ] ) * scale ) ) ; if ( ( values [ j ] ) >= 0 ) valueQ += ( ( int ) ( ( maxValue - ( values [ j ] ) ) * scale ) ) ; else { valueQ += ( ( int ) ( maxValue * scale ) ) ; height = - height ; } <START_BUG> graphics . setColor ( ( ( Color ) ( colors [ j ] ) ) ) ; <END_BUG> graphics . fillRect ( valueP , valueQ , ( barWidth - 2 ) , height ) ; graphics . setColor ( Color . black ) ; graphics . drawRect ( valueP , valueQ , ( barWidth - 2 ) , height ) ; int labelWidth = labelFontMetrics . stringWidth ( name [ j ] ) ; int valuesWidth = labelFontMetrics . stringWidth ( String . valueOf ( values [ j ] ) ) ; p = ( j * barWidth ) + ( ( barWidth - labelWidth ) // 2 ) ; int vp = ( j * barWidth ) + ( ( barWidth - valuesWidth ) // 2 ) ; graphics . drawString ( name [ j ] , p , q ) ; graphics . drawString ( String . valueOf ( values [ j ] ) , vp , valueQ ) ; } } }

Fix:
graphics . setColor ( ( ( Color ) ( colors [ ( j % 10 ) ] ) ) ) ;
Buggy code:
public class DeclarationOfReferencedTypesPattern extends TypeReferencePattern { HashSet knownTypes ; IJavaElement enclosingElement ; public DeclarationOfReferencedTypesPattern ( IJavaElement enclosingElement ) { } protected void matchReportImportRef ( ImportReference importRef , Binding binding , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } private void reportDeclaration ( TypeBinding typeBinding , int maxType , MatchLocator locator ) throws CoreException { IType type = locator . lookupType ( typeBinding ) ; if ( type == null ) return ; <START_BUG> IResource resource = type . getUnderlyingResource ( ) ; <END_BUG> boolean isBinary = type . isBinary ( ) ; IBinaryType info = null ; if ( isBinary ) { if ( resource == null ) { resource = type . getJavaProject ( ) . getProject ( ) ; } info = locator . getBinaryInfo ( ( ( ClassFile ) ( type . getClassFile ( ) ) ) , resource ) ; } while ( ( maxType >= 0 ) && ( type != null ) ) { if ( ! ( this . knownTypes . contains ( type ) ) ) { if ( isBinary ) { locator . reportBinaryMatch ( resource , type , info , IJavaSearchResultCollector . EXACT_MATCH ) ; } else { TypeDeclaration typeDecl = ( ( SourceTypeBinding ) ( typeBinding ) ) . scope . referenceContext ; locator . report ( resource , typeDecl . sourceStart , typeDecl . sourceEnd , type , IJavaSearchResultCollector . EXACT_MATCH ) ; } this . knownTypes . add ( type ) ; } if ( typeBinding instanceof BinaryTypeBinding ) { typeBinding = ( ( BinaryTypeBinding ) ( typeBinding ) ) . enclosingType ( ) ; } else { typeBinding = ( ( SourceTypeBinding ) ( typeBinding ) ) . enclosingType ( ) ; } IJavaElement parent = type . getParent ( ) ; if ( parent instanceof IType ) { type = ( ( IType ) ( parent ) ) ; } else { type = null ; } maxType -- ; } } }

Fix:
IResource resource = type . getResource ( ) ;
Buggy code:
reportService . close ( ) ; definitionList . sortBy ( new Comparator < ReportDefinition > ( ) { @ Override public int compare ( ReportDefinition o1 , ReportDefinition o2 ) { <START_BUG> return o1 . getName ( ) . compareTo ( o2 . getName ( ) ) ; <END_BUG>

Fix:
return o1 . getName ( ) . toLowerCase ( ) . compareTo ( o2 . getName ( ) . toLowerCase ( ) ) ;
Buggy code:
public class CopyMessageAction extends FrameAction implements SelectionListener { public CopyMessageAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { SelectFolderDialog dialog = treeModel . getSelectFolderDialog ( ) ; if ( dialog . success ( ) ) { Folder destFolder = dialog . getSelectedFolder ( ) ; FolderCommandReference [ ] result = new FolderCommandReference [ 2 ] ; <START_BUG> FolderCommandReference [ ] r1 = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> FolderCommandReference r2 = new FolderCommandReference ( destFolder ) ; result [ 0 ] = r1 [ 0 ] ; result [ 1 ] = r2 ; CopyMessageCommand c = new CopyMessageCommand ( result ) ; processor . addOp ( c ) ; } } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r1 = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
<START_BUG> public class ConfirmPasswordRule extends SameValueContexualRule < ConfirmPassword , Password , String > { <END_BUG> protected ConfirmPasswordRule ( final ValidationContext validationContext , final ConfirmPassword confirmPassword ) { } @ Override public boolean isValid ( final String confirmValue ) { return super . isValid ( confirmValue ) ; } }

Fix:
public class ConfirmPasswordRule extends SameValueContextualRule < ConfirmPassword , Password , String > {
Buggy code:
public class JournalEntryAdapter extends ArrayAdapter < JournalEntry > { Context context ; List < JournalEntry > entries ; public JournalEntryAdapter ( Context context , int resource , List < JournalEntry > entries ) { } @ Override public View getView ( int position , View convertView , ViewGroup container ) { LayoutInflater inflater = ( ( LayoutInflater ) ( context . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; View customView = inflater . inflate ( journal_entries_layout , container , false ) ; TextView dateTV = ( ( TextView ) ( customView . findViewById ( textViewDate ) ) ) ; ImageView picIV = ( ( ImageView ) ( customView . findViewById ( imageViewJournalPic ) ) ) ; TextView blurbTV = ( ( TextView ) ( customView . findViewById ( textViewBlurb ) ) ) ; JournalEntry currentEntry = getItem ( position ) ; String date = currentEntry . getDate ( ) ; SimpleDateFormat formatter = new SimpleDateFormat ( "yyyyMMdd_HHmmss" ) ; Date formatInDateFrom = null ; try { formatInDateFrom = ( ( Date ) ( formatter . parse ( date ) ) ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } SimpleDateFormat newFormat = new SimpleDateFormat ( "EEE,<seq2seq4repair_space>d<seq2seq4repair_space>MMM,<seq2seq4repair_space>''yy<seq2seq4repair_space>h:mm<seq2seq4repair_space>aaa" ) ; String formattedDate = newFormat . format ( formatInDateFrom ) ; String filePath = currentEntry . getPicFilePath ( ) ; Bitmap userPhoto = BitmapFactory . decodeFile ( filePath ) ; dateTV . setText ( formattedDate ) ; <START_BUG> picIV . setImageBitmap ( userPhoto ) ; <END_BUG> blurbTV . setText ( currentEntry . getBlurb ( ) ) ; return customView ; } }

Fix:
picIV . setImageBitmap ( Bitmap . createScaledBitmap ( userPhoto , 300 , 300 , false ) ) ;
Buggy code:
public class JDBCSampler extends AbstractSampler implements PerSampleClonable , TestListener { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.protocol.jdbc" ) ; public static final String URL = "JDBCSampler.url" ; public static final String DRIVER = "JDBCSampler.driver" ; public static String CONNECTIONS = "JDBCSampler.connections" ; public static String MAXUSE = "JDBCSampler.maxuse" ; transient DBConnectionManager manager = DBConnectionManager . getManager ( ) ; public static final String QUERY = "JDBCSampler.query" ; private static Map keyMap = new HashMap ( ) ; private static boolean running = false ; public JDBCSampler ( ) { } public void testStarted ( String host ) { } public void testEnded ( String host ) { } public synchronized void testStarted ( ) { } public synchronized void testEnded ( ) { } public String getQuery ( ) { } public SampleResult sample ( Entry e ) { DBKey key = getKey ( ) ; long start ; long end ; long time ; time = start = end = 0 ; SampleResult res = new SampleResult ( ) ; Connection con = null ; ResultSet rs = null ; Statement stmt = null ; Data data = new Data ( ) ; <START_BUG> res . setSampleLabel ( getQuery ( ) ) ; <END_BUG> start = System . currentTimeMillis ( ) ; try { int count = 0 ; while ( ( count < 20 ) && ( ( con = manager . getConnection ( key ) ) == null ) ) { try { Thread . sleep ( 10 ) ; } catch ( Exception err ) { count ++ ; } } stmt = con . createStatement ( ) ; boolean retVal = stmt . execute ( getQuery ( ) ) ; if ( retVal ) { rs = stmt . getResultSet ( ) ; data = getDataFromResultSet ( rs ) ; rs . close ( ) ; } else { int updateCount = stmt . getUpdateCount ( ) ; } stmt . close ( ) ; manager . releaseConnection ( con ) ; res . setResponseData ( data . toString ( ) . getBytes ( ) ) ; res . setDataType ( TEXT ) ; res . setSuccessful ( true ) ; } catch ( Exception ex ) { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException err ) { rs = null ; } } if ( stmt != null ) { try { stmt . close ( ) ; } catch ( SQLException err ) { stmt = null ; } } manager . releaseConnection ( con ) ; JDBCSampler . log . error ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>JDBC<seq2seq4repair_space>sampling" , ex ) ; res . setResponseData ( new byte [ 0 ] ) ; res . setSuccessful ( false ) ; } end = System . currentTimeMillis ( ) ; time += end - start ; res . setTime ( time ) ; res . setSamplerData ( this . toString ( ) ) ; return res ; } public String getUrl ( ) { } public String getUsername ( ) { } public String getPassword ( ) { } public String getDriver ( ) { } public int getMaxUse ( ) { } public int getNumConnections ( ) { } private DBKey getKey ( ) { } private Data getDataFromResultSet ( ResultSet rs ) throws SQLException { } public String toString ( ) { } public void testIterationStart ( IterationEvent event ) { } }

Fix:
res . setSampleLabel ( getName ( ) ) ;
Buggy code:
public class LoginDao { public static boolean validate ( String name , String pass ) { boolean status = false ; Connection conn = null ; PreparedStatement pst = null ; ResultSet rs = null ; String url = "jdbc:mysql:////localhost:3306//" ; <START_BUG> String dbName = "form" ; <END_BUG> String driver = "com.mysql.jdbc.Driver" ; String userName = "root" ; String password = "BlackSox2012" ; try { Class . forName ( driver ) . newInstance ( ) ; conn = DriverManager . getConnection ( ( url + dbName ) , userName , password ) ; pst = conn . prepareStatement ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>gaming.users<seq2seq4repair_space>where<seq2seq4repair_space>username=?<seq2seq4repair_space>and<seq2seq4repair_space>userpass=?" ) ; pst . setString ( 1 , name ) ; pst . setString ( 2 , pass ) ; rs = pst . executeQuery ( ) ; status = rs . next ( ) ; } catch ( Exception e ) { System . out . println ( e ) ; } finally { if ( conn != null ) { try { conn . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } if ( pst != null ) { try { pst . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } } return status ; } No newline ; at end ; of file ; }

Fix:
String dbName = "gaming" ;
Buggy code:
public class ArticleInfo implements Serializable { private Article article ; private int number ; private String title ; private String subtitle ; private boolean swapTitlePos ; private String author ; private ArrayList < String > contentList ; private boolean isFav ; private int i ; public void reset ( ) { } public boolean hasNextContent ( ) { } public boolean isNextImg ( ) { String s = contentList . get ( i ) ; <START_BUG> if ( s . substring ( 0 , 5 ) . equals ( "_IMG_" ) ) { <END_BUG> return true ; } else { return false ; } } public String getNextPart ( ) { } public void getNextImg ( DataModel dm , DataFoundListener listener ) { } public Article getArticle ( ) { } public boolean isFav ( ) { } public void setFav ( boolean isFav ) { } public ArrayList < String > getContentList ( ) { } public void setContentList ( ArrayList < String > contentList ) { } public String getTitle ( ) { } public void setTitle ( String title ) { } public String getSubtitle ( ) { } public void setSubtitle ( String subtitle ) { } public boolean isSwapTitlePos ( ) { } public void setSwapTitlePos ( boolean swapTitlePos ) { } public String getAuthor ( ) { } public void setAuthor ( String author ) { } public int getNumber ( ) { } public void setNumber ( int number ) { } public ArticleInfo ( Article article ) { } }

Fix:
if ( ( ( s . length ( ) ) > 5 ) && ( s . substring ( 0 , 5 ) . equals ( "_IMG_" ) ) ) {
Buggy code:
public class JdkDependenciesProcessor implements DeploymentUnitProcessor { private static ModuleIdentifier SUN_JDK = ModuleIdentifier . create ( "sun.jdk" ) ; @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; <START_BUG> moduleSpecification . addDependency ( new ModuleDependency ( moduleLoader , JdkDependenciesProcessor . SUN_JDK , false , false , false ) ) ; <END_BUG> } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , JdkDependenciesProcessor . SUN_JDK , false , false , false ) ) ;
Buggy code:
public class SpringBeanLocator implements IProxyTargetLocator { private transient Class beanTypeCache ; private String beanTypeName ; private String beanName ; private ISpringContextLocator springContextLocator ; private Boolean singletonCache = null ; public SpringBeanLocator ( Class beanType , ISpringContextLocator locator ) { } public SpringBeanLocator ( String beanName , Class beanType , ISpringContextLocator locator ) { } private final String getBeanNameOfClass ( ApplicationContext ctx , Class clazz ) { } public boolean isSingletonBean ( ) { } public Class getBeanType ( ) { } public Object locateProxyTarget ( ) { } private ApplicationContext getSpringContext ( ) { } public final String getBeanName ( ) { <START_BUG> if ( ( beanName ) == null ) { <END_BUG> beanName = getBeanNameOfClass ( getSpringContext ( ) , getBeanType ( ) ) ; } return beanName ; } public final ISpringContextLocator getSpringContextLocator ( ) { } private final Object lookupSpringBean ( ApplicationContext ctx , Class clazz ) { } private static Object lookupSpringBean ( ApplicationContext ctx , String name , Class clazz ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } }

Fix:
if ( ( ( beanName ) == null ) || ( "" . equals ( beanName ) ) ) {
Buggy code:
public class LongestIncreasingSubSequence { public int longestIncreasingSubSequenceDP ( int [ ] arr ) { if ( ( arr . length ) == 1 ) { return 1 ; } int [ ] T = new int [ arr . length ] ; for ( int i = 0 ; i < ( arr . length ) ; i ++ ) { T [ i ] = 1 ; } for ( int i = 1 ; i < ( arr . length ) ; i ++ ) { for ( int j = 0 ; j < i ; j ++ ) { if ( ( arr [ j ] ) < ( arr [ i ] ) ) { <START_BUG> T [ i ] = Math . max ( T [ j ] , ( ( T [ j ] ) + 1 ) ) ; <END_BUG> } } } int max = 0 ; for ( int i = 0 ; i < ( T . length ) ; i ++ ) { if ( max < ( T [ i ] ) ) { max = T [ i ] ; } } return max ; } public static void main ( String [ ] args ) { } }

Fix:
T [ i ] = Math . max ( T [ i ] , ( ( T [ j ] ) + 1 ) ) ;
Buggy code:
public class DisplayOutputWritersAction { private final AnalysisJobBuilder _analysisJobBuilder ; public DisplayOutputWritersAction ( AnalysisJobBuilder analysisJobBuilder ) { } public final void showPopup ( JComponent component ) { } public List < JMenuItem > createMenuItems ( ) { List < JMenuItem > result = new ArrayList < JMenuItem > ( ) ; for ( final ComponentDescriptor < ? > descriptor : getDescriptors ( ) ) { <START_BUG> JMenuItem outputWriterMenuItem = new org . datacleaner . widgets . DescriptorMenuItem ( _analysisJobBuilder , null , descriptor ) ; <END_BUG> outputWriterMenuItem . addActionListener ( new ActionListener ( ) { @ Override public void actionPerformed ( ActionEvent e ) { ComponentBuilder componentBuilder = _analysisJobBuilder . addComponent ( descriptor ) ; configure ( _analysisJobBuilder , componentBuilder ) ; } } ) ; result . add ( outputWriterMenuItem ) ; } return result ; } protected void configure ( AnalysisJobBuilder analysisJobBuilder , ComponentBuilder componentBuilder ) { } protected Collection < ? extends ComponentDescriptor < ? > > getDescriptors ( ) { } }

Fix:
JMenuItem outputWriterMenuItem = new org . datacleaner . widgets . DescriptorMenuItem ( _analysisJobBuilder , null , descriptor , false ) ;