nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ExpressionState { private final EvaluationContext relatedContext ; private Stack < ExpressionState . VariableScope > variableScopes ; private Stack < TypedValue > contextObjects ; private final TypedValue rootObject ; private SpelParserConfiguration configuration ; public ExpressionState ( EvaluationContext context ) { } public ExpressionState ( EvaluationContext context , SpelParserConfiguration configuration ) { } public ExpressionState ( EvaluationContext context , TypedValue rootObject ) { } public ExpressionState ( EvaluationContext context , TypedValue rootObject , SpelParserConfiguration configuration ) { } private void ensureVariableScopesInitialized ( ) { } public TypedValue getActiveContextObject ( ) { } public void pushActiveContextObject ( TypedValue obj ) { } public void popActiveContextObject ( ) { } public TypedValue getRootContextObject ( ) { } public void setVariable ( String name , Object value ) { } public TypedValue lookupVariable ( String name ) { Object value = this . relatedContext . lookupVariable ( name ) ; if ( value == null ) { <START_BUG> return TypedValue . NULL_TYPED_VALUE ; <END_BUG> } else { return new TypedValue ( value , TypeDescriptor . forObject ( value ) ) ; } } public TypeComparator getTypeComparator ( ) { } public Class < ? > findType ( String type ) throws EvaluationException { } public Object convertValue ( Object value , TypeDescriptor targetTypeDescriptor ) throws EvaluationException { } public Object convertValue ( TypedValue value , TypeDescriptor targetTypeDescriptor ) throws EvaluationException { } public void enterScope ( Map < String , Object > argMap ) { } public void enterScope ( String name , Object value ) { } public void exitScope ( ) { } public void setLocalVariable ( String name , Object value ) { } public Object lookupLocalVariable ( String name ) { } public TypedValue operate ( Operation op , Object left , Object right ) throws EvaluationException { } public List < PropertyAccessor > getPropertyAccessors ( ) { } public EvaluationContext getEvaluationContext ( ) { } public SpelParserConfiguration getConfiguration ( ) { } private static class VariableScope { private final Map < String , Object > vars = new HashMap < String , Object > ( ) ; public VariableScope ( ) { } public VariableScope ( Map < String , Object > arguments ) { } public VariableScope ( String name , Object value ) { } public Object lookupVariable ( String name ) { return this . vars . get ( name ) ; } public void setVariable ( String name , Object value ) { } public boolean definesVariable ( String name ) { } } }

Fix:
return TypedValue . NULL ;
Buggy code:
public class MockServerManagerProcess extends ServerManager { private final Managed managed ; private final Map < String , List < String > > serverCommands = new ConcurrentHashMap < String , List < String > > ( ) ; private final Map < String , DirectServerManagerCommunicationHandler > serverConnections = new HashMap < String , DirectServerManagerCommunicationHandler > ( ) ; private final TestServerManagerMessageHandler messageHandler = new TestServerManagerMessageHandler ( ) ; private volatile TestDirectServerManagerCommunicationListener serverListener ; private volatile ProcessManagerSlave pmSlave ; private MockServerManagerProcess ( Managed managed , ServerManagerEnvironment environment ) { } public static MockServerManagerProcess create ( ) throws Exception { } public static MockServerManagerProcess create ( Managed managed , List < String > command ) throws Exception { } private static MockServerManagerProcess create ( Managed managed , int pmPort ) throws Exception { MockServerManagerProcess . MockServerManagerEnvironment environment = new MockServerManagerProcess . MockServerManagerEnvironment ( false , pmPort ) ; MockServerManagerProcess sm = new MockServerManagerProcess ( managed , environment ) ; sm . serverListener = TestDirectServerManagerCommunicationListener . create ( sm , InetAddress . getLocalHost ( ) , 0 , 20 , sm . messageHandler ) ; if ( pmPort > 0 ) { <START_BUG> sm . pmSlave = ProcessManagerSlaveFactory . getInstance ( ) . getProcessManagerSlave ( environment , sm . parseHost ( ) , sm . messageHandler ) ; <END_BUG> new Thread ( sm . pmSlave . getController ( ) , "Test<seq2seq4repair_space>ServerManager<seq2seq4repair_space>PM<seq2seq4repair_space>Slave" ) . start ( ) ; } return sm ; } public void addServerToPm ( String serverName , int pmPort ) throws Exception { } public void startServerInPm ( String serverName ) throws IOException { } public void stopServerInPm ( String serverName ) throws IOException { } public void removeServerFromPm ( String serverName ) throws IOException { } public void sendMessageToServer ( String serverName , ServerManagerToServerProtocolCommand cmd ) throws Exception { } public void sendMessageToServer ( String serverName , ServerManagerToServerProtocolCommand cmd , Object data ) throws Exception { } public void sendReconnectServersToProcessManager ( ) throws IOException { } public ServerMessage awaitAndReadMessage ( ) { } public void waitForShutdownCommand ( ) throws InterruptedException { } @ Override public void stop ( ) { } public void crashServerManager ( int exitCode ) { } private DirectServerManagerCommunicationHandler getServerCommunicationHandler ( String serverName ) throws InterruptedException { } static class MockServerManagerEnvironment extends ServerManagerEnvironment { public MockServerManagerEnvironment ( boolean isRestart , int pmPort ) throws Exception { } } }

