nus-yam/ex-repair huggingface dataset:
Buggy code:
public class HotelSystem { public enum State { NOT_LOGGED_IN , CUSTOMER_LOGGED_IN , MANAGER_LOGGED_IN ; } HotelSystem . State state ; ArrayList < User > users ; public ArrayList < Building > buildings ; Database db ; User currentUser = null ; public HotelSystem ( ) { } public User findUser ( String email ) { } public User findUser ( String fname , String lname ) { } public boolean addUser ( User u ) { } private void addAdmin ( ) { } public User login ( String email , String password ) { } public void logout ( ) { } public ArrayList < Room > getMatchingRooms ( Date startDate , Date endDate , boolean smoking , int beds , int rating ) { } public boolean isLoggedIn ( ) { } void loadUsers ( ) { } private void loadBuildings ( ) { } private ArrayList < Floor > loadFloors ( int building ) { } private ArrayList < Room > loadRooms ( int floor ) { String statement = String . format ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>rooms<seq2seq4repair_space>where<seq2seq4repair_space>floor<seq2seq4repair_space>=<seq2seq4repair_space>%d;" , floor ) ; ResultSet rooms = db . execute ( statement ) ; ArrayList < Room > rs = new ArrayList ( ) ; try { while ( rooms . next ( ) ) { int number = rooms . getInt ( "number" ) ; int beds = rooms . getInt ( "beds" ) ; double price = rooms . getDouble ( "price" ) ; int rank = rooms . getInt ( "rank" ) ; boolean clean = rooms . getBoolean ( "clean" ) ; boolean smoking = rooms . getBoolean ( "smoking" ) ; <START_BUG> Room room = new Room ( number , beds , price , rank , clean , smoking ) ; <END_BUG> rs . add ( room ) ; } } catch ( Exception e ) { CLI . println ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>rooms!" ) ; } return rs ; } public boolean createAccount ( String name , String email , String password ) { } public boolean createEmployee ( String name , String email , String password , ArrayList < Permissions > permissions ) { } void removeAccount ( User account ) { } public User getUser ( ) { } public boolean checkin ( Customer customer ) { } public boolean checkout ( Customer customer ) { } public boolean reserveRoom ( int roomNum , Customer customer , Date start , Date end ) { } void getHotelStats ( ) { } public boolean setDiscount ( int building , int room , int percentOff ) { } public void removeBuilding ( Building building ) { } public void addBuilding ( ) { } public Building getBuilding ( int index ) { } int getNumOfBuildings ( ) { } @ Override public String toString ( ) { } }

Fix:
Room room = new Room ( this . db . getNextRoomId ( ) , number , beds , price , rank , clean , smoking ) ;
Buggy code:
public abstract class SubstitutionTextReader extends Reader { private Reader fReader ; private boolean fWasWhiteSpace ; private int fCharAfterWhiteSpace ; private boolean fSkipWhiteSpace = true ; private boolean fReadFromBuffer ; private StringBuffer fBuffer ; private int fIndex ; protected SubstitutionTextReader ( Reader reader ) { } public String getString ( ) throws IOException { } protected abstract String computeSubstitution ( int c ) throws IOException { } protected Reader getReader ( ) { } protected int nextChar ( ) throws IOException { } public int read ( ) throws IOException { int c ; do { c = nextChar ( ) ; <START_BUG> while ( ! ( fReadFromBuffer ) ) { <END_BUG> String s = computeSubstitution ( c ) ; if ( s == null ) break ; if ( ( s . length ( ) ) > 0 ) fBuffer . insert ( 0 , s ) ; c = nextChar ( ) ; } } while ( ( ( fSkipWhiteSpace ) && ( fWasWhiteSpace ) ) && ( c == '<seq2seq4repair_space>' ) ) ; fWasWhiteSpace = ( ( c == '<seq2seq4repair_space>' ) || ( c == '\r' ) ) || ( c == '\n' ) ; return c ; } public int read ( char [ ] cbuf , int off , int len ) throws IOException { } public boolean ready ( ) throws IOException { } public void close ( ) throws IOException { } public void reset ( ) throws IOException { } protected final void setSkipWhitespace ( boolean state ) { } protected final boolean isSkippingWhitespace ( ) { } }

