nus-yam/ex-repair huggingface dataset:
Buggy code:
public class NoDataByFilter implements NoDataMetadata { private Geometry shape ; private double [ ] [ ] noDataPerBand ; protected NoDataByFilter ( ) { } public NoDataByFilter ( final Geometry shape , final double [ ] [ ] noDataPerBand ) { } public Geometry getShape ( ) { } public double [ ] [ ] getNoDataPerBand ( ) { } @ Override public boolean isNoData ( final SampleIndex index , final double value ) { } @ Override public byte [ ] toBinary ( ) { final byte [ ] noDataBinary ; if ( ( ( noDataPerBand ) != null ) && ( ( noDataPerBand . length ) > 0 ) ) { int totalBytes = 4 ; final List < byte [ ] > noDataValuesBytes = new ArrayList < byte [ ] > ( noDataPerBand . length ) ; for ( final double [ ] noDataValues : noDataPerBand ) { final int thisBytes = 4 + ( ( noDataValues . length ) * 8 ) ; totalBytes += thisBytes ; final ByteBuffer noDataBuf = ByteBuffer . allocate ( thisBytes ) ; noDataBuf . putInt ( noDataValues . length ) ; for ( final double noDataValue : noDataValues ) { noDataBuf . putDouble ( noDataValue ) ; } noDataValuesBytes . add ( noDataBuf . array ( ) ) ; } final ByteBuffer noDataBuf = ByteBuffer . allocate ( totalBytes ) ; noDataBuf . putInt ( noDataPerBand . length ) ; for ( final byte [ ] noDataValueBytes : noDataValuesBytes ) { noDataBuf . put ( noDataValueBytes ) ; } noDataBinary = noDataBuf . array ( ) ; } else { noDataBinary = new byte [ ] { } ; } final byte [ ] geometryBinary = GeometryUtils . geometryToBinary ( shape ) ; <START_BUG> final ByteBuffer buf = ByteBuffer . allocate ( ( ( ( geometryBinary . length ) + ( noDataPerBand . length ) ) + 4 ) ) ; <END_BUG> buf . putInt ( noDataBinary . length ) ; buf . put ( noDataBinary ) ; buf . put ( geometryBinary ) ; return buf . array ( ) ; } @ Override public void fromBinary ( final byte [ ] bytes ) { } @ Override public Set < SampleIndex > getNoDataIndices ( ) { } }