Fix:
sm . pmSlave = ProcessManagerSlaveFactory . getInstance ( ) . getProcessManagerSlave ( environment , sm . getHostModel ( ) , sm . messageHandler ) ;
Buggy code:
public class BukkitAbstractEventMixin implements EventMixinInterface { AbstractEvent mySuper ; public BukkitAbstractEventMixin ( AbstractEvent mySuper ) { } public void cancel ( Object e , boolean state ) { } @ Override public Map < String , Construct > evaluate_helper ( Object e ) throws EventException { Map < String , Construct > map = new HashMap < String , Construct > ( ) ; map . put ( "type" , new CString ( mySuper . getName ( ) , 0 , null ) ) ; <START_BUG> String macro = "" ; <END_BUG> if ( e instanceof BlockEvent ) { macro = "block" ; } else if ( e instanceof EntityEvent ) { macro = "entity" ; if ( ( ( ( EntityEvent ) ( e ) ) . getEntity ( ) ) instanceof Player ) { Entity entity = ( ( EntityEvent ) ( e ) ) . getEntity ( ) ; map . put ( "player" , new CString ( ( ( Player ) ( entity ) ) . getName ( ) , 0 , null ) ) ; } } else if ( ( e instanceof FurnaceBurnEvent ) || ( e instanceof FurnaceSmeltEvent ) ) { macro = "inventory" ; } else if ( e instanceof PlayerEvent ) { map . put ( "player" , new CString ( ( ( PlayerEvent ) ( e ) ) . getPlayer ( ) . getName ( ) , 0 , null ) ) ; macro = "player" ; } else if ( e instanceof ServerEvent ) { macro = "server" ; } else if ( e instanceof VehicleEvent ) { macro = "vehicle" ; } else if ( e instanceof WeatherEvent ) { macro = "weather" ; } else if ( e instanceof WorldEvent ) { macro = "world" ; } else { macro = "custom" ; } map . put ( "macrotype" , new CString ( macro , 0 , null ) ) ; return map ; } public void manualTrigger ( Object e ) { } public boolean isCancellable ( Object o ) { } }

Fix:
String macro ;
Buggy code:
public class XModeHandler extends HandlerBase { public XModeHandler ( XmlParser parser , String modeName , String path ) { } public Object resolveEntity ( String publicId , String systemId ) { } public void attribute ( String aname , String value , boolean isSpecified ) { } public void doctypeDecl ( String name , String publicId , String systemId ) throws Exception { } public void charData ( char [ ] c , int off , int len ) { } public void startElement ( String tag ) { tag = pushElement ( tag ) ; if ( tag == "MODE" ) { mode = jEdit . getMode ( modeName ) ; if ( ( mode ) == null ) { mode = new Mode ( modeName ) ; jEdit . addMode ( mode ) ; } } else if ( tag == "KEYWORDS" ) { keywords = new KeywordMap ( true ) ; } else if ( tag == "RULES" ) { <START_BUG> rules = new ParserRuleSet ( mode ) ; <END_BUG> rules . setIgnoreCase ( lastIgnoreCase ) ; rules . setHighlightDigits ( lastHighlightDigits ) ; rules . setEscape ( lastEscape ) ; rules . setDefault ( lastDefaultID ) ; } } public void endElement ( String name ) { } public void startDocument ( ) { } private XmlParser parser ; private String modeName ; private String path ; private TokenMarker marker ; private KeywordMap keywords ; private Mode mode ; private Stack stateStack ; private String propName ; private String propValue ; private Hashtable props ; private String lastStart ; private String lastEnd ; private String lastKeyword ; private String lastSetName ; private String lastEscape ; private String lastDelegateSet ; private ParserRuleSet rules ; private byte lastDefaultID = Token . NULL ; private byte lastTokenID ; private int termChar = - 1 ; private boolean lastNoLineBreak ; private boolean lastNoWordBreak ; private boolean lastAtLineStart ; private boolean lastExcludeMatch ; private boolean lastIgnoreCase = true ; private boolean lastHighlightDigits ; private byte stringToToken ( String value ) { } private void addKeyword ( String k , byte id ) { } private String pushElement ( String name ) { } private String peekElement ( ) { } private String popElement ( ) { } private void error ( String msg ) { } private void error ( String msg , String subst ) { } private void error ( String msg , Throwable t ) { } private void _error ( String msg ) { } }

Fix:
rules = new ParserRuleSet ( lastSetName , mode ) ;
Buggy code:
public class DurationDV extends AbstractDateTimeDV { private static final int [ ] [ ] DATETIMES = new int [ ] [ ] { new int [ ] { 1696 , 9 , 1 , 0 , 0 , 0 , 0 , 'Z' } , new int [ ] { 1697 , 2 , 1 , 0 , 0 , 0 , 0 , 'Z' } , new int [ ] { 1903 , 3 , 1 , 0 , 0 , 0 , 0 , 'Z' } , new int [ ] { 1903 , 7 , 1 , 0 , 0 , 0 , 0 , 'Z' } } ; private int [ ] [ ] fDuration = null ; public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { try { return parse ( content , null ) ; } catch ( Exception ex ) { <START_BUG> throw new InvalidDatatypeValueException ( "not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>duration" ) ; <END_BUG> } } protected int [ ] parse ( String str , int [ ] date ) throws SchemaDateTimeException { } protected short compareDates ( int [ ] date1 , int [ ] date2 , boolean strict ) { } private short compareResults ( short resultA , short resultB , boolean strict ) { } private int [ ] addDuration ( int [ ] date , int index , int [ ] duration ) { } protected String dateToString ( int [ ] date ) { } }

Fix:
throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "duration" } ) ;
Buggy code:
public class AllTests { public static Test suite ( ) { <START_BUG> TestSuite suite = new TestSuite ( "Test<seq2seq4repair_space>for<seq2seq4repair_space>org.columba.core.command" ) ; <END_BUG> suite . addTest ( new TestSuite ( DefaultProcessorTest . class ) ) ; return suite ; } }

Fix:
TestSuite suite = new TestSuite ( "Test<seq2seq4repair_space>for<seq2seq4repair_space>org.columba.api.command" ) ;
Buggy code:
public interface MessageProducer { <START_BUG> public Message getMessage ( int version ) throws IOException ; <END_BUG> }

