nus-yam/ex-repair huggingface dataset:
Buggy code:
public class WebRequestCycle extends RequestCycle { private static final Log log = LogFactory . getLog ( WebRequestCycle . class ) ; public static final String resourceReferencePrefix = "//resources//" ; public WebRequestCycle ( final WebSession session , final WebRequest request , final Response response ) { } public WebRequest getWebRequest ( ) { } public WebResponse getWebResponse ( ) { } protected final boolean parseRequest ( ) { } protected void redirectTo ( final Page page ) { } final void setFormComponentValuesFromCookies ( final Page page ) { } private boolean bookmarkablePage ( ) { } private boolean callComponentListener ( ) { } private boolean homePage ( ) { } private void invokeInterface ( final Component component , final String interfaceName ) { } private void invokeInterface ( final Page page , final String path , final String interfaceName ) { } private final Page newPage ( final Class pageClass ) { } private void onExpiredPage ( ) { } private boolean renderStaticContent ( ) { } private boolean resourceReference ( ) { final String pathInfo = getWebRequest ( ) . getPathInfo ( ) ; if ( pathInfo . startsWith ( WebRequestCycle . resourceReferencePrefix ) ) { final String resourceReferenceKey = pathInfo . substring ( WebRequestCycle . resourceReferencePrefix . length ( ) ) ; <START_BUG> final Resource resource = getApplication ( ) . getResource ( resourceReferenceKey ) ; <END_BUG> if ( resource == null ) { throw new WicketRuntimeException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>resource<seq2seq4repair_space>referenced<seq2seq4repair_space>by<seq2seq4repair_space>key<seq2seq4repair_space>" + resourceReferenceKey ) ) ; } else { resource . onResourceRequested ( ) ; } return true ; } return false ; } }

Fix:
final Resource resource = getApplication ( ) . getSharedResources ( ) . get ( resourceReferenceKey ) ;
Buggy code:
public abstract class AbstractEJBComponentRuntimeHandler < T extends EJBComponent > extends AbstractRuntimeOnlyHandler { private final Map < PathAddress , ComponentConfiguration > componentConfigs = Collections . synchronizedMap ( new HashMap < PathAddress , ComponentConfiguration > ( ) ) ; private final Class < T > componentClass ; private final EJBComponentType componentType ; protected AbstractEJBComponentRuntimeHandler ( final EJBComponentType componentType , final Class < T > componentClass ) { } @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } public void registerComponent ( final PathAddress address , final ComponentConfiguration configuration ) { } public void unregisterComponent ( final PathAddress address ) { } protected void executeReadAttribute ( String attributeName , OperationContext context , T component , ComponentConfiguration config , PathAddress address ) { } protected void executeWriteAttribute ( String attributeName , OperationContext context , ModelNode operation , T component , ComponentConfiguration config , PathAddress address ) throws OperationFailedException { if ( ( componentType . hasPool ( ) ) && ( AbstractEJBComponentResourceDefinition . POOL_MAX_SIZE . getName ( ) . equals ( attributeName ) ) ) { <START_BUG> int newSize = AbstractEJBComponentResourceDefinition . POOL_MAX_SIZE . validateResolvedOperation ( operation ) . asInt ( ) ; <END_BUG> Pool < ? > pool = componentType . getPool ( component ) ; int oldSize = pool . getMaxSize ( ) ; componentType . getPool ( component ) . setMaxSize ( newSize ) ; if ( ( context . completeStep ( ) ) != ( ResultAction . KEEP ) ) { pool . setMaxSize ( oldSize ) ; } } else { throw new IllegalStateException ( String . format ( "Unknown<seq2seq4repair_space>attribute<seq2seq4repair_space>%s" , attributeName ) ) ; } } protected void executeAgainstComponent ( OperationContext context , ModelNode operation , T component , ComponentConfiguration componentConfiguration , String opName , PathAddress address ) throws OperationFailedException { } protected boolean isOperationReadOnly ( String opName ) { } private static IllegalStateException unknownOperation ( String opName ) { } private boolean isForWrite ( String opName ) { } private ComponentConfiguration getComponentConfiguration ( final PathAddress operationAddress ) throws OperationFailedException { } private T getComponent ( final ComponentConfiguration config , final PathAddress operationAddress , final OperationContext context , final boolean forWrite ) throws OperationFailedException { } }

Fix:
int newSize = AbstractEJBComponentResourceDefinition . POOL_MAX_SIZE . resolveModelAttribute ( context , operation ) . asInt ( ) ;
Buggy code:
public class FileDataSource extends DataSource < Reader > { public static final String BASE_PATH = "basePath" ; protected String basePath ; protected String encoding = null ; private static final Logger LOG = LoggerFactory . getLogger ( FileDataSource . class ) ; @ Override public void init ( Context context , Properties initProps ) { } @ Override public Reader getData ( String query ) { } static File getFile ( String basePath , String query ) { } protected Reader openStream ( File file ) throws FileNotFoundException , UnsupportedEncodingException { if ( ( encoding ) == null ) { <START_BUG> return new InputStreamReader ( new FileInputStream ( file ) ) ; <END_BUG> } else { return new InputStreamReader ( new FileInputStream ( file ) , encoding ) ; } } @ Override public void close ( ) { } }

Fix:
return new InputStreamReader ( new FileInputStream ( file ) , "UTF-8" ) ;
Buggy code:
public class ActivityNewBusiness_Step2 extends Activity implements WebserviceResponse { private String TAG = "ActivityNewBusiness_Step2" ; private EditTextFont edtPhone ; private EditTextFont edtWebsite ; private EditTextFont edtEmail ; private EditTextFont edtMobile ; WorkTime workTime ; Location_M locationM ; boolean isEditing = false ; private WebserviceResponse webserviceResponse ; private Context context ; private boolean closed = false ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void submit ( View view ) { } public void help ( View view ) { } public void setAnimations ( ) { } public void onBackPressed ( ) { } public void back ( View v ) { } public void setWorkTime ( View v ) { } void updateViews ( ) { } private String two_char ( int x ) { } public void setLocation ( View v ) { } public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } void putDataInPassingBusiness ( ) { } @ Override public void getResult ( Object result ) { } @ Override public void getError ( Integer errorCode ) { try { String errorMessage = ServerAnswer . getError ( getApplicationContext ( ) , errorCode ) ; <START_BUG> Dialogs . showMessage ( context , errorMessage ) ; <END_BUG> } catch ( Exception e ) { Log . e ( TAG , CLOSED_BEFORE_RESPONSE ) ; } } }

Fix:
Dialogs . showMessage ( this , errorMessage ) ;
Buggy code:
public class DeviceSocket extends Socket { java . net . Socket socket = null ; public DeviceSocket ( String hostName , int port ) { } @ Override public String getLatestSmsContainingSubstring ( String substring ) { } @ Override public void connectUnderlyingSocketMediumTryOnce ( ) { try { if ( ( DeviceConstants . SSL_SOCKET ) == true ) { SocketFactory socketFactory = SSLSocketFactory . getDefault ( ) ; socket = socketFactory . createSocket ( host , port ) ; } else { socket = new java . net . Socket ( host , port ) ; } socket . setSoTimeout ( ( ( InstaMsg . SOCKET_READ_TIMEOUT_SECS ) * 1000 ) ) ; } catch ( Exception e ) { Log . errorLog ( ( ( ( ( ( ( SOCKET_ERROR ) + "Error<seq2seq4repair_space>occurred<seq2seq4repair_space>while<seq2seq4repair_space>connecting<seq2seq4repair_space>to<seq2seq4repair_space>[" ) + ( host ) ) + "]<seq2seq4repair_space>on<seq2seq4repair_space>port<seq2seq4repair_space>[" ) + ( port ) ) + "]" ) ) ; return ; } socketCorrupted = false ; <START_BUG> Log . infoLog ( ( ( ( ( "TCP-SOCKET<seq2seq4repair_space>UNDERLYING_MEDIUM<seq2seq4repair_space>INITIATED<seq2seq4repair_space>FOR<seq2seq4repair_space>HOST<seq2seq4repair_space>=<seq2seq4repair_space>[" + ( InstaMsg . INSTAMSG_HOST ) ) + "],<seq2seq4repair_space>PORT<seq2seq4repair_space>=<seq2seq4repair_space>[" ) + ( InstaMsg . INSTAMSG_PORT ) ) + "]." ) ) ; <END_BUG> } @ Override public ReturnCode socketRead ( byte [ ] buffer , int len , boolean guaranteed ) { } @ Override public ReturnCode socketWrite ( byte [ ] buffer , int len ) { } @ Override public void releaseUnderlyingSocketMediumGuaranteed ( ) { } }

Fix:
Log . infoLog ( ( ( ( ( "TCP-SOCKET<seq2seq4repair_space>UNDERLYING_MEDIUM<seq2seq4repair_space>INITIATED<seq2seq4repair_space>FOR<seq2seq4repair_space>HOST<seq2seq4repair_space>=<seq2seq4repair_space>[" + ( DeviceConstants . INSTAMSG_HOST ) ) + "],<seq2seq4repair_space>PORT<seq2seq4repair_space>=<seq2seq4repair_space>[" ) + ( InstaMsg . INSTAMSG_PORT ) ) + "]." ) ) ;
Buggy code:
public class CompressedStreamWriter extends StreamWriter { public static final int CHUNK_SIZE = ( 10 * 1024 ) * 1024 ; private final CompressionInfo compressionInfo ; public CompressedStreamWriter ( SSTableReader sstable , Collection < Pair < Long , Long > > sections , CompressionInfo compressionInfo , StreamSession session ) { } @ Override public void write ( DataOutputStreamAndChannelPlus out ) throws IOException { long totalSize = totalSize ( ) ; RandomAccessReader file = sstable . openDataReader ( ) ; <START_BUG> FileChannel fc = file . getChannel ( ) ; <END_BUG> long progress = 0L ; List < Pair < Long , Long > > sections = getTransferSections ( compressionInfo . chunks ) ; try { for ( final Pair < Long , Long > section : sections ) { long length = ( section . right ) - ( section . left ) ; long bytesTransferred = 0 ; while ( bytesTransferred < length ) { final long bytesTransferredFinal = bytesTransferred ; final int toTransfer = ( ( int ) ( Math . min ( CompressedStreamWriter . CHUNK_SIZE , ( length - bytesTransferred ) ) ) ) ; limiter . acquire ( toTransfer ) ; long lastWrite = ( ( Long ) ( out . applyToChannel ( new WBCFunction ( ) { public Object apply ( WritableByteChannel wbc ) throws IOException { return fc . transferTo ( ( ( section . left ) + bytesTransferredFinal ) , toTransfer , wbc ) ; } } ) ) ) ; bytesTransferred += lastWrite ; progress += lastWrite ; session . progress ( descriptor , OUT , progress , totalSize ) ; } } } finally { FileUtils . closeQuietly ( file ) ; } } @ Override protected long totalSize ( ) { } private List < Pair < Long , Long > > getTransferSections ( CompressionMetadata [ ] chunks ) { } }

Fix:
final FileChannel fc = file . getChannel ( ) ;
Buggy code:
public class ReportGui extends AbstractReportGui { private static final long serialVersionUID = 240L ; private JTextField commentPanel ; private final DirectoryPanel baseDir = new DirectoryPanel ( JMeterUtils . getResString ( "report_base_directory" ) , Color . white ) ; private ArgumentsPanel argsPanel ; public ReportGui ( ) { } @ Override public JPopupMenu createPopupMenu ( ) { JPopupMenu pop = new JPopupMenu ( ) ; <START_BUG> JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "Add" ) ) ; <END_BUG> addMenu . add ( ReportMenuFactory . makeMenuItem ( new ReportPageGui ( ) . getStaticLabel ( ) , ReportPageGui . class . getName ( ) , "Add" ) ) ; addMenu . add ( ReportMenuFactory . makeMenuItem ( new HTMLReportWriterGui ( ) . getStaticLabel ( ) , HTMLReportWriterGui . class . getName ( ) , "Add" ) ) ; addMenu . add ( ReportMenuFactory . makeMenu ( CONFIG_ELEMENTS , "Add" ) ) ; pop . add ( addMenu ) ; ReportMenuFactory . addFileMenu ( pop ) ; ReportMenuFactory . addEditMenu ( pop , true ) ; return pop ; } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement plan ) { } @ Override public String getLabelResource ( ) { } @ Override public Collection < String > getMenuCategories ( ) { } @ Override public void configure ( TestElement el ) { } private JPanel createVariablePanel ( ) { } private Container createCommentPanel ( ) { } private void init ( ) { } }

