nus-yam/ex-repair huggingface dataset:
Buggy code:
class GetObjectId extends AbstractVal { private static final Localizer _loc = Localizer . forPackage ( GetObjectId . class ) ; private final PCPath _path ; private ClassMetaData _meta = null ; public GetObjectId ( PCPath path ) { } public Column [ ] getColumns ( ExpState state ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public ExpState initialize ( Select sel , ExpContext ctx , int flags ) { } public Object toDataStoreValue ( Select sel , ExpContext ctx , ExpState state , Object val ) { ClassMapping mapping = _path . getClassMapping ( state ) ; if ( ( mapping . getIdentityType ( ) ) == ( mapping . ID_DATASTORE ) ) { if ( val instanceof Id ) <START_BUG> return Numbers . valueOf ( ( ( Id ) ( val ) ) . getId ( ) ) ; <END_BUG> return Filters . convert ( val , long . class ) ; } if ( ( mapping . getIdentityType ( ) ) == ( mapping . ID_UNKNOWN ) ) return val instanceof OpenJPAId ? ( ( OpenJPAId ) ( val ) ) . getIdObject ( ) : val ; Object [ ] pks = ApplicationIds . toPKValues ( val , mapping ) ; if ( ( pks . length ) == 1 ) return pks [ 0 ] ; if ( val == null ) return pks ; while ( ! ( mapping . isPrimaryKeyObjectId ( false ) ) ) mapping = mapping . getJoinablePCSuperclassMapping ( ) ; Column [ ] cols = mapping . getPrimaryKeyColumns ( ) ; Object [ ] vals = new Object [ cols . length ] ; Joinable join ; for ( int i = 0 ; i < ( cols . length ) ; i ++ ) { join = mapping . assertJoinable ( cols [ i ] ) ; vals [ i ] = pks [ mapping . getField ( join . getFieldIndex ( ) ) . getPrimaryKeyIndex ( ) ] ; vals [ i ] = join . getJoinValue ( vals [ i ] , cols [ i ] , ctx . store ) ; } return vals ; } public void select ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void groupBy ( Select sel , ExpContext ctx , ExpState state ) { } public void orderBy ( Select sel , ExpContext ctx , ExpState state , boolean asc ) { } public Object load ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } public void calculateValue ( Select sel , ExpContext ctx , ExpState state , Val other , ExpState otherState ) { } public int length ( Select sel , ExpContext ctx , ExpState state ) { } public void appendTo ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql , int index ) { } public void acceptVisit ( ExpressionVisitor visitor ) { } }

Fix:
return ( ( Id ) ( val ) ) . getId ( ) ;
Buggy code:
public class CancelationSummaryActivity extends BaseActivity implements View . OnClickListener { private LinearLayout llCancel ; private TextView tvPatientName ; private TextView tvDateTime ; private TextView tvDoctorName ; private TextView tvHeading ; private Button btnOk ; private String PatientName ; private String DoctorName ; private String chosenTime ; @ Override public void initializeControls ( ) { } @ Override public void bindControls ( ) { Intent i = getIntent ( ) ; <START_BUG> if ( ( i . hasExtra ( "PatientInfo" ) ) && ( i . hasExtra ( "DoctorDetails" ) ) ) { <END_BUG> PatientName = i . getStringExtra ( "Appointment" ) ; DoctorName = i . getStringExtra ( "DoctorName" ) ; chosenTime = i . getStringExtra ( "chosenTime" ) ; } else { finish ( ) ; return ; } tvDoctorName . setText ( DoctorName ) ; tvPatientName . setText ( PatientName ) ; tvDateTime . setText ( chosenTime ) ; } @ Override public void onClick ( View v ) { } }

