nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ProjectileBehavior extends Behavior implements DEFObjectCollisionListener , PlayerCollisionListener , SurfaceImpactListener { public static final long LIFESPAN_MILLIS = 4500 ; private final int damageOnImpact ; private final DeathBehavior deathBehavior ; private final Projectile parent ; private WeakReference < WorldObject > honingTarget = new WeakReference < WorldObject > ( null ) ; private int honingAdjustmentUpdate = 0 ; private boolean honing = false ; private double speed ; private final MovesByVelocity movesByVelocity ; public ProjectileBehavior ( WorldObject parent , int damageOnImpact , ExplosionType explosionType , boolean honing ) { } public void reset ( Vector3D heading , double speed ) { } @ Override public void _tick ( long tickTimeMillis ) { if ( ( honingTarget ) != null ) { if ( ( honingTarget . get ( ) ) == null ) return ; if ( ( ( ( honingAdjustmentUpdate ) ++ ) % 5 ) == 0 ) { if ( ! ( honingTarget . get ( ) . isVisible ( ) ) ) return ; <START_BUG> final Vector3D honingVector = new Vector3D ( honingTarget . get ( ) . getPosition ( ) ) . subtract ( new Vector3D ( getParent ( ) . getPosition ( ) ) ) . normalize ( ) ; <END_BUG> if ( Double . isNaN ( honingVector . getX ( ) ) ) return ; if ( Double . isNaN ( honingVector . getY ( ) ) ) return ; if ( Double . isNaN ( honingVector . getZ ( ) ) ) return ; getParent ( ) . getBehavior ( ) . probeForBehavior ( AutoLeveling . class ) . setLevelingVector ( honingVector ) ; movesByVelocity . setVelocity ( getParent ( ) . getHeading ( ) . scalarMultiply ( speed ) ) ; } } } @ Override public void collidedWithSurface ( WorldObject wo , double [ ] surfaceNormal ) { } @ Override public void collidedWithDEFObject ( DEFObject other ) { } public void forceCollision ( WorldObject other ) { } @ Override public void collidedWithPlayer ( Player other ) { } }

Fix:
final Vector3D honingVector = new Vector3D ( honingTarget . get ( ) . getPositionWithOffset ( ) ) . subtract ( new Vector3D ( getParent ( ) . getPosition ( ) ) ) . normalize ( ) ;
Buggy code:
public class GameScreen implements Screen { Skin skin ; Stage stage ; MainGame g ; private static final float GRAVITY = 450 ; private static final int BOARDX = 800 ; private static final int BOARDY = 480 ; private static final float TERMINALVEL = - 300 ; private OrthographicCamera camera ; private ShapeRenderer shapeRenderer ; private Player1 player1 ; private Player2 player2 ; private Player [ ] players ; private FileHandle testMap ; private MapDrawer mapDrawer ; private JumpRenew [ ] renewButtons ; private Rectangle intersectionPlayers ; private Map map ; public GameScreen ( MainGame g ) { } public GameScreen ( ) { } public void create ( ) { stage = new Stage ( ) ; input . setInputProcessor ( stage ) ; camera = new OrthographicCamera ( ) ; camera . setToOrtho ( false , GameScreen . BOARDX , GameScreen . BOARDY ) ; shapeRenderer = new ShapeRenderer ( ) ; renewButtons = new JumpRenew [ 6 ] ; renewButtons [ 0 ] = new JumpRenew ( 100 , 100 ) ; renewButtons [ 1 ] = new JumpRenew ( 100 , 200 ) ; renewButtons [ 2 ] = new JumpRenew ( 100 , 300 ) ; renewButtons [ 3 ] = new JumpRenew ( 100 , 400 ) ; renewButtons [ 4 ] = new JumpRenew ( 100 , 500 ) ; renewButtons [ 5 ] = new JumpRenew ( 100 , 600 ) ; <START_BUG> setUpLevel ( "level0.bmp" ) ; <END_BUG> intersectionPlayers = new Rectangle ( ) ; System . out . println ( ) ; } public void setUpLevel ( String level ) { } public void render ( float delta ) { } private void draw ( ) { } private void handleInput ( ) { } private void updatePlayers ( ) { } public static int getBoardHeight ( ) { } public static int getBoardWidth ( ) { } @ Override public void resize ( int width , int height ) { } @ Override public void dispose ( ) { } @ Override public void show ( ) { } @ Override public void hide ( ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } }

