nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AllowedMethodsInformation { public static final AllowedMethodsInformation INSTANCE_BMT = new AllowedMethodsInformation ( true ) ; public static final AllowedMethodsInformation INSTANCE_CMT = new AllowedMethodsInformation ( false ) ; private final Set < DeniedMethodKey > denied ; private final Set < AllowedMethodsInformation . DeniedSyncMethodKey > deniedSyncMethods ; private final boolean beanManagedTransaction ; protected AllowedMethodsInformation ( boolean beanManagedTransaction ) { } protected void setup ( Set < DeniedMethodKey > denied ) { } protected static void add ( Set < DeniedMethodKey > otherDenied , InvocationType setEntityContext , MethodType timerServiceMethod ) { } protected static void add ( Set < AllowedMethodsInformation . DeniedSyncMethodKey > otherDenied , CurrentSynchronizationCallback . CallbackType callbackType , MethodType timerServiceMethod ) { } public static void checkAllowed ( final MethodType methodType ) { } private void checkTransactionSync ( MethodType methodType ) { } protected void realCheckPermission ( MethodType methodType , InvocationType invocationType ) { checkTransactionSync ( methodType ) ; if ( invocationType != null ) { if ( denied . contains ( new DeniedMethodKey ( invocationType , methodType ) ) ) { throwException ( methodType , invocationType ) ; } } <START_BUG> if ( ( ( invocationType != ( InvocationType . CONCURRENT_CONTEXT ) ) && ( ! ( beanManagedTransaction ) ) ) && ( methodType == ( MethodType . GET_USER_TRANSACTION ) ) ) { <END_BUG> throw MESSAGES . unauthorizedAccessToUserTransaction ( ) ; } } protected void throwException ( MethodType methodType , InvocationType invocationType ) { } protected void throwException ( MethodType methodType , CurrentSynchronizationCallback . CallbackType callback ) { } private static class DeniedSyncMethodKey { private final CallbackType callbackType ; private final MethodType methodType ; public DeniedSyncMethodKey ( CurrentSynchronizationCallback . CallbackType callbackType , MethodType methodType ) { } public CallbackType getCallbackType ( ) { } public MethodType getMethodType ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } } }

Fix:
if ( ( ! ( beanManagedTransaction ) ) && ( methodType == ( MethodType . GET_USER_TRANSACTION ) ) ) {
Buggy code:
public class XQDTPreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences ( ) { IEclipsePreferences store = new DefaultScope ( ) . getNode ( PLUGIN_ID ) ; <START_BUG> store . put ( LANGUAGE_LEVEL , LANGUAGE_NAME_XQUERY ) ; <END_BUG> } }

