nus-yam/ex-repair huggingface dataset:
Buggy code:
public class XPathPanel extends JPanel { private static final long serialVersionUID = 240L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private JCheckBox negated ; private JSyntaxTextArea xpath ; private JButton checkXPath ; public XPathPanel ( ) { } private void init ( ) { } public void setDefaultValues ( ) { } public String getXPath ( ) { } public void setXPath ( String xpath ) { <START_BUG> this . xpath . setText ( xpath ) ; <END_BUG> } public boolean isNegated ( ) { } public void setNegated ( boolean negated ) { } public JCheckBox getNegatedCheckBox ( ) { } public JButton getCheckXPathButton ( ) { } public JSyntaxTextArea getXPathField ( ) { } public boolean isShowNegated ( ) { } public void setShowNegated ( boolean showNegate ) { } public static boolean validXPath ( String xpathString , boolean showDialog ) { } }

Fix:
this . xpath . setInitialText ( xpath ) ;
Buggy code:
public class BiblioParser { public static void extract ( int nBiblios ) { for ( int i = 1 ; i <= nBiblios ; i ++ ) { try { <START_BUG> File biblio = new File ( ( ( Outputs . BASE_PATH ) + ( String . format ( "biblio101_%s.txt" , i ) ) ) ) ; <END_BUG> String xmlPath = ( Inputs . BIBLIO_PATH ) + ( String . format ( "biblio101_%s.xml" , i ) ) ; BiblioParser . extractAUandWC ( xmlPath , ";" , RELATION_FILE ) ; BiblioParser . extractAB ( xmlPath , biblio ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } private static void extractAUandWC ( String path , String sep , File out ) throws IOException { } private static void extractAB ( String path , File out ) throws IOException { } private static List < String > extractTag ( String tag , String lines , String sep ) { } private static Matcher getTagMatcher ( String tag , String input ) { } No newline ; at end ; of file ; }

Fix:
File biblio = new File ( ( ( Outputs . ABSTRACT_PATH ) + ( String . format ( "biblio101_%s.txt" , i ) ) ) ) ;
Buggy code:
public class CookieManager extends ConfigTestElement implements Serializable , TestListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String CLEAR = "CookieManager.clearEachIteration" ; public static final String COOKIES = "CookieManager.cookies" ; public static final String POLICY = "CookieManager.policy" ; private static final String TAB = "\t" ; private static final boolean DELETE_NULL_COOKIES = JMeterUtils . getPropDefault ( "CookieManager.delete_null_cookies" , true ) ; private static final boolean ALLOW_VARIABLE_COOKIES = JMeterUtils . getPropDefault ( "CookieManager.allow_variable_cookies" , true ) ; private transient CookieSpec cookieSpec ; private transient CollectionProperty initialCookies ; public static final String DEFAULT_POLICY = CookiePolicy . BROWSER_COMPATIBILITY ; public CookieManager ( ) { } public Object clone ( ) { } public String getPolicy ( ) { } public void setCookiePolicy ( String policy ) { } public CollectionProperty getCookies ( ) { } public int getCookieCount ( ) { } public boolean getClearEachIteration ( ) { } public void setClearEachIteration ( boolean clear ) { } public void save ( String authFile ) throws IOException { } public void addFile ( String cookieFile ) throws IOException { } private String cookieToString ( Cookie c ) { } public void recoverRunningVersion ( ) { } public void setRunningVersion ( boolean running ) { } public void add ( Cookie c ) { } public void clear ( ) { } private void clearCookies ( ) { } public void remove ( int index ) { } public Cookie get ( int i ) { } private org . apache . commons . httpclient . Cookie makeCookie ( Cookie jmc ) { } public org . apache . commons . httpclient . Cookie [ ] getCookiesForUrl ( URL url ) { } public String getCookieHeaderForURL ( URL url ) { } public void addCookieFromHeader ( String cookieHeader , URL url ) { } private boolean match ( Cookie a , Cookie b ) { } private void removeMatchingCookies ( Cookie newCookie ) { } public String getClassLabel ( ) { } public void testStarted ( ) { } public void testEnded ( ) { } public void testStarted ( String host ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { if ( getClearEachIteration ( ) ) { clearCookies ( ) ; <START_BUG> setProperty ( initialCookies ) ; <END_BUG> } } }

Fix:
setProperty ( ( ( CollectionProperty ) ( initialCookies . clone ( ) ) ) ) ;
Buggy code:
public class TestWiktionary { private static final String PATH_TO_DUMP_FILE = "//Users//swalter//Downloads//" ; private static final String TARGET_DIRECTORY = "//Users//swalter//Desktop//Wiktionary//English" ; private static final boolean OVERWRITE_EXISTING_FILES = true ; public static void main ( String [ ] args ) throws Exception { IWiktionaryEdition wkt = JWKTL . openEdition ( new File ( TestWiktionary . TARGET_DIRECTORY ) ) ; <START_BUG> for ( IWiktionaryEntry entry : wkt . getEntriesForWord ( "wife" , true ) ) { <END_BUG> String etymology = "" ; String word = entry . getWord ( ) ; String part_of_speech = entry . getPartOfSpeech ( ) . toString ( ) ; String language = entry . getWordLanguage ( ) . getISO639_1 ( ) . toString ( ) ; try { etymology = entry . getWordEtymology ( ) . toString ( ) ; } catch ( Exception e ) { } String entry_header = entry . getHeader ( ) . toString ( ) ; System . out . println ( ( ( ( ( ( ( ( ( ( "<seq2seq4repair_space>" + word ) + "//" ) + part_of_speech ) + "//" ) + language ) + "//" ) + etymology ) + "//" ) + entry_header ) ) ; System . out . println ( "-----" ) ; } } }

Fix:
for ( IWiktionaryEntry entry : wkt . getEntriesForWord ( "married" , true ) ) {
Buggy code:
public class Recorder extends Task { private static Hashtable recorderEntries = new Hashtable ( ) ; private String filename = null ; private Boolean append = null ; private Boolean start = null ; private int loglevel = - 1 ; public void setAction ( Recorder . ActionChoices action ) { } public void setAppend ( boolean append ) { } public void setLoglevel ( Recorder . VerbosityLevelChoices level ) { } public void setName ( String fname ) { } public void execute ( ) throws TaskException { if ( ( filename ) == null ) throw new TaskException ( "No<seq2seq4repair_space>filename<seq2seq4repair_space>specified" ) ; <START_BUG> getProject ( ) . log ( ( "setting<seq2seq4repair_space>a<seq2seq4repair_space>recorder<seq2seq4repair_space>for<seq2seq4repair_space>name<seq2seq4repair_space>" + ( filename ) ) , MSG_DEBUG ) ; <END_BUG> RecorderEntry recorder = getRecorder ( filename , getProject ( ) ) ; recorder . setMessageOutputLevel ( loglevel ) ; recorder . setRecordState ( start ) ; } protected RecorderEntry getRecorder ( String name , Project proj ) throws TaskException { } public static class ActionChoices extends EnumeratedAttribute { private static final String [ ] values = new String [ ] { "start" , "stop" } ; public String [ ] getValues ( ) { } } public static class VerbosityLevelChoices extends EnumeratedAttribute { private static final String [ ] values = new String [ ] { "error" , "warn" , "info" , "verbose" , "debug" } ; public String [ ] getValues ( ) { } } }

Fix:
log ( ( "setting<seq2seq4repair_space>a<seq2seq4repair_space>recorder<seq2seq4repair_space>for<seq2seq4repair_space>name<seq2seq4repair_space>" + ( filename ) ) , MSG_DEBUG ) ;
Buggy code:
public class TLSSyslogServer extends TCPSyslogServer { private static final Logger LOGGER = Logger . getLogger ( TLSSyslogServer . class ) ; private SSLContext sslContext ; @ Override public void initialize ( ) throws SyslogRuntimeException { super . initialize ( ) ; Security . removeProvider ( "BC" ) ; final SSLTCPNetSyslogServerConfigIF config = ( ( SSLTCPNetSyslogServerConfigIF ) ( this . tcpNetSyslogServerConfig ) ) ; try { final char [ ] keystorePwd = config . getKeyStorePassword ( ) . toCharArray ( ) ; final KeyStore keystore = TLSSyslogServer . loadKeyStore ( config . getKeyStore ( ) , keystorePwd ) ; final char [ ] truststorePassword = config . getTrustStorePassword ( ) . toCharArray ( ) ; final KeyStore truststore = TLSSyslogServer . loadKeyStore ( config . getTrustStore ( ) , truststorePassword ) ; final KeyManagerFactory keyManagerFactory = KeyManagerFactory . getInstance ( KeyManagerFactory . getDefaultAlgorithm ( ) ) ; keyManagerFactory . init ( keystore , keystorePwd ) ; final TrustManagerFactory trustManagerFactory = TrustManagerFactory . getInstance ( TrustManagerFactory . getDefaultAlgorithm ( ) ) ; trustManagerFactory . init ( truststore ) ; sslContext = SSLContext . getInstance ( "TLS" ) ; sslContext . init ( keyManagerFactory . getKeyManagers ( ) , trustManagerFactory . getTrustManagers ( ) , null ) ; } catch ( Exception e ) { <START_BUG> TLSSyslogServer . LOGGER . error ( "Exception<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>SSLContext<seq2seq4repair_space>for<seq2seq4repair_space>TLS<seq2seq4repair_space>syslog<seq2seq4repair_space>server<seq2seq4repair_space>initialization" , e ) ; <END_BUG> throw new SyslogRuntimeException ( e ) ; } } @ Override protected ServerSocketFactory getServerSocketFactory ( ) throws IOException { } private static KeyStore loadKeyStore ( final String keystoreFile , final char [ ] keystorePwd ) throws IOException , KeyStoreException , NoSuchAlgorithmException , CertificateException { } }

Fix:
TLSSyslogServer . LOGGER . error ( "Exception<seq2seq4repair_space>occured<seq2seq4repair_space>during<seq2seq4repair_space>SSLContext<seq2seq4repair_space>for<seq2seq4repair_space>TLS<seq2seq4repair_space>syslog<seq2seq4repair_space>server<seq2seq4repair_space>initialization" , e ) ;
Buggy code:
public class Main extends Application { final int numevents = 7 ; Group allBoxes = new Group ( ) ; ComboBox pickMatches ; Keyboard mainKeyboard ; boolean [ ] eventTypes ; ImageView spinning ; int songTempo ; String eventFilter ; TextField inTempo ; ArrayList < Match > matches ; ObservableList < Long > matchIds ; boolean callingAPI ; public void initBoxes ( ) { } public void initKeyboard ( ) { } public void spinDisk ( ) { Timeline n = new Timeline ( ) ; n . setCycleCount ( 10 ) ; n . setAutoReverse ( false ) ; n . getKeyFrames ( ) . add ( new KeyFrame ( Duration . millis ( 2000 ) , new KeyValue ( spinning . rotateProperty ( ) , 360 ) ) ) ; <START_BUG> n . play ( ) ; <END_BUG> } @ Override public void start ( Stage primaryStage ) { } public static void main ( String [ ] args ) { } class PlaySongConcept implements Runnable { int sound = 0 ; @ Override public void run ( ) { } } class PlaySong implements Runnable { int sound = 1 ; @ Override public void run ( ) { } } public void getMatch ( long matchId ) { } public void getMatch ( int index ) { } public void getMatchIds ( long time ) { } public void getMatchIds ( ) { } public void recievedMatch ( Match match ) { } public void recievedMatchIds ( ArrayList < Long > ids ) { } class GetMatchInfo implements Runnable { public URL url ; public GetMatchInfo ( String url ) { } @ Override public void run ( ) { } } class GetIds implements Runnable { URL url ; public GetIds ( String url ) { } @ Override public void run ( ) { } } }

Fix:
n . playFromStart ( ) ;
Buggy code:
@ Test ( groups = "unit" ) public class IMachineToImageTest { @ Test public void testConvert ( ) throws Exception { VirtualBoxManager vbm = createNiceMock ( VirtualBoxManager . class ) ; IVirtualBox vBox = createNiceMock ( IVirtualBox . class ) ; IMachine vm = createNiceMock ( IMachine . class ) ; IGuestOSType guestOsType = createNiceMock ( IGuestOSType . class ) ; String linuxDescription = "Ubuntu<seq2seq4repair_space>10.04" ; expect ( vbm . getVBox ( ) ) . andReturn ( vBox ) . anyTimes ( ) ; expect ( vm . getOSTypeId ( ) ) . andReturn ( "os-type" ) . anyTimes ( ) ; expect ( vBox . getGuestOSType ( eq ( "os-type" ) ) ) . andReturn ( guestOsType ) ; expect ( vm . getDescription ( ) ) . andReturn ( "my-ubuntu-machine" ) . anyTimes ( ) ; expect ( guestOsType . getDescription ( ) ) . andReturn ( linuxDescription ) . anyTimes ( ) ; expect ( guestOsType . getIs64Bit ( ) ) . andReturn ( true ) ; replay ( vbm , vBox , vm , guestOsType ) ; IMachineToImage fn = new IMachineToImage ( vbm ) ; Image image = fn . apply ( vm ) ; assertEquals ( image . getDescription ( ) , "my-ubuntu-machine" ) ; assertEquals ( image . getOperatingSystem ( ) . getDescription ( ) , linuxDescription ) ; assertTrue ( image . getOperatingSystem ( ) . is64Bit ( ) ) ; <START_BUG> assertEquals ( image . getOperatingSystem ( ) . getFamily ( ) , UBUNTU ) ; <END_BUG> assertEquals ( image . getOperatingSystem ( ) . getVersion ( ) , "10.04" ) ; } @ Test public void testOsVersion ( ) throws Exception { } @ Test public void testUnparseableOsString ( ) throws Exception { } }

Fix:
assertEquals ( image . getOperatingSystem ( ) . getFamily ( ) , LINUX ) ;
Buggy code:
public class AsmElementFormatter { public static final String UNDEFINED = "<undefined>" ; public static final String DECLARE_PRECEDENCE = "precedence" ; public static final String DECLARE_SOFT = "soft" ; public static final String DECLARE_PARENTS = "parents" ; public static final String DECLARE_WARNING = "warning" ; public static final String DECLARE_ERROR = "error" ; public static final String DECLARE_UNKNONWN = "<unknown<seq2seq4repair_space>declare>" ; public static final String POINTCUT_ABSTRACT = "<abstract<seq2seq4repair_space>pointcut>" ; public static final String POINTCUT_ANONYMOUS = "<anonymous<seq2seq4repair_space>pointcut>" ; public static final String DOUBLE_DOTS = ".." ; public static final int MAX_MESSAGE_LENGTH = 18 ; public static final String DEC_LABEL = "declare" ; public void genLabelAndKind ( MethodDeclaration methodDeclaration , IProgramElement node ) { } private String genDecaLabel ( DeclareAnnotation deca ) { } private String genPrecedenceListLabel ( TypePatternList list ) { } public void setParameters ( AbstractMethodDeclaration md , IProgramElement pe ) { Argument [ ] argArray = md . arguments ; if ( argArray == null ) { pe . setParameterNames ( Collections . EMPTY_LIST ) ; pe . setParameterSignatures ( Collections . EMPTY_LIST ) ; } else { List names = new ArrayList ( ) ; List paramSigs = new ArrayList ( ) ; for ( int i = 0 ; i < ( argArray . length ) ; i ++ ) { String argName = new String ( argArray [ i ] . name ) ; if ( acceptArgument ( argName , argArray [ i ] . type . toString ( ) ) ) { TypeReference typeR = argArray [ i ] . type ; <START_BUG> if ( typeR != null ) { <END_BUG> TypeBinding typeB = typeR . resolvedType ; if ( typeB == null ) { typeB = typeR . resolveType ( md . scope ) ; } EclipseFactory factory = EclipseFactory . fromScopeLookupEnvironment ( md . scope ) ; UnresolvedType ut = factory . fromBinding ( typeB ) ; paramSigs . add ( ut . getSignature ( ) . toCharArray ( ) ) ; } names . add ( argName ) ; } } pe . setParameterNames ( names ) ; if ( ! ( paramSigs . isEmpty ( ) ) ) { pe . setParameterSignatures ( paramSigs ) ; } } } private boolean acceptArgument ( String name , String type ) { } public String genTypePatternLabel ( TypePattern tp ) { } public String genDeclareMessage ( String message ) { } private String translatePointcutName ( String name ) { } }

Fix:
if ( ( typeR != null ) && ( ( md . scope ) != null ) ) {
Buggy code:
public class MainActivity extends ActionBarActivity implements OnFragmentAttachedListener , SidebarListener , SessionListener , ProductGridListener { private Store store = Store . getInstance ( ) ; @ InjectView ( id . toolbar ) Toolbar toolbar ; @ InjectView ( id . drawer_layout ) DrawerLayout drawerLayout ; ActionBarDrawerToggle drawerToggle ; private SearchView searchView ; private SidebarFragment sidebar ; @ Override protected void onNewIntent ( Intent intent ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { super . onConfigurationChanged ( newConfig ) ; <START_BUG> setContentView ( activity_main ) ; <END_BUG> } @ Override protected void onStart ( ) { } @ Override protected void onResume ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onProductSelected ( Product product ) { } @ Override public void onSidebarHome ( ) { } @ Override public void onSidebarOrders ( ) { } @ Override public void onSidebarLogIn ( ) { } @ Override public void onSidebarCategory ( Section section , Category category ) { } private final OnQueryTextListener searchListener = new OnQueryTextListener ( ) { public boolean onQueryTextSubmit ( String queryText ) { } public boolean onQueryTextChange ( String queryText ) { } } ; void navTo ( NeonFragment fragment ) { } @ Override public void onLogin ( Session session ) { } @ Override public void onLogout ( ) { } public void onFragmentAttached ( NeonFragment sender ) { } private void resetSearchHint ( ) { } private void setSearchHint ( int res ) { } private void setSearchHint ( String hint ) { } }

Fix:
setContentView ( fragment_home ) ;
Buggy code:
public class PlayingFieldPanel extends JPanel { @ SuppressWarnings ( "unused" ) private static final Random _random = new Random ( System . currentTimeMillis ( ) ) ; private static final long serialVersionUID = - 8647279084154615455L ; private PlayingFieldPanel _self ; private BufferedImage _backgroundImg ; private double _snapTime ; private boolean _isDebugActive ; private IGameStateManager _stateManager ; private HashMap < Integer , Sprite > _sprites ; private ParticleSystem _particleSystem ; public PlayingFieldPanel ( int width , int height , IGameStateManager stateManager ) { } @ Override public void paintComponent ( Graphics g ) { } @ Override public void paintComponents ( Graphics g ) { } public void playerInit ( ) { } public void render ( Graphics g ) { } public void setDebugMode ( boolean active ) { } protected BufferedImage rotateImage ( BufferedImage src , double degrees ) { } protected AffineTransform rotateTransform ( BufferedImage src , double degrees ) { } private double getScaleX ( ) { } private double getScaleY ( ) { } private void init ( ) { this . addMouseListener ( new MouseAdapter ( ) { @ Override public void mousePressed ( MouseEvent e ) { _self . requestFocusInWindow ( ) ; } } ) ; this . addComponentListener ( new ComponentAdapter ( ) { @ Override public void componentResized ( ComponentEvent e ) { _self . repaint ( ) ; } } ) ; this . setLayout ( null ) ; this . setBackground ( Color . BLACK ) ; <START_BUG> _isDebugActive = true ; <END_BUG> } private void invokeExplosion ( double x , double y ) { } private void paintBars ( Graphics2D g2d , SpaceShip d ) { } private void removeOutdatedSprites ( ) { } private void showDebugInfo ( Graphics2D g2d , SpaceShip pl ) { } private void updateSprites ( ) { } public void stopThreads ( ) { } public void startThreads ( ) { } }

Fix:
_isDebugActive = false ;
Buggy code:
public class PredIsStartState implements Predicate { public static PredIsStartState TheInstance = new PredIsStartState ( ) ; private PredIsStartState ( ) { } public boolean predicate ( Object obj ) { <START_BUG> return ( obj instanceof Pseudostate ) && ( ( ( ( Pseudostate ) ( obj ) ) . getKind ( ) ) == ( PseudostateKind . INITIAL ) ) ; <END_BUG> } }

Fix:
return ( obj instanceof Pseudostate ) && ( INITIAL . equals ( ( ( Pseudostate ) ( obj ) ) . getKind ( ) ) ) ;
Buggy code:
public class WicketTesterHelper { public static class ComponentData implements Serializable { private static final long serialVersionUID = 1L ; public String path ; public String type ; public String value ; } public static List getComponentData ( final Page page ) { final List data = new ArrayList ( ) ; page . visitChildren ( new IVisitor ( ) { public Object component ( final Component component ) { final WicketTesterHelper . ComponentData object = new WicketTesterHelper . ComponentData ( ) ; String name = component . getClass ( ) . getName ( ) ; if ( ( name . indexOf ( "$" ) ) > 0 ) { name = component . getClass ( ) . getSuperclass ( ) . getName ( ) ; } <START_BUG> name = Strings . lastPathComponent ( name , ':' ) ; <END_BUG> object . path = component . getPageRelativePath ( ) ; object . type = name ; try { object . value = component . getModelObjectAsString ( ) ; } catch ( Exception e ) { object . value = e . getMessage ( ) ; } data . add ( object ) ; return IVisitor . CONTINUE_TRAVERSAL ; } } ) ; return data ; } public static void assertEquals ( final Collection expects , final Collection actuals ) { } public static void failWithVerboseMessage ( final Collection expects , final Collection actuals ) { } public static String asLined ( final Collection objects ) { } }

Fix:
name = Strings . lastPathComponent ( name , PATH_SEPARATOR ) ;
Buggy code:
public interface IJAXBClassProvider { public List < Class > getClasses ( ) { } public String getProviderName ( ) { } public static IJAXBClassProvider [ ] getJAXBProviders ( ) throws CoreException { Logger logger = LoggerFactory . getLogger ( IJAXBClassProvider . class ) ; IJAXBClassProvider [ ] jaxbProviders = null ; <START_BUG> String id = "org.eclipse.ice.item.itemBuilder" ; <END_BUG> IExtensionPoint point = Platform . getExtensionRegistry ( ) . getExtensionPoint ( id ) ; if ( point != null ) { IConfigurationElement [ ] elements = point . getConfigurationElements ( ) ; jaxbProviders = new IJAXBClassProvider [ elements . length ] ; for ( int i = 0 ; i < ( elements . length ) ; i ++ ) { jaxbProviders [ i ] = ( ( IJAXBClassProvider ) ( elements [ i ] . createExecutableExtension ( "class" ) ) ) ; } } else { logger . error ( ( ( "Extension<seq2seq4repair_space>Point<seq2seq4repair_space>" + id ) + "does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) ) ; } return jaxbProviders ; } }

Fix:
String id = "org.eclipse.ice.datastructures.jaxbClassProvider" ;
Buggy code:
public class TestPrefixRandom extends LuceneTestCase { private IndexSearcher searcher ; private IndexReader reader ; private Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random , MockTokenizer . KEYWORD , false ) ) . setMaxBufferedDocs ( _TestUtil . nextInt ( random , 50 , 1000 ) ) ) ; Document doc = new Document ( ) ; Field field = newField ( "field" , "" , TYPE_UNSTORED ) ; doc . add ( field ) ; final String codec = Codec . getDefault ( ) . getName ( ) ; int num = ( codec . equals ( "Lucene3x" ) ) ? 200 * ( RANDOM_MULTIPLIER ) : atLeast ( 1000 ) ; for ( int i = 0 ; i < num ; i ++ ) { <START_BUG> field . setValue ( _TestUtil . randomUnicodeString ( random , 10 ) ) ; <END_BUG> writer . addDocument ( doc ) ; } reader = writer . getReader ( ) ; searcher = newSearcher ( reader ) ; writer . close ( ) ; } @ Override public void tearDown ( ) throws Exception { } private class DumbPrefixQuery extends MultiTermQuery { private final BytesRef prefix ; DumbPrefixQuery ( Term term ) { } @ Override protected TermsEnum getTermsEnum ( Terms terms , AttributeSource atts ) throws IOException { } private class SimplePrefixTermsEnum extends FilteredTermsEnum { private final BytesRef prefix ; private SimplePrefixTermsEnum ( TermsEnum tenum , BytesRef prefix ) throws IOException { } @ Override protected AcceptStatus accept ( BytesRef term ) throws IOException { } } @ Override public String toString ( String field ) { } } public void testPrefixes ( ) throws Exception { } private void assertSame ( String prefix ) throws IOException { } }

Fix:
field . setStringValue ( _TestUtil . randomUnicodeString ( random , 10 ) ) ;
Buggy code:
@ Config ( constants = BuildConfig . class , sdk = 21 ) @ RunWith ( RobolectricGradleTestRunner . class ) public class TournamentTest { private SwissTournament t ; private List < HumanPlayer > players ; @ Rule public final ExpectedException thrown = ExpectedException . none ( ) ; @ Before public void setup ( ) { } private void startTournamentWithPlayers ( int number_of_players ) { } private void startRoundWithPlayers ( int number_of_players ) { t = new SwissTournament ( ) ; for ( int i = 0 ; i < number_of_players ; i ++ ) { t . addPlayer ( players . get ( i ) ) ; } assertTrue ( t . canStartTournament ( ) ) ; t . startTournament ( ) ; assertTrue ( t . isStarted ( ) ) ; assertTrue ( t . canStartNextRound ( ) ) ; try { t . startNextRound ( ) ; } catch ( Exception e ) { <START_BUG> e . printStackTrace ( ) ; <END_BUG> } Assert . assertFalse ( t . canStartNextRound ( ) ) ; } @ Test public void canCreateTournamentTest ( ) { } @ Test public void canAddPlayerTest ( ) { } @ Test public void canNotAddPlayersAfterTournamentStartTest ( ) { } @ Test public void canNotStartTournamentWithLessThanTwoPlayersTest ( ) { } @ Test public void canNotCallStartTournamentWithLessThanTwoPlayersTest ( ) { } @ Test public void canStartTournamentWithTwoOrMorePlayersTest ( ) { } @ Test public void canNotAddAPlayerTwiceTest ( ) { } @ Test public void canPlayOneRoundWithTwoPlayersTest ( ) { } @ Test public void canPlayOneRoundWithFourPlayersTest ( ) { } @ Test public void canNotCallStartNextRoundWhenResultsAreMissingTest ( ) { } @ Test public void canNotEnterResultsWhenRoundIsNotStartedTest ( ) { } @ Test public void canNotEnterNegativeResultsTest ( ) { } @ Test public void getMinPossibleRoundsWithPowerZeroTest ( ) { } @ Test public void getMinPossibleRoundsWithPowerOneTest ( ) { } @ Test public void getMinPossibleRoundsWithPowerTwoTest ( ) { } @ Test public void getMinPossibleRoundsWithPowerThreeTest ( ) { } @ Test public void getMinPossibleRoundsWithPowerFourTest ( ) { } @ Test public void getMinPossibleRoundsWithPowerFiveTest ( ) { } No newline ; at end ; of file ; }

Fix:
Assert . assertEquals ( null , e ) ;
Buggy code:
public abstract class AbstractExpressionBuilder { protected static final int EX_USER = 0 ; protected static final int EX_FATAL = 1 ; protected static final int EX_UNSUPPORTED = 2 ; protected static final Class TYPE_OBJECT = Object . class ; protected static final Class TYPE_STRING = String . class ; protected static final Class TYPE_CHAR_OBJ = Character . class ; protected static final Class TYPE_NUMBER = Number . class ; protected static final Class TYPE_COLLECTION = Collection . class ; protected static final Class TYPE_MAP = Map . class ; protected static final int CONTAINS_TYPE_ELEMENT = 1 ; protected static final int CONTAINS_TYPE_KEY = 2 ; protected static final int CONTAINS_TYPE_VALUE = 3 ; private static final Localizer _loc = Localizer . forPackage ( AbstractExpressionBuilder . class ) ; protected final Resolver resolver ; protected ExpressionFactory factory ; private final Set _accessPath = new HashSet ( ) ; private Map _seenVars = null ; private Set _boundVars = null ; public AbstractExpressionBuilder ( ExpressionFactory factory , Resolver resolver ) { } protected abstract ClassLoader getClassLoader ( ) { } protected OpenJPAException parseException ( int e , String token , Object [ ] args , Exception nest ) { } protected ClassMetaData addAccessPath ( ClassMetaData meta ) { } protected ClassMetaData [ ] getAccessPath ( ) { } protected boolean isBound ( Value var ) { } protected void bind ( Value var ) { } protected Value getVariable ( String id , boolean bind ) { } protected void assertUnboundVariablesValid ( ) { } protected abstract boolean isDeclaredVariable ( String id ) { } protected boolean isSeenVariable ( String id ) { } protected ClassMetaData getMetaData ( Class c , boolean required ) { } protected ClassMetaData getMetaData ( Class c , boolean required , ClassLoader loader ) { <START_BUG> return resolver . getConfiguration ( ) . getMetaDataRepository ( ) . getMetaData ( c , loader , required ) ; <END_BUG> } protected Value traversePath ( Path path , String field ) { } protected Value traversePath ( Path path , String field , boolean pcOnly , boolean allowNull ) { } protected Object traverseStaticField ( Class cls , String field ) { } protected abstract Class getDeclaredVariableType ( String name ) { } protected void setImplicitTypes ( Value val1 , Value val2 , Class expected ) { } private void convertTypes ( Value val1 , Value val2 ) { } private void convertTypesQuotedNumbers ( Value val1 , Value val2 ) { } private static boolean isNumeric ( Class type ) { } protected void setImplicitContainsTypes ( Value val1 , Value val2 , int op ) { } protected static void setImplicitType ( Value val , Class expected ) { } protected abstract Localizer getLocalizer ( ) { } protected abstract String currentQuery ( ) { } }

Fix:
return resolver . getConfiguration ( ) . getMetaDataRepositoryInstance ( ) . getMetaData ( c , loader , required ) ;
Buggy code:
public class UndertowConnectorTestCase { private final ListenerService < ? > listener = mock ( ListenerService . class ) ; private final Connector connector = new UndertowConnector ( this . listener ) ; @ Test public void getType ( ) { OptionMap options = OptionMap . builder ( ) . getMap ( ) ; assertSame ( AJP , new UndertowConnector ( new org . wildfly . extension . undertow . AjpListenerService ( "" , "" , options ) ) . getType ( ) ) ; <START_BUG> assertSame ( HTTP , new UndertowConnector ( new org . wildfly . extension . undertow . HttpListenerService ( "" , "" , options , false , false ) ) . getType ( ) ) ; <END_BUG> assertSame ( HTTPS , new UndertowConnector ( new org . wildfly . extension . undertow . HttpsListenerService ( "" , "" , options ) ) . getType ( ) ) ; } @ Test public void getAddress ( ) throws UnknownHostException { } @ Test public void getPort ( ) throws UnknownHostException { } @ Test public void setAddress ( ) throws UnknownHostException { } }

Fix:
assertSame ( HTTP , new UndertowConnector ( new org . wildfly . extension . undertow . HttpListenerService ( "" , "" , options , false ) ) . getType ( ) ) ;
Buggy code:
public final class DefaultTermVectorsWriter extends TermVectorsWriter { private final Directory directory ; private final String segment ; private IndexOutput tvx = null ; private IndexOutput tvd = null ; private IndexOutput tvf = null ; public DefaultTermVectorsWriter ( Directory directory , String segment , IOContext context ) throws IOException { } @ Override public void startDocument ( int numVectorFields ) throws IOException { } private long [ ] fps = new long [ 10 ] ; private int fieldCount = 0 ; private int numVectorFields = 0 ; private String lastFieldName ; @ Override public void startField ( FieldInfo info , int numTerms , boolean positions , boolean offsets ) throws IOException { } private final BytesRef lastTerm = new BytesRef ( 10 ) ; private int [ ] offsetStartBuffer = new int [ 10 ] ; private int [ ] offsetEndBuffer = new int [ 10 ] ; private int offsetIndex = 0 ; private int offsetFreq = 0 ; private boolean positions = false ; private boolean offsets = false ; @ Override public void startTerm ( BytesRef term , int freq ) throws IOException { final int prefix = StringHelper . bytesDifference ( lastTerm . bytes , lastTerm . offset , lastTerm . length , term . bytes , term . offset , term . length ) ; final int suffix = ( term . length ) - prefix ; tvf . writeVInt ( prefix ) ; tvf . writeVInt ( suffix ) ; tvf . writeBytes ( term . bytes , ( ( term . offset ) + prefix ) , suffix ) ; tvf . writeVInt ( freq ) ; <START_BUG> lastTerm . copy ( term ) ; <END_BUG> lastPosition = lastOffset = 0 ; if ( ( offsets ) && ( positions ) ) { offsetStartBuffer = ArrayUtil . grow ( offsetStartBuffer , freq ) ; offsetEndBuffer = ArrayUtil . grow ( offsetEndBuffer , freq ) ; offsetIndex = 0 ; offsetFreq = freq ; } } int lastPosition = 0 ; int lastOffset = 0 ; @ Override public void addProx ( int numProx , DataInput positions , DataInput offsets ) throws IOException { } @ Override public void addPosition ( int position , int startOffset , int endOffset ) throws IOException { } @ Override public void abort ( ) { } private void addRawDocuments ( DefaultTermVectorsReader reader , int [ ] tvdLengths , int [ ] tvfLengths , int numDocs ) throws IOException { } @ Override public final int merge ( MergeState mergeState ) throws IOException { } private static final int MAX_RAW_MERGE_DOCS = 4192 ; private int copyVectorsWithDeletions ( MergeState mergeState , final DefaultTermVectorsReader matchingVectorsReader , final MergeState . IndexReaderAndLiveDocs reader , int [ ] rawDocLengths , int [ ] rawDocLengths2 ) throws IOException , MergeAbortedException { } private int copyVectorsNoDeletions ( MergeState mergeState , final DefaultTermVectorsReader matchingVectorsReader , final MergeState . IndexReaderAndLiveDocs reader , int [ ] rawDocLengths , int [ ] rawDocLengths2 ) throws IOException , MergeAbortedException { } @ Override public void finish ( int numDocs ) throws IOException { } @ Override public void close ( ) throws IOException { } }

Fix:
lastTerm . copyBytes ( term ) ;
Buggy code:
public class DecorationBuilder implements IDecoration { private static int DECORATOR_ARRAY_SIZE = 5 ; private List prefixes = new ArrayList ( ) ; private List suffixes = new ArrayList ( ) ; private ImageDescriptor [ ] descriptors = new ImageDescriptor [ DecorationBuilder . DECORATOR_ARRAY_SIZE ] ; private Color foregroundColor ; private Color backgroundColor ; private Font font ; LightweightDecoratorDefinition currentDefinition ; private boolean valueSet = false ; private final IDecorationContext context ; DecorationBuilder ( ) { } public DecorationBuilder ( IDecorationContext context ) { } void setCurrentDefinition ( LightweightDecoratorDefinition definition ) { } public void addOverlay ( ImageDescriptor overlay ) { } public void addOverlay ( ImageDescriptor overlay , int quadrant ) { } public void addPrefix ( String prefixString ) { } public void addSuffix ( String suffixString ) { } DecorationResult createResult ( ) { <START_BUG> DecorationResult newResult = new DecorationResult ( new ArrayList ( prefixes ) , new ArrayList ( suffixes ) , descriptors , foregroundColor , backgroundColor , font , context ) ; <END_BUG> return newResult ; } void clearContents ( ) { } boolean hasValue ( ) { } void applyResult ( DecorationResult result ) { } public void setBackgroundColor ( Color bgColor ) { } public void setFont ( Font newFont ) { } public void setForegroundColor ( Color fgColor ) { } public IDecorationContext getDecorationContext ( ) { } }

Fix:
DecorationResult newResult = new DecorationResult ( new ArrayList ( prefixes ) , new ArrayList ( suffixes ) , descriptors , foregroundColor , backgroundColor , font ) ;
Buggy code:
public class ImapAttributPanel extends JPanel { private ImapItem item ; private JCheckBox secureCheckBox ; private JCheckBox storePasswordCheckBox ; private JCheckBox automaticallyApplyFilterCheckBox ; private JCheckBox intervalCheckingCheckBox ; private JPanel jPanel1 ; private JLabel intervalCheckingLabel ; private JLabel intervalCheckingLabel2 ; private JTextField intervalCheckingTextField ; private JCheckBox cleanupCheckBox ; private JPanel cleanupPanel ; public ImapAttributPanel ( ImapItem item ) { } public void updateComponents ( boolean b ) { if ( b ) { automaticallyApplyFilterCheckBox . setSelected ( item . getBoolean ( "automatically_apply_filter" ) ) ; } else { <START_BUG> item . set ( "automatically_apply_filter" , automaticallyApplyFilterCheckBox . isSelected ( ) ) ; <END_BUG> } } public void createPanel ( DefaultFormBuilder builder ) { } protected void initComponents ( ) { } }

Fix:
item . setBoolean ( "automatically_apply_filter" , automaticallyApplyFilterCheckBox . isSelected ( ) ) ;
Buggy code:
public class MainActivity extends Activity { Button BtnStatus ; Button BtnCombat ; Button MapBtn ; Button loginBtn ; Button signinBtn ; Button SlideBtn ; TextView Logo1 ; TextView Logo2 ; Button BtnSignUp ; Class < ? > nextIntentClass ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void checkFirstLaunchAndSetupApplication ( ) { } private void setupApplication ( ) { Controller . setupBob ( ) ; Controller . setupObjectives ( ) ; Resources resources = this . getResources ( ) ; AssetManager assetManager = resources . getAssets ( ) ; try { InputStream inputStream = assetManager . open ( "server.properties" ) ; Properties properties = new Properties ( ) ; properties . load ( inputStream ) ; String server_name = properties . getProperty ( "address" ) ; int server_port = Integer . parseInt ( properties . getProperty ( "port" ) ) ; System . out . println ( server_name ) ; MainActivity . LoginUserTask task = new MainActivity . LoginUserTask ( server_name , server_port , this ) ; task . execute ( ) ; } catch ( IOException e ) { <START_BUG> System . err . println ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>server<seq2seq4repair_space>property<seq2seq4repair_space>file" ) ; <END_BUG> e . printStackTrace ( ) ; } } private class LoginUserTask extends AsyncTask < Void , Void , Boolean > { private String server ; private int port ; ProgressDialog dialog ; Context ctx ; public LoginUserTask ( String server , int port , Context ctx ) { } protected void onPreExecute ( ) { } protected Boolean doInBackground ( Void ... params ) { } protected void onPostExecute ( Boolean login ) { } } No newline ; at end ; of file ; }

Fix:
Log . i ( "Server" , "Failed<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>server<seq2seq4repair_space>property<seq2seq4repair_space>file" ) ;
Buggy code:
public interface Print < Term , Ty , Bind > extends GTermAlg < Term , Ty , IPrint < Bind > > , varapp . Print < Term , Bind > { PrintTy < Ty , Bind > printTy ( ) { } @ Override PrintBind < Bind , Ty > printBind ( ) { } @ Override default IPrint < Bind > TmAbs ( String x , Ty ty , Term t ) { return ( ctx ) -> { Tuple2 < Context < Bind > , String > pr = ctx . pickFreshName ( x ) ; <START_BUG> return ( ( ( ( "lambda<seq2seq4repair_space>" + pr . _2 ) + ":" ) + ( printTy ( ) . visitTy ( ty ) ) ) + "." ) + ( visitTerm ( t ) . print ( pr . _1 ) ) ; <END_BUG> } ; } No newline ; at end ; of file ; }

Fix:
return ( ( ( ( "lambda<seq2seq4repair_space>" + pr . _2 ) + ":" ) + ( printTy ( ) . visitTy ( ty ) . print ( ctx ) ) ) + ".<seq2seq4repair_space>" ) + ( visitTerm ( t ) . print ( pr . _1 ) ) ;
Buggy code:
public final class ChangeDocIDToMatchFile { private static final Logger log = LoggerFactory . getLogger ( ChangeDocIDToMatchFile . class ) ; public static void main ( String [ ] argv ) { } private static void trueMain ( String [ ] argv ) throws IOException { } public static AnswerKey convertAnswerKeyDocID ( Symbol docID , AnswerKey input ) { CorefAnnotation corefAnnotation = input . corefAnnotation ( ) ; CorefAnnotation fixedCorefAnnotation = CorefAnnotation . create ( docID , corefAnnotation . CASesToIDs ( ) , corefAnnotation . unannotatedCASes ( ) ) ; Iterable < AssessedResponse > annotatedArgs = Iterables . transform ( input . annotatedResponses ( ) , ChangeDocIDToMatchFile . fixAssessedResponseDocID ( docID ) ) ; Iterable < Response > unannotatedArgs = Iterables . transform ( input . unannotatedResponses ( ) , ChangeDocIDToMatchFile . fixResponseDocID ( docID ) ) ; <START_BUG> return AnswerKey . from ( docID , annotatedArgs , unannotatedArgs , corefAnnotation ) ; <END_BUG> } private static Function < AssessedResponse , AssessedResponse > fixAssessedResponseDocID ( final Symbol docID ) { } private static Function < Response , Response > fixResponseDocID ( final Symbol docID ) { } }

Fix:
return AnswerKey . from ( docID , annotatedArgs , unannotatedArgs , fixedCorefAnnotation ) ;
Buggy code:
public class SpanRegexQuery extends SpanQuery { private Term term ; public SpanRegexQuery ( Term term ) { } public Term getTerm ( ) { } public Query rewrite ( IndexReader reader ) throws IOException { } public Spans getSpans ( IndexReader reader ) throws IOException { } public String getField ( ) { } public Collection getTerms ( ) { } public boolean equals ( Object o ) { if ( ( this ) == o ) return true ; <START_BUG> if ( ! ( o instanceof TermQuery ) ) <END_BUG> return false ; final SpanRegexQuery that = ( ( SpanRegexQuery ) ( o ) ) ; return ( term . equals ( that . term ) ) && ( ( getBoost ( ) ) == ( that . getBoost ( ) ) ) ; } public int hashCode ( ) { } public String toString ( String field ) { } }

Fix:
if ( ! ( o instanceof SpanRegexQuery ) )
Buggy code:
public class ComponentCreateTagTest extends TestCase { private static Log log = LogFactory . getLog ( ComponentCreateTagTest . class ) ; private MockWebApplication application ; public ComponentCreateTagTest ( String name ) { } public void testRenderHomePage_1 ( ) throws Exception { } public void testRenderHomePage_2 ( ) throws Exception { } public void testRenderHomePage_3 ( ) throws Exception { } public void testRenderHomePage_4 ( ) throws Exception { } public void testRenderHomePage_5 ( ) throws Exception { } public void testRenderHomePage_6 ( ) throws Exception { } public void executeTest ( final Class pageClass , final String filename ) throws Exception { application = new MockWebApplication ( null ) ; application . getRequiredPageSettings ( ) . setHomePage ( pageClass ) ; <START_BUG> application . getSettings ( ) . setStripWicketTags ( true ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; ComponentCreateTagTest . log . info ( document ) ; assertTrue ( DiffUtil . validatePage ( document , this . getClass ( ) , filename ) ) ; } }

Fix:
application . getMarkupSettings ( ) . setStripWicketTags ( true ) ;
Buggy code:
public class CenterJustifyAction extends CheckBoxAction implements ContainerListener , Observer { public CenterJustifyAction ( FrameMediator frameMediator ) { } public void update ( Observable arg0 , Object arg1 ) { } public void actionPerformed ( ActionEvent evt ) { } public void componentAdded ( ContainerEvent e ) { <START_BUG> log . debug ( "Re-registering<seq2seq4repair_space>as<seq2seq4repair_space>observer<seq2seq4repair_space>on<seq2seq4repair_space>editor<seq2seq4repair_space>controller" ) ; <END_BUG> ( ( org . columba . mail . gui . composer . ComposerController ) ( getFrameMediator ( ) ) ) . getEditorController ( ) . addObserver ( this ) ; } public void componentRemoved ( ContainerEvent e ) { } }

Fix:
log . info ( "Re-registering<seq2seq4repair_space>as<seq2seq4repair_space>observer<seq2seq4repair_space>on<seq2seq4repair_space>editor<seq2seq4repair_space>controller" ) ;
Buggy code:
public class StrictMaxPoolConfig extends PoolConfig { public static final int DEFAULT_MAX_POOL_SIZE = 20 ; public static final long DEFAULT_TIMEOUT = 5 ; public static final TimeUnit DEFAULT_TIMEOUT_UNIT = TimeUnit . MINUTES ; private volatile int maxPoolSize ; private volatile TimeUnit timeoutUnit ; private volatile long timeout ; public StrictMaxPoolConfig ( final String poolName , int maxSize , long timeout , TimeUnit timeUnit ) { } @ Override public Pool < ? > createPool ( final StatelessObjectFactory statelessObjectFactory ) { } public int getMaxPoolSize ( ) { } public void setMaxPoolSize ( int maxPoolSize ) { } public TimeUnit getTimeoutUnit ( ) { } public void setTimeoutUnit ( TimeUnit timeoutUnit ) { } public long getTimeout ( ) { } public void setTimeout ( long timeout ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( ( ( ( ( ( "StrictMaxPoolConfig{" + "name=" ) + ( this . poolName ) ) + "maxPoolSize=" ) + ( maxPoolSize ) ) + ",<seq2seq4repair_space>timeoutUnit=" ) + ( timeoutUnit ) ) + ",<seq2seq4repair_space>timeout=" ) + ( timeout ) ) + '}' ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( ( "StrictMaxPoolConfig{" + "name=" ) + ( this . poolName ) ) + ",<seq2seq4repair_space>maxPoolSize=" ) + ( maxPoolSize ) ) + ",<seq2seq4repair_space>timeoutUnit=" ) + ( timeoutUnit ) ) + ",<seq2seq4repair_space>timeout=" ) + ( timeout ) ) + '}' ;
Buggy code:
public class Decorations extends Canvas { Image image ; Image [ ] images = new Image [ 0 ] ; Menu menuBar ; String text = "" ; boolean minimized ; boolean maximized ; Control savedFocus ; Button defaultButton ; Decorations ( ) { } public Decorations ( Composite parent , int style ) { } static int checkStyle ( int style ) { } void bringToTop ( boolean force ) { } protected void checkSubclass ( ) { } int compare ( ImageData data1 , ImageData data2 ) { } <START_BUG> Control computeTabGroup ( ) { <END_BUG> return this ; } Control computeTabRoot ( ) { } void fixDecorations ( Decorations newDecorations , Control control , Menu [ ] menus ) { } public Button getDefaultButton ( ) { } public Image getImage ( ) { } public Image [ ] getImages ( ) { } public boolean getMaximized ( ) { } public Menu getMenuBar ( ) { } public boolean getMinimized ( ) { } String getNameText ( ) { } public String getText ( ) { } public boolean isReparentable ( ) { } boolean isTabGroup ( ) { } boolean isTabItem ( ) { } Decorations menuShell ( ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } boolean restoreFocus ( ) { } void saveFocus ( ) { } public void setDefaultButton ( Button button ) { } public void setImage ( Image image ) { } public void setImages ( Image [ ] images ) { } public void setMaximized ( boolean maximized ) { } public void setMenuBar ( Menu menu ) { } public void setMinimized ( boolean minimized ) { } void setSavedFocus ( Control control ) { } public void setText ( String string ) { } void sort ( Image [ ] images ) { } boolean traverseItem ( boolean next ) { } boolean traverseReturn ( ) { } }

Fix:
Widget computeTabGroup ( ) {
Buggy code:
public class Main { private static final String KARAF_HOME = "karaf.home" ; private static final Class [ ] parameters = new Class [ ] { URL . class } ; private String application = System . getProperty ( "karaf.name" , "root" ) ; private String user = "karaf" ; private static enum Errno { ENOENT ( 2 ) , EIO ( 5 ) , ENXIO ( 6 ) , EACCES ( 13 ) , EEXIST ( 17 ) , ETIMEDOUT ( 110 ) , EDQUOT ( 122 ) , UNKNOWN ( 255 ) ; private final int errno ; Errno ( int errno ) { } int getErrno ( ) { } } private static void exitIfThrowableMatches ( Throwable throwable , Class klass , Main . Errno errno , String message ) { } public static void main ( String [ ] args ) throws Exception { } public void run ( String [ ] args ) throws Exception { } public void loadJarsFromPath ( File path ) throws IOException { } public static void addURL ( URL u ) throws IOException { } private void run ( final CommandProcessorImpl commandProcessor , String [ ] args , final InputStream in , final PrintStream out , final PrintStream err ) throws Exception { } protected Console createConsole ( CommandProcessorImpl commandProcessor , InputStream in , PrintStream out , PrintStream err , Terminal terminal ) throws Exception { <START_BUG> return new Console ( commandProcessor , in , out , err , terminal , "UTF-8" , null ) ; <END_BUG> } public String getDiscoveryResource ( ) { } private void discoverCommands ( CommandProcessorImpl commandProcessor , ClassLoader cl ) throws IOException , ClassNotFoundException { } protected void addCommand ( Command cmd , Function function , CommandProcessorImpl commandProcessor ) { } public String getApplication ( ) { } public void setApplication ( String application ) { } public String getUser ( ) { } public void setUser ( String user ) { } public boolean isMultiScopeMode ( ) { } private static PrintStream wrap ( PrintStream stream ) { } private static < T > T unwrap ( T stream ) { } private static List < URL > getFiles ( File base ) throws MalformedURLException { } private static void getFiles ( File base , List < URL > urls ) throws MalformedURLException { } }

Fix:
return new Console ( commandProcessor , in , out , err , terminal , null , null ) ;
Buggy code:
public class MafiaGiveBeansToMafiaCommand extends MafiaGameCommand { public GameCommandResult execute ( Player p , Game g ) { super . execute ( p , g ) ; MafiaGame game = ( ( MafiaGame ) ( g ) ) ; MafiaPlayer player = ( ( MafiaPlayer ) ( p ) ) ; List < MafiaBoss > mafiaBosses = game . getMafia ( ) ; List < HarvestablePile > fields = player . getAllFields ( ) ; for ( Pile pile : game . getRevealArray ( ) ) { while ( ( pile . pileSize ( ) ) != 0 ) { pile . pop ( ) . ifPresent ( ( Card c ) -> game . getDiscardPile ( ) . append ( c ) ) ; } } for ( MafiaBoss mafia : mafiaBosses ) { Optional < CardType > mafiaCT = mafia . getPile ( ) . peek ( ) ; for ( Pile field : fields ) { <START_BUG> if ( ( ( field . pileSize ( ) ) != 0 ) && ( mafiaCT == ( field . peek ( ) ) ) ) <END_BUG> field . pop ( ) . ifPresent ( ( Card c ) -> mafia . getPile ( ) . append ( c ) ) ; } } return MafiaGameCommandResult . GIVE_BEANS ; } }

Fix:
if ( ( ( field . pileSize ( ) ) != 0 ) && ( mafiaCT . equals ( field . peek ( ) ) ) )