nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PerCflow extends PerClause { private boolean isBelow ; private Pointcut entry ; public PerCflow ( Pointcut entry , boolean isBelow ) { } <START_BUG> public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { <END_BUG> return FuzzyBoolean . MAYBE ; } public FuzzyBoolean match ( Shadow shadow ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public PerClause concretize ( ResolvedTypeX inAspect ) { } public void write ( DataOutputStream s ) throws IOException { } public static PerClause readPerClause ( DataInputStream s , ISourceContext context ) throws IOException { } public Kind getKind ( ) { } public String toString ( ) { } }

Fix:
public FuzzyBoolean fastMatch ( FastMatchInfo type ) {
Buggy code:
public class giveTownMoney implements SignShopOperation { @ Override public Boolean setupOperation ( SignShopArguments ssArgs ) { } @ Override public Boolean checkRequirements ( SignShopArguments ssArgs , Boolean activeCheck ) { SignShopPlayer ssPlayer = ssArgs . getPlayer ( ) . get ( ) ; if ( ! ( ssArgs . isPlayerOnline ( ) ) ) return true ; MoneyModifierManager . applyModifiers ( ssArgs , GiveToTown ) ; try { <START_BUG> Resident resident = TownyUniverse . getDataSource ( ) . getResident ( ssPlayer . getName ( ) ) ; <END_BUG> Town town = resident . getTown ( ) ; if ( ! ( resident . isMayor ( ) ) ) { if ( ! ( town . hasAssistant ( resident ) ) ) { ssPlayer . sendMessage ( SignShopConfig . getError ( "towny_owner_not_mayor_or_assistant" , ssArgs . getMessageParts ( ) ) ) ; return false ; } } if ( ( Vault . getEconomy ( ) ) == null ) { ssPlayer . sendMessage ( "Error<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>economy,<seq2seq4repair_space>tell<seq2seq4repair_space>the<seq2seq4repair_space>System<seq2seq4repair_space>Administrator<seq2seq4repair_space>to<seq2seq4repair_space>install<seq2seq4repair_space>Vault<seq2seq4repair_space>properly." ) ; return false ; } else if ( town . getEconomyName ( ) . isEmpty ( ) ) { ssPlayer . sendMessage ( SignShopConfig . getError ( "towny_owner_not_belong_to_town" , ssArgs . getMessageParts ( ) ) ) ; return false ; } } catch ( TownyException x ) { ssPlayer . sendMessage ( SignShopConfig . getError ( "towny_owner_not_belong_to_town" , ssArgs . getMessageParts ( ) ) ) ; return false ; } return true ; } @ Override public Boolean runOperation ( SignShopArguments ssArgs ) { } }

Fix:
Resident resident = TownyUniverse . getDataSource ( ) . getResident ( ssArgs . getOwner ( ) . get ( ) . getName ( ) ) ;
Buggy code:
public class PerspContentProvider implements IStructuredContentProvider { public PerspContentProvider ( ) { } public void dispose ( ) { } public Object [ ] getElements ( Object element ) { } public void inputChanged ( Viewer viewer , Object oldInput , Object newInput ) { } public boolean isDeleted ( Object element ) { } IPerspectiveDescriptor [ ] filteredPerspectives ( IPerspectiveRegistry registry ) { IObjectActivityManager manager = PlatformUI . getWorkbench ( ) . getObjectActivityManager ( PL_PERSPECTIVES , false ) ; IPerspectiveDescriptor [ ] descriptors = registry . getPerspectives ( ) ; if ( manager == null ) { return descriptors ; } <START_BUG> Collection activePerspectives = manager . getActiveObjects ( ) ; <END_BUG> Collection filtered = new ArrayList ( ) ; for ( int i = 0 ; i < ( descriptors . length ) ; i ++ ) { IPerspectiveDescriptor descriptor = descriptors [ i ] ; if ( ( ( org . eclipse . ui . internal . registry . PerspectiveDescriptor ) ( descriptor ) ) . isPredefined ( ) ) { if ( activePerspectives . contains ( descriptor . getId ( ) ) ) { filtered . add ( descriptor ) ; } } else { filtered . add ( descriptor ) ; } } return ( ( IPerspectiveDescriptor [ ] ) ( filtered . toArray ( new IPerspectiveDescriptor [ filtered . size ( ) ] ) ) ) ; } }

Fix:
Collection activePerspectives = manager . getEnabledObjects ( ) ;
Buggy code:
public class DefaultExceptionMapper implements IExceptionMapper { private static final Logger logger = LoggerFactory . getLogger ( DefaultExceptionMapper . class ) ; public IRequestHandler map ( Exception e ) { } private IRequestHandler internalMap ( Exception e ) { final Application application = Application . get ( ) ; if ( isProcessingAjaxRequest ( ) ) { switch ( application . getExceptionSettings ( ) . getAjaxErrorHandlingStrategy ( ) ) { case INVOKE_FAILURE_HANDLER : return new ErrorCodeRequestHandler ( 500 ) ; } } if ( e instanceof StalePageException ) { return new RenderPageRequestHandler ( new PageProvider ( ( ( StalePageException ) ( e ) ) . getPage ( ) ) ) ; } else if ( e instanceof PageExpiredException ) { return createPageRequestHandler ( new PageProvider ( Application . get ( ) . getApplicationSettings ( ) . getPageExpiredErrorPage ( ) ) ) ; } else if ( ( e instanceof AuthorizationException ) || ( e instanceof ListenerInvocationNotAllowedException ) ) { return createPageRequestHandler ( new PageProvider ( Application . get ( ) . getApplicationSettings ( ) . getAccessDeniedPage ( ) ) ) ; } else if ( e instanceof ResponseIOException ) { DefaultExceptionMapper . logger . error ( "Connection<seq2seq4repair_space>lost,<seq2seq4repair_space>give<seq2seq4repair_space>up<seq2seq4repair_space>responding." , e ) ; return new EmptyRequestHandler ( ) ; } else { final UnexpectedExceptionDisplay unexpectedExceptionDisplay = application . getExceptionSettings ( ) . getUnexpectedExceptionDisplay ( ) ; DefaultExceptionMapper . logger . error ( "Unexpected<seq2seq4repair_space>error<seq2seq4repair_space>occurred" , e ) ; if ( SHOW_EXCEPTION_PAGE . equals ( unexpectedExceptionDisplay ) ) { Page currentPage = extractCurrentPage ( ) ; return createPageRequestHandler ( new PageProvider ( new org . apache . wicket . markup . html . pages . ExceptionErrorPage ( e , currentPage ) ) ) ; } else if ( SHOW_INTERNAL_ERROR_PAGE . equals ( unexpectedExceptionDisplay ) ) { return createPageRequestHandler ( new PageProvider ( application . getApplicationSettings ( ) . getInternalErrorPage ( ) ) ) ; } else { <START_BUG> return new EmptyRequestHandler ( ) ; <END_BUG> } } } private RenderPageRequestHandler createPageRequestHandler ( PageProvider pageProvider ) { } private boolean isProcessingAjaxRequest ( ) { } private Page extractCurrentPage ( ) { } }

Fix:
return new ErrorCodeRequestHandler ( 500 ) ;
Buggy code:
public class SourceLocation implements Serializable , ISourceLocation { public static final ISourceLocation UNKNOWN = new SourceLocation ( ISourceLocation . NO_FILE , 0 , 0 , 0 ) ; public static final void validLine ( int line ) { } public static final void validColumn ( int column ) { } private final File sourceFile ; private final int startLine ; private final int column ; private final int endLine ; private final String context ; private boolean noColumn ; public SourceLocation ( File file , int line ) { } public SourceLocation ( File file , int line , int endLine ) { } public SourceLocation ( File file , int line , int endLine , int column ) { } public SourceLocation ( File file , int line , int endLine , int column , String context ) { } public File getSourceFile ( ) { } public int getLine ( ) { } public int getColumn ( ) { } public int getEndLine ( ) { } public String getContext ( ) { } public String toString ( ) { StringBuffer sb = new StringBuffer ( ) ; if ( null != ( context ) ) { sb . append ( context ) ; sb . append ( EOL ) ; } if ( ( sourceFile ) != ( ISourceLocation . NO_FILE ) ) { sb . append ( sourceFile . getPath ( ) ) ; sb . append ( ":" ) ; } <START_BUG> sb . append ( ( ( ( "" + ( startLine ) ) + "-" ) + ( endLine ) ) ) ; <END_BUG> if ( ! ( noColumn ) ) { sb . append ( ( ":" + ( column ) ) ) ; } return sb . toString ( ) ; } }

Fix:
sb . append ( startLine ) ;
Buggy code:
@ Component ( StripeGatewayFactory . ID ) public class StripeGatewayFactory extends AbstractGatewayFactory implements GatewayFactory { public static final String ID = "stripe" ; @ Inject private ObjectMapper mapper ; @ Inject private Logger logger ; @ Override public String getId ( ) { } @ Override public PaymentGateway createGateway ( ) { Optional < File > tenantConfigurationFile = getTenantConfigurationFile ( "configuration.yml" ) ; if ( ! ( tenantConfigurationFile . isPresent ( ) ) ) { <START_BUG> logger . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>Paybox<seq2seq4repair_space>payment<seq2seq4repair_space>gateway<seq2seq4repair_space>:<seq2seq4repair_space>no<seq2seq4repair_space>tenant<seq2seq4repair_space>configuration<seq2seq4repair_space>found" ) ; <END_BUG> return null ; } try { JsonNode node = mapper . readTree ( tenantConfigurationFile . get ( ) ) ; StripeTenantConfiguration configuration = mapper . readValue ( new TreeTraversingParser ( node ) , StripeTenantConfiguration . class ) ; return new StripePaymentGateway ( configuration ) ; } catch ( FileNotFoundException e ) { logger . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>stripe<seq2seq4repair_space>payment<seq2seq4repair_space>gateway<seq2seq4repair_space>:<seq2seq4repair_space>configuration<seq2seq4repair_space>file<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; return null ; } catch ( JsonProcessingException e ) { logger . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>stripe<seq2seq4repair_space>payment<seq2seq4repair_space>gateway<seq2seq4repair_space>:<seq2seq4repair_space>invalid<seq2seq4repair_space>configuration<seq2seq4repair_space>file" ) ; return null ; } catch ( IOException e ) { logger . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>stripe<seq2seq4repair_space>payment<seq2seq4repair_space>gateway<seq2seq4repair_space>:<seq2seq4repair_space>IO<seq2seq4repair_space>exception" ) ; return null ; } } }

Fix:
logger . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>stripe<seq2seq4repair_space>payment<seq2seq4repair_space>gateway<seq2seq4repair_space>:<seq2seq4repair_space>no<seq2seq4repair_space>tenant<seq2seq4repair_space>configuration<seq2seq4repair_space>found" ) ;
Buggy code:
public class Symlink extends DispatchTask { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; private String resource ; private String link ; private Vector fileSets = new Vector ( ) ; private String linkFileName ; private boolean overwrite ; private boolean failonerror ; private boolean executing = false ; public void init ( ) throws BuildException { } public synchronized void execute ( ) throws BuildException { } public void single ( ) throws BuildException { } public void delete ( ) throws BuildException { } public void recreate ( ) throws BuildException { } public void record ( ) throws BuildException { } private void setDefaults ( ) { } public void setOverwrite ( boolean owrite ) { } public void setFailOnError ( boolean foe ) { } public void setAction ( String action ) { } public void setLink ( String lnk ) { } public void setResource ( String src ) { } public void setLinkfilename ( String lf ) { } public void addFileset ( FileSet set ) { } public static void deleteSymlink ( String path ) throws FileNotFoundException , IOException { } public static void deleteSymlink ( File linkfil ) throws IOException { } private void writePropertyFile ( Properties properties , File dir ) throws BuildException { BufferedOutputStream bos = null ; try { bos = new BufferedOutputStream ( new FileOutputStream ( new File ( dir , linkFileName ) ) ) ; properties . store ( bos , ( "Symlinks<seq2seq4repair_space>from<seq2seq4repair_space>" + dir ) ) ; } catch ( IOException ioe ) { throw new BuildException ( ioe , getLocation ( ) ) ; } finally { <START_BUG> Symlink . FILE_UTILS . close ( bos ) ; <END_BUG> } } private void handleError ( String msg ) { } private void doLink ( String res , String lnk ) throws BuildException { } private HashSet findLinks ( Vector v ) { } private Properties loadLinks ( Vector v ) { } }

Fix:
FileUtils . close ( bos ) ;
Buggy code:
public class Program { private static final Logger LOGGER = Logger . getLogger ( Program . class . getName ( ) ) ; private static final ScheduledExecutorService executor = Executors . newSingleThreadScheduledExecutor ( ) ; private static final BotConfig config = INSTANCE . get ( BotConfig . class ) ; private final DefaultBot bot ; private final InteractionBot interactionBot ; private final ChatInterface chatInterface = new StackExchangeChat ( ) ; private final JavaDocAccessor javaDocAccessor ; private static final Pattern javadocPattern = Pattern . compile ( ( ( "^" + ( Pattern . quote ( Program . config . getTrigger ( ) ) ) ) + "javadoc:(.*)" ) , Pattern . DOTALL ) ; public Program ( ) throws IOException { } public void startup ( ) { } private void scheduleQueryingThread ( ) { } private void login ( ) { } private void bindDefaultCommands ( ) { bindShutdownCommand ( ) ; bindJavaDocCommand ( ) ; <START_BUG> new com . gmail . inverseconduit . commands . sets . CoreBotCommands ( chatInterface ) . allCommands ( ) . forEach ( bot :: subscribe ) ; <END_BUG> } private void bindJavaDocCommand ( ) { } private void bindShutdownCommand ( ) { } }

Fix:
new com . gmail . inverseconduit . commands . sets . CoreBotCommands ( chatInterface , bot ) . allCommands ( ) . forEach ( bot :: subscribe ) ;
Buggy code:
public class AllMyDrawings { public static void drawPicture1 ( Graphics2D g2 ) { } public static void drawPicture2 ( Graphics2D g2 ) { } public static void drawPicture3 ( Graphics2D g2 ) { g2 . drawString ( "A<seq2seq4repair_space>bunch<seq2seq4repair_space>of<seq2seq4repair_space>Coffee<seq2seq4repair_space>Cups<seq2seq4repair_space>by<seq2seq4repair_space>Phill<seq2seq4repair_space>Conrad" , 20 , 20 ) ; <START_BUG> Sweatshirt s = new Sweatshirt ( 20 , 20 , 10 , 10 ) ; <END_BUG> g2 . draw ( s ) ; } }

Fix:
Sweatshirt s = new Sweatshirt ( 20 , 20 , 100 , 60 ) ;
Buggy code:
public class ChatDetailFragment extends Fragment implements ChatDetailContract . View { private Presenter mPresenter ; private ChatDetailAdapter mListAdapter ; private ChatDetailViewModel mChatDetailViewModel ; private ChatdetailFragBinding mChatDetailFragBinding ; private static final String CHAT_ID = "CHAT_ID" ; EditText etMessage ; ImageButton btSend ; public ChatDetailFragment ( ) { } public static ChatDetailFragment newInstance ( ) { } @ Override public void setPresenter ( @ NonNull ChatDetailContract . Presenter presenter ) { } @ Override public void onResume ( ) { } @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { mChatDetailFragBinding = ChatdetailFragBinding . inflate ( inflater , container , false ) ; mChatDetailFragBinding . setChats ( mChatDetailViewModel ) ; mChatDetailFragBinding . setPresenter ( mPresenter ) ; ListView listView = mChatDetailFragBinding . messageList ; SharedPreferencesHelper sharedPreferencesHelper = SharedPreferencesHelper . getInstance ( NAME_USER , getContext ( ) . getApplicationContext ( ) ) ; <START_BUG> final long chatUserId = Long . valueOf ( sharedPreferencesHelper . loadString ( KEY_USERNAME , "1" ) ) ; <END_BUG> mListAdapter = new ChatDetailAdapter ( new ArrayList < Message > ( 0 ) , chatUserId , mPresenter , mChatDetailViewModel ) ; listView . setAdapter ( mListAdapter ) ; final ScrollChildSwipeRefreshLayout swipeRefreshLayout = mChatDetailFragBinding . refreshLayout ; swipeRefreshLayout . setColorSchemeColors ( ContextCompat . getColor ( getActivity ( ) , colorPrimary ) , ContextCompat . getColor ( getActivity ( ) , colorAccent ) , ContextCompat . getColor ( getActivity ( ) , colorPrimaryDark ) ) ; swipeRefreshLayout . setScrollUpChild ( listView ) ; setHasOptionsMenu ( true ) ; View root = mChatDetailFragBinding . getRoot ( ) ; return root ; } public static ChatDetailFragment newInstance ( String chatId ) { } @ Override public void showMessages ( List < Message > messageList ) { } @ Override public boolean isActive ( ) { } @ Override public void setLoadingIndicator ( boolean active ) { } @ Override public void showLoadingMessagesError ( ) { } public void setViewModel ( ChatDetailViewModel viewModel ) { } private void showMessage ( String message ) { } }

Fix:
final long chatUserId = Long . valueOf ( sharedPreferencesHelper . loadString ( KEY_USERID , "1" ) ) ;
Buggy code:
public class ServerAppl extends Appl { public PropagandaServer server ; @ Override public void main ( ) { if ( ( ( flags . get ( "?" ) ) != null ) || ( ( flags . get ( "h" ) ) != null ) ) { S . pL ( "-name<seq2seq4repair_space>propaganda<seq2seq4repair_space>server<seq2seq4repair_space>name" ) ; S . pL ( "-MB<seq2seq4repair_space>start<seq2seq4repair_space>Moquette<seq2seq4repair_space>Broker<seq2seq4repair_space>(MQTT)" ) ; S . pL ( "-port=<port><seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>port<seq2seq4repair_space>of<seq2seq4repair_space>propaganda<seq2seq4repair_space>server<seq2seq4repair_space>(=8899)" ) ; S . pL ( "-http=<port><seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>port<seq2seq4repair_space>of<seq2seq4repair_space>propaganda<seq2seq4repair_space>http<seq2seq4repair_space>server<seq2seq4repair_space>(=8888)" ) ; S . pL ( "-ws=<port><seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>port<seq2seq4repair_space>of<seq2seq4repair_space>propaganda<seq2seq4repair_space>WS<seq2seq4repair_space>server<seq2seq4repair_space>(=8877)" ) ; S . pL ( "-discover=<port><seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>port<seq2seq4repair_space>of<seq2seq4repair_space>propaganda<seq2seq4repair_space>discover<seq2seq4repair_space>server<seq2seq4repair_space>(=8833)" ) ; S . pL ( "-fed.port=<port><seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>port<seq2seq4repair_space>of<seq2seq4repair_space>propaganda<seq2seq4repair_space>federation<seq2seq4repair_space>listener<seq2seq4repair_space>(=0)<seq2seq4repair_space>-<seq2seq4repair_space>EXPERIMENTAL" ) ; S . pL ( "-fed.join=<host:port><seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>host:port<seq2seq4repair_space>for<seq2seq4repair_space>joining<seq2seq4repair_space>federation<seq2seq4repair_space>(='')<seq2seq4repair_space>-<seq2seq4repair_space>EXPERIMENTAL" ) ; return ; } String port_s = "8899" ; String fl ; if ( ( fl = flags . get ( "port" ) ) != null ) { port_s = fl ; } if ( ( fl = flags . get ( "name" ) ) != null ) { PropagandaServer . DEFAULT_NAME = fl ; } if ( ( fl = flags . get ( "http" ) ) != null ) { PropagandaServer . DEFAULT_HTTP_PORT = Integer . parseInt ( fl ) ; } if ( ( fl = flags . get ( "ws" ) ) != null ) { PropagandaServer . DEFAULT_WS_PORT = Integer . parseInt ( fl ) ; } if ( ( fl = flags . get ( "discover" ) ) != null ) { PropagandaServer . DEFAULT_DISCOVER_PORT = Integer . parseInt ( fl ) ; } if ( ( fl = flags . get ( "fed.port" ) ) != null ) { PropagandaServer . DEFAULT_FEDERATION_PORT = Integer . parseInt ( fl ) ; } if ( ( fl = flags . get ( "fed.join" ) ) != null ) { PropagandaServer . DEFAULT_FEDERATION_JOINHOST = fl ; } <START_BUG> server = PropagandaServer . getDefaultServer ( "" , Integer . parseInt ( port_s ) ) ; <END_BUG> String s = "ALL" ; if ( ( s = flags . get ( "log" ) ) != null ) { Config . setLogLevel ( ( ( s . length ( ) ) == 0 ? "ALL" : s ) ) ; } } public static void main ( String [ ] args ) { } }

Fix:
server = PropagandaServer . getDefaultServer ( Integer . parseInt ( port_s ) ) ;
Buggy code:
@ Controller @ RequestMapping ( "//course" ) public class CourseController { private static final Logger LOGGER = LoggerFactory . getLogger ( CourseController . class ) ; private CourseService courseService ; private BatchService batchService ; @ Autowired public CourseController ( CourseService courseService , BatchService batchService ) { } @ RequestMapping ( method = GET ) public String preCreate ( @ ModelAttribute Course course ) { } @ RequestMapping ( method = POST ) public String create ( @ ModelAttribute @ Valid Course course , BindingResult result , ModelMap modelMap ) { } @ RequestMapping ( value = "//{courseId}" , method = GET ) public String read ( @ PathVariable ( "courseId" ) String courseId , ModelMap modelMap ) { } @ RequestMapping ( value = "//{courseId}" , method = POST ) public String update ( @ PathVariable ( "courseId" ) String courseId , @ ModelAttribute @ Valid Course course , ModelMap modelMap , BindingResult result ) { } @ RequestMapping ( value = "//{courseId}//delete" , method = GET ) public String delete ( @ PathVariable ( "courseId" ) String courseId ) { } @ RequestMapping ( value = "//deleteList" , method = POST ) public String deleteList ( @ RequestParam String data ) { } @ RequestMapping ( value = "//list" , method = GET ) public String list ( ModelMap modelMap ) { } @ RequestMapping ( value = "{courseId}//batches" , method = GET ) @ ResponseBody public List < Batch > fetchBatches ( @ PathVariable ( "courseId" ) String courseId ) { <START_BUG> return batchService . findByCourseName ( courseId ) ; <END_BUG> } @ ModelAttribute ( "standards" ) public List < Standard > populateStandards ( ) { } @ ModelAttribute ( "mediums" ) public List < Medium > populateMediums ( ) { } @ ModelAttribute ( "boards" ) public List < Board > populateBoards ( ) { } }

Fix:
return batchService . findByCourseId ( courseId ) ;
Buggy code:
public class AddMessageFolderTest extends AbstractFolderTst { public AddMessageFolderTest ( String arg0 ) { } public AddMessageFolderTest ( MailboxTstFactory factory , String arg0 ) { } public void testAddMessage ( ) throws Exception { } public void testAddAttributesTest ( ) throws Exception { Object [ ] uids1 = getSourceFolder ( ) . getUids ( ) ; assertEquals ( "starting<seq2seq4repair_space>with<seq2seq4repair_space>empty<seq2seq4repair_space>folder" , 0 , uids1 . length ) ; MailboxInfo info1 = getSourceFolder ( ) . getMessageFolderInfo ( ) ; assertEquals ( "starting<seq2seq4repair_space>with<seq2seq4repair_space>empty<seq2seq4repair_space>folder" , 0 , info1 . getExists ( ) ) ; String input = FolderTstHelper . getString ( 0 ) ; System . out . println ( ( "input=" + input ) ) ; ByteArrayInputStream inputStream = FolderTstHelper . getByteArrayInputStream ( input ) ; Object uid = getSourceFolder ( ) . addMessage ( inputStream ) ; Flags flags = getSourceFolder ( ) . getFlags ( uid ) ; flags . setSeen ( true ) ; MailboxInfo info = getSourceFolder ( ) . getMessageFolderInfo ( ) ; assertEquals ( "message-folderinfo<seq2seq4repair_space>exists" , 1 , info . getExists ( ) ) ; <START_BUG> assertEquals ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>unseen<seq2seq4repair_space>messages<seq2seq4repair_space>in<seq2seq4repair_space>folder" , 1 , info . getUnseen ( ) ) ; <END_BUG> assertEquals ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>seen<seq2seq4repair_space>messages<seq2seq4repair_space>in<seq2seq4repair_space>folder" , 0 , ( ( info . getExists ( ) ) - ( info . getUnseen ( ) ) ) ) ; inputStream . close ( ) ; } }

Fix:
assertEquals ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>unseen<seq2seq4repair_space>messages<seq2seq4repair_space>in<seq2seq4repair_space>folder" , 0 , info . getUnseen ( ) ) ;
Buggy code:
public class MainWindow extends JFrame { private final String TITLE = "Dream<seq2seq4repair_space>Recorder" ; private final Color BG_COLOR = Color . BLACK ; private final Color MENU_BG_COLOR = Color . LIGHT_GRAY ; private final Color MENU_TEXT_COLOR = Color . BLACK ; protected GraphViewer graphViewer ; private JMenuBar menu = new JMenuBar ( ) ; private GuiConfig guiConfig ; private InputEventHandler eventHandler ; public MainWindow ( InputEventHandler eventHandler , GuiConfig guiConfig ) { } private void close ( ) { } public void setGraphViewer ( GraphViewer graphViewer ) { } private void showMessage ( String s ) { } private Dimension getWorkspaceDimension ( ) { } private void formMenu ( ) { } private File chooseFileToRead ( ) { } private File getDirectoryToRead ( ) { } private void setDirectoryToRead ( String directoryToRead ) { } File getDirectoryToSave ( ) { } void setDirectoryToSave ( String directoryToSave ) { } void startRecording ( RecordingSettings recordingSettings , File file ) throws ApplicationException { <START_BUG> if ( ( recordingSettings . getDirectoryToSave ( ) ) != ( file . getParent ( ) ) ) { <END_BUG> guiConfig . setDirectoryToSave ( recordingSettings . getDirectoryToSave ( ) ) ; eventHandler . startRecording ( recordingSettings , file ) ; } } String normalizeFilename ( String filename ) { } private void prepareRecord ( File file ) { } }

Fix:
if ( ( file == null ) || ( ( recordingSettings . getDirectoryToSave ( ) ) != ( file . getParent ( ) ) ) ) {
Buggy code:
public class SnomedLoader implements Loader { private static Logger logger = Logger . getLogger ( SnomedLoader . class ) ; public void load ( File file ) { OObjectDatabaseTx dbConnection = VocabularyRepository . getInstance ( ) . getInactiveDbConnection ( ) ; SnomedLoader . logger . debug ( ( "Loading<seq2seq4repair_space>SNOMED<seq2seq4repair_space>File:<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; BufferedReader br = null ; try { SnomedLoader . logger . info ( "Truncating<seq2seq4repair_space>SnomedModel<seq2seq4repair_space>Datastore..." ) ; VocabularyRepository . truncateModel ( dbConnection , SnomedModel . class ) ; SnomedLoader . logger . info ( ( ( ( dbConnection . getName ( ) ) + ".SnomedModel<seq2seq4repair_space>Datastore<seq2seq4repair_space>Truncated...<seq2seq4repair_space>records<seq2seq4repair_space>remaining:<seq2seq4repair_space>" ) + ( VocabularyRepository . getRecordCount ( dbConnection , SnomedModel . class ) ) ) ) ; int count = 0 ; br = new BufferedReader ( new FileReader ( file ) ) ; String available ; while ( ( available = br . readLine ( ) ) != null ) { if ( ( count ++ ) == 0 ) { continue ; } else { String [ ] line = available . split ( "\t" ) ; SnomedModel model = dbConnection . newInstance ( SnomedModel . class ) ; <START_BUG> model . setCode ( line [ 0 ] . toUpperCase ( ) ) ; <END_BUG> model . setDisplayName ( line [ 2 ] . toUpperCase ( ) ) ; dbConnection . save ( model ) ; } } VocabularyRepository . updateIndexProperties ( dbConnection , SnomedModel . class ) ; SnomedLoader . logger . info ( ( "SnomedModel<seq2seq4repair_space>Loading<seq2seq4repair_space>complete...<seq2seq4repair_space>records<seq2seq4repair_space>existing:<seq2seq4repair_space>" + ( VocabularyRepository . getRecordCount ( dbConnection , SnomedModel . class ) ) ) ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { if ( br != null ) { try { br . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } Runtime r = Runtime . getRuntime ( ) ; r . gc ( ) ; } } public String getCodeName ( ) { } public String getCodeSystem ( ) { } }

Fix:
model . setCode ( line [ 4 ] . toUpperCase ( ) ) ;
Buggy code:
public class SplashScreenFragment extends BaseFacebookHandlerFragment { View mCurrentView = null ; NotesManager mNotesManager = null ; NotesRepository mNotesRepository = null ; TextView mSplashScreenTextView = null ; Time startupTime = new Time ( ) ; int splashScreenShowTimeMillis = 1 * 1000 ; public SplashScreenFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } private void logAndShowOnScreen ( String logText ) { } public void loadNotes ( Activity activity , final String userName ) { } protected void onSessionStateChange ( Session session , SessionState state , Exception exception ) { if ( ( session != null ) && ( session . isOpened ( ) ) ) { logAndShowOnScreen ( "\nLogged<seq2seq4repair_space>in.<seq2seq4repair_space>Getting<seq2seq4repair_space>user<seq2seq4repair_space>details." ) ; Request request = Request . newMeRequest ( session , new Request . GraphUserCallback ( ) { @ Override public void onCompleted ( GraphUser user , Response response ) { if ( user != null ) { System . out . println ( ( "onSessionStateChange:<seq2seq4repair_space>LoadNotes:<seq2seq4repair_space>session<seq2seq4repair_space>is<seq2seq4repair_space>open.<seq2seq4repair_space>username:" + ( user . getName ( ) ) ) ) ; <START_BUG> loadNotes ( getActivity ( ) , getLoggedInUsername ( ) ) ; <END_BUG> } } } ) ; Request . executeBatchAsync ( request ) ; } else { logAndShowOnScreen ( "\nUser<seq2seq4repair_space>not<seq2seq4repair_space>already<seq2seq4repair_space>logged<seq2seq4repair_space>in." ) ; System . out . println ( "onSessionStateChange:<seq2seq4repair_space>LoadNotes:<seq2seq4repair_space>session<seq2seq4repair_space>was<seq2seq4repair_space>closed." ) ; loadNotes ( getActivity ( ) , getLoggedInUsername ( ) ) ; } } private void launchMainActivity ( ) { } public static void LaunchMainActivity ( Activity currentActivity , Fragment currentFragment ) { } No newline ; at end ; of file ; }

Fix:
loadNotes ( getActivity ( ) , user . getId ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class StatelessBeanTestCase { private static final Logger log = Logger . getLogger ( StatelessBeanTestCase . class . getName ( ) ) ; @ Deployment public static JavaArchive createDeployment ( ) { } @ EJB ( mappedName = "java:global//ejb3-slsb-example//SimpleStatelessSessionBean!org.jboss.as.demos.ejb3.archive.SimpleStatelessSessionLocal" ) private SimpleStatelessSessionLocal localBean ; @ Test public void testSLSB ( ) throws Exception { String message = "Zzzzzzzz.....!" ; String echo = localBean . echo ( message ) ; <START_BUG> String expectedEcho = ( ( ( ( ( ( SimpleInterceptor . class . getSimpleName ( ) ) + "#" ) + ( SimpleStatelessSessionBean . class . getSimpleName ( ) ) ) + "#" ) + "Echo<seq2seq4repair_space>" ) + message ) + "<seq2seq4repair_space>--<seq2seq4repair_space>(1:Other,<seq2seq4repair_space>2:Other,<seq2seq4repair_space>3:Other)" ; <END_BUG> Assert . assertEquals ( "Unexpected<seq2seq4repair_space>echo<seq2seq4repair_space>message<seq2seq4repair_space>received<seq2seq4repair_space>from<seq2seq4repair_space>stateless<seq2seq4repair_space>bean" , expectedEcho , echo ) ; } }

Fix:
String expectedEcho = ( ( ( ( ( ( SimpleInterceptor . class . getName ( ) ) + "#" ) + ( SimpleStatelessSessionBean . class . getName ( ) ) ) + "#" ) + "Echo<seq2seq4repair_space>" ) + message ) + "<seq2seq4repair_space>--<seq2seq4repair_space>(1:Other,<seq2seq4repair_space>2:Other,<seq2seq4repair_space>3:Other)" ;
Buggy code:
public class MarkMessageAsHamAction extends AbstractColumbaAction implements SelectionListener { public MarkMessageAsHamAction ( FrameMediator frameMediator ) { } public void selectionChanged ( SelectionChangedEvent e ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ; <END_BUG> processor . addOp ( new MarkMessageAsHamCommand ( r ) ) ; } }

Fix:
FolderCommandReference r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class RrdtoolDataSource implements JRDataSource { private int m_currentRow = - 1 ; private Xport m_data ; public RrdtoolDataSource ( Xport data ) { } @ Override public Object getFieldValue ( JRField field ) throws JRException { if ( "Timestamp" . equalsIgnoreCase ( getColumnName ( field ) ) ) { long ts = ( new Long ( m_data . getData ( ) . getRow ( m_currentRow ) . getT ( ) . getContent ( ) ) ) * 1000L ; return new Date ( ts ) ; } else if ( "Step" . equalsIgnoreCase ( getColumnName ( field ) ) ) { <START_BUG> return Integer . valueOf ( m_data . getMeta ( ) . getStep ( ) . getContent ( ) ) ; <END_BUG> } int index = getColumnIndex ( field ) ; return new Double ( m_data . getData ( ) . getRow ( m_currentRow ) . getV ( index ) . getContent ( ) ) ; } private String getColumnName ( JRField field ) { } @ Override public boolean next ( ) throws JRException { } private int getColumnIndex ( JRField field ) { } }

Fix:
return Long . valueOf ( m_data . getMeta ( ) . getStep ( ) . getContent ( ) ) ;
Buggy code:
public class PropPanelDiagram extends PropPanel { public PropPanelDiagram ( ) { } public void removeElement ( ) { Object target = getTarget ( ) ; if ( target instanceof ArgoDiagram ) { try { ArgoDiagram diagram = ( ( ArgoDiagram ) ( target ) ) ; <START_BUG> Project project = TheInstance . getProject ( ) ; <END_BUG> Object newTarget = project . getModel ( ) ; project . moveToTrash ( diagram ) ; navigateTo ( newTarget ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } protected boolean isAcceptibleBaseMetaClass ( String baseClass ) { } }

Fix:
Project project = ProjectManager . getManager ( ) . getCurrentProject ( ) ;
Buggy code:
public final class Rectangle implements SerializableCompatibility { public int x ; public int y ; public int width ; public int height ; static final long serialVersionUID = 3256439218279428914L ; public Rectangle ( int x , int y , int width , int height ) { } public void add ( Rectangle rect ) { } public boolean contains ( int x , int y ) { <START_BUG> return ( ( ( x >= ( this . x ) ) && ( y >= ( this . y ) ) ) && ( ( x - ( this . x ) ) < ( width ) ) ) && ( ( y - ( this . y ) ) < ( height ) ) ; <END_BUG> } public boolean contains ( Point pt ) { } public boolean equals ( Object object ) { } public int hashCode ( ) { } public void intersect ( Rectangle rect ) { } public Rectangle intersection ( Rectangle rect ) { } public boolean intersects ( int x , int y , int width , int height ) { } public boolean intersects ( Rectangle rect ) { } public boolean isEmpty ( ) { } public String toString ( ) { } public Rectangle union ( Rectangle rect ) { } }

Fix:
return ( ( ( x >= ( this . x ) ) && ( y >= ( this . y ) ) ) && ( x < ( ( this . x ) + ( width ) ) ) ) && ( y < ( ( this . y ) + ( height ) ) ) ;
Buggy code:
public class UdpConnection extends SelectionKeyHandler { private static Logger logger_ = Logger . getLogger ( UdpConnection . class ) ; private static final int BUFFER_SIZE = 4096 ; private static final int protocol_ = 195935983 ; private DatagramChannel socketChannel_ ; private SelectionKey key_ ; private EndPoint localEndPoint_ ; public void init ( ) throws IOException { } public void init ( int port ) throws IOException { } public boolean write ( Message message , EndPoint to ) throws IOException { boolean bVal = true ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; Message . serializer ( ) . serialize ( message , dos ) ; byte [ ] data = bos . toByteArray ( ) ; if ( ( data . length ) > 0 ) { <START_BUG> UdpConnection . logger_ . debug ( ( "Size<seq2seq4repair_space>of<seq2seq4repair_space>Gossip<seq2seq4repair_space>packet<seq2seq4repair_space>" + ( data . length ) ) ) ; <END_BUG> byte [ ] protocol = BasicUtilities . intToByteArray ( UdpConnection . protocol_ ) ; ByteBuffer buffer = ByteBuffer . allocate ( ( ( data . length ) + ( protocol . length ) ) ) ; buffer . put ( protocol ) ; buffer . put ( data ) ; buffer . flip ( ) ; int n = socketChannel_ . send ( buffer , to . getInetAddress ( ) ) ; if ( n == 0 ) { bVal = false ; } } return bVal ; } void close ( ) { } public DatagramChannel getDatagramChannel ( ) { } private byte [ ] gobbleHeaderAndExtractBody ( ByteBuffer buffer ) { } public void read ( SelectionKey key ) { } }

Fix:
UdpConnection . logger_ . trace ( ( "Size<seq2seq4repair_space>of<seq2seq4repair_space>Gossip<seq2seq4repair_space>packet<seq2seq4repair_space>" + ( data . length ) ) ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { EditText examNameEditText ; EditText dateOfExamEditText ; EditText hourOfExamEditText ; EditText numberOfHoursEditText ; private static final int RESULT_SETTINGS = 1 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void setDatePicker ( ) { } private void setHourPicker ( ) { } private void updateTimeLabel ( Calendar myCalendar ) { } private void updateDateLabel ( Calendar myCalendar ) { } public static class PlaceholderFragment extends Fragment { public PlaceholderFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } } public void addEvent ( View view ) { ScheduleManager scheduleManager = new ScheduleManager ( getContentResolver ( ) ) ; DateFormat dateFormat = new SimpleDateFormat ( "dd//MM//yy-HH:mm" , Locale . getDefault ( ) ) ; try { String examName = examNameEditText . getText ( ) . toString ( ) ; String numberOfHoursString = numberOfHoursEditText . getText ( ) . toString ( ) ; if ( ( examName . isEmpty ( ) ) || ( numberOfHoursString . isEmpty ( ) ) ) throw new Exception ( ) ; int hoursOfStudy = Integer . valueOf ( numberOfHoursString ) ; String dateString = ( ( dateOfExamEditText . getText ( ) . toString ( ) ) + "-" ) + ( hourOfExamEditText . getText ( ) . toString ( ) ) ; Date date = dateFormat . parse ( dateString ) ; Calendar calendar = new GregorianCalendar ( ) ; calendar . setTime ( date ) ; long eventID = scheduleManager . addExam ( examName , calendar , hoursOfStudy ) ; <START_BUG> Intent i = new Intent ( getApplicationContext ( ) , ListActivity . class ) ; <END_BUG> startActivity ( i ) ; this . clearAllFields ( ) ; } catch ( Exception e ) { Context context = getApplicationContext ( ) ; CharSequence text = "All<seq2seq4repair_space>fields<seq2seq4repair_space>are<seq2seq4repair_space>required" ; int duration = Toast . LENGTH_SHORT ; Toast toast = Toast . makeText ( context , text , duration ) ; toast . setGravity ( CENTER_VERTICAL , 0 , 0 ) ; toast . show ( ) ; } } private void clearAllFields ( ) { } }

Fix:
Intent i = new Intent ( getApplicationContext ( ) , ExamsActivity . class ) ;
Buggy code:
public class SWPTest extends TestCase { private String password ; public SWPTest ( String testName ) { } public static Test suite ( ) { } public void setUp ( ) throws Exception { } public void tearDown ( ) throws Exception { } public void testSWP_NO_FP_AES ( ) { } public void testSWP_NO_FP_FNR ( ) { System . out . println ( "Test<seq2seq4repair_space>FNR<seq2seq4repair_space>Searchable<seq2seq4repair_space>String<seq2seq4repair_space>" ) ; double loadFactor = 1 ; try { <START_BUG> String givenText = "Hello<seq2seq4repair_space>" ; <END_BUG> byte [ ] plainBytes = FNRUtils . rankIPAddress ( givenText ) ; SWP swp = new SWP ( SSEUtil . getSecretKeySpec ( password , SSEUtil . getRandomBytes ( 20 ) ) , "FNR" , loadFactor , ( ( plainBytes . length ) * ( Byte . SIZE ) ) ) ; byte [ ] cipherBytes = swp . encrypt ( plainBytes , 1 ) ; if ( ( cipherBytes . length ) == ( 2 * ( SWP . BLOCK_BYTES ) ) ) assertTrue ( "Additional<seq2seq4repair_space>Storage" , true ) ; else assertTrue ( "Strange" , false ) ; byte [ ] decryptBytes = swp . decrypt ( cipherBytes , 1 ) ; if ( Arrays . equals ( plainBytes , decryptBytes ) ) assertTrue ( "Encryption<seq2seq4repair_space>and<seq2seq4repair_space>Decryption<seq2seq4repair_space>works<seq2seq4repair_space>!" , true ) ; else assertTrue ( "Failed" , false ) ; byte [ ] trapDoor = swp . getTrapDoor ( plainBytes ) ; if ( swp . isMatch ( trapDoor , cipherBytes ) ) assertTrue ( "Matching<seq2seq4repair_space>works<seq2seq4repair_space>Blind-foldedly<seq2seq4repair_space>!" , true ) ; else assertTrue ( "Matching<seq2seq4repair_space>Does<seq2seq4repair_space>not<seq2seq4repair_space>work<seq2seq4repair_space>!" , false ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; assertTrue ( ( "Something<seq2seq4repair_space>went<seq2seq4repair_space>wrong<seq2seq4repair_space>..<seq2seq4repair_space>some<seq2seq4repair_space>where<seq2seq4repair_space>!!!<seq2seq4repair_space>.." + ( e . getMessage ( ) ) ) , false ) ; } } public void testSWP_NO_FP_FNR_IP ( ) { } public void testSWP_NO_ADD_STORAGE_AES ( ) { } public void testSWP_NO_ADD_STORAGE_FNR ( ) { } public void testSWP_NO_ADD_STORAGE_FNR_IP ( ) { } public void testLoadFactor ( ) { } }

Fix:
String givenText = "192.168.1.1" ;
Buggy code:
public class PCEPObjectParserTest { private TlvRegistry tlvRegistry ; private VendorInformationTlvRegistry viTlvRegistry ; @ Before public void setUp ( ) throws Exception { } @ Test public void testOpenObjectWithTLV ( ) throws IOException , PCEPDeserializerException { } @ Test public void testLspObjectWithTLV ( ) throws IOException , PCEPDeserializerException { } @ Test public void testStateful07LspObjectWithTlv ( ) throws IOException , PCEPDeserializerException { } @ Test public void testLspaObject ( ) throws IOException , PCEPDeserializerException { } @ Test public void testSrpObject ( ) throws IOException , PCEPDeserializerException { } @ Test public void testSRPObjectWithPSTTlv ( ) throws PCEPDeserializerException { <START_BUG> final byte [ ] srpObjectWithPstTlvBytes = new byte [ ] { 33 , 16 , 0 , 20 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 27 , 0 , 4 , 0 , 0 , 0 , 0 } ; <END_BUG> final CInitiated00SrpObjectParser parser = new CInitiated00SrpObjectParser ( this . tlvRegistry , this . viTlvRegistry ) ; SrpBuilder builder = new SrpBuilder ( ) ; builder . setProcessingRule ( false ) ; builder . setIgnore ( false ) ; builder . setOperationId ( new SrpIdNumber ( 1L ) ) ; builder . addAugmentation ( Srp1 . class , new Srp1Builder ( ) . setRemove ( true ) . build ( ) ) ; builder . setTlvs ( new TlvsBuilder ( ) . setPathSetupType ( new PathSetupTypeBuilder ( ) . setPst ( ( ( short ) ( 0 ) ) ) . build ( ) ) . build ( ) ) ; final ByteBuf result = Unpooled . wrappedBuffer ( srpObjectWithPstTlvBytes ) ; assertEquals ( builder . build ( ) , parser . parseObject ( new ObjectHeaderImpl ( false , false ) , result . slice ( 4 , ( ( result . readableBytes ( ) ) - 4 ) ) ) ) ; final ByteBuf buf = Unpooled . buffer ( ) ; parser . serializeObject ( builder . build ( ) , buf ) ; assertArrayEquals ( srpObjectWithPstTlvBytes , ByteArray . getAllBytes ( buf ) ) ; } }

Fix:
final byte [ ] srpObjectWithPstTlvBytes = new byte [ ] { 33 , 16 , 0 , 20 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 28 , 0 , 4 , 0 , 0 , 0 , 0 } ;
Buggy code:
public class ValidateSubsystemExtension implements Extension { public static final String NAMESPACE = "urn:mycompany:mysubsystem:1.0" ; public static final String SUBSYSTEM_NAME = "mysubsystem" ; private final ValidateSubsystemExtension . SubsystemParser parser = new ValidateSubsystemExtension . SubsystemParser ( ) ; private volatile DescriptionProvider addDescriptionProvider ; public void setAddDescriptionProvider ( DescriptionProvider addDescriptionProvider ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public void initialize ( ExtensionContext context ) { } 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 ValidateSubsystemExtension . SubsystemDescribeHandler INSTANCE = new ValidateSubsystemExtension . SubsystemDescribeHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . add ( ValidateSubsystemExtension . createAddSubsystemOperation ( ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class SimpleSecurityManager implements ServerSecurityManager { private ThreadLocalStack < SecurityContext > contexts = new ThreadLocalStack < SecurityContext > ( ) ; private ISecurityManagement securityManagement = null ; private PrivilegedAction < SecurityContext > securityContext ( ) { } private SecurityContext establishSecurityContext ( final String securityDomain ) { } public void setSecurityManagement ( ISecurityManagement iSecurityManagement ) { } public Principal getCallerPrincipal ( ) { } public Subject getSubject ( ) { } private Principal getPrincipal ( Subject subject ) { } public boolean isCallerInRole ( final Object incommingMappedRoles , final Map < String , Collection < String > > roleLinks , final String ... roleNames ) { } public boolean authorize ( String ejbName , CodeSource ejbCodeSource , String ejbMethodIntf , Method ejbMethod , Set < Principal > methodRoles , String contextID ) { } public void push ( final String securityDomain ) { } public void push ( final String securityDomain , String userName , char [ ] password , final Subject subject ) { } public void authenticate ( ) { } public void authenticate ( final String runAs , final String runAsPrincipal , final Set < String > extraRoles ) { } private boolean authenticate ( SecurityContext context , Subject subject ) { } private Identity getUnauthenticatedIdentity ( ) { } public void pop ( ) { } private Set < String > getRoleAliases ( final String roleName , final Map < String , Collection < String > > roleLinks ) { } private void audit ( String level , AuditManager auditManager , Principal userPrincipal ) { AuditEvent auditEvent = new AuditEvent ( AuditLevel . SUCCESS ) ; Map < String , Object > ctxMap = new HashMap < String , Object > ( ) ; <START_BUG> ctxMap . put ( "principal" , ( userPrincipal != null ? userPrincipal : "null" ) ) ; <END_BUG> ctxMap . put ( "Source" , getClass ( ) . getCanonicalName ( ) ) ; ctxMap . put ( "Action" , "authentication" ) ; auditEvent . setContextMap ( ctxMap ) ; auditManager . audit ( auditEvent ) ; } }

Fix:
ctxMap . put ( "principal" , ( userPrincipal != null ? userPrincipal . getName ( ) : "null" ) ) ;
Buggy code:
public class Authorization extends AbstractTestElement implements Serializable { private static final long serialVersionUID = 241L ; private static final String URL = "Authorization.url" ; private static final String USERNAME = "Authorization.username" ; private static final String PASSWORD = "Authorization.password" ; private static final String DOMAIN = "Authorization.domain" ; private static final String REALM = "Authorization.realm" ; private static final String MECHANISM = "Authorization.mechanism" ; private static final String TAB = "\t" ; Authorization ( String url , String user , String pass , String domain , String realm , Mechanism mechanism ) { } public boolean expectsModification ( ) { } public Authorization ( ) { } public void addConfigElement ( ConfigElement config ) { } public String getURL ( ) { } public void setURL ( String url ) { } public String getUser ( ) { } public void setUser ( String user ) { } public String getPass ( ) { } public void setPass ( String pass ) { } public String getDomain ( ) { } public void setDomain ( String domain ) { } public String getRealm ( ) { } public void setRealm ( String realm ) { } public Mechanism getMechanism ( ) { } public void setMechanism ( Mechanism mechanism ) { <START_BUG> setProperty ( Authorization . MECHANISM , mechanism . toString ( ) ) ; <END_BUG> } @ Override public String toString ( ) { } public String toBasicHeader ( ) { } }

Fix:
setProperty ( Authorization . MECHANISM , mechanism . name ( ) , BASIC_DIGEST . name ( ) ) ;
Buggy code:
public class ChessServer { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; Game g = new Game ( ) ; g . draw ( ) ; while ( true ) { String cmd = in . nextLine ( ) ; String [ ] a = cmd . split ( "<seq2seq4repair_space>" ) ; <START_BUG> if ( a [ 0 ] . equals ( "move" ) ) { <END_BUG> g . movePiece ( ChessServer . convertCMDcoordinates ( a [ 1 ] ) , ChessServer . convertCMDcoordinates ( a [ 2 ] ) ) ; } else if ( a [ 0 ] . equals ( "exit" ) ) { return ; } g . draw ( ) ; } } public static Vector2 convertCMDcoordinates ( String cmd ) { } }

Fix:
if ( ( ( a [ 0 ] . equals ( "move" ) ) || ( a [ 0 ] . equals ( "mv" ) ) ) && ( ( a . length ) == 3 ) ) {