nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ShowViewDialog extends Dialog implements IDoubleClickListener , ISelectionChangedListener { private static final String DIALOG_SETTING_SECTION_NAME = "ShowViewDialog" ; private static final int LIST_HEIGHT = 300 ; private static final int LIST_WIDTH = 250 ; private static final String STORE_EXPANDED_CATEGORIES_ID = ( ShowViewDialog . DIALOG_SETTING_SECTION_NAME ) + ".STORE_EXPANDED_CATEGORIES_ID" ; private static final String STORE_SELECTED_VIEW_ID = ( ShowViewDialog . DIALOG_SETTING_SECTION_NAME ) + ".STORE_SELECTED_VIEW_ID" ; private FilteredTree filteredTree ; private Button okButton ; private IViewDescriptor [ ] viewDescs = new IViewDescriptor [ 0 ] ; private IViewRegistry viewReg ; public ShowViewDialog ( Shell parentShell , IViewRegistry viewReg ) { } protected void buttonPressed ( int buttonId ) { } protected void cancelPressed ( ) { } protected void configureShell ( Shell shell ) { } protected void createButtonsForButtonBar ( Composite parent ) { } protected Control createDialogArea ( Composite parent ) { Composite composite = ( ( Composite ) ( super . createDialogArea ( parent ) ) ) ; composite . setFont ( parent . getFont ( ) ) ; createFilteredTreeViewer ( composite ) ; <START_BUG> layoutTopControl ( filteredTree . getViewer ( ) . getControl ( ) ) ; <END_BUG> restoreWidgetValues ( ) ; return composite ; } private void createFilteredTreeViewer ( Composite parent ) { } private boolean hasAtMostOneView ( TreeViewer tree ) { } public void doubleClick ( DoubleClickEvent event ) { } protected IDialogSettings getDialogSettings ( ) { } public IViewDescriptor [ ] getSelection ( ) { } private void layoutTopControl ( Control control ) { } protected void restoreWidgetValues ( ) { } protected void saveWidgetValues ( ) { } public void selectionChanged ( SelectionChangedEvent event ) { } protected void updateButtons ( ) { } protected void updateSelection ( SelectionChangedEvent event ) { } }

Fix:
layoutTopControl ( filteredTree ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class ResourceInjectionTestCase { private static final Logger logger = Logger . getLogger ( ResourceInjectionTestCase . class . getName ( ) ) ; private SimpleSLSB slsb ; @ Before public void beforeTest ( ) throws Exception { } @ Deployment public static WebArchive createWebDeployment ( ) { final WebArchive war = ShrinkWrap . create ( WebArchive . class , "resource-injection-test.war" ) ; war . addPackage ( SimpleSLSB . class . getPackage ( ) ) ; <START_BUG> war . addAsWebInfResource ( "injection//web.xml" ) ; <END_BUG> ResourceInjectionTestCase . logger . info ( ( "War<seq2seq4repair_space>created:<seq2seq4repair_space>" + ( war . toString ( true ) ) ) ) ; return war ; } @ Test public void testResourceInjectionInEJB ( ) { } @ Test public void testEnvEntryInjection ( ) { } @ Test public void testOptionalEnvEntryInjection ( ) { } @ Test public void testOptionalEnvEntryEncAvailability ( ) { } @ Test public void testTimerServiceInjection ( ) { } @ Test public void testOrbEnvironment ( ) throws Exception { } @ Test public void testInjection ( ) throws Exception { } }

Fix:
war . addAsWebInfResource ( ResourceInjectionTestCase . class . getPackage ( ) , "web.xml" , "web.xml" ) ;
Buggy code:
public class Employee implements Serializable { private final String name ; private final int id ; private Set < String > nickNames = new HashSet < String > ( ) ; public Employee ( final int id , final String name ) { } public String getName ( ) { <START_BUG> return this . getName ( ) ; <END_BUG> } public int getId ( ) { } public void addNick ( final String nick ) { } public Set < String > getNickNames ( ) { } }

Fix:
return this . name ;
Buggy code:
public class HandlerMethod { protected final Log logger = LogFactory . getLog ( HandlerMethod . class ) ; private final Object bean ; private final Method method ; private final BeanFactory beanFactory ; private final MethodParameter [ ] parameters ; private final Method bridgedMethod ; public HandlerMethod ( Object bean , Method method ) { } private MethodParameter [ ] initMethodParameters ( ) { } public HandlerMethod ( Object bean , String methodName , Class < ? > ... parameterTypes ) throws NoSuchMethodException { } public HandlerMethod ( String beanName , BeanFactory beanFactory , Method method ) { } protected HandlerMethod ( HandlerMethod handlerMethod ) { } private HandlerMethod ( HandlerMethod handlerMethod , Object handler ) { } public Object getBean ( ) { } public Method getMethod ( ) { } public Class < ? > getBeanType ( ) { } protected Method getBridgedMethod ( ) { } public MethodParameter [ ] getMethodParameters ( ) { } public MethodParameter getReturnType ( ) { } public MethodParameter getReturnValueType ( Object returnValue ) { } public boolean isVoid ( ) { } public < A extends Annotation > A getMethodAnnotation ( Class < A > annotationType ) { <START_BUG> return AnnotationUtils . findAnnotation ( this . bridgedMethod , annotationType ) ; <END_BUG> } public HandlerMethod createWithResolvedBean ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } private class HandlerMethodParameter extends MethodParameter { protected HandlerMethodParameter ( int index ) { } @ Override public Class < ? > getDeclaringClass ( ) { } @ Override public < T extends Annotation > T getMethodAnnotation ( Class < T > annotationType ) { return HandlerMethod . this . getMethodAnnotation ( annotationType ) ; } } private class ReturnValueMethodParameter extends HandlerMethod . HandlerMethodParameter { private final Object returnValue ; public ReturnValueMethodParameter ( Object returnValue ) { } @ Override public Class < ? > getParameterType ( ) { } } }