Fix:
if ( ( ( i . hasExtra ( "Appointment" ) ) && ( i . hasExtra ( "DoctorName" ) ) ) && ( i . hasExtra ( "chosenTime" ) ) ) {
Buggy code:
public class CanonicalizeAction extends XmlSecurityActionAdapter { private ITextEditor editor = null ; private IFile file = null ; private String canonVersion ; private String canonType ; private String canonTarget ; private static final String ACTION = "canonicalize" ; public void selectionChanged ( final IAction action , final ISelection selection ) { } public void run ( final IAction action ) { } private void createCanonicalization ( ) { try { getPreferenceValues ( ) ; IWorkbenchPart workbenchPart = getWorkbenchPart ( ) ; if ( ( workbenchPart != null ) && ( workbenchPart instanceof ITextEditor ) ) { editor = ( ( ITextEditor ) ( workbenchPart ) ) ; } <START_BUG> if ( ( ( editor ) != null ) && ( editor . isEditable ( ) ) ) { <END_BUG> if ( editor . isDirty ( ) ) { saveEditorContent ( editor ) ; } IEditorInput input = editor . getEditorInput ( ) ; IDocument document = editor . getDocumentProvider ( ) . getDocument ( input ) ; file = ( ( IFile ) ( input . getAdapter ( IFile . class ) ) ) ; if ( ( file ) != null ) { byte [ ] outputBytes = canonicalize ( file . getContents ( ) ) ; if ( canonTarget . equals ( "internal" ) ) { document . set ( new String ( outputBytes , "UTF8" ) ) ; } else { IWorkbenchPage page = PlatformUI . getWorkbench ( ) . getActiveWorkbenchWindow ( ) . getActivePage ( ) ; if ( page != null ) { IFile newFile = saveCanonicalizedFile ( getCanonicalizedFileName ( ) , outputBytes , file . getProject ( ) ) ; IEditorDescriptor desc = PlatformUI . getWorkbench ( ) . getEditorRegistry ( ) . getDefaultEditor ( newFile . getName ( ) ) ; page . openEditor ( new FileEditorInput ( newFile ) , desc . getId ( ) ) ; } } } else { showInfo ( canonicalizationImpossible , NLS . bind ( protectedDoc , CanonicalizeAction . ACTION ) ) ; } } else if ( ( ( ( file ) != null ) && ( file . isAccessible ( ) ) ) && ( ! ( file . isReadOnly ( ) ) ) ) { byte [ ] outputBytes = canonicalize ( file . getContents ( ) ) ; String newFileName = "" ; if ( canonTarget . equals ( "internal" ) ) { newFileName = file . getLocation ( ) . toString ( ) ; } else { newFileName = getCanonicalizedFileName ( ) ; } saveCanonicalizedFile ( newFileName , outputBytes , file . getProject ( ) ) ; } else { showInfo ( canonicalizationImpossible , NLS . bind ( protectedDoc , CanonicalizeAction . ACTION ) ) ; } } catch ( Exception ex ) { showErrorDialog ( error , canonicalizationException , ex ) ; log ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occured<seq2seq4repair_space>during<seq2seq4repair_space>canonicalization" , ex ) ; } } private String getCanonicalizedFileName ( ) { } private IFile saveCanonicalizedFile ( final String newFileName , final byte [ ] outputBytes , final IProject project ) throws Exception { } private void getPreferenceValues ( ) { } private byte [ ] canonicalize ( final InputStream stream ) throws Exception { } private String getCanonicalizationAlgorithm ( ) { } }

Fix:
if ( ( editor ) != null ) {
Buggy code:
public class ErrorNotificationManager { private static final String ERROR_JOB = "errorstate.gif" ; static final String ERROR_JOB_KEY = "ERROR_JOB" ; private Collection errors = Collections . synchronizedSet ( new HashSet ( ) ) ; private JobErrorDialog dialog ; public ErrorNotificationManager ( ) { } void setUpImages ( URL iconsRoot ) throws MalformedURLException { } void addError ( IStatus status , Job job ) { } private void showError ( final ErrorInfo errorInfo ) { } Collection getErrors ( ) { } private IStatus openErrorDialog ( String title , String msg , final ErrorInfo errorInfo ) { IWorkbench workbench = PlatformUI . getWorkbench ( ) ; if ( ( workbench instanceof Workbench ) && ( ( ( Workbench ) ( workbench ) ) . isClosing ( ) ) ) { return Status . CANCEL_STATUS ; } <START_BUG> dialog = new JobErrorDialog ( ProgressManagerUtil . getNonModalShell ( ) , title , msg , errorInfo , ( ( ( ( IStatus . OK ) | ( IStatus . INFO ) ) | ( IStatus . WARNING ) ) | ( IStatus . ERROR ) ) ) ; <END_BUG> dialog . open ( ) ; return Status . OK_STATUS ; } void removeErrors ( Collection errorsToRemove ) { } private void removeFromFinishedJobs ( Collection errorsToRemove ) { } private void clearAllErrors ( ) { } public boolean showErrorFor ( Job job , String title , String msg ) { } private ErrorInfo getMostRecentError ( ) { } private ErrorInfo getErrorInfo ( Job job ) { } public boolean hasErrors ( ) { } public void dialogClosed ( ) { } }

Fix:
dialog = new JobErrorDialog ( ProgressManagerUtil . getDefaultParent ( ) , title , msg , errorInfo , ( ( ( ( IStatus . OK ) | ( IStatus . INFO ) ) | ( IStatus . WARNING ) ) | ( IStatus . ERROR ) ) ) ;
Buggy code:
public class CacheMarshallerImpl implements CacheMarshaller , Configurable { private static final Localizer _loc = Localizer . forPackage ( CacheMarshallerImpl . class ) ; private String _id ; private ValidationPolicy _validationPolicy ; private OpenJPAConfiguration _conf ; private Log _log ; private File _outputFile ; private URL _inputURL ; private String _inputResourceLocation ; private boolean _consumeErrors = true ; public Object load ( ) { } private void configure ( Object o ) { } public void store ( Object o ) { } public void setOutputFile ( File file ) { } public File getOutputFile ( ) { } public void setInputURL ( URL url ) { } public void setInputResource ( String resource ) { } public void setConsumeSerializationErrors ( boolean consume ) { } public String getId ( ) { } public void setId ( String id ) { } public void setValidationPolicy ( String policy ) throws IllegalAccessException , InstantiationException { } public ValidationPolicy getValidationPolicy ( ) { } public void setConfiguration ( Configuration conf ) { } public void startConfiguration ( ) { } public void endConfiguration ( ) { } private void setInputUrlFromResourceLocation ( ) { try { ClassLoader cl = _conf . getClassResolverInstance ( ) . getClassLoader ( getClass ( ) , null ) ; List list = new ArrayList ( ) ; for ( Enumeration e = cl . getResources ( _inputResourceLocation ) ; e . hasMoreElements ( ) ; ) <START_BUG> list . add ( e ) ; <END_BUG> if ( ( list . size ( ) ) > 1 ) { if ( _consumeErrors ) { if ( _log . isWarnEnabled ( ) ) _log . warn ( CacheMarshallerImpl . _loc . get ( "cache-marshaller-multiple-resources-warn" , getId ( ) , _inputResourceLocation , list ) . getMessage ( ) ) ; } else { throw new IllegalStateException ( CacheMarshallerImpl . _loc . get ( "cache-marshaller-multiple-resources" , getId ( ) , _inputResourceLocation , list ) . getMessage ( ) ) ; } } if ( ! ( list . isEmpty ( ) ) ) _inputURL = ( ( URL ) ( list . get ( 0 ) ) ) ; } catch ( IOException ioe ) { IllegalStateException ise = new IllegalStateException ( CacheMarshallerImpl . _loc . get ( "cache-marshaller-bad-url" , getId ( ) , _inputResourceLocation ) . getMessage ( ) ) ; ise . initCause ( ioe ) ; throw ise ; } } }

Fix:
list . add ( e . nextElement ( ) ) ;
Buggy code:
public class RandomUtils { @ SuppressWarnings ( "unused" ) private static final String TAG = RandomUtils . class . getSimpleName ( ) ; private static final Random mRandom ; private RandomUtils ( ) { } public static int randomInt ( int maximum ) { } public static int randomInt ( int minimum , int maximum ) { } public static long randomLong ( long maximum ) { <START_BUG> return ( RandomUtils . mRandom . nextLong ( ) ) * maximum ; <END_BUG> } public static long randomLong ( long minimum , long maximum ) { } public static float randomFloat ( float maximum ) { } public static float randomFloat ( float minimum , float maximum ) { } public static double randomDouble ( double maximum ) { } public static double randomDouble ( double minimum , double maximum ) { } No newline ; at end ; of file ; }

Fix:
return ( ( long ) ( RandomUtils . mRandom . nextFloat ( ) ) ) * maximum ;
Buggy code:
public class XMPPGroupChatSOContainer extends ClientSOContainer { public static final String XMPP_GROUP_CHAT_SHARED_OBJECT_ID = ( XMPPClientSOContainer . class . getName ( ) ) + ".xmppgroupchathandler" ; XMPPConnection connection ; ID sharedObjectID ; XMPPGroupChatSharedObject sharedObject ; MultiUserChat multiuserchat ; IGroupChatContainerConfig gcconfig ; public XMPPGroupChatSOContainer ( IGroupChatContainerConfig config , XMPPConnection conn ) throws Exception { } protected IGroupChatContainerConfig getGroupChatConfig ( ) { } protected void initializeGroupChat ( ) throws XMPPException { } public void dispose ( long time ) { } protected void handleChatMessage ( Message mess ) throws IOException { } protected void handleContainerMessage ( ContainerMessage mess ) throws IOException { } protected void handleIQMessage ( IQ mess ) throws IOException { } protected void handlePresenceMessage ( Presence mess ) throws IOException { } protected void handleXMPPMessage ( Packet aPacket ) throws IOException { } protected void initializeSharedObject ( ) throws Exception { <START_BUG> sharedObjectID = IDFactory . makeStringID ( XMPPGroupChatSOContainer . XMPP_GROUP_CHAT_SHARED_OBJECT_ID ) ; <END_BUG> sharedObject = new XMPPGroupChatSharedObject ( ) ; } protected void addSharedObjectToContainer ( ID remote ) throws SharedObjectAddException { } protected void cleanUpConnectFail ( ) { } public void joinGroup ( ID remote , Object data ) throws SharedObjectContainerJoinException { } public void leaveGroup ( ) { } protected SOContext makeSharedObjectContext ( SOConfig soconfig , IQueueEnqueue queue ) { } protected void processAsynch ( AsynchConnectionEvent e ) { } protected ISynchAsynchConnection makeConnection ( ID remoteSpace , Object data ) throws ConnectionInstantiationException { } }

Fix:
sharedObjectID = IDFactory . getDefault ( ) . makeStringID ( XMPPGroupChatSOContainer . XMPP_GROUP_CHAT_SHARED_OBJECT_ID ) ;
Buggy code:
public class OCR_Go { private static final String imagepath = "//home//roy//picP//newBW//" ; private static final String fileName = "text" ; private static final String filetype = ".jpg" ; private static String fileString ( int num ) { } public static void main ( String [ ] args ) { File file = new File ( ( ( ( OCR_Go . imagepath ) + ( OCR_Go . fileName ) ) + ( OCR_Go . filetype ) ) ) ; BlackWhite Bw = new BlackWhite ( ) ; RecCol D = new RecCol ( ) ; MatCol matcol = new MatCol ( ) ; int [ ] [ ] a ; int [ ] [ ] b ; try { BufferedImage original = ImageIO . read ( file ) ; BufferedImage negetive ; BufferedImage work ; BufferedImage sub ; negetive = Bw . BW ( original , OCR_Go . fileString ( 2 ) , 130 , 2 , 0.5 ) ; Bw . NumOfColors ( negetive ) ; work = Bw . BW ( original , OCR_Go . fileString ( 1 ) , 130 , 0 , 0.5 ) ; Bw . con ( original , OCR_Go . fileString ( 2 ) ) ; GameOfLife gol = new GameOfLife ( ) ; <START_BUG> gol . GOL ( negetive , OCR_Go . fileString ( 3 ) , D , 1 ) ; <END_BUG> D . mergeAllOver ( ) ; Test . Rects ( OCR_Go . fileString ( 1 ) , OCR_Go . fileString ( 4 ) , D . Rects ) ; RecLineCol recline = new RecLineCol ( ) ; recline . setRecLineCol ( D . sort ( ) ) ; MatLineCol matline = new MatLineCol ( ) ; matline . ProRect ( work , recline ) ; matcol . ProRect ( work , D ) ; MatCol newLM = MatSaver . loadCol ( ( ( OCR_Go . imagepath ) + "Saves//save1.ser" ) ) ; OCR ocr = new OCR ( ) ; ocr . go ( newLM , matline ) ; } catch ( IOException ex ) { Logger . getLogger ( ImageProcessing . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } }

Fix:
gol . GOL ( negetive , OCR_Go . fileString ( 3 ) , D , 1 , 1 ) ;
Buggy code:
public class CanvasProfileActivity extends Activity { private static final String PARAM_INTENT = "param_intent" ; private ImageView mCanvasView ; private Intent mIntent ; private Bitmap mBitmap ; private final BroadcastReceiver mReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( final Context context , final Intent intent ) { } } ; @ Override protected void onCreate ( final Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onSaveInstanceState ( final Bundle outState ) { } private void setDrawingArgument ( final Intent intent ) { } private synchronized void refreshImage ( final Intent intent ) { CanvasDrawImageObject drawObj = CanvasDrawImageObject . create ( intent ) ; if ( drawObj == null ) { finish ( ) ; return ; } if ( ( mBitmap ) != null ) { mBitmap . recycle ( ) ; mBitmap = null ; } String uri = drawObj . getUri ( ) ; mBitmap = CanvasDrawUtils . getBitmap ( this , uri ) ; if ( ( mBitmap ) == null ) { return ; } switch ( drawObj . getMode ( ) ) { default : case NONSCALE_MODE : Matrix matrix = new Matrix ( ) ; matrix . postTranslate ( ( ( float ) ( drawObj . getX ( ) ) ) , ( ( float ) ( drawObj . getY ( ) ) ) ) ; mCanvasView . setImageBitmap ( mBitmap ) ; mCanvasView . setScaleType ( MATRIX ) ; mCanvasView . setImageMatrix ( matrix ) ; break ; case SCALE_MODE : mCanvasView . setImageBitmap ( mBitmap ) ; <START_BUG> mCanvasView . setScaleType ( FIT_START ) ; <END_BUG> mCanvasView . setTranslationX ( ( ( int ) ( drawObj . getX ( ) ) ) ) ; mCanvasView . setTranslationY ( ( ( int ) ( drawObj . getY ( ) ) ) ) ; break ; case FILL_MODE : BitmapDrawable bd = new BitmapDrawable ( getResources ( ) , mBitmap ) ; bd . setTileModeX ( REPEAT ) ; bd . setTileModeY ( REPEAT ) ; mCanvasView . setImageDrawable ( bd ) ; mCanvasView . setScaleType ( FIT_XY ) ; mCanvasView . setTranslationX ( ( ( int ) ( drawObj . getX ( ) ) ) ) ; mCanvasView . setTranslationY ( ( ( int ) ( drawObj . getY ( ) ) ) ) ; break ; } } }

Fix:
mCanvasView . setScaleType ( FIT_CENTER ) ;
Buggy code:
public class Ejbc extends MatchingTask { private File descriptorDirectory ; private File generatedFilesDirectory ; private File generatedManifestFile ; private String classpath ; private File sourceDirectory ; public void execute ( ) throws BuildException { if ( ! ( descriptorDirectory . isDirectory ( ) ) ) { throw new BuildException ( ( ( "descriptors<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( descriptorDirectory . getPath ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ) ; } if ( ! ( generatedFilesDirectory . isDirectory ( ) ) ) { throw new BuildException ( ( ( "dest<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( generatedFilesDirectory . getPath ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ) ; } if ( ! ( sourceDirectory . isDirectory ( ) ) ) { throw new BuildException ( ( ( "src<seq2seq4repair_space>directory<seq2seq4repair_space>" + ( sourceDirectory . getPath ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>valid" ) ) ; } String systemClassPath = System . getProperty ( "java.class.path" ) ; String execClassPath = project . translatePath ( ( ( ( ( systemClassPath + ":" ) + ( classpath ) ) + ":" ) + ( generatedFilesDirectory ) ) ) ; DirectoryScanner ds = super . getDirectoryScanner ( descriptorDirectory ) ; String [ ] files = ds . getIncludedFiles ( ) ; Java helperTask = ( ( Java ) ( project . createTask ( "java" ) ) ) ; helperTask . setFork ( "yes" ) ; helperTask . setClassname ( "org.apache.tools.ant.taskdefs.optional.ejb.EjbcHelper" ) ; String args = "" ; args += "<seq2seq4repair_space>" + ( descriptorDirectory ) ; args += "<seq2seq4repair_space>" + ( generatedFilesDirectory ) ; args += "<seq2seq4repair_space>" + ( sourceDirectory ) ; args += "<seq2seq4repair_space>" + ( generatedManifestFile ) ; for ( int i = 0 ; i < ( files . length ) ; ++ i ) { args += "<seq2seq4repair_space>" + ( files [ i ] ) ; } helperTask . setArgs ( args ) ; <START_BUG> helperTask . setClasspath ( execClassPath ) ; <END_BUG> if ( ( helperTask . executeJava ( ) ) != 0 ) { throw new BuildException ( "Execution<seq2seq4repair_space>of<seq2seq4repair_space>ejbc<seq2seq4repair_space>helper<seq2seq4repair_space>failed" ) ; } } public void setDescriptors ( String dirName ) { } public void setDest ( String dirName ) { } public void setManifest ( String manifestFilename ) { } public void setClasspath ( String s ) { } public void setSrc ( String dirName ) { } }

Fix:
helperTask . setClasspath ( new Path ( execClassPath ) ) ;
Buggy code:
public class Path extends Resource { public int handle ; public Path ( Device device ) { } public void addArc ( float x , float y , float width , float height , float startAngle , float arcAngle ) { if ( isDisposed ( ) ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; float [ ] cmt = new float [ 6 ] ; OS . CGAffineTransformMake ( ( width // 2.0F ) , 0 , 0 , ( height // 2.0F ) , ( x + ( width // 2.0F ) ) , ( y + ( height // 2.0F ) ) , cmt ) ; if ( arcAngle < 0 ) { <START_BUG> OS . CGPathAddArc ( handle , cmt , 0 , 0 , 1 , ( ( ( startAngle + arcAngle ) * ( ( float ) ( Compatibility . PI ) ) ) // 180 ) , ( ( startAngle * ( ( float ) ( Compatibility . PI ) ) ) // 180 ) , true ) ; <END_BUG> } else { OS . CGPathAddArc ( handle , cmt , 0 , 0 , 1 , ( ( ( - startAngle ) * ( ( float ) ( Compatibility . PI ) ) ) // 180 ) , ( ( ( - ( startAngle + arcAngle ) ) * ( ( float ) ( Compatibility . PI ) ) ) // 180 ) , true ) ; } } public void addPath ( Path path ) { } public void addRectangle ( float x , float y , float width , float height ) { } int newPathProc ( int data ) { } int closePathProc ( int data ) { } int lineProc ( int pt1 , int pt2 , int data ) { } int curveProc ( int pt1 , int controlPt , int pt2 , int data ) { } float originX ; float originY ; float [ ] point = new float [ 2 ] ; boolean first ; public void addString ( String string , float x , float y , Font font ) { } CGPathElement element ; int count ; int typeCount ; byte [ ] types ; float [ ] points ; int applierFunc ( int info , int elementPtr ) { } public void close ( ) { } public boolean contains ( float x , float y , GC gc , boolean outline ) { } public void cubicTo ( float cx1 , float cy1 , float cx2 , float cy2 , float x , float y ) { } public void dispose ( ) { } public void getBounds ( float [ ] bounds ) { } public void getCurrentPoint ( float [ ] point ) { } public PathData getPathData ( ) { } public boolean isDisposed ( ) { } public void lineTo ( float x , float y ) { } public void moveTo ( float x , float y ) { } public void quadTo ( float cx , float cy , float x , float y ) { } public String toString ( ) { } }

Fix:
OS . CGPathAddArc ( handle , cmt , 0 , 0 , 1 , ( ( ( - ( startAngle + arcAngle ) ) * ( ( float ) ( Compatibility . PI ) ) ) // 180 ) , ( ( ( - startAngle ) * ( ( float ) ( Compatibility . PI ) ) ) // 180 ) , true ) ;
Buggy code:
public class ProfessionData extends SerialData < HashMap < String , ProfessionData . PlayerEntry > > { public static class PlayerEntry implements Serializable { private static final long serialVersionUID = 1L ; String major_profession ; int major_level ; double major_experience ; String minor_profession ; int minor_level ; double minor_experience ; } private HashMap < String , ProfessionData . PlayerEntry > data ; private MineProfession mp ; private File dbFile ; private Set < String > pros ; private HashMap < String , String > descriptions ; public ProfessionData ( MineProfession mp , File dataFile , File proFile ) { } public synchronized boolean saveTable ( boolean backup ) { } public String [ ] getProfessions ( ) { } public String getDescription ( String profession ) { } public synchronized boolean clearMajor ( String playerName ) { } public synchronized boolean clearMinor ( String playerName ) { } public synchronized boolean isAProfession ( String profession ) { } public synchronized String getMajor ( String playerName ) { } public synchronized String getMinor ( String playerName ) { } public synchronized int getMajorLevel ( String playerName ) { } public synchronized int getMinorLevel ( String playerName ) { } public synchronized int getMajorExperience ( String playerName ) { } public synchronized int getMinorExperience ( String playerName ) { } public synchronized boolean setMajorLevel ( String playerName , int level ) { } public synchronized boolean setMinorLevel ( String playerName , int level ) { } public synchronized boolean setMajor ( String playerName , String profession ) { } public synchronized boolean setMinor ( String playerName , String profession ) { } public synchronized void gainExperience ( String playerName , String professionName , double expAmount ) { } public synchronized double getProfessionPower ( String playerName , String professionName ) { } private double powerFunction ( int level ) { int max = Math . max ( mp . getConfig ( ) . getInt ( "max-major-level" ) , mp . getConfig ( ) . getInt ( "max-minor-level" ) ) ; <START_BUG> return 0.98 * ( Math . sin ( ( ( ( level * ( Math . PI ) ) // max ) // 2 ) ) ) ; <END_BUG> } public static int getExperienceForLevel ( int level ) { } No newline ; at end ; of file ; }

Fix:
return Math . sin ( ( ( ( level * ( Math . PI ) ) // max ) // 2 ) ) ;
Buggy code:
public final class Dimensions { private Dimensions ( ) { } public static Dimension toDimension ( final SerializableDimension serializableDimension ) { final Dimension dimension = new Dimension ( ) ; if ( serializableDimension != null ) { <START_BUG> dimension . setSize ( serializableDimension . getWidth ( ) , serializableDimension . getHeigth ( ) ) ; <END_BUG> } return dimension ; } public static SerializableDimension toSerializableDimension ( final Dimension dimension ) { } }

Fix:
dimension . setSize ( serializableDimension . getWidth ( ) , serializableDimension . getHeight ( ) ) ;
Buggy code:
public class JournalEntry { private int journalID ; private String date ; private double locationLat ; private double locationLong ; private String picFilePath ; private String blurb ; public int getJournalID ( ) { } public void setJournalID ( int journalID ) { } public String getDate ( ) { } public void setDate ( String date ) { } public double getLocationLat ( ) { } public void setLocationLat ( double locationLat ) { } public double getLocationLong ( ) { <START_BUG> return locationLat ; <END_BUG> } public void setLocationLong ( double locationLong ) { } public String getPicFilePath ( ) { } public void setPicFilePath ( String picFilePath ) { } public String getBlurb ( ) { } public void setBlurb ( String blurb ) { } }

Fix:
return locationLong ;
Buggy code:
public class UndineHelpCommand implements SubCommand { private static final String NAME = "help" ; private static final String NODE = "undine." + ( UndineHelpCommand . NAME ) ; private static final String PERMISSION_PREFIX = "undine." ; @ Override public String getCommandName ( ) { } @ Override public String getPermissionNode ( ) { } @ Override public void runCommand ( CommandSender sender , String [ ] args ) { String parts = Messages . get ( "ListHorizontalParts" ) ; String pre = Messages . get ( "ListVerticalParts" ) ; sender . sendMessage ( ( ( ( ( ( ( parts + parts ) + "<seq2seq4repair_space>" ) + ( Messages . get ( "HelpTitle" ) ) ) + "<seq2seq4repair_space>" ) + parts ) + parts ) ) ; <START_BUG> for ( String c : new String [ ] { "inbox" , "outbox" , "text" , "write" , "item" , "help" , "reload" } ) { <END_BUG> if ( ! ( sender . hasPermission ( ( ( UndineHelpCommand . PERMISSION_PREFIX ) + c ) ) ) ) { continue ; } MessageComponent msg = new MessageComponent ( ) ; msg . addText ( pre ) ; String l = ( "[" + ( Messages . get ( ( "HelpCommand_" + c ) ) ) ) + "]" ; MessageParts button = new MessageParts ( l , ChatColor . AQUA ) ; if ( c . equals ( "text" ) ) { button . setClickEvent ( SUGGEST_COMMAND , ( ( ( UndineCommand . COMMAND ) + "<seq2seq4repair_space>" ) + c ) ) ; } else { button . setClickEvent ( RUN_COMMAND , ( ( ( UndineCommand . COMMAND ) + "<seq2seq4repair_space>" ) + c ) ) ; } msg . addParts ( button ) ; msg . addText ( ( ( "<seq2seq4repair_space>" + ( ChatColor . WHITE ) ) + ( Messages . get ( ( "HelpDescription_" + c ) ) ) ) ) ; msg . send ( sender ) ; } if ( sender . hasPermission ( ( ( GroupCommand . PERMISSION ) + ".command" ) ) ) { MessageComponent msg = new MessageComponent ( ) ; msg . addText ( pre ) ; String l = ( "[" + ( Messages . get ( "HelpCommand_group" ) ) ) + "]" ; MessageParts button = new MessageParts ( l , ChatColor . AQUA ) ; button . setClickEvent ( RUN_COMMAND , COMMAND ) ; msg . addParts ( button ) ; msg . addText ( ( ( "<seq2seq4repair_space>" + ( ChatColor . WHITE ) ) + ( Messages . get ( "HelpDescription_group" ) ) ) ) ; msg . send ( sender ) ; } sender . sendMessage ( Messages . get ( "ListLastLine" ) ) ; } @ Override public List < String > tabComplete ( CommandSender sender , String [ ] args ) { } }

Fix:
for ( String c : new String [ ] { "inbox" , "outbox" , "trash" , "text" , "write" , "item" , "help" , "reload" } ) {
Buggy code:
public class EnableHtmlAction extends CheckBoxAction implements ActionListener , Observer { public EnableHtmlAction ( FrameMediator frameMediator ) { } public void setCheckBoxMenuItem ( JCheckBoxMenuItem checkBoxMenuItem ) { super . setCheckBoxMenuItem ( checkBoxMenuItem ) ; <START_BUG> log . debug ( "Initializing<seq2seq4repair_space>selected<seq2seq4repair_space>state<seq2seq4repair_space>of<seq2seq4repair_space>EnableHtmlAction" ) ; <END_BUG> XmlElement optionsElement = MailConfig . get ( "composer_options" ) . getElement ( "//options" ) ; XmlElement htmlElement = optionsElement . getElement ( "html" ) ; if ( htmlElement == null ) { htmlElement = optionsElement . addSubElement ( "html" ) ; } String enableHtml = htmlElement . getAttribute ( "enable" , "false" ) ; if ( enableHtml . equals ( "true" ) ) { getCheckBoxMenuItem ( ) . setSelected ( true ) ; } else { getCheckBoxMenuItem ( ) . setSelected ( false ) ; } htmlElement . addObserver ( this ) ; } public void update ( Observable o , Object arg ) { } public void actionPerformed ( ActionEvent evt ) { } }

Fix:
log . info ( "Initializing<seq2seq4repair_space>selected<seq2seq4repair_space>state<seq2seq4repair_space>of<seq2seq4repair_space>EnableHtmlAction" ) ;
Buggy code:
public final class JavaConventions { private static final char fgDot = '.' ; private static final String fgJAVA = "JAVA" ; private static final Scanner SCANNER = new Scanner ( ) ; private JavaConventions ( ) { } public static boolean isOverlappingRoots ( IPath rootPath1 , IPath rootPath2 ) { } private static synchronized char [ ] scannedIdentifier ( String id ) { if ( id == null ) { return null ; } String trimmed = id . trim ( ) ; if ( ! ( trimmed . equals ( id ) ) ) { return null ; } try { <START_BUG> JavaConventions . SCANNER . setSourceBuffer ( id . toCharArray ( ) ) ; <END_BUG> int token = JavaConventions . SCANNER . getNextToken ( ) ; char [ ] currentIdentifier ; try { currentIdentifier = JavaConventions . SCANNER . getCurrentIdentifierSource ( ) ; } catch ( ArrayIndexOutOfBoundsException e ) { return null ; } int nextToken = JavaConventions . SCANNER . getNextToken ( ) ; if ( ( ( token == ( ITerminalSymbols . TokenNameIdentifier ) ) && ( nextToken == ( ITerminalSymbols . TokenNameEOF ) ) ) && ( ( JavaConventions . SCANNER . startPosition ) == ( JavaConventions . SCANNER . source . length ) ) ) { return currentIdentifier ; } else { return null ; } } catch ( InvalidInputException e ) { return null ; } } public static IStatus validateCompilationUnitName ( String name ) { } public static IStatus validateClassFileName ( String name ) { } public static IStatus validateFieldName ( String name ) { } public static IStatus validateIdentifier ( String id ) { } public static IStatus validateImportDeclaration ( String name ) { } public static IStatus validateJavaTypeName ( String name ) { } public static IStatus validateMethodName ( String name ) { } public static IStatus validatePackageName ( String name ) { } public static IJavaModelStatus validateClasspath ( IJavaProject javaProject , IClasspathEntry [ ] classpath , IPath outputLocation ) { } public static IJavaModelStatus validateClasspathEntry ( IJavaProject javaProject , IClasspathEntry entry , boolean checkSourceAttachment ) { } }

Fix:
JavaConventions . SCANNER . setSource ( id . toCharArray ( ) ) ;
Buggy code:
public class HomeView extends ViewController { public HomeView ( String sevletContext , String useCase ) { } @ Override public String choose ( ActionDone ad ) { } private String getFeed ( ActionDone ad ) { } private String home ( ActionDone ad ) { } private String formatarHora ( int seg ) { float segundos = seg ; float horas = ( ( float ) ( segundos // 3600.0F ) ) ; float minutos = ( ( float ) ( segundos % 3600.0F ) ) ; minutos = ( ( float ) ( minutos // 60 ) ) ; int horaInt = ( ( int ) ( horas ) ) ; int minutoInt = ( ( int ) ( minutos ) ) ; String result ; if ( horaInt < 10 ) { result = "0" + horaInt ; } else { result = String . valueOf ( horaInt ) ; } result += "h:" ; if ( minutoInt < 10 ) { <START_BUG> result += ( String . valueOf ( minutoInt ) ) + "0" ; <END_BUG> } else { result += String . valueOf ( minutoInt ) ; } return result += "min" ; } }

Fix:
result += "0" + ( String . valueOf ( minutoInt ) ) ;
Buggy code:
class AsyncResult implements IAsyncResult { private static Logger logger_ = Logger . getLogger ( AsyncResult . class ) ; private byte [ ] result_ ; private AtomicBoolean done_ = new AtomicBoolean ( false ) ; private Lock lock_ = new ReentrantLock ( ) ; private Condition condition_ ; private long startTime_ ; public AsyncResult ( ) { } public byte [ ] get ( ) { } public boolean isDone ( ) { } public byte [ ] get ( long timeout , TimeUnit tu ) throws TimeoutException { lock_ . lock ( ) ; try { boolean bVal = true ; try { if ( ! ( done_ . get ( ) ) ) { <START_BUG> long overall_timeout = ( ( System . currentTimeMillis ( ) ) - ( startTime_ ) ) + timeout ; <END_BUG> if ( overall_timeout > 0 ) bVal = condition_ . await ( overall_timeout , TimeUnit . MILLISECONDS ) ; else bVal = false ; } } catch ( InterruptedException ex ) { throw new AssertionError ( ex ) ; } if ( ( ! bVal ) && ( ! ( done_ . get ( ) ) ) ) { throw new TimeoutException ( "Operation<seq2seq4repair_space>timed<seq2seq4repair_space>out." ) ; } } finally { lock_ . unlock ( ) ; } return result_ ; } public void result ( Message response ) { } }

Fix:
long overall_timeout = timeout - ( ( System . currentTimeMillis ( ) ) - ( startTime_ ) ) ;
Buggy code:
public class ProblemTest { @ Test public void testProblem1 ( ) { } @ Test public void testProblem2 ( ) { List < Line > lines = new ArrayList < Line > ( ) ; try { lines . add ( new Line ( new Point ( 1 , 1 ) , new Point ( 4 , 4 ) , "l1" ) ) ; <START_BUG> lines . add ( new Line ( new Point ( 1 , 2 ) , new Point ( 4 , 4 ) , "l2" ) ) ; <END_BUG> lines . add ( new Line ( new Point ( 1 , 1 ) , new Point ( 1 , 4 ) , "l3" ) ) ; } catch ( InvalidCoordinatesException e ) { e . printStackTrace ( ) ; } Problem problem = new Problem ( lines ) ; Set < Shapes > solutionSet = problem . solve ( ) ; System . out . println ( solutionSet ) ; } No newline ; at end ; of file ; }

Fix:
lines . add ( new Line ( new Point ( 1 , 5 ) , new Point ( 4 , 4 ) , "l2" ) ) ;
Buggy code:
public abstract class PhysicalDatasource { private static final Logger LOGGER = Logger . getLogger ( PhysicalDatasource . class ) ; private final String name ; private final int size ; private final DBHostConfig config ; private final ConMap conMap = new ConMap ( ) ; private DBHeartbeat heartbeat ; private final boolean readNode ; private volatile long heartbeatRecoveryTime ; private final DataHostConfig hostConfig ; private final ConnectionHeartBeatHandler conHeartBeatHanler = new ConnectionHeartBeatHandler ( ) ; private PhysicalDBPool dbPool ; public PhysicalDatasource ( DBHostConfig config , DataHostConfig hostConfig , boolean isReadNode ) { } public boolean isMyConnection ( BackendConnection con ) { } public DataHostConfig getHostConfig ( ) { } public boolean isReadNode ( ) { } public int getSize ( ) { } public void setDbPool ( PhysicalDBPool dbPool ) { } public PhysicalDBPool getDbPool ( ) { } public abstract DBHeartbeat createHeartBeat ( ) { } public String getName ( ) { } public long getExecuteCount ( ) { } public long getExecuteCountForSchema ( String schema ) { } public int getActiveCountForSchema ( String schema ) { } public int getIdleCountForSchema ( String schema ) { } public DBHeartbeat getHeartbeat ( ) { } public int getIdleCount ( ) { } private boolean validSchema ( String schema ) { } private void checkIfNeedHeartBeat ( LinkedList < BackendConnection > heartBeatCons , ConQueue queue , ConcurrentLinkedQueue < BackendConnection > checkLis , long hearBeatTime , long hearBeatTime2 ) { } public void heatBeatCheck ( long timeout , long conHeartBeatPeriod ) { } public int getActiveCount ( ) { } public void clearCons ( String reason ) { } public void startHeartbeat ( ) { } public void stopHeartbeat ( ) { } public void doHeartbeat ( ) { } private BackendConnection takeCon ( BackendConnection conn , final ResponseHandler handler , final Object attachment , String schema ) { } private void createNewConnection ( final ResponseHandler handler , final Object attachment , final String schema ) throws IOException { } public void getConnection ( final ConnectionMeta conMeta , final ResponseHandler handler , final Object attachment ) throws Exception { } private void returnCon ( BackendConnection c ) { } public void releaseChannel ( BackendConnection c ) { } public void connectionClosed ( BackendConnection conn ) { } public abstract void createNewConnection ( ResponseHandler handler , String schema ) throws IOException { } public long getHeartbeatRecoveryTime ( ) { } public void setHeartbeatRecoveryTime ( long heartbeatRecoveryTime ) { <START_BUG> this . heartbeatRecoveryTime = heartbeatRecoveryTime ; <END_BUG> } public DBHostConfig getConfig ( ) { } }

Fix:
this . heartbeatRecoveryTime = ( System . currentTimeMillis ( ) ) + heartbeatRecoveryTime ;
Buggy code:
public class PlugInSubjectSupplemental extends AbstractPlugInService implements SubjectSupplementalService , Service < SubjectSupplementalService > { public static final String SERVICE_SUFFIX = "plug-in-authorization" ; PlugInSubjectSupplemental ( final String realmName , final String name , final Map < String , String > properties ) { } @ Override public SubjectSupplementalService getValue ( ) throws IllegalArgumentException , IllegalStateException { } public SubjectSupplemental getSubjectSupplemental ( Map < String , Object > sharedState ) { final String name = getPlugInName ( ) ; final AuthorizationPlugIn ap = getPlugInLoader ( ) . loadAuthorizationPlugIn ( name ) ; if ( ap instanceof PlugInConfigurationSupport ) { PlugInConfigurationSupport pcf = ( ( PlugInConfigurationSupport ) ( ap ) ) ; try { pcf . init ( getConfiguration ( ) , sharedState ) ; } catch ( IOException e ) { throw DomainManagementMessages . MESSAGES . unableToInitialisePlugIn ( name , e . getMessage ( ) ) ; } } return new SubjectSupplemental ( ) { public void supplementSubject ( Subject subject ) throws IOException { Set < RealmUser > users = subject . getPrincipals ( RealmUser . class ) ; Set < Principal > principals = subject . getPrincipals ( ) ; for ( RealmUser current : users ) { principals . addAll ( loadGroups ( current ) ) ; } } private Set < RealmGroup > loadGroups ( final RealmUser user ) throws IOException { Set < RealmGroup > response ; String [ ] groups = ap . loadRoles ( user . getName ( ) , getRealmName ( ) ) ; response = new HashSet < RealmGroup > ( groups . length ) ; for ( String current : groups ) { <START_BUG> response . add ( new RealmGroup ( current ) ) ; <END_BUG> } return response ; } } ; } }

Fix:
response . add ( new RealmGroup ( getRealmName ( ) , current ) ) ;
Buggy code:
public final class TimeSeriesTableViewer extends TableViewer { public enum ScrollDataMode { FOCUS_CELL , SELECTED_ROWS ; } private final Table _table ; private SparklineScrollBar _scroll ; private TimeSeriesEditingSupport _editingSupport ; private LocalDateFormat _dateFormat = new LocalDateFormat ( DateTimeFormat . shortDate ( ) ) ; private NumberFormat _numberFormat = NumberFormat . getNumberInstance ( ) ; private TimeSeriesTableViewer . ScrollDataMode _scrollDataMode = TimeSeriesTableViewer . ScrollDataMode . FOCUS_CELL ; private TimeSeriesTableViewer ( Table table ) { } TimeSeriesEditingSupport getEditingSupport ( ) { } public void setEditingSupport ( TimeSeriesEditingSupport editingSupport ) { } public void setDateFormat ( LocalDateFormat format ) { } NumberFormat getNumberFormat ( ) { } public void setNumberFormat ( NumberFormat format ) { } public void setScrollDataMode ( TimeSeriesTableViewer . ScrollDataMode mode ) { } public static TimeSeriesTableViewer newTimeSeriesTable ( Composite parent ) { } @ Override protected void internalRefresh ( Object element , boolean updateLabels ) { } @ Override protected void assertContentProviderType ( IContentProvider provider ) { } private void register ( SparklineScrollBar scroll ) { } private void hook ( ) { } private void release ( ) { } private int _scrollEventId = 0 ; private void handleSelection ( Event e ) { } private final CellNavigationStrategy _navigationStrategy = new CellNavigationStrategy ( ) ; private void handleKeyPressed ( Event e ) { } private boolean _updateThumb = true ; private void handleResize ( ) { } private void handlePaint ( ) { if ( ! ( _updateThumb ) ) return ; final Rectangle rect = _table . getVisibleScrollableCells ( ) ; <START_BUG> final int max = ( ( _scroll . getMaximum ( ) ) - ( _scroll . getMinimum ( ) ) ) - 1 ; <END_BUG> final int tWidth = Math . min ( Math . max ( 1 , rect . width ) , max ) ; _scroll . setThumb ( tWidth ) ; _scroll . setEnabled ( ( tWidth != max ) ) ; } private boolean _mouseActive = false ; private void handleMouseDown ( Event e ) { } private void handleMouseMove ( ) { } private void handleMouseUp ( Event e ) { } private void updateHighlights ( ) { } private void updateData ( ) { } private final class PeriodLabelProvider extends CellLabelProvider { private final TimeSeriesContentProvider _base ; public PeriodLabelProvider ( TimeSeriesContentProvider base ) { } @ Override public void update ( ViewerCell cell ) { } } private final Listener _listener = new Listener ( ) { @ Override public void handleEvent ( Event event ) { } } ; }

Fix:
final int max = ( ( _scroll . getMaximum ( ) ) - ( _scroll . getMinimum ( ) ) ) + 1 ;
Buggy code:
@ Test ( groups = "live" , singleThreaded = true , testName = "CreateAndInstallVmLiveTest" ) public class CreateAndInstallVmLiveTest extends BaseVirtualBoxClientLiveTest { Map < OsFamily , Map < String , String > > map = new BaseComputeServiceContextModule ( ) { } . provideOsVersionMap ( new ComputeServiceConstants . ReferenceData ( ) , Guice . createInjector ( new GsonModule ( ) ) . getInstance ( Json . class ) ) ; private String vmId = "jclouds-image-iso-1" ; private String osTypeId = "" ; private String ideControllerName = "IDE<seq2seq4repair_space>Controller" ; private String guestId = "guest" ; private String hostId = "host" ; private String vmName = "jclouds-image-virtualbox-iso-to-machine-test" ; @ BeforeGroups ( groups = { "live" } ) public void setUp ( ) throws Exception { } public void testCreateImageMachineFromIso ( ) throws Exception { VirtualBoxManager manager = ( ( VirtualBoxManager ) ( context . getProviderSpecificContext ( ) . getApi ( ) ) ) ; ComputeServiceContext localHostContext = computeServiceForLocalhostAndGuest ( hostId , "localhost" , guestId , "localhost" , new Credentials ( "toor" , "password" ) ) ; Predicate < IPSocket > socketTester = new org . jclouds . predicates . RetryablePredicate < IPSocket > ( new InetSocketAddressConnect ( ) , 10 , 1 , TimeUnit . SECONDS ) ; String workingDir = PropertyUtils . getWorkingDirFromProperty ( ) ; StorageController ideController = StorageController . builder ( ) . name ( ideControllerName ) . bus ( IDE ) . attachISO ( 0 , 0 , ( workingDir + "//ubuntu-11.04-server-i386.iso" ) ) . attachHardDisk ( 0 , 1 , ( workingDir + "//testadmin.vdi" ) ) . attachISO ( 1 , 1 , ( workingDir + "//VBoxGuestAdditions_4.1.2.iso" ) ) . build ( ) ; <START_BUG> VmSpec vmSpecification = VmSpec . builder ( ) . id ( vmId ) . name ( vmName ) . osTypeId ( osTypeId ) . controller ( ideController ) . forceOverwrite ( true ) . natNetworkAdapter ( 0 , NatAdapter . builder ( ) . tcpRedirectRule ( "127.0.0.1" , 2222 , "" , 22 ) . build ( ) ) . build ( ) ; <END_BUG> IMachine imageMachine = new CreateAndInstallVm ( manager , guestId , localHostContext , hostId , socketTester , "127.0.0.1" , 8080 , HEADLESS ) . apply ( vmSpecification ) ; IMachineToImage iMachineToImage = new IMachineToImage ( manager , map ) ; Image newImage = iMachineToImage . apply ( imageMachine ) ; Set < ? extends Image > images = context . getComputeService ( ) . listImages ( ) ; Iterable < String > imageIds = Iterables . transform ( images , extractId ( ) ) ; assertTrue ( Iterables . any ( imageIds , Predicates . equalTo ( newImage . getId ( ) ) ) ) ; } private Function < Image , String > extractId ( ) { } }

Fix:
VmSpec vmSpecification = VmSpec . builder ( ) . id ( vmId ) . name ( vmName ) . memoryMB ( 512 ) . osTypeId ( osTypeId ) . controller ( ideController ) . forceOverwrite ( true ) . natNetworkAdapter ( 0 , NatAdapter . builder ( ) . tcpRedirectRule ( "127.0.0.1" , 2222 , "" , 22 ) . build ( ) ) . build ( ) ;
Buggy code:
public class CompositeKey implements WritableComparable < CompositeKey > { private String key ; private int index ; public CompositeKey ( ) { } public CompositeKey ( String key , int index ) { } @ Override public int compareTo ( CompositeKey o ) { } @ Override public void write ( DataOutput out ) throws IOException { } @ Override public void readFields ( DataInput in ) throws IOException { } @ Override public String toString ( ) { <START_BUG> return String . format ( "%s\t%s" , key , index ) ; <END_BUG> } public String getKey ( ) { } public void setKey ( String key ) { } public int getIndex ( ) { } public void setIndex ( int index ) { } }

Fix:
return String . format ( "%s:%s" , key , index ) ;
Buggy code:
public class PackageTest extends TestCase { public PackageTest ( String name ) { } public void testAdd1 ( ) throws Exception { } public void testEqualsAndHashCode1 ( ) throws Exception { } public void testAddObjectAndTree ( ) throws Exception { } public void testEqualsAndHashCode2 ( ) throws Exception { } public void testSearch ( ) throws Exception { ListedHashTree tree = new ListedHashTree ( ) ; <START_BUG> SearchByClass searcher = new SearchByClass ( Integer . class ) ; <END_BUG> String one = "one" ; String two = "two" ; Integer o = new Integer ( 1 ) ; tree . add ( one , o ) ; tree . getTree ( one ) . add ( o , two ) ; tree . traverse ( searcher ) ; assertEquals ( 1 , searcher . getSearchResults ( ) . size ( ) ) ; } }

Fix:
SearchByClass < Integer > searcher = new SearchByClass < Integer > ( Integer . class ) ;
Buggy code:
public class TestBean { private Double x = Double . valueOf ( 1.0 ) ; private String y = "1.0" ; public Double getX ( ) { } public String getY ( ) { } public void setX ( Double double1 ) { } public void setY ( String string ) { } public Double getZ ( ) { <START_BUG> throw new MathRuntimeException ( "?" ) ; <END_BUG> } public void setZ ( Double double1 ) { } }

Fix:
throw new org . apache . commons . math . MathRuntimeException ( LocalizedFormats . SIMPLE_MESSAGE , "?" ) ;
Buggy code:
public class AvgOrigDistanceReduceTask implements ReduceTask { @ Override public void close ( ) throws TwisterException { } @ Override public void configure ( JobConf jobConf , ReducerConf reducerConf ) throws TwisterException { } @ Override public void reduce ( ReduceOutputCollector collector , Key key , List < Value > values ) throws TwisterException { double average = 0 ; double avgSquare = 0 ; double maxDelta = 0.0 ; long pairCount = 0 ; long missingDistCount = 0 ; double [ ] averages ; for ( Value val : values ) { averages = ( ( DoubleArray ) ( val ) ) . getData ( ) ; average += averages [ 0 ] ; avgSquare += averages [ 1 ] ; if ( maxDelta < ( averages [ 2 ] ) ) { maxDelta = averages [ 2 ] ; } pairCount += ( ( long ) ( averages [ 3 ] ) ) ; missingDistCount += ( ( long ) ( averages [ 4 ] ) ) ; } double [ ] avgs = new double [ 5 ] ; avgs [ 0 ] = average ; avgs [ 1 ] = avgSquare ; avgs [ 2 ] = maxDelta ; avgs [ 3 ] = pairCount ; <START_BUG> avgs [ 3 ] = missingDistCount ; <END_BUG> collector . collect ( new IntKey ( 0 ) , new DoubleArray ( avgs , avgs . length ) ) ; } }

Fix:
avgs [ 4 ] = missingDistCount ;