Fix:
public Message getMessage ( Integer version ) throws IOException ;
Buggy code:
public abstract class CachedFolder extends LocalFolder { protected AbstractHeaderCache headerCache ; public CachedFolder ( FolderItem item ) { } public Object addMessage ( AbstractMessage message , WorkerStatusController worker ) throws Exception { } public boolean exists ( Object uid , WorkerStatusController worker ) throws Exception { } public void expungeFolder ( WorkerStatusController worker ) throws Exception { } protected HeaderList getCachedHeaderList ( WorkerStatusController worker ) throws Exception { } public HeaderList getHeaderList ( WorkerStatusController worker ) throws Exception { } public AbstractMessage getMessage ( Object uid , WorkerStatusController worker ) throws Exception { if ( ( aktMessage ) != null ) { if ( aktMessage . getUID ( ) . equals ( uid ) ) { return ( ( AbstractMessage ) ( aktMessage . clone ( ) ) ) ; } } String source = getMessageSource ( uid , worker ) ; ColumbaHeader header = ( ( ColumbaHeader ) ( getCachedHeaderList ( worker ) . get ( uid ) ) ) ; <START_BUG> AbstractMessage message = new Rfc822Parser ( ) . parse ( source , true , header , 0 ) ; <END_BUG> message . setUID ( uid ) ; message . setSource ( source ) ; if ( source == null ) { source = new String ( ) ; } aktMessage = message ; return ( ( AbstractMessage ) ( message . clone ( ) ) ) ; } public ColumbaHeader getMessageHeader ( Object uid , WorkerStatusController worker ) throws Exception { } public Object [ ] getUids ( WorkerStatusController worker ) throws Exception { } public void innerCopy ( Folder destFolder , Object [ ] uids , WorkerStatusController worker ) throws Exception { } protected void markMessage ( Object uid , int variant , WorkerStatusController worker ) throws Exception { } public void markMessage ( Object [ ] uids , int variant , WorkerStatusController worker ) throws Exception { } public void removeMessage ( Object uid , WorkerStatusController worker ) throws Exception { } public void save ( WorkerStatusController worker ) throws Exception { } public AbstractHeaderCache getHeaderCacheInstance ( ) { } }

Fix:
AbstractMessage message = new Rfc822Parser ( ) . parse ( source , header ) ;
Buggy code:
public class IzouPluginClassLoader extends URLClassLoader { private static final Logger log = LoggerFactory . getLogger ( IzouPluginClassLoader . class ) ; private static final String PLUGIN_PACKAGE_PREFIX_PF4J = "ro.fortsoft.pf4j." ; private static final String PLUGIN_PACKAGE_PREFIX_IZOU = "org.intellimate.izou" ; private static final String PLUGIN_PACKAGE_PREFIX_IZOU_SDK = "org.intellimate.izou.sdk" ; private static final String PLUGIN_PACKAGE_PREFIX_LOG_SL4J = "org.slf4j" ; private static final String PLUGIN_PACKAGE_PREFIX_LOG_LOG4J = "org.apache.logging.log4j" ; private static final String PLUGIN_ZIP_FILE_MANAGER = "ZipFileManager" ; private PluginManager pluginManager ; private PluginDescriptor pluginDescriptor ; private URLClassPath classesClassPath = new URLClassPath ( new URL [ 0 ] ) ; public IzouPluginClassLoader ( PluginManager pluginManager , PluginDescriptor pluginDescriptor , ClassLoader parent ) { } @ Override public void addURL ( URL url ) { } @ Override public Class < ? > loadClass ( String className ) throws ClassNotFoundException { IzouPluginClassLoader . log . debug ( "Received<seq2seq4repair_space>request<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>class<seq2seq4repair_space>'{}'" , className ) ; if ( className . startsWith ( IzouPluginClassLoader . PLUGIN_PACKAGE_PREFIX_PF4J ) ) { IzouPluginClassLoader . log . debug ( "Delegate<seq2seq4repair_space>the<seq2seq4repair_space>loading<seq2seq4repair_space>of<seq2seq4repair_space>class<seq2seq4repair_space>'{}'<seq2seq4repair_space>to<seq2seq4repair_space>parent" , className ) ; try { return getClass ( ) . getClassLoader ( ) . loadClass ( className ) ; } catch ( ClassNotFoundException e ) { } } else if ( className . startsWith ( IzouPluginClassLoader . PLUGIN_PACKAGE_PREFIX_IZOU_SDK ) ) { IzouPluginClassLoader classLoader = getSDKClassLoader ( className ) ; if ( classLoader != null ) { <START_BUG> return classLoader . loadClass ( className ) ; <END_BUG> } else { throw new ClassNotFoundException ( ) ; } } else if ( ( ( className . startsWith ( IzouPluginClassLoader . PLUGIN_PACKAGE_PREFIX_LOG_SL4J ) ) || ( className . startsWith ( IzouPluginClassLoader . PLUGIN_PACKAGE_PREFIX_IZOU ) ) ) || ( className . startsWith ( IzouPluginClassLoader . PLUGIN_PACKAGE_PREFIX_LOG_LOG4J ) ) ) { try { return super . getParent ( ) . loadClass ( className ) ; } catch ( ClassNotFoundException e ) { } } else if ( className . contains ( IzouPluginClassLoader . PLUGIN_ZIP_FILE_MANAGER ) ) { return loadAndRegisterIzouPlugin ( className ) ; } return loadCustomClass ( className ) ; } private IzouPluginClassLoader getSDKClassLoader ( String className ) { } private Class < ? > loadCustomClass ( String className ) throws ClassNotFoundException { } private Class < ? > loadAndRegisterIzouPlugin ( String className ) throws ClassNotFoundException { } public Class < ? > loadClassFromClasses ( String className ) throws ClassNotFoundException { } @ Override public URL getResource ( String name ) { } public void dispose ( ) { } public PluginDescriptor getPluginDescriptor ( ) { } }

