nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class ValidationUtils { private static Log logger = LogFactory . getLog ( ValidationUtils . class ) ; public static void invokeValidator ( Validator validator , Object obj , Errors errors ) { <START_BUG> ValidationUtils . invokeValidator ( validator , obj , errors , ( ( Class [ ] ) ( null ) ) ) ; <END_BUG> } public static void invokeValidator ( Validator validator , Object obj , Errors errors , Object ... validationHints ) { } public static void rejectIfEmpty ( Errors errors , String field , String errorCode ) { } public static void rejectIfEmpty ( Errors errors , String field , String errorCode , String defaultMessage ) { } public static void rejectIfEmpty ( Errors errors , String field , String errorCode , Object [ ] errorArgs ) { } public static void rejectIfEmpty ( Errors errors , String field , String errorCode , Object [ ] errorArgs , String defaultMessage ) { } public static void rejectIfEmptyOrWhitespace ( Errors errors , String field , String errorCode ) { } public static void rejectIfEmptyOrWhitespace ( Errors errors , String field , String errorCode , String defaultMessage ) { } public static void rejectIfEmptyOrWhitespace ( Errors errors , String field , String errorCode , Object [ ] errorArgs ) { } public static void rejectIfEmptyOrWhitespace ( Errors errors , String field , String errorCode , Object [ ] errorArgs , String defaultMessage ) { } }

Fix:
ValidationUtils . invokeValidator ( validator , obj , errors , ( ( Object [ ] ) ( null ) ) ) ;
Buggy code:
public class Snippet93 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new RowLayout ( ) ) ; <START_BUG> Label label = new Label ( shell , SWT . NULL ) ; <END_BUG> GC gc = new GC ( label ) ; Point size = gc . textExtent ( "Hello" ) ; gc . dispose ( ) ; label . setText ( ( "Hello<seq2seq4repair_space>-><seq2seq4repair_space>" + size ) ) ; shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
Label label = new Label ( shell , SWT . NONE ) ;
Buggy code:
public final class KeyMachine { public static KeyMachine create ( ) { } private Map actionMap ; private Map actionMapForMode ; private SortedSet bindingSet ; private String configuration ; private SortedMap configurationMap ; private Map keySequenceMap ; private Map keySequenceMapForMode ; private SortedSet matchSet ; private SortedSet matchSetForMode ; private KeySequence mode ; private SortedMap scopeMap ; private String [ ] scopes ; private boolean solved ; private SortedMap tree ; private KeyMachine ( ) { } public Map getActionMap ( ) { } public Map getActionMapForMode ( ) { } public SortedSet getBindingSet ( ) { } public String getConfiguration ( ) { } public SortedMap getConfigurationMap ( ) { } public Map getKeySequenceMap ( ) { } public Map getKeySequenceMapForMode ( ) { } public SortedSet getMatchSet ( ) { } public SortedSet getMatchSetForMode ( ) { if ( ( matchSetForMode ) == null ) { SortedSet matchSetForMode = new TreeSet ( ) ; Iterator iterator = getMatchSet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { Match match = ( ( Match ) ( iterator . next ( ) ) ) ; <START_BUG> if ( match . getBinding ( ) . getKeySequence ( ) . isChildOf ( mode ) ) <END_BUG> matchSetForMode . add ( match ) ; } this . matchSetForMode = Collections . unmodifiableSortedSet ( matchSetForMode ) ; } return matchSetForMode ; } public KeySequence getMode ( ) { } public SortedMap getScopeMap ( ) { } public String [ ] getScopes ( ) { } public boolean setBindingSet ( SortedSet bindingSet ) throws IllegalArgumentException { } public boolean setConfiguration ( String configuration ) { } public boolean setConfigurationMap ( SortedMap configurationMap ) throws IllegalArgumentException { } public boolean setMode ( KeySequence mode ) throws IllegalArgumentException { } public boolean setScopeMap ( SortedMap scopeMap ) throws IllegalArgumentException { } public boolean setScopes ( String [ ] scopes ) throws IllegalArgumentException { } private void build ( ) { } private void invalidateMode ( ) { } private void invalidateSolution ( ) { } private void invalidateTree ( ) { } private void solve ( ) { } }