Fix:
JMenu addMenu = new JMenu ( JMeterUtils . getResString ( "add" ) ) ;
Buggy code:
public class XSElementDecl { public static final short NO_CONSTRAINT = 0 ; public static final short DEFAULT_VALUE = 1 ; public static final short FIXED_VALUE = 2 ; public String fName = null ; public String fTargetNamespace = null ; public XSTypeDecl fType = null ; short fMiscFlags = 0 ; public short fBlock = SchemaSymbols . EMPTY_SET ; public short fFinal = SchemaSymbols . EMPTY_SET ; public Object fDefault = null ; public XSElementDecl fSubGroup = null ; static final int INITIAL_SIZE = 2 ; int fIDCPos = 0 ; IdentityConstraint [ ] fIDConstraints = new IdentityConstraint [ XSElementDecl . INITIAL_SIZE ] ; private static final short CONSTRAINT_MASK = 3 ; private static final short NILLABLE = 4 ; private static final short ABSTRACT = 8 ; public short getConstraintType ( ) { } public boolean isNillable ( ) { } public boolean isAbstract ( ) { } public void setConstraintType ( short constraintType ) { } public void setIsNillable ( ) { } public void setIsAbstract ( ) { } public void addIDConstaint ( IdentityConstraint idc ) { } public IdentityConstraint [ ] getIDConstraints ( ) { } static final IdentityConstraint [ ] resize ( IdentityConstraint [ ] oldArray , int newSize ) { } public String toString ( ) { <START_BUG> return ( ( fTargetNamespace ) + ":" ) + ( fName ) ; <END_BUG> } }