Fix:
return classLoader . loadCustomClass ( className ) ;
Buggy code:
public class NavigationDrawerFragment extends BaseFragment implements ViewPager . OnPageChangeListener , View . OnClickListener { public static final String TAG = NavigationDrawerFragment . class . getName ( ) ; private static final int INDEX_SOUND_SHEETS = 0 ; private static final int INDEX_PLAYLIST = 1 ; private EventBus bus ; private SlidingTabLayout tabBar ; private ViewPager tabContent ; private NavigationDrawerFragment . TabContentAdapter tabContentAdapter ; private ViewGroup listContainer ; private NavigationDrawerFragment . ViewPagerContentObserver listObserver ; private SoundLayoutsList soundLayoutList ; private SoundLayoutsListAdapter soundLayoutListAdapter ; private Playlist playlist ; private PlaylistAdapter playlistAdapter ; private SoundSheets soundSheets ; private TextView currentLayoutName ; private View contextualActionContainer ; private View deleteSelected ; private int minHeightOfListContent = 0 ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } public void calculateMinHeightOfListContent ( ) { } private void initSoundLayoutsAndAdapter ( ) { } private void initSoundSheetsAndAdapter ( ) { } private void initPlayListAndAdapter ( ) { } @ Override public void onStart ( ) { } @ Override public void onStop ( ) { } @ Override public void onPause ( ) { } @ Override public void onClick ( View v ) { } private void animateSoundLayoutsListAppear ( ) { } public void triggerSoundLayoutUpdate ( ) { } @ SuppressWarnings ( "unused" ) public void onEvent ( ActionModeEvent event ) { ActionModeEvent . REQUEST requestedAction = event . getRequestedAction ( ) ; switch ( requestedAction ) { case START : this . onActionModeStart ( ) ; return ; <START_BUG> case STOP : <END_BUG> this . onActionModeFinished ( ) ; } } private void onActionModeStart ( ) { } private void onActionModeFinished ( ) { } @ Override public void onPageScrolled ( int position , float positionOffset , int positionOffsetPixels ) { } @ Override public void onPageSelected ( int position ) { } @ Override public void onPageScrollStateChanged ( int state ) { } public void setLayoutName ( String layoutName ) { } public void adjustViewPagerToContent ( ) { } public SoundSheetsAdapter getSoundSheetsAdapter ( ) { } public Playlist getPlaylist ( ) { } private class TabContentAdapter extends PagerAdapter { @ Override public CharSequence getPageTitle ( int position ) { } @ Override public int getCount ( ) { } @ Override public boolean isViewFromObject ( View view , Object object ) { } @ Override public Object instantiateItem ( ViewGroup container , int position ) { } } private class ViewPagerContentObserver extends RecyclerView . AdapterDataObserver { @ Override public void onChanged ( ) { } } private class NavigationDrawerTabColorizer implements SlidingTabLayout . TabColorizer { @ Override public int getIndicatorColor ( int position ) { } @ Override public int getDividerColor ( int position ) { } } }

Fix:
case STOPPED :
Buggy code:
public final class ArgoSecurityManager extends SecurityManager { private boolean _allowExit = false ; private static ArgoSecurityManager SINGLETON = new ArgoSecurityManager ( ) ; public static final ArgoSecurityManager getInstance ( ) { } private ArgoSecurityManager ( ) { } public void checkPermission ( Permission perm ) { if ( perm instanceof RuntimePermission ) { if ( "exitVM" . equals ( perm . getName ( ) ) ) { if ( ! ( _allowExit ) ) { <START_BUG> throw new SecurityException ( ) ; <END_BUG> } } } } public boolean getAllowExit ( ) { } public void setAllowExit ( boolean allowExit ) { } }

Fix:
throw new ArgoSecurityException ( true ) ;
Buggy code:
class AutomatonTermsEnum extends FilteredTermsEnum { private final ByteRunAutomaton runAutomaton ; private final BytesRef commonSuffixRef ; private final boolean finite ; private final Transition [ ] [ ] allTransitions ; private final long [ ] visited ; private long curGen ; private final BytesRef seekBytesRef = new BytesRef ( 10 ) ; private boolean linear = false ; private final BytesRef linearUpperBound = new BytesRef ( 10 ) ; private final Comparator < BytesRef > termComp ; public AutomatonTermsEnum ( TermsEnum tenum , CompiledAutomaton compiled ) throws IOException { } @ Override protected AcceptStatus accept ( final BytesRef term ) { } @ Override protected BytesRef nextSeekTerm ( final BytesRef term ) throws IOException { if ( term == null ) { assert ( seekBytesRef . length ) == 0 ; if ( runAutomaton . isAccept ( runAutomaton . getInitialState ( ) ) ) { return seekBytesRef ; } } else { <START_BUG> seekBytesRef . copy ( term ) ; <END_BUG> } if ( nextString ( ) ) { return seekBytesRef ; } else { return null ; } } private void setLinear ( int position ) { } private final IntsRef savedStates = new IntsRef ( 10 ) ; private boolean nextString ( ) { } private boolean nextString ( int state , int position ) { } private int backtrack ( int position ) { } }

Fix:
seekBytesRef . copyBytes ( term ) ;
Buggy code:
public class Checker extends ParseTreeVisitor < Type > { private SymbolTable variables ; private SymbolTable globals = new SymbolTable ( ) ; private SymbolTable locks = new SymbolTable ( 0 , globals ) ; public SymbolTable getVariables ( ) { } private void initializeScope ( ) { } private void initializeScopeWithOffset ( ) { } private void finalizeScope ( ) { } public ParseTree check ( ParseTree tree ) throws ParseException { } @ Override public Type visitProgram ( Program node ) throws ParseException { } @ Override public Type visitAssignStat ( AssignStat node ) throws ParseException { } @ Override public Type visitBlockStat ( BlockStat node ) throws ParseException { } @ Override public Type visitDeclStat ( DeclStat node ) throws ParseException { } @ Override public Type visitEndProgram ( EndProgram node ) throws ParseException { } @ Override public Type visitIfStat ( IfStat node ) throws ParseException { } @ Override public Type visitLockStat ( LockStat lockStat ) throws ParseException { } @ Override public Type visitPass ( Pass node ) { } @ Override public Type visitPrintStat ( PrintStat node ) throws ParseException { } @ Override public Type visitReadStat ( ReadStat node ) throws ParseException { } @ Override public Type visitUnlockStat ( UnlockStat unlockStat ) throws ParseException { } @ Override public Type visitWhileStat ( WhileStat node ) throws ParseException { } private Type getExpressionType ( Expression expr ) { } @ Override public Type visitAddiExpression ( AddiExpression node ) throws ParseException { } @ Override public Type visitBitExpression ( BitExpression node ) throws ParseException { visit ( node . getLeftExpression ( ) ) ; visit ( node . getRightExpression ( ) ) ; <START_BUG> if ( ( ( getExpressionType ( node . getLeftExpression ( ) ) ) != ( Type . BOOL ) ) || ( ( getExpressionType ( node . getRightExpression ( ) ) ) != ( Type . BOOL ) ) ) { <END_BUG> throw createTypeException ( BOOL , node . getType ( ) , node ) ; } return node . getType ( ) ; } @ Override public Type visitBoolExpression ( BoolExpression node ) throws ParseException { } @ Override public Type visitCompExpression ( CompExpression node ) throws ParseException { } @ Override public Type visitMultiExpression ( MultiExpression node ) throws ParseException { } @ Override public Type visitParExpression ( ParExpression node ) throws ParseException { } @ Override public Type visitPrefixExpression ( PrefixExpression node ) throws ParseException { } private ParseException createTypeException ( Type expected , Type type , Node node ) { } @ Override public Type visitSpidExpression ( SpidExpression node ) throws ParseException { } @ Override public Type visitValueExpression ( ValueExpression node ) throws ParseException { } }