Fix:
if ( match . getBinding ( ) . getKeySequence ( ) . isChildOf ( mode , false ) )
Buggy code:
public final class ArgoSecurityManager extends SecurityManager { protected static Category cat = Category . getInstance ( ArgoSecurityManager . class ) ; private boolean _allowExit = false ; private static final ArgoSecurityManager SINGLETON = new ArgoSecurityManager ( ) ; public static final ArgoSecurityManager getInstance ( ) { } private ArgoSecurityManager ( ) { } public void checkPermission ( Permission perm ) { if ( perm . getClass ( ) . equals ( PropertyPermission . class ) ) { if ( "sun.awt.exception.handler" . equals ( perm . getName ( ) ) ) { PropertyPermission pp = ( ( PropertyPermission ) ( perm ) ) ; if ( "write" . equals ( pp . getActions ( ) ) ) { throw new SecurityException ( ) ; } } } else if ( perm . getClass ( ) . equals ( RuntimePermission . class ) ) { RuntimePermission rp = ( ( RuntimePermission ) ( perm ) ) ; ArgoSecurityManager . cat . debug ( ( ( ( ( "RuntimePermission:<seq2seq4repair_space>" + ( rp . getName ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>'" ) + ( rp . getActions ( ) ) ) + "'" ) ) ; if ( "exitVM" . equals ( rp . getName ( ) ) ) { <START_BUG> if ( ! ( _allowExit ) ) { <END_BUG> throw new ArgoSecurityException ( true ) ; } } } } public boolean getAllowExit ( ) { } public void setAllowExit ( boolean allowExit ) { } }

Fix:
if ( ! ( ArgoSecurityManager . getInstance ( ) . getAllowExit ( ) ) ) {
Buggy code:
public class TransactionExtension implements Extension { public static final String SUBSYSTEM_NAME = "transactions" ; private static final String RESOURCE_NAME = ( TransactionExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; private static final int MANAGEMENT_API_MAJOR_VERSION = 1 ; private static final int MANAGEMENT_API_MINOR_VERSION = 1 ; private static final int MANAGEMENT_API_MICRO_VERSION = 1 ; private static final ServiceName MBEAN_SERVER_SERVICE_NAME = JBOSS . append ( "mbean" , "server" ) ; static final PathElement LOG_STORE_PATH = PathElement . pathElement ( LOG_STORE , LOG_STORE ) ; static final PathElement SUBSYSTEM_PATH = PathElement . pathElement ( SUBSYSTEM , TransactionExtension . SUBSYSTEM_NAME ) ; static final PathElement PARTECIPANT_PATH = PathElement . pathElement ( PARTICIPANTS ) ; static final PathElement TRANSACTION_PATH = PathElement . pathElement ( TRANSACTIONS ) ; static StandardResourceDescriptionResolver getResourceDescriptionResolver ( final String ... keyPrefix ) { } static MBeanServer getMBeanServer ( OperationContext context ) { } public void initialize ( ExtensionContext context ) { TransactionLogger . ROOT_LOGGER . debug ( "Initializing<seq2seq4repair_space>Transactions<seq2seq4repair_space>Extension" ) ; final LogStoreResource resource = new LogStoreResource ( ) ; final boolean registerRuntimeOnly = context . isRuntimeOnlyRegistrationValid ( ) ; final SubsystemRegistration subsystem = context . registerSubsystem ( TransactionExtension . SUBSYSTEM_NAME , TransactionExtension . MANAGEMENT_API_MAJOR_VERSION , TransactionExtension . MANAGEMENT_API_MINOR_VERSION , TransactionExtension . MANAGEMENT_API_MICRO_VERSION ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( new TransactionSubsystemRootResourceDefinition ( registerRuntimeOnly ) ) ; <START_BUG> registration . registerOperationHandler ( DESCRIBE , INSTANCE , INSTANCE , false , PRIVATE ) ; <END_BUG> ManagementResourceRegistration logStoreChild = registration . registerSubModel ( new LogStoreDefinition ( resource ) ) ; if ( registerRuntimeOnly ) { ManagementResourceRegistration transactionChild = logStoreChild . registerSubModel ( new LogStoreTransactionDefinition ( resource ) ) ; ManagementResourceRegistration partecipantChild = transactionChild . registerSubModel ( LogStoreTransactionParticipantDefinition . INSTANCE ) ; } subsystem . registerXMLElementWriter ( TransactionSubsystem12Parser . INSTANCE ) ; TransactionExtension . registerTransformers ( subsystem ) ; } public void initializeParsers ( ExtensionParsingContext context ) { } private static final ModelVersion version = ModelVersion . create ( 1 , 1 , 0 ) ; private static final RejectExpressionValuesTransformer TRANSFORMER = new RejectExpressionValuesTransformer ( TransactionSubsystemRootResourceDefinition . attributes ) ; private static void registerTransformers ( final SubsystemRegistration subsystem ) { } }

Fix:
registration . registerOperationHandler ( DEFINITION , INSTANCE ) ;
Buggy code:
public class SharedResourceReference extends ResourceReference { private static final long serialVersionUID = 1L ; public SharedResourceReference ( Class < ? > scope , String name , Locale locale , String style , String variation ) { } public SharedResourceReference ( Class < ? > scope , String name ) { } public SharedResourceReference ( String name ) { } @ Override public IResource getResource ( ) { ResourceReference ref = Application . get ( ) . getResourceReferenceRegistry ( ) . getResourceReference ( getScope ( ) , getName ( ) , getLocale ( ) , getStyle ( ) , getVariation ( ) , false ) ; if ( ref == null ) { return new AbstractResource ( ) { private static final long serialVersionUID = 1L ; @ Override protected ResourceResponse newResourceResponse ( Attributes attributes ) { ResourceResponse res = new ResourceResponse ( ) ; <START_BUG> res . setErrorCode ( SC_NOT_FOUND ) ; <END_BUG> return res ; } } ; } else if ( ref != ( this ) ) { return ref . getResource ( ) ; } else { throw new IllegalStateException ( "SharedResourceReference<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>registered<seq2seq4repair_space>globally." ) ; } } @ Override public boolean canBeRegistered ( ) { } }

Fix:
res . setError ( SC_NOT_FOUND ) ;
Buggy code:
public class InfinispanBeanGroupFactory < G , I , T > implements BeanGroupFactory < G , I , T > { private final Cache < G , BeanGroupEntry < I , T > > cache ; private final CacheInvoker invoker ; private final MarshalledValueFactory < MarshallingContext > factory ; private final MarshallingContext context ; public InfinispanBeanGroupFactory ( Cache < G , BeanGroupEntry < I , T > > cache , CacheInvoker invoker , MarshalledValueFactory < MarshallingContext > factory , MarshallingContext context ) { } @ Override public BeanGroupEntry < I , T > createValue ( G id ) { Map < I , T > beans = new HashMap < > ( ) ; BeanGroupEntry < I , T > entry = new InfinispanBeanGroupEntry ( this . factory . createMarshalledValue ( beans ) ) ; <START_BUG> BeanGroupEntry < I , T > existing = this . invoker . invoke ( this . cache , new CreateOperation ( id , entry ) , FORCE_SYNCHRONOUS ) ; <END_BUG> return existing != null ? existing : entry ; } @ Override public BeanGroupEntry < I , T > findValue ( G id ) { } @ Override public void evict ( G id ) { } @ Override public void remove ( G id ) { } @ Override public BeanGroup < G , I , T > createGroup ( final G id , final BeanGroupEntry < I , T > entry ) { } private static class BeanGroupMutator < G , I , T > implements Mutator { private final CacheInvoker invoker ; private final Cache < G , BeanGroupEntry < I , T > > cache ; private final G id ; private final BeanGroupEntry < I , T > entry ; BeanGroupMutator ( CacheInvoker invoker , Cache < G , BeanGroupEntry < I , T > > cache , G id , BeanGroupEntry < I , T > entry ) { } @ Override public void mutate ( ) { } } }

Fix:
BeanGroupEntry < I , T > existing = this . invoker . invoke ( this . cache , new CreateOperation ( id , entry ) ) ;
Buggy code:
public class SubjectTreeRenderer extends DefaultTreeCellRenderer { private Font plainFont ; private Font boldFont ; private Font underlinedFont ; public SubjectTreeRenderer ( ) { } public Component getTreeCellRendererComponent ( JTree tree , Object value , boolean selected , boolean expanded , boolean leaf , int row , boolean hasFocus ) { super . getTreeCellRendererComponent ( tree , value , selected , expanded , leaf , row , hasFocus ) ; MessageNode messageNode = ( ( MessageNode ) ( value ) ) ; if ( messageNode . getUserObject ( ) . equals ( "root" ) ) { setText ( "..." ) ; setIcon ( null ) ; return this ; } HeaderInterface header = messageNode . getHeader ( ) ; if ( header == null ) { return this ; } Flags flags = ( ( org . columba . mail . message . ColumbaHeader ) ( header ) ) . getFlags ( ) ; if ( flags != null ) { if ( ! ( flags . getSeen ( ) ) ) { setFont ( boldFont ) ; } else if ( messageNode . isHasRecentChildren ( ) ) { setFont ( underlinedFont ) ; } else setFont ( plainFont ) ; } String subject = ( ( String ) ( header . get ( "columba.subject" ) ) ) ; if ( subject != null ) <START_BUG> setText ( "test" ) ; <END_BUG> else setText ( "null" ) ; setIcon ( null ) ; return this ; } public void paint ( Graphics g ) { } private String layout ( JLabel label , FontMetrics fontMetrics , String text , Rectangle viewR ) { } }

Fix:
setText ( subject ) ;
Buggy code:
public abstract class ScopedProxyUtils { private static final String TARGET_NAME_PREFIX = "scopedTarget." ; public static BeanDefinitionHolder createScopedProxy ( BeanDefinitionHolder definition , BeanDefinitionRegistry registry , boolean proxyTargetClass ) { String originalBeanName = definition . getBeanName ( ) ; BeanDefinition targetDefinition = definition . getBeanDefinition ( ) ; String targetBeanName = ScopedProxyUtils . getTargetBeanName ( originalBeanName ) ; RootBeanDefinition proxyDefinition = new RootBeanDefinition ( ScopedProxyFactoryBean . class ) ; proxyDefinition . setDecoratedDefinition ( new BeanDefinitionHolder ( targetDefinition , targetBeanName ) ) ; proxyDefinition . setOriginatingBeanDefinition ( targetDefinition ) ; proxyDefinition . setSource ( definition . getSource ( ) ) ; <START_BUG> proxyDefinition . setRole ( ROLE_INFRASTRUCTURE ) ; <END_BUG> proxyDefinition . getPropertyValues ( ) . add ( "targetBeanName" , targetBeanName ) ; if ( proxyTargetClass ) { targetDefinition . setAttribute ( PRESERVE_TARGET_CLASS_ATTRIBUTE , Boolean . TRUE ) ; } else { proxyDefinition . getPropertyValues ( ) . add ( "proxyTargetClass" , Boolean . FALSE ) ; } proxyDefinition . setAutowireCandidate ( targetDefinition . isAutowireCandidate ( ) ) ; proxyDefinition . setPrimary ( targetDefinition . isPrimary ( ) ) ; if ( targetDefinition instanceof AbstractBeanDefinition ) { proxyDefinition . copyQualifiersFrom ( ( ( AbstractBeanDefinition ) ( targetDefinition ) ) ) ; } targetDefinition . setAutowireCandidate ( false ) ; targetDefinition . setPrimary ( false ) ; registry . registerBeanDefinition ( targetBeanName , targetDefinition ) ; return new BeanDefinitionHolder ( proxyDefinition , originalBeanName , definition . getAliases ( ) ) ; } public static String getTargetBeanName ( String originalBeanName ) { } }

Fix:
proxyDefinition . setRole ( targetDefinition . getRole ( ) ) ;
Buggy code:
public class BrentSolver extends UnivariateRealSolverImpl { private static final long serialVersionUID = 7694577816772532779L ; @ Deprecated public BrentSolver ( UnivariateRealFunction f ) { } public BrentSolver ( ) { } @ Deprecated public double solve ( double min , double max ) throws FunctionEvaluationException , MaxIterationsExceededException { } @ Deprecated public double solve ( double min , double max , double initial ) throws FunctionEvaluationException , MaxIterationsExceededException { } public double solve ( final UnivariateRealFunction f , final double min , final double max , final double initial ) throws FunctionEvaluationException , MaxIterationsExceededException { } public double solve ( final UnivariateRealFunction f , final double min , final double max ) throws FunctionEvaluationException , MaxIterationsExceededException { clearResult ( ) ; verifyInterval ( min , max ) ; double ret = Double . NaN ; double yMin = f . value ( min ) ; double yMax = f . value ( max ) ; double sign = yMin * yMax ; if ( sign > 0 ) { if ( ( Math . abs ( yMin ) ) <= ( functionValueAccuracy ) ) { setResult ( min , 0 ) ; ret = min ; } else if ( ( Math . abs ( yMax ) ) <= ( functionValueAccuracy ) ) { setResult ( max , 0 ) ; ret = max ; } else { <START_BUG> throw MathRuntimeException . createIllegalArgumentException ( ( "function<seq2seq4repair_space>values<seq2seq4repair_space>at<seq2seq4repair_space>endpoints<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>different<seq2seq4repair_space>signs.<seq2seq4repair_space>" + "Endpoints:<seq2seq4repair_space>[{0},<seq2seq4repair_space>{1}],<seq2seq4repair_space>Values:<seq2seq4repair_space>[{2},<seq2seq4repair_space>{3}]" ) , new Object [ ] { min , max , yMin , yMax } ) ; <END_BUG> } } else if ( sign < 0 ) { ret = solve ( f , min , yMin , max , yMax , min , yMin ) ; } else { if ( yMin == 0.0 ) { ret = min ; } else { ret = max ; } } return ret ; } private double solve ( final UnivariateRealFunction f , double x0 , double y0 , double x1 , double y1 , double x2 , double y2 ) throws FunctionEvaluationException , MaxIterationsExceededException { } }

Fix:
throw MathRuntimeException . createIllegalArgumentException ( ( "function<seq2seq4repair_space>values<seq2seq4repair_space>at<seq2seq4repair_space>endpoints<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>different<seq2seq4repair_space>signs.<seq2seq4repair_space>" + "Endpoints:<seq2seq4repair_space>[{0},<seq2seq4repair_space>{1}],<seq2seq4repair_space>Values:<seq2seq4repair_space>[{2},<seq2seq4repair_space>{3}]" ) , min , max , yMin , yMax ) ;
Buggy code:
public class IdRelation { private int id1 ; private int id2 ; public IdRelation ( ) { } public int getId1 ( ) { } public void setId1 ( int id1 ) { } public int getId2 ( ) { } public void setId2 ( int id2 ) { <START_BUG> this . id1 = id2 ; <END_BUG> } }

Fix:
this . id2 = id2 ;
Buggy code:
public class MojioClient { private static String REQUEST_TAG = "MojioRequest" ; private static String URL_AUTH_PATH = "https:////api.moj.io//OAuth2//authorize?response_type=token&client_id=%s" ; private String _apiBaseUrl = "https:////api.moj.io//v1//" ; private String _mojioAppID ; private String _mojioAppSecretKey ; private String _redirectUrl ; public interface ResponseListener < T > { public void onSuccess ( T result ) { } public void onFailure ( String error ) { } } private Context _ctx ; private DataStorageHelper _oauthHelper ; private VolleyHelper _requestHelper ; public MojioClient ( Context ctx , String mojioAppID , String mojioSecretkey , String redirectUrl ) { } public boolean isUserLoggedIn ( ) { } public void launchLoginActivity ( Activity activity , int requestCode ) { } public void authenticateApp ( final MojioClient . ResponseListener < UserToken > responseListener ) { } public void login ( String userNameOrPassword , String password , final MojioClient . ResponseListener < User > responseListener ) { } public void loginFacebook ( String fbAccesstoken , final MojioClient . ResponseListener < User > responseListener ) { } private void getUser ( String userID , final MojioClient . ResponseListener < User > responseListener ) { } public void logout ( ) { <START_BUG> _oauthHelper . removeAllStoredValues ( ) ; <END_BUG> } public < T > void get ( final Class < T > modelClass , String entityPath , Map < String , String > queryOptions , final MojioClient . ResponseListener < T > listener ) { } public void getImage ( String entityPath , Map < String , String > queryOptions , final MojioClient . ResponseListener < Bitmap > listener ) { } public < T > void update ( final Class < T > modelClass , String entityPath , JSONObject data , final MojioClient . ResponseListener < T > listener ) { } public < T > void delete ( final Class < T > modelClass , String entityPath , final MojioClient . ResponseListener < T > listener ) { } public < T > void create ( final Class < T > modelClass , String entityPath , final MojioClient . ResponseListener < T > listener ) { } public < T > void create ( final Class < T > modelClass , String entityPath , String contentBody , final MojioClient . ResponseListener < T > listener ) { } public < T > void create ( final Class < T > modelClass , String entityPath , Map < String , String > params , final MojioClient . ResponseListener < T > listener ) { } private void reportVolleyError ( final VolleyError error , MojioClient . ResponseListener listener ) { } public void addRequestToQueue ( Request request ) { } public void cancelAllRequests ( ) { } }

Fix:
_oauthHelper . removeAllUserStoredValues ( ) ;
Buggy code:
public class PantherShuttleActivity extends Activity implements OnClickListener { private ImageView imgView ; @ Override public void onCreate ( Bundle savedInstanceState ) { } public void onClick ( View v ) { switch ( v . getId ( ) ) { case id . btnMap : <START_BUG> Intent i = new Intent ( this , Map . class ) ; <END_BUG> startActivity ( i ) ; break ; case id . btnSchedule : Intent j = new Intent ( this , Schedule . class ) ; startActivity ( j ) ; break ; case id . btnTimes : Intent k = new Intent ( this , Times . class ) ; startActivity ( k ) ; break ; } } No newline ; at end ; of file ; }

Fix:
Intent i = new Intent ( this , UniMap . class ) ;
Buggy code:
public class ManagementPermissionAuthorizer implements Authorizer { private static final Action FAKE_JMX_ACTION = new Action ( Util . createOperation ( "test" , EMPTY_ADDRESS ) , null ) ; private final PermissionFactory permissionFactory ; private final JmxPermissionFactory jmxPermissionFactory ; public ManagementPermissionAuthorizer ( PermissionFactory permissionFactory , JmxPermissionFactory jmxPermissionFactory ) { } @ Override public AuthorizerDescription getDescription ( ) { } @ Override public AuthorizationResult authorize ( Caller caller , Environment callEnvironment , Action action , TargetAttribute target ) { } @ Override public AuthorizationResult authorize ( Caller caller , Environment callEnvironment , Action action , TargetResource target ) { } private AuthorizationResult authorize ( PermissionCollection userPermissions , PermissionCollection requiredPermissions ) { } @ Override public AuthorizationResult authorizeJmxOperation ( Caller caller , Environment callEnvironment , JmxAction action ) { } @ Override public Set < String > getCallerRoles ( Caller caller , Environment callEnvironment , Set < String > runAsRoles ) { } private AuthorizationResult authorize ( Set < String > callerRoles , StandardRole ... roles ) { for ( StandardRole role : roles ) { <START_BUG> if ( callerRoles . contains ( role . toString ( ) ) ) { <END_BUG> return AuthorizationResult . PERMITTED ; } } return new AuthorizationResult ( Decision . DENY ) ; } }

Fix:
if ( callerRoles . contains ( role . getOfficialForm ( ) ) ) {
Buggy code:
public class ProcessPremise { public static Collection < SentenceFragment > forwardEntailments ( String input , StanfordCoreNLP pipeline ) { Annotation ann = new Annotation ( input ) ; pipeline . annotate ( ann ) ; List < SentenceFragment > entailments = new ArrayList < > ( ) ; for ( CoreMap sentence : ann . get ( SentencesAnnotation . class ) ) { entailments . addAll ( sentence . get ( EntailedSentencesAnnotation . class ) . stream ( ) . collect ( Collectors . toList ( ) ) ) ; } if ( entailments . isEmpty ( ) ) { <START_BUG> entailments . add ( new SentenceFragment ( ann . get ( SentencesAnnotation . class ) . get ( 0 ) . get ( CollapsedDependenciesAnnotation . class ) , false ) ) ; <END_BUG> } Iterator < SentenceFragment > iter = entailments . iterator ( ) ; while ( iter . hasNext ( ) ) { if ( iter . next ( ) . words . isEmpty ( ) ) { iter . remove ( ) ; } } return entailments ; } @ SuppressWarnings ( { "unchecked" , "UnusedDeclaration" } ) public static class QRewriteAnnotator extends SentenceAnnotator { public QRewriteAnnotator ( String name , Properties props ) { } @ Override protected void doOneSentence ( Annotation annotation , CoreMap sentence ) { } @ Override protected int nThreads ( ) { } @ Override protected long maxTime ( ) { } @ Override protected void doOneFailedSentence ( Annotation annotation , CoreMap sentence ) { } @ Override public Set < Requirement > requirementsSatisfied ( ) { } @ Override public Set < Requirement > requires ( ) { } } public static StanfordCoreNLP constructPipeline ( ) { } public static StanfordCoreNLP constructPipeline ( String parser ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
entailments . add ( new SentenceFragment ( ann . get ( SentencesAnnotation . class ) . get ( 0 ) . get ( CollapsedDependenciesAnnotation . class ) , true , false ) ) ;
Buggy code:
public class SystemMenuFastViewOrientation extends ContributionItem { private ViewPane viewPane ; private IntModel currentOrientation = new IntModel ( SWT . VERTICAL ) ; public SystemMenuFastViewOrientation ( ViewPane newViewPane ) { } public void dispose ( ) { } public void fill ( Menu menu , int index ) { WorkbenchWindow workbenchWindow = ( ( WorkbenchWindow ) ( viewPane . getPage ( ) . getWorkbenchWindow ( ) ) ) ; FastViewBar bar = workbenchWindow . getFastViewBar ( ) ; if ( ( bar != null ) && ( ( viewPane ) != null ) ) { currentOrientation . set ( bar . getOrientation ( viewPane . getViewReference ( ) ) ) ; <START_BUG> MenuItem orientationItem = new MenuItem ( menu , SWT . CASCADE ) ; <END_BUG> { orientationItem . setText ( WorkbenchMessages . getString ( "FastViewBar.view_orientation" ) ) ; Menu orientationSwtMenu = new Menu ( orientationItem ) ; RadioMenu orientationMenu = new RadioMenu ( orientationSwtMenu , currentOrientation ) ; orientationMenu . addMenuItem ( WorkbenchMessages . getString ( "FastViewBar.horizontal" ) , new Integer ( SWT . HORIZONTAL ) ) ; orientationMenu . addMenuItem ( WorkbenchMessages . getString ( "FastViewBar.vertical" ) , new Integer ( SWT . VERTICAL ) ) ; orientationItem . setMenu ( orientationSwtMenu ) ; } } } public boolean isDynamic ( ) { } }

Fix:
MenuItem orientationItem = new MenuItem ( menu , SWT . CASCADE , index ) ;
Buggy code:
@ SupportedOptions ( TranslationFileGenerator . GENERATED_FILES_PATH_OPTION ) final class TranslationFileGenerator extends AbstractGenerator { public static final String GENERATED_FILES_PATH_OPTION = "generatedTranslationFilesPath" ; public static final String GENERATED_FILE_EXTENSION = ".i18n_locale_COUNTRY_VARIANT.properties" ; private static final String FILE_SEPARATOR = System . getProperty ( "file.separator" ) ; private final String generatedFilesPath ; public TranslationFileGenerator ( final ProcessingEnvironment processingEnv ) { } @ Override public void processTypeElement ( final TypeElement annotation , final TypeElement element , final MessageInterface messageInterface ) { if ( ( generatedFilesPath ) != null ) { if ( element . getKind ( ) . isInterface ( ) ) { String packageName = elementUtils ( ) . getPackageOf ( element ) . getQualifiedName ( ) . toString ( ) ; <START_BUG> String relativePath = packageName . replaceAll ( "\\." , TranslationFileGenerator . FILE_SEPARATOR ) ; <END_BUG> String fileName = ( getPrimaryClassNamePrefix ( element ) ) + ( TranslationFileGenerator . GENERATED_FILE_EXTENSION ) ; this . generateSkeletalTranslationFile ( relativePath , fileName , messageInterface ) ; } } } void generateSkeletalTranslationFile ( final String relativePath , final String fileName , final MessageInterface messageInterface ) { } }

Fix:
String relativePath = packageName . replace ( '.' , File . separatorChar ) ;
Buggy code:
public abstract class DefaultRmicAdapter extends AbstractLogEnabled implements RmicAdapter { private static final Random rand = new Random ( ) ; private Rmic attributes ; private FileNameMapper mapper ; public DefaultRmicAdapter ( ) { } public void setRmic ( Rmic attributes ) { } public Path getClasspath ( ) throws TaskException { } public FileNameMapper getMapper ( ) { } public Rmic getRmic ( ) { } protected Commandline setupRmicCommand ( ) throws TaskException { } protected Commandline setupRmicCommand ( String [ ] options ) throws TaskException { } protected Path getCompileClasspath ( ) throws TaskException { <START_BUG> Path classpath = new Path ( attributes . getProject ( ) ) ; <END_BUG> classpath . setLocation ( attributes . getBase ( ) ) ; if ( ( attributes . getClasspath ( ) ) == null ) { if ( attributes . getIncludeantruntime ( ) ) { classpath . addExisting ( systemClasspath ) ; } } else { if ( attributes . getIncludeantruntime ( ) ) { classpath . addExisting ( attributes . getClasspath ( ) . concatSystemClasspath ( "last" ) ) ; } else { classpath . addExisting ( attributes . getClasspath ( ) . concatSystemClasspath ( "ignore" ) ) ; } } if ( attributes . getIncludejavaruntime ( ) ) { classpath . addJavaRuntime ( ) ; } return classpath ; } protected String getSkelClassSuffix ( ) { } protected String getStubClassSuffix ( ) { } protected String getTieClassSuffix ( ) { } protected void logAndAddFilesToCompile ( Commandline cmd ) { } private class RmicFileNameMapper implements FileNameMapper { RmicFileNameMapper ( ) { } public void setFrom ( String s ) { } public void setTo ( String s ) { } public String [ ] mapFileName ( String name ) { } } }

Fix:
Path classpath = new Path ( ) ;
Buggy code:
public class RepositoryActivity extends SingleFragmentActivity { private static final String TAG = "sm_TagRepostioryActivity" ; public static final String EXTRA_REPO = "ru.seriousmike.testgithubclient.RepositoryActivity.repo" ; public static final String EXTRA_OWNER = "ru.seriousmike.testgithubclient.RepositoryActivity.owner" ; public static final String EXTRA_RI_DESCR = "ru.seriousmike.testgithubclient.RepositoryActivity.repo_info.descr" ; public static final String EXTRA_RI_OWNER_NAME = "ru.seriousmike.testgithubclient.RepositoryActivity.repo_info.owner_name" ; public static final String EXTRA_RI_CREATED = "ru.seriousmike.testgithubclient.RepositoryActivity.repo_info.created_at" ; public static final String EXTRA_RI_PUSHED = "ru.seriousmike.testgithubclient.RepositoryActivity.repo_info.pushed_at" ; public static final String EXTRA_RI_ONWER_PIC = "ru.seriousmike.testgithubclient.RepositoryActivity.repo_info.avatar" ; @ Override protected Fragment createFragment ( ) { } @ Override public void clickedPositive ( int event_code ) { } @ Override public void clickedNegative ( int event_code ) { Log . i ( RepositoryActivity . TAG , "user<seq2seq4repair_space>denied<seq2seq4repair_space>repeat" ) ; <START_BUG> ( ( ru . seriousmike . testgithubclient . fragments . RepositoryFragment ) ( getFragmentManager ( ) . findFragmentById ( R . id . fragmentContainer ) ) ) . showRefreshFooter ( ) ; <END_BUG> ( ( ru . seriousmike . testgithubclient . fragments . RepositoryFragment ) ( getFragmentManager ( ) . findFragmentById ( R . id . fragmentContainer ) ) ) . showRefreshFooter ( ) ; } }

Fix:
( ( ru . seriousmike . testgithubclient . fragments . RepositoryFragment ) ( getFragmentManager ( ) . findFragmentById ( R . id . fragmentContainer ) ) ) . cancelRefreshing ( ) ;
Buggy code:
public class Subpart implements Comparable < Subpart > { private long iId = - 1 ; private String iInstructionalType = null ; private String iName = null ; private List < Section > iSections = new ArrayList < Section > ( ) ; private Config iConfig = null ; private Subpart iParent = null ; private boolean iAllowOverlap = false ; public Subpart ( long id , String itype , String name , Config config , Subpart parent ) { } public long getId ( ) { } public String getInstructionalType ( ) { } public String getName ( ) { } public Config getConfig ( ) { } public List < Section > getSections ( ) { } public Subpart getParent ( ) { } @ Override public String toString ( ) { } public boolean isParentOf ( Subpart subpart ) { } public int compareTo ( Subpart s ) { } public Set < Choice > getChoices ( ) { } public double getMinPenalty ( ) { } public double getMaxPenalty ( ) { } public List < Subpart > getChildren ( ) { } public boolean isAllowOverlap ( ) { } public void setAllowOverlap ( boolean allowOverlap ) { } public List < Reservation > getSectionReservations ( ) { } private List < Reservation > iSectionReservations = null ; public void clearReservationCache ( ) { } <START_BUG> public Integer getLimit ( ) { <END_BUG> if ( ( iLimit ) == null ) iLimit = getLimitNoCache ( ) ; return iLimit ; } private int getLimitNoCache ( ) { } private Integer iLimit = null ; }

Fix:
public int getLimit ( ) {
Buggy code:
public class KeyBindingService implements IKeyBindingService { private IPartListener partListener ; private ShellListener shellListener ; private HashMap defIdToAction = new HashMap ( ) ; private HashMap allDefIdToAction = new HashMap ( ) ; private String [ ] scopeIds = new String [ ] { IWorkbenchConstants . DEFAULT_ACCELERATOR_SCOPE_ID } ; private WWinKeyBindingService parent ; private long parentUpdateNumber ; public KeyBindingService ( WWinKeyBindingService service , PartSite site ) { } public void registerExtendedActions ( ActionDescriptor [ ] actionDescriptors ) { } public String [ ] getScopeIds ( ) { } public void setScopeIds ( String [ ] scopeIds ) throws IllegalArgumentException { } public void registerAction ( IAction action ) { } public void unregisterAction ( IAction action ) { } private void initializeMapping ( ) { } public void dispose ( ) { } public IAction getAction ( String definitionId ) { } public String getActiveAcceleratorConfigurationId ( ) { <START_BUG> return ( ( Workbench ) ( PlatformUI . getWorkbench ( ) ) ) . getActiveAcceleratorConfiguration ( ) . getId ( ) ; <END_BUG> } public String getActiveAcceleratorScopeId ( ) { } public void setActiveAcceleratorScopeId ( String scopeId ) throws IllegalArgumentException { } public boolean processKey ( KeyEvent event ) { } public void enable ( boolean enable ) { } }

Fix:
return ( ( Workbench ) ( PlatformUI . getWorkbench ( ) ) ) . getActiveAcceleratorConfiguration ( ) . getLabel ( ) . getId ( ) ;
Buggy code:
public class DOMElementWriter { private static String lSep = System . getProperty ( "line.separator" ) ; private StringBuffer sb = new StringBuffer ( ) ; protected String [ ] knownEntities = new String [ ] { "gt" , "amp" , "lt" , "apos" , "quot" } ; public void write ( Element element , Writer out , int indent , String indentWith ) throws IOException { for ( int i = 0 ; i < indent ; i ++ ) { out . write ( indentWith ) ; } out . write ( "<" ) ; out . write ( element . getTagName ( ) ) ; NamedNodeMap attrs = element . getAttributes ( ) ; for ( int i = 0 ; i < ( attrs . getLength ( ) ) ; i ++ ) { Attr attr = ( ( Attr ) ( attrs . item ( i ) ) ) ; out . write ( "<seq2seq4repair_space>" ) ; out . write ( attr . getName ( ) ) ; out . write ( "=\"" ) ; out . write ( encode ( attr . getValue ( ) ) ) ; out . write ( "\"" ) ; } out . write ( ">" ) ; boolean hasChildren = false ; NodeList children = element . getChildNodes ( ) ; for ( int i = 0 ; i < ( children . getLength ( ) ) ; i ++ ) { Node child = children . item ( i ) ; if ( ( child . getNodeType ( ) ) == ( Node . ELEMENT_NODE ) ) { if ( ! hasChildren ) { out . write ( DOMElementWriter . lSep ) ; hasChildren = true ; } write ( ( ( Element ) ( child ) ) , out , ( indent + 1 ) , indentWith ) ; } if ( ( child . getNodeType ( ) ) == ( Node . TEXT_NODE ) ) { out . write ( "<![CDATA[" ) ; out . write ( ( ( Text ) ( child ) ) . getData ( ) ) ; out . write ( "]]>" ) ; } } if ( hasChildren ) { for ( int i = 0 ; i < indent ; i ++ ) { <START_BUG> out . write ( "<seq2seq4repair_space>" ) ; <END_BUG> } } out . write ( "<//" ) ; out . write ( element . getTagName ( ) ) ; out . write ( ">" ) ; out . write ( DOMElementWriter . lSep ) ; } public String encode ( String value ) { } public boolean isReference ( String ent ) { } }

Fix:
out . write ( indentWith ) ;
Buggy code:
public class AlgoPerimeterPoly extends AlgoElement { private GeoPolygon polygon ; private GeoNumeric circum ; public AlgoPerimeterPoly ( Construction cons , String label , GeoPolygon polygon ) { } AlgoPerimeterPoly ( Construction cons , GeoPolygon polygon ) { } @ Override public Algos getClassName ( ) { } @ Override protected void setInputOutput ( ) { } @ Override public final void compute ( ) { if ( ! ( polygon . isDefined ( ) ) ) { circum . setUndefined ( ) ; return ; } GeoSegmentND [ ] segment = polygon . getSegments ( ) ; double length = 0 ; <START_BUG> for ( int i = 0 ; i < ( segment . length ) ; i ++ ) { <END_BUG> length = length + ( segment [ i ] . getLength ( ) ) ; } circum . setValue ( length ) ; } public GeoNumeric getCircumference ( ) { } }

Fix:
for ( int i = 0 ; i < ( polygon . getPointsLength ( ) ) ; i ++ ) {
Buggy code:
public class AttributeModifier implements Serializable { private final boolean addAttributeIfNotPresent ; private final String attribute ; private boolean enabled ; private final String pattern ; private final IModel replaceModel ; public AttributeModifier ( final String attribute , final boolean addAttributeIfNotPresent , final IModel replaceModel ) { } public AttributeModifier ( final String attribute , final IModel replaceModel ) { } public AttributeModifier ( final String attribute , final String pattern , final boolean addAttributeIfNotPresent , final IModel replaceModel ) { } public AttributeModifier ( final String attribute , final String pattern , final IModel replaceModel ) { } public final boolean isEnabled ( ) { } public final void setEnabled ( final boolean enabled ) { } final void detachModel ( ) { } final boolean getAddAttributeIfNotPresent ( ) { } final String getAttribute ( ) { } final String getPattern ( ) { } final IModel getReplaceModel ( ) { } void replaceAttibuteValue ( final ComponentTag tag ) { if ( enabled ) { final ValueMap attributes = tag . getAttributes ( ) ; <START_BUG> final Object replacementValue = getReplaceModel ( ) . getObject ( ) ; <END_BUG> if ( replacementValue != null ) { if ( attributes . containsKey ( attribute ) ) { final String value = attributes . get ( attribute ) . toString ( ) ; if ( ( ( pattern ) == null ) || ( value . matches ( pattern ) ) ) { attributes . put ( attribute , replacementValue ) ; } } else if ( addAttributeIfNotPresent ) { attributes . put ( attribute , replacementValue ) ; } } } } }

Fix:
final Object replacementValue = getReplaceModel ( ) . getObject ( null ) ;
Buggy code:
abstract class XSDAbstractTraverser { protected XSDHandler fSchemaHandler = null ; protected SymbolTable fSymbolTable = null ; protected XSAttributeChecker fAttrChecker = null ; protected XMLErrorReporter fErrorReporter = null ; XSDAbstractTraverser ( XSDHandler handler , XMLErrorReporter errorReporter , XSAttributeChecker attrChecker ) { } void reset ( ) { } void setSymbolTable ( SymbolTable table ) { } int traverseAnnotationDecl ( Element annotationDecl , Hashtable parentAttrs ) { Hashtable attrValues = fAttrChecker . checkAttributes ( annotationDecl , true ) ; for ( Element child = DOMUtil . getFirstChildElement ( annotationDecl ) ; child != null ; child = DOMUtil . getNextSiblingElement ( child ) ) { String name = child . getLocalName ( ) ; if ( ! ( ( name . equals ( ELT_APPINFO ) ) || ( name . equals ( ELT_DOCUMENTATION ) ) ) ) { <START_BUG> reportSchemaError ( "an<seq2seq4repair_space><annotation><seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space><appinfo><seq2seq4repair_space>and<seq2seq4repair_space><documentation><seq2seq4repair_space>elements" , null ) ; <END_BUG> } attrValues = fAttrChecker . checkAttributes ( child , true ) ; } return - 1 ; } void reportGenericSchemaError ( String error ) { } Element checkContent ( Element elm , Element content , boolean isEmpty ) { } int parseFinalSet ( String finalString ) { } }

Fix:
reportGenericSchemaError ( "an<seq2seq4repair_space><annotation><seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space><appinfo><seq2seq4repair_space>and<seq2seq4repair_space><documentation><seq2seq4repair_space>elements" ) ;
Buggy code:
public class BasicServer { private static String basicObjectName = "basicname" ; private static String basicMultiObjectName = "basicmultiname" ; private static String basicObjectRefName = "basicrefname" ; private static Context ic = null ; private static BasicObjectItf ba = null ; private static BasicMultiObjectItf bma = null ; private static BasicObjectRef bref = null ; public static void main ( String [ ] args ) { } public static void start ( ) { try { <START_BUG> CarolConfiguration . initCarol ( ) ; <END_BUG> BasicServer . ba = new BasicObject ( ) ; BasicServer . bma = new BasicMultiObject ( ) ; BasicServer . bref = new BasicObjectRef ( "string" ) ; BasicServer . ic = new InitialContext ( ) ; BasicServer . ic . rebind ( BasicServer . basicObjectName , BasicServer . ba ) ; BasicServer . ic . rebind ( BasicServer . basicMultiObjectName , BasicServer . bma ) ; BasicServer . ic . rebind ( BasicServer . basicObjectRefName , BasicServer . bref ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . err . println ( ( "Server<seq2seq4repair_space>can't<seq2seq4repair_space>start<seq2seq4repair_space>:" + e ) ) ; } } public static void stop ( ) { } }

Fix:
CarolConfiguration . init ( ) ;
Buggy code:
public class ConsoleHandlerAdd extends AbstractHandlerAdd { private static final long serialVersionUID = - 4769503787024853339L ; private Target target = Target . SYSTEM_OUT ; public ConsoleHandlerAdd ( final String name ) { } public Target getTarget ( ) { } public void setTarget ( final Target target ) { } protected AbstractHandlerElement < ? > createElement ( final String name ) { } protected < P > void applyUpdate ( final UpdateContext updateContext , final UpdateResultHandler < ? super Void , P > handler , final P param ) { try { <START_BUG> final BatchBuilder builder = updateContext . getBatchBuilder ( ) ; <END_BUG> final ConsoleHandlerService service = new ConsoleHandlerService ( ) ; final ServiceBuilder < Handler > serviceBuilder = builder . addService ( LogServices . handlerName ( getName ( ) ) , service ) ; service . setLevel ( Level . parse ( getLevelName ( ) ) ) ; final Boolean autoFlush = getAutoflush ( ) ; if ( autoFlush != null ) service . setAutoflush ( autoFlush . booleanValue ( ) ) ; try { service . setEncoding ( getEncoding ( ) ) ; } catch ( UnsupportedEncodingException e ) { handler . handleFailure ( e , param ) ; return ; } service . setFormatterSpec ( getFormatter ( ) ) ; serviceBuilder . setInitialMode ( ACTIVE ) ; serviceBuilder . addListener ( new UpdateResultHandler . ServiceStartListener < P > ( handler , param ) ) ; serviceBuilder . install ( ) ; } catch ( Throwable t ) { handler . handleFailure ( t , param ) ; return ; } } }

Fix:
final BatchBuilder builder = updateContext . getServiceTarget ( ) ;
Buggy code:
public class DriverDependenciesProcessor implements DeploymentUnitProcessor { private static final String SERVICE_FILE_NAME = "META-INF//services//java.sql.Driver" ; private static final ModuleIdentifier JTA = ModuleIdentifier . create ( "javax.transaction.api" ) ; @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; if ( deploymentUnit . hasAttachment ( RESOURCE_ROOTS ) ) { final List < ResourceRoot > resourceRoots = deploymentUnit . getAttachmentList ( RESOURCE_ROOTS ) ; for ( ResourceRoot root : resourceRoots ) { VirtualFile child = root . getRoot ( ) . getChild ( DriverDependenciesProcessor . SERVICE_FILE_NAME ) ; if ( child . exists ( ) ) { <START_BUG> moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , DriverDependenciesProcessor . JTA , false , false , false ) ) ; <END_BUG> break ; } } } } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
moduleSpecification . addSystemDependency ( new ModuleDependency ( moduleLoader , DriverDependenciesProcessor . JTA , false , false , false , false ) ) ;
Buggy code:
public class BeanShell { public static void evalSelection ( View view , JEditTextArea textArea ) { } public static void showEvaluateDialog ( View view ) { } public static void showEvaluateLinesDialog ( View view ) { String command = GUIUtilities . input ( view , "beanshell-eval-line" , null ) ; if ( command != null ) { if ( ! ( command . endsWith ( ";" ) ) ) command = command + ";" ; if ( ( view . getMacroRecorder ( ) ) != null ) view . getMacroRecorder ( ) . record ( 1 , command ) ; JEditTextArea textArea = view . getTextArea ( ) ; Buffer buffer = view . getBuffer ( ) ; try { buffer . beginCompoundEdit ( ) ; Selection [ ] selection = textArea . getSelection ( ) ; for ( int i = 0 ; i < ( selection . length ) ; i ++ ) { Selection s = selection [ i ] ; for ( int j = s . getStartLine ( ) ; j <= ( s . getEndLine ( ) ) ; j ++ ) { BeanShell . global . setVariable ( "line" , new Integer ( j ) ) ; <START_BUG> BeanShell . global . setVariable ( "index" , new Integer ( ( ( j - ( s . getStartLine ( ) ) ) + 1 ) ) ) ; <END_BUG> int start = s . getStart ( buffer , j ) ; int end = s . getEnd ( buffer , j ) ; String text = buffer . getText ( start , ( end - start ) ) ; BeanShell . global . setVariable ( "text" , text ) ; Object returnValue = BeanShell . eval ( view , command , true ) ; if ( returnValue != null ) { buffer . remove ( start , ( end - start ) ) ; buffer . insertString ( start , returnValue . toString ( ) , null ) ; } } } } catch ( BadLocationException bl ) { Log . log ( ERROR , BeanShell . class , bl ) ; } catch ( Throwable e ) { } finally { buffer . endCompoundEdit ( ) ; } textArea . selectNone ( ) ; } } public static void showRunScriptDialog ( View view ) { } public static void runScript ( View view , String path , boolean ownNamespace , boolean rethrowBshErrors ) { } public static void runScript ( View view , String path , Reader in , boolean ownNamespace , boolean rethrowBshErrors ) { } public static Object eval ( View view , String command , boolean rethrowBshErrors ) { } public static Object eval ( View view , NameSpace namespace , String command , boolean rethrowBshErrors ) { } public static String cacheBlock ( String id , String code , boolean childNamespace ) { } public static Object runCachedBlock ( String id , View view , NameSpace namespace ) { } public static boolean isScriptRunning ( ) { } public static NameSpace getNameSpace ( ) { } static void init ( ) { } private static Interpreter interpForMethods ; private static NameSpace global ; private static NameSpace internal ; private static boolean running ; private static int cachedBlockCounter ; private static Interpreter createInterpreter ( NameSpace nameSpace ) { } }

Fix:
BeanShell . global . setVariable ( "index" , new Integer ( ( j - ( s . getStartLine ( ) ) ) ) ) ;
Buggy code:
public class MissingConfigCalculationFunction implements CalculationSingleFunction < CalculationTarget , Void > { @ Override public FunctionRequirements requirements ( CalculationTarget target ) { } @ Override public Void execute ( CalculationTarget target , CalculationMarketData marketData ) { <START_BUG> throw new IllegalStateException ( Messages . format ( "No<seq2seq4repair_space>rule<seq2seq4repair_space>configured<seq2seq4repair_space>for<seq2seq4repair_space>measure<seq2seq4repair_space>on<seq2seq4repair_space>''" , target . getClass ( ) . getSimpleName ( ) ) ) ; <END_BUG> } }

Fix:
throw new IllegalStateException ( Messages . format ( "No<seq2seq4repair_space>rule<seq2seq4repair_space>configured<seq2seq4repair_space>for<seq2seq4repair_space>measure<seq2seq4repair_space>on<seq2seq4repair_space>'{}'" , target . getClass ( ) . getSimpleName ( ) ) ) ;