Fix:
setUpLevel ( "level0.jpg" ) ;
Buggy code:
public class Matcher { public static List < User > match ( User user ) throws NoMatchFoundException { } public static List < User > filterBySex ( User user , List < User > users ) { } public static List < User > filterByLocation ( User user , List < User > users ) { } public static List < User > removeLikes ( User user , List < User > users ) { } public static List < User > orderByCommonInterest ( User user , List < User > users ) { Map < User , Integer > userRatings = new HashMap < > ( ) ; for ( User u : users ) { userRatings . put ( u , Matcher . countCommonInterests ( user , u ) ) ; } userRatings = Utils . sortByValue ( userRatings ) ; for ( Map . Entry < User , Integer > e : userRatings . entrySet ( ) ) { Logger . info ( ( ( ( e . getKey ( ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( e . getValue ( ) ) ) ) ; } List < User > matches = new ArrayList < > ( ) ; Iterator < Map . Entry < User , Integer > > entrySetIterator = userRatings . entrySet ( ) . iterator ( ) ; for ( int i = 0 ; i < ( userRatings . size ( ) ) ; i ++ ) { Map . Entry < User , Integer > entry = entrySetIterator . next ( ) ; <START_BUG> matches . add ( i , entry . getKey ( ) ) ; <END_BUG> } return matches ; } private static int countCommonInterests ( User user , User match ) { } }

Fix:
matches . add ( entry . getKey ( ) ) ;
Buggy code:
public class CrawlerConsole { public static void main ( String [ ] args ) { InteractiveQuery i = new InteractiveQuery ( ) ; i . setResultsPrinter ( new ResultsPrinter ( ) { @ Override public void printResult ( Result r ) { WebDocument wd = ( ( WebDocument ) ( r . getDocument ( ) ) ) ; if ( r instanceof RankedResult ) { <START_BUG> DecimalFormat df = new DecimalFormat ( "0.000" ) ; <END_BUG> RankedResult rR = ( ( RankedResult ) ( r ) ) ; System . out . print ( ( ( ( ( ( rR . getDocument ( ) . getId ( ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( df . format ( rR . getRank ( ) ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( wd . getUrl ( ) ) ) ) ; System . out . println ( ( "\t" + ( rR . getDocument ( ) . getTitle ( ) ) ) ) ; } else { System . out . print ( ( ( ( r . getDocument ( ) . getId ( ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( wd . getUrl ( ) ) ) ) ; System . out . println ( ( "\t" + ( r . getDocument ( ) . getTitle ( ) ) ) ) ; } } } ) ; i . run ( ) ; } }

Fix:
DecimalFormat df = new DecimalFormat ( "0.00000000" ) ;
Buggy code:
public class HeaderTableMouseListener extends MouseAdapter { private TableController headerTableViewer ; private ViewMessageAction viewMessageAction ; public HeaderTableMouseListener ( TableController headerTableViewer ) { } protected void processPopup ( final MouseEvent event ) { } public void mousePressed ( MouseEvent event ) { } public void mouseClicked ( MouseEvent event ) { } protected void processDoubleClick ( ) { int selectedRow = headerTableViewer . getView ( ) . getSelectedRow ( ) ; <START_BUG> MessageNode node = ( ( MessageNode ) ( headerTableViewer . getHeaderTableModel ( ) . getValueAt ( selectedRow , 0 ) ) ) ; <END_BUG> boolean markedAsDraft = node . getHeader ( ) . getFlags ( ) . getDraft ( ) ; if ( markedAsDraft ) { new org . columba . mail . gui . table . action . OpenMessageWithComposerAction ( headerTableViewer . getFrameController ( ) ) . actionPerformed ( null ) ; } else { new org . columba . mail . gui . table . action . OpenMessageWithMessageFrameAction ( headerTableViewer . getFrameController ( ) ) . actionPerformed ( null ) ; } } public void mouseReleased ( MouseEvent event ) { } }

Fix:
MessageNode node = ( ( MessageNode ) ( headerTableViewer . getHeaderTableModel ( ) . getMessageNodeAtRow ( selectedRow ) ) ) ;
Buggy code:
public class FileMetaDataIterator implements MetaDataIterator { private static final long SCAN_LIMIT = 100000 ; private static final Localizer _loc = Localizer . forPackage ( FileMetaDataIterator . class ) ; private final Iterator _itr ; private File _file = null ; public FileMetaDataIterator ( File file ) { } public FileMetaDataIterator ( File dir , MetaDataFilter filter ) throws IOException { } private int scan ( File file , MetaDataFilter filter , FileMetaDataIterator . FileResource rsrc , Collection metas , int scanned ) throws IOException { if ( scanned > ( FileMetaDataIterator . SCAN_LIMIT ) ) <START_BUG> throw new IllegalStateException ( FileMetaDataIterator . _loc . get ( "too-many-files" , String . valueOf ( FileMetaDataIterator . SCAN_LIMIT ) ) ) ; <END_BUG> scanned ++ ; if ( filter == null ) metas . add ( file ) ; else { rsrc . setFile ( file ) ; if ( filter . matches ( rsrc ) ) metas . add ( file ) ; else { File [ ] files = file . listFiles ( ) ; if ( files != null ) for ( int i = 0 ; i < ( files . length ) ; i ++ ) scanned = scan ( files [ i ] , filter , rsrc , metas , scanned ) ; } } return scanned ; } public boolean hasNext ( ) { } public Object next ( ) throws IOException { } public InputStream getInputStream ( ) throws IOException { } public File getFile ( ) { } public void close ( ) { } private static class FileResource implements MetaDataFilter . Resource { private File _file = null ; public void setFile ( File file ) { } public String getName ( ) { } public byte [ ] getContent ( ) throws IOException { } } }

Fix:
throw new IllegalStateException ( FileMetaDataIterator . _loc . get ( "too-many-files" , String . valueOf ( FileMetaDataIterator . SCAN_LIMIT ) ) . getMessage ( ) ) ;
Buggy code:
public abstract class AbstractDatatypeValidator implements Cloneable , DatatypeValidator { protected DatatypeValidator fBaseValidator = null ; protected String fPattern = null ; protected RegularExpression fRegex = null ; protected short fFacetsDefined = 0 ; protected DatatypeMessageProvider fMessageProvider = new DatatypeMessageProvider ( ) ; protected Locale fLocale = null ; protected short fFlags = 0 ; protected XMLErrorReporter fErrorReporter = null ; <START_BUG> public abstract Object validate ( String content , Object state ) throws InvalidDatatypeValueException ; <END_BUG> public abstract Object clone ( ) throws CloneNotSupportedException { } public short getWSFacet ( ) { } public DatatypeValidator getBaseValidator ( ) { } protected String getErrorString ( String key , Object [ ] args ) { } public void setLocale ( Locale locale ) { } public short getXSType ( ) { } public String fLocalName = null ; public String getXSTypeName ( ) { } protected int fFinalSet = 0 ; public int getFinalSet ( ) { } public void setFinalSet ( int finalSet ) { } }

Fix:
public abstract Object validate ( String content , ValidationContext state ) throws InvalidDatatypeValueException ;
Buggy code:
public abstract class Openable extends JavaElement implements IBufferChangedListener , IOpenable { protected Openable ( JavaElement parent ) { } public void bufferChanged ( BufferChangedEvent event ) { if ( event . getBuffer ( ) . isClosed ( ) ) { JavaModelManager . getJavaModelManager ( ) . getElementsOutOfSynchWithBuffers ( ) . remove ( this ) ; getBufferManager ( ) . removeBuffer ( event . getBuffer ( ) ) ; } else { <START_BUG> JavaModelManager . getJavaModelManager ( ) . getElementsOutOfSynchWithBuffers ( ) . put ( this , this ) ; <END_BUG> } } protected abstract boolean buildStructure ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } public boolean canBeRemovedFromCache ( ) { } public boolean canBufferBeRemovedFromCache ( IBuffer buffer ) { } protected void closeBuffer ( ) { } protected void closing ( Object info ) { } protected void codeComplete ( ICompilationUnit cu , ICompilationUnit unitToSkip , int position , CompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { } protected IJavaElement [ ] codeSelect ( ICompilationUnit cu , int offset , int length , WorkingCopyOwner owner ) throws JavaModelException { } protected Object createElementInfo ( ) { } public boolean exists ( ) { } protected void generateInfos ( Object info , HashMap newElements , IProgressMonitor monitor ) throws JavaModelException { } public IBuffer getBuffer ( ) throws JavaModelException { } public IBufferFactory getBufferFactory ( ) { } protected BufferManager getBufferManager ( ) { } public IResource getCorrespondingResource ( ) throws JavaModelException { } public IOpenable getOpenable ( ) { } public IResource getUnderlyingResource ( ) throws JavaModelException { } protected boolean hasBuffer ( ) { } public boolean hasUnsavedChanges ( ) throws JavaModelException { } public boolean isConsistent ( ) { } public boolean isOpen ( ) { } protected boolean isSourceElement ( ) { } public boolean isStructureKnown ( ) throws JavaModelException { } public void makeConsistent ( IProgressMonitor monitor ) throws JavaModelException { } public void open ( IProgressMonitor pm ) throws JavaModelException { } protected IBuffer openBuffer ( IProgressMonitor pm , Object info ) throws JavaModelException { } protected void openParent ( Object childInfo , HashMap newElements , IProgressMonitor pm ) throws JavaModelException { } protected boolean parentExists ( ) { } protected boolean resourceExists ( ) { } public void save ( IProgressMonitor pm , boolean force ) throws JavaModelException { } public PackageFragmentRoot getPackageFragmentRoot ( ) { } }

Fix:
JavaModelManager . getJavaModelManager ( ) . getElementsOutOfSynchWithBuffers ( ) . add ( this ) ;
Buggy code:
public class ZooKeeperTransactionAllocaterTest { TestingServer zkTestServer ; ZooKeeperTransactionsAllocater allocater ; List < String > createdTXIds = new ArrayList < String > ( ) ; List < Throwable > failures = new ArrayList < Throwable > ( ) ; Set < String > activeTX = new HashSet < String > ( ) ; volatile boolean shutdown = false ; private Random random = new Random ( ) ; @ Before public void startZookeeper ( ) throws Exception { } private int runTest ( ) throws InterruptedException { } @ Test public void test ( ) throws InterruptedException { } public void recoveryTest ( ) throws InterruptedException { } private class TXRequester implements Runnable { int s = 0 ; public void run ( ) { <START_BUG> while ( ( ( s ) < 20 ) && ( ! ( shutdown ) ) ) { <END_BUG> ( s ) ++ ; try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { } try { String txID = allocater . getTransaction ( ) ; synchronized ( activeTX ) { assert ! ( activeTX . contains ( txID ) ) ; activeTX . add ( txID ) ; activeTX . notify ( ) ; } try { Thread . sleep ( ( 200 + ( ( Math . abs ( random . nextInt ( ) ) ) % 200 ) ) ) ; } catch ( InterruptedException e ) { } allocater . releaseTransaction ( txID ) ; synchronized ( activeTX ) { activeTX . remove ( txID ) ; } } catch ( Throwable e ) { synchronized ( failures ) { failures . add ( e ) ; shutdown = true ; } } } } } @ After public void stopZookeeper ( ) throws IOException , InterruptedException { } }

Fix:
while ( ( ( s ) < 10 ) && ( ! ( shutdown ) ) ) {
Buggy code:
public class BeanShellServer implements Runnable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private final int serverport ; private final String serverfile ; public BeanShellServer ( int port , String file ) { } static String getprop ( String s ) { } static void setprop ( String s , String v ) { } public void run ( ) { ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; try { Class < ? > Interpreter = loader . loadClass ( "bsh.Interpreter" ) ; Object instance = Interpreter . newInstance ( ) ; Class < String > string = String . class ; Class < Object > object = Object . class ; Method eval = Interpreter . getMethod ( "eval" , new Class [ ] { string } ) ; Method setObj = Interpreter . getMethod ( "set" , new Class [ ] { string , object } ) ; Method setInt = Interpreter . getMethod ( "set" , new Class [ ] { string , int . class } ) ; Method source = Interpreter . getMethod ( "source" , new Class [ ] { string } ) ; setObj . invoke ( instance , new Object [ ] { "t" , this } ) ; <START_BUG> setInt . invoke ( instance , new Object [ ] { "portnum" , new Integer ( serverport ) } ) ; <END_BUG> if ( ( serverfile . length ( ) ) > 0 ) { try { source . invoke ( instance , new Object [ ] { serverfile } ) ; } catch ( InvocationTargetException e1 ) { BeanShellServer . log . warn ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>source<seq2seq4repair_space>" + ( serverfile ) ) ) ; Throwable t = e1 . getCause ( ) ; if ( t != null ) { BeanShellServer . log . warn ( t . toString ( ) ) ; } } } eval . invoke ( instance , new Object [ ] { "setAccessibility(true);" } ) ; eval . invoke ( instance , new Object [ ] { "server(portnum);" } ) ; } catch ( ClassNotFoundException e ) { BeanShellServer . log . error ( "Beanshell<seq2seq4repair_space>Interpreter<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } catch ( Exception e ) { BeanShellServer . log . error ( "Problem<seq2seq4repair_space>starting<seq2seq4repair_space>BeanShell<seq2seq4repair_space>server<seq2seq4repair_space>" , e ) ; } } }

Fix:
setInt . invoke ( instance , new Object [ ] { "portnum" , Integer . valueOf ( serverport ) } ) ;
Buggy code:
public class TicTacToePanel extends JPanel { private LinkedList < JLabel > labels = new LinkedList < > ( ) ; private Color spieler1 = Color . yellow ; private Color spieler2 = Color . red ; private TicTacToeGewinnabfrage tttg ; private TicTacToeKI tttki = new TicTacToeKI ( ) ; private int gameMode = 0 ; private int player = 1 ; private int beginner = 1 ; private GameClient gc ; private boolean myTurn = false ; private boolean gameOver ; private PlayerGUI pgui ; private boolean ok = true ; public Color getSpieler1 ( ) { } public TicTacToePanel ( GameClient gc , PlayerGUI pgui ) { } public boolean isOk ( ) { } public boolean isMyTurn ( ) { } public void setMyTurn ( boolean myTurn ) { } private TicTacToePanel getInstance ( ) { } public void sendGoHome ( ) { if ( gc . isConnected ( ) ) { try { <START_BUG> if ( ( ( gameMode ) == 2 ) && ( ! ( gameOver ) ) ) { <END_BUG> gc . sendObject ( "##GO##HOME##" ) ; } } catch ( IOException ex ) { Logger . getLogger ( TicTacToePanel . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } catch ( ClassNotFoundException ex ) { Logger . getLogger ( TicTacToePanel . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } } private void initComponents ( ) { } public void changeLabelState ( boolean b ) { } private void onMouseClicked ( MouseEvent e ) throws IOException , ClassNotFoundException { } private void restart ( ) { } private JPopupMenu popupmenu ; private JMenuItem miRestartSinglePlayer ; private JMenuItem miRestartOfflineMultiplayer ; private JMenuItem miRestartOnlineMultiplayer ; }

Fix:
if ( ( gameMode ) == 2 ) {
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class MapBasedInitialContextEjbClientTestCase { private static final String ARCHIVE_NAME = "map-based-client-1" ; @ Deployment public static Archive < ? > getDeployment ( ) { } @ Test public void testScopedEJBClientContexts ( ) throws Exception { <START_BUG> InitialContext ctx = new InitialContext ( getEjbClientProperties ( System . getProperty ( "node0" , "127.0.0.1" ) , 8080 ) ) ; <END_BUG> try { String lookupName = ( ( ( ( "ejb://" + ( MapBasedInitialContextEjbClientTestCase . ARCHIVE_NAME ) ) + "//" ) + ( StatelessBean . class . getSimpleName ( ) ) ) + "!" ) + ( StatelessIface . class . getCanonicalName ( ) ) ; StatelessIface beanStateless = ( ( StatelessIface ) ( ctx . lookup ( lookupName ) ) ) ; Assert . assertEquals ( "Unexpected<seq2seq4repair_space>EJB<seq2seq4repair_space>client<seq2seq4repair_space>context<seq2seq4repair_space>used<seq2seq4repair_space>for<seq2seq4repair_space>invoking<seq2seq4repair_space>stateless<seq2seq4repair_space>bean" , USER_NAME , beanStateless . getCallerPrincipalName ( ) ) ; lookupName = ( ( ( ( ( "ejb://" + ( MapBasedInitialContextEjbClientTestCase . ARCHIVE_NAME ) ) + "//" ) + ( StatefulBean . class . getSimpleName ( ) ) ) + "!" ) + ( StatefulIface . class . getCanonicalName ( ) ) ) + "?stateful" ; StatefulIface beanStateful = ( ( StatefulIface ) ( ctx . lookup ( lookupName ) ) ) ; Assert . assertEquals ( "Unexpected<seq2seq4repair_space>EJB<seq2seq4repair_space>client<seq2seq4repair_space>context<seq2seq4repair_space>used<seq2seq4repair_space>for<seq2seq4repair_space>invoking<seq2seq4repair_space>stateful<seq2seq4repair_space>bean" , USER_NAME , beanStateful . getCallerPrincipalName ( ) ) ; ctx . close ( ) ; } finally { ctx . close ( ) ; } } private Properties getEjbClientProperties ( String node , int port ) { } }

Fix:
InitialContext ctx = new InitialContext ( getEjbClientProperties ( System . getProperty ( "node0" , "127.0.0.1" ) , 4447 ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) @ WebServlet ( "//trelloURL" ) public class TrelloServlet extends HttpServlet { @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String inUrl = request . getParameter ( "userUrl" ) ; <START_BUG> if ( ( inUrl == null ) || ( inUrl . isEmpty ( ) ) ) { <END_BUG> errorOuput ( request , response ) ; return ; } try { Main . writeCSVFileFromURL ( inUrl ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } String filePath = "//Users//Atkinson//Documents//trallo.csv" ; File downloadFile = new File ( filePath ) ; FileInputStream inStream = new FileInputStream ( downloadFile ) ; ServletContext context = getServletContext ( ) ; response . setContentType ( "text//csv" ) ; response . setContentLength ( ( ( int ) ( downloadFile . length ( ) ) ) ) ; String headerKey = "Content-Disposition" ; String headerValue = String . format ( "attachment;<seq2seq4repair_space>filename=\"%s\"" , downloadFile . getName ( ) ) ; response . setHeader ( headerKey , headerValue ) ; OutputStream outStream = response . getOutputStream ( ) ; byte [ ] buffer = new byte [ 4096 ] ; int bytesRead = - 1 ; while ( ( bytesRead = inStream . read ( buffer ) ) != ( - 1 ) ) { outStream . write ( buffer , 0 , bytesRead ) ; } inStream . close ( ) ; outStream . close ( ) ; } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ SuppressWarnings ( "unused" ) private void errorOuput ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
if ( ( ( inUrl == null ) || ( inUrl . isEmpty ( ) ) ) || ( ! ( inUrl . startsWith ( "https:////trello.com//" ) ) ) ) {
Buggy code:
public class ExpireTripExecutor extends AbstractScheduledTaskExecutor { private static final long MAX_ARRIVAL_DELAY = ( 12 * 60 ) * 60 ; private TripOfferDAO tripOfferDAO ; private TripsManager tripsManager ; @ Inject ExpireTripExecutor ( TripOfferDAO tripOfferDAO , TripsManager tripsManager , SessionFactory sessionFactory , LogManager logManager ) { } @ Override protected void doRun ( ) throws Exception { for ( TripOffer offer : tripOfferDAO . findAll ( ) ) { <START_BUG> if ( ( ( offer . getEstimatedArrivalTimeInSeconds ( ) ) + ( ExpireTripExecutor . MAX_ARRIVAL_DELAY ) ) > ( System . currentTimeMillis ( ) ) ) { <END_BUG> logManager . d ( ( ( "Offer<seq2seq4repair_space>" + ( offer . getId ( ) ) ) + "<seq2seq4repair_space>expired<seq2seq4repair_space>and<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>deleted" ) ) ; tripsManager . updateOffer ( offer , TripOfferUpdate . createCancelUpdate ( ) ) ; } } } }

Fix:
if ( ( ( offer . getEstimatedArrivalTimeInSeconds ( ) ) + ( ExpireTripExecutor . MAX_ARRIVAL_DELAY ) ) > ( ( System . currentTimeMillis ( ) ) // 1000 ) ) {
Buggy code:
public class customList extends ArrayAdapter < ParseObject > { List < ParseObject > res ; View customView ; public customList ( Context context , List < ParseObject > resource ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { LayoutInflater inflater = LayoutInflater . from ( getContext ( ) ) ; customView = inflater . inflate ( feedquest , parent , false ) ; TextView feedView = ( ( TextView ) ( customView . findViewById ( listText ) ) ) ; final ImageView img = ( ( ImageView ) ( customView . findViewById ( picView ) ) ) ; <START_BUG> String singleDescription = res . get ( position ) . getString ( "description" ) ; <END_BUG> ParseFile fileObject = res . get ( position ) . getParseFile ( "image" ) ; fileObject . getDataInBackground ( new GetDataCallback ( ) { public void done ( byte [ ] data , ParseException e ) { if ( e == null ) { Log . d ( "test" , "We've<seq2seq4repair_space>got<seq2seq4repair_space>data<seq2seq4repair_space>in<seq2seq4repair_space>data." ) ; byte [ ] bitpic = data ; Bitmap bitmap = BitmapFactory . decodeByteArray ( bitpic , 0 , bitpic . length ) ; img . setImageBitmap ( bitmap ) ; } else { Log . d ( "test" , "There<seq2seq4repair_space>was<seq2seq4repair_space>a<seq2seq4repair_space>problem<seq2seq4repair_space>downloading<seq2seq4repair_space>the<seq2seq4repair_space>data." ) ; } } } ) ; feedView . setText ( singleDescription ) ; return customView ; } }

Fix:
String singleDescription = res . get ( position ) . getString ( "title" ) ;
Buggy code:
public class RequestThread extends Thread { public RequestThread ( Socket socket , File rootDir , String stringIP ) { } private static void sendHeader ( BufferedOutputStream out , int code , String contentType , long contentLength , long lastModified ) throws IOException { } private static void sendError ( BufferedOutputStream out , int code , String message ) throws IOException { } public void run ( ) { InputStream reader = null ; try { _socket . setSoTimeout ( 30000 ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( _socket . getInputStream ( ) ) ) ; BufferedOutputStream out = new BufferedOutputStream ( _socket . getOutputStream ( ) ) ; String request = in . readLine ( ) ; if ( ( ( request == null ) || ( ! ( request . startsWith ( "GET<seq2seq4repair_space>" ) ) ) ) || ( ! ( ( request . endsWith ( "<seq2seq4repair_space>HTTP//1.0" ) ) || ( request . endsWith ( "HTTP//1.1" ) ) ) ) ) { RequestThread . sendError ( out , 500 , "Invalid<seq2seq4repair_space>Method." ) ; return ; } String path = request . substring ( 4 , ( ( request . length ( ) ) - 9 ) ) ; File file = new File ( _rootDir , URLDecoder . decode ( path , "UTF-8" ) ) . getCanonicalFile ( ) ; if ( file . isDirectory ( ) ) { File indexFile = new File ( file , "index.html" ) ; if ( ( indexFile . exists ( ) ) && ( ! ( indexFile . isDirectory ( ) ) ) ) { file = indexFile ; } } if ( ! ( file . toString ( ) . startsWith ( _rootDir . toString ( ) ) ) ) { RequestThread . sendError ( out , 403 , "Permission<seq2seq4repair_space>Denied." ) ; } else if ( ! ( file . exists ( ) ) ) { RequestThread . sendError ( out , 404 , "File<seq2seq4repair_space>Not<seq2seq4repair_space>Found." ) ; } else if ( file . isDirectory ( ) ) { if ( ! ( path . endsWith ( "//" ) ) ) { path = path + "//" ; } File [ ] files = file . listFiles ( ) ; RequestThread . sendHeader ( out , 200 , "text//html" , ( - 1 ) , System . currentTimeMillis ( ) ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { file = files [ i ] ; String filename = file . getName ( ) ; if ( filename . endsWith ( "manifest" ) ) <START_BUG> out . write ( ( ( ( ( "http:////" + ( _stringIP ) ) + "//" ) + filename ) + "\n" ) . getBytes ( ) ) ; <END_BUG> } } else { reader = new BufferedInputStream ( new FileInputStream ( file ) ) ; String contentType = ( ( String ) ( MIME_TYPES . get ( SimpleWebServer . getExtension ( file ) ) ) ) ; if ( contentType == null ) { contentType = "application//octet-stream" ; } RequestThread . sendHeader ( out , 200 , contentType , file . length ( ) , file . lastModified ( ) ) ; byte [ ] buffer = new byte [ 4096 ] ; int bytesRead ; while ( ( bytesRead = reader . read ( buffer ) ) != ( - 1 ) ) { out . write ( buffer , 0 , bytesRead ) ; } reader . close ( ) ; } out . flush ( ) ; out . close ( ) ; } catch ( IOException e ) { if ( reader != null ) { try { reader . close ( ) ; } catch ( Exception anye ) { } } } } private File _rootDir ; private Socket _socket ; private String _stringIP ; No newline ; at end ; of file ; }

Fix:
out . write ( ( ( ( ( "\nhttp:////" + ( _stringIP ) ) + "//" ) + filename ) + "\n" ) . getBytes ( ) ) ;
Buggy code:
public class ParentResourceEscapePathTest extends WicketTestCase { public void testParentEscapeSequenceInRenderedHtml ( ) throws Exception { } private void parentEscapeSequenceInRenderedHtml ( ) { } private void assertContains ( String html , String expected ) { } public void testResourceUrlGeneratedByResourceReference ( ) { } private void resourceUrlGeneratedByResourceReference ( ) { final ResourceReference ref = new PackageResourceReference ( ParentResourceEscapePathTestPage . class , "..//..//..//ParentResourceTest.js" ) ; <START_BUG> assertEquals ( expectedResourceUrl ( ) , tester . getRequestCycle ( ) . urlFor ( ref ) ) ; <END_BUG> } public void testRequestHandlingOfResourceUrlWithEscapeStringInside ( ) { } private void requestHandlingOfResourceUrlWithEscapeStringInside ( ) { } private String expectedResourceUrl ( ) { } }

Fix:
assertEquals ( expectedResourceUrl ( ) , tester . getLastRequestCycle ( ) . urlFor ( ref ) ) ;
Buggy code:
public abstract class AbstractHeaderCache { protected HeaderList headerList ; protected File headerFile ; protected boolean headerCacheAlreadyLoaded ; protected LocalFolder folder ; public AbstractHeaderCache ( LocalFolder folder ) { } public HeaderInterface createHeaderInstance ( ) { } public boolean isHeaderCacheAlreadyLoaded ( ) { } public boolean exists ( Object uid ) throws Exception { } public int count ( ) { } public void remove ( Object uid ) throws Exception { } public void add ( HeaderInterface header ) throws Exception { } public HeaderList getHeaderList ( WorkerStatusController worker ) throws Exception { } public void load ( WorkerStatusController worker ) throws Exception { log . info ( ( "loading<seq2seq4repair_space>header-cache=" + ( headerFile ) ) ) ; FileInputStream istream = new FileInputStream ( headerFile . getPath ( ) ) ; ObjectInputStream p = new ObjectInputStream ( istream ) ; int capacity = p . readInt ( ) ; log . info ( ( "capacity=" + capacity ) ) ; if ( capacity != ( folder . getDataStorageInstance ( ) . getMessageCount ( ) ) ) { headerList = folder . getDataStorageInstance ( ) . recreateHeaderList ( worker ) ; return ; } headerList = new HeaderList ( capacity ) ; Integer uid ; worker . setDisplayText ( "Loading<seq2seq4repair_space>headers<seq2seq4repair_space>from<seq2seq4repair_space>cache..." ) ; if ( worker != null ) worker . setProgressBarMaximum ( capacity ) ; int nextUid = - 1 ; for ( int i = 1 ; i <= capacity ; i ++ ) { if ( worker != null ) worker . setProgressBarValue ( i ) ; HeaderInterface h = createHeaderInstance ( ) ; loadHeader ( p , h ) ; headerList . add ( h , ( ( Integer ) ( h . get ( "columba.uid" ) ) ) ) ; if ( h . get ( "columba.flags.recent" ) . equals ( Boolean . TRUE ) ) folder . getMessageFolderInfo ( ) . incRecent ( ) ; if ( h . get ( "columba.flags.seen" ) . equals ( Boolean . FALSE ) ) folder . getMessageFolderInfo ( ) . incUnseen ( ) ; folder . getMessageFolderInfo ( ) . incExists ( ) ; int aktUid = ( ( Integer ) ( h . get ( "columba.uid" ) ) ) . intValue ( ) ; if ( nextUid < aktUid ) nextUid = aktUid ; } nextUid ++ ; log . debug ( ( "next<seq2seq4repair_space>UID<seq2seq4repair_space>for<seq2seq4repair_space>new<seq2seq4repair_space>messages<seq2seq4repair_space>=" + nextUid ) ) ; <START_BUG> folder . setNextUid ( nextUid ) ; <END_BUG> p . close ( ) ; } public void save ( WorkerStatusController worker ) throws Exception { } protected abstract void loadHeader ( ObjectInputStream p , HeaderInterface h ) throws Exception { } protected abstract void saveHeader ( ObjectOutputStream p , HeaderInterface h ) throws Exception { } }

Fix:
folder . setNextMessageUid ( nextUid ) ;
Buggy code:
public class FieldTranslator { private static final int ALPHABET_SIZE = 26 ; private static String getExcelStyleLetterIndex ( int numericIndex ) { } public TextFieldMeta translateTextField ( String name , Integer columns , List < RightAnswer > rightAnswers , String help , String hint ) { } public MemoFieldMeta translateMemoField ( String name , Integer columns , Integer rows , String help , String hint ) { } public SelectFieldMeta translateOptionList ( String name , String listType , List < OptionListOption > options ) { List < SelectFieldOptionMeta > translatedOptions = new ArrayList < > ( ) ; for ( OptionListOption option : options ) { <START_BUG> translatedOptions . add ( new SelectFieldOptionMeta ( option . getName ( ) , option . getPoints ( ) , option . getText ( ) ) ) ; <END_BUG> } String newListType = listType ; if ( "radio" . equals ( listType ) ) { newListType = "radio-vertical" ; } else if ( "radio_horz" . equals ( listType ) ) { newListType = "radio-horizontal" ; } return new SelectFieldMeta ( name , newListType , translatedOptions ) ; } public MultiSelectFieldMeta translateChecklistField ( String paramName , List < MultiSelectFieldOptionMeta > options ) { } public ConnectFieldMeta translateConnectField ( String name , List < ConnectFieldOption > options ) { } public FileFieldMeta translateFileField ( String name , String help , String hint ) { } }

Fix:
translatedOptions . add ( new SelectFieldOptionMeta ( option . getName ( ) , ( ( ( option . getPoints ( ) ) != null ) && ( ( option . getPoints ( ) ) > 0 ) ) , option . getText ( ) ) ) ;
Buggy code:
public class Mutex { private boolean mutex ; public Mutex ( ) { } public synchronized void lock ( ) { } public synchronized void release ( ) { mutex = false ; <START_BUG> notifyAll ( ) ; <END_BUG> } }

Fix:
notify ( ) ;
Buggy code:
class TableModelClassByProps extends TableModelComposite { public TableModelClassByProps ( ) { } public void initColumns ( ) { } public Vector rowObjectsFor ( Object t ) { if ( ! ( t instanceof UMLClassDiagram ) ) return new Vector ( ) ; UMLClassDiagram d = ( ( UMLClassDiagram ) ( t ) ) ; <START_BUG> Vector nodes = d . getGraphModel ( ) . getNodes ( ) ; <END_BUG> Vector res = new Vector ( ) ; int size = nodes . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { Object node = nodes . elementAt ( i ) ; if ( node instanceof MMClass ) res . addElement ( node ) ; } return res ; } public String toString ( ) { } }

Fix:
Vector nodes = d . getNodes ( ) ;
Buggy code:
abstract class NS_CNAME_PTRRecord extends Record { protected Name target ; protected NS_CNAME_PTRRecord ( ) { } protected NS_CNAME_PTRRecord ( Name name , int type , int dclass , long ttl ) { } public NS_CNAME_PTRRecord ( Name name , int type , int dclass , long ttl , Name target ) { } <START_BUG> protected static Record rrFromWire ( NS_CNAME_PTRRecord rec , DataByteInputStream in ) throws IOException { <END_BUG> if ( in == null ) return rec ; rec . target = new Name ( in ) ; return rec ; } protected static Record rdataFromString ( NS_CNAME_PTRRecord rec , Tokenizer st , Name origin ) throws IOException { } public String rdataToString ( ) { } public Name getTarget ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
protected static Record rrFromWire ( NS_CNAME_PTRRecord rec , DNSInput in ) throws IOException {
Buggy code:
public class StringListAttributeDefinitionUnitTestCase { @ Test public void testExpressions ( ) throws OperationFailedException { <START_BUG> ListAttributeDefinition ld = new StringListAttributeDefinition . Builder ( "test" ) . setAllowExpression ( true ) . setValidator ( new StringLengthValidator ( 1 , false , true ) ) . build ( ) ; <END_BUG> ModelNode op = new ModelNode ( ) ; op . get ( "test" ) . add ( "abc" ) . add ( "${test:1}" ) ; ModelNode validated = ld . validateOperation ( op ) ; Assert . assertEquals ( op . get ( "test" ) . get ( 0 ) , validated . get ( 0 ) ) ; Assert . assertEquals ( new ModelNode ( ) . setExpression ( op . get ( "test" ) . get ( 1 ) . asString ( ) ) , validated . get ( 1 ) ) ; ModelNode model = new ModelNode ( ) ; ld . validateAndSet ( op , model ) ; Assert . assertEquals ( op . get ( "test" ) . get ( 0 ) , model . get ( "test" ) . get ( 0 ) ) ; Assert . assertEquals ( new ModelNode ( ) . setExpression ( op . get ( "test" ) . get ( 1 ) . asString ( ) ) , model . get ( "test" ) . get ( 1 ) ) ; } }

Fix:
ListAttributeDefinition ld = new StringListAttributeDefinition . Builder ( "test" ) . setAllowExpression ( true ) . setElementValidator ( new StringLengthValidator ( 1 , false , true ) ) . build ( ) ;
Buggy code:
public class VaultDescriptions { private static final String RESOURCE_NAME = ( VaultDescriptions . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; public static ModelNode getVaultDescription ( Locale locale ) { } public static ModelNode getVaultAddDescription ( Locale locale ) { final ResourceBundle bundle = VaultDescriptions . getResourceBundle ( locale ) ; final ModelNode node = new ModelNode ( ) ; node . get ( ModelDescriptionConstants . OPERATION_NAME ) . set ( ModelDescriptionConstants . ADD ) ; <START_BUG> node . get ( ModelDescriptionConstants . DESCRIPTION ) . set ( bundle . getString ( "jvm.add" ) ) ; <END_BUG> node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , CODE . getLocalName ( ) , ModelDescriptionConstants . TYPE ) . set ( STRING ) ; node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , CODE . getLocalName ( ) , ModelDescriptionConstants . DESCRIPTION ) . set ( bundle . getString ( "vault.code" ) ) ; node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , CODE . getLocalName ( ) , ModelDescriptionConstants . REQUIRED ) . set ( false ) ; node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , VAULT_OPTION . getLocalName ( ) , ModelDescriptionConstants . DESCRIPTION ) . set ( bundle . getString ( "vault.option" ) ) ; node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , VAULT_OPTION . getLocalName ( ) , ModelDescriptionConstants . TYPE ) . set ( OBJECT ) ; node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , VAULT_OPTION . getLocalName ( ) , ModelDescriptionConstants . VALUE_TYPE ) . set ( STRING ) ; node . get ( ModelDescriptionConstants . REQUEST_PROPERTIES , VAULT_OPTION . getLocalName ( ) , ModelDescriptionConstants . REQUIRED ) . set ( false ) ; node . get ( ModelDescriptionConstants . REPLY_PROPERTIES ) . setEmptyObject ( ) ; return node ; } public static ModelNode getVaultRemoveDescription ( Locale locale ) { } private static ResourceBundle getResourceBundle ( Locale locale ) { } }

Fix:
node . get ( ModelDescriptionConstants . DESCRIPTION ) . set ( bundle . getString ( "vault.add" ) ) ;
Buggy code:
public class ResultViewActivity extends BasicActivity implements OnClickListener { private static final String TAG = "ResultViewActivity" ; private MapView mapView ; private static final ITileSource OSM_TILESOURCE = TileSourceFactory . MAPNIK ; private MapController mapController ; private MyLocationNewOverlay myLocationOverlay ; private static final int DEFAULT_ZOOM_LEVEL = 18 ; private static final ITileSource DEFAULT_TILESOURCE = TileSourceFactory . MAPNIK ; private ListView listView ; private AbstractDataElement element ; private Dialog dialog ; private List < String > endList ; private List < String > keyList ; private CharSequence [ ] array ; private AlertDialog alert ; private Map < String , ClassifiedTag > tagMap ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void output ( ) { endList = new ArrayList < String > ( ) ; keyList = new ArrayList < String > ( ) ; for ( Map . Entry entry : element . getTags ( ) . entrySet ( ) ) { String key = ( ( String ) ( entry . getKey ( ) ) ) ; keyList . add ( key ) ; endList . add ( ( ( key + "=" ) + ( element . getTags ( ) . get ( key ) ) ) ) ; } <START_BUG> final ArrayAdapter < String > adapter = new ArrayAdapter < String > ( context , layout . simple_list_item_1 , endList ) ; <END_BUG> listView . setAdapter ( adapter ) ; } @ Override public void onClick ( View v ) { } }

Fix:
final ArrayAdapter < String > adapter = new ArrayAdapter < String > ( this , layout . simple_list_item_1 , endList ) ;
Buggy code:
public final class User { private static final String CNAME = "com.garpr.android.data.User" ; private static final String KEY_PLAYER = "KEY_PLAYER" ; private static final String KEY_RANK = "KEY_RANK" ; private static final String KEY_REGION = "KEY_REGION" ; private static final String TAG = "User" ; private static User sUser ; private int mRank ; private Player mPlayer ; private Region mRegion ; public static boolean areWeInTheUsersRegion ( ) { } public static Player getPlayer ( ) { } public static int getRank ( ) { } public static Region getRegion ( ) { } private static synchronized User getUser ( ) { } public static boolean hasPlayer ( ) { } public static boolean hasRank ( ) { } private static void loadUser ( ) { User . sUser = new User ( ) ; final SharedPreferences sPreferences = Settings . get ( User . CNAME ) ; try { final String playerString = sPreferences . getString ( User . KEY_PLAYER , null ) ; if ( Utils . validStrings ( playerString ) ) { Console . d ( User . TAG , "Read<seq2seq4repair_space>in<seq2seq4repair_space>User's<seq2seq4repair_space>Player<seq2seq4repair_space>from<seq2seq4repair_space>SharedPreferences" ) ; final JSONObject playerJSON = new JSONObject ( playerString ) ; User . sUser . mPlayer = new Player ( playerJSON ) ; } else { Console . d ( User . TAG , "User<seq2seq4repair_space>has<seq2seq4repair_space>no<seq2seq4repair_space>Player<seq2seq4repair_space>saved<seq2seq4repair_space>in<seq2seq4repair_space>SharedPreferences" ) ; } User . sUser . mRank = sPreferences . getInt ( User . KEY_RANK , Integer . MIN_VALUE ) ; if ( ( User . sUser . mRank ) == ( Integer . MIN_VALUE ) ) { Console . d ( User . TAG , "User<seq2seq4repair_space>has<seq2seq4repair_space>no<seq2seq4repair_space>rank<seq2seq4repair_space>saved<seq2seq4repair_space>in<seq2seq4repair_space>SharedPreferences" ) ; } else { <START_BUG> Console . d ( User . TAG , ( ( "Read<seq2seq4repair_space>in<seq2seq4repair_space>User's<seq2seq4repair_space>rank<seq2seq4repair_space>from<seq2seq4repair_space>SharedPreferences<seq2seq4repair_space>(" + ( User . sUser . mRank ) ) + ")" ) ) ; <END_BUG> } final String regionString = sPreferences . getString ( User . KEY_REGION , null ) ; Console . d ( User . TAG , ( "Read<seq2seq4repair_space>in<seq2seq4repair_space>User's<seq2seq4repair_space>Region<seq2seq4repair_space>from<seq2seq4repair_space>SharedPreferences:<seq2seq4repair_space>" + regionString ) ) ; final JSONObject regionJSON = new JSONObject ( regionString ) ; User . sUser . mRegion = new Region ( regionJSON ) ; } catch ( final JSONException e ) { throw new RuntimeException ( e ) ; } } private static void saveUser ( ) { } public static synchronized void setPlayer ( final Player player ) { } public static synchronized void setRegion ( final Region region ) { } private User ( ) { } @ Override public String toString ( ) { } }

Fix:
Console . d ( User . TAG , ( ( "Read<seq2seq4repair_space>in<seq2seq4repair_space>User's<seq2seq4repair_space>rank<seq2seq4repair_space>from<seq2seq4repair_space>SharedPreferences<seq2seq4repair_space>(" + ( User . sUser . mRank ) ) + ')' ) ) ;
Buggy code:
public class BeanShellPostProcessor extends AbstractTestElement implements Serializable , PostProcessor , TestBean { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 2 ; private String script ; private transient BeanShellInterpreter bshInterpreter = null ; private static final String INIT_FILE = "beanshell.postprocessor.init" ; public BeanShellPostProcessor ( ) { } private void init ( ) { } private Object readResolve ( ) { } public void process ( ) { JMeterContext jmctx = JMeterContextService . getContext ( ) ; SampleResult prev = jmctx . getPreviousResult ( ) ; <START_BUG> if ( ( prev == null ) || ( ( prev . getResponseData ( ) . length ) == 0 ) ) { <END_BUG> return ; } JMeterVariables vars = jmctx . getVariables ( ) ; try { bshInterpreter . set ( "ctx" , jmctx ) ; bshInterpreter . set ( "vars" , vars ) ; bshInterpreter . set ( "prev" , prev ) ; bshInterpreter . set ( "data" , prev . getResponseData ( ) ) ; bshInterpreter . eval ( script ) ; } catch ( JMeterException e ) { BeanShellPostProcessor . log . warn ( ( "Problem<seq2seq4repair_space>in<seq2seq4repair_space>BeanShell<seq2seq4repair_space>script<seq2seq4repair_space>" + e ) ) ; } } public Object clone ( ) { } public String getScript ( ) { } public void setScript ( String s ) { } }

Fix:
if ( prev == null ) {
Buggy code:
class CompilationUnitResolver extends Compiler { public CompilationUnitResolver ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } protected static IErrorHandlingPolicy getHandlingPolicy ( ) { } protected static INameEnvironment getNameEnvironment ( ICompilationUnit sourceUnit ) throws JavaModelException { } protected static INameEnvironment getNameEnvironment ( IJavaProject javaProject ) throws JavaModelException { } protected static ICompilerRequestor getRequestor ( ) { } public static CompilationUnitDeclaration resolve ( ICompilationUnit unitElement , IAbstractSyntaxTreeVisitor visitor ) throws JavaModelException { } public static CompilationUnitDeclaration parse ( char [ ] source , Map settings ) { if ( source == null ) { throw new IllegalArgumentException ( ) ; } CompilerOptions compilerOptions = new CompilerOptions ( settings ) ; <START_BUG> Parser parser = new Parser ( new ProblemReporter ( DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) , compilerOptions , new DefaultProblemFactory ( Locale . getDefault ( ) ) ) , false , ( ( compilerOptions . sourceLevel ) >= ( JDK1_4 ) ) ) ; <END_BUG> org . eclipse . jdt . internal . compiler . env . ICompilationUnit sourceUnit = new CompilationUnit ( source , "" , compilerOptions . defaultEncoding ) ; CompilationUnitDeclaration compilationUnitDeclaration = parser . dietParse ( sourceUnit , new CompilationResult ( sourceUnit , 0 , 0 , compilerOptions . maxProblemsPerUnit ) ) ; if ( compilationUnitDeclaration . ignoreMethodBodies ) { compilationUnitDeclaration . ignoreFurtherInvestigation = true ; return compilationUnitDeclaration ; } parser . scanner . setSource ( source ) ; TypeDeclaration [ ] types = compilationUnitDeclaration . types ; if ( types != null ) { for ( int i = types . length ; ( -- i ) >= 0 ; ) types [ i ] . parseMethod ( parser , compilationUnitDeclaration ) ; } return compilationUnitDeclaration ; } protected static IProblemFactory getProblemFactory ( final char [ ] fileName , final IAbstractSyntaxTreeVisitor visitor ) { } public static CompilationUnitDeclaration resolve ( char [ ] source , String unitName , IJavaProject javaProject , IAbstractSyntaxTreeVisitor visitor ) throws JavaModelException { } public static CompilationUnitDeclaration resolve ( char [ ] source , char [ ] [ ] packageName , String unitName , IJavaProject javaProject , IAbstractSyntaxTreeVisitor visitor ) throws JavaModelException { } }

Fix:
Parser parser = new Parser ( new ProblemReporter ( DefaultErrorHandlingPolicies . proceedWithAllProblems ( ) , compilerOptions , new DefaultProblemFactory ( Locale . getDefault ( ) ) ) , false , compilerOptions . sourceLevel ) ;