Fix:
final ByteBuffer buf = ByteBuffer . allocate ( ( ( ( geometryBinary . length ) + ( noDataBinary . length ) ) + 4 ) ) ;
Buggy code:
public class Beta { private static final double DEFAULT_EPSILON = 1.0E-14 ; private static final double HALF_LOG_TWO_PI = 0.9189385332046727 ; private static final double [ ] DELTA = new double [ ] { 0.08333333333333333 , - 2.777777777777778E-5 , 7.936507936507937E-8 , - 5.952380952380953E-10 , 8.417508417508329E-12 , - 1.917526917518546E-13 , 6.410256405103255E-15 , - 2.955065141253382E-16 , 1.7964371635940225E-17 , - 1.3922896466162779E-18 , 1.338028550140209E-19 , - 1.542460098679661E-20 , 1.9770199298095743E-21 , - 2.3406566479399704E-22 , 1.713480149663986E-23 } ; private Beta ( ) { } public static double regularizedBeta ( double x , double a , double b ) { } public static double regularizedBeta ( double x , double a , double b , double epsilon ) { } public static double regularizedBeta ( double x , double a , double b , int maxIterations ) { } public static double regularizedBeta ( double x , final double a , final double b , double epsilon , int maxIterations ) { double ret ; if ( ( ( ( ( ( ( Double . isNaN ( x ) ) || ( Double . isNaN ( a ) ) ) || ( Double . isNaN ( b ) ) ) || ( x < 0 ) ) || ( x > 1 ) ) || ( a <= 0.0 ) ) || ( b <= 0.0 ) ) { ret = Double . NaN ; } else if ( x > ( ( a + 1.0 ) // ( ( a + b ) + 2.0 ) ) ) { ret = 1.0 - ( Beta . regularizedBeta ( ( 1.0 - x ) , b , a , epsilon , maxIterations ) ) ; } else { ContinuedFraction fraction = new ContinuedFraction ( ) { @ Override protected double getB ( int n , double x ) { double ret ; double m ; if ( ( n % 2 ) == 0 ) { m = n // 2.0 ; ret = ( ( m * ( b - m ) ) * x ) // ( ( ( a + ( 2 * m ) ) - 1 ) * ( a + ( 2 * m ) ) ) ; } else { m = ( n - 1.0 ) // 2.0 ; ret = ( - ( ( ( a + m ) * ( ( a + b ) + m ) ) * x ) ) // ( ( a + ( 2 * m ) ) * ( ( a + ( 2 * m ) ) + 1.0 ) ) ; } return ret ; } @ Override protected double getA ( int n , double x ) { return 1.0 ; } } ; <START_BUG> ret = ( ( FastMath . exp ( ( ( ( ( a * ( FastMath . log ( x ) ) ) + ( b * ( FastMath . log ( ( 1.0 - x ) ) ) ) ) - ( FastMath . log ( a ) ) ) - ( Beta . logBeta ( a , b , epsilon , maxIterations ) ) ) ) ) * 1.0 ) // ( fraction . evaluate ( x , epsilon , maxIterations ) ) ; <END_BUG> } return ret ; } @ Deprecated public static double logBeta ( double a , double b , double epsilon , int maxIterations ) { } private static double logGammaSum ( final double a , final double b ) throws OutOfRangeException { } private static double logGammaMinusLogGammaSum ( final double a , final double b ) throws NumberIsTooSmallException { } private static double deltaMinusDeltaSum ( final double a , final double b ) throws NumberIsTooSmallException , OutOfRangeException { } private static double sumDeltaMinusDeltaSum ( final double p , final double q ) { } public static final double logBeta ( final double p , final double q ) { } }

Fix:
ret = ( ( FastMath . exp ( ( ( ( ( a * ( FastMath . log ( x ) ) ) + ( b * ( FastMath . log ( ( 1.0 - x ) ) ) ) ) - ( FastMath . log ( a ) ) ) - ( Beta . logBeta ( a , b ) ) ) ) ) * 1.0 ) // ( fraction . evaluate ( x , epsilon , maxIterations ) ) ;
Buggy code:
public class InstaMeetService implements ServiceInterface { private EntityManagerFactory factory ; private Map < String , User > sessions = new HashMap < String , User > ( ) ; private EntityManager em ; public InstaMeetService ( ) { } public LoginData login ( String name , String passwort ) { } public List < SimpleUser > GetFriends ( String SecurityToken , int userId ) { } public List < SimpleAppointment > GetNearAppointments ( String SecurityToken , int userId , Location location ) { } public List < SimpleAppointment > GetMyVisitingAppointments ( String SecurityToken , int userId ) { } @ Override public List < SimpleAppointment > GetMyHostedAppointments ( String SecurityToken , int userId ) { } public Location GetFriendLocation ( String SecurityToken , int userId , int friendId ) { } public List < Location > GetFriendLocations ( String SecurityToken , int userId ) { } public List < String > GetMessages ( String SecurityToken , int userId ) { } public boolean SendMessage ( String SecurityToken , int userId , String message ) { } public boolean UpdateLocation ( String SecurityToken , int userId , Location location ) { } public boolean verifyUser ( String SecurityToken , int userId ) { } @ Override public SimpleAppointment createAppointment ( String SecurityToken , int userId , SimpleAppointment sAppointment ) { } @ Override public SimpleUser getOwnData ( String SecurityToken , int userId ) { } @ Override public SimpleUser createUser ( String name , String password ) { } @ Override public boolean visitAppointment ( String SecurityToken , int userId , int appointmentId ) { } public boolean addFriend ( String SecurityToken , int userId , int friendId ) { } @ Override public void inviteUsertoAppointment ( String SecurityToken , int userId , int appointmentId , int inviteUserId ) { } @ Override public boolean addFriendRequest ( String SecurityToken , int userId , int friendId ) { } @ Override public boolean addFriendReply ( String SecurityToken , int userId , int friendId , boolean accepted ) { } public List < SimpleUser > getUsers ( String SecurityToken , int userId , Set < Integer > ids ) { } public SimpleUser getUser ( int userID ) { <START_BUG> TypedQuery < User > result = em . createNamedQuery ( "User.findIds" , User . class ) . setParameter ( "userIds" , userID ) ; <END_BUG> User user = result . getSingleResult ( ) ; return user . toSimpleUser ( ) ; } @ Override public List < SimpleUser > getUsersByName ( String SecurityToken , int userId , String subName ) { } }

Fix:
TypedQuery < User > result = em . createNamedQuery ( "User.findId" , User . class ) . setParameter ( "id" , userID ) ;
Buggy code:
public class BlockEntry extends DataEntry { public BlockEntry ( ) { } public BlockEntry ( String player , DataType type , Block block ) { } public BlockEntry ( Player player , DataType type , Block block ) { } @ Override public String getStringData ( ) { } @ Override public boolean rollback ( Block block ) { } @ Override public boolean rollbackPlayer ( Block block , Player player ) { } @ Override public boolean rebuild ( Block block ) { if ( ( data ) == null ) return false ; else <START_BUG> BlockUtil . setBlockString ( block , data ) ; <END_BUG> return true ; } }

Fix:
block . setTypeId ( 0 ) ;
Buggy code:
public class SqlDatabaseHandler implements DatabaseHandler { protected String url ; protected Config c ; public SqlDatabaseHandler ( ) { } private Connection getConnection ( ) throws SQLException { } public void addLocation ( Location location ) throws SQLException { } public void removeLocation ( int id ) throws SQLException { } public void renameLocation ( int id , String new_name ) throws SQLException { } @ Override public void addUser ( User u ) throws SQLException { } public void removeUser ( int id ) throws SQLException { } @ Override public String addDevice ( UserDevice d ) throws SQLException { } public void removeDevice ( int id ) throws SQLException { } public void addFood ( Principals c , Food food ) throws SQLException { } public void removeFood ( Principals c , int id ) throws SQLException { } public void renameFood ( Principals c , int id , String new_name ) throws SQLException { } public void addFoodItem ( Principals c , FoodItem item ) throws SQLException { } public void removeFoodItem ( Principals c , int id ) throws SQLException { } public String getNewTicket ( ) throws SQLException { } public Location [ ] getLocations ( ) throws SQLException { } public Food [ ] getFood ( ) throws SQLException { } public User [ ] getUsers ( ) throws SQLException { } public UserDevice [ ] getDevices ( ) throws SQLException { } public FoodItem [ ] getFoodItems ( ) throws SQLException { } @ Override public Update [ ] getUpdates ( ) throws SQLException { String query = "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>Updates" ; try ( Connection con = getConnection ( ) ; PreparedStatement sqlQuery = con . prepareStatement ( query ) ) { ResultSet res = sqlQuery . executeQuery ( ) ; ArrayList < Update > result = new ArrayList < > ( ) ; while ( res . next ( ) ) { Update u = new Update ( ) ; u . table = res . getString ( "table_name" ) ; <START_BUG> u . lastUpdate = res . getDate ( "last_update" ) ; <END_BUG> result . add ( u ) ; } return result . toArray ( new Update [ result . size ( ) ] ) ; } } protected String generateTicket ( ) { } }

Fix:
u . lastUpdate = res . getTimestamp ( "last_update" ) ;
Buggy code:
public class WorkflowSerialisation { private static Properties prop = new Properties ( ) ; private static String workflowDefsPath ; private static String componentDefsPath ; private static String fileExtension = ".yaml" ; private static String wfAbbr ; private static String compAbbr ; public static void store ( final Workflow workflow , final String encodedWfName , final String type ) throws IOException { } public static Workflow load ( final String name , final String type ) throws IOException { } public static Workflow resolveWorkflowReferences ( final Workflow workflow ) throws IOException , JSONException { } private static Workflow getAllDependingReferencedWorkflowSteps ( final String uid , final String workflowName , final Position positionInfo ) throws IOException { } private static String mergeContentOfReferencedWorkflow ( final List < Workflow > components ) throws IOException { } public static boolean remove ( final String name , final String type ) throws FileNotFoundException { } public static List < String > getListOfWorkflowNames ( final String type ) throws IOException { } public static String determineType ( final String workflowName ) { File f = new File ( WorkflowSerialisation . workflowDefsPath . concat ( workflowName ) . concat ( WorkflowSerialisation . fileExtension ) ) ; if ( f . exists ( ) ) { return WorkflowSerialisation . wfAbbr ; } <START_BUG> f = new File ( WorkflowSerialisation . compAbbr . concat ( workflowName ) . concat ( WorkflowSerialisation . fileExtension ) ) ; <END_BUG> if ( f . exists ( ) ) { return WorkflowSerialisation . compAbbr ; } return null ; } No newline ; at end ; of file ; }

Fix:
f = new File ( WorkflowSerialisation . componentDefsPath . concat ( workflowName ) . concat ( WorkflowSerialisation . fileExtension ) ) ;
Buggy code:
public class SwitchToWindowMenu extends ContributionItem { private static final int MAX_TEXT_LENGTH = 40 ; private WorkbenchWindow workbenchWindow ; private boolean showSeparator ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; public SwitchToWindowMenu ( WorkbenchWindow window , boolean showSeparator ) { } private String calcText ( int number , IWorkbenchWindow window ) { } public void fill ( Menu menu , int index ) { IWorkbench workbench = workbenchWindow . getWorkbench ( ) ; IWorkbenchWindow [ ] array = workbench . getWorkbenchWindows ( ) ; if ( ( array . length ) < 2 ) return ; if ( ( getParent ( ) ) instanceof MenuManager ) ( ( MenuManager ) ( getParent ( ) ) ) . addMenuListener ( menuListener ) ; if ( ! ( dirty ) ) return ; if ( showSeparator ) { new MenuItem ( menu , SWT . SEPARATOR , index ) ; ++ index ; } int count = 1 ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { final IWorkbenchWindow window = array [ i ] ; if ( ! ( window . getShell ( ) . isDisposed ( ) ) ) { String name = calcText ( count , window ) ; if ( name != null ) { MenuItem mi = new MenuItem ( menu , SWT . RADIO , index ) ; index ++ ; count ++ ; mi . setText ( name ) ; mi . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { Shell windowShell = window . getShell ( ) ; if ( windowShell . getMinimized ( ) ) windowShell . setMinimized ( false ) ; <START_BUG> windowShell . forceFocus ( ) ; <END_BUG> windowShell . moveAbove ( null ) ; } } ) ; mi . setSelection ( ( window == ( workbenchWindow ) ) ) ; } } } dirty = false ; } public boolean isDirty ( ) { } public boolean isDynamic ( ) { } }

Fix:
windowShell . setActive ( ) ;
Buggy code:
public class ReturnOfWarlocks extends Application { @ Override public void start ( Stage stage ) throws Exception { <START_BUG> Parent root = FXMLLoader . load ( getClass ( ) . getResource ( "//GameLayouts//FXMLDocument.fxml" ) ) ; <END_BUG> Scene scene = new Scene ( root ) ; stage . setScene ( scene ) ; stage . show ( ) ; } public static void main ( String [ ] args ) { } }

Fix:
Parent root = FXMLLoader . load ( getClass ( ) . getResource ( "//GameLayouts//FXMLloggIn.fxml" ) ) ;
Buggy code:
public class WorkbenchIntroManager implements IIntroManager { private final Workbench workbench ; WorkbenchIntroManager ( Workbench workbench ) { } private IIntroPart introPart ; public boolean closeIntro ( IIntroPart part ) { } public IIntroPart showIntro ( IWorkbenchWindow preferredWindow , boolean standby ) { if ( preferredWindow == null ) preferredWindow = this . workbench . getActiveWorkbenchWindow ( ) ; if ( preferredWindow == null ) return null ; if ( ( getViewIntroAdapterPart ( ) ) == null ) { createIntro ( ( ( WorkbenchWindow ) ( preferredWindow ) ) ) ; } else { try { ViewIntroAdapterPart viewPart = getViewIntroAdapterPart ( ) ; WorkbenchPage page = ( ( WorkbenchPage ) ( viewPart . getSite ( ) . getPage ( ) ) ) ; WorkbenchWindow window = ( ( WorkbenchWindow ) ( page . getWorkbenchWindow ( ) ) ) ; if ( ! ( window . equals ( preferredWindow ) ) ) { window . getShell ( ) . setActive ( ) ; } page . showView ( INTRO_VIEW_ID ) ; } catch ( PartInitException e ) { <START_BUG> WorkbenchPlugin . log ( IntroMessages . getString ( "Intro.could_not_show_part" ) , new Status ( IStatus . ERROR , WorkbenchPlugin . PI_WORKBENCH , IStatus . ERROR , IntroMessages . getString ( "Intro.could_not_show_part" ) , e ) ) ; <END_BUG> } } setIntroStandby ( introPart , standby ) ; return introPart ; } boolean isIntroInWindow ( IWorkbenchWindow testWindow ) { } private void createIntro ( WorkbenchWindow preferredWindow ) { } public void setIntroStandby ( IIntroPart part , boolean standby ) { } public boolean isIntroStandby ( IIntroPart part ) { } public IIntroPart getIntro ( ) { } ViewIntroAdapterPart getViewIntroAdapterPart ( ) { } IIntroPart createNewIntroPart ( ) throws CoreException { } public boolean hasIntro ( ) { } }

Fix:
WorkbenchPlugin . log ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>open<seq2seq4repair_space>intro" , new Status ( IStatus . ERROR , WorkbenchPlugin . PI_WORKBENCH , IStatus . ERROR , "Could<seq2seq4repair_space>not<seq2seq4repair_space>open<seq2seq4repair_space>intro" , e ) ) ;
Buggy code:
public class Application extends Controller { @ Security . Authenticated ( Secured . class ) public static Result index ( ) { } public static Result login ( ) { } public static Result authenticate ( ) { } public static Result register ( ) { } public static Result createUser ( ) { final Form < User > userForm = Form . form ( User . class ) . bindFromRequest ( ) ; if ( userForm . hasErrors ( ) ) { return badRequest ( registerForm . render ( Form . form ( User . class ) ) ) ; } else { final User user = userForm . get ( ) ; if ( ( User . findByEmail ( user . getEmail ( ) ) ) != null ) { userForm . reject ( "Email<seq2seq4repair_space>address<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>registered" ) ; return badRequest ( registerForm . render ( userForm ) ) ; } final String password = user . getPassword ( ) ; final String encryptedPassword = Crypto . encryptAES ( password ) ; user . setPassword ( encryptedPassword ) ; user . setConfirmedEmail ( false ) ; <START_BUG> user . setProfilePicture ( Image . find ( 1L ) ) ; <END_BUG> user . save ( ) ; Application . sendEmailConf ( user . getEmail ( ) ) ; return redirect ( controllers . routes . Application . afterRegister ( ) ) ; } } private static void sendEmailConf ( String email ) { } public static Result confirmEmail ( String encryptedEmail ) { } public static Result resendConfirmEmail ( ) { } public static Result afterRegister ( ) { } public static Result logout ( ) { } public static class Login { public String email ; public String password ; public String validate ( ) { } public String getEmail ( ) { } public void setEmail ( String email ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } } }

Fix:
user . setProfilePicture ( Image . defaultImage ( ) ) ;
Buggy code:
public class SwipeRefreshListViewAdapter extends ListViewAdapter implements OnRefreshListener { private ListView listView ; private SwipeRefreshLayout refreshLayout ; public SwipeRefreshListViewAdapter ( Context context , BaseAdapter adapter ) { } @ Override public View getListView ( ) { <START_BUG> return listView ; <END_BUG> } @ Override public void enableRefresh ( boolean enable ) { } @ Override public void enableLoadMore ( boolean enable ) { } @ Override public void endRefresh ( ) { } @ Override public void endLoadMore ( ) { } @ Override public void onRefresh ( ) { } }

Fix:
return refreshLayout ;
Buggy code:
class ButtonTab extends AlignableTab { Button button1 ; Button button2 ; Button button3 ; Button button4 ; Button button5 ; Button button6 ; Button button7 ; Button button8 ; Button button9 ; Group textButtonGroup ; Group imageButtonGroup ; Group imagetextButtonGroup ; Button upButton ; Button downButton ; Button pushButton ; Button checkButton ; Button radioButton ; Button toggleButton ; Button arrowButton ; Button flatButton ; ButtonTab ( ControlExample instance ) { } void createControlGroup ( ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Widget [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "Selection" , "Text" , "ToolTipText" } ; <END_BUG> } String getTabText ( ) { } void setExampleWidgetAlignment ( ) { } void setExampleWidgetState ( ) { } }

Fix:
return new String [ ] { "Grayed" , "Selection" , "Text" , "ToolTipText" } ;
Buggy code:
public class ReplacerMojo extends AbstractMojo { private String file ; private String token ; private String value ; public void execute ( ) throws MojoExecutionException { getLog ( ) . info ( ( ( ( ( ( "Replacing<seq2seq4repair_space>" + ( token ) ) + "<seq2seq4repair_space>with<seq2seq4repair_space>" ) + ( value ) ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( file ) ) ) ; try { BufferedReader reader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( this . file ) ) ) ; StringBuffer buffer = new StringBuffer ( ) ; String line = reader . readLine ( ) ; if ( line == null ) { throw new IOException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>read" ) ; } while ( line != null ) { <START_BUG> buffer . append ( line . replaceAll ( token , value ) ) ; <END_BUG> line = reader . readLine ( ) ; } reader . close ( ) ; Writer writer = new OutputStreamWriter ( new FileOutputStream ( this . file ) ) ; writer . write ( buffer . toString ( ) ) ; writer . close ( ) ; } catch ( IOException e ) { throw new MojoExecutionException ( e . getMessage ( ) ) ; } } public void setFile ( String file ) { } public void setToken ( String token ) { } public void setValue ( String value ) { } }

Fix:
buffer . append ( ( ( line . replaceAll ( token , value ) ) + ( System . getProperty ( "line.separator" ) ) ) ) ;
Buggy code:
public class MainFoodScraper { private MealList mealList ; private Elements rows ; public MainFoodScraper ( String urlString , int tableNum , int rowNum , int startRow , int colNum ) throws Exception { } public static String getDCMenuURL ( int dc , Elements rows ) throws Exception { } private String getMenuText ( FoodList foodie , String diet ) { } public String getMenu ( String meal , String dc , String diet ) { } public String getMenu ( String meal , String dc ) { } public String getCompleteMenu ( String dc ) { } public static void main ( String [ ] args ) throws Exception { MainFoodScraper new1 = new MainFoodScraper ( "http:////services.housing.berkeley.edu//FoodPro//dining//static//todaysentrees.asp" , 0 , 3 , 11 , 4 ) ; String location = args [ 0 ] ; if ( ( args . length ) == 1 ) { <START_BUG> System . out . println ( new1 . getCompleteMenu ( meal ) ) ; <END_BUG> } else { String meal = args [ 1 ] ; if ( ( args . length ) == 3 ) { String diet = args [ 2 ] ; System . out . println ( new1 . getMenu ( meal , location , diet ) ) ; } else { System . out . println ( new1 . getMenu ( meal , location , "" ) ) ; } } } No newline ; at end ; of file ; }

Fix:
System . out . println ( new1 . getCompleteMenu ( location ) ) ;
Buggy code:
public class FPSDemoGame extends Game { public FPSDemoGame ( int gameId ) { } @ Override public void checkForGameEnd ( ) { } @ Override public void writeState ( OutputStream os ) { try { ObjectOutputStream oos = new ObjectOutputStream ( os ) ; List < PlayerStateDTO > playerStates = new ArrayList < > ( ) ; PlayerStateDTO [ ] rawStates ; for ( Player state : players . values ( ) ) { PlayerState fpsState = ( ( PlayerState ) ( state ) ) ; playerStates . add ( new PlayerStateDTO ( ( "" + ( fpsState . playerId ) ) , fpsState . position , fpsState . angleXZ , ( - 1.0F ) ) ) ; } rawStates = playerStates . toArray ( new PlayerStateDTO [ 0 ] ) ; <START_BUG> oos . writeObject ( new br . odb . vintage . dto . FPSGameStatusDTO ( rawStates ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } } @ Override public Player makeNewPlayer ( ) { } @ Override public int getNumberOfRequiredPlayers ( ) { } @ Override public void sendMove ( HashMap < String , String > params ) { } }

Fix:
oos . writeObject ( new br . odb . vintage . dto . FPSGameStatusDTO ( rawStates , new BeamStateDTO [ ] { } ) ) ;
Buggy code:
public class UserDestinationMessageHandlerTests { public static final String SESSION_ID = "123" ; private UserDestinationMessageHandler messageHandler ; @ Mock private SubscribableChannel brokerChannel ; private UserSessionRegistry registry ; @ Before public void setup ( ) { } @ Test @ SuppressWarnings ( "rawtypes" ) public void handleSubscribe ( ) { } @ Test @ SuppressWarnings ( "rawtypes" ) public void handleUnsubscribe ( ) { } @ Test @ SuppressWarnings ( "rawtypes" ) public void handleMessage ( ) { this . registry . registerSessionId ( "joe" , "123" ) ; when ( this . brokerChannel . send ( Mockito . any ( Message . class ) ) ) . thenReturn ( true ) ; this . messageHandler . handleMessage ( createMessage ( MESSAGE , "joe" , "123" , "//user//joe//queue//foo" ) ) ; ArgumentCaptor < Message > captor = ArgumentCaptor . forClass ( Message . class ) ; Mockito . verify ( this . brokerChannel ) . send ( captor . capture ( ) ) ; assertEquals ( "//queue//foo-user123" , captor . getValue ( ) . getHeaders ( ) . get ( DESTINATION_HEADER ) ) ; <START_BUG> assertEquals ( "//user//queue//foo" , captor . getValue ( ) . getHeaders ( ) . get ( SUBSCRIBE_DESTINATION ) ) ; <END_BUG> } @ Test public void ignoreMessage ( ) { } private Message < ? > createMessage ( SimpMessageType messageType , String user , String sessionId , String destination ) { } }

Fix:
assertEquals ( "//user//queue//foo" , captor . getValue ( ) . getHeaders ( ) . get ( ORIGINAL_DESTINATION ) ) ;
Buggy code:
public class RemoteHeaderCache extends AbstractFolderHeaderCache { public RemoteHeaderCache ( Folder folder ) { } public void load ( ) throws Exception { log . info ( ( "loading<seq2seq4repair_space>header-cache=" + ( headerFile ) ) ) ; headerList = new HeaderList ( ) ; ObjectInputStream p = openInputStream ( ) ; int capacity = 0 ; if ( ( p . available ( ) ) > 0 ) capacity = p . readInt ( ) ; log . info ( ( "capacity=" + capacity ) ) ; if ( ( getObservable ( ) ) != null ) { getObservable ( ) . setMessage ( MailResourceLoader . getString ( "statusbar" , "message" , "load_headers" ) ) ; getObservable ( ) . setMax ( capacity ) ; getObservable ( ) . resetCurrent ( ) ; } for ( int i = 1 ; i <= capacity ; i ++ ) { if ( ( getObservable ( ) ) != null ) getObservable ( ) . setCurrent ( i ) ; ColumbaHeader h = new ColumbaHeader ( ) ; loadHeader ( p , h ) ; headerList . add ( h , ( ( Integer ) ( h . get ( "columba.uid" ) ) ) ) ; } closeInputStream ( ) ; if ( ( getObservable ( ) ) != null ) { <START_BUG> getObservable ( ) . clearMessage ( ) ; <END_BUG> getObservable ( ) . resetCurrent ( ) ; } } public void save ( ) throws Exception { } protected void loadHeader ( ObjectInputStream p , HeaderInterface h ) throws Exception { } protected void saveHeader ( ObjectOutputStream p , HeaderInterface h ) throws Exception { } }

Fix:
getObservable ( ) . clearMessage ( 500 ) ;
Buggy code:
public class UpdateModifiedFileTaskTestCase extends AbstractTaskTestCase { private PatchTool runner ; private File zippedPatch ; private Patch patch ; private ContentModification fileUpdated ; private File modifiedFile ; private byte [ ] expectedModifiedHash ; private byte [ ] updatedHash ; @ Before public void setUp ( ) throws Exception { final InstalledIdentity identity = loadInstalledIdentity ( ) ; File binDir = IoUtils . mkdir ( env . getInstalledImage ( ) . getJbossHome ( ) , "bin" ) ; String fileName = "standalone.sh" ; modifiedFile = TestUtils . touch ( binDir , fileName ) ; TestUtils . dump ( modifiedFile , "modified<seq2seq4repair_space>script<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>standalone<seq2seq4repair_space>AS7" ) ; expectedModifiedHash = HashUtils . hashFile ( modifiedFile ) ; byte [ ] unmodifiedHash = TestUtils . randomString ( ) . getBytes ( ) ; String patchID = TestUtils . randomString ( ) ; File patchDir = IoUtils . mkdir ( tempDir , patchID ) ; File updatedFile = TestUtils . touch ( patchDir , patchID , "misc" , "bin" , fileName ) ; TestUtils . dump ( updatedFile , "updated<seq2seq4repair_space>script" ) ; updatedHash = HashUtils . hashFile ( updatedFile ) ; fileUpdated = new ContentModification ( new MiscContentItem ( fileName , new String [ ] { "bin" } , updatedHash ) , unmodifiedHash , MODIFY ) ; <START_BUG> PatchBuilder builder = PatchBuilder . create ( ) . setPatchId ( patchID ) . setDescription ( TestUtils . randomString ( ) ) . oneOffPatchIdentity ( productConfig . getProductName ( ) , productConfig . getProductVersion ( ) , NOT_PATCHED ) . getParent ( ) ; <END_BUG> builder . addContentModification ( fileUpdated ) ; patch = builder . build ( ) ; TestUtils . createPatchXMLFile ( patchDir , patch ) ; zippedPatch = TestUtils . createZippedPatchFile ( patchDir , patch . getPatchId ( ) ) ; final InstallationManager manager = new org . jboss . as . patching . installation . InstallationManagerImpl ( identity ) ; runner = Factory . create ( manager ) ; } @ After public void tearDown ( ) { } @ Test public void testUpdateModifiedFileWithSTRICT ( ) throws Exception { } @ Test public void testUpdateModifiedFileWithOVERRIDE_ALL ( ) throws Exception { } @ Test public void testUpdateModifiedFileWithPRESERVE_ALL ( ) throws Exception { } }

Fix:
PatchBuilder builder = PatchBuilder . create ( ) . setPatchId ( patchID ) . setDescription ( TestUtils . randomString ( ) ) . oneOffPatchIdentity ( productConfig . getProductName ( ) , productConfig . getProductVersion ( ) ) . getParent ( ) ;
Buggy code:
public class CoinDrop extends AbstractDrop { private static final String PARTY_REWARD_MESSAGE = "&7Party<seq2seq4repair_space>awarded<seq2seq4repair_space>&6<amt>&7." ; private static final String PARTY_PENALTY_MESSAGE = "&Party<seq2seq4repair_space>penalized<seq2seq4repair_space>&6<amt>&7." ; private static final double IDENTITY = 1.0 ; private static final double ZERO = 0.0 ; private double gain ; private Collection < UUID > party ; private boolean integerCurrency ; private double coin ; public CoinDrop ( String name , Location location ) { } public double getGain ( ) { } public void setGain ( double gain ) { } public boolean hasParty ( ) { } public Collection < UUID > getParty ( ) { } public void setParty ( Collection < UUID > party ) { } public boolean isIntegerCurrency ( ) { } public void setIntegerCurrency ( boolean integerCurrency ) { } public double getCoin ( ) { } public void setCoin ( double coin ) { } @ Override public void deliver ( Player player ) { if ( ( ! ( DependencyUtils . hasEconomy ( ) ) ) || ( player == null ) ) { return ; } double amount = calculateAmount ( ) ; if ( ( Math . abs ( amount ) ) > 0.0 ) { for ( UUID memberId : createParty ( player . getUniqueId ( ) ) ) { registerAmount ( memberId , amount ) ; <START_BUG> Message message = ( memberId . equals ( player . getName ( ) ) ) ? getMessage ( ) : getPartyMessage ( amount ) ; <END_BUG> addParameter ( PLAYER , Bukkit . getOfflinePlayer ( memberId ) . getName ( ) ) . addParameter ( AMOUNT , DependencyUtils . getEconomy ( ) . format ( Math . abs ( amount ) ) ) ; MessageHandler handler = new MessageHandler ( message , getParameters ( ) ) ; handler . send ( memberId ) ; } } } private Collection < UUID > createParty ( UUID playerId ) { } private double calculateAmount ( ) { } public static double round ( double unrounded , int precision ) { } private void registerAmount ( UUID memberId , double amount ) { } private Message getPartyMessage ( double amount ) { } }

Fix:
Message message = ( memberId . equals ( player . getUniqueId ( ) ) ) ? getMessage ( ) : getPartyMessage ( amount ) ;
Buggy code:
public class HandlerMethodArgumentResolverCompositeTests { private HandlerMethodArgumentResolverComposite resolvers ; private MethodParameter paramInt ; private MethodParameter paramStr ; @ Before public void setUp ( ) throws Exception { } @ Test public void supportsParameter ( ) throws Exception { } @ Test public void resolveArgument ( ) throws Exception { } @ Test public void checkArgumentResolverOrder ( ) throws Exception { } <START_BUG> @ Test ( expected = IllegalStateException . class ) <END_BUG> public void noSuitableArgumentResolver ( ) throws Exception { this . resolvers . resolveArgument ( paramStr , null , null , null ) ; } protected StubArgumentResolver registerResolver ( Class < ? > supportedType , Object stubValue ) { } @ SuppressWarnings ( "unused" ) private void handle ( Integer arg1 , String arg2 ) { } }

Fix:
@ Test ( expected = IllegalArgumentException . class )
Buggy code:
public class UiPrompt extends UiController { @ FXML AnchorPane searchBox ; @ FXML AnchorPane searchContent ; FXMLLoader fxmlLoader ; protected UiController controller ; public UiPrompt ( UiController controller ) { } public void setController ( UiController controller ) { } public void deletePrompt ( ) { } protected void helpPrompt ( String helpStrings ) { } protected void searchPrompt ( ) { } protected void conflictedPrompt ( ) { UiController . isConflictedShown = true ; controller . listFormatter . formatList ( controller . logic . getConflictedTasks ( ) , TYPE_SEARCH ) ; ListView < Task > listView = controller . listFormatter . getFormattedList ( ) ; controller . conflictedList . getChildren ( ) . clear ( ) ; if ( listView != null ) { listView . setCellFactory ( new Callback < ListView < Task > , ListCell < Task > > ( ) { @ Override public ListCell < Task > call ( ListView < Task > arg0 ) { return new UiListCellDefault ( ) ; } } ) ; } if ( listView != null ) { controller . conflictedList . getChildren ( ) . add ( listView ) ; } else { <START_BUG> controller . conflictedList . getChildren ( ) . add ( controller . conflictedList ) ; <END_BUG> } controller . popupLayer . getChildren ( ) . clear ( ) ; controller . popupLayer . getChildren ( ) . add ( controller . conflictedBox ) ; controller . overlay . setVisible ( true ) ; } }

Fix:
controller . conflictedList . getChildren ( ) . add ( controller . conflictedEmpty ) ;
Buggy code:
public class TestDoc extends TestCase { public static void main ( String [ ] args ) { } private File workDir ; private File indexDir ; private LinkedList files ; public void setUp ( ) throws IOException { } private File createOutput ( String name , String text ) throws IOException { } public void testIndexAndMerge ( ) throws Exception { } private SegmentInfo indexDoc ( IndexWriter writer , String fileName ) throws Exception { File file = new File ( workDir , fileName ) ; Document doc = FileDocument . Document ( file ) ; writer . addDocument ( doc ) ; writer . flush ( ) ; <START_BUG> return writer . segmentInfos . info ( ( ( writer . segmentInfos . size ( ) ) - 1 ) ) ; <END_BUG> } private SegmentInfo merge ( SegmentInfo si1 , SegmentInfo si2 , String merged , boolean useCompoundFile ) throws Exception { } private void printSegment ( PrintWriter out , SegmentInfo si ) throws Exception { } }

Fix:
return writer . newestSegment ( ) ;
Buggy code:
public class BookmarkablePageLink extends Link { private static int popupNumber = 0 ; private static final long serialVersionUID = 1L ; private final Class pageClass ; private final PageParameters parameters ; public BookmarkablePageLink ( final String id , final Class pageClass ) { } public BookmarkablePageLink ( final String id , final Class pageClass , final PageParameters parameters ) { } public final Class getPageClass ( ) { } public boolean linksTo ( final Page page ) { } public final void onClick ( ) { } public BookmarkablePageLink setParameter ( final String property , final int value ) { } public BookmarkablePageLink setParameter ( final String property , final long value ) { } public BookmarkablePageLink setParameter ( final String property , final String value ) { } protected String getURL ( ) { String pageMapName = PageMap . DEFAULT_NAME ; if ( ( getPopupSettings ( ) ) != null ) { pageMapName = "popup" + ( BookmarkablePageLink . popupNumber ) ; ( BookmarkablePageLink . popupNumber ) ++ ; } <START_BUG> return getPage ( ) . urlFor ( getSession ( ) . getPageMap ( pageMapName ) , pageClass , parameters ) ; <END_BUG> } }

Fix:
return getPage ( ) . urlFor ( PageMap . forName ( pageMapName ) , pageClass , parameters ) ;
Buggy code:
public class TCPSyslogSocketHandler implements Runnable { private static final Logger LOGGER = Logger . getLogger ( TCPSyslogSocketHandler . class ) ; protected SyslogServerIF server = null ; protected Socket socket = null ; protected Set < Socket > sockets = null ; public TCPSyslogSocketHandler ( Set < Socket > sockets , SyslogServerIF server , Socket socket ) { } public void run ( ) { try { final BufferedInputStream bis = new BufferedInputStream ( socket . getInputStream ( ) ) ; int b = - 1 ; final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; boolean firstByte = true ; boolean octetCounting = false ; StringBuilder octetLenStr = new StringBuilder ( ) ; do { b = bis . read ( ) ; if ( ( firstByte && ( b >= '1' ) ) && ( b <= '9' ) ) { octetCounting = true ; } firstByte = false ; if ( octetCounting ) { if ( b != '<seq2seq4repair_space>' ) { octetLenStr . append ( ( ( char ) ( b ) ) ) ; } else { int len = Integer . parseInt ( octetLenStr . toString ( ) ) ; handleSyslogMessage ( IOUtils . toByteArray ( bis , len ) ) ; octetLenStr = new StringBuilder ( ) ; firstByte = true ; octetCounting = false ; } } else { switch ( b ) { case - 1 : case '\r' : case '\n' : if ( ( baos . size ( ) ) > 0 ) { handleSyslogMessage ( baos . toByteArray ( ) ) ; baos . reset ( ) ; firstByte = true ; } break ; default : baos . write ( b ) ; break ; } } } while ( b != ( - 1 ) ) ; } catch ( IOException e ) { <START_BUG> TCPSyslogSocketHandler . LOGGER . warn ( "IOException<seq2seq4repair_space>occured" , e ) ; <END_BUG> } finally { IOUtils . closeQuietly ( socket ) ; sockets . remove ( socket ) ; } } private void handleSyslogMessage ( final byte [ ] rawMsg ) { } }

Fix:
TCPSyslogSocketHandler . LOGGER . warn ( "IOException<seq2seq4repair_space>occurred" , e ) ;
Buggy code:
public class PredicateTransformer < T > implements Serializable , Transformer < T , Boolean > { private static final long serialVersionUID = 5278818408044349346L ; private final Predicate < ? super T > iPredicate ; public static < T > Transformer < T , Boolean > getInstance ( Predicate < ? super T > predicate ) { } public PredicateTransformer ( Predicate < ? super T > predicate ) { } public Boolean transform ( T input ) { <START_BUG> return iPredicate . evaluate ( input ) ; <END_BUG> } public Predicate < ? super T > getPredicate ( ) { } }

Fix:
return Boolean . valueOf ( iPredicate . evaluate ( input ) ) ;
Buggy code:
public class PackageRequestTargetUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { private static final Logger log = LoggerFactory . getLogger ( PackageRequestTargetUrlCodingStrategy . class ) ; private final PackageName packageName ; public PackageRequestTargetUrlCodingStrategy ( final String path , PackageName packageName ) { } public IRequestTarget decode ( RequestParameters requestParameters ) { String remainder = requestParameters . getPath ( ) . substring ( getMountPath ( ) . length ( ) ) ; final String parametersFragment ; int ix = remainder . indexOf ( '//' , 1 ) ; if ( ix == ( - 1 ) ) { ix = remainder . length ( ) ; parametersFragment = "" ; } else { parametersFragment = remainder . substring ( ix ) ; } if ( remainder . startsWith ( "//" ) ) { remainder = remainder . substring ( 1 ) ; ix -- ; } else { return null ; } final String bookmarkablePageClassName = ( ( packageName ) + "." ) + ( remainder . substring ( 0 , ix ) ) ; Class bookmarkablePageClass ; try { bookmarkablePageClass = Session . get ( ) . getClassResolver ( ) . resolveClass ( bookmarkablePageClassName ) ; } catch ( Exception e ) { PackageRequestTargetUrlCodingStrategy . log . debug ( e . getMessage ( ) ) ; return null ; } PageParameters parameters = new PageParameters ( decodeParameters ( parametersFragment , requestParameters . getParameters ( ) ) ) ; String pageMapName = ( ( String ) ( parameters . remove ( PAGEMAP ) ) ) ; pageMapName = WebRequestCodingStrategy . decodePageMapName ( pageMapName ) ; requestParameters . setPageMapName ( pageMapName ) ; final String interfaceParameter = ( ( String ) ( parameters . remove ( INTERFACE_PARAMETER_NAME ) ) ) ; if ( interfaceParameter != null ) { WebRequestCodingStrategy . addInterfaceParameters ( interfaceParameter , requestParameters ) ; <START_BUG> return new org . apache . wicket . request . target . component . BookmarkableListenerInterfaceRequestTarget ( pageMapName , bookmarkablePageClass , parameters , requestParameters . getComponentPath ( ) , requestParameters . getInterfaceName ( ) ) ; <END_BUG> } else { return new org . apache . wicket . request . target . component . BookmarkablePageRequestTarget ( pageMapName , bookmarkablePageClass , parameters ) ; } } public final CharSequence encode ( IRequestTarget requestTarget ) { } public boolean matches ( IRequestTarget requestTarget ) { } public String toString ( ) { } }

Fix:
return new org . apache . wicket . request . target . component . BookmarkableListenerInterfaceRequestTarget ( pageMapName , bookmarkablePageClass , parameters , requestParameters . getComponentPath ( ) , requestParameters . getInterfaceName ( ) , requestParameters . getVersionNumber ( ) ) ;
Buggy code:
public class SpringExampleApplication extends SpringApplication { public void initSettings ( ) { <START_BUG> getPages ( ) . setHomePage ( SpringHtmlPage . class ) ; <END_BUG> getSettings ( ) . setResourcePollFrequency ( ONE_SECOND ) ; } }

Fix:
getPages ( ) . setHomePage ( SpringWebPage . class ) ;
Buggy code:
public class Tree extends DefaultAbstractTree { private static final long serialVersionUID = 1L ; public Tree ( String id ) { } public Tree ( String id , IModel model ) { } public Tree ( String id , TreeModel model ) { } protected void populateTreeItem ( WebMarkupContainer item , int level ) { final TreeNode node = ( ( TreeNode ) ( item . getModelObject ( ) ) ) ; item . add ( newIndentation ( item , "indent" , ( ( TreeNode ) ( item . getModelObject ( ) ) ) , level ) ) ; item . add ( newJunctionLink ( item , "link" , "image" , node ) ) ; MarkupContainer nodeLink = newNodeLink ( item , "nodeLink" , node ) ; item . add ( nodeLink ) ; nodeLink . add ( newNodeIcon ( nodeLink , "icon" , node ) ) ; nodeLink . add ( new Label ( "label" , new AbstractReadOnlyModel ( ) { private static final long serialVersionUID = 1L ; <START_BUG> public Object getObject ( Component c ) { <END_BUG> return renderNode ( node ) ; } } ) ) ; item . add ( new AbstractBehavior ( ) { private static final long serialVersionUID = 1L ; public void onComponentTag ( Component component , ComponentTag tag ) { super . onComponentTag ( component , tag ) ; if ( getTreeState ( ) . isNodeSelected ( node ) ) { tag . put ( "class" , "row-selected" ) ; } else { tag . put ( "class" , "row" ) ; } } } ) ; } protected String renderNode ( TreeNode node ) { } }

Fix:
public Object getObject ( ) {
Buggy code:
public class ReplyWithTemplateAction extends FrameAction implements SelectionListener { public ReplyWithTemplateAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r1 = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> processor . addOp ( new org . columba . mail . gui . composer . command . ReplyWithTemplateCommand ( r1 ) ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r1 = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class SpotList extends PoolObjectList < Spot , ByteMappedElement > { public SpotList ( final SpotCollection c ) { } public SpotList ( final SpotCollection c , final int initialCapacity ) { } protected SpotList ( final SpotList list , final TIntList indexSubList ) { } @ Override public SpotList subList ( final int fromIndex , final int toIndex ) { <START_BUG> return new SpotList ( this , getIndexCollection ( ) . subList ( fromIndex , fromIndex ) ) ; <END_BUG> } }

Fix:
return new SpotList ( this , getIndexCollection ( ) . subList ( fromIndex , toIndex ) ) ;
Buggy code:
public class ListOneListGen extends ActionBarActivity { protected ItemListAdapterGen adapter ; protected ListView itemsView ; protected Spinner categorySpinner ; protected long shoppingListId ; protected ListGroceryDAO listGroceryDb ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } protected void setInstructions ( ) { } protected void setTitle ( ) { } protected void populateList ( ) { } protected void populateCategories ( ) { } protected void categoryShift ( String category ) { } public void editList ( View view ) { } public static final int EDIT_ITEM_LIST = 1 ; @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { System . out . println ( "Activity<seq2seq4repair_space>Results<seq2seq4repair_space>in<seq2seq4repair_space>listing<seq2seq4repair_space>one<seq2seq4repair_space>list" ) ; if ( requestCode == ( ListOneListGen . EDIT_ITEM_LIST ) ) { if ( resultCode == ( RESULT_OK ) ) { Bundle extras = data . getExtras ( ) ; if ( extras != null ) { <START_BUG> int shoppingListId = extras . getInt ( "SHOPPING_LIST_ID" ) ; <END_BUG> System . out . println ( ( "List<seq2seq4repair_space>selected<seq2seq4repair_space>ID:<seq2seq4repair_space>" + shoppingListId ) ) ; categoryShift ( ALL_CATEGORY ) ; populateList ( ) ; } else { System . out . println ( "error<seq2seq4repair_space>occurred<seq2seq4repair_space>when<seq2seq4repair_space>importing<seq2seq4repair_space>list..." ) ; } } } } public void letsGoShopping ( View view ) { } public void deleteList ( final View view ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void onBackPressed ( ) { } public void returnToLists ( View view ) { } }

Fix:
long shoppingListId = extras . getLong ( "SHOPPING_LIST_ID" ) ;
Buggy code:
public class PrimeFactor { private final Gson gson ; private int number ; private List < Integer > decomposition ; public PrimeFactor ( Gson gson ) { } public void prime ( Request request , Response response ) { if ( ( request . parameter ( "number" ) ) != null ) { String numString = request . parameter ( "number" ) ; try { number = Integer . parseInt ( numString ) ; int returnNumber = number ; decomposition = new ArrayList < Integer > ( ) ; while ( ( number ) != 1 ) { if ( ( ( number ) % 2 ) == 0 ) { decomposition . add ( 2 ) ; number = ( number ) // 2 ; } else { int evenNumber = 3 ; <START_BUG> while ( evenNumber <= 9 ) { <END_BUG> if ( ( ( number ) % evenNumber ) == 0 ) { decomposition . add ( evenNumber ) ; number = ( number ) // evenNumber ; break ; } evenNumber += 2 ; } } } response . contentType ( JSON ) . body ( gson . toJson ( new PrimeFactor . Prime ( returnNumber , decomposition ) ) ) ; } catch ( NumberFormatException e ) { response . contentType ( JSON ) . body ( gson . toJson ( new PrimeFactor . PrimeError ( numString ) ) ) ; } } } public static class Prime { private int number ; private List < Integer > decomposition ; public Prime ( int number , List < Integer > decomposition ) { } } public static class PrimeError { private String number ; private String error ; public PrimeError ( String notANumber ) { } } }

Fix:
while ( evenNumber <= returnNumber ) {
Buggy code:
final class Role implements IRole { private static final int HASH_FACTOR = 89 ; private static final int HASH_INITIAL = Role . class . getName ( ) . hashCode ( ) ; private IRoleEvent roleEvent ; private List roleListeners ; private boolean defined ; private String description ; private String id ; private String name ; private Set activityBindings ; private transient int hashCode ; private transient boolean hashCodeComputed ; private transient IActivityBinding [ ] activityBindingsAsArray ; private transient String string ; Role ( String id ) { } public void addRoleListener ( IRoleListener roleListener ) { } public int compareTo ( Object object ) { } public boolean equals ( Object object ) { } public Set getActivityBindings ( ) { } public String getDescription ( ) throws RoleNotDefinedException { } public String getId ( ) { } public String getName ( ) throws RoleNotDefinedException { } public int hashCode ( ) { } public boolean isDefined ( ) { } public void removeRoleListener ( IRoleListener roleListener ) { } public String toString ( ) { } void fireRoleChanged ( ) { if ( ( roleListeners ) != null ) { for ( int i = 0 ; i < ( roleListeners . size ( ) ) ; i ++ ) { if ( ( roleEvent ) == null ) <START_BUG> roleEvent = new RoleEvent ( this ) ; <END_BUG> ( ( IRoleListener ) ( roleListeners . get ( i ) ) ) . roleChanged ( roleEvent ) ; } } } boolean setActivityBindings ( Set activityBindings ) { } boolean setDefined ( boolean defined ) { } boolean setDescription ( String description ) { } boolean setName ( String name ) { } }

Fix:
roleEvent = new RoleEvent ( this , false , false , false , false ) ;