Fix:
return AnnotationUtils . findAnnotation ( this . method , annotationType ) ;
Buggy code:
public class PertApplication extends DrawApplication { private static final String PERTIMAGES = "//org//jhotdraw//samples//pert//images//" ; public PertApplication ( ) { } protected void createTools ( JToolBar palette ) { super . createTools ( palette ) ; Tool tool = new TextTool ( this , new TextFigure ( ) ) ; palette . add ( createToolButton ( ( ( IMAGES ) + "TEXT" ) , "Text<seq2seq4repair_space>Tool" , tool ) ) ; tool = new PertFigureCreationTool ( this ) ; palette . add ( createToolButton ( ( ( PertApplication . PERTIMAGES ) + "PERT" ) , "Task<seq2seq4repair_space>Tool" , tool ) ) ; tool = new ConnectionTool ( this , new PertDependency ( ) ) ; palette . add ( createToolButton ( ( ( IMAGES ) + "CONN" ) , "Dependency<seq2seq4repair_space>Tool" , tool ) ) ; tool = new CreationTool ( this , new LineFigure ( ) ) ; <START_BUG> palette . add ( createToolButton ( ( ( IMAGES ) + "Line" ) , "Line<seq2seq4repair_space>Tool" , tool ) ) ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
palette . add ( createToolButton ( ( ( IMAGES ) + "LINE" ) , "Line<seq2seq4repair_space>Tool" , tool ) ) ;
Buggy code:
public class FileDetailsActivity extends BaseActivity { private Context context ; private ImageView fileIcon ; private TextView tvFilename ; private TextView tvFileSize ; private Button btnOpenDownloadFile ; private ListEntryItem current ; private File file ; private String ident ; private String authCode ; private String serverUrl ; private String folderId ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void buttonClick ( View target ) { String text = ( ( Button ) ( target ) ) . getText ( ) . toString ( ) ; if ( text . equals ( getString ( open_file ) ) ) { Intent open = new Intent ( Intent . ACTION_VIEW , Uri . parse ( file . getAbsolutePath ( ) ) ) ; String extension = MimeTypeMap . getFileExtensionFromUrl ( file . getAbsolutePath ( ) ) ; String mimetype = MimeTypeMap . getSingleton ( ) . getMimeTypeFromExtension ( extension ) ; open . addFlags ( FLAG_ACTIVITY_NEW_TASK ) ; open . setAction ( ACTION_VIEW ) ; open . setDataAndType ( Uri . fromFile ( file ) , mimetype ) ; PackageManager packageManager = getPackageManager ( ) ; List < ResolveInfo > list = packageManager . queryIntentActivities ( open , MATCH_DEFAULT_ONLY ) ; if ( ( list . size ( ) ) > 0 ) { startActivity ( open ) ; } else { Toast . makeText ( context , getString ( activity_not_found ) , LENGTH_SHORT ) . show ( ) ; } startActivity ( open ) ; } else { StringBuilder sb = new StringBuilder ( ) ; sb . append ( serverUrl ) ; sb . append ( "//api//getFile//" ) ; <START_BUG> sb . append ( ( ( current . getId ( ) ) + "?" ) ) ; <END_BUG> sb . append ( current . getUrl ( ) ) ; current . setUrl ( sb . toString ( ) ) ; new FileDetailsActivity . DownloadFile ( ) . execute ( current ) ; } } private class DownloadFile extends AsyncTask < ListEntryItem , Integer , Boolean > { Notification notification ; NotificationManager notificationManager ; private int maxProgress ; ListEntryItem current ; @ Override protected void onPreExecute ( ) { } @ Override protected Boolean doInBackground ( ListEntryItem ... params ) { } @ Override protected void onProgressUpdate ( Integer ... values ) { } @ Override protected void onPostExecute ( Boolean result ) { } } }

Fix:
sb . append ( ( ( folderId ) + "?" ) ) ;
Buggy code:
final class RemoteServiceImpl implements IRemoteService { RemoteServiceReferenceImpl refImpl ; private Object service ; private long nextID ; public RemoteServiceImpl ( final RemoteServiceReferenceImpl refImpl , final Object service ) { } public void callAsynch ( final IRemoteCall call , final IRemoteCallListener listener ) { } <START_BUG> public IFutureStatus callAsynch ( final IRemoteCall call ) { <END_BUG> final FutureStatus result = new FutureStatus ( ) ; final IRemoteCallListener listener = new IRemoteCallListener ( ) { public void handleEvent ( IRemoteCallEvent event ) { if ( event instanceof IRemoteCallCompleteEvent ) { IRemoteCallCompleteEvent cce = ( ( IRemoteCallCompleteEvent ) ( event ) ) ; if ( cce . hadException ( ) ) result . setException ( cce . getException ( ) ) ; else result . set ( cce . getResponse ( ) ) ; } } } ; callAsynch ( call , listener ) ; return result ; } public Object callSynch ( final IRemoteCall call ) throws ECFException { } public void fireAsynch ( final IRemoteCall call ) throws ECFException { } public Object getProxy ( ) throws ECFException { } synchronized long getNextID ( ) { } private class AsyncResult extends Thread implements IAsyncResult { Object result ; Throwable exception ; IRemoteCall call ; private IRemoteCallListener listener ; AsyncResult ( final IRemoteCall call , final IRemoteCallListener listener ) { } public synchronized void clear ( ) { } public Object get ( ) throws InterruptedException , InvocationTargetException { } public synchronized Object get ( final long msecs ) throws InterruptedException , InvocationTargetException { } public synchronized InvocationTargetException getException ( ) { } public synchronized boolean isReady ( ) { } public synchronized Object peek ( ) { } public void run ( ) { } } }

Fix:
public IFuture callAsynch ( final IRemoteCall call ) {
Buggy code:
public class LDA_GibbsDebug extends LDA_Gibbs { public LDA_GibbsDebug ( int number_of_iteration , double converge , double beta , _Corpus c , double lambda , int number_of_topics , double alpha , double burnIn , int lag ) { } public void printTopWords ( int k , String betaFile ) { } public void debugOutput ( String filePrefix ) { } public void printTopicAssignment ( _Doc d , File folder ) { } public void printCorpusTopWords ( int k , String betaFile ) { } public void printParameter ( String parameterFile ) { try { <START_BUG> System . out . println ( "print<seq2seq4repair_space>childParameterFile" ) ; <END_BUG> PrintWriter paraOut = new PrintWriter ( new File ( parameterFile ) ) ; for ( _Doc d : m_trainSet ) { paraOut . print ( ( ( d . getName ( ) ) + "\t" ) ) ; paraOut . print ( "topicProportion\t" ) ; for ( int k = 0 ; k < ( number_of_topics ) ; k ++ ) { paraOut . print ( ( ( d . m_topics [ k ] ) + "\t" ) ) ; } paraOut . println ( ) ; } paraOut . flush ( ) ; paraOut . close ( ) ; } catch ( Exception ex ) { System . err . print ( "para<seq2seq4repair_space>File<seq2seq4repair_space>Not<seq2seq4repair_space>Found" ) ; } } }

Fix:
System . out . println ( "print<seq2seq4repair_space>ParameterFile" ) ;
Buggy code:
public class CacheMutatorTestCase { @ Test public void mutate ( ) { } @ Test public void isMutable ( ) { assertTrue ( CacheMutator . isMutable ( new Object ( ) ) ) ; assertTrue ( CacheMutator . isMutable ( new Date ( ) ) ) ; assertFalse ( CacheMutator . isMutable ( Boolean . TRUE ) ) ; assertFalse ( CacheMutator . isMutable ( Character . valueOf ( 'a' ) ) ) ; <START_BUG> assertFalse ( CacheMutator . isMutable ( Currency . getInstance ( Locale . getDefault ( ) ) ) ) ; <END_BUG> assertFalse ( CacheMutator . isMutable ( BASIC ) ) ; assertFalse ( CacheMutator . isMutable ( Locale . getDefault ( ) ) ) ; assertFalse ( CacheMutator . isMutable ( Byte . valueOf ( Integer . valueOf ( 1 ) . byteValue ( ) ) ) ) ; assertFalse ( CacheMutator . isMutable ( Short . valueOf ( Integer . valueOf ( 1 ) . shortValue ( ) ) ) ) ; assertFalse ( CacheMutator . isMutable ( Integer . valueOf ( 1 ) ) ) ; assertFalse ( CacheMutator . isMutable ( Long . valueOf ( 1 ) ) ) ; assertFalse ( CacheMutator . isMutable ( Float . valueOf ( 1 ) ) ) ; assertFalse ( CacheMutator . isMutable ( Double . valueOf ( 1 ) ) ) ; assertFalse ( CacheMutator . isMutable ( BigInteger . valueOf ( 1 ) ) ) ; assertFalse ( CacheMutator . isMutable ( BigDecimal . valueOf ( 1 ) ) ) ; assertFalse ( CacheMutator . isMutable ( "test" ) ) ; assertFalse ( CacheMutator . isMutable ( TimeZone . getDefault ( ) ) ) ; assertFalse ( CacheMutator . isMutable ( UUID . randomUUID ( ) ) ) ; assertFalse ( CacheMutator . isMutable ( new CacheMutatorTestCase . ImmutableObject ( ) ) ) ; } @ Immutable static class ImmutableObject { } }

Fix:
assertFalse ( CacheMutator . isMutable ( Currency . getInstance ( Locale . US ) ) ) ;
Buggy code:
public class DB_Index { public static final String copyrightNotice = Copyright . SHORT_2004 ; public static void doIndexes ( Connection conn ) throws SQLException { Statement stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( ( "SELECT<seq2seq4repair_space>TABLEID,<seq2seq4repair_space>CONGLOMERATENAME,<seq2seq4repair_space>" + ( "DESCRIPTOR,<seq2seq4repair_space>SCHEMAID,<seq2seq4repair_space>ISINDEX,<seq2seq4repair_space>ISCONSTRAINT<seq2seq4repair_space>FROM<seq2seq4repair_space>SYS.SYSCONGLOMERATES<seq2seq4repair_space>" + "ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>TABLEID" ) ) ) ; boolean firstTime = true ; while ( rs . next ( ) ) { if ( ( ! ( rs . getBoolean ( 5 ) ) ) || ( rs . getBoolean ( 6 ) ) ) continue ; String tableId = rs . getString ( 1 ) ; String tableName = dblook . lookupTableId ( tableId ) ; if ( tableName == null ) continue ; else if ( dblook . isExcludedTable ( tableName ) ) continue ; String iSchema = dblook . lookupSchemaId ( rs . getString ( 4 ) ) ; if ( dblook . isIgnorableSchema ( iSchema ) ) continue ; if ( firstTime ) { Logs . reportString ( "----------------------------------------------" ) ; <START_BUG> Logs . reportMessage ( "CSLOOK_Header" , "indexes" ) ; <END_BUG> Logs . reportString ( "----------------------------------------------\n" ) ; } String iName = dblook . addQuotes ( dblook . expandDoubleQuotes ( rs . getString ( 2 ) ) ) ; iName = ( iSchema + "." ) + iName ; StringBuffer createIndexString = DB_Index . createIndex ( iName , tableName , tableId , rs . getString ( 3 ) ) ; Logs . writeToNewDDL ( createIndexString . toString ( ) ) ; Logs . writeStmtEndToNewDDL ( ) ; Logs . writeNewlineToNewDDL ( ) ; firstTime = false ; } rs . close ( ) ; stmt . close ( ) ; } private static StringBuffer createIndex ( String ixName , String tableName , String tableId , String ixDescribe ) throws SQLException { } }

Fix:
Logs . reportMessage ( "CSLOOK_IndexesHeader" ) ;
Buggy code:
class YearMonthDurationDV extends DurationDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected Duration getDuration ( DateTimeData date ) { int sign = 1 ; if ( ( ( date . year ) < 0 ) || ( ( date . month ) < 0 ) ) { sign = - 1 ; } <START_BUG> return factory . newDuration ( ( sign == 1 ) , ( ( date . year ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . year ) ) ) : null ) , ( ( date . month ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . month ) ) ) : null ) , null , null , null , null ) ; <END_BUG> } }