Fix:
return ( ( fTargetNamespace ) + "," ) + ( fName ) ;
Buggy code:
@ RunWith ( MockitoJUnitRunner . class ) public class RubyLocatorTest { @ Mock FileSystemHelper fileSystemHelper ; RubyLocator rubyLocator ; @ Before public void setUp ( ) throws Exception { } @ Test public void testBuildEnv ( ) throws Exception { final RubyRuntime mriRuby = RvmFixtures . getMRIRubyRuntimeDefaultGemSet ( ) ; when ( fileSystemHelper . pathExists ( mriRuby . getRubyExecutablePath ( ) ) ) . thenReturn ( true ) ; when ( fileSystemHelper . pathExists ( mriRuby . getGemPath ( ) ) ) . thenReturn ( true ) ; Map < String , String > currentEnvVars = Maps . newHashMap ( ) ; currentEnvVars . put ( "PATH" , TEST_CURRENT_PATH ) ; Map < String , String > envVars = rubyLocator . buildEnv ( "ruby-1.9.3-p0@default" , currentEnvVars ) ; assertTrue ( envVars . containsKey ( MY_RUBY_HOME ) ) ; assertTrue ( envVars . containsKey ( GEM_HOME ) ) ; assertTrue ( envVars . containsKey ( GEM_PATH ) ) ; assertTrue ( envVars . containsKey ( BUNDLE_HOME ) ) ; assertTrue ( envVars . containsKey ( RVM_RUBY_STRING ) ) ; assertTrue ( envVars . containsKey ( RVM_GEM_SET ) ) ; assertTrue ( envVars . containsKey ( PATH ) ) ; <START_BUG> assertEquals ( RvmFixtures . getMRIRubyRuntimeDefaultGemSetPath ( ) , envVars . get ( "PATH" ) ) ; <END_BUG> } @ Test public void testGetRubyHome ( ) throws Exception { } @ Test public void testGetGemBinPath ( ) throws Exception { } @ Test public void testGetRubyRuntime ( ) throws Exception { } @ Test public void testListRubyRuntimes ( ) throws Exception { } @ Test public void testSearchForRubyExecutable ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testSearchForRubyExecutableWhenNotFound ( ) { } @ Test public void testHasRuby ( ) throws Exception { } }

Fix:
assertEquals ( RvmFixtures . getMRIRubyRuntimeDefaultBinPath ( ) , envVars . get ( "PATH" ) ) ;
Buggy code:
public class LoginFilter implements Filter { @ Override public void destroy ( ) { } @ Override public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { <START_BUG> UserBean userBean = ( ( UserBean ) ( ( ( javax . servlet . http . HttpServletRequest ) ( request ) ) . getSession ( ) . getAttribute ( "loginBean" ) ) ) ; <END_BUG> if ( ( userBean == null ) || ( ! ( userBean . isLoggedIn ( ) ) ) ) { String contextPath = ( ( javax . servlet . http . HttpServletRequest ) ( request ) ) . getContextPath ( ) ; ( ( javax . servlet . http . HttpServletResponse ) ( response ) ) . sendRedirect ( ( contextPath + "//login.xhtml" ) ) ; } chain . doFilter ( request , response ) ; } @ Override public void init ( FilterConfig arg0 ) throws ServletException { } }

Fix:
UserBean userBean = ( ( UserBean ) ( ( ( javax . servlet . http . HttpServletRequest ) ( request ) ) . getSession ( ) . getAttribute ( "userBean" ) ) ) ;
Buggy code:
public abstract class RelationToManyTableFieldStrategy extends StoreCollectionFieldStrategy { private static final Localizer _loc = Localizer . forPackage ( RelationToManyTableFieldStrategy . class ) ; protected ClassMapping [ ] getIndependentElementMappings ( boolean traverse ) { } protected ForeignKey getJoinForeignKey ( ClassMapping elem ) { } protected void selectElement ( Select sel , ClassMapping elem , JDBCStore store , JDBCFetchConfiguration fetch , int eagerMode , Joins joins ) { } protected Object loadElement ( OpenJPAStateManager sm , JDBCStore store , JDBCFetchConfiguration fetch , Result res , Joins joins ) throws SQLException { } protected Joins join ( Joins joins , ClassMapping elem ) { } protected Joins joinElementRelation ( Joins joins , ClassMapping elem ) { } public void map ( boolean adapt ) { } public void insert ( OpenJPAStateManager sm , JDBCStore store , RowManager rm ) throws SQLException { } private void insert ( OpenJPAStateManager sm , RowManager rm , Object vals ) throws SQLException { Collection coll = toCollection ( vals ) ; if ( ( coll == null ) || ( coll . isEmpty ( ) ) ) return ; Row row = rm . getSecondaryRow ( field . getTable ( ) , ACTION_INSERT ) ; row . setForeignKey ( field . getJoinForeignKey ( ) , field . getJoinColumnIO ( ) , sm ) ; ValueMapping elem = field . getElementMapping ( ) ; StoreContext ctx = sm . getContext ( ) ; Column order = field . getOrderColumn ( ) ; boolean setOrder = field . getOrderColumnIO ( ) . isInsertable ( order , false ) ; <START_BUG> int idx = 0 ; <END_BUG> OpenJPAStateManager esm ; for ( Iterator itr = coll . iterator ( ) ; itr . hasNext ( ) ; idx ++ ) { esm = RelationStrategies . getStateManager ( itr . next ( ) , ctx ) ; elem . setForeignKey ( row , esm ) ; if ( setOrder ) row . setInt ( order , idx ) ; rm . flushSecondaryRow ( row ) ; } } public void update ( OpenJPAStateManager sm , JDBCStore store , RowManager rm ) throws SQLException { } public void delete ( OpenJPAStateManager sm , JDBCStore store , RowManager rm ) throws SQLException { } public Object toDataStoreValue ( Object val , JDBCStore store ) { } public Joins join ( Joins joins , boolean forceOuter ) { } public Joins joinRelation ( Joins joins , boolean forceOuter , boolean traverse ) { } }

Fix:
int idx = ( setOrder && ( order != null ) ) ? order . getBase ( ) : 0 ;
Buggy code:
public class ExternalLink extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private final IModel href ; private final IModel label ; private PopupSettings popupSettings = null ; public ExternalLink ( MarkupContainer parent , final String id , final String href , final String label ) { } public ExternalLink ( MarkupContainer parent , final String id , final String href ) { } public ExternalLink ( MarkupContainer parent , final String id , final IModel href , final IModel label ) { } public ExternalLink ( MarkupContainer parent , final String id , final IModel href ) { } public final PopupSettings getPopupSettings ( ) { } public final ExternalLink setPopupSettings ( final PopupSettings popupSettings ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { if ( ( href ) != null ) { Object hrefValue = href . getObject ( ) ; if ( hrefValue != null ) { String url = hrefValue . toString ( ) ; if ( ( ( tag . getName ( ) . equalsIgnoreCase ( "a" ) ) || ( tag . getName ( ) . equalsIgnoreCase ( "link" ) ) ) || ( tag . getName ( ) . equalsIgnoreCase ( "area" ) ) ) { tag . put ( "href" , url ) ; if ( ( popupSettings ) != null ) { tag . put ( "onclick" , popupSettings . getPopupJavaScript ( ) ) ; } } else { if ( ( popupSettings ) != null ) { popupSettings . setTarget ( ( ( "'" + url ) + "'" ) ) ; String popupScript = popupSettings . getPopupJavaScript ( ) ; tag . put ( "onclick" , popupScript ) ; } else { <START_BUG> tag . put ( "onclick" , ( ( "location.href='" + url ) + "';" ) ) ; <END_BUG> } } } } } @ Override protected void onComponentTagBody ( MarkupStream markupStream , ComponentTag openTag ) { } }

Fix:
tag . put ( "onclick" , ( ( "window.location.href='" + url ) + "';" ) ) ;
Buggy code:
public class StructuredDocument { private final int depth ; private final Path relativeToBasePath ; private final Optional < FileResource > fileResource ; private final Optional < Directory > directory ; private final List < StructuredDocument > childDocuments ; public StructuredDocument ( int depth , Directory directory , Path basePath ) { } private StructuredDocument ( int depth , FileResource resource , Optional < Directory > directory , Path basePath ) { } public void toOutputPaths ( OutputPathsEnv env , List < FlattenedStructuredDocument > res ) { FileResource v = fileResource . orElseGet ( ( ) -> new FileResourcePlaceHolder ( relativeToBasePath , env . configuration ) ) ; <START_BUG> Path virtualPath = env . resource . getPath ( ) . getParent ( ) . resolve ( this . relativeToBasePath . toString ( ) ) ; <END_BUG> FileResource virtualResource = new VirtualPathFileResource ( virtualPath , v ) ; Path finalOutputPathForResource = env . outputPathExtractor . apply ( virtualResource ) ; StringBuilder sb = new StringBuilder ( ) ; Map < String , Object > model = ModelPreparer . prepare ( env . root , env . configuration , env . locale , virtualResource , finalOutputPathForResource , env . taxonomy ) ; sb . append ( renderFile ( env , model ) ) ; if ( ( depth ) < ( env . maxDepth ) ) { addFlattenedStructuredDocument ( env , res , virtualResource , finalOutputPathForResource , sb . toString ( ) ) ; childDocuments . forEach ( ( sd ) -> sd . toOutputPaths ( env , res ) ) ; } else if ( ( depth ) == ( env . maxDepth ) ) { renderChildDocuments ( env , model ) . forEach ( sb :: append ) ; addFlattenedStructuredDocument ( env , res , virtualResource , finalOutputPathForResource , sb . toString ( ) ) ; } } private void addFlattenedStructuredDocument ( OutputPathsEnv env , List < FlattenedStructuredDocument > res , FileResource virtualResource , Path finalOutputPathForResource , String includeAllResult ) { } private String renderFile ( OutputPathsEnv env , Map < String , Object > model ) { } private List < String > renderChildDocuments ( OutputPathsEnv env , Map < String , Object > model ) { } private List < StructuredDocument > from ( int depth , Optional < Directory > directory , Path basePath ) { } private static int headerLevel ( String name ) { } private static TocAndMainTitle extractTocFrom ( int depth , String s , Path finalOutputPathForResource ) { } No newline ; at end ; Optional . of file ; }

Fix:
Path virtualPath = ( ( depth ) == 0 ) ? env . resource . getPath ( ) : env . resource . getPath ( ) . getParent ( ) . resolve ( this . relativeToBasePath . toString ( ) ) ;
Buggy code:
public class CreateFilterOnFromAction extends FrameAction implements SelectionListener { public CreateFilterOnFromAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> CreateFilterOnMessageCommand c = new CreateFilterOnMessageCommand ( r , CreateFilterOnMessageCommand . FILTER_ON_FROM ) ; processor . addOp ( c ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class CommonsLoggingListener implements BuildListener , BuildLogger { private boolean initialized = false ; private LogFactory logFactory ; public CommonsLoggingListener ( ) { } private Log getLog ( String cat , String suffix ) { } public void buildStarted ( BuildEvent event ) { } public void buildFinished ( BuildEvent event ) { } public void targetStarted ( BuildEvent event ) { if ( initialized ) { Log log = getLog ( "org.apache.tools.ant.Target" , event . getTarget ( ) . getName ( ) ) ; <START_BUG> realLog ( log , ( "Start:<seq2seq4repair_space>" + ( event . getTarget ( ) . getName ( ) ) ) , MSG_DEBUG , null ) ; <END_BUG> } } public void targetFinished ( BuildEvent event ) { } public void taskStarted ( BuildEvent event ) { } public void taskFinished ( BuildEvent event ) { } public void messageLogged ( BuildEvent event ) { } private void realLog ( Log log , String message , int priority , Throwable t ) { } PrintStream out = System . out ; PrintStream err = System . err ; public void setMessageOutputLevel ( int level ) { } public void setOutputPrintStream ( PrintStream output ) { } public void setEmacsMode ( boolean emacsMode ) { } public void setErrorPrintStream ( PrintStream err ) { } }

Fix:
realLog ( log , ( "Start:<seq2seq4repair_space>" + ( event . getTarget ( ) . getName ( ) ) ) , MSG_VERBOSE , null ) ;
Buggy code:
public class TitleParserTest extends DatabaseTestCase { @ Override protected void setUp ( ) throws Exception { } public void testNoRegexes ( ) throws Exception { } public void testMonthDate ( ) { } public void testMonthSlashDay ( ) { } public void testArmyTime ( ) { } public void test_AM_PM ( ) { } public void test_at_hour ( ) { } public void test_oclock_AM ( ) { } public void test_several_forms_of_eight ( ) { } public void test_several_forms_of_1230PM ( ) { } private void insertTitleAddTask ( String title , Task task , TaskService taskService ) { } public void testDays ( ) throws Exception { Calendar today = Calendar . getInstance ( ) ; TaskService taskService = new TaskService ( ) ; Task task = new Task ( ) ; task . setValue ( TITLE , "Jog<seq2seq4repair_space>today" ) ; taskService . quickAdd ( task ) ; Date date = new Date ( task . getValue ( DUE_DATE ) ) ; assertEquals ( ( ( date . getDay ( ) ) + 1 ) , today . get ( Calendar . DAY_OF_WEEK ) ) ; task = new Task ( ) ; task . setValue ( TITLE , "Jog<seq2seq4repair_space>tomorrow" ) ; taskService . quickAdd ( task ) ; date = new Date ( task . getValue ( DUE_DATE ) ) ; <START_BUG> assertEquals ( ( ( date . getDay ( ) ) + 1 ) , ( ( today . get ( Calendar . DAY_OF_WEEK ) ) + 1 ) ) ; <END_BUG> String [ ] days = new String [ ] { "sunday" , "monday" , "tuesday" , "wednesday" , "thursday" , "friday" , "saturday" } ; String [ ] abrevDays = new String [ ] { "sun." , "mon." , "tue." , "wed." , "thu." , "fri." , "sat." } ; for ( int i = 1 ; i <= 6 ; i ++ ) { task = new Task ( ) ; task . setValue ( TITLE , ( "Jog<seq2seq4repair_space>" + ( days [ i ] ) ) ) ; taskService . quickAdd ( task ) ; date = new Date ( task . getValue ( DUE_DATE ) ) ; assertEquals ( date . getDay ( ) , i ) ; task = new Task ( ) ; task . setValue ( TITLE , ( "Jog<seq2seq4repair_space>" + ( abrevDays [ i ] ) ) ) ; taskService . quickAdd ( task ) ; date = new Date ( task . getValue ( DUE_DATE ) ) ; assertEquals ( date . getDay ( ) , i ) ; } } public void testPriority0 ( ) throws Exception { } public void testPriority1 ( ) throws Exception { } public void testPriority2 ( ) throws Exception { } public void testPriority3 ( ) throws Exception { } public void testDailyWithNoDueDate ( ) throws Exception { } public void testWeeklyWithNoDueDate ( ) throws Exception { } public void testMonthlyFromNoDueDate ( ) throws Exception { } public void testDailyFromDueDate ( ) throws Exception { } public void testWeeklyFromDueDate ( ) throws Exception { } public void testTagsPound ( ) throws Exception { } public void testTagsAt ( ) throws Exception { } }

Fix:
assertEquals ( ( ( date . getDay ( ) ) + ( 1 % 7 ) ) , ( ( today . get ( Calendar . DAY_OF_WEEK ) ) + ( 1 % 7 ) ) ) ;
Buggy code:
public class WabServletContextServiceProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit depUnit = phaseContext . getDeploymentUnit ( ) ; ContextActivator activator = depUnit . getAttachment ( ATTACHMENT_KEY ) ; <START_BUG> XBundle bundle = depUnit . getAttachment ( INSTALLED_BUNDLE_KEY ) ; <END_BUG> if ( ( activator != null ) && ( bundle != null ) ) { registerServletContext ( bundle . getBundleContext ( ) , activator . getContext ( ) . getServletContext ( ) ) ; } } private void registerServletContext ( BundleContext bundleContext , ServletContext sc ) { } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
XBundle bundle = depUnit . getAttachment ( BUNDLE_KEY ) ;
Buggy code:
public class CustomerViewDings extends Fragment implements AbsListView . OnItemClickListener { private CustomerViewDings . OnDingsFragmentInteractionListener mListener ; private AbsListView mListView ; private ListAdapter mAdapter ; public CustomerViewDings ( ) { } public ArrayList < Deal > dealList ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { } public void setEmptyText ( CharSequence emptyText ) { } public interface OnDingsFragmentInteractionListener { public void onDingsFragmentInteraction ( String id ) { } } public class DingArrayAdapter extends ArrayAdapter < Deal > { private final Context context ; private final ArrayList < Deal > values ; public DingArrayAdapter ( Context context , ArrayList < Deal > values ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { LayoutInflater inflater = getActivity ( ) . getLayoutInflater ( ) ; View rowView = inflater . inflate ( deal_view_row , parent , false ) ; <START_BUG> Deal deal = values . get ( position ) ; <END_BUG> Merchant merchant = deal . getMerchant ( ) ; ImageView image = ( ( ImageView ) ( rowView . findViewById ( merchantLogo ) ) ) ; image . setImageBitmap ( merchant . getImage ( ) ) ; TextView companyName = ( ( TextView ) ( rowView . findViewById ( companyName ) ) ) ; companyName . setText ( merchant . getCompanyName ( ) ) ; TextView merchantType = ( ( TextView ) ( rowView . findViewById ( merchantType ) ) ) ; merchantType . setText ( merchant . getMerchantType ( ) ) ; TextView dealTextView = ( ( TextView ) ( rowView . findViewById ( dealDetail ) ) ) ; dealTextView . setText ( deal . toString ( ) ) ; dealTextView . setTypeface ( dealTextView . getTypeface ( ) , BOLD ) ; TextView additionInfo = ( ( TextView ) ( rowView . findViewById ( addtionalInfo ) ) ) ; additionInfo . setText ( "500<seq2seq4repair_space>m" ) ; return rowView ; } } }

Fix:
Deal deal = values . get ( ( ( ( values . size ( ) ) - 1 ) - position ) ) ;
Buggy code:
public class CSVWriter { private CSVConfig config ; private Writer writer ; public CSVWriter ( ) { } public CSVWriter ( CSVConfig config ) { } public void writeRecord ( Map map ) { CSVField [ ] fields = config . getFields ( ) ; try { StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < ( fields . length ) ; i ++ ) { Object o = map . get ( fields [ i ] . getName ( ) ) ; if ( o != null ) { String value = o . toString ( ) ; value = writeValue ( fields [ i ] , value ) ; sb . append ( value ) ; } if ( ( ! ( config . isDelimiterIgnored ( ) ) ) && ( ( fields . length ) != ( i + 1 ) ) ) { sb . append ( config . getDelimiter ( ) ) ; } } if ( config . isEndTrimmed ( ) ) { for ( int i = ( sb . length ( ) ) - 1 ; i >= 0 ; i -- ) { System . out . println ( ( "i<seq2seq4repair_space>:<seq2seq4repair_space>" + i ) ) ; if ( Character . isWhitespace ( sb . charAt ( i ) ) ) { sb . deleteCharAt ( i ) ; } else { break ; } } } <START_BUG> sb . append ( "\n" ) ; <END_BUG> String line = sb . toString ( ) ; writer . write ( line ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } protected String writeValue ( CSVField field , String value ) throws Exception { } public CSVConfig getConfig ( ) { } public void setConfig ( CSVConfig config ) { } public void setWriter ( Writer writer ) { } }

Fix:
sb . append ( config . getRowDelimiter ( ) ) ;
Buggy code:
@ Step ( id = "SetSessionVariableStep" , name = "SetSessionVariableMeta.Name" , image = "icons//setsessionvariable.svg" , description = "SetSessionVariableMeta.Description" , i18nPackageName = "pt.webdetails.di.baserverutils" , categoryDescription = "BAServerUtils.Category" , isSeparateClassLoaderNeeded = true , documentationUrl = "http:////wiki.pentaho.com//display//EAI//Set+Session+Variables" ) public class SetSessionVariableMeta extends BaseStepMeta implements StepMetaInterface { private static Class < ? > PKG = SetSessionVariableMeta . class ; private String [ ] fieldName ; private String [ ] variableName ; private String [ ] defaultValue ; private boolean useFormatting ; public SetSessionVariableMeta ( ) { } public StepInterface getStep ( StepMeta stepMeta , StepDataInterface stepDataInterface , int cnr , TransMeta transMeta , Trans trans ) { } public StepDataInterface getStepData ( ) { } public StepDialogInterface getDialog ( Shell shell , StepMetaInterface meta , TransMeta transMeta , String name ) { } public String [ ] getFieldName ( ) { } public void setFieldName ( String [ ] fieldName ) { } public String [ ] getVariableName ( ) { } public void setVariableName ( String [ ] fieldValue ) { } public String [ ] getDefaultValue ( ) { } public void setDefaultValue ( String [ ] defaultValue ) { } public boolean isUsingFormatting ( ) { } public void setUseFormatting ( boolean useFormatting ) { } public void allocate ( int count ) { } public void setDefault ( ) { } public Object clone ( ) { } public String getXML ( ) { } public void loadXML ( Node stepNode , List < DatabaseMeta > databases , IMetaStore metaStore ) throws KettleXMLException { } public void readRep ( Repository rep , IMetaStore metaStore , ObjectId id_step , List < DatabaseMeta > databases ) throws KettleException { try { int count = rep . countNrStepAttributes ( id_step , "field_name" ) ; allocate ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { fieldName [ i ] = rep . getStepAttributeString ( id_step , i , "field_name" ) ; <START_BUG> variableName [ i ] = rep . getStepAttributeString ( id_step , i , "field_variable" ) ; <END_BUG> defaultValue [ i ] = rep . getStepAttributeString ( id_step , i , "field_default_value" ) ; } useFormatting = rep . getStepAttributeBoolean ( id_step , 0 , "use_formatting" , false ) ; } catch ( Exception e ) { throw new KettleException ( BaseMessages . getString ( SetSessionVariableMeta . PKG , "SetSessionVariable.RuntimeError.UnableToReadRepository" ) , e ) ; } } public void saveRep ( Repository rep , IMetaStore metaStore , ObjectId id_transformation , ObjectId id_step ) throws KettleException { } public void check ( List < CheckResultInterface > remarks , TransMeta transMeta , StepMeta stepMeta , RowMetaInterface prev , String [ ] input , String [ ] output , RowMetaInterface info , VariableSpace space , Repository repository , IMetaStore metaStore ) { } }

Fix:
variableName [ i ] = rep . getStepAttributeString ( id_step , i , "field_variable_name" ) ;
Buggy code:
class UserTransactionCommitTask extends UserTransactionManagementTask { UserTransactionCommitTask ( final TransactionRequestHandler transactionRequestHandler , final EJBRemoteTransactionsRepository transactionsRepository , final MarshallerFactory marshallerFactory , final UserTransactionID userTransactionID , final ChannelAssociation channelAssociation , final short invocationId ) { } @ Override protected void manageTransaction ( ) throws Throwable { <START_BUG> final Transaction transaction = this . transactionsRepository . removeTransaction ( this . userTransactionID ) ; <END_BUG> if ( transaction != null ) { this . resumeTransaction ( transaction ) ; this . transactionsRepository . getTransactionManager ( ) . commit ( ) ; } else if ( EJB3_INVOCATION_LOGGER . isDebugEnabled ( ) ) { EJB3_INVOCATION_LOGGER . debug ( ( ( "Not<seq2seq4repair_space>committing<seq2seq4repair_space>transaction<seq2seq4repair_space>" + ( this . userTransactionID ) ) + "<seq2seq4repair_space>as<seq2seq4repair_space>is<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>server" ) ) ; } } }

Fix:
final Transaction transaction = this . transactionsRepository . removeUserTransaction ( this . userTransactionID ) ;
Buggy code:
public class RedirectInjector extends InvokeInjector { public RedirectInjector ( InjectionInfo info ) { } @ Override protected void inject ( Target target , MethodInsnNode node ) { boolean injectTargetParams = false ; boolean targetIsStatic = ( node . getOpcode ( ) ) == ( Opcodes . INVOKESTATIC ) ; Type ownerType = Type . getType ( ( ( "L" + ( node . owner ) ) + ";" ) ) ; Type returnType = Type . getReturnType ( node . desc ) ; Type [ ] args = Type . getArgumentTypes ( node . desc ) ; Type [ ] stackVars = ( targetIsStatic ) ? args : ObjectArrays . concat ( ownerType , args ) ; String desc = ( Injector . printArgs ( stackVars ) ) + returnType ; if ( ! ( desc . equals ( this . methodNode . desc ) ) ) { String alternateDesc = ( Injector . printArgs ( ObjectArrays . concat ( stackVars , target . arguments , Type . class ) ) ) + returnType ; if ( alternateDesc . equals ( this . methodNode . desc ) ) { injectTargetParams = true ; } else { <START_BUG> throw new org . spongepowered . asm . mixin . injection . InvalidInjectionException ( this . info , ( ( ( ( "@Redirect<seq2seq4repair_space>handler<seq2seq4repair_space>method<seq2seq4repair_space>has<seq2seq4repair_space>an<seq2seq4repair_space>invalid<seq2seq4repair_space>signature<seq2seq4repair_space>" + ",<seq2seq4repair_space>expected<seq2seq4repair_space>" ) + desc ) + "<seq2seq4repair_space>found<seq2seq4repair_space>" ) + ( this . methodNode . desc ) ) ) ; <END_BUG> } } InsnList insns = new InsnList ( ) ; int extraLocals = ( ASMHelper . getArgsSize ( stackVars ) ) + 1 ; int extraStack = 1 ; int [ ] argMap = this . storeArgs ( target , stackVars , insns , 0 ) ; if ( injectTargetParams ) { int argSize = ASMHelper . getArgsSize ( target . arguments ) ; extraLocals += argSize ; extraStack += argSize ; argMap = Ints . concat ( argMap , target . argIndices ) ; } this . invokeHandlerWithArgs ( this . methodArgs , insns , argMap ) ; target . insns . insertBefore ( node , insns ) ; target . insns . remove ( node ) ; target . addToLocals ( extraLocals ) ; target . addToStack ( extraStack ) ; } }

Fix:
throw new org . spongepowered . asm . mixin . injection . InvalidInjectionException ( this . info , ( ( ( ( ( ( "@Redirect<seq2seq4repair_space>handler<seq2seq4repair_space>method<seq2seq4repair_space>" + ( this . methodNode . name ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>an<seq2seq4repair_space>invalid<seq2seq4repair_space>signature<seq2seq4repair_space>" ) + ",<seq2seq4repair_space>expected<seq2seq4repair_space>" ) + desc ) + "<seq2seq4repair_space>found<seq2seq4repair_space>" ) + ( this . methodNode . desc ) ) ) ;
Buggy code:
@ Singleton public class MultiplayerService { @ Inject private Provider < EntityManager > entityManagerProvider ; @ Inject UserRepository userRepository ; @ Transactional public boolean gameStore ( Game game ) { } @ Transactional public boolean usergameStore ( UserGame game ) { } @ Transactional public void gameUpdate ( String _host , String _game ) { } @ Transactional public void gameUpdate2 ( Game game ) { } @ UnitOfWork public List < Game > getAllGames ( ) { } @ UnitOfWork public boolean gameGet ( String _game ) { } @ UnitOfWork public List < UserGame > getAllUserGames ( ) { } @ UnitOfWork public List < UserGame > getDistinctAllUserGames ( ) { } @ UnitOfWork public List < Game > getActiveGames ( ) { } @ UnitOfWork public List < Game > getInactiveGames ( ) { } @ UnitOfWork public List < UserGame > getUserGamesByUsername ( String u ) { } @ UnitOfWork public List < UserGame > getUserGamesByGameName ( String u ) { } public long allocateWinningsToWinner ( User user , long buyInAmount , int numberOfPlayers ) { <START_BUG> long potTotal = buyInAmount * ( numberOfPlayers - 1 ) ; <END_BUG> user . setBalance ( ( ( user . getBalance ( ) ) + potTotal ) ) ; userRepository . merge ( user ) ; return potTotal ; } }

Fix:
long potTotal = buyInAmount * numberOfPlayers ;
Buggy code:
public final class RDate implements Serializable , Comparable < RDate > { private int _year ; private int _month ; private int _day ; @ SuppressWarnings ( { "UnusedDeclaration" } ) private RDate ( ) { } public RDate ( final int year , final int month , final int day ) { } public int getDay ( ) { } public int getMonth ( ) { } public int getYear ( ) { } @ Override public String toString ( ) { } @ Nonnull public RDate addDays ( final int dayDelta ) { } @ Nonnull public RDate addMonths ( final int monthDelta ) { } @ Override public int hashCode ( ) { } public boolean before ( @ Nonnull final RDate other ) { } public boolean after ( @ Nonnull final RDate other ) { } @ Override public int compareTo ( @ Nonnull final RDate other ) { } @ Override public boolean equals ( final Object object ) { } public static RDate today ( ) { } @ SuppressWarnings ( { "deprecation" } ) public static RDate fromDate ( @ Nonnull final Date date ) { } @ SuppressWarnings ( { "deprecation" } ) public static Date toDate ( @ Nonnull final RDate date ) { } @ Nonnull public static RDate addDays ( @ Nonnull final RDate date , final int dayDelta ) { int year = date . getYear ( ) ; int month = date . getMonth ( ) ; int day = ( date . getDay ( ) ) + dayDelta ; <START_BUG> while ( day < 0 ) { <END_BUG> month -= 1 ; if ( 0 == month ) { year -= 1 ; month = 12 ; } day += RDate . getDaysInMonth ( year , month ) ; } while ( day > ( RDate . getDaysInMonth ( year , month ) ) ) { day -= RDate . getDaysInMonth ( year , month ) ; month += 1 ; if ( 13 == month ) { year += 1 ; month = 1 ; } } return new RDate ( year , month , day ) ; } @ Nonnull public static RDate addMonths ( @ Nonnull final RDate date , final int monthDelta ) { } public static int getDaysInMonth ( final int year , final int month ) { } public static RDate parse ( @ Nonnull final String text ) { } private static IllegalArgumentException poorlyFormattedException ( final String text ) { } }

Fix:
while ( day <= 0 ) {
Buggy code:
public class JMXSubsystemTestCase extends AbstractSubsystemTest { public JMXSubsystemTestCase ( ) { } @ Test public void testParseEmptySubsystem ( ) throws Exception { } @ Test public void testParseSubsystemWithBadChild ( ) throws Exception { } @ Test public void testParseSubsystemWithBadAttribute ( ) throws Exception { } @ Test public void testParseSubsystemWithConnector ( ) throws Exception { } @ Test public void testParseSubsystemWithTwoConnectors ( ) throws Exception { } @ Test public void testParseSubsystemWithBadConnectorAttribute ( ) throws Exception { } @ Test public void testInstallIntoController ( ) throws Exception { } @ Test public void testParseAndMarshalModel ( ) throws Exception { String subsystemXml = ( ( ( "<subsystem<seq2seq4repair_space>xmlns=\"" + ( CURRENT . getUriString ( ) ) ) + "\">" ) + "<seq2seq4repair_space><jmx-connector<seq2seq4repair_space>registry-binding=\"registry1\"<seq2seq4repair_space>server-binding=\"server1\"<seq2seq4repair_space>//>" ) + "<//subsystem>" ; AdditionalInitialization additionalInit = new EmptyAdditionalInitialization ( ) { @ Override public void setupController ( ControllerInitializer controllerInitializer ) { controllerInitializer . addSocketBinding ( "registry1" , 12345 ) ; controllerInitializer . addSocketBinding ( "server1" , 12346 ) ; } } ; KernelServices servicesA = super . installInController ( additionalInit , subsystemXml ) ; ModelNode modelA = servicesA . readWholeModel ( ) ; String marshalled = servicesA . getPersistedSubsystemXml ( ) ; servicesA . shutdown ( ) ; System . out . println ( marshalled ) ; <START_BUG> KernelServices servicesB = super . installInController ( additionalInit , subsystemXml ) ; <END_BUG> ModelNode modelB = servicesB . readWholeModel ( ) ; super . compare ( modelA , modelB ) ; } @ Test public void testDescribeHandler ( ) throws Exception { } private void assertJmxSubsystemAddress ( ModelNode address ) { } }

Fix:
KernelServices servicesB = super . installInController ( additionalInit , marshalled ) ;
Buggy code:
@ Controller public class ScriptController { ExecutorService executor = Executors . newFixedThreadPool ( 10 ) ; @ Autowired DomainRepository domainRepository ; @ Autowired UserRepository userRepository ; @ Autowired AdminRepository adminRepository ; @ Autowired ScriptRepository scriptRepository ; private static final Logger LOGGER = Logger . getLogger ( ScriptController . class . getName ( ) ) ; @ RequestMapping ( value = "//script//{subject}//{name}" , method = RequestMethod . GET ) public String scriptShow ( @ PathVariable String subject , @ PathVariable String name , Model model , Principal principal ) { } @ RequestMapping ( value = "//script//run" , method = RequestMethod . POST ) public String scriptRun ( @ RequestParam String subject , @ RequestParam String name , Model model , Principal principal ) { } @ RequestMapping ( value = "//script//save" , method = RequestMethod . POST ) public String scriptSave ( @ RequestParam String subject , @ RequestParam String name , @ RequestParam String command , Model model , Principal principal ) { } @ RequestMapping ( value = "//script//file" , method = RequestMethod . POST ) public String scriptFile ( @ RequestParam String subject , @ RequestParam String scriptName , @ RequestParam String text , Model model , Principal principal ) { } <START_BUG> private String writeToFile ( Script script , String subject , String text ) { <END_BUG> String fileName = subjectFile ( script , subject ) ; try { FileUtils . writeStringToFile ( new File ( fileName ) , text ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return text ; } private String readFromFile ( Script script , String subject ) { } private String subjectFile ( Script script , String subject ) { } }

Fix:
private String writeToFile ( Script script , String text , String subject ) {
Buggy code:
class Extension extends AbstractVal implements Exp , Val { private final JDBCFilterListener _listener ; private final Val _target ; private final Val _arg ; private final ClassMapping _candidate ; private Joins _joins = null ; private ClassMetaData _meta = null ; private Class _cast = null ; public Extension ( JDBCFilterListener listener , Val target , Val arg , ClassMapping candidate ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public boolean isVariable ( ) { } public Class getType ( ) { } private Class [ ] getArgTypes ( ) { } public void setImplicitType ( Class type ) { } public void initialize ( Select sel , JDBCStore store , boolean nullTest ) { } public Joins getJoins ( ) { } public Object toDataStoreValue ( Object val , JDBCStore store ) { } public void select ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void selectColumns ( Select sel , JDBCStore store , Object [ ] params , boolean pks , JDBCFetchConfiguration fetch ) { } public void groupBy ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { <START_BUG> sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) , false ) ; <END_BUG> } public void orderBy ( Select sel , JDBCStore store , Object [ ] params , boolean asc , JDBCFetchConfiguration fetch ) { } private SQLBuffer newSQLBuffer ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public Object load ( Result res , JDBCStore store , JDBCFetchConfiguration fetch ) throws SQLException { } public boolean hasVariable ( Variable var ) { } public void calculateValue ( Select sel , JDBCStore store , Object [ ] params , Val other , JDBCFetchConfiguration fetch ) { } public void clearParameters ( ) { } public int length ( ) { } public void appendTo ( SQLBuffer sql , int index , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } private FilterValue [ ] getArgs ( Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public void initialize ( Select sel , JDBCStore store , Object [ ] params , Map contains ) { } public void appendTo ( SQLBuffer sql , Select sel , JDBCStore store , Object [ ] params , JDBCFetchConfiguration fetch ) { } public boolean hasContainsExpression ( ) { } }

Fix:
sel . groupBy ( newSQLBuffer ( sel , store , params , fetch ) ) ;