Fix:
while ( ( ! ( fReadFromBuffer ) ) && ( c != ( - 1 ) ) ) {
Buggy code:
public class Server extends AbstractServer { private ServerCommunicationHandler serverCommunicationHandler ; private final MessageHandler messageHandler = new MessageHandler ( this ) ; public Server ( ServerEnvironment environment ) { } public void start ( ) { } public void start ( Standalone config ) throws ServerStartException { } public void stop ( ) { } Callback createListenerCallback ( ) { return new ServerStartupListener . Callback ( ) { public void run ( Map < ServiceName , StartException > serviceFailures , long elapsedTime , int totalServices , int onDemandServices , int startedServices ) { if ( serviceFailures . isEmpty ( ) ) { <START_BUG> log . infof ( "JBoss<seq2seq4repair_space>AS<seq2seq4repair_space>started<seq2seq4repair_space>in<seq2seq4repair_space>%dms.<seq2seq4repair_space>-<seq2seq4repair_space>Services<seq2seq4repair_space>[Total:<seq2seq4repair_space>%d,<seq2seq4repair_space>On-demand:<seq2seq4repair_space>%d.<seq2seq4repair_space>Started:<seq2seq4repair_space>%d]" , elapsedTime , totalServices , onDemandServices , startedServices ) ; <END_BUG> sendMessage ( "STARTED" ) ; } else { sendMessage ( "START<seq2seq4repair_space>FAILED" ) ; final StringBuilder buff = new StringBuilder ( String . format ( "JBoss<seq2seq4repair_space>AS<seq2seq4repair_space>server<seq2seq4repair_space>start<seq2seq4repair_space>failed.<seq2seq4repair_space>Attempted<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>%d<seq2seq4repair_space>services<seq2seq4repair_space>in<seq2seq4repair_space>%dms" , totalServices , elapsedTime ) ) ; buff . append ( "\nThe<seq2seq4repair_space>following<seq2seq4repair_space>services<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>start:\n" ) ; for ( Map . Entry < ServiceName , StartException > entry : serviceFailures . entrySet ( ) ) { buff . append ( String . format ( "\t%s<seq2seq4repair_space>=><seq2seq4repair_space>%s\n" , entry . getKey ( ) , entry . getValue ( ) . getMessage ( ) ) ) ; } log . error ( buff . toString ( ) ) ; } } } ; } private void launchCommunicationHandler ( ) { } private void sendMessage ( final String message ) { } }

Fix:
log . infof ( "JBoss<seq2seq4repair_space>AS<seq2seq4repair_space>started<seq2seq4repair_space>-<seq2seq4repair_space>Installed<seq2seq4repair_space>%d<seq2seq4repair_space>and<seq2seq4repair_space>started<seq2seq4repair_space>%d<seq2seq4repair_space>services<seq2seq4repair_space>in<seq2seq4repair_space>%dms." , totalServices , startedServices , elapsedTime ) ;
Buggy code:
public class UserLoginAction extends ActionSupport { private UserService userservice ; private String name ; private String password ; private TbUser user ; private TbAdmin admin ; private String limit ; public String getLimit ( ) { } public void setLimit ( String limit ) { } public UserService getUserservice ( ) { } public void setUserservice ( UserService userservice ) { } public String getName ( ) { } public void setName ( String name ) { } public String getPassword ( ) { } public void setPassword ( String password ) { } public TbUser getUser ( ) { } public void setUser ( TbUser user ) { } public TbAdmin getAdmin ( ) { } public void setAdmin ( TbAdmin admin ) { } public String logincheck ( ) throws IOException { HttpServletRequest request = ServletActionContext . getRequest ( ) ; HttpServletResponse response = ServletActionContext . getResponse ( ) ; PrintWriter out = response . getWriter ( ) ; name = request . getParameter ( "username" ) ; password = request . getParameter ( "userpassword" ) ; if ( ( name . equals ( "" ) ) || ( password . equals ( "" ) ) ) { out . print ( "0" ) ; } else if ( ! ( name . matches ( "[0-9]+" ) ) ) { out . print ( "1" ) ; } else { List list = userservice . queryUser ( name , password ) ; if ( ( list . size ( ) ) == 0 ) { out . print ( "2" ) ; } else { user = ( ( TbUser ) ( userservice . queryUser ( name , password ) . get ( 0 ) ) ) ; <START_BUG> if ( ( user . getTbAdmins ( ) . size ( ) ) != 0 ) { <END_BUG> Iterator iterator = user . getTbAdmins ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { admin = ( ( TbAdmin ) ( iterator . next ( ) ) ) ; } if ( ( admin . getSuperAdmin ( ) ) == true ) { request . getSession ( ) . setAttribute ( "limit" , "3" ) ; request . getSession ( ) . setAttribute ( "user" , user ) ; } else { request . getSession ( ) . setAttribute ( "limit" , "2" ) ; request . getSession ( ) . setAttribute ( "user" , user ) ; } } else { request . getSession ( ) . setAttribute ( "limit" , "1" ) ; request . getSession ( ) . setAttribute ( "user" , user ) ; } out . print ( "3" ) ; } } out . close ( ) ; return null ; } public String login ( ) throws IOException { } }

Fix:
if ( ( ( user . getTbAdmins ( ) ) != null ) && ( ( user . getTbAdmins ( ) . size ( ) ) != 0 ) ) {
Buggy code:
public class LoginViewMobilizeImpl extends Composite implements LoginView { @ UiTemplate ( "LoginViewMobilize.ui.xml" ) interface LoginBoxViewUiBinder extends UiBinder < Widget , LoginViewMobilizeImpl > { } private static LoginViewMobilizeImpl . LoginBoxViewUiBinder uiBinder = GWT . create ( LoginViewMobilizeImpl . LoginBoxViewUiBinder . class ) ; @ UiField TextBox userNameTextBox ; @ UiField PasswordTextBox passwordTextBox ; @ UiField Button loginButton ; @ UiField Image logo ; @ UiField UListElement linkList ; @ UiField HTMLPanel linkListDiv ; @ UiField HTMLPanel descriptionPanel ; private Presenter presenter ; public LoginViewMobilizeImpl ( ) { } private void initEventHandlers ( ) { } private void submit ( ) { } public void setPresenter ( Presenter presenter ) { } @ Override public void setLoginFailed ( String msg ) { <START_BUG> ErrorDialog . show ( "Login<seq2seq4repair_space>failed." , msg ) ; <END_BUG> } @ Override public String getUsername ( ) { } @ Override public String getPassword ( ) { } @ Override public void disableLoginForm ( ) { } @ Override public void enableLoginForm ( ) { } @ Override public void showError ( String errorMsg ) { } }

Fix:
ErrorDialog . show ( "Invalid<seq2seq4repair_space>username<seq2seq4repair_space>or<seq2seq4repair_space>password" , msg ) ;
Buggy code:
public class DeleteMessageAction extends AbstractColumbaAction implements SelectionListener { public DeleteMessageAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . MailFrameMediator ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ; r [ 0 ] . setMarkVariant ( MARK_AS_EXPUNGED ) ; MessageFolder folder = ( ( MessageFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; <START_BUG> int uid = folder . getFolderItem ( ) . getInteger ( "uid" ) ; <END_BUG> MessageFolder trash = ( ( MessageFolder ) ( ( ( org . columba . mail . folder . RootFolder ) ( folder . getRootFolder ( ) ) ) . getTrashFolder ( ) ) ) ; if ( uid == ( trash . getUid ( ) ) ) { processor . addOp ( new org . columba . mail . folder . command . MarkMessageCommand ( r ) ) ; processor . addOp ( new org . columba . mail . folder . command . ExpungeFolderCommand ( r ) ) ; } else { MessageFolder destFolder = trash ; FolderCommandReference [ ] result = new FolderCommandReference [ 2 ] ; FolderCommandReference [ ] r1 = ( ( org . columba . mail . gui . frame . MailFrameMediator ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ; FolderCommandReference r2 = new FolderCommandReference ( destFolder ) ; result [ 0 ] = r1 [ 0 ] ; result [ 1 ] = r2 ; MoveMessageCommand c = new MoveMessageCommand ( result ) ; processor . addOp ( c ) ; } } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
int uid = folder . getConfiguration ( ) . getInteger ( "uid" ) ;
Buggy code:
public class Recorder extends Task { private String filename = null ; private Boolean append = null ; private Boolean start = null ; private int loglevel = - 1 ; private boolean emacsMode = false ; private static Hashtable recorderEntries = new Hashtable ( ) ; public void setName ( String fname ) { } public void setAction ( Recorder . ActionChoices action ) { } public void setAppend ( boolean append ) { } public void setEmacsMode ( boolean emacsMode ) { } public void setLoglevel ( Recorder . VerbosityLevelChoices level ) { } public void execute ( ) throws BuildException { } public static class ActionChoices extends EnumeratedAttribute { private static final String [ ] values = new String [ ] { "start" , "stop" } ; public String [ ] getValues ( ) { } } public static class VerbosityLevelChoices extends EnumeratedAttribute { private static final String [ ] values = new String [ ] { "error" , "warn" , "info" , "verbose" , "debug" } ; public String [ ] getValues ( ) { } } protected RecorderEntry getRecorder ( String name , Project proj ) throws BuildException { Object o = Recorder . recorderEntries . get ( name ) ; RecorderEntry entry ; if ( o == null ) { try { entry = new RecorderEntry ( name ) ; PrintStream out = null ; if ( ( append ) == null ) { out = new PrintStream ( new FileOutputStream ( name ) ) ; } else { out = new PrintStream ( new FileOutputStream ( name , append . booleanValue ( ) ) ) ; } entry . setErrorPrintStream ( out ) ; entry . setOutputPrintStream ( out ) ; } catch ( IOException ioe ) { throw new BuildException ( "Problems<seq2seq4repair_space>creating<seq2seq4repair_space>a<seq2seq4repair_space>recorder<seq2seq4repair_space>entry" , ioe ) ; } <START_BUG> proj . addBuildListener ( entry ) ; <END_BUG> Recorder . recorderEntries . put ( name , entry ) ; } else { entry = ( ( RecorderEntry ) ( o ) ) ; } return entry ; } }

Fix:
entry . setProject ( proj ) ;
Buggy code:
public class BarcodeGenerator { private static int codeNbr = 0 ; private static StringBuilder barcode ; private static ArrayList < Integer > takenBarcodes = new ArrayList < Integer > ( ) ; public static String getCode ( ) { BarcodeGenerator . barcode = new StringBuilder ( ) ; BarcodeGenerator . barcode . append ( BarcodeGenerator . codeNbr ) ; BarcodeGenerator . barcode . reverse ( ) ; while ( ( BarcodeGenerator . barcode . length ( ) ) < 5 ) { BarcodeGenerator . barcode . append ( "0" ) ; } BarcodeGenerator . barcode . reverse ( ) ; BarcodeGenerator . takenBarcodes . add ( BarcodeGenerator . codeNbr ) ; int i = 0 ; while ( BarcodeGenerator . takenBarcodes . contains ( BarcodeGenerator . codeNbr ) ) { <START_BUG> BarcodeGenerator . codeNbr += ( ( BarcodeGenerator . codeNbr ) + 1 ) % 100000 ; <END_BUG> i ++ ; if ( i > 100009 ) { throw new RejectedExecutionException ( "No<seq2seq4repair_space>available<seq2seq4repair_space>barcodes!" ) ; } } return BarcodeGenerator . barcode . toString ( ) ; } public static void setCodeNbr ( int newNbr ) { } public static void setBarcodeAsAvailable ( String barcode ) { } No newline ; at end ; of file ; }

Fix:
BarcodeGenerator . codeNbr = ( ( BarcodeGenerator . codeNbr ) + 1 ) % 100000 ;
Buggy code:
public class SelectResultDataSource implements GridDataSource { private final List < Triple > results ; private int startIndex = 0 ; public SelectResultDataSource ( Query query , QueryDataService queryDataService ) { } public void prepare ( int startIndex , int endIndex , List < SortConstraint > sortConstraints ) { } public int getAvailableRows ( ) { } public Object getRowValue ( int index ) { <START_BUG> return results . get ( ( index - ( startIndex ) ) ) ; <END_BUG> } public Class < ? > getRowType ( ) { } public List < Triple > getResults ( ) { } }

Fix:
return results . get ( index ) ;
Buggy code:
public class ResourceMapperTest extends WicketTestCase { private static final Charset CHARSET = Charset . forName ( "UTF-8" ) ; private static final String SHARED_NAME = "test-resource" ; private IRequestMapper mapper ; private ResourceMapperTest . TestResource resource ; @ Override protected void setUp ( ) throws Exception { } private Request createRequest ( final String url ) { return new Request ( ) { @ Override public Url getUrl ( ) { return Url . parse ( url , ResourceMapperTest . CHARSET ) ; } @ Override public Locale getLocale ( ) { return null ; } @ Override public Charset getCharset ( ) { return ResourceMapperTest . CHARSET ; } @ Override <START_BUG> public Url getBaseUrl ( ) { <END_BUG> return getUrl ( ) ; } } ; } @ Test public void testInvalidPathIsEmpty ( ) { } @ Test public void testInvalidPathIsMismatch ( ) { } @ Test public void testInvalidPathIsTooShort ( ) { } @ Test public void testValidPathWithParams ( ) { } @ Test public void testValidPathWithParamsAndQueryPath ( ) { } private static class TestResource implements IResource { private static final long serialVersionUID = - 3130204487473856574L ; public PageParameters pageParameters ; public void respond ( Attributes attributes ) { } } }

Fix:
public Url getClientUrl ( ) {
Buggy code:
public class ModelReader { private final ModelController controller ; private volatile ModelNode deploymentModel ; public ModelReader ( ModelController controller ) { } ModelNode getDeploymentModel ( ) { } ModelNode execute ( ModelNode operation ) { ModelNode result = controller . execute ( operation , logging , COMMIT , null ) ; if ( result . hasDefined ( FAILURE_DESCRIPTION ) ) { <START_BUG> throw new RuntimeException ( result . get ( FAILURE_DESCRIPTION ) . asString ( ) ) ; <END_BUG> } return result . require ( RESULT ) ; } void setDeploymentModel ( ModelNode deploymentModel ) { } }

Fix:
throw new RuntimeException ( result . get ( FAILURE_DESCRIPTION ) . toString ( ) ) ;
Buggy code:
public class BrokerAvailabilityEvent extends ApplicationEvent { private static final long serialVersionUID = - 8156742505179181002L ; private final boolean brokerAvailable ; public BrokerAvailabilityEvent ( boolean brokerAvailable , Object source ) { } public boolean isBrokerAvailable ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "BrokerAvailabilityEvent[available=" + ( this . brokerAvailable ) ) + ",<seq2seq4repair_space>" ) + ( getSource ( ) ) ) + "]" ; <END_BUG> } }

Fix:
return "BrokerAvailabilityEvent=" + ( this . brokerAvailable ) ;
Buggy code:
public class PathTokenizer implements Iterable < PathToken > { private String path ; private char [ ] pathChars ; private int index = 0 ; private List < PathToken > pathTokens = new LinkedList < PathToken > ( ) ; public PathTokenizer ( String jsonPath , JsonProvider jsonProvider ) { } public List < String > getFragments ( ) { } public String getPath ( ) { } public Iterator < PathToken > iterator ( ) { } private boolean isEmpty ( ) { } private char peek ( ) { } private char poll ( ) { } public List < String > splitPath ( ) { List < String > fragments = new LinkedList < String > ( ) ; while ( ! ( isEmpty ( ) ) ) { skip ( '<seq2seq4repair_space>' ) ; char current = peek ( ) ; switch ( current ) { case '$' : fragments . add ( Character . toString ( current ) ) ; poll ( ) ; break ; case '.' : poll ( ) ; <START_BUG> if ( ( peek ( ) ) == '.' ) { <END_BUG> poll ( ) ; fragments . add ( ".." ) ; assertNotInvalidPeek ( '.' ) ; } break ; case '[' : fragments . add ( extract ( true , ']' ) ) ; break ; default : fragments . add ( extract ( false , '[' , '.' ) ) ; } } return fragments ; } private String extract ( boolean includeSopChar , char ... stopChars ) { } private String clean ( StringBuilder sb ) { } private String trim ( String src , String trim ) { } private String trimRight ( String src , String trim ) { } private String trimLeft ( String src , String trim ) { } private boolean isStopChar ( char c , char ... scanFor ) { } private void skip ( char target ) { } private void assertNotInvalidPeek ( char ... invalidChars ) { } private void assertValidPeek ( boolean acceptEmpty , char ... validChars ) { } }

Fix:
if ( ( ! ( isEmpty ( ) ) ) && ( ( peek ( ) ) == '.' ) ) {
Buggy code:
public class CheckBoxMultipleChoicePage extends WicketExamplePage { private static final List < String > SITES = Arrays . asList ( new String [ ] { "The<seq2seq4repair_space>Server<seq2seq4repair_space>Side" , "Java<seq2seq4repair_space>Lobby" , "Java.Net" } ) ; private static final List < String > MANY_CHOICES = Arrays . asList ( new String [ ] { "Choice1" , "Choice2" , "Choice3" , "Choice4" , "Choice5" , "Choice6" , "Choice7" , "Choice8" , "Choice9" } ) ; public CheckBoxMultipleChoicePage ( ) { } private static class Input implements IClusterable { public List < String > sites = new ArrayList < String > ( ) ; public List < String > choices = new ArrayList < String > ( ) ; public Input ( ) { } @ Override public String toString ( ) { } private String listAsString ( List < String > list ) { <START_BUG> StringBuffer b = new StringBuffer ( ) ; <END_BUG> for ( Iterator < String > i = list . iterator ( ) ; i . hasNext ( ) ; ) { b . append ( i . next ( ) ) ; if ( i . hasNext ( ) ) { b . append ( ",<seq2seq4repair_space>" ) ; } } return b . toString ( ) ; } } @ Override protected void explain ( ) { } }

Fix:
StringBuilder b = new StringBuilder ( ) ;
Buggy code:
public class HgImporter extends Importer { private String hgLink = null ; private File tempDir = null ; private Repository repo = null ; public HgImporter ( String hgLink , UserManager user ) { } public HgImporter ( ArchiveFromHg archive , UserManager user ) { } @ Override public HgImporter importRepo ( ) throws ImporterException { } @ Override public void cleanUp ( ) { repo . close ( ) ; try { if ( tempDir . exists ( ) ) FileUtils . deleteDirectory ( tempDir ) ; } catch ( IOException e ) { <START_BUG> LOGGER . error ( e , "Exception<seq2seq4repair_space>cleaning<seq2seq4repair_space>up<seq2seq4repair_space>temp<seq2seq4repair_space>dir,<seq2seq4repair_space>after<seq2seq4repair_space>importing<seq2seq4repair_space>a<seq2seq4repair_space>Git<seq2seq4repair_space>repository" ) ; <END_BUG> } } private void cloneHg ( ) throws ImporterException { } private void buildArchive ( ) throws ImporterException { } private void scanRepository ( File directory , CombineArchive archive ) throws ImporterException { } private OmexDescription getOmexForFile ( File file ) { } private String processNzRepoLink ( String link ) throws ImporterException { } }

Fix:
LOGGER . error ( e , "Exception<seq2seq4repair_space>cleaning<seq2seq4repair_space>up<seq2seq4repair_space>temp<seq2seq4repair_space>dir,<seq2seq4repair_space>after<seq2seq4repair_space>importing<seq2seq4repair_space>a<seq2seq4repair_space>HG<seq2seq4repair_space>repository" ) ;
Buggy code:
public class StringType extends AbstractPrimitiveType < String > { private static final Charset Charset_UTF8 = Charset . forName ( "UTF-8" ) ; private static final DecoderImpl . TypeDecoder < String > _stringCreator = new DecoderImpl . TypeDecoder < String > ( ) { public String decode ( final ByteBuffer buf ) { } } ; public static interface StringEncoding extends PrimitiveTypeEncoding < String > { void setValue ( String val , int length ) { } } private final StringType . StringEncoding _stringEncoding ; private final StringType . StringEncoding _shortStringEncoding ; StringType ( final EncoderImpl encoder , final DecoderImpl decoder ) { } public Class < String > getTypeClass ( ) { } public StringType . StringEncoding getEncoding ( final String val ) { } static int calculateUTF8Length ( final String s ) { int len = s . length ( ) ; final int length = len ; for ( int i = 0 ; i < length ; i ++ ) { int c = s . charAt ( i ) ; if ( ( c & 65408 ) != 0 ) { len ++ ; if ( ( c & 63488 ) != 0 ) { len ++ ; <START_BUG> if ( ( c & 55296 ) == 55296 ) { <END_BUG> i ++ ; } } } } return len ; } public StringType . StringEncoding getCanonicalEncoding ( ) { } public Collection < StringType . StringEncoding > getAllEncodings ( ) { } private class AllStringEncoding extends LargeFloatingSizePrimitiveTypeEncoding < String > implements StringType . StringEncoding { private String _value ; private int _length ; public AllStringEncoding ( final EncoderImpl encoder , final DecoderImpl decoder ) { } @ Override protected void writeEncodedValue ( final String val ) { } @ Override protected int getEncodedValueSize ( final String val ) { } @ Override public byte getEncodingCode ( ) { } public StringType getType ( ) { } public boolean encodesSuperset ( final TypeEncoding < String > encoding ) { } public String readValue ( ) { } public void setValue ( final String val , final int length ) { } } private class ShortStringEncoding extends SmallFloatingSizePrimitiveTypeEncoding < String > implements StringType . StringEncoding { private String _value ; private int _length ; public ShortStringEncoding ( final EncoderImpl encoder , final DecoderImpl decoder ) { } @ Override protected void writeEncodedValue ( final String val ) { } @ Override protected int getEncodedValueSize ( final String val ) { } @ Override public byte getEncodingCode ( ) { } public StringType getType ( ) { } public boolean encodesSuperset ( final TypeEncoding < String > encoder ) { } public String readValue ( ) { } public void setValue ( final String val , final int length ) { } } }

Fix:
if ( ( ( c & 55296 ) == 55296 ) && ( c < 56320 ) ) {
Buggy code:
public class HashTableSC < K , V > implements HashTableInterface < K , V > { private Node [ ] array ; private Function < K , Integer > foh ; private int tableSize = INITIAL_TABLE_SIZE ; private int size = 0 ; private int numCollisions = 0 ; private int numResizes = 0 ; public HashTableSC ( ) { } public HashTableSC ( Function < K , Integer > f ) { } @ Override public int indexOf ( K key ) { } @ Override public void put ( K key , V val ) { } @ Override public V get ( K key ) { } @ Override public void delete ( K key ) { } public void delete ( K key , Node p , Node node ) { } @ Override public void clear ( ) { } @ Override public void resize ( ) { } @ Override public int getSize ( ) { } @ Override public int getTableSize ( ) { } @ Override public int getNumCollisions ( ) { } @ Override public int getNumResizes ( ) { } @ Override public void print ( ) { } @ Override public void printGraph ( ) { System . out . println ( "-----------<seq2seq4repair_space>Print<seq2seq4repair_space>Graph-----------" ) ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { System . out . print ( ( i + "<seq2seq4repair_space>|<seq2seq4repair_space>" ) ) ; if ( ( array [ i ] ) != null ) { Node node = array [ i ] ; while ( node != null ) { <START_BUG> System . out . print ( "#" ) ; <END_BUG> node = node . getNext ( ) ; } } System . out . println ( ) ; } } public static void main ( String [ ] args ) { } }

Fix:
System . out . print ( BLACK_CIRCLE ) ;
Buggy code:
public class AroundWeaveTestCase extends WeaveTestCase { public AroundWeaveTestCase ( String name ) { } public void testAround ( ) throws IOException { } public void testAroundAll ( ) throws IOException { } public void testAroundAndOthers ( ) throws IOException { } public void testAroundAllAndOthers ( ) throws IOException { } private BcelAdvice makeAroundMunger ( final boolean matchOnlyPrintln ) { <START_BUG> BcelWorld world = new BcelWorld ( ) ; <END_BUG> final Member sig = Member . method ( TypeX . forName ( "Aspect" ) , Modifier . STATIC , "ajc_around" , "(Lorg//aspectj//runtime//internal//AroundClosure;)Ljava//lang//Object;" ) ; return new BcelAdvice ( AdviceKind . stringToKind ( "around" ) , ( matchOnlyPrintln ? makePointcutPrintln ( ) : makePointcutAll ( ) ) , sig , 0 , ( - 1 ) , ( - 1 ) , null , TypeX . forName ( "Aspect" ) . resolve ( world ) ) { public void specializeOn ( Shadow s ) { super . specializeOn ( s ) ; ( ( BcelShadow ) ( s ) ) . initializeForAroundClosure ( ) ; } } ; } private void aroundTest ( String outName , final boolean matchOnlyPrintln ) throws IOException { } private void aroundTestAndOthers ( String outName , final boolean matchOnlyPrintln ) throws IOException { } }

Fix:
BcelWorld world = super . world ;
Buggy code:
public class CompactCalendar { private static final Logger log = Logger . getLogger ( CompactCalendar . class . getName ( ) ) ; public static final TimeZone UTC = TimeZone . getTimeZone ( "UTC" ) ; private final long timeInMillis ; private final String timeZoneId ; private CompactCalendar ( long timeInMillis , String timeZoneId ) { } public static DateFormat createDateFormat ( String pattern ) { } public static CompactCalendar parseDate ( String dateString , String dateFormatString ) { } public static CompactCalendar fromMillisAndTimeZone ( long timeInMillis , String timeZoneId ) { } public static CompactCalendar fromMillis ( long timeInMillis ) { } public static CompactCalendar fromCalendar ( Calendar calendar ) { } public static CompactCalendar fromDate ( Date date ) { } public static CompactCalendar now ( ) { } public static CompactCalendar getInstance ( String timeZoneId ) { } public CompactCalendar asUTCTimeInTimeZone ( TimeZone timeZone ) { <START_BUG> return new CompactCalendar ( ( ( timeInMillis ) + ( timeZone . getOffset ( timeInMillis ) ) ) , "UTC" ) ; <END_BUG> } public long getTimeInMillis ( ) { } public String getTimeZoneId ( ) { } public Calendar getCalendar ( ) { } public boolean hasDateDefined ( ) { } public Date getTime ( ) { } private static volatile Map < String , TimeZone > timeZones = Collections . emptyMap ( ) ; private TimeZone getTimeZone ( ) { } public boolean after ( CompactCalendar other ) { } public boolean before ( CompactCalendar other ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
return new CompactCalendar ( ( ( timeInMillis ) - ( timeZone . getOffset ( timeInMillis ) ) ) , "UTC" ) ;
Buggy code:
public abstract class Ownable extends Field { protected int price ; private Player playerOwner ; protected int owner ; private boolean pawn ; public Ownable ( String name , int price , int owner ) { } public abstract int getRent ( Player player ) { } public abstract void landOnField ( Player player ) { } public abstract void buildOnField ( Player player ) { } public abstract void demolition ( Player player ) { } public abstract int getFieldColor ( ) { } public abstract int getFieldReq ( ) { } public abstract int getHouses ( ) { } public abstract int getHousePrice ( ) { } public void setOwner ( Player player ) { } public Player getOwner ( ) { } public void setStatus ( boolean status , Player player ) { if ( status == true ) { player . addBalance ( ( ( price ) // 2 ) ) ; pawn = status ; } else if ( status == false ) { <START_BUG> player . addBalance ( ( ( ( price ) // 2 ) * ( - 1 ) ) ) ; <END_BUG> pawn = status ; } } public boolean getStatus ( ) { } public int getPrice ( ) { } }

Fix:
player . addBalance ( ( ( ( ( ( price ) // 2 ) * ( - 1 ) ) // 100 ) * 110 ) ) ;
Buggy code:
public class StaticMapsProvider { private static final String MARKERS_URL = "http:////cgeo.carnero.cc//_markers//" ; private static final int MIN_MAP_IMAGE_BYTES = 6000 ; private static final BlockingThreadPool pool = new BlockingThreadPool ( 1 , Thread . MIN_PRIORITY ) ; public static File getMapFile ( final String geocode , String prefix , final int level , final boolean createDirs ) { } private static void downloadDifferentZooms ( final cgCache cache , String markerUrl , String prefix , String latlonMap , int edge , String waypoints ) { } private static void downloadMap ( cgCache cache , int zoom , String mapType , String markerUrl , String prefix , int level , String latlonMap , int edge , String waypoints ) { final String mapUrl = "http:////maps.google.com//maps//api//staticmap?center=" + latlonMap ; final String url = ( ( ( ( ( ( ( ( ( ( ( ( ( mapUrl + "&zoom=" ) + zoom ) + "&size=" ) + edge ) + "x" ) + edge ) + "&maptype=" ) + mapType ) + "&markers=icon%3A" ) + markerUrl ) + "%7C" ) + latlonMap ) + waypoints ) + "&sensor=false" ; final File file = StaticMapsProvider . getMapFile ( cache . getGeocode ( ) , prefix , level , true ) ; final HttpResponse httpResponse = cgBase . request ( url , null , false ) ; if ( httpResponse != null ) { <START_BUG> if ( LocalStorage . saveEntityToFile ( httpResponse . getEntity ( ) , file ) ) { <END_BUG> final long fileSize = file . length ( ) ; if ( fileSize < ( StaticMapsProvider . MIN_MAP_IMAGE_BYTES ) ) { file . delete ( ) ; } } } } public static void downloadMaps ( cgCache cache , cgeoapplication app ) { } public static void downloadMaps ( cgCache cache , Activity activity ) { } public static void downloadMaps ( cgCache cache , Display display ) { } public static void storeWaypointStaticMap ( cgCache cache , Activity activity , cgWaypoint waypoint , boolean waitForResult ) { } private static void storeWaypointStaticMap ( cgCache cache , int edge , cgWaypoint waypoint , final boolean waitForResult ) { } public static void storeCacheStaticMap ( cgCache cache , Activity activity , final boolean waitForResult ) { } private static void storeCacheStaticMap ( cgCache cache , int edge , final boolean waitForResult ) { } private static int guessMinDisplaySide ( Display display ) { } private static int guessMinDisplaySide ( Activity activity ) { } private static void downloadMaps ( final cgCache cache , final String markerUrl , final String prefix , final String latlonMap , final int edge , final String waypoints , boolean waitForResult ) { } private static String getCacheMarkerUrl ( final cgCache cache ) { } private static String getWpMarkerUrl ( final cgWaypoint waypoint ) { } public static void removeWpStaticMaps ( int wp_id , String geocode ) { } public static boolean doesExistStaticMapForCache ( String geocode ) { } public static boolean doesExistStaticMapForWaypoint ( String geocode , int waypointId ) { } }

Fix:
if ( LocalStorage . saveEntityToFile ( httpResponse , file ) ) {
Buggy code:
@ Service @ Slf4j @ Data public class FileFormatCache { @ Cacheable ( "inputFormats" ) public List < LineAttributes > getFileFormat ( String key ) { } @ Cacheable ( "formatFiles" ) public String getFormatFile ( String key ) { <START_BUG> Map < String , String > propMap = FileUtil . getPropertyValues ( "input_format.properties" ) ; <END_BUG> return propMap . get ( key ) ; } @ CacheEvict ( value = "formatFiles" , allEntries = true ) public void removeAllInputFormats ( ) { } }

Fix:
Map < String , String > propMap = FileUtil . getPropertyValues ( "//input_format.properties" ) ;
Buggy code:
public final class ListAppender extends AppenderSkeleton { private List model = new ArrayList ( ) ; public final List getList ( ) { } protected void append ( LoggingEvent event ) { <START_BUG> event . prepareForSerialization ( ) ; <END_BUG> event . getLocationInformation ( ) ; synchronized ( model ) { model . add ( event ) ; } } public void close ( ) { } public void clearModel ( ) { } }

Fix:
event . prepareForDeferredProcessing ( ) ;
Buggy code:
public class MessageBuilderTests { @ Test public void buildMessage ( ) { MockMessageSource messageSource = new MockMessageSource ( ) ; messageSource . addMessage ( "invalidFormat" , Locale . US , "#{label}<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#{format}" ) ; messageSource . addMessage ( "mathForm.decimalField" , Locale . US , "Decimal<seq2seq4repair_space>Field" ) ; MessageBuilder builder = new MessageBuilder ( messageSource ) ; <START_BUG> String message = builder . code ( "invalidFormat" ) . arg ( "label" , new ResolvableArgument ( "mathForm.decimalField" ) ) . arg ( "format" , "#,###.##" ) . defaultMessage ( "Field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#,###.##" ) . build ( ) ; <END_BUG> assertEquals ( "Decimal<seq2seq4repair_space>Field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#,###.##" , message ) ; } }

Fix:
String message = builder . code ( "invalidFormat" ) . arg ( "label" , new ResolvableArgument ( "mathForm.decimalField" ) ) . arg ( "format" , "#,###.##" ) . locale ( Locale . US ) . defaultMessage ( "Field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#,###.##" ) . build ( ) ;
Buggy code:
if ( ! ( isMod ( sender ) ) ) { if ( message . matches ( "[A-Z]{20,}" ) ) { new me . jewsofhazzard . pcmrbot . util . Timeouts ( connectedChannel , sender , 1 , TType . CAPS ) ; } else if ( message . matches ( "(([A-Za-z0-9_://\\-@\\s.]+[\\s?\\.\\s?]?)+([\\s?\\.\\s?](c\\s?o\\s?m|n\\s?e\\s?t|o\\s?r\\s?g|c\\s?o|a\\s?u|u\\s?k|u\\s?s|m\\s?e|b\\s?z|i\\s?n\\s?t|e\\s?d\\s?u|g\\s?o\\s?v\\s?|m\\s?i\\s?l|a\\s?c)(\\s)?(//)?)+[A-Za-z0-9_://\\-@\\s.]+)+" ) ) { new me . jewsofhazzard . pcmrbot . util . Timeouts ( connectedChannel , sender , 1 , TType . LINK ) ; } else <START_BUG> if ( message . matches ( ( ( "[\\W_]{" + ( numSymbols ) ) + "{15,}" ) ) ) { <END_BUG>

Fix:
if ( message . matches ( ( ( "[\\W_]{" + ( numSymbols ) ) + ",}" ) ) ) {
Buggy code:
public class DiscardWorkingCopyOperation extends JavaModelOperation { public DiscardWorkingCopyOperation ( IJavaElement workingCopy ) { } protected void executeOperation ( ) throws JavaModelException { CompilationUnit workingCopy = getWorkingCopy ( ) ; int useCount = JavaModelManager . getJavaModelManager ( ) . discardPerWorkingCopyInfo ( workingCopy ) ; if ( useCount == 0 ) { <START_BUG> if ( ( workingCopy . owner ) != ( DefaultWorkingCopyOwner . PRIMARY ) ) { <END_BUG> JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; delta . removed ( workingCopy ) ; addDelta ( delta ) ; removeReconcileDelta ( workingCopy ) ; } else { JavaElementDelta delta = new JavaElementDelta ( this . getJavaModel ( ) ) ; delta . changed ( workingCopy , IJavaElementDelta . F_PRIMARY_WORKING_COPY ) ; addDelta ( delta ) ; } } } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } }

Fix:
if ( ! ( workingCopy . isPrimary ( ) ) ) {
Buggy code:
public class Tetrimino implements IMoveable < Tetrimino > { private final Block [ ] blocks ; public Tetrimino ( Block [ ] blocks ) { } public Block [ ] blocks ( ) { } private Tetrimino move ( int dx , int dy ) { } @ Override public Tetrimino moveDown ( ) { <START_BUG> return move ( 0 , ( - 1 ) ) ; <END_BUG> } @ Override public Tetrimino moveLeft ( ) { } @ Override public Tetrimino moveRight ( ) { } @ Override public Tetrimino moveRelative ( int x , int y ) { } }

Fix:
return move ( 0 , 1 ) ;
Buggy code:
public class HomeProxyActivity extends AppCompatActivity { private static final String LOG = "HomeProxyActivity" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; Intent intent = new Intent ( ) ; Role role = AccessControl . getCurrentUserRole ( this ) ; Log . d ( HomeProxyActivity . LOG , role . toString ( ) ) ; switch ( role ) { case OWNER : intent . setClass ( this , MainActivity . class ) ; break ; case SELLER : intent . setClass ( this , CheckActivity . class ) ; break ; } <START_BUG> intent . setFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; <END_BUG> startActivity ( intent ) ; } }

Fix:
intent . setFlags ( ( ( Intent . FLAG_ACTIVITY_NEW_TASK ) | ( Intent . FLAG_ACTIVITY_CLEAR_TASK ) ) ) ;
Buggy code:
public class BooleanProperty extends AbstractProperty { private boolean value ; private transient boolean savedValue ; public BooleanProperty ( String name , boolean v ) { } public BooleanProperty ( ) { } public void setObjectValue ( Object v ) { } public String getStringValue ( ) { <START_BUG> return JOrphanUtils . booleanToString ( value ) ; <END_BUG> } public Object getObjectValue ( ) { } public Object clone ( ) { } public boolean getBooleanValue ( ) { } public void setRunningVersion ( boolean runningVersion ) { } public void recoverRunningVersion ( TestElement owner ) { } }

Fix:
return Boolean . toString ( value ) ;
Buggy code:
public class nsIWeakReference extends nsISupports { static final int LAST_METHOD_ID = ( nsISupports . LAST_METHOD_ID ) + 1 ; public static final String NS_IWEAKREFERENCE_IID_STRING = "9188bc85-f92e-11d2-81ef-0060083a0bcf" ; public static final nsID NS_IWEAKREFERENCE_IID = new nsID ( nsIWeakReference . NS_IWEAKREFERENCE_IID_STRING ) ; public nsIWeakReference ( int address ) { } public int QueryReferent ( nsID uuid , int [ ] result ) { <START_BUG> return XPCOM . VtblCall ( ( ( super . LAST_METHOD_ID ) + 1 ) , getAddress ( ) , uuid , result ) ; <END_BUG> } }

Fix:
return XPCOM . VtblCall ( ( ( nsISupports . LAST_METHOD_ID ) + 1 ) , getAddress ( ) , uuid , result ) ;
Buggy code:
public class MonthGridAdapter extends ArrayAdapter < Calendar > { private static final int NUM_OF_DAYS_IN_WEEK = 7 ; private static final Calendar TODAY = Calendar . getInstance ( ) ; private Context mContext ; private Calendar mDay ; private Calendar mPointingDay ; private LayoutInflater mInflater ; private OnDayClickListener mOnDayClickListener ; private int mLine = 0 ; public MonthGridAdapter ( Context context , Calendar day , Calendar pointingDay ) { } private void init ( ) { } public void setOnDayClickListener ( OnDayClickListener onDayClickListener ) { } public int getLine ( ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { if ( convertView == null ) { convertView = mInflater . inflate ( view_month_item , null ) ; } final Calendar day = getItem ( position ) ; <START_BUG> TextView dayView = ( ( TextView ) ( convertView . findViewById ( content ) ) ) ; <END_BUG> dayView . setText ( ( "" + ( day . get ( Calendar . DATE ) ) ) ) ; convertView . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { if ( ( mOnDayClickListener ) != null ) { mOnDayClickListener . onDayClick ( day ) ; } } } ) ; if ( ( day . get ( Calendar . MONTH ) ) != ( mDay . get ( Calendar . MONTH ) ) ) { dayView . setTextColor ( GRAY ) ; } else if ( isSameDay ( day , mPointingDay ) ) { dayView . setBackgroundResource ( point ) ; dayView . setTextColor ( WHITE ) ; } else if ( isSameDay ( day , MonthGridAdapter . TODAY ) ) { dayView . setBackgroundResource ( today ) ; dayView . setTextColor ( WHITE ) ; } else if ( ( day . get ( Calendar . DAY_OF_WEEK ) ) == ( Calendar . SUNDAY ) ) { dayView . setTextColor ( RED ) ; } else if ( ( day . get ( Calendar . DAY_OF_WEEK ) ) == ( Calendar . SATURDAY ) ) { dayView . setTextColor ( BLUE ) ; } else { dayView . setBackgroundColor ( TRANSPARENT ) ; dayView . setTextColor ( BLACK ) ; } return convertView ; } private boolean isSameDay ( Calendar cal1 , Calendar cal2 ) { } public void setPointingDay ( Calendar pointingDay ) { } }

Fix:
TextView dayView = ( ( TextView ) ( convertView . findViewById ( month_view_item_content ) ) ) ;
Buggy code:
public final class Log { private static Logging logger = new LogCatLogger ( ) ; public static int v ( String tag , String message ) { <START_BUG> return android . util . Log . v ( tag , message ) ; <END_BUG> } public static int v ( String tag , String message , Throwable tr ) { } public static int d ( String tag , String message ) { } public static int d ( String tag , String message , Throwable tr ) { } public static int i ( String tag , String message ) { } public static int i ( String tag , String message , Throwable tr ) { } public static int w ( String tag , String message ) { } public static int w ( String tag , String message , Throwable tr ) { } public static int w ( String tag , Throwable tr ) { } public static int e ( String tag , String message ) { } public static int e ( String tag , String message , Throwable tr ) { } public static int e ( String message ) { } public static int e ( Throwable tr ) { } public static int e ( String msg , Throwable tr ) { } public static int wtf ( String tag , String message , Throwable tr ) { } public static int wtf ( String tag , Exception tr ) { } public static int wtf ( String tag , String message ) { } public static int wtf ( Throwable tr ) { } public static int logStackTrace ( String message ) { } public static String getStackTraceString ( Throwable tr ) { } public static void initLogger ( Logging log ) { } }

Fix:
return Log . logger . v ( tag , message ) ;
Buggy code:
class RequestMatcherClientHttpRequest extends MockClientHttpRequest implements ResponseActions { private final List < RequestMatcher > requestMatchers = new LinkedList < RequestMatcher > ( ) ; private ResponseCreator responseCreator ; public RequestMatcherClientHttpRequest ( RequestMatcher requestMatcher ) { } public ResponseActions andExpect ( RequestMatcher requestMatcher ) { } public void andRespond ( ResponseCreator responseCreator ) { } public ClientHttpResponse executeInternal ( ) throws IOException { if ( this . requestMatchers . isEmpty ( ) ) { throw new AssertionError ( "No<seq2seq4repair_space>request<seq2seq4repair_space>expectations<seq2seq4repair_space>to<seq2seq4repair_space>execute" ) ; } if ( ( this . responseCreator ) == null ) { throw new AssertionError ( ( "No<seq2seq4repair_space>ResponseCreator<seq2seq4repair_space>was<seq2seq4repair_space>set<seq2seq4repair_space>up.<seq2seq4repair_space>Add<seq2seq4repair_space>it<seq2seq4repair_space>after<seq2seq4repair_space>request<seq2seq4repair_space>expectations,<seq2seq4repair_space>" + "e.g.<seq2seq4repair_space>MockRestServiceServer.expect(requestTo(\"//foo\")).andRespond(withSuccess())" ) ) ; } for ( RequestMatcher requestMatcher : this . requestMatchers ) { requestMatcher . match ( this ) ; } setResponse ( this . responseCreator . createResponse ( this ) ) ; <START_BUG> return super . execute ( ) ; <END_BUG> } }

Fix:
return super . executeInternal ( ) ;
Buggy code:
public class User extends Actor { public static Array < Bullet > userBullets = new Array ( ) ; private Texture userImg ; private long lastShotTime ; private int atkSpeed ; private float moveSpeed ; private Touchpad movePad ; public User ( Touchpad move , float x , float y , float width , float height ) { } public User ( Touchpad move ) { } public int getDir ( ) { } @ Override public void act ( float delta ) { } @ Override public void draw ( Batch batch , float alpha ) { } public boolean overlaps ( Actor a ) { } public void move ( Vector2 direction ) { } public void checkScreenBoundsCollision ( ) { } public Bullet fireBullet ( Vector2 direction , float speed ) { <START_BUG> Bullet bullet = new Bullet ( direction . nor ( ) . scl ( 70 ) . scl ( 3 ) , speed , false , ( ( ( this . getX ( ) ) + ( ( this . getWidth ( ) ) // 2 ) ) - ( ( Constants . BULLET_WIDTH ) // 2 ) ) , ( ( ( this . getY ( ) ) + ( ( this . getHeight ( ) ) // 2 ) ) - ( ( Constants . BULLET_HEIGHT ) // 2 ) ) , Constants . BULLET_WIDTH , Constants . BULLET_HEIGHT ) ; <END_BUG> User . userBullets . add ( bullet ) ; lastShotTime = TimeUtils . nanoTime ( ) ; return bullet ; } public long getLastShotTime ( ) { } public int getAtkSpeed ( ) { } }

Fix:
Bullet bullet = new Bullet ( direction . scl ( ( 1 // ( Vector2 . len ( direction . x , direction . y ) ) ) ) . scl ( 100 ) , speed , false , ( ( ( this . getX ( ) ) + ( ( this . getWidth ( ) ) // 2 ) ) - ( ( Constants . BULLET_WIDTH ) // 2 ) ) , ( ( ( this . getY ( ) ) + ( ( this . getHeight ( ) ) // 2 ) ) - ( ( Constants . BULLET_HEIGHT ) // 2 ) ) , Constants . BULLET_WIDTH , Constants . BULLET_HEIGHT ) ;