Fix:
return datatypeFactory . newDuration ( ( sign == 1 ) , ( ( date . year ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . year ) ) ) : null ) , ( ( date . month ) != ( DatatypeConstants . FIELD_UNDEFINED ) ? BigInteger . valueOf ( ( sign * ( date . month ) ) ) : null ) , null , null , null , null ) ;
Buggy code:
public class RenamingTest extends TestCase { Logger logger = Logger . getLogger ( RenamingTest . class ) ; Logger root ; PatternLayout layout ; public RenamingTest ( String arg0 ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testRename ( ) throws Exception { RollingFileAppender rfa = new RollingFileAppender ( ) ; rfa . setLayout ( layout ) ; String datePattern = "yyyy-MM-dd_HH_mm_ss" ; SimpleDateFormat sdf = new SimpleDateFormat ( datePattern ) ; String [ ] filenames = new String [ 2 ] ; TimeBasedRollingPolicy tbrp = new TimeBasedRollingPolicy ( ) ; tbrp . setFileNamePattern ( ( ( "output//test-%d{" + datePattern ) + "}" ) ) ; tbrp . setActiveFileName ( "output//test.log" ) ; tbrp . activateOptions ( ) ; rfa . setRollingPolicy ( tbrp ) ; <START_BUG> rfa . activateOptions ( ) ; <END_BUG> Calendar cal = Calendar . getInstance ( ) ; root . addAppender ( rfa ) ; logger . debug ( ( "Hello<seq2seq4repair_space>" + 0 ) ) ; Thread . sleep ( 5000 ) ; logger . debug ( ( "Hello<seq2seq4repair_space>" + 1 ) ) ; filenames [ 0 ] = "output//test-" + ( sdf . format ( cal . getTime ( ) ) ) ; filenames [ 1 ] = "output//test.log" ; for ( int i = 0 ; i < ( filenames . length ) ; i ++ ) { assertTrue ( Compare . compare ( filenames [ i ] , ( "witness//rolling//renaming." + i ) ) ) ; } } }

Fix:
rfa . activate ( ) ;
Buggy code:
public class ArchiveUtils { private ArchiveUtils ( ) { } public static String toString ( ArchiveEntry entry ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> sb . append ( ( entry . isDirectory ( ) ? 'd' : '-' ) ) ; String size = Long . toString ( entry . getSize ( ) ) ; sb . append ( '<seq2seq4repair_space>' ) ; for ( int i = 7 ; i > ( size . length ( ) ) ; i -- ) { sb . append ( '<seq2seq4repair_space>' ) ; } sb . append ( size ) ; sb . append ( '<seq2seq4repair_space>' ) . append ( entry . getName ( ) ) ; return sb . toString ( ) ; } public static boolean matchAsciiBuffer ( String expected , byte [ ] buffer , int offset , int length ) { } public static boolean matchAsciiBuffer ( String expected , byte [ ] buffer ) { } public static byte [ ] toAsciiBytes ( String inputString ) { } public static String toAsciiString ( final byte [ ] inputBytes ) { } public static String toAsciiString ( final byte [ ] inputBytes , int offset , int length ) { } public static boolean isEqual ( final byte [ ] buffer1 , final int offset1 , final int length1 , final byte [ ] buffer2 , final int offset2 , final int length2 , boolean ignoreTrailingNulls ) { } public static boolean isEqual ( final byte [ ] buffer1 , final int offset1 , final int length1 , final byte [ ] buffer2 , final int offset2 , final int length2 ) { } public static boolean isEqual ( final byte [ ] buffer1 , final byte [ ] buffer2 ) { } public static boolean isEqual ( final byte [ ] buffer1 , final byte [ ] buffer2 , boolean ignoreTrailingNulls ) { } public static boolean isEqualWithNull ( final byte [ ] buffer1 , final int offset1 , final int length1 , final byte [ ] buffer2 , final int offset2 , final int length2 ) { } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public interface Validator { <START_BUG> void validate ( Object model , List < String > properties ) ; <END_BUG> }

Fix:
ValidateResults validate ( Object model , List < String > properties ) ;
Buggy code:
public class ExactTypePattern extends TypePattern { protected TypeX type ; public ExactTypePattern ( TypeX type , boolean includeSubtypes ) { } protected boolean matchesExactly ( ResolvedTypeX matchType ) { } public TypeX getType ( ) { } public FuzzyBoolean matchesInstanceof ( ResolvedTypeX matchType ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void write ( DataOutputStream out ) throws IOException { } public static TypePattern read ( DataInputStream s , ISourceContext context ) throws IOException { } public String toString ( ) { <START_BUG> return ( ( "ExactTypePattern(" + ( type . toString ( ) ) ) + ( includeSubtypes ? "+" : "" ) ) + ")" ; <END_BUG> } public TypePattern resolveBindings ( IScope scope , Bindings bindings , boolean allowBinding , boolean requireExactType ) { } }

Fix:
return ( type . toString ( ) ) + ( includeSubtypes ? "+" : "" ) ;
Buggy code:
@ SuppressWarnings ( { "rawtypes" , "unchecked" , "serial" } ) public class ActivitiesPanel extends JPanel { private JComboBox extraInfo ; private JComboBox phase ; private JComboBox option ; private ClientController control ; public boolean state = false ; public ActivitiesPanel ( ClientController c ) { } public void update ( ) { ArrayList < Phase > phases = this . control . model . getPlayer ( ) . getPhases ( ) ; PhaseType [ ] p = new PhaseType [ phases . size ( ) ] ; for ( int i = 0 ; i < ( phases . size ( ) ) ; i ++ ) { p [ i ] = phases . get ( i ) . getType ( ) ; } <START_BUG> option . setModel ( new DefaultComboBoxModel ( p ) ) ; <END_BUG> } }

Fix:
phase . setModel ( new DefaultComboBoxModel ( p ) ) ;
Buggy code:
public class ChannelProvider implements JGroupsChannelLookup { private static final String CHANNEL_FACTORY = "channel-factory" ; private static final String ID = "id" ; public static void init ( GlobalConfiguration global , ChannelFactory factory ) { Properties properties = global . getTransportProperties ( ) ; properties . setProperty ( CHANNEL_LOOKUP , ChannelProvider . class . getName ( ) ) ; properties . put ( ChannelProvider . CHANNEL_FACTORY , factory ) ; <START_BUG> properties . put ( ChannelProvider . ID , global . getClusterName ( ) ) ; <END_BUG> } @ Override public Channel getJGroupsChannel ( Properties properties ) { } @ Override public boolean shouldStartAndConnect ( ) { } @ Override public boolean shouldStopAndDisconnect ( ) { } }

Fix:
properties . put ( ChannelProvider . ID , ( ( ( global . getTransportNodeName ( ) ) + "-" ) + ( global . getClusterName ( ) ) ) ) ;
Buggy code:
public class TestStrategyAnnotaion extends SingleEMFTestCase { public void testStrategy ( ) { <START_BUG> EntityManagerFactory emf = Persistence . createEntityManagerFactory ( "example" , System . getProperties ( ) ) ; <END_BUG> EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; Person person = new Person ( ) ; person . setName ( "parul" ) ; person . setAge ( 21 ) ; em . persist ( person ) ; em . getTransaction ( ) . commit ( ) ; em . clear ( ) ; List pers = em . createQuery ( "select<seq2seq4repair_space>p<seq2seq4repair_space>from<seq2seq4repair_space>Person<seq2seq4repair_space>p" ) . getResultList ( ) ; assertTrue ( pers . isEmpty ( ) ) ; } }

Fix:
EntityManagerFactory emf = Persistence . createEntityManagerFactory ( "testStrategy" , System . getProperties ( ) ) ;
Buggy code:
public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { <START_BUG> if ( ( originalMethod . typeVariables ) == ( NoTypeVariables ) ) { <END_BUG> return super . createParameterizedMethod ( originalMethod ) ; } return new ParameterizedGenericMethodBinding ( originalMethod , this , this . environment ) ; } public String debugName ( ) { } public char [ ] genericTypeSignature ( ) { } public boolean isEquivalentTo ( TypeBinding otherType ) { } public boolean isParameterizedType ( ) { } public boolean isRawType ( ) { } protected void initializeArguments ( ) { } public char [ ] readableName ( ) { } public TypeBinding substitute ( TypeBinding originalType ) { } public char [ ] shortReadableName ( ) { } }

Fix:
if ( ( ( originalMethod . typeVariables ) == ( NoTypeVariables ) ) || ( originalMethod . isStatic ( ) ) ) {
Buggy code:
@ Embeddable public class TimeBox { private Date from ; private Date to ; public TimeBox ( ) { } public TimeBox ( Date from , Date to ) { } public Date getFrom ( ) { } public void setFrom ( Date from ) { } public Date getTo ( ) { } public void setTo ( Date to ) { } public void validate ( ) { Validate . notNull ( from ) ; Validate . notNull ( to ) ; <START_BUG> Validate . isTrue ( from . before ( to ) ) ; <END_BUG> } }

Fix:
Validate . isTrue ( ( ( from . before ( to ) ) || ( from . equals ( to ) ) ) ) ;
Buggy code:
public class TCPServerSOContainerGroup extends SOContainerGroup implements ISocketAcceptHandler { public static final String INVALID_CONNECT = "Invalid<seq2seq4repair_space>connect<seq2seq4repair_space>request.<seq2seq4repair_space>" ; public static final Trace debug = Trace . create ( "connection" ) ; public static final String DEFAULT_GROUP_NAME = TCPServerSOContainerGroup . class . getName ( ) ; protected int port ; Server listener ; boolean isOnTheAir = false ; ThreadGroup threadGroup ; public TCPServerSOContainerGroup ( String name , ThreadGroup group , int port ) { } public TCPServerSOContainerGroup ( String name , int port ) { } public TCPServerSOContainerGroup ( int port ) { } protected void debug ( String msg ) { } protected void dumpStack ( String msg , Throwable e ) { } public synchronized void putOnTheAir ( ) throws IOException { } public synchronized boolean isOnTheAir ( ) { } public void handleAccept ( Socket aSocket ) throws Exception { } public synchronized void takeOffTheAir ( ) { if ( ( listener ) != null ) { if ( ( Trace . ON ) && ( ( TCPServerSOContainerGroup . debug ) != null ) ) { <START_BUG> TCPServerSOContainerGroup . debug . msg ( ( ( "Taking<seq2seq4repair_space>" + ( getName ( ) ) ) + "<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>air." ) ) ; <END_BUG> } try { listener . close ( ) ; } catch ( IOException e ) { if ( ( Trace . ON ) && ( ( TCPServerSOContainerGroup . debug ) != null ) ) { TCPServerSOContainerGroup . debug . dumpStack ( e , "Exception<seq2seq4repair_space>in<seq2seq4repair_space>closeListener" ) ; } } listener = null ; } isOnTheAir = false ; } public int getPort ( ) { } public String toString ( ) { } }

Fix:
TCPServerSOContainerGroup . debug . msg ( ( ( "Taking<seq2seq4repair_space>" + ( getName ( ) ) ) + "<seq2seq4repair_space>off<seq2seq4repair_space>the<seq2seq4repair_space>air." ) ) ;
Buggy code:
public class WebServiceSEIPresentNoWebMethodRuleTest extends AbstractAnnotationValidationTest { @ Override protected Annotation getAnnotation ( ) { } @ Override protected String getClassContents ( ) { StringBuilder classContents = new StringBuilder ( "package<seq2seq4repair_space>com.example;\n\n" ) ; classContents . append ( "import<seq2seq4repair_space>javax.jws.WebService;\n\n" ) ; <START_BUG> classContents . append ( "@WebService(name=\"MyClass\",<seq2seq4repair_space>endpointInterface=\"MyInterface\",<seq2seq4repair_space>" ) ; <END_BUG> classContents . append ( "targetNamespace=\"http:////example.com//\",<seq2seq4repair_space>portName=\"MyClassPort\",<seq2seq4repair_space>" ) ; classContents . append ( "serviceName=\"MyClassService\")\n" ) ; classContents . append ( "public<seq2seq4repair_space>class<seq2seq4repair_space>MyClass<seq2seq4repair_space>{\n\n" ) ; classContents . append ( ( "\tpublic<seq2seq4repair_space>String<seq2seq4repair_space>myMethod()<seq2seq4repair_space>{" + "\n\t\treturn<seq2seq4repair_space>\"txt\";\n\t}\n\n}" ) ) ; return classContents . toString ( ) ; } @ Override protected String getClassName ( ) { } @ Override protected String getPackageName ( ) { } public void testWebServiceSEIPresentNoWebMethodRule ( ) { } }

Fix:
classContents . append ( "@WebService(endpointInterface=\"MyInterface\",<seq2seq4repair_space>" ) ;
Buggy code:
public class ArrayType extends Type { public static final ChildPropertyDescriptor COMPONENT_TYPE_PROPERTY = new ChildPropertyDescriptor ( ArrayType . class , "componentType" , Type . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Type componentType = null ; ArrayType ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getComponentType ( ) { if ( ( this . componentType ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . componentType ) == null ) { preLazyInit ( ) ; this . componentType = new SimpleType ( this . ast ) ; postLazyInit ( this . componentType , ArrayType . COMPONENT_TYPE_PROPERTY ) ; } } } return this . componentType ; } public void setComponentType ( Type componentType ) { } public Type getElementType ( ) { } public int getDimensions ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class Map { float width ; float height ; private int maxApple ; private int maxBonus ; private int nbApples = 0 ; private int nbBonus = 0 ; private ArrayList < Item > items = new ArrayList < Item > ( ) ; final GameEngine gameEngineRef ; Map ( int nbPlayer , float width , float height , GameEngine gameEngineRef ) { } public void newGame ( ) { } public void newRound ( ) { } void createItems ( ) { } public void setTrap ( int player , float px , float py , float radius ) { } ArrayList < Item > getItems ( ) { } public boolean collisionCircleItems ( float x , float y , float radius ) { for ( Item i : items ) <START_BUG> if ( ( ( ( x - ( i . x ) ) * ( x - ( i . x ) ) ) + ( ( y - ( i . y ) ) * ( y - ( i . y ) ) ) ) <= ( radius + ( i . radius ) ) ) <END_BUG> return true ; return false ; } ArrayList < float [ ] > getEquivalentPositions ( float x , float y , float r ) { } void putInside ( Part head ) { } public void step ( ) { } }

Fix:
if ( ( ( ( x - ( i . x ) ) * ( x - ( i . x ) ) ) + ( ( y - ( i . y ) ) * ( y - ( i . y ) ) ) ) <= ( ( radius + ( i . radius ) ) * ( radius + ( i . radius ) ) ) )
Buggy code:
@ WebServlet ( urlPatterns = { "//count" } ) public class StatefulServlet extends HttpServlet { private static final long serialVersionUID = - 592774116315946908L ; @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { HttpSession session = req . getSession ( true ) ; Stateful bean = ( ( Stateful ) ( session . getAttribute ( "bean" ) ) ) ; if ( bean == null ) { try { <START_BUG> bean = ( ( Stateful ) ( new InitialContext ( ) . lookup ( "java:app//stateful//StatefulBean!org.jboss.as.test.clustering.unmanaged.ejb3.stateful.bean.Stateful" ) ) ) ; <END_BUG> } catch ( NamingException e ) { throw new ServletException ( e ) ; } } resp . setHeader ( "count" , String . valueOf ( bean . increment ( ) ) ) ; resp . getWriter ( ) . write ( "Success" ) ; session . setAttribute ( "bean" , bean ) ; } }

Fix:
bean = ( ( Stateful ) ( new InitialContext ( ) . lookup ( ( "java:app//stateful//StatefulBean!" + ( Stateful . class . getCanonicalName ( ) ) ) ) ) ) ;
Buggy code:
public class FolderLayout implements IFolderLayout { private ViewStack folder ; private PageLayout pageLayout ; private ViewFactory viewFactory ; public FolderLayout ( PageLayout pageLayout , ViewStack folder , ViewFactory viewFactory ) { } public void addPlaceholder ( String viewId ) { } public void addView ( String viewId ) { if ( pageLayout . checkPartInLayout ( viewId ) ) return ; try { IViewDescriptor descriptor = viewFactory . getViewRegistry ( ) . find ( viewId ) ; if ( WorkbenchActivityHelper . filterItem ( descriptor ) ) { addPlaceholder ( viewId ) ; LayoutHelper . addViewActivator ( pageLayout , viewId ) ; } else { ViewPane newPart = LayoutHelper . createView ( pageLayout . getViewFactory ( ) , viewId ) ; linkPartToPageLayout ( viewId , newPart ) ; folder . add ( newPart ) ; } } catch ( PartInitException e ) { <START_BUG> WorkbenchPlugin . log ( e . getMessage ( ) ) ; <END_BUG> } } private void linkPartToPageLayout ( String viewId , LayoutPart newPart ) { } }

Fix:
WorkbenchPlugin . log ( getClass ( ) , "addView(String)" , e ) ;
Buggy code:
public class AccountWizardLauncher { public AccountWizardLauncher ( ) { } public void launchWizard ( boolean firstStart ) { DataModel data = new DataModel ( ) ; Step [ ] steps ; if ( firstStart ) { steps = new Step [ ] { new WelcomeStep ( ) , new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , false ) , new FinishStep ( ) } ; } else { steps = new Step [ ] { new IdentityStep ( data ) , new IncomingServerStep ( data ) , new OutgoingServerStep ( data , true ) } ; } WizardModel model = new net . javaprog . ui . wizard . DefaultWizardModel ( steps ) ; model . addWizardModelListener ( new AccountCreator ( data ) ) ; Wizard wizard = new Wizard ( model , MailResourceLoader . getString ( "dialog" , "accountwizard" , "title" ) , ImageLoader . getSmallImageIcon ( "stock_preferences.png" ) ) ; CSH . setHelpIDString ( wizard , "getting_started_1" ) ; <START_BUG> JavaHelpSupport . enableHelp ( wizard , HelpManager . getHelpManager ( ) . getHelpBroker ( ) ) ; <END_BUG> wizard . pack ( ) ; wizard . setLocationRelativeTo ( null ) ; wizard . setVisible ( true ) ; } }

Fix:
JavaHelpSupport . enableHelp ( wizard , HelpManager . getInstance ( ) . getHelpBroker ( ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "//candidate" ) public class CandidateController extends AbstractBaseController { @ Autowired private UserService userService ; @ Autowired private MailService mailService ; @ Autowired private WithdrawRequestService withdrawRequestService ; @ RequestMapping ( "//success" ) public ModelAndView candidateDataSuccess ( final HttpServletRequest request , final HttpServletResponse response , final Locale locale ) { <START_BUG> GdeUser user = GDESessionFacade . getUser ( request ) ; <END_BUG> if ( user != null ) { try { user . setLastLoginRole ( CANDIDATE ) ; userService . update ( user ) ; } catch ( Exception e ) { throw new GDEException ( e ) ; } } return new ModelAndView ( "candidate_data_success" ) ; } @ RequestMapping ( "//review" ) public ModelAndView candidateDataReview ( final HttpServletRequest request , final HttpServletResponse response , final Locale locale ) { } @ RequestMapping ( "//withdraw" ) public void withdrawApllicatipon ( final HttpServletRequest request , final HttpServletResponse response , final Locale locale ) { } private MailMetaData getMailMetaDataForWithdrawApplicationMail ( final Locale locale , final String contextpath ) { } private void sentWithdrawMail ( final MailMetaData mailMetaData , final String reason , final Locale locale , final GdeUser user ) { } @ RequestMapping ( "//withdrawmessage" ) public ModelAndView withdrawMesssagePage ( HttpServletRequest request , HttpServletResponse response ) { } No newline ; at end ; of file ; }

Fix:
GdeUser user = getApplicationUser ( request ) ;
Buggy code:
public class BindingRemoveHandler extends SocketBindingRemoveHandler { public static final BindingRemoveHandler INSTANCE = new BindingRemoveHandler ( ) ; private BindingRemoveHandler ( ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) { PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; String name = address . getLastElement ( ) . getValue ( ) ; ServiceName svcName = JBOSS_BINDING_NAME . append ( name ) ; ServiceRegistry registry = context . getServiceRegistry ( true ) ; ServiceController < ? > controller = registry . getService ( svcName ) ; <START_BUG> if ( ( controller != null ) && ( ( controller . getState ( ) ) == ( State . UP ) ) ) { <END_BUG> context . reloadRequired ( ) ; } else { context . removeService ( JBOSS_BINDING_NAME . append ( name ) ) ; } } protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
if ( ( ( controller != null ) && ( ( controller . getState ( ) ) == ( State . UP ) ) ) && ( controller . getSubstate ( ) . isRestState ( ) ) ) {
Buggy code:
public class ResourceUrlProviderJavaConfigTests { private final ResourceUrlProviderJavaConfigTests . TestServlet servlet = new ResourceUrlProviderJavaConfigTests . TestServlet ( ) ; private MockFilterChain filterChain ; private MockHttpServletRequest request ; @ Before @ SuppressWarnings ( "resource" ) public void setup ( ) throws Exception { } @ Test public void rootServletMapping ( ) throws Exception { } @ Test public void prefixServletMapping ( ) throws Exception { } @ Test public void extensionServletMapping ( ) throws Exception { } @ Configuration static class WebConfig extends WebMvcConfigurationSupport { @ Override public void addResourceHandlers ( ResourceHandlerRegistry registry ) { <START_BUG> registry . addResourceHandler ( "//resources//**" ) . addResourceLocations ( "classpath:org//springframework//web//servlet//resource//test//" ) . addVersionHash ( "//**" ) ; <END_BUG> } } @ SuppressWarnings ( "serial" ) private static class TestServlet extends HttpServlet { private HttpServletResponse response ; @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) { } } }

Fix:
registry . addResourceHandler ( "//resources//**" ) . addResourceLocations ( "classpath:org//springframework//web//servlet//resource//test//" ) . setResourceResolvers ( new FingerprintResourceResolver ( ) , new PathResourceResolver ( ) ) ;
Buggy code:
public class ConstructorDeclaration extends AbstractMethodDeclaration { public ExplicitConstructorCall constructorCall ; public boolean isDefaultConstructor = false ; public TypeParameter [ ] typeParameters ; public ConstructorDeclaration ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext initializerFlowContext , FlowInfo flowInfo ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } public void generateSyntheticFieldInitializationsIfNecessary ( MethodScope methodScope , CodeStream codeStream , ReferenceBinding declaringClass ) { } private void internalGenerateCode ( ClassScope classScope , ClassFile classFile ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { } public boolean isInitializationMethod ( ) { } public boolean isRecursive ( ArrayList visited ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer printBody ( int indent , StringBuffer output ) { } public void resolveJavadoc ( ) { } public void resolveStatements ( ) { if ( ! ( CharOperation . equals ( scope . enclosingSourceType ( ) . sourceName , selector ) ) ) { scope . problemReporter ( ) . missingReturnType ( this ) ; } if ( ( ( this . binding ) != null ) && ( this . binding . declaringClass . isAnnotationType ( ) ) ) { scope . problemReporter ( ) . annotationTypeDeclarationCannotHaveConstructor ( this ) ; } if ( ( this . constructorCall ) != null ) { <START_BUG> if ( ( ( ( this . binding ) != null ) && ( ( this . binding . declaringClass . id ) == ( T_Object ) ) ) && ( ( this . constructorCall . accessMode ) != ( ExplicitConstructorCall . This ) ) ) { <END_BUG> if ( ( this . constructorCall . accessMode ) == ( ExplicitConstructorCall . Super ) ) { scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this . constructorCall ) ; } this . constructorCall = null ; } else { this . constructorCall . resolve ( this . scope ) ; } } if ( ( ( modifiers ) & ( AccSemicolonBody ) ) != 0 ) { scope . problemReporter ( ) . methodNeedBody ( this ) ; } super . resolveStatements ( ) ; } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { } public TypeParameter [ ] typeParameters ( ) { } }

Fix:
if ( ( ( ( this . binding ) != null ) && ( ( this . binding . declaringClass . id ) == ( TypeIds . T_JavaLangObject ) ) ) && ( ( this . constructorCall . accessMode ) != ( ExplicitConstructorCall . This ) ) ) {
Buggy code:
public class JoinGameController extends Controller implements IJoinGameController , Observer { private INewGameView newGameView ; private ISelectColorView selectColorView ; private IMessageView messageView ; private IAction joinAction ; private IMasterManager master ; private PlayerInfo localPlayer ; private GameInfo localGame ; private Game gameModel ; private ArrayList < String > takenColors ; private ArrayList < String > newTakenColors ; private final int NUMBER_OF_PLAYERS = 4 ; private boolean inGame = false ; public JoinGameController ( IJoinGameView view , INewGameView newGameView , ISelectColorView selectColorView , IMessageView messageView ) { } public IJoinGameView getJoinGameView ( ) { } public IAction getJoinAction ( ) { } public void setJoinAction ( IAction value ) { } public INewGameView getNewGameView ( ) { } public void setNewGameView ( INewGameView newGameView ) { } public ISelectColorView getSelectColorView ( ) { } public void setSelectColorView ( ISelectColorView selectColorView ) { } public IMessageView getMessageView ( ) { } public void setMessageView ( IMessageView messageView ) { } @ Override public void start ( ) { } @ Override public void startCreateNewGame ( ) { } @ Override public void cancelCreateNewGame ( ) { } @ Override public void createNewGame ( ) { } @ Override public void startJoinGame ( GameInfo game ) { } @ Override public void cancelJoinGame ( ) { } @ Override public void joinGame ( CatanColor color ) { } private boolean isAscii ( String word ) { <START_BUG> return word . matches ( "[a-zA-Z0-9<seq2seq4repair_space>]+" ) ; <END_BUG> } public void generateGameList ( ) { } public void enableAllColors ( ) { } @ Override public void update ( Observable o , Object arg ) { } }

Fix:
return word . matches ( "[a-zA-Z0-9<,>.?//:;\"\'\\!@#$%^&*()_~`]+" ) ;
Buggy code:
public class DefaultDetailsArea extends AbstractStatusAreaProvider { private WorkbenchStatusDialog workbenchStatusDialog ; public DefaultDetailsArea ( WorkbenchStatusDialog wsd ) { } protected static final int MASK = ( ( ( IStatus . CANCEL ) | ( IStatus . ERROR ) ) | ( IStatus . INFO ) ) | ( IStatus . WARNING ) ; private static final Object NESTING_INDENT = "<seq2seq4repair_space>" ; private List list ; private Clipboard clipboard ; public Control createSupportArea ( Composite parent , StatusAdapter statusAdapter ) { } protected Composite createArea ( Composite parent ) { } protected void setStatusAdapter ( StatusAdapter adapter ) { list . removeAll ( ) ; populateList ( list , adapter . getStatus ( ) , 0 ) ; <START_BUG> if ( ( workbenchStatusDialog . getErrors ( ) . size ( ) ) == 1 ) { <END_BUG> Long timestamp = ( ( Long ) ( adapter . getProperty ( TIMESTAMP_PROPERTY ) ) ) ; if ( timestamp != null ) { String date = DateFormat . getDateTimeInstance ( LONG , LONG ) . format ( new Date ( timestamp . longValue ( ) ) ) ; list . add ( NLS . bind ( JobInfo_Error , new Object [ ] { "" , date } ) ) ; } } } private void createDNDSource ( ) { } private void createCopyAction ( final Composite parent ) { } private String prepareCopyString ( ) { } private void populateList ( List list , IStatus status , int nesting ) { } public List getList ( ) { } }

Fix:
if ( ( workbenchStatusDialog . getStatusAdapters ( ) . size ( ) ) == 1 ) {
Buggy code:
public class SIGRecord extends Record { private static SIGRecord member = new SIGRecord ( ) ; private int covered ; private int alg ; private int labels ; private long origttl ; private Date expire ; private Date timeSigned ; private int footprint ; private Name signer ; private byte [ ] signature ; private SIGRecord ( ) { } private SIGRecord ( Name name , int dclass , long ttl ) { } static SIGRecord getMember ( ) { } public SIGRecord ( Name name , int dclass , long ttl , int covered , int alg , int origttl , Date expire , Date timeSigned , int footprint , Name signer , byte [ ] signature ) { } Record rrFromWire ( Name name , int type , int dclass , long ttl , int length , DataByteInputStream in ) throws IOException { } Record rdataFromString ( Name name , int dclass , long ttl , Tokenizer st , Name origin ) throws IOException { SIGRecord rec = new SIGRecord ( name , dclass , ttl ) ; String typeString = st . getString ( ) ; int covered = Type . value ( typeString ) ; if ( covered < 0 ) throw st . exception ( ( "Invalid<seq2seq4repair_space>type:<seq2seq4repair_space>" + typeString ) ) ; rec . covered = covered ; rec . alg = st . getUInt8 ( ) ; rec . labels = st . getUInt8 ( ) ; rec . origttl = st . getTTL ( ) ; rec . expire = FormattedTime . parse ( st . getString ( ) ) ; rec . timeSigned = FormattedTime . parse ( st . getString ( ) ) ; rec . footprint = st . getUInt16 ( ) ; rec . signer = st . getName ( origin ) ; <START_BUG> rec . signature = base64 . fromString ( remainingStrings ( st ) ) ; <END_BUG> return rec ; } public String rdataToString ( ) { } public int getTypeCovered ( ) { } public int getAlgorithm ( ) { } public int getLabels ( ) { } public long getOrigTTL ( ) { } public Date getExpire ( ) { } public Date getTimeSigned ( ) { } public int getFootprint ( ) { } public Name getSigner ( ) { } public byte [ ] getSignature ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
rec . signature = st . getBase64 ( ) ;
Buggy code:
public class JavaSearchParticipant extends SearchParticipant { IndexSelector indexSelector ; public void beginSearching ( ) { } public void doneSearching ( ) { } public String getDescription ( ) { } public SearchDocument getDocument ( String documentPath ) { } public void indexDocument ( SearchDocument document , IPath indexPath ) { } public void locateMatches ( SearchDocument [ ] indexMatches , SearchPattern pattern , IJavaSearchScope scope , SearchRequestor requestor , IProgressMonitor monitor ) throws CoreException { <START_BUG> MatchLocator matchLocator = new MatchLocator ( pattern , requestor , scope , ( monitor == null ? null : new SubProgressMonitor ( monitor , 95 ) ) ) ; <END_BUG> if ( ( monitor != null ) && ( monitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; matchLocator . locateMatches ( indexMatches ) ; if ( ( monitor != null ) && ( monitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; matchLocator . locatePackageDeclarations ( this ) ; } public IPath [ ] selectIndexes ( SearchPattern pattern , IJavaSearchScope scope ) { } }

Fix:
MatchLocator matchLocator = new MatchLocator ( pattern , requestor , scope , monitor ) ;