Fix:
if ( ( ( getExpressionType ( node . getLeftExpression ( ) ) ) != ( Type . INT ) ) || ( ( getExpressionType ( node . getRightExpression ( ) ) ) != ( Type . INT ) ) ) {
Buggy code:
public class FlatEnvironment extends Environment { protected final List < PDefinition > definitions ; private boolean limitStateScope = false ; public List < PDefinition > getDefinitions ( ) { } public FlatEnvironment ( ITypeCheckerAssistantFactory af , List < PDefinition > definitions ) { } public FlatEnvironment ( ITypeCheckerAssistantFactory af , List < PDefinition > definitions , Environment env ) { } public FlatEnvironment ( ITypeCheckerAssistantFactory af , PDefinition one , Environment env ) { } public void add ( PDefinition one ) { } @ Override public PDefinition findName ( ILexNameToken name , NameScope scope ) { PDefinition def = af . createPDefinitionListAssistant ( ) . findName ( definitions , name , scope ) ; <START_BUG> if ( def != null ) { <END_BUG> return def ; } if ( ( outer ) == null ) { return null ; } else { if ( limitStateScope ) { scope = NameScope . NAMES ; } return outer . findName ( name , scope ) ; } } @ Override public PDefinition findType ( ILexNameToken name , String fromModule ) { } @ Override public AStateDefinition findStateDefinition ( ) { } @ Override public void unusedCheck ( ) { } @ Override public boolean isVDMPP ( ) { } @ Override public boolean isSystem ( ) { } @ Override public SClassDefinition findClassDefinition ( ) { } @ Override public boolean isStatic ( ) { } @ Override public Set < PDefinition > findMatches ( ILexNameToken name ) { } @ Override public void markUsed ( ) { } public void setLimitStateScope ( boolean limitStateScope ) { } }

Fix:
if ( ( def != null ) && ( ! ( ExcludedDefinitions . isExcluded ( def ) ) ) ) {
Buggy code:
public class LoopControlPanel extends AbstractControllerGui implements ActionListener { private static final long serialVersionUID = 240L ; private JCheckBox infinite ; private JTextField loops ; private boolean displayName = true ; private static final String INFINITE = "Infinite<seq2seq4repair_space>Field" ; private static final String LOOPS = "Loops<seq2seq4repair_space>Field" ; public LoopControlPanel ( ) { } public LoopControlPanel ( boolean displayName ) { } @ Override public void configure ( TestElement element ) { } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement lc ) { } @ Override public void clearGui ( ) { } @ Override public void actionPerformed ( ActionEvent event ) { if ( infinite . isSelected ( ) ) { loops . setText ( "" ) ; loops . setEnabled ( false ) ; } else { loops . setEnabled ( true ) ; <START_BUG> new FocusRequester ( loops ) ; <END_BUG> } } @ Override public String getLabelResource ( ) { } private void init ( ) { } private JPanel createLoopCountPanel ( ) { } private void setState ( String loopCount ) { } private void setState ( int loopCount ) { } }

Fix:
FocusRequester . requestFocus ( loops ) ;
Buggy code:
public interface SqlMapGenerator { <START_BUG> public String generateSqlMap ( PsiClass psiClass , String tableName ) throws Exception ; <END_BUG> }

Fix:
public String generateSqlMap ( PsiClass psiClass ) throws Exception ;
Buggy code:
public abstract class FolderTreeNode extends DefaultMutableTreeNode implements TreeNodeInterface { protected static final ImageIcon collapsedIcon = ImageLoader . getSmallImageIcon ( "folder-closed.png" ) ; protected static final ImageIcon expandedIcon = ImageLoader . getSmallImageIcon ( "folder-open.png" ) ; protected FolderItem node ; protected Lock myLock ; private static int nextUid = 0 ; private final Class [ ] FOLDER_ITEM_ARG = new Class [ ] { FolderItem . class } ; private final Class [ ] STRING_ARG = new Class [ ] { String . class } ; public FolderTreeNode ( FolderItem node ) { } public static final FolderItem getDefaultItem ( String type , XmlElement props ) { } public TreePath getSelectionTreePath ( ) { } public static XmlElement getDefaultProperties ( ) { } public int getUid ( ) { } public ImageIcon getCollapsedIcon ( ) { } public ImageIcon getExpandedIcon ( ) { } public CapabilityList getSupportedActions ( ) { } public boolean tryToGetLock ( Object locker ) { } public void releaseLock ( ) { } public XmlElement getNode ( ) { } public FolderItem getFolderItem ( ) { } public String getName ( ) { } public void setName ( String s ) { } public String toString ( ) { } public void insert ( FolderTreeNode newFolder , int newIndex ) { } public void removeFolder ( ) throws Exception { } public abstract String getDefaultChild ( ) { } public final Hashtable getAttributes ( ) { } public abstract void createChildren ( WorkerStatusController worker ) { } public FolderTreeNode addFolder ( String name , String type ) throws Exception { <START_BUG> FolderPluginHandler handler = ( ( FolderPluginHandler ) ( pluginManager . getHandler ( "folder" ) ) ) ; <END_BUG> Class childClass = handler . getPluginClass ( type ) ; Method m_getDefaultProperties = childClass . getMethod ( "getDefaultProperties" , null ) ; XmlElement props = ( ( XmlElement ) ( m_getDefaultProperties . invoke ( null , null ) ) ) ; props . addAttribute ( "name" , name ) ; FolderItem childNode = FolderTreeNode . getDefaultItem ( type , props ) ; Object [ ] args = new Object [ ] { childNode } ; FolderTreeNode folder = null ; try { folder = ( ( FolderTreeNode ) ( handler . getPlugin ( type , args ) ) ) ; addWithXml ( folder ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return folder ; } public FolderTreeNode addFolder ( String name ) throws Exception { } public void addWithXml ( FolderTreeNode folder ) { } public TreeNode getChild ( String str ) { } public void setNode ( FolderItem node ) { } public void append ( FolderTreeNode child ) { } }

Fix:
FolderPluginHandler handler = ( ( FolderPluginHandler ) ( pluginManager . getHandler ( "org.columba.mail.folder" ) ) ) ;
Buggy code:
public class UploadPage extends WicketExamplePage { private static Log log = LogFactory . getLog ( UploadPage . class ) ; private List files = new ArrayList ( ) ; private UploadPage . FileListView fileListView ; private Folder uploadFolder ; public UploadPage ( final PageParameters parameters ) { } private void refreshFiles ( ) { } private void checkFileExists ( File newFile ) { } private class FileUploadForm extends UploadForm { private final Model fileModel = new Model ( ) ; public FileUploadForm ( String name ) { } protected void onSubmit ( ) { <START_BUG> FileItem item = ( ( FileItem ) ( fileModel . getObject ( ) ) ) ; <END_BUG> if ( item != null ) { String fileName = item . getName ( ) ; fileName = afterLast ( fileName , ':' ) ; fileName = afterLast ( fileName , '\\' ) ; fileName = afterLast ( fileName , '//' ) ; UploadPage . log . info ( ( "uploaded<seq2seq4repair_space>item:<seq2seq4repair_space>" + fileName ) ) ; File newFile = new File ( uploadFolder , fileName ) ; checkFileExists ( newFile ) ; try { newFile . createNewFile ( ) ; item . write ( newFile ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>file" ) ; } refreshFiles ( ) ; } } private String afterLast ( final String s , final char c ) { } } private class FileListView extends ListView { public FileListView ( String name , final List files ) { } protected void populateItem ( ListItem listItem ) { } } }

Fix:
FileItem item = ( ( FileItem ) ( fileModel . getObject ( this ) ) ) ;
Buggy code:
@ Widgetset ( "org.vaadin.artur.multiuserspreadsheet.MultiuserSpreadsheetWidgetset" ) @ Theme ( "mytheme" ) @ Push public class MultiUserSpreadsheet extends UI { @ WebServlet ( urlPatterns = "//*" , name = "MyUIServlet" , asyncSupported = true ) @ VaadinServletConfiguration ( ui = MultiUserSpreadsheet . class , productionMode = false ) public static class MyUIServlet extends VaadinServlet { } private Spreadsheet spreadsheet = new Spreadsheet ( ) ; ValueChangeListener changeListener = new ValueChangeListener ( ) { @ Override public void valueChanged ( final int row , final int col , final int cellType , final Object value ) { } } ; @ Override protected void init ( VaadinRequest vaadinRequest ) { final VerticalLayout layout = new VerticalLayout ( ) ; layout . setSizeFull ( ) ; layout . setMargin ( true ) ; setContent ( layout ) ; spreadsheet . addCellValueChangeListener ( new CellValueChangeListener ( ) { @ Override public void onCellValueChange ( CellValueChangeEvent event ) { for ( CellReference cellRef : event . getChangedCells ( ) ) { Cell cell = spreadsheet . getCell ( cellRef ) ; if ( cell == null ) { <START_BUG> return ; <END_BUG> } Object value = getCellValue ( cell ) ; int cellType = cell . getCellType ( ) ; MasterState . setCellValue ( cellRef . getRow ( ) , cellRef . getCol ( ) , cellType , value ) ; } } } ) ; Map < Position , CellData > initialData = MasterState . getStateAndListen ( changeListener ) ; addInitialData ( initialData ) ; spreadsheet . focus ( ) ; layout . addComponent ( spreadsheet ) ; layout . setExpandRatio ( spreadsheet , 1 ) ; addDetachListener ( new DetachListener ( ) { @ Override public void detach ( DetachEvent event ) { MasterState . removeListener ( changeListener ) ; } } ) ; } private void addInitialData ( Map < Position , CellData > initialData ) { } protected Object getCellValue ( Cell cell ) { } }

Fix:
continue ;
Buggy code:
public class TestConfig extends AbstractSolrTestCase { public String getSchemaFile ( ) { } public String getSolrConfigFile ( ) { } public void testJavaProperty ( ) { } public void testLucene23Upgrades ( ) throws Exception { } public void testAutomaticDeprecationSupport ( ) { <START_BUG> ShowFileRequestHandler handler = ( ( ShowFileRequestHandler ) ( h . getCore ( ) . getRequestHandler ( "admin//file" ) ) ) ; <END_BUG> assertTrue ( "file<seq2seq4repair_space>handler<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>automatically<seq2seq4repair_space>registered" , ( handler != null ) ) ; assertFalse ( handler . getHiddenFiles ( ) . contains ( "scheam.xml" . toUpperCase ( ) ) ) ; assertTrue ( handler . getHiddenFiles ( ) . contains ( "PROTWORDS.TXT" ) ) ; } }

Fix:
ShowFileRequestHandler handler = ( ( ShowFileRequestHandler ) ( h . getCore ( ) . getRequestHandler ( "//admin//file" ) ) ) ;
Buggy code:
public abstract class CachedFolder extends LocalFolder { protected AbstractHeaderCache headerCache ; public CachedFolder ( FolderItem item ) { } public Object addMessage ( AbstractMessage message , WorkerStatusController worker ) throws Exception { } public boolean exists ( Object uid , WorkerStatusController worker ) throws Exception { } public void expungeFolder ( WorkerStatusController worker ) throws Exception { } protected HeaderList getCachedHeaderList ( WorkerStatusController worker ) throws Exception { } public String getDefaultChild ( ) { } public HeaderList getHeaderList ( WorkerStatusController worker ) throws Exception { } public AbstractMessage getMessage ( Object uid , WorkerStatusController worker ) throws Exception { } public ColumbaHeader getMessageHeader ( Object uid , WorkerStatusController worker ) throws Exception { } public Object [ ] getUids ( WorkerStatusController worker ) throws Exception { <START_BUG> int count = getHeaderCacheInstance ( ) . count ( ) ; <END_BUG> Object [ ] uids = new Object [ count ] ; int i = 0 ; for ( Enumeration e = getCachedHeaderList ( worker ) . keys ( ) ; e . hasMoreElements ( ) ; ) { uids [ ( i ++ ) ] = e . nextElement ( ) ; } return uids ; } public void innerCopy ( Folder destFolder , Object [ ] uids , WorkerStatusController worker ) throws Exception { } protected void markMessage ( Object uid , int variant , WorkerStatusController worker ) throws Exception { } public void markMessage ( Object [ ] uids , int variant , WorkerStatusController worker ) throws Exception { } public void removeMessage ( Object uid , WorkerStatusController worker ) throws Exception { } public void save ( WorkerStatusController worker ) throws Exception { } public AbstractHeaderCache getHeaderCacheInstance ( ) { } }

Fix:
int count = getCachedHeaderList ( worker ) . count ( ) ;
Buggy code:
@ Path ( "//vm//{portMac}" ) public class VMInstanceResource extends AbstractWebResource { private final Logger log = LoggerFactory . getLogger ( getClass ( ) ) ; @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Response getVMInstance ( @ PathParam ( "portMac" ) String portMac ) { <START_BUG> String result = get ( TopoManagerService . class ) . getVmInstance ( portMac ) ; <END_BUG> return Response . status ( 202 ) . entity ( result ) . build ( ) ; } }

Fix:
String result = get ( org . iris4sdn . csdncm . vptopology . TopoManagerService . class ) . getVMInstance ( portMac ) ;
Buggy code:
public class TestSetParameter extends SingleEMFTestCase { private int userid ; private static String ORIGINAL_NAME = "Shannon" ; private static int ORIGINAL_AGE = 62 ; private static String UPDATED_NAME = "Obama" ; private static int UPDATED_AGE = 29 ; public void setUp ( ) { } public void testSetPositionalParameter ( ) { } public void testSetPositionalParameterInNonIntutiveOrder ( ) { } public void testSetNamedParameter ( ) { } public void testNativeSQL ( ) { EntityManager em = emf . createEntityManager ( ) ; em . getTransaction ( ) . begin ( ) ; <START_BUG> int count = em . createNativeQuery ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>Address<seq2seq4repair_space>(id,<seq2seq4repair_space>city," + "<seq2seq4repair_space>country,<seq2seq4repair_space>streetAd,<seq2seq4repair_space>zipcode)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,?,?,?,?)" ) ) . setParameter ( 1 , ( ( System . currentTimeMillis ( ) ) % 10000 ) ) . setParameter ( 2 , "Some<seq2seq4repair_space>City" ) . setParameter ( 3 , "Some<seq2seq4repair_space>Country" ) . setParameter ( 4 , "Some<seq2seq4repair_space>Street" ) . setParameter ( 5 , ( ( System . currentTimeMillis ( ) ) % 10000 ) ) . executeUpdate ( ) ; <END_BUG> em . getTransaction ( ) . commit ( ) ; assertEquals ( 1 , count ) ; } public CompUser createUser ( String name , String cName , int age , boolean isMale ) { } void verifyUpdate ( ) { } }

Fix:
int count = em . createNativeQuery ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>Address<seq2seq4repair_space>(id,<seq2seq4repair_space>city," + "<seq2seq4repair_space>country,<seq2seq4repair_space>streetAd,<seq2seq4repair_space>zipcode)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,?,?,?,?)" ) ) . setParameter ( 1 , ( ( System . currentTimeMillis ( ) ) % 10000 ) ) . setParameter ( 2 , "Some<seq2seq4repair_space>City" ) . setParameter ( 3 , "Some<seq2seq4repair_space>Country" ) . setParameter ( 4 , "Some<seq2seq4repair_space>Street" ) . setParameter ( 5 , String . valueOf ( ( ( System . currentTimeMillis ( ) ) % 10000 ) ) ) . executeUpdate ( ) ;
Buggy code:
public class Subsystem extends Classifier implements Package { public boolean _isInstantiable ; public Subsystem ( ) { } public Subsystem ( Name name ) { } public Subsystem ( Name name , boolean isInstantiable ) { } public Subsystem ( String nameStr ) { } public boolean getIsInstantiable ( ) { } public void setIsInstantiable ( boolean x ) throws PropertyVetoException { } public Vector _referencedElement ; public Vector getReferencedElement ( ) { } public void setReferencedElement ( Vector x ) throws PropertyVetoException { if ( ( _referencedElement ) == null ) _referencedElement = new Vector ( ) ; <START_BUG> fireVetoableChange ( "referencedElement" , _referencedElement , x ) ; <END_BUG> _referencedElement = x ; } public void addReferencedElement ( ModelElement x ) throws PropertyVetoException { } public void removeReferencedElement ( ModelElement x ) throws PropertyVetoException { } }

Fix:
fireVetoableChangeNoCompare ( "referencedElement" , _referencedElement , x ) ;
Buggy code:
class DataSoftVersion implements Cloneable , Comparable < DataSoftVersion > { private int id ; private LocalDate date ; private int opAdded ; private int opDeleted ; private int opUpdated ; private int dsAdded ; private int dsDeleted ; private int dsUpdated ; private int totalOp = 0 ; private int totalDs = 0 ; private int changesOp = 0 ; private int changesDs = 0 ; private int maintAct = 0 ; private int growthOp = 0 ; private int growthDs = 0 ; private float complexityOp = 0 ; private float complexityDs = 0 ; private float workRateOp = 0 ; private float workRateDs = 0 ; DataSoftVersion ( int id , LocalDate date , int opAdded , int opDeleted , int opUpdated , int dsAdded , int dsDeleted , int dsUpdated ) { } public void generateExtraDataFirst ( int initOp , int initDs ) { } public void generateExtraData ( int prevTotalOp , int prevTotalDs , LocalDate prevDate ) { try { totalOp = ( prevTotalOp + ( opAdded ) ) - ( opDeleted ) ; <START_BUG> totalDs = ( prevTotalDs + ( dsAdded ) ) - ( dsUpdated ) ; <END_BUG> growthOp = ( totalOp ) - prevTotalOp ; growthDs = ( totalDs ) - prevTotalDs ; if ( ( opAdded ) != 0 ) complexityOp = ( ( float ) ( ( opUpdated ) + ( opDeleted ) ) ) // ( opAdded ) ; else complexityOp = 0 ; if ( ( dsAdded ) != 0 ) complexityDs = ( ( float ) ( ( dsUpdated ) + ( dsDeleted ) ) ) // ( dsAdded ) ; else complexityDs = 0 ; int daysPassed = ( ( int ) ( ChronoUnit . DAYS . between ( prevDate , date ) ) ) ; workRateOp = ( ( float ) ( ( ( opAdded ) + ( opUpdated ) ) + ( opDeleted ) ) ) // daysPassed ; workRateDs = ( ( float ) ( ( ( dsAdded ) + ( dsUpdated ) ) + ( dsDeleted ) ) ) // daysPassed ; } catch ( Exception e ) { JOptionPane . showMessageDialog ( null , "Error<seq2seq4repair_space>in<seq2seq4repair_space>generateExtraData" ) ; } } public int getDataInt ( String vName ) { } public LocalDate getDate ( ) { } public double getDataFloat ( String vName ) { } public int compareTo ( DataSoftVersion o ) { } }

Fix:
totalDs = ( prevTotalDs + ( dsAdded ) ) - ( dsDeleted ) ;
Buggy code:
public class Javac12 extends DefaultCompilerAdapter { public boolean execute ( ) throws BuildException { attributes . log ( "Using<seq2seq4repair_space>classic<seq2seq4repair_space>compiler" , MSG_VERBOSE ) ; <START_BUG> Commandline cmd = setupJavacCommand ( ) ; <END_BUG> OutputStream logstr = new org . apache . tools . ant . taskdefs . LogOutputStream ( attributes , Project . MSG_WARN ) ; try { Class c = Class . forName ( "sun.tools.javac.Main" ) ; Constructor cons = c . getConstructor ( new Class [ ] { OutputStream . class , String . class } ) ; Object compiler = cons . newInstance ( new Object [ ] { logstr , "javac" } ) ; Method compile = c . getMethod ( "compile" , new Class [ ] { String [ ] . class } ) ; Boolean ok = ( ( Boolean ) ( compile . invoke ( compiler , new Object [ ] { cmd . getArguments ( ) } ) ) ) ; return ok . booleanValue ( ) ; } catch ( ClassNotFoundException ex ) { throw new BuildException ( ( "Cannot<seq2seq4repair_space>use<seq2seq4repair_space>classic<seq2seq4repair_space>compiler,<seq2seq4repair_space>as<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available" + ( "<seq2seq4repair_space>A<seq2seq4repair_space>common<seq2seq4repair_space>solution<seq2seq4repair_space>is<seq2seq4repair_space>to<seq2seq4repair_space>set<seq2seq4repair_space>the<seq2seq4repair_space>environment<seq2seq4repair_space>variable" + "<seq2seq4repair_space>JAVA_HOME<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>jdk<seq2seq4repair_space>directory." ) ) , location ) ; } catch ( Exception ex ) { if ( ex instanceof BuildException ) { throw ( ( BuildException ) ( ex ) ) ; } else { throw new BuildException ( "Error<seq2seq4repair_space>starting<seq2seq4repair_space>classic<seq2seq4repair_space>compiler:<seq2seq4repair_space>" , ex , location ) ; } } finally { try { logstr . close ( ) ; } catch ( IOException e ) { throw new BuildException ( e ) ; } } } }

Fix:
Commandline cmd = setupJavacCommand ( true ) ;
Buggy code:
public class TCPConfigGui extends AbstractConfigGui { private static final long serialVersionUID = 240L ; private ServerPanel serverPanel ; private JLabeledTextField classname ; private JCheckBox reUseConnection ; private JCheckBox setNoDelay ; private JCheckBox closeConnection ; private JTextField soLinger ; private JTextField eolByte ; private JTextArea requestData ; private boolean displayName = true ; public TCPConfigGui ( ) { } public TCPConfigGui ( boolean displayName ) { } @ Override public String getLabelResource ( ) { } @ Override public void configure ( TestElement element ) { super . configure ( element ) ; classname . setText ( element . getPropertyAsString ( CLASSNAME ) ) ; serverPanel . setServer ( element . getPropertyAsString ( SERVER ) ) ; <START_BUG> reUseConnection . setSelected ( element . getPropertyAsBoolean ( RE_USE_CONNECTION , true ) ) ; <END_BUG> serverPanel . setPort ( element . getPropertyAsString ( PORT ) ) ; serverPanel . setResponseTimeout ( element . getPropertyAsString ( TIMEOUT ) ) ; serverPanel . setConnectTimeout ( element . getPropertyAsString ( TIMEOUT_CONNECT ) ) ; setNoDelay . setSelected ( element . getPropertyAsBoolean ( NODELAY ) ) ; requestData . setText ( element . getPropertyAsString ( REQUEST ) ) ; closeConnection . setSelected ( element . getPropertyAsBoolean ( CLOSE_CONNECTION , CLOSE_CONNECTION_DEFAULT ) ) ; soLinger . setText ( element . getPropertyAsString ( SO_LINGER ) ) ; eolByte . setText ( element . getPropertyAsString ( EOL_BYTE ) ) ; } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement element ) { } @ Override public void clearGui ( ) { } private JPanel createNoDelayPanel ( ) { } private JPanel createClosePortPanel ( ) { } private JPanel createCloseConnectionPanel ( ) { } private JPanel createSoLingerOption ( ) { } private JPanel createEolBytePanel ( ) { } private JPanel createRequestPanel ( ) { } private void init ( ) { } }

Fix:
reUseConnection . setSelected ( element . getPropertyAsBoolean ( RE_USE_CONNECTION , RE_USE_CONNECTION_DEFAULT ) ) ;