Fix:
store . put ( LANGUAGE_LEVEL , LANGUAGE_NAME_XQUERY_SCRIPTING ) ;
Buggy code:
public class TSIG { public static final Name HMAC = Name . fromConstantString ( "HMAC-MD5.SIG-ALG.REG.INT." ) ; public static final short FUDGE = 300 ; private Name name ; private Name alg ; private byte [ ] key ; private hmacSigner axfrSigner = null ; public TSIG ( Name name , byte [ ] key ) { } public TSIGRecord generate ( Message m , byte [ ] b , byte error , TSIGRecord old ) { } public void apply ( Message m , byte error , TSIGRecord old ) { } public void apply ( Message m , TSIGRecord old ) { } public void applyAXFR ( Message m , TSIGRecord old , boolean first ) { } public byte verify ( Message m , byte [ ] b , int length , TSIGRecord old ) { } public byte verify ( Message m , byte [ ] b , TSIGRecord old ) { } public void verifyAXFRStart ( ) { } public byte verifyAXFR ( Message m , byte [ ] b , TSIGRecord old , boolean required , boolean first ) { TSIGRecord tsig = m . getTSIG ( ) ; hmacSigner h = axfrSigner ; if ( first ) return verify ( m , b , old ) ; if ( tsig != null ) m . getHeader ( ) . decCount ( ADDITIONAL ) ; byte [ ] header = m . getHeader ( ) . toWire ( ) ; if ( tsig != null ) m . getHeader ( ) . incCount ( ADDITIONAL ) ; h . addData ( header ) ; int len ; if ( tsig == null ) len = ( b . length ) - ( header . length ) ; else len = ( m . tsigstart ) - ( header . length ) ; h . addData ( b , header . length , len ) ; if ( tsig == null ) { if ( required ) return Rcode . FORMERR ; else return Rcode . NOERROR ; } if ( ( ! ( tsig . getName ( ) . equals ( name ) ) ) || ( ! ( tsig . getAlgorithm ( ) . equals ( alg ) ) ) ) { if ( Options . check ( "verbose" ) ) System . err . println ( "BADKEY<seq2seq4repair_space>failure" ) ; return Rcode . BADKEY ; } DataByteOutputStream out = new DataByteOutputStream ( ) ; long time = ( tsig . getTimeSigned ( ) . getTime ( ) ) // 1000 ; short timeHigh = ( ( short ) ( time > > 32 ) ) ; int timeLow = ( ( int ) ( time ) ) ; out . writeShort ( timeHigh ) ; out . writeInt ( timeLow ) ; out . writeShort ( tsig . getFudge ( ) ) ; h . addData ( out . toByteArray ( ) ) ; if ( ( h . verify ( tsig . getSignature ( ) ) ) == false ) { if ( Options . check ( "verbose" ) ) System . err . println ( "BADSIG<seq2seq4repair_space>failure" ) ; return Rcode . BADSIG ; } h . clear ( ) ; DataByteOutputStream dbs = new DataByteOutputStream ( ) ; <START_BUG> dbs . writeShort ( ( ( short ) ( old . getSignature ( ) . length ) ) ) ; <END_BUG> h . addData ( dbs . toByteArray ( ) ) ; h . addData ( tsig . getSignature ( ) ) ; return Rcode . NOERROR ; } public int recordLength ( ) { } }

Fix:
dbs . writeShort ( ( ( short ) ( tsig . getSignature ( ) . length ) ) ) ;
Buggy code:
public class TestCartesianShapeFilter extends TestCase { public void testSerializable ( ) throws IOException { <START_BUG> CartesianShapeFilter filter = new CartesianShapeFilter ( new Shape ( "1" ) , "test" ) ; <END_BUG> try { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( bos ) ; oos . writeObject ( filter ) ; } catch ( NotSerializableException e ) { fail ( ( ( "Filter<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>serializable<seq2seq4repair_space>but<seq2seq4repair_space>raised<seq2seq4repair_space>a<seq2seq4repair_space>NotSerializableException<seq2seq4repair_space>[" + ( e . getMessage ( ) ) ) + "]" ) ) ; } } }

Fix:
CartesianShapeFilter filter = new CartesianShapeFilter ( new Shape ( 1 ) , "test" ) ;
Buggy code:
public class TestMorfologikAnalyzer extends BaseTokenStreamTestCase { private Analyzer getTestAnalyzer ( ) { } public final void testSingleTokens ( ) throws IOException { } public final void testMultipleTokens ( ) throws IOException { } public final void testLeftoverStems ( ) throws IOException { } public final void testCase ( ) throws IOException { } private void assertPOSToken ( TokenStream ts , String term , String ... tags ) throws IOException { } public final void testPOSAttribute ( ) throws IOException { } public void testRandom ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , getTestAnalyzer ( ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , getTestAnalyzer ( ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class AddressbookTableModel extends AbstractTableModel implements HeaderListTableModel { private String [ ] columns = new String [ ] { "type" , "displayname" , "email;internet" , "url" } ; private HeaderItemList rows ; public AddressbookTableModel ( ) { } public HeaderItemList getHeaderList ( ) { } public void setHeaderList ( HeaderItemList list ) { } public void update ( ) { } public int getColumnCount ( ) { } public int getRowCount ( ) { } public Object getValueAt ( int row , int column ) { HeaderItem item = rows . get ( row ) ; <START_BUG> return item ; <END_BUG> } }

Fix:
return item . get ( columns [ column ] ) ;
Buggy code:
public abstract class ImportExportPage extends WorkbenchWizardSelectionPage { protected static final String DIALOG_SETTING_SECTION_NAME = "ImportExportPage." ; private TreeViewer treeViewer ; protected class CategorizedWizardSelectionTree { private static final int SIZING_LISTS_HEIGHT = 200 ; private IWizardCategory wizardCategories ; private String message ; private TreeViewer viewer ; protected CategorizedWizardSelectionTree ( IWizardCategory categories , String msg ) { } protected Composite createControl ( Composite parent ) { } private void createFilteredTree ( Composite parent ) { FilteredTree filteredTree = new FilteredTree ( parent , ( ( ( ( SWT . SINGLE ) | ( SWT . H_SCROLL ) ) | ( SWT . V_SCROLL ) ) | ( SWT . BORDER ) ) , new WizardPatternFilter ( ) ) ; viewer = filteredTree . getViewer ( ) ; filteredTree . setFont ( parent . getFont ( ) ) ; viewer . setContentProvider ( new WizardContentProvider ( ) ) ; viewer . setLabelProvider ( new WorkbenchLabelProvider ( ) ) ; <START_BUG> viewer . setSorter ( INSTANCE ) ; <END_BUG> ArrayList inputArray = new ArrayList ( ) ; boolean expandTop = false ; if ( ( wizardCategories ) != null ) { if ( ( wizardCategories . getParent ( ) ) == null ) { IWizardCategory [ ] children = wizardCategories . getCategories ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { inputArray . add ( children [ i ] ) ; } } else { expandTop = true ; inputArray . add ( wizardCategories ) ; } } if ( expandTop ) { viewer . setAutoExpandLevel ( 2 ) ; } AdaptableList input = new AdaptableList ( inputArray ) ; viewer . addFilter ( new WizardActivityFilter ( ) ) ; viewer . setInput ( input ) ; } protected TreeViewer getViewer ( ) { } private void layoutTopControl ( Control control ) { } } protected ImportExportPage ( IWorkbench aWorkbench , IStructuredSelection currentSelection ) { } public void createControl ( Composite parent ) { } protected abstract Composite createTreeViewer ( Composite parent ) { } protected void treeDoubleClicked ( DoubleClickEvent event ) { } private void updateSelectedNode ( WorkbenchWizardElement wizardElement ) { } protected void updateMessage ( ) { } protected void listSelectionChanged ( ISelection selection ) { } private IWizardNode createWizardNode ( IWizardDescriptor element ) { } protected void restoreWidgetValues ( ) { } protected void expandPreviouslyExpandedCategories ( String setting , IWizardCategory wizardCategories , TreeViewer viewer ) { } protected void selectPreviouslySelected ( String setting , IWizardCategory wizardCategories , final TreeViewer viewer ) { } protected void storeExpandedCategories ( String setting , TreeViewer viewer ) { } protected void storeSelectedCategoryAndWizard ( String setting , TreeViewer viewer ) { } public void saveWidgetValues ( ) { } public IWizardPage getNextPage ( ) { } protected ITriggerPoint getTriggerPoint ( ) { } protected void setTreeViewer ( TreeViewer viewer ) { } protected TreeViewer getTreeViewer ( ) { } protected void initialize ( ) { } }

Fix:
viewer . setComparator ( INSTANCE ) ;
Buggy code:
public class HelloBrowserApplication extends WicketExampleApplication { public HelloBrowserApplication ( ) { } @ Override public Class < ? extends Page > getHomePage ( ) { } @ Override protected void init ( ) { super . init ( ) ; getRequestCycleSettings ( ) . setGatherExtendedBrowserInfo ( true ) ; <START_BUG> mountBookmarkablePage ( "howdy" , HelloBrowser . class ) ; <END_BUG> } }

Fix:
mountPage ( "howdy" , HelloBrowser . class ) ;
Buggy code:
@ Controller public class HomeController { @ Autowired private ThymeleafTilesConfigurer tilesConfigurer ; <START_BUG> @ RequestMapping ( "//index" ) <END_BUG> public String index ( ) { return "index" ; } }

Fix:
@ RequestMapping ( { "//home" , "//" } )
Buggy code:
public class SubTypeSearchJob extends PatternSearchJob { SimpleSet indexes = new SimpleSet ( 5 ) ; public SubTypeSearchJob ( SearchPattern pattern , SearchParticipant participant , IJavaSearchScope scope , IndexQueryRequestor requestor ) { } public void finished ( ) { } public Index [ ] getIndexes ( IProgressMonitor progressMonitor ) { } public boolean search ( Index index , IProgressMonitor progressMonitor ) { if ( index == null ) return IJob . COMPLETE ; <START_BUG> if ( ( indexes . addIfNotIncluded ( index ) ) == index ) <END_BUG> index . startQuery ( ) ; return super . search ( index , progressMonitor ) ; } }

Fix:
if ( ( this . indexes . addIfNotIncluded ( index ) ) == index )
Buggy code:
public class PatternFilter extends ViewerFilter { private Map cache = new HashMap ( ) ; private StringMatcher matcher ; public Object [ ] filter ( Viewer viewer , Object parent , Object [ ] elements ) { } public boolean select ( Viewer viewer , Object parentElement , Object element ) { Object [ ] children = ( ( org . eclipse . jface . viewers . ITreeContentProvider ) ( ( ( org . eclipse . jface . viewers . AbstractTreeViewer ) ( viewer ) ) . getContentProvider ( ) ) ) . getChildren ( element ) ; <START_BUG> if ( ( children . length ) > 0 ) <END_BUG> return ( filter ( viewer , element , children ) . length ) > 0 ; String labelText = ( ( org . eclipse . jface . viewers . ILabelProvider ) ( ( ( org . eclipse . jface . viewers . StructuredViewer ) ( viewer ) ) . getLabelProvider ( ) ) ) . getText ( element ) ; if ( labelText == null ) return false ; return match ( labelText ) ; } public void setPattern ( String patternString ) { } protected boolean match ( String string ) { } }

Fix:
if ( ( children != null ) && ( ( children . length ) > 0 ) )
Buggy code:
public class Assignment extends Expression { public Expression lhs ; public Expression expression ; public Assignment ( Expression lhs , Expression expression , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { LocalVariableBinding local = this . lhs . localVariableBinding ( ) ; int nullStatus = this . expression . nullStatus ( flowInfo ) ; if ( ( local != null ) && ( nullStatus == ( FlowInfo . NULL ) ) ) { if ( flowInfo . isDefinitelyNull ( local ) ) { <START_BUG> currentScope . problemReporter ( ) . localVariableCanOnlyBeNull ( local , this . lhs ) ; <END_BUG> } } flowInfo = ( ( Reference ) ( lhs ) ) . analyseAssignment ( currentScope , flowContext , flowInfo , this , false ) . unconditionalInits ( ) ; if ( local != null ) { switch ( nullStatus ) { case FlowInfo . NULL : flowInfo . markAsDefinitelyNull ( local ) ; break ; case FlowInfo . NON_NULL : flowInfo . markAsDefinitelyNonNull ( local ) ; break ; } } return flowInfo ; } void checkAssignmentEffect ( BlockScope scope ) { } void checkAssignment ( BlockScope scope , TypeBinding lhsType , TypeBinding rhsType ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } Binding getDirectBinding ( Expression someExpression ) { } FieldBinding getLastField ( Expression someExpression ) { } public int nullStatus ( FlowInfo flowInfo ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
flowContext . recordUsingNullReference ( currentScope , local , this . lhs , FlowInfo . NULL , flowInfo ) ;
Buggy code:
public class TestConcurrentMergeScheduler extends LuceneTestCase { private static class FailOnlyOnFlush extends MockRAMDirectory . Failure { boolean doFail ; boolean hitExc ; @ Override public void setDoFail ( ) { } @ Override public void clearDoFail ( ) { } @ Override public void eval ( MockRAMDirectory dir ) throws IOException { if ( ( doFail ) && ( Thread . currentThread ( ) . getName ( ) . equals ( "main" ) ) ) { StackTraceElement [ ] trace = new Exception ( ) . getStackTrace ( ) ; for ( int i = 0 ; i < ( trace . length ) ; i ++ ) { <START_BUG> if ( "doFlush" . equals ( trace [ i ] . getMethodName ( ) ) ) { <END_BUG> hitExc = true ; throw new IOException ( "now<seq2seq4repair_space>failing<seq2seq4repair_space>during<seq2seq4repair_space>flush" ) ; } } } } } public void testFlushExceptions ( ) throws IOException { } public void testDeleteMerging ( ) throws IOException { } public void testNoExtraFiles ( ) throws IOException { } public void testNoWaitClose ( ) throws IOException { } }

Fix:
if ( "flush" . equals ( trace [ i ] . getMethodName ( ) ) ) {
Buggy code:
public class FriendsSubController extends SplitPane implements Initializable { private MainController application ; @ FXML private Accordion groupsAccordion ; @ FXML private Button btnAddFriend ; @ FXML private HBox boxAddFriend ; @ FXML private TextField friendName ; private Map < String , ObservableList < FriendsSubController . UserHBoxCell > > groups ; private class UserHBoxCell extends HBox { private User user ; private Label label ; private ImageView icon ; private static final String ON_PATH = "IHM//resources//online_icon.png" ; private static final String OFF_PATH = "IHM//resources//offline_icon.png" ; public UserHBoxCell ( final User vUser , final boolean status ) { } public void switchOn ( ) { } public void switchOff ( ) { } public User getUser ( ) { } } public FriendsSubController ( ) { } @ Override public void initialize ( final URL url , final ResourceBundle resourceBundle ) { } public void build ( ) { } public void addGroup ( final Group group ) { } public void addGroups ( final List < Group > groupsParam ) { } public void addUserInGroup ( final User user , final String groupName ) { } public void addUsersInGroup ( final List < User > users , final String groupName ) { } private TitledPane createNewGroup ( final String groupName ) { } public void addFriend ( ) { } public void setApp ( final MainController app ) { } public void connectUser ( final User user ) { } public void disconnectUser ( final User user ) { } public void receiveFriendResponse ( final User sender , final boolean response ) { Platform . runLater ( new Runnable ( ) { @ Override public void run ( ) { if ( response ) { Dialogs . showInformationDialog ( ( ( "L'utilisateur<seq2seq4repair_space>" + ( sender . getLogin ( ) ) ) + "<seq2seq4repair_space>a<seq2seq4repair_space>accepté<seq2seq4repair_space>votre<seq2seq4repair_space>demande<seq2seq4repair_space>d'ami." ) ) ; <START_BUG> application . getIHMtoDATA ( ) . acceptUserInGroup ( sender , getFriendGroup ( ) ) ; <END_BUG> moveUserToGroup ( sender , FRIENDS_GROUP_NAME ) ; } else { Dialogs . showInformationDialog ( ( ( "L'utilisateur<seq2seq4repair_space>" + ( sender . getLogin ( ) ) ) + "<seq2seq4repair_space>a<seq2seq4repair_space>refusé<seq2seq4repair_space>votre<seq2seq4repair_space>demande<seq2seq4repair_space>d'ami." ) ) ; } } } ) ; } public void receiveFriendRequest ( final User sender ) { } private Group getFriendGroup ( ) { } private Group getDefaultGroup ( ) { } private User lookForUser ( final User user ) { } private boolean isMyFriend ( User user ) { } private User lookForUser ( final String login ) { } private String removeUserFromGroup ( final User user ) { } private void moveUserToGroup ( final User user , final String groupName ) { } public void reloadUserGroups ( ) { } private void clearGroups ( ) { } private void reloadUser ( final User user ) { } }

Fix:
application . getIHMtoDATA ( ) . addUserInGroup ( sender , getFriendGroup ( ) ) ;
Buggy code:
final class CombinedResourceInputStream extends InputStream { private static final String TIME_TO_LIVE_CONTEXT_PARAM = "org.omnifaces.CACHE_SETTING_APPLICATION_TTL" ; private static final String DEFAULT_SCOPE = "application" ; public static final String PARAM_NAME_ACTIVATE_RESOURCE_CACHING = "org.omnifaces.COMBINED_RESOURCE_ACTIVATE_RESOURCE_CACHING" ; private static final byte [ ] CRLF = new byte [ ] { '\r' , '\n' } ; private List < InputStream > streams ; private Iterator < InputStream > streamIterator ; private InputStream currentStream ; static Map < String , byte [ ] > cachedResources = new HashMap < String , byte [ ] > ( ) ; private byte [ ] combinedResource = null ; private int pointer = 0 ; public CombinedResourceInputStream ( Set < Resource > resources ) throws IOException { } private void prepareStreaming ( Set < Resource > resources ) throws IOException { } @ SuppressWarnings ( "resource" ) private static byte [ ] prepareStreamingFromCache ( Iterator < InputStream > streamIterator , Set < Resource > resources ) throws IOException { String key = "" ; for ( Resource resource : resources ) { key += ( ( ( resource . getLibraryName ( ) ) + "//" ) + ( resource . getResourceName ( ) ) ) + "<seq2seq4repair_space>" ; } Cache scopedCache = CacheFactory . getCache ( FacesContext . getCurrentInstance ( ) , CombinedResourceInputStream . DEFAULT_SCOPE ) ; byte [ ] _combinedResource ; synchronized ( CombinedResourceHandler . class ) { _combinedResource = ( ( byte [ ] ) ( scopedCache . getObject ( key ) ) ) ; } if ( null != _combinedResource ) { return _combinedResource ; } streamIterator . hasNext ( ) ; InputStream currentStream = streamIterator . next ( ) ; if ( null == _combinedResource ) { ByteArrayOutputStream collector = new ByteArrayOutputStream ( ) ; int read = - 1 ; while ( true ) { read = currentStream . read ( ) ; if ( read == ( - 1 ) ) { if ( streamIterator . hasNext ( ) ) { currentStream = streamIterator . next ( ) ; } else { break ; } } else collector . write ( read ) ; } _combinedResource = collector . toByteArray ( ) ; synchronized ( CombinedResourceHandler . class ) { <START_BUG> if ( null == ( scopedCache . getAttribute ( key , key ) ) ) <END_BUG> scopedCache . putObject ( key , _combinedResource , CombinedResourceInputStream . getTimeToLiveOfCacheEntries ( ) ) ; } } return _combinedResource ; } private static int getTimeToLiveOfCacheEntries ( ) { } @ Override public int read ( ) throws IOException { } public int readFromStreamIterator ( ) throws IOException { } public int readFromCache ( ) throws IOException { } @ Override public void close ( ) throws IOException { } No newline ; at end ; of file ; }

Fix:
if ( null == ( scopedCache . getObject ( key ) ) )
Buggy code:
public class KeyPressTick { private final int ascendKey = ParachuteCommonProxy . getAscendKey ( ) ; @ SubscribeEvent public void onTick ( TickEvent . PlayerTickEvent event ) { if ( event . phase . equals ( START ) ) { <START_BUG> if ( ( Keyboard . getEventKey ( ) ) == ( Keyboard . KEY_SPACE ) ) { <END_BUG> EntityPlayer player = event . player ; if ( player != null ) { boolean keyPressed = Keyboard . isKeyDown ( ascendKey ) ; network . sendToServer ( new KeyPressMessage ( ascendKey , keyPressed ) ) ; } } } } }

Fix:
if ( ( Keyboard . getEventKey ( ) ) == ( ascendKey ) ) {
Buggy code:
public class Program { public static void main ( String [ ] args ) { Database rootDatabase = null ; try { rootDatabase = new Database ( "localhost" , 3306 , "root" , "new-password" ) ; } catch ( DatabaseException E ) { System . out . println ( E . getMessage ( ) ) ; return ; } if ( ! ( rootDatabase . selectDatabase ( "university" ) ) ) { System . out . println ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>select<seq2seq4repair_space>the<seq2seq4repair_space>university<seq2seq4repair_space>database.<seq2seq4repair_space>Exiting..." ) ; rootDatabase . close ( ) ; return ; } rootDatabase . addUser ( "brown" , "brown123" , Staff ) ; rootDatabase . addUser ( "grey" , "grey123" , Student ) ; System . out . println ( "Welcome<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>CSC3300<seq2seq4repair_space>University<seq2seq4repair_space>Database<seq2seq4repair_space>CLI!\nPlease<seq2seq4repair_space>log<seq2seq4repair_space>in." ) ; boolean validAuth = false ; do { String username = InputReader . _readString ( "Enter<seq2seq4repair_space>username:<seq2seq4repair_space>" ) ; String password = InputReader . _readString ( "Enter<seq2seq4repair_space>password:<seq2seq4repair_space>" ) ; validAuth = rootDatabase . authUser ( username , password ) ; if ( ! validAuth ) System . out . println ( "Invalid<seq2seq4repair_space>credentials<seq2seq4repair_space>supplied.<seq2seq4repair_space>Please<seq2seq4repair_space>try<seq2seq4repair_space>again." ) ; } while ( ! validAuth ) ; UserInterface userInteraction = new UserInterface ( rootDatabase ) ; userInteraction . mainMenu ( ) ; <START_BUG> System . out . println ( "Thanks<seq2seq4repair_space>you<seq2seq4repair_space>for<seq2seq4repair_space>using<seq2seq4repair_space>the<seq2seq4repair_space>CSC3300<seq2seq4repair_space>University<seq2seq4repair_space>Database<seq2seq4repair_space>CLI!" ) ; <END_BUG> rootDatabase . close ( ) ; } }

Fix:
System . out . println ( "Thank<seq2seq4repair_space>you<seq2seq4repair_space>for<seq2seq4repair_space>using<seq2seq4repair_space>the<seq2seq4repair_space>CSC3300<seq2seq4repair_space>University<seq2seq4repair_space>Database<seq2seq4repair_space>CLI!" ) ;
Buggy code:
public class UmlModelListener implements MElementListener { Category logger = null ; private static UmlModelListener SINGLETON = new UmlModelListener ( ) ; public static UmlModelListener getInstance ( ) { } private UmlModelListener ( ) { } public void listRoleItemSet ( MElementEvent mee ) { } public void propertySet ( MElementEvent mee ) { } public void recovered ( MElementEvent mee ) { } public void removed ( MElementEvent mee ) { } public void roleAdded ( MElementEvent mee ) { } public void roleRemoved ( MElementEvent mee ) { } protected void notifyModelChanged ( MElementEvent mee ) { if ( ( ( ( mee . getAddedValue ( ) ) != null ) || ( ( mee . getRemovedValue ( ) ) != null ) ) || ( ( ( mee . getNewValue ( ) ) != null ) && ( ! ( mee . getNewValue ( ) . equals ( mee . getOldValue ( ) ) ) ) ) ) { <START_BUG> if ( ( TheInstance . getNavigatorPane ( ) ) != null ) <END_BUG> TheInstance . getNavigatorPane ( ) . forceUpdate ( ) ; if ( ( ProjectManager . getManager ( ) . getCurrentProject ( ) ) != null ) ProjectManager . getManager ( ) . getCurrentProject ( ) . setNeedsSave ( true ) ; } } }

Fix:
if ( ( ( ProjectBrowser . TheInstance ) != null ) && ( ( TheInstance . getNavigatorPane ( ) ) != null ) )
Buggy code:
Element title = newDocument . createElement ( "title" ) ; <START_BUG> title . setTextContent ( spaceName ) ; <END_BUG>

Fix:
title . setTextContent ( ( "Home<seq2seq4repair_space>Page:<seq2seq4repair_space>" + spaceName ) ) ;
Buggy code:
public class DefaultMarkupResourceStreamProvider implements IMarkupResourceStreamProvider { private static final Logger log = LoggerFactory . getLogger ( DefaultMarkupResourceStreamProvider . class ) ; public DefaultMarkupResourceStreamProvider ( ) { } public IResourceStream getMarkupResourceStream ( final MarkupContainer container , Class < ? > containerClass ) { final IResourceStreamLocator locator = Application . get ( ) . getResourceSettings ( ) . getResourceStreamLocator ( ) ; String style = container . getStyle ( ) ; String variation = container . getVariation ( ) ; Locale locale = container . getLocale ( ) ; String ext = container . getMarkupType ( ) . getExtension ( ) ; while ( containerClass != ( MarkupContainer . class ) ) { String path = containerClass . getName ( ) . replace ( '.' , '//' ) ; <START_BUG> IResourceStream resourceStream = locator . locate ( container . getClass ( ) , path , style , variation , locale , ext ) ; <END_BUG> if ( resourceStream != null ) { return new MarkupResourceStream ( resourceStream , new ContainerInfo ( container ) , containerClass ) ; } containerClass = containerClass . getSuperclass ( ) ; } return null ; } }

Fix:
IResourceStream resourceStream = locator . locate ( container . getClass ( ) , path , style , variation , locale , ext , false ) ;
Buggy code:
public class WhileController extends GenericController implements Serializable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 232L ; private static final String CONDITION = "WhileController.condition" ; public WhileController ( ) { } private boolean endOfLoop ( boolean loopEnd ) { <START_BUG> String cnd = getCondition ( ) ; <END_BUG> WhileController . log . debug ( ( ( "Condition<seq2seq4repair_space>string:" + cnd ) + "." ) ) ; boolean res ; if ( ( loopEnd && ( ( cnd . length ( ) ) == 0 ) ) || ( "LAST" . equalsIgnoreCase ( cnd ) ) ) { JMeterVariables threadVars = JMeterContextService . getContext ( ) . getVariables ( ) ; res = "false" . equalsIgnoreCase ( threadVars . get ( LAST_SAMPLE_OK ) ) ; } else { res = "false" . equalsIgnoreCase ( cnd ) ; } WhileController . log . debug ( ( "Condition<seq2seq4repair_space>value:<seq2seq4repair_space>" + res ) ) ; return res ; } protected Sampler nextIsNull ( ) throws NextIsNullException { } public Sampler next ( ) { } public void setCondition ( String string ) { } public String getCondition ( ) { } }

Fix:
String cnd = getCondition ( ) . trim ( ) ;
Buggy code:
public class CacheFactoryAdd extends AbstractAddStepHandler { private final AttributeDefinition [ ] attributes ; CacheFactoryAdd ( AttributeDefinition ... attributes ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > serviceControllers ) throws OperationFailedException { } Collection < ServiceController < ? > > installRuntimeServices ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler ) throws OperationFailedException { final String name = PathAddress . pathAddress ( operation . get ( ADDRESS ) ) . getLastElement ( ) . getValue ( ) ; ModelNode passivationStoreModel = PASSIVATION_STORE . resolveModelAttribute ( context , model ) ; String passivationStore = ( passivationStoreModel . isDefined ( ) ) ? passivationStoreModel . asString ( ) : null ; final Collection < String > unwrappedAliasValues = ALIASES . unwrap ( context , model ) ; <START_BUG> final Set < String > aliases = ( unwrappedAliasValues != null ) ? new HashSet < > ( unwrappedAliasValues ) : Collections . EMPTY_SET ; <END_BUG> ServiceTarget target = context . getServiceTarget ( ) ; ServiceBuilder < ? > builder = CacheFactoryAdd . buildCacheFactoryBuilder ( target , name , passivationStore ) ; for ( String alias : aliases ) { builder . addAliases ( CacheFactoryBuilderService . getServiceName ( alias ) ) ; } if ( verificationHandler != null ) { builder . addListener ( verificationHandler ) ; } return Collections . < ServiceController < ? > > singleton ( builder . install ( ) ) ; } private static ServiceBuilder < ? > buildCacheFactoryBuilder ( ServiceTarget target , String name , String passivationStore ) { } }

Fix:
final Set < String > aliases = ( unwrappedAliasValues != null ) ? new HashSet < > ( unwrappedAliasValues ) : Collections . < String > emptySet ( ) ;
Buggy code:
public class AddExpenseActivity extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public void saveExpense ( View v ) { Toast . makeText ( this , "added<seq2seq4repair_space>a<seq2seq4repair_space>expense" , LENGTH_SHORT ) . show ( ) ; ExpenseListController cm = new ExpenseListController ( ) ; <START_BUG> EditText textview = ( ( EditText ) ( findViewById ( itemName ) ) ) ; <END_BUG> EditText startdateView = ( ( EditText ) ( findViewById ( expenseDate ) ) ) ; EditText categoryView = ( ( EditText ) ( findViewById ( Category ) ) ) ; EditText descriptView = ( ( EditText ) ( findViewById ( expenseDescription ) ) ) ; EditText costView = ( ( EditText ) ( findViewById ( amountSpent ) ) ) ; EditText currencyView = ( ( EditText ) ( findViewById ( currency ) ) ) ; cm . addExpense ( new Expense ( textview . getText ( ) . toString ( ) , categoryView . getText ( ) . toString ( ) , costView . getText ( ) . toString ( ) , currencyView . getText ( ) . toString ( ) , descriptView . getText ( ) . toString ( ) ) ) ; Intent intent = new Intent ( this , ExpenseListActivity . class ) ; startActivity ( intent ) ; } }

Fix:
EditText textview = ( ( EditText ) ( findViewById ( name ) ) ) ;
Buggy code:
public class SacnReceiver extends Thread { public static final int SOURCE_NAME_ADDR = 44 ; public static final int ACN_IDENTIFIER_SIZE = 12 ; public static final byte [ ] ACN_IDENTIFIER = new byte [ ] { 65 , 83 , 67 , 45 , 69 , 49 , 46 , 49 , 55 , 0 , 0 , 0 } ; public static final int SACN_PORT = 5568 ; public MulticastSocket mcSocket ; boolean seenPacket = false ; private byte [ ] buf ; private PixelPusherObserver observer ; public SacnReceiver ( PixelPusherObserver observer ) { } public void addGroup ( InetAddress group ) { } private void update_channel ( int universe , int channel , int value ) { } private void parseSacnPacket ( DatagramPacket packet ) { buf = packet . getData ( ) ; if ( ( buf . length ) > ( SacnReceiver . ACN_IDENTIFIER_SIZE ) ) { for ( int i = 0 ; i < ( SacnReceiver . ACN_IDENTIFIER_SIZE ) ; i ++ ) { if ( ( SacnReceiver . ACN_IDENTIFIER [ i ] ) != ( buf [ ( i + 4 ) ] ) ) { System . out . println ( "sACN:<seq2seq4repair_space>Got<seq2seq4repair_space>a<seq2seq4repair_space>packet<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>sACN<seq2seq4repair_space>port,<seq2seq4repair_space>but<seq2seq4repair_space>ID<seq2seq4repair_space>was<seq2seq4repair_space>wrong." ) ; return ; } } } if ( ! ( this . seenPacket ) ) { System . out . println ( "sACN:<seq2seq4repair_space>Got<seq2seq4repair_space>an<seq2seq4repair_space>sACN<seq2seq4repair_space>packet!" ) ; this . seenPacket = true ; } <START_BUG> int universe = ( buf [ 114 ] ) | ( ( buf [ 113 ] ) << 8 ) ; <END_BUG> for ( int i = 0 ; i < 512 ; i ++ ) { update_channel ( universe , ( i + 1 ) , buf [ ( i + 126 ) ] ) ; } } @ Override public void run ( ) { } }

Fix:
int universe = ( ( buf [ 114 ] ) & 255 ) | ( ( ( buf [ 113 ] ) & 255 ) << 8 ) ;
Buggy code:
public class InventoryUtil implements Listener { public static void addItem ( Inventory inv , ItemStack item ) { } public static void clearInventory ( final Player p ) { } public static void clearHandler ( CommandSender cs , Player player , String [ ] args , int offset , boolean showExtended ) { } public static boolean isFullInventory ( Inventory inv ) { } @ SuppressWarnings ( "deprecation" ) public static boolean isEmptyInventory ( PlayerInventory inv ) { } @ SuppressWarnings ( "deprecation" ) public static String convertInventoryToString ( Inventory invInventory ) { } @ SuppressWarnings ( "deprecation" ) public static Inventory convertStringToInventory ( String invString , String name ) { String [ ] serializedBlocks = invString . split ( ";" ) ; String invInfo = serializedBlocks [ 0 ] ; Inventory deserializedInventory = Bukkit . getServer ( ) . createInventory ( null , Integer . valueOf ( invInfo ) , name . substring ( 0 , 31 ) ) ; for ( int i = 1 ; i < ( serializedBlocks . length ) ; i ++ ) { String [ ] serializedBlock = serializedBlocks [ i ] . split ( "#" ) ; int stackPosition = Integer . valueOf ( serializedBlock [ 0 ] ) ; if ( stackPosition >= ( deserializedInventory . getSize ( ) ) ) { continue ; } ItemStack is = null ; Boolean createdItemStack = false ; String [ ] serializedItemStack = serializedBlock [ 1 ] . split ( ":" ) ; for ( String itemInfo : serializedItemStack ) { String [ ] itemAttribute = itemInfo . split ( "@" ) ; if ( itemAttribute [ 0 ] . equals ( "t" ) ) { is = new ItemStack ( Material . getMaterial ( Integer . valueOf ( itemAttribute [ 1 ] ) ) ) ; createdItemStack = true ; } else if ( ( itemAttribute [ 0 ] . equals ( "d" ) ) && createdItemStack ) { is . setDurability ( Short . valueOf ( itemAttribute [ 1 ] ) ) ; } else if ( ( itemAttribute [ 0 ] . equals ( "a" ) ) && createdItemStack ) { is . setAmount ( Integer . valueOf ( itemAttribute [ 1 ] ) ) ; } else if ( ( itemAttribute [ 0 ] . equals ( "e" ) ) && createdItemStack ) { <START_BUG> is . addEnchantment ( Enchantment . getById ( Integer . valueOf ( itemAttribute [ 1 ] ) ) , Integer . valueOf ( itemAttribute [ 2 ] ) ) ; <END_BUG> } } deserializedInventory . setItem ( stackPosition , is ) ; } return deserializedInventory ; } }

Fix:
is . addUnsafeEnchantment ( Enchantment . getById ( Integer . valueOf ( itemAttribute [ 1 ] ) ) , Integer . valueOf ( itemAttribute [ 2 ] ) ) ;
Buggy code:
public class ContentDBConnector { private Connection sqlConnection ; private String contentTable = ContextConfig . getInstance ( ) . CONTENT_DB_contentTABLE_NAME ; private String jobTable = ContextConfig . getInstance ( ) . CONTENT_DB_jobTABLE_NAME ; String Query_FOR_CREATE_TRIGGER = ( ( ( ( "CREATE<seq2seq4repair_space>TRIGGER<seq2seq4repair_space>update_trigger<seq2seq4repair_space>AFTER<seq2seq4repair_space>INSERT<seq2seq4repair_space>ON<seq2seq4repair_space>" + ( contentTable ) ) + "<seq2seq4repair_space>FOR<seq2seq4repair_space>EACH<seq2seq4repair_space>ROW<seq2seq4repair_space>BEGIN<seq2seq4repair_space>INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>" ) + ( jobTable ) ) + "(doc_id,<seq2seq4repair_space>working_status,<seq2seq4repair_space>complete_status,<seq2seq4repair_space>client_jobstatus)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(NEW.doc_id,<seq2seq4repair_space>0,<seq2seq4repair_space>0,<seq2seq4repair_space>0);" ) + "END;" ; public ContentDBConnector ( ) { } private void setTrigger ( ) { } public boolean add ( Document document ) { } public boolean delete ( Document document ) { } public Document query ( String colName , String value ) { } public boolean update ( String columnName , int id , int status ) { } public ArrayList < Integer > checkUpdates ( String columnName , int id ) { } private boolean connect ( ) { } private boolean disconnect ( ) { } private void cleanJobTable ( ) { } private void reConnect ( ) { } private String escape ( String text ) { } private String unescape ( String text ) { } public ArrayList < Document > queryFromDate ( String startDate , String endDate , boolean bNaver , boolean bDaum , boolean bNate ) { } public ArrayList < Integer > queryClientJobCandidates ( int nRows ) { } public ArrayList < String > queryCategoryList ( List < Integer > termLinkedDocIds ) { } public ArrayList < String > queryTitle ( List < Integer > termLinkedDocIds ) { ArrayList < String > titleList = new ArrayList < String > ( ) ; ResultSet resultSet = null ; try { Statement stmt = sqlConnection . createStatement ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( ( ( "select<seq2seq4repair_space>title<seq2seq4repair_space>from<seq2seq4repair_space>" + ( contentTable ) ) + "<seq2seq4repair_space>where<seq2seq4repair_space>" ) ) ; for ( int doc_id : termLinkedDocIds ) { sb . append ( ( ( "doc_id<seq2seq4repair_space>=<seq2seq4repair_space>" + doc_id ) + "<seq2seq4repair_space>OR<seq2seq4repair_space>" ) ) ; } sb . replace ( ( ( sb . length ( ) ) - 4 ) , sb . length ( ) , ";" ) ; resultSet = stmt . executeQuery ( sb . toString ( ) ) ; while ( resultSet . next ( ) ) { <START_BUG> titleList . add ( resultSet . getString ( 1 ) ) ; <END_BUG> } stmt . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } return titleList ; } }

Fix:
titleList . add ( unescape ( resultSet . getString ( 1 ) ) ) ;
Buggy code:
public class CustomCommands extends Module { public Path commandFile = Paths . get ( ( ( channelBot . getPath ( ) ) + "save.commands" ) ) ; public File commandFile2 = new File ( ( ( channelBot . getPath ( ) ) + "save.commands" ) ) ; public boolean commandFileExists ; public CustomCommands ( ChannelBot channelBot ) { } public void rawCommand ( String message , String sender , HashMap < String , String > tags ) { } public boolean addCustomCommand ( String message ) { } public boolean addCustomCommand ( String message , boolean log ) { } public void addCustomCommandToConfig ( String message , String sender , HashMap < String , String > tags ) { if ( ( commandFileExists ) && ( addCustomCommand ( message ) ) ) { try { <START_BUG> Files . write ( commandFile , ( ( String . join ( "<seq2seq4repair_space>" , ( ( CharSequence [ ] ) ( Utils . makeArgs ( message ) ) ) ) ) + "\n" ) . getBytes ( ) , StandardOpenOption . APPEND ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } } } public void removeCustomCommand ( String message , String sender , HashMap < String , String > tags ) { } }

Fix:
Files . write ( commandFile , ( ( String . join ( "<seq2seq4repair_space>" , ( ( CharSequence [ ] ) ( Utils . makeArgs ( message ) ) ) ) ) + ( System . getProperty ( "line.separator" ) ) ) . getBytes ( ) , StandardOpenOption . APPEND ) ;
Buggy code:
public class TSIG { private static final String HMAC_MD5_STR = "HMAC-MD5.SIG-ALG.REG.INT." ; private static final String HMAC_SHA1_STR = "hmac-sha1." ; private static final String HMAC_SHA256_STR = "hmac-sha256." ; public static final Name HMAC_MD5 = Name . fromConstantString ( TSIG . HMAC_MD5_STR ) ; public static final Name HMAC = TSIG . HMAC_MD5 ; public static final Name HMAC_SHA1 = Name . fromConstantString ( TSIG . HMAC_SHA1_STR ) ; public static final Name HMAC_SHA256 = Name . fromConstantString ( TSIG . HMAC_SHA256_STR ) ; public static final short FUDGE = 300 ; private Name name ; private Name alg ; private String digest ; private byte [ ] key ; private void getDigest ( ) { if ( alg . equals ( TSIG . HMAC_MD5 ) ) digest = "md5" ; else if ( alg . equals ( TSIG . HMAC_SHA1 ) ) <START_BUG> digest = "sha" ; <END_BUG> else if ( alg . equals ( TSIG . HMAC_SHA256 ) ) digest = "sha-256" ; else throw new IllegalArgumentException ( "Invalid<seq2seq4repair_space>algorithm" ) ; } public TSIG ( Name algorithm , Name name , byte [ ] key ) { } public TSIG ( Name name , byte [ ] key ) { } public TSIG ( Name algorithm , String name , String key ) { } public TSIG ( String name , String key ) { } public TSIGRecord generate ( Message m , byte [ ] b , int error , TSIGRecord old ) { } public void apply ( Message m , int error , TSIGRecord old ) { } public void apply ( Message m , TSIGRecord old ) { } public void applyStream ( Message m , TSIGRecord old , boolean first ) { } public byte verify ( Message m , byte [ ] b , int length , TSIGRecord old ) { } public int verify ( Message m , byte [ ] b , TSIGRecord old ) { } public int recordLength ( ) { } public static class StreamVerifier { private TSIG key ; private org . xbill . DNS . HMAC verifier ; private int nresponses ; private int lastsigned ; private TSIGRecord lastTSIG ; public StreamVerifier ( TSIG tsig , TSIGRecord old ) { } public int verify ( Message m , byte [ ] b ) { } } }

Fix:
digest = "sha-1" ;
Buggy code:
public class OtherServicesSubsystemExtension implements Extension { public static final String NAMESPACE = "urn:mycompany:mysubsystem:1.0" ; public static final String SUBSYSTEM_NAME = "mysubsystem" ; private final OtherServicesSubsystemExtension . SubsystemParser parser = new OtherServicesSubsystemExtension . SubsystemParser ( ) ; private volatile OperationStepHandler addHandler ; public OtherServicesSubsystemExtension ( ) { } public void setAddHandler ( OperationStepHandler addHandler ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public void initialize ( ExtensionContext context ) { <START_BUG> final SubsystemRegistration subsystem = context . registerSubsystem ( OtherServicesSubsystemExtension . SUBSYSTEM_NAME , 1 , 0 ) ; <END_BUG> final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( SUBSYSTEM ) ; registration . registerOperationHandler ( ADD , addHandler , SUBSYSTEM_ADD , false ) ; registration . registerOperationHandler ( DESCRIBE , OtherServicesSubsystemExtension . SubsystemDescribeHandler . INSTANCE , OtherServicesSubsystemExtension . SubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; registration . registerOperationHandler ( REMOVE , INSTANCE , SUBSYSTEM_REMOVE , false ) ; subsystem . registerXMLElementWriter ( parser ) ; } private static ModelNode createAddSubsystemOperation ( ) { } private static class SubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } } private static class SubsystemDescribeHandler implements OperationStepHandler , DescriptionProvider { static final OtherServicesSubsystemExtension . SubsystemDescribeHandler INSTANCE = new OtherServicesSubsystemExtension . SubsystemDescribeHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } @ Override public ModelNode getModelDescription ( Locale locale ) { } } }

Fix:
final SubsystemRegistration subsystem = context . registerSubsystem ( OtherServicesSubsystemExtension . SUBSYSTEM_NAME , 1 , 0 , 0 ) ;
Buggy code:
@ ManagedBean @ RequestScoped public class DownloadBean { @ EJB private RegistruFacadeLocal registruFacade ; @ EJB private TransferFacadeLocal transferFacade ; private static final Logger LOG = Logger . getLogger ( DownloadBean . class . getName ( ) ) ; private static final int BUFFER_SIZE = 8096 ; private int tid ; private int rid ; private String reportRange ; public DownloadBean ( ) { } public void downloadFile ( ) { } public void downloadReport ( ) { } public void downloadOneFile ( ) { try { Transfer transfer = transferFacade . find ( tid ) ; FacesContext fc = FacesContext . getCurrentInstance ( ) ; ExternalContext ec = fc . getExternalContext ( ) ; File file = transfer . getAttachment ( ) ; String fileName = file . getFilename ( ) ; int length ; InputStream inputStream = ec . getResourceAsStream ( ( "//WEB-INF//upload//" + ( transfer . getAttachment ( ) . getHash ( ) ) ) ) ; if ( inputStream == null ) { <START_BUG> FacesMessage msg = new FacesMessage ( FacesMessage . SEVERITY_ERROR , "Eroare<seq2seq4repair_space>Descărcare" , "Fișier<seq2seq4repair_space>inexistent" ) ; <END_BUG> FacesContext . getCurrentInstance ( ) . addMessage ( "growl" , msg ) ; throw new FileNotFoundException ( "File<seq2seq4repair_space>not<seq2seq4repair_space>found!" ) ; } else { ec . responseReset ( ) ; if ( fileName . endsWith ( "xlsx" ) ) { ec . setResponseContentType ( "application//vnd.openxmlformats-officedocument.spreadsheetml.sheet" ) ; ec . setResponseHeader ( "Content-Disposition" , ( ( "attachment;<seq2seq4repair_space>filename=\"file_" + ( tid ) ) + ".xlsx\"" ) ) ; } else if ( fileName . endsWith ( "xls" ) ) { ec . setResponseContentType ( "application//vnd.ms-excel" ) ; ec . setResponseHeader ( "Content-Disposition" , ( ( "attachment;<seq2seq4repair_space>filename=\"file_" + ( tid ) ) + ".xls\"" ) ) ; } OutputStream outputStream = ec . getResponseOutputStream ( ) ; byte [ ] buffer = new byte [ DownloadBean . BUFFER_SIZE ] ; while ( ( length = inputStream . read ( buffer ) ) != ( - 1 ) ) { outputStream . write ( buffer , 0 , length ) ; } outputStream . flush ( ) ; outputStream . close ( ) ; } fc . responseComplete ( ) ; } catch ( IOException e ) { DownloadBean . LOG . severe ( e . toString ( ) ) ; } } public void downloadZip ( ) { } public int getTid ( ) { } public void setTid ( int tid ) { } public int getRid ( ) { } public void setRid ( int rid ) { } public String getReportRange ( ) { } public void setReportRange ( String reportRange ) { } }

Fix:
FacesMessage msg = new FacesMessage ( FacesMessage . SEVERITY_ERROR , "Eroare<seq2seq4repair_space>Descărcare" , ( "Fișier<seq2seq4repair_space>inexistent:<seq2seq4repair_space>" + ( transfer . getAttachment ( ) . getHash ( ) ) ) ) ;
Buggy code:
public class Echo extends Task { protected String message = "" ; protected File file = null ; protected boolean append = false ; protected int logLevel = Project . MSG_WARN ; public void execute ( ) throws BuildException { } public void setMessage ( String msg ) { } public void setFile ( File file ) { } public void setAppend ( boolean append ) { } public void addText ( String msg ) { <START_BUG> message += ProjectHelper . replaceProperties ( msg , project . getProperties ( ) ) ; <END_BUG> } public void setLevel ( Echo . EchoLevel echoLevel ) { } public static class EchoLevel extends EnumeratedAttribute { public String [ ] getValues ( ) { } } }

Fix:
message += ProjectHelper . replaceProperties ( project , msg , project . getProperties ( ) ) ;