nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BatchImageBuilder extends AbstractImageBuilder { protected BatchImageBuilder ( JavaBuilder javaBuilder ) { } public void build ( ) { if ( JavaBuilder . DEBUG ) System . out . println ( "FULL<seq2seq4repair_space>build" ) ; try { notifier . subTask ( Util . bind ( "build.scrubbingOutput" ) ) ; <START_BUG> JavaBuilder . removeProblemsFor ( javaBuilder . currentProject ) ; <END_BUG> scrubOutputFolder ( ) ; notifier . updateProgressDelta ( 0.1F ) ; notifier . subTask ( Util . bind ( "build.analyzingSources" ) ) ; ArrayList locations = new ArrayList ( 33 ) ; ArrayList typeNames = new ArrayList ( 33 ) ; addAllSourceFiles ( locations , typeNames ) ; notifier . updateProgressDelta ( 0.15F ) ; if ( ( locations . size ( ) ) > 0 ) { String [ ] allSourceFiles = new String [ locations . size ( ) ] ; locations . toArray ( allSourceFiles ) ; String [ ] initialTypeNames = new String [ typeNames . size ( ) ] ; typeNames . toArray ( initialTypeNames ) ; notifier . setProgressPerCompilationUnit ( ( 0.75F // ( allSourceFiles . length ) ) ) ; workQueue . addAll ( allSourceFiles ) ; compile ( allSourceFiles , initialTypeNames ) ; } } catch ( CoreException e ) { throw internalException ( e ) ; } finally { cleanUp ( ) ; } } protected void addAllSourceFiles ( final ArrayList locations , final ArrayList typeNames ) throws CoreException { } protected void scrubOutputFolder ( ) throws CoreException { } protected void copyExtraResourcesBack ( ) throws CoreException { } public String toString ( ) { } }

Fix:
JavaBuilder . removeProblemsAndTasksFor ( javaBuilder . currentProject ) ;
Buggy code:
public class ParentResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { <START_BUG> if ( ( tag instanceof WicketTag ) || ( tag . getId ( ) . startsWith ( "_" ) ) ) { <END_BUG> return false ; } MarkupContainer parent = container ; while ( ( parent != null ) && ( parent . isTransparentResolver ( ) ) ) { parent = parent . getParent ( ) ; if ( parent != null ) { Component component = parent . get ( tag . getId ( ) ) ; if ( component != null ) { component . render ( markupStream ) ; return true ; } } } parent = container . getParent ( ) ; if ( parent instanceof IComponentResolver ) { return ( ( IComponentResolver ) ( parent ) ) . resolve ( container , markupStream , tag ) ; } return false ; } }

Fix:
if ( tag instanceof WicketTag ) {
Buggy code:
public class SequenceFilesFromDirectory extends AbstractJob { private static final String PREFIX_ADDITION_FILTER = PrefixAdditionFilter . class . getName ( ) ; private static final String [ ] CHUNK_SIZE_OPTION = new String [ ] { "chunkSize" , "chunk" } ; private static final String [ ] FILE_FILTER_CLASS_OPTION = new String [ ] { "fileFilterClass" , "filter" } ; private static final String [ ] KEY_PREFIX_OPTION = new String [ ] { "keyPrefix" , "prefix" } ; private static final String [ ] CHARSET_OPTION = new String [ ] { "charset" , "c" } ; public static void main ( String [ ] args ) throws Exception { } @ Override public int run ( String [ ] args ) throws Exception { addOptions ( ) ; if ( ( parseArguments ( args ) ) == null ) { return - 1 ; } Map < String , String > options = parseOptions ( ) ; Path input = getInputPath ( ) ; Path output = getOutputPath ( ) ; if ( hasOption ( OVERWRITE_OPTION ) ) { Configuration conf = new Configuration ( ) ; HadoopUtil . delete ( conf , output ) ; } String keyPrefix = getOption ( SequenceFilesFromDirectory . KEY_PREFIX_OPTION [ 0 ] ) ; Charset charset = Charset . forName ( getOption ( SequenceFilesFromDirectory . CHARSET_OPTION [ 0 ] ) ) ; Configuration conf = getConf ( ) ; FileSystem fs = FileSystem . get ( input . toUri ( ) , conf ) ; ChunkedWriter writer = new ChunkedWriter ( conf , Integer . parseInt ( options . get ( SequenceFilesFromDirectory . CHUNK_SIZE_OPTION [ 0 ] ) ) , output ) ; try { SequenceFilesFromDirectoryFilter pathFilter ; String fileFilterClassName = options . get ( SequenceFilesFromDirectory . FILE_FILTER_CLASS_OPTION [ 0 ] ) ; if ( PrefixAdditionFilter . class . getName ( ) . equals ( fileFilterClassName ) ) { pathFilter = new PrefixAdditionFilter ( conf , keyPrefix , options , writer , charset , fs ) ; } else { Class < ? extends SequenceFilesFromDirectoryFilter > pathFilterClass = Class . forName ( fileFilterClassName ) . asSubclass ( SequenceFilesFromDirectoryFilter . class ) ; Constructor < ? extends SequenceFilesFromDirectoryFilter > constructor = pathFilterClass . getConstructor ( Configuration . class , String . class , Map . class , ChunkedWriter . class , Charset . class , FileSystem . class ) ; <START_BUG> pathFilter = constructor . newInstance ( conf , keyPrefix , options , writer , fs ) ; <END_BUG> } fs . listStatus ( input , pathFilter ) ; } finally { Closeables . closeQuietly ( writer ) ; } return 0 ; } protected void addOptions ( ) { } protected Map < String , String > parseOptions ( ) { } }

Fix:
pathFilter = constructor . newInstance ( conf , keyPrefix , options , writer , charset , fs ) ;
Buggy code:
public class CookieTest extends TestCase { private WicketTester tester ; private SignInPanel panel ; private Form < ? > form ; private Cookie cookieUsername ; private WebPage page ; public CookieTest ( String name ) { } @ Override protected void setUp ( ) throws Exception { } public void testSetCookieOnForm ( ) throws IOException , ServletException { } public void testPersistCookieWithPersistenceDisabled ( ) throws IOException , ServletException { } public void testPersistCookie ( ) throws IOException , ServletException { panel . setPersistent ( true ) ; form . onFormSubmitted ( ) ; Collection < Cookie > cookies = tester . getServletResponse ( ) . getCookies ( ) ; Assert . assertEquals ( 2 , cookies . size ( ) ) ; for ( Cookie cooky : cookies ) { String pathOfStoredComponent = cooky . getName ( ) . replaceAll ( "\\." , ":" ) ; Assert . assertNotNull ( page . get ( pathOfStoredComponent ) ) ; <START_BUG> if ( ( page . get ( pathOfStoredComponent ) . getDefaultModelObjectAsString ( ) ) != "" ) { <END_BUG> Assert . assertEquals ( cooky . getValue ( ) , page . get ( pathOfStoredComponent ) . getDefaultModelObjectAsString ( ) ) ; } } } public void testRemoveFromPage ( ) throws IOException , ServletException { } }

Fix:
if ( ! ( page . get ( pathOfStoredComponent ) . getDefaultModelObjectAsString ( ) . equals ( "" ) ) ) {
Buggy code:
public class CalendarHomeFragment extends Fragment { private Preferences mPreferences ; private View mRootView ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View rootView = inflater . inflate ( calendar_home_fragment , container , false ) ; LinearLayout homeCalendarLayout = ( ( LinearLayout ) ( rootView . findViewById ( calendar_home_fragment_layout ) ) ) ; View todaysEventsLayout = inflater . inflate ( calendar_item , container , false ) ; TextView txtEventDate = ( ( TextView ) ( todaysEventsLayout . findViewById ( event_date ) ) ) ; txtEventDate . setText ( "Today's<seq2seq4repair_space>Events" ) ; txtEventDate . setGravity ( CENTER_HORIZONTAL ) ; <START_BUG> View lineDivider = todaysEventsLayout . findViewById ( line_divider ) ; <END_BUG> List < CalendarEvent > events = CalendarUtil . getCalendarEvents ( getContext ( ) , ONE_DAY ) ; Calendar calendar = Calendar . getInstance ( ) ; for ( int i = 0 ; ( i < ( events . size ( ) ) ) && ( i < 7 ) ; i ++ ) { CalendarEvent event = events . get ( i ) ; lineDivider . setVisibility ( VISIBLE ) ; txtEventDate . setVisibility ( VISIBLE ) ; calendar . setTime ( event . start ) ; TextView txtEventTime = ( ( TextView ) ( todaysEventsLayout . findViewById ( event_time ) ) ) ; String eventTime = ( ( event . startString ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( event . endString ) ; txtEventTime . setText ( eventTime ) ; TextView txtEventDesc = ( ( TextView ) ( todaysEventsLayout . findViewById ( event_description ) ) ) ; txtEventDesc . setText ( event . description ) ; if ( ! ( event . location . isEmpty ( ) ) ) { TextView txtEventLoc = ( ( TextView ) ( todaysEventsLayout . findViewById ( event_location ) ) ) ; txtEventLoc . setText ( event . location ) ; txtEventLoc . setVisibility ( VISIBLE ) ; } LinearLayout . LayoutParams llp = new LinearLayout . LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . WRAP_CONTENT ) ; llp . setMargins ( 0 , 0 , 0 , 4 ) ; todaysEventsLayout . setLayoutParams ( llp ) ; homeCalendarLayout . addView ( todaysEventsLayout ) ; } return rootView ; } }

Fix:
View lineDivider = todaysEventsLayout . findViewById ( calendar_day_divider ) ;
Buggy code:
public class DefaultCMSetter extends BaseInterceptor { public DefaultCMSetter ( ) { } public void contextInit ( Context ctx ) throws TomcatException { setEngineHeader ( ctx ) ; ServletWrapper errorWrapper = new ServletWrapper ( ) ; errorWrapper . setContext ( ctx ) ; errorWrapper . setServletClass ( "org.apache.tomcat.servlets.DefaultErrorPage" ) ; errorWrapper . setServletName ( "tomcat.errorPage" ) ; ctx . addServlet ( errorWrapper ) ; try { ServletWrapper errorWrapper1 = ctx . getServletByName ( "tomcat.errorPage" ) ; <START_BUG> errorWrapper1 . initServlet ( ) ; <END_BUG> } catch ( Exception ex ) { System . out . println ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>default<seq2seq4repair_space>servlet<seq2seq4repair_space>" ) ; ex . printStackTrace ( ) ; throw new TomcatException ( "Error<seq2seq4repair_space>loading<seq2seq4repair_space>default<seq2seq4repair_space>error<seq2seq4repair_space>servlet<seq2seq4repair_space>" , ex ) ; } } private void setEngineHeader ( Context ctx ) { } }

Fix:
errorWrapper1 . init ( ) ;
Buggy code:
class ContainsExpression extends EqualExpression { public ContainsExpression ( Val val1 , Val val2 ) { } public ExpState initialize ( Select sel , ExpContext ctx , Map contains ) { Val val1 = getValue1 ( ) ; if ( ( contains != null ) && ( val1 instanceof PCPath ) ) { PCPath sql = ( ( PCPath ) ( val1 ) ) ; <START_BUG> String path = sql . getPath ( ) ; <END_BUG> Integer count = ( ( Integer ) ( contains . get ( path ) ) ) ; if ( count == null ) count = Numbers . valueOf ( 0 ) ; else count = Numbers . valueOf ( ( ( count . intValue ( ) ) + 1 ) ) ; contains . put ( path , count ) ; sql . setContainsId ( count . toString ( ) ) ; } return super . initialize ( sel , ctx , contains ) ; } protected boolean isDirectComparison ( ) { } }

Fix:
String path = sql . getPCPathString ( ) ;
Buggy code:
public class PingResponseMessage implements Serializable { private static final long serialVersionUID = 3257569516165740857L ; protected PingResponseMessage ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "PingResponseMessage" ) ; <END_BUG> return buf . toString ( ) ; } }

Fix:
StringBuffer buf = new StringBuffer ( "PingResponseMessage[]" ) ;
Buggy code:
class AddCompilationUnitToIndex extends IndexRequest { IFile resource ; IndexManager manager ; IPath indexedContainer ; char [ ] contents ; public AddCompilationUnitToIndex ( IFile resource , IndexManager manager , IPath indexedContainer ) { } public boolean belongsTo ( String jobFamily ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) return IJob . COMPLETE ; try { IIndex index = manager . getIndex ( this . indexedContainer , true , true ) ; if ( index == null ) return IJob . COMPLETE ; ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; if ( monitor == null ) return IJob . COMPLETE ; try { monitor . enterWrite ( ) ; char [ ] contents = this . getContents ( ) ; if ( contents == null ) return IJob . FAILED ; <START_BUG> index . add ( new IFileDocument ( resource , contents ) , new SourceIndexer ( ) ) ; <END_BUG> } finally { monitor . exitWrite ( ) ; } } catch ( IOException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>index<seq2seq4repair_space>" + ( this . resource ) ) + "<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } return IJob . FAILED ; } return IJob . COMPLETE ; } private char [ ] getContents ( ) { } public void initializeContents ( ) { } public String toString ( ) { } }

Fix:
index . add ( new IFileDocument ( resource , contents ) , new SourceIndexer ( resource ) ) ;
Buggy code:
public class JMSQueueRemove extends AbstractJMSSubsystemUpdate < Void > { private static final long serialVersionUID = - 635741968258725932L ; private final String queueName ; public JMSQueueRemove ( final String queueName ) { } protected void applyUpdate ( JMSSubsystemElement element ) throws UpdateFailedException { } protected < P > void applyUpdate ( UpdateContext context , UpdateResultHandler < ? super Void , P > handler , P param ) { <START_BUG> final ServiceController < ? > service = context . getServiceContainer ( ) . getService ( JMS_QUEUE_BASE . append ( queueName ) ) ; <END_BUG> if ( service == null ) { handler . handleSuccess ( null , param ) ; } else { service . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( handler , param ) ) ; } } public AbstractSubsystemUpdate < JMSSubsystemElement , ? > getCompensatingUpdate ( JMSSubsystemElement original ) { } }

Fix:
final ServiceController < ? > service = context . getServiceRegistry ( ) . getService ( JMS_QUEUE_BASE . append ( queueName ) ) ;
Buggy code:
public class HandlerLevelChange extends AbstractModelUpdateHandler { static final String OPERATION_NAME = "change-log-level" ; static final HandlerLevelChange INSTANCE = new HandlerLevelChange ( ) ; @ Override protected void updateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; <START_BUG> final ServiceRegistry serviceRegistry = context . getServiceRegistry ( false ) ; <END_BUG> final ServiceController < Handler > controller = ( ( ServiceController < Handler > ) ( serviceRegistry . getService ( LogServices . handlerName ( name ) ) ) ) ; final ModelNode level = CommonAttributes . LEVEL . validateResolvedOperation ( model ) ; if ( ( controller != null ) && ( level . isDefined ( ) ) ) { controller . getValue ( ) . setLevel ( Level . parse ( level . asString ( ) ) ) ; } } }

Fix:
final ServiceRegistry serviceRegistry = context . getServiceRegistry ( true ) ;
Buggy code:
public class AsmBuilderTest extends TestCase { public static Test suite ( ) { } public void testNullHandlingOfVisit ( ) { ICompilationUnit cu = new ICompilationUnit ( ) { public char [ ] getContents ( ) { return null ; } public char [ ] getMainTypeName ( ) { return null ; } public char [ ] [ ] getPackageName ( ) { return null ; } public char [ ] getFileName ( ) { return null ; } } ; LocalTypeDeclaration local = new LocalTypeDeclaration ( new CompilationResult ( cu , 0 , 0 , 0 ) ) ; local . name = new char [ 2 ] ; BlockScope scope = null ; try { <START_BUG> new AsmBuilder ( new CompilationResult ( cu , 0 , 0 , 0 ) ) . visit ( local , scope ) ; <END_BUG> } catch ( Exception e ) { assertTrue ( ( e instanceof EmptyStackException ) ) ; } } }

Fix:
new AsmHierarchyBuilder ( new CompilationResult ( cu , 0 , 0 , 0 ) ) . visit ( local , scope ) ;
Buggy code:
public abstract class GenericCheckInDialogFragment extends DialogFragment { public interface InitBundle { String ITEM_TITLE = "itemtitle" ; String DEFAULT_MESSAGE = "message" ; String MOVIE_TMDB_ID = "movietmdbid" ; String EPISODE_TVDB_ID = "episodetvdbid" ; } public class CheckInDialogDismissedEvent { } @ InjectView ( id . editTextCheckInMessage ) EditText mEditTextMessage ; @ InjectView ( id . buttonCheckIn ) View mButtonCheckIn ; @ InjectView ( id . buttonCheckInPasteTitle ) View mButtonPasteTitle ; @ InjectView ( id . buttonCheckInClear ) View mButtonClear ; @ InjectView ( id . progressBarCheckIn ) View mProgressBar ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; if ( ( SeriesGuidePreferences . THEME ) == ( style . Theme_SeriesGuide_DarkBlue ) ) { <START_BUG> setStyle ( STYLE_NO_TITLE , 0 ) ; <END_BUG> } else if ( ( SeriesGuidePreferences . THEME ) == ( style . Theme_SeriesGuide_Light ) ) { setStyle ( STYLE_NO_TITLE , Theme_SeriesGuide_Light_Dialog_CheckIn ) ; } else { setStyle ( STYLE_NO_TITLE , Theme_SeriesGuide_Dialog_CheckIn ) ; } } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } @ Override public void onStop ( ) { } @ Override public void onDismiss ( DialogInterface dialog ) { } @ Override public void onDestroyView ( ) { } public void onEvent ( TraktTask . TraktActionCompleteEvent event ) { } public void onEvent ( TraktTask . TraktCheckInBlockedEvent event ) { } private void checkIn ( ) { } protected abstract void checkInTrakt ( String message ) { } private void setProgressLock ( boolean lock ) { } }

Fix:
setStyle ( STYLE_NO_TITLE , Theme_SeriesGuide_DarkBlue_Dialog_CheckIn ) ;
Buggy code:
public class ThreadNumber implements Serializable , Function { private static final String KEY = "__threadNum" ; private static final List desc = new LinkedList ( ) ; public String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { <START_BUG> return Thread . currentThread ( ) . getName ( ) . substring ( ( ( Thread . currentThread ( ) . getName ( ) . indexOf ( "-" ) ) + 1 ) ) ; <END_BUG> } public void setParameters ( Collection parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } }

Fix:
return Thread . currentThread ( ) . getName ( ) . substring ( ( ( Thread . currentThread ( ) . getName ( ) . lastIndexOf ( "-" ) ) + 1 ) ) ;
Buggy code:
public class SURLStatusManagerImpl implements SURLStatusManager { @ Override public boolean abortAllGetRequestsForSURL ( GridUserInterface user , TSURL surl , String explanation ) { } @ Override public boolean abortAllPutRequestsForSURL ( GridUserInterface user , TSURL surl , String explanation ) { final SURLStatusDAO dao = new SURLStatusDAO ( ) ; <START_BUG> return dao . abortActivePtGsForSURL ( user , surl , explanation ) ; <END_BUG> } @ Override public boolean abortRequest ( GridUserInterface user , TRequestToken token , String explanation ) { } @ Override public boolean abortRequestForSURL ( GridUserInterface user , TRequestToken token , TSURL surl , String explanation ) { } private void authzCheck ( GridUserInterface user , RequestSummaryData request ) { } @ Override public boolean failRequestForSURL ( GridUserInterface user , TRequestToken token , TSURL surl , TStatusCode code , String explanation ) { } @ Override public Map < TSURL , TReturnStatus > getPinnedSURLsForUser ( GridUserInterface user , List < TSURL > surls ) { } @ Override public Map < TSURL , TReturnStatus > getPinnedSURLsForUser ( GridUserInterface user , TRequestToken token , List < TSURL > surls ) { } @ Override public Map < TSURL , TReturnStatus > getSURLStatuses ( GridUserInterface user , TRequestToken token ) { } @ Override public Map < TSURL , TReturnStatus > getSURLStatuses ( GridUserInterface user , TRequestToken token , List < TSURL > surls ) { } @ Override public boolean isSURLBusy ( TRequestToken requestTokenToExclude , TSURL surl ) { } @ Override public boolean isSURLBusy ( TSURL surl ) { } @ Override public boolean isSURLPinned ( TSURL surl ) { } private RequestSummaryData lookupAndCheckRequest ( GridUserInterface user , TRequestToken token ) { } private RequestSummaryData lookupRequest ( TRequestToken token ) { } @ Override public void markSURLsReadyForRead ( TRequestToken token , List < TSURL > surls ) { } @ Override public void releaseSURLs ( GridUserInterface user , List < TSURL > surls ) { } @ Override public void releaseSURLs ( TRequestToken token , List < TSURL > surls ) { } }

Fix:
return dao . abortActivePtPsForSURL ( user , surl , explanation ) ;
Buggy code:
public class Snippet125 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; final Table table = new Table ( shell , SWT . BORDER ) ; for ( int i = 0 ; i < 20 ; i ++ ) { TableItem item = new TableItem ( table , SWT . NONE ) ; item . setText ( ( "item<seq2seq4repair_space>" + i ) ) ; } table . setToolTipText ( "" ) ; final Listener labelListener = new Listener ( ) { public void handleEvent ( Event event ) { Label label = ( ( Label ) ( event . widget ) ) ; Shell shell = label . getShell ( ) ; switch ( event . type ) { case SWT . MouseDown : Event e = new Event ( ) ; e . item = ( ( TableItem ) ( label . getData ( "_TABLEITEM" ) ) ) ; table . setSelection ( new TableItem [ ] { ( ( TableItem ) ( e . item ) ) } ) ; table . notifyListeners ( Selection , e ) ; case SWT . MouseExit : shell . dispose ( ) ; break ; } } } ; Listener tableListener = new Listener ( ) { Shell tip = null ; Label label = null ; public void handleEvent ( Event event ) { switch ( event . type ) { case SWT . Dispose : case SWT . KeyDown : case SWT . MouseMove : { if ( ( tip ) == null ) break ; tip . dispose ( ) ; tip = null ; label = null ; break ; } case SWT . MouseHover : { TableItem item = table . getItem ( new Point ( event . x , event . y ) ) ; if ( item != null ) { if ( ( ( tip ) != null ) && ( ! ( tip . isDisposed ( ) ) ) ) tip . dispose ( ) ; <START_BUG> tip = new Shell ( shell , SWT . ON_TOP ) ; <END_BUG> tip . setLayout ( new FillLayout ( ) ) ; label = new Label ( tip , SWT . NONE ) ; label . setForeground ( display . getSystemColor ( COLOR_INFO_FOREGROUND ) ) ; label . setBackground ( display . getSystemColor ( COLOR_INFO_BACKGROUND ) ) ; label . setData ( "_TABLEITEM" , item ) ; label . setText ( ( "tooltip<seq2seq4repair_space>" + ( item . getText ( ) ) ) ) ; label . addListener ( MouseExit , labelListener ) ; label . addListener ( MouseDown , labelListener ) ; Point size = tip . computeSize ( DEFAULT , DEFAULT ) ; Rectangle rect = item . getBounds ( 0 ) ; Point pt = table . toDisplay ( rect . x , rect . y ) ; tip . setBounds ( pt . x , pt . y , size . x , size . y ) ; tip . setVisible ( true ) ; } } } } } ; table . addListener ( Dispose , tableListener ) ; table . addListener ( KeyDown , tableListener ) ; table . addListener ( MouseMove , tableListener ) ; table . addListener ( MouseHover , tableListener ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
tip = new Shell ( shell , ( ( SWT . ON_TOP ) | ( SWT . TOOL ) ) ) ;
Buggy code:
public class AS implements Comparable < AS > , Comparator < AS > { public static final int AS_TRANS = 23456 ; public static final AS NullAS = new AS ( 0 ) ; protected byte [ ] ASCode = new byte [ ] { 0 , 0 , 0 , 0 } ; protected AS ( ) { } public AS ( long ASnumber ) { } public AS ( byte [ ] as ) throws Exception { } private void setASCode ( long val ) { } private void setASCode ( byte [ ] newval ) throws Exception { } public long getASN ( ) { } public void setASN ( long ASnumber ) { } public int compareTo ( AS other ) { } public int compare ( AS as1 , AS as2 ) { } private boolean equals ( AS other ) { } private boolean equals ( String other ) { } public boolean equals ( Object other ) { } public boolean is4Byte ( ) { } public boolean isPlaceholder ( ) { } public String toString ( ) { if ( this . equals ( 0 ) ) return "AS_NULL" ; if ( this . equals ( AS . AS_TRANS ) ) return "AS_TRANS" ; if ( this . is4Byte ( ) ) <START_BUG> return String . format ( "%d.%d" , hiWord ( ) , loWord ( ) ) ; <END_BUG> return String . format ( "%d" , loWord ( ) ) ; } private int hiWord ( ) { } private int loWord ( ) { } public String toString ( String prefix ) { } public static AS parseString ( String asspec ) throws Exception { } }

Fix:
return String . format ( "%d" , ( ( ( hiWord ( ) ) << 16 ) + ( loWord ( ) ) ) ) ;
Buggy code:
public class StandardPayloadHandler implements PayloadHandler < StandardPacket > { public static final String PACKET_HEADER = "PluginMessageFramework" ; private final Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ; @ Override public boolean isPacketApplicable ( Packet packet ) { } @ Override public boolean isPacketClassApplicable ( Class < ? extends Packet > packetClass ) { } @ Override public StandardPacket readIncomingPacket ( byte [ ] bytes ) { try { ObjectInputStream objectInputStream = new ObjectInputStream ( new ByteArrayInputStream ( bytes ) ) ; if ( objectInputStream . readUTF ( ) . equals ( StandardPayloadHandler . PACKET_HEADER ) ) { Object object = objectInputStream . readObject ( ) ; if ( StandardPacket . class . isAssignableFrom ( object . getClass ( ) ) ) { StandardPacket standardPacket = ( ( StandardPacket ) ( object ) ) ; Utilities . setReceived ( standardPacket ) ; return standardPacket ; } else { throw new IllegalArgumentException ( "Class<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>extend<seq2seq4repair_space>Packet." ) ; } } } catch ( IOException e ) { logger . error ( "Exception<seq2seq4repair_space>whilst<seq2seq4repair_space>reading<seq2seq4repair_space>custom<seq2seq4repair_space>payload." , e ) ; } catch ( ClassNotFoundException e ) { <START_BUG> logger . debug ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>packet<seq2seq4repair_space>class<seq2seq4repair_space>whilst<seq2seq4repair_space>de-serializing." , e ) ; <END_BUG> } return null ; } @ Override public byte [ ] writeOutgoingPacket ( StandardPacket standardPacket ) throws IOException { } }

Fix:
logger . debug ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>packet<seq2seq4repair_space>class<seq2seq4repair_space>whilst<seq2seq4repair_space>de-serializing.\nMake<seq2seq4repair_space>sure<seq2seq4repair_space>the<seq2seq4repair_space>Packet<seq2seq4repair_space>class<seq2seq4repair_space>has<seq2seq4repair_space>the<seq2seq4repair_space>same<seq2seq4repair_space>package<seq2seq4repair_space>in<seq2seq4repair_space>all<seq2seq4repair_space>instances." , e ) ;
Buggy code:
public class ShingleAnalyzerWrapperTest extends BaseTokenStreamTestCase { private Analyzer analyzer ; private IndexSearcher searcher ; private IndexReader reader ; private Directory directory ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; analyzer = new ShingleAnalyzerWrapper ( new org . apache . lucene . analysis . MockAnalyzer ( random ( ) , MockTokenizer . WHITESPACE , false ) , 2 ) ; directory = newDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , new org . apache . lucene . index . IndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ) ; Document doc ; doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . TextField ( "content" , "please<seq2seq4repair_space>divide<seq2seq4repair_space>this<seq2seq4repair_space>sentence<seq2seq4repair_space>into<seq2seq4repair_space>shingles" , Store . YES ) ) ; writer . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . TextField ( "content" , "just<seq2seq4repair_space>another<seq2seq4repair_space>test<seq2seq4repair_space>sentence" , Store . YES ) ) ; writer . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . TextField ( "content" , "a<seq2seq4repair_space>sentence<seq2seq4repair_space>which<seq2seq4repair_space>contains<seq2seq4repair_space>no<seq2seq4repair_space>test" , Store . YES ) ) ; writer . addDocument ( doc ) ; <START_BUG> writer . close ( ) ; <END_BUG> reader = DirectoryReader . open ( directory ) ; searcher = newSearcher ( reader ) ; } @ Override public void tearDown ( ) throws Exception { } protected void compareRanks ( ScoreDoc [ ] hits , int [ ] ranks ) throws Exception { } public void testShingleAnalyzerWrapperPhraseQuery ( ) throws Exception { } public void testShingleAnalyzerWrapperBooleanQuery ( ) throws Exception { } public void testReusableTokenStream ( ) throws Exception { } public void testNonDefaultMinShingleSize ( ) throws Exception { } public void testNonDefaultMinAndSameMaxShingleSize ( ) throws Exception { } public void testNoTokenSeparator ( ) throws Exception { } public void testNullTokenSeparator ( ) throws Exception { } public void testAltTokenSeparator ( ) throws Exception { } public void testAltFillerToken ( ) throws Exception { } public void testOutputUnigramsIfNoShinglesSingleToken ( ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class RestaurantController extends Controller { static Form < Meal > inputForm = new Form < Meal > ( Meal . class ) ; public static Result createMeal ( ) { User u = Session . getCurrentUser ( ctx ( ) ) ; if ( ! ( u . role . equalsIgnoreCase ( "RESTAURANT" ) ) ) { return ok ( wrong . render ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>meal<seq2seq4repair_space>if<seq2seq4repair_space>you're<seq2seq4repair_space>not<seq2seq4repair_space>reastaurant!<seq2seq4repair_space>" ) ) ; } String mealName = RestaurantController . inputForm . bindFromRequest ( ) . field ( "name" ) . value ( ) ; String mealPrice = RestaurantController . inputForm . bindFromRequest ( ) . field ( "price" ) . value ( ) ; mealPrice = mealPrice . replace ( ',' , '.' ) ; Double price = Double . parseDouble ( mealPrice ) ; if ( ( Meal . create ( mealName , price ) ) == true ) { <START_BUG> return redirect ( "//restaurant" ) ; <END_BUG> } return TODO ; } public static Result deleteMeal ( ) { } public static Result list ( ) { } public static Result details ( int id ) { } No newline ; at end ; of file ; }

Fix:
return ok ( user . render ( Session . getCurrentUser ( ctx ( ) ) . email ) ) ;
Buggy code:
public class LocaleUtils { private static final List cAvailableLocaleList ; private static Set cAvailableLocaleSet ; private static final Map cLanguagesByCountry = Collections . synchronizedMap ( new HashMap ( ) ) ; private static final Map cCountriesByLanguage = Collections . synchronizedMap ( new HashMap ( ) ) ; public LocaleUtils ( ) { } public static Locale toLocale ( String str ) { } public static List localeLookupList ( Locale locale ) { } public static List localeLookupList ( Locale locale , Locale defaultLocale ) { } public static List availableLocaleList ( ) { } public static Set availableLocaleSet ( ) { } public static boolean isAvailableLocale ( Locale locale ) { <START_BUG> return LocaleUtils . cAvailableLocaleSet . contains ( locale ) ; <END_BUG> } public static List languagesByCountry ( String countryCode ) { } public static List countriesByLanguage ( String languageCode ) { } }

Fix:
return LocaleUtils . availableLocaleList ( ) . contains ( locale ) ;
Buggy code:
@ Path ( "//submission" ) public class FormSubmissionResource { private static final Logger LOGGER = Logger . getLogger ( FormSubmissionResource . class . getName ( ) ) ; private final DispatcherSync dispatcher ; private final ResourceLocatorSync locator ; private final AuthenticationTokenService authenticationTokenService ; private final ServerSideAuthProvider authProvider ; private final Provider < EntityManager > entityManager ; private final BlobFieldStorageService blobFieldStorageService ; private final InstanceIdService instanceIdService ; private final SubmissionArchiver submissionArchiver ; @ Inject public FormSubmissionResource ( DispatcherSync dispatcher , ResourceLocatorSync locator , AuthenticationTokenService authenticationTokenService , ServerSideAuthProvider authProvider , Provider < EntityManager > entityManager , BlobFieldStorageService blobFieldStorageService , InstanceIdService instanceIdService , SubmissionArchiver submissionArchiver ) { } @ POST @ Consumes ( MediaType . MULTIPART_FORM_DATA ) @ Produces ( MediaType . TEXT_XML ) public Response submit ( byte [ ] bytes ) { } private FieldValue tryParse ( FormInstance formInstance , FormField formField , Element element , boolean legacy ) { } private GeoPoint parseLocation ( Element element , boolean legacy ) { } private void persist ( AuthenticatedUser user , XFormInstance instance , AttachmentValue fieldValue ) { Attachment attachment = fieldValue . getValues ( ) . get ( 0 ) ; if ( ( attachment . getFilename ( ) ) != null ) { try { BodyPart bodyPart = ( ( XFormInstanceImpl ) ( instance ) ) . findBodyPartByFilename ( attachment . getFilename ( ) ) ; String mimeType = bodyPart . getContentType ( ) ; attachment . setMimeType ( mimeType ) ; blobFieldStorageService . put ( user , bodyPart . getDisposition ( ) , mimeType , new org . activityinfo . service . blob . BlobId ( attachment . getBlobId ( ) ) , instance . getFormClassId ( ) , ByteSource . wrap ( ByteStreams . toByteArray ( bodyPart . getInputStream ( ) ) ) ) ; } catch ( MessagingException messagingException ) { FormSubmissionResource . LOGGER . log ( Level . SEVERE , "Unable<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>input" , messagingException ) ; throw new WebApplicationException ( Response . status ( BAD_REQUEST ) . build ( ) ) ; } catch ( IOException ioException ) { <START_BUG> FormSubmissionResource . LOGGER . log ( Level . SEVERE , "Could<seq2seq4repair_space>not<seq2seq4repair_space>write<seq2seq4repair_space>image<seq2seq4repair_space>to<seq2seq4repair_space>GCS" , ioException ) ; <END_BUG> throw new WebApplicationException ( Response . status ( SERVICE_UNAVAILABLE ) . build ( ) ) ; } } } private VoidResult createLocation ( int id , int locationTypeId , String name , GeoPoint geoPoint ) { } }

Fix:
FormSubmissionResource . LOGGER . log ( Level . SEVERE , "Could<seq2seq4repair_space>not<seq2seq4repair_space>write<seq2seq4repair_space>attachment<seq2seq4repair_space>to<seq2seq4repair_space>GCS" , ioException ) ;
Buggy code:
public class CgmParserTest { private final Logger LOGGER = LoggerFactory . getLogger ( CgmParserTest . class ) ; public CgmParserTest ( ) { } @ BeforeClass public static void setUpClass ( ) { } @ AfterClass public static void tearDownClass ( ) { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void I_3051E ( ) throws IOException { } @ Test public void NS3051V ( ) throws IOException { } @ Test public void I_3052A ( ) throws IOException { } @ Test public void I_3060A ( ) throws IOException { } @ Test public void I_3063F ( ) throws IOException { } @ Test public void I_3068A ( ) throws IOException { } @ Test public void NS3059A ( ) throws IOException { } @ Test public void NS3073A ( ) throws IOException { } @ Test public void NS3101B ( ) throws IOException { } private void testOneImage ( String parentDirectory , String testfile ) throws IOException { <START_BUG> String inputFileName = ( ( ( File . separator ) + parentDirectory ) + ( File . separator ) ) + testfile ; <END_BUG> LOGGER . info ( ( "==================================<seq2seq4repair_space>Testing<seq2seq4repair_space>:" + inputFileName ) ) ; assertNotNull ( ( "Test<seq2seq4repair_space>file<seq2seq4repair_space>missing:<seq2seq4repair_space>" + inputFileName ) , getClass ( ) . getResource ( inputFileName ) ) ; try { LOGGER . info ( "loading<seq2seq4repair_space>from<seq2seq4repair_space>InputStream" ) ; NitfReader reader = new NitfInputStreamReader ( new BufferedInputStream ( getClass ( ) . getResourceAsStream ( inputFileName ) ) ) ; AllDataExtractionParseStrategy parseStrategy = new AllDataExtractionParseStrategy ( ) ; NitfFileParser . parse ( reader , parseStrategy ) ; if ( parseStrategy . getGraphicSegments ( ) . isEmpty ( ) ) { LOGGER . info ( "Loaded<seq2seq4repair_space>file,<seq2seq4repair_space>but<seq2seq4repair_space>found<seq2seq4repair_space>no<seq2seq4repair_space>graphic<seq2seq4repair_space>segments." ) ; System . exit ( 0 ) ; } GraphicSegment segment = parseStrategy . getGraphicSegments ( ) . get ( 0 ) ; CgmParser parser = new CgmParser ( parseStrategy . getGraphicSegments ( ) . get ( 0 ) . getData ( ) ) ; parser . buildCommandList ( ) ; BufferedImage targetImage = new BufferedImage ( segment . getBoundingBox2Column ( ) , segment . getBoundingBox2Row ( ) , BufferedImage . TYPE_INT_ARGB ) ; CgmRenderer renderer = new CgmRenderer ( ) ; renderer . setTargetImageGraphics ( ( ( Graphics2D ) ( targetImage . getGraphics ( ) ) ) , segment . getBoundingBox2Column ( ) , segment . getBoundingBox2Row ( ) ) ; renderer . render ( parser . getCommandList ( ) ) ; File targetFile = new File ( ( ( ( "target" + ( File . separator ) ) + testfile ) + "cgm.png" ) ) ; ImageIO . write ( targetImage , "png" , targetFile ) ; } catch ( ParseException e ) { LOGGER . error ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>from<seq2seq4repair_space>InputStream<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } }

Fix:
String inputFileName = ( ( "//" + parentDirectory ) + "//" ) + testfile ;
Buggy code:
public class ActionBar extends JPanel { public ActionBar ( final View view , boolean temp ) { } public HistoryTextField getField ( ) { } public void goToActionBar ( ) { } public void actionListChanged ( ) { } private static NameSpace namespace = new NameSpace ( BeanShell . getNameSpace ( ) , "action<seq2seq4repair_space>bar<seq2seq4repair_space>namespace" ) ; private View view ; private boolean temp ; private int repeatCount ; private HistoryTextField action ; private ActionBar . CompletionPopup popup ; private RolloverButton close ; private String [ ] actions ; private void initActions ( ) { } private void invoke ( ) { } private String [ ] getCompletions ( String str ) { } private void complete ( boolean insertLongestPrefix ) { } class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } class DocumentHandler implements DocumentListener { public void insertUpdate ( DocumentEvent evt ) { } public void removeUpdate ( DocumentEvent evt ) { } public void changedUpdate ( DocumentEvent evt ) { } } class ActionTextField extends HistoryTextField { boolean repeat ; boolean nonDigit ; ActionTextField ( ) { } public boolean isManagingFocus ( ) { } public boolean getFocusTraversalKeysEnabled ( ) { } public void processKeyEvent ( KeyEvent evt ) { } private void passToView ( final KeyEvent evt ) { if ( temp ) view . removeToolBar ( ActionBar . this ) ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { view . getTextArea ( ) . requestFocus ( ) ; view . getInputHandler ( ) . setRepeatCount ( repeatCount ) ; <START_BUG> view . getInputHandler ( ) . processKeyEvent ( evt ) ; <END_BUG> } } ) ; } public void addNotify ( ) { } } class CompletionPopup extends JWindow { ActionBar . CompletionPopup . CompletionList list ; CompletionPopup ( String [ ] actions ) { } void setModel ( String [ ] actions ) { } class MouseHandler extends MouseAdapter { public void mouseClicked ( MouseEvent evt ) { } } class CompletionList extends JList { CompletionList ( Object [ ] data ) { } public void processKeyEvent ( KeyEvent evt ) { } } class KeyHandler extends KeyAdapter { public void keyTyped ( KeyEvent evt ) { } public void keyPressed ( KeyEvent evt ) { } } } }

Fix:
view . processKeyEvent ( evt ) ;
Buggy code:
public class DropKeyspace extends Migration { private static final DropKeyspace . Serializer serializer = new DropKeyspace . Serializer ( ) ; private String name ; private boolean blockOnFileDeletion ; private DropKeyspace ( DataInputStream din ) throws IOException { } public DropKeyspace ( String name , boolean blockOnFileDeletion ) throws IOException , ConfigurationException { } @ Override public ICompactSerializer getSerializer ( ) { } @ Override public void applyModels ( ) throws IOException { KSMetaData ksm = DatabaseDescriptor . getTableDefinition ( name ) ; Table table = Table . clear ( ksm . name ) ; if ( table == null ) throw new IOException ( ( "Table<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>active.<seq2seq4repair_space>" + ( ksm . name ) ) ) ; for ( CFMetaData cfm : ksm . cfMetaData ( ) . values ( ) ) { CFMetaData . purge ( cfm ) ; <START_BUG> table . dropCf ( cfm . cfName ) ; <END_BUG> SystemTable . markForRemoval ( cfm ) ; } DatabaseDescriptor . clearTableDefinition ( ksm , newVersion ) ; CommitLog . instance ( ) . forceNewSegment ( ) ; Migration . cleanupDeadFiles ( blockOnFileDeletion ) ; HintedHandOffManager . renameHints ( name , null ) ; } private static final class Serializer implements ICompactSerializer < DropKeyspace > { public void serialize ( DropKeyspace dropKeyspace , DataOutputStream dos ) throws IOException { } public DropKeyspace deserialize ( DataInputStream dis ) throws IOException { } } }

Fix:
table . dropCf ( cfm . cfId ) ;
Buggy code:
public class AccessDeniedPage extends WebPage { private static final long serialVersionUID = 1L ; public AccessDeniedPage ( ) { } @ Override protected void configureResponse ( ) { super . configureResponse ( ) ; <START_BUG> getWebRequestCycle ( ) . getWebResponse ( ) . getHttpServletResponse ( ) . setStatus ( SC_FORBIDDEN ) ; <END_BUG> } @ Override public boolean isVersioned ( ) { } @ Override public boolean isErrorPage ( ) { } }

Fix:
getRequestCycle ( ) . getWebResponse ( ) . getHttpServletResponse ( ) . setStatus ( SC_FORBIDDEN ) ;
Buggy code:
public class Human implements Steppable { private Random rand ; private int waitsteps = 0 ; private int stayedSteps = 0 ; private Int2D position ; private int direction ; private int pause ; public int getDirection ( ) { } public int getPause ( ) { } private int rule ; public Human ( Int2D pos , int direction , int rule , int pause ) { } @ Override public void step ( SimState state ) { } public Int2D rule2 ( SparseGrid2D area ) { } public Int2D rule0 ( SparseGrid2D area ) { } public Int2D rule1 ( SparseGrid2D area ) { } private Int2D checkToGoLeft ( SparseGrid2D area , int nextFieldDiff ) { } public Int2D stepLeft ( int nextFieldDiff ) { } public Int2D stepRight ( int nextFieldDiff ) { } public Int2D stepAhead ( int nextFieldDiff ) { } public int getHumanAtPos ( Int2D pos , SparseGrid2D area ) { } public int getRule ( ) { } public Entropy getEntropy ( ) { } public Int2D getPosition ( ) { } private Int2D calculatePosition ( Int2D position ) { <START_BUG> if ( ( position . getX ( ) ) > ( Config . width ) ) { <END_BUG> return new Int2D ( ( ( position . getX ( ) ) % ( Config . width ) ) , position . y ) ; } else if ( ( position . getX ( ) ) < 0 ) { return new Int2D ( ( ( position . getX ( ) ) + ( Config . width ) ) , position . y ) ; } else { return position ; } } public void setPosition ( Int2D position ) { } No newline ; at end ; of file ; }

Fix:
if ( ( position . getX ( ) ) >= ( Config . width ) ) {
Buggy code:
public class Snippet292 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; final Tree tree = new Tree ( shell , SWT . BORDER ) ; for ( int i = 0 ; i < 5 ; i ++ ) { <START_BUG> TreeItem treeItem = new TreeItem ( tree , SWT . NULL ) ; <END_BUG> treeItem . setText ( ( "TreeItem<seq2seq4repair_space>" + i ) ) ; for ( int j = 0 ; j < 3 ; j ++ ) { TreeItem subItem = new TreeItem ( treeItem , SWT . NONE ) ; subItem . setText ( ( ( ( "SubItem<seq2seq4repair_space>" + i ) + "-" ) + j ) ) ; } if ( ( i % 3 ) == 0 ) treeItem . setExpanded ( true ) ; } final Label label = new Label ( shell , SWT . NONE ) ; label . addListener ( Dispose , new Listener ( ) { public void handleEvent ( Event e ) { Image image = label . getImage ( ) ; if ( image != null ) image . dispose ( ) ; } } ) ; Button button = new Button ( shell , SWT . PUSH ) ; button . setText ( "Snapshot" ) ; button . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event e ) { Image image = label . getImage ( ) ; if ( image != null ) image . dispose ( ) ; image = new Image ( display , tree . getBounds ( ) ) ; GC gc = new GC ( image ) ; boolean success = tree . print ( gc ) ; gc . dispose ( ) ; label . setImage ( image ) ; if ( ! success ) { MessageBox messageBox = new MessageBox ( shell , ( ( SWT . OK ) | ( SWT . PRIMARY_MODAL ) ) ) ; messageBox . setMessage ( "Sorry,<seq2seq4repair_space>taking<seq2seq4repair_space>a<seq2seq4repair_space>snapshot<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>your<seq2seq4repair_space>platform" ) ; messageBox . open ( ) ; } } } ) ; GridLayout layout = new GridLayout ( 2 , true ) ; shell . setLayout ( layout ) ; tree . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; label . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ; button . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true , 2 , 1 ) ) ; shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
TreeItem treeItem = new TreeItem ( tree , SWT . NONE ) ;
Buggy code:
public class DriveSelector { public enum DriveMode { virtual , real ; } public static Drive get ( DriveSelector . DriveMode dm ) { <START_BUG> Drive drive ; <END_BUG> switch ( dm ) { case virtual : break ; case real : drive = new Drive ( new DriveReal ( ) ) ; break ; } return drive ; } }

Fix:
Drive drive = null ;
Buggy code:
public class HyperLogLog { private int m ; private int b ; private double alpha ; private int [ ] registers ; public static double EXP32 = Math . pow ( 2 , 32 ) ; public HyperLogLog ( int registers ) throws Exception { } private double getAlpha ( ) { } private void reset ( ) { } private int rho ( int val , int max ) { } public void Add ( int val ) { int k = 32 - ( this . b ) ; int r = rho ( ( val << ( this . b ) ) , k ) ; <START_BUG> int j = val > > k ; <END_BUG> if ( r > ( this . registers [ j ] ) ) { this . registers [ j ] = r ; } } public long Count ( ) { } public HyperLogLog Merge ( HyperLogLog h1 , HyperLogLog h2 ) throws Exception { } public HyperLogLog Intersect ( HyperLogLog h1 , HyperLogLog h2 ) throws Exception { } public String ToJson ( ) { } No newline ; at end ; of file ; }

Fix:
int j = val > > ( Math . abs ( k ) ) ;
Buggy code:
public class DeclarationOfAccessedFieldsPattern extends FieldReferencePattern { HashSet knownFields ; IJavaElement enclosingElement ; public DeclarationOfAccessedFieldsPattern ( IJavaElement enclosingElement ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } private void reportDeclaration ( FieldBinding fieldBinding , MatchLocator locator ) throws CoreException { if ( fieldBinding == ( LengthField ) ) return ; ReferenceBinding declaringClass = fieldBinding . declaringClass ; IType type = locator . lookupType ( declaringClass ) ; if ( type == null ) return ; char [ ] name = fieldBinding . name ; IField field = type . getField ( new String ( name ) ) ; if ( this . knownFields . contains ( field ) ) return ; this . knownFields . add ( field ) ; <START_BUG> IResource resource = type . getUnderlyingResource ( ) ; <END_BUG> boolean isBinary = type . isBinary ( ) ; IBinaryType info = null ; if ( isBinary ) { if ( resource == null ) { resource = type . getJavaProject ( ) . getProject ( ) ; } info = locator . getBinaryInfo ( ( ( ClassFile ) ( type . getClassFile ( ) ) ) , resource ) ; locator . reportBinaryMatch ( resource , field , info , IJavaSearchResultCollector . EXACT_MATCH ) ; } else { TypeDeclaration typeDecl = ( ( SourceTypeBinding ) ( declaringClass ) ) . scope . referenceContext ; FieldDeclaration fieldDecl = null ; FieldDeclaration [ ] fieldDecls = typeDecl . fields ; for ( int i = 0 , length = fieldDecls . length ; i < length ; i ++ ) { if ( CharOperation . equals ( name , fieldDecls [ i ] . name ) ) { fieldDecl = fieldDecls [ i ] ; break ; } } if ( fieldDecl != null ) { locator . report ( resource , fieldDecl . sourceStart , fieldDecl . sourceEnd , field , IJavaSearchResultCollector . EXACT_MATCH ) ; } } } }

Fix:
IResource resource = type . getResource ( ) ;