nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ClientGuiThread implements Runnable { protected ObjectInputStream inStream = null ; protected ClientGui gui = null ; protected boolean exitListening = false ; public ClientGuiThread ( ClientGui gui ) { } @ Override public void run ( ) { try { while ( ! ( gui . tabController . isInitialized ( ) ) ) { Thread . sleep ( 100 ) ; } } catch ( InterruptedException ex ) { } Packet responsePacket ; PacketType ptype ; String message ; String sender ; String receiver ; do { responsePacket = read ( ) ; ptype = responsePacket . getIdentifier ( ) ; switch ( ptype ) { case DISCONNECT : exitListening = true ; break ; case GM : GroupMessagePacket gm = ( ( GroupMessagePacket ) ( responsePacket ) ) ; message = gm . getMessage ( ) ; sender = gm . getSender ( ) ; gui . tabController . outputLineOnGui ( ( ( ( "<" + sender ) + "><seq2seq4repair_space>" ) + message ) , 0 ) ; break ; case KICK : gui . tabController . outputLineOnGui ( ( ( networking . packets . KickPacket ) ( responsePacket ) ) . getMessage ( ) ) ; exitListening = true ; break ; case PM : PrivateMessagePacket pm = ( ( PrivateMessagePacket ) ( responsePacket ) ) ; message = pm . getMessage ( ) ; sender = pm . getSender ( ) ; receiver = pm . getReceiver ( ) ; String person = ( gui . clientName . equals ( receiver ) ) ? sender : receiver ; <START_BUG> if ( gui . tabController . outputLineOnGui ( ( ( ( "<" + sender ) + "><seq2seq4repair_space>" ) + message ) , receiver ) ) { <END_BUG> if ( gui . clientName . equals ( sender ) ) { gui . tabController . setFocusAt ( receiver ) ; } } break ; case USERLIST : List < String > list = ( ( networking . packets . UserListPacket ) ( responsePacket ) ) . getUserList ( ) ; gui . userListController . updateUserList ( list ) ; break ; case INFO : gui . tabController . outputLineOnGui ( ( ( networking . general . MessagePacket ) ( responsePacket ) ) . getMessage ( ) ) ; } } while ( ! ( exitListening ) ) ; gui . closeConnection ( ) ; } protected synchronized Packet read ( ) { } }

Fix:
if ( gui . tabController . outputLineOnGui ( ( ( ( "<" + sender ) + "><seq2seq4repair_space>" ) + message ) , person ) ) {
Buggy code:
public class GeohashPrefixTree extends SpatialPrefixTree { public static class Factory extends SpatialPrefixTreeFactory { @ Override protected int getLevelForDistance ( double degrees ) { GeohashPrefixTree grid = new GeohashPrefixTree ( ctx , GeohashPrefixTree . getMaxLevelsPossible ( ) ) ; <START_BUG> return ( grid . getLevelForDistance ( degrees ) ) + 1 ; <END_BUG> } @ Override protected SpatialPrefixTree newSPT ( ) { } } public GeohashPrefixTree ( SpatialContext ctx , int maxLevels ) { } public static int getMaxLevelsPossible ( ) { } @ Override public int getLevelForDistance ( double dist ) { final int level = GeohashPrefixTree . lookupHashLenForWidthHeight ( dist , dist ) ; return Math . max ( Math . min ( level , maxLevels ) , 1 ) ; } private static int lookupHashLenForWidthHeight ( double lonErr , double latErr ) { } private static final double [ ] hashLenToLatHeight ; private static final double [ ] hashLenToLonWidth ; @ Override public Node getNode ( Point p , int level ) { } @ Override public Node getNode ( String token ) { } @ Override public Node getNode ( byte [ ] bytes , int offset , int len ) { } @ Override public List < Node > getNodes ( Shape shape , int detailLevel , boolean inclParents ) { } class GhCell extends Node { GhCell ( String token ) { } GhCell ( byte [ ] bytes , int off , int len ) { } @ Override public void reset ( byte [ ] bytes , int off , int len ) { } @ Override public Collection < Node > getSubCells ( ) { } @ Override public int getSubCellsSize ( ) { } @ Override public Node getSubCell ( Point p ) { } private Shape shape ; @ Override public Shape getShape ( ) { } @ Override public Point getCenter ( ) { } private String getGeohash ( ) { } } }

Fix:
return grid . getLevelForDistance ( degrees ) ;
Buggy code:
public final class InteractionManager { private final NiftyMouseInputEvent mouseEvent ; private Draggable draggedObject ; private Element draggedGraphic ; private boolean isDragging ; private Nifty activeNifty ; private Screen activeScreen ; public InteractionManager ( ) { } public void dropAtMap ( final int x , final int y ) { } public void dropAtInventory ( final int slot ) { } public void cancelDragging ( ) { } public void startDragging ( final Draggable draggable ) { } public void setActiveNiftyEnv ( final Nifty nifty , final Screen screen ) { } public void notifyDraggingInventory ( int slot ) { } public void notifyDraggingMap ( int oldx , int oldy , int newx , int newy ) { if ( ! ( isDragging ) ) { final InteractiveMapTile targetTile = World . getMap ( ) . getInteractive ( ) . getInteractiveTileOnScreenLoc ( oldx , oldy ) ; if ( targetTile == null ) { return ; } if ( ! ( targetTile . canDrag ( ) ) ) { return ; } startDragging ( targetTile ) ; cleanDraggedElement ( ) ; if ( ( ( activeScreen ) != null ) && ( ( activeNifty ) != null ) ) { final Item movedItem = targetTile . getTopImage ( ) ; final int width = movedItem . getWidth ( ) ; final int height = movedItem . getHeight ( ) ; draggedGraphic = activeScreen . findElementByName ( "mapDragObject" ) ; draggedGraphic . resetLayout ( ) ; draggedGraphic . setConstraintWidth ( new SizeValue ( ( ( Integer . toString ( width ) ) + "px" ) ) ) ; draggedGraphic . setConstraintHeight ( new SizeValue ( ( ( Integer . toString ( height ) ) + "px" ) ) ) ; draggedGraphic . setConstraintX ( new SizeValue ( ( ( Integer . toString ( ( oldx - ( width // 2 ) ) ) ) + "px" ) ) ) ; draggedGraphic . setConstraintY ( new SizeValue ( ( ( Integer . toString ( ( oldy - ( height // 2 ) ) ) ) + "px" ) ) ) ; draggedGraphic . setVisible ( true ) ; draggedGraphic . reactivate ( ) ; final Element imgElement = draggedGraphic . findElementByName ( "mapDragImage" ) ; imgElement . setWidth ( width ) ; imgElement . setHeight ( height ) ; final ImageRenderer imgRender = imgElement . getRenderer ( ImageRenderer . class ) ; imgRender . setImage ( new de . lessvoid . nifty . render . NiftyImage ( activeNifty . getRenderEngine ( ) , new illarion . client . gui . EntitySlickRenderImage ( movedItem ) ) ) ; <START_BUG> activeScreen . layoutLayers ( ) ; <END_BUG> mouseEvent . initialize ( oldx , oldy , 0 , true , false , false ) ; mouseEvent . setButton0InitialDown ( true ) ; activeScreen . mouseEvent ( mouseEvent ) ; mouseEvent . initialize ( newx , newy , 0 , true , false , false ) ; activeScreen . mouseEvent ( mouseEvent ) ; } } } private void cleanDraggedElement ( ) { } }

Fix:
draggedGraphic . getParent ( ) . layoutElements ( ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class RunAsTestCase extends SecurityTest { private static final Logger log = Logger . getLogger ( RunAsTestCase . class . getName ( ) ) ; @ EJB ( mappedName = "java:global//ejb3security//WhoAmIBean!org.jboss.as.test.integration.ejb.security.WhoAmI" ) private WhoAmI whoAmIBean ; @ EJB ( mappedName = "java:global//ejb3security//EntryBean!org.jboss.as.test.integration.ejb.security.runas.EntryBean" ) private EntryBean entryBean ; @ Deployment public static Archive < ? > runAsDeployment ( ) { } @ Test public void testAuthentication_TwoBeans ( ) throws Exception { LoginContext lc = Util . getCLMLoginContext ( "user1" , "password1" ) ; lc . login ( ) ; try { String [ ] response = entryBean . doubleWhoAmI ( ) ; assertEquals ( "user1" , response [ 0 ] ) ; <START_BUG> assertEquals ( "run-as-principal" , response [ 1 ] ) ; <END_BUG> } finally { lc . logout ( ) ; } } @ Test public void testRunAsICIR_TwoBeans ( ) throws Exception { } @ Test public void testOnlyRole1 ( ) { } }

Fix:
assertEquals ( "anonymous" , response [ 1 ] ) ;
Buggy code:
public class QuestionHandler { private LinkedList < Question > usedQuestion = new LinkedList < Question > ( ) ; private Question currentQuestion ; private boolean currentQuestionAnswered = true ; private LinkedList < String > currentQuestionAnswers = null ; private int right = 0 ; private int takenHints = 0 ; private Question lastHintQuestion ; public QuestionHandler ( AssetManager am ) throws Exception { } public String getNextAnswer ( ) { } public Question getNextQuestion ( ) { <START_BUG> if ( ( ( usedQuestion ) != null ) && ( ( usedQuestion . size ( ) ) >= 0 ) ) { <END_BUG> if ( currentQuestionAnswered ) { currentQuestionAnswered = false ; currentQuestion = usedQuestion . getFirst ( ) ; usedQuestion . removeFirst ( ) ; } return currentQuestion ; } return null ; } public String getCat ( ) { } public int getRight ( ) { } public String getHint ( ) { } public int checkAnswer ( String answer ) { } }

Fix:
if ( ( ( usedQuestion ) != null ) && ( ( usedQuestion . size ( ) ) > 0 ) ) {
Buggy code:
@ Controller public class MainController { @ Autowired private MTwitterService service ; @ RequestMapping ( value = { "//{user}" , "//{user}//timeline" } , method = RequestMethod . GET ) public String getUserTimeline ( Model model , @ PathVariable ( "user" ) String user , @ ModelAttribute ( "newTweet" ) MTweet newTweet ) { } @ RequestMapping ( value = "//{user}//add" , method = RequestMethod . POST ) public String addNewTweet ( @ ModelAttribute ( "newTweet" ) MTweet newTweet , @ PathVariable ( "user" ) String user ) { } @ RequestMapping ( value = "//{user}//tweets" , method = RequestMethod . GET ) public String getUserTweets ( Model model , @ PathVariable ( "user" ) String user , @ ModelAttribute ( "newTweet" ) MTweet newTweet ) { } @ RequestMapping ( value = "//hashtag//{hashtag}" , method = RequestMethod . GET ) public String getTweetsByHashTag ( Model model , @ PathVariable ( "hashtag" ) String hashtag , @ ModelAttribute ( "newTweet" ) MTweet newTweet ) { List < MTweet > tweets = service . findByHashtag ( hashtag ) ; model . addAttribute ( "tweets" , tweets ) ; <START_BUG> model . addAttribute ( "pagetype" , ( "hashtag:<seq2seq4repair_space>" + hashtag ) ) ; <END_BUG> return "home" ; } No newline ; at end ; of file ; }

Fix:
model . addAttribute ( "pagetype" , ( "hashtag:<seq2seq4repair_space>#" + hashtag ) ) ;
Buggy code:
final class DeploymentModelBuilderJAXWS_EJB3 extends AbstractDeploymentModelBuilder { DeploymentModelBuilderJAXWS_EJB3 ( ) { } @ Override protected void build ( final Deployment dep , final DeploymentUnit unit ) { <START_BUG> this . getAndPropagateAttachment ( WS_ENDPOINTS_KEY , DeploymentJaxws . class , unit , dep ) ; <END_BUG> final JBossWebMetaData webMetaData = ASHelper . getJBossWebMetaData ( unit ) ; if ( webMetaData != null ) { dep . addAttachment ( JBossWebMetaData . class , webMetaData ) ; } this . log . debug ( "Creating<seq2seq4repair_space>JAXWS<seq2seq4repair_space>EJB3<seq2seq4repair_space>endpoints<seq2seq4repair_space>meta<seq2seq4repair_space>data<seq2seq4repair_space>model" ) ; for ( final EndpointJaxwsEjb container : ASHelper . getJaxwsEjbs ( unit ) ) { final String ejbName = container . getName ( ) ; this . log . debug ( ( "EJB3<seq2seq4repair_space>name:<seq2seq4repair_space>" + ejbName ) ) ; final String ejbClass = container . getClassName ( ) ; this . log . debug ( ( "EJB3<seq2seq4repair_space>class:<seq2seq4repair_space>" + ejbClass ) ) ; final Endpoint ep = this . newHttpEndpoint ( ejbClass , ejbName , dep ) ; ep . setProperty ( CONTAINER_NAME , container . getContainerName ( ) ) ; } } }

Fix:
this . getAndPropagateAttachment ( JAXWS_ENDPOINTS_KEY , DeploymentJaxws . class , unit , dep ) ;
Buggy code:
public class ProgressBar extends Control { public ProgressBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { <START_BUG> SWTProgressIndicator widget = ( ( SWTProgressIndicator ) ( new SWTProgressIndicator ( ) . alloc ( ) ) ) ; <END_BUG> widget . initWithFrame ( new NSRect ( ) ) ; widget . setUsesThreadedAnimation ( false ) ; widget . setIndeterminate ( ( ( ( style ) & ( SWT . INDETERMINATE ) ) != 0 ) ) ; if ( ( ( style ) & ( SWT . INDETERMINATE ) ) != 0 ) widget . startAnimation ( null ) ; view = widget ; } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getSelection ( ) { } public int getState ( ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setSelection ( int value ) { } public void setState ( int state ) { } }

Fix:
NSProgressIndicator widget = ( ( NSProgressIndicator ) ( new SWTProgressIndicator ( ) . alloc ( ) ) ) ;
Buggy code:
public class StrBuilderTest extends TestCase { private static Object FOO = new Object ( ) { public String toString ( ) { } } ; public static void main ( String [ ] args ) { } public static Test suite ( ) { } public StrBuilderTest ( String name ) { } public void testConstructors ( ) { } public void testCapacityAndLength ( ) { } public void testLength ( ) { } public void testSetLength ( ) { } public void testCapacity ( ) { } public void testEnsureCapacity ( ) { } public void testMinimizeCapacity ( ) { } public void testSize ( ) { } public void testIsEmpty ( ) { } public void testClear ( ) { } public void testCharAt ( ) { } public void testSetCharAt ( ) { } public void testNullText ( ) { } public void testAppendWithNullText ( ) { } public void testAppend_Object ( ) { } public void testAppend_CharArray ( ) { } public void testAppend_Primitive ( ) { } public void testAppend_PrimitiveNumber ( ) { } public void testAppendPadding ( ) { } public void testAppendFixedWidthPadLeft ( ) { StrBuilder sb = new StrBuilder ( ) ; sb . appendFixedWidthPadLeft ( "foo" , ( - 1 ) , '-' ) ; assertEquals ( "" , sb . toString ( ) ) ; sb . clear ( ) ; sb . appendFixedWidthPadLeft ( "foo" , 0 , '-' ) ; assertEquals ( "" , sb . toString ( ) ) ; sb . clear ( ) ; sb . appendFixedWidthPadLeft ( "foo" , 1 , '-' ) ; assertEquals ( "o" , sb . toString ( ) ) ; sb . clear ( ) ; sb . appendFixedWidthPadLeft ( "foo" , 2 , '-' ) ; assertEquals ( "oo" , sb . toString ( ) ) ; sb . clear ( ) ; sb . appendFixedWidthPadLeft ( "foo" , 3 , '-' ) ; assertEquals ( "foo" , sb . toString ( ) ) ; sb . clear ( ) ; sb . appendFixedWidthPadLeft ( "foo" , 4 , '-' ) ; assertEquals ( "-foo" , sb . toString ( ) ) ; sb . clear ( ) ; sb . appendFixedWidthPadLeft ( "foo" , 10 , '-' ) ; assertEquals ( 10 , sb . length ( ) ) ; assertEquals ( "-------foo" , sb . toString ( ) ) ; sb . clear ( ) ; sb . setNullText ( "null" ) ; <START_BUG> sb . appendFixedWidthPadRight ( null , 5 , '-' ) ; <END_BUG> assertEquals ( "-null" , sb . toString ( ) ) ; } public void testAppendFixedWidthPadLeft_int ( ) { } public void testAppendFixedWidthPadRight ( ) { } public void testAppendFixedWidthPadRight_int ( ) { } public void testAppendWithSeparators_Array ( ) { } public void testAppendWithSeparators_Collection ( ) { } public void testAppendWithSeparators_Iterator ( ) { } public void testAppendWithSeparatorsWithNullText ( ) { } public void testCharArray ( ) { } public void testInsert ( ) { } public void testInsertWithNullText ( ) { } }

Fix:
sb . appendFixedWidthPadLeft ( null , 5 , '-' ) ;
Buggy code:
public class ModClusterReset implements OperationStepHandler , DescriptionProvider { static final ModClusterReset INSTANCE = new ModClusterReset ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; modcluster . reset ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class CTPArbDetail { private static CTPArbDetail self ; public String tradingDay ; public String instrumentID ; public String exchangeID ; public String exchangeInstID ; public double lastPrice ; public double preSettlementPrice ; public double preClosePrice ; public double preOpenInterest ; public double openPrice ; public double highestPrice ; public double lowestPrice ; public double volume ; public double turnover ; public double openInterest ; public double closePrice ; public double settlementPrice ; public double upperLimitPrice ; public double lowerLimitPrice ; public double preDelta ; public double currDelta ; public String updateTime ; public double updateMillisec ; public double bidPrice1 ; public double bidVolume1 ; public double askPrice1 ; public double askVolume1 ; public double bidPrice2 ; public double bidVolume2 ; public double askPrice2 ; public double askVolume2 ; public double bidPrice3 ; public double bidVolume3 ; public double askPrice3 ; public double askVolume3 ; public double bidPrice4 ; public double bidVolume4 ; public double askPrice4 ; public double askVolume4 ; public double bidPrice5 ; public double bidVolume5 ; public double askPrice5 ; public double askVolume5 ; public double averagePrice ; public void setData ( String val , int loc ) { } public void setData ( double val , int loc ) { } private CTPArbDetail ( ) { } public static CTPArbDetail getInstance ( ) { } public ArbDetail getArbDetail ( ) { ArbDetail detail = new ArbDetail ( ) ; String symbol = instrumentID ; int year = Integer . valueOf ( symbol . substring ( 2 , 4 ) ) ; int month = Integer . valueOf ( symbol . substring ( 4 , 6 ) ) ; String monthAndDateString = ( ( ( ( 20 + "" ) + year ) + "年" ) + month ) + "月" ; detail . setSymbol ( symbol ) ; detail . setMonth ( monthAndDateString ) ; detail . setDate ( monthAndDateString ) ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( new Date ( ) ) ; String clockString = ( ( ( ( FormatTool . twoNumberFormat ( calendar . get ( Calendar . HOUR_OF_DAY ) ) ) + ":" ) + ( FormatTool . twoNumberFormat ( calendar . get ( Calendar . MINUTE ) ) ) ) + ":" ) + ( FormatTool . twoNumberFormat ( calendar . get ( Calendar . SECOND ) ) ) ; detail . setClock ( clockString ) ; detail . setPresentPrice ( lastPrice ) ; <START_BUG> detail . setBidPirce ( bidPrice1 ) ; <END_BUG> detail . setBid ( ( ( int ) ( bidVolume1 ) ) ) ; detail . setAskPrice ( askPrice1 ) ; detail . setAsk ( ( ( int ) ( askVolume1 ) ) ) ; detail . setVol ( ( ( int ) ( volume ) ) ) ; detail . setPreRepository ( ( ( int ) ( preOpenInterest ) ) ) ; detail . setRepository ( ( ( int ) ( openInterest ) ) ) ; detail . setPreClose ( preClosePrice ) ; detail . setOpen ( openPrice ) ; detail . setHigh ( highestPrice ) ; detail . setLow ( lowestPrice ) ; detail . setFullAmount ( turnover ) ; detail . setPreSettlePrice ( preSettlementPrice ) ; detail . setHardenPrice ( upperLimitPrice ) ; detail . setLimitPrice ( lowerLimitPrice ) ; detail . setAverPrice ( averagePrice ) ; return detail ; } }

Fix:
detail . setBidPrice ( bidPrice1 ) ;
Buggy code:
public class Player { private float padDir ; private Snake snk = new Snake ( ) ; private int killScore ; private int number ; private int color ; private String name ; private Effects equippedItem ; private Effects inUseItem ; private boolean useEquippedItemRequest ; private boolean isDead ; private int deathDate ; final GameEngine gameEngineRef ; static final int [ ] colors = new int [ ] { - 65536 , - 16763905 , - 30720 , - 16729344 , - 5635926 , - 1536 , - 39169 , - 7829368 , - 14492178 } ; static final String [ ] colorsName = new String [ ] { "Red" , "Blue" , "Orange" , "Green" , "Purple" , "Yellow" , "Pink" , "Grey" , "Cyan" } ; static final int nbColor = Math . min ( Player . colorsName . length , Player . colors . length ) ; static final Random random = new Random ( ) ; public Player ( int num , GameEngine gameEngineRef ) { } public void setName ( String s ) { } public String getName ( ) { } public int getNumber ( ) { } public int getScore ( ) { } public void addKillScore ( int score ) { } public int getColor ( ) { } public Snake getSnake ( ) { } public void newGame ( ) { } public void newRound ( ) { } public void kill ( int murderer ) { } public void revive ( ) { } public int getDeathTime ( ) { } public boolean isDead ( ) { } public boolean isRecentlyDead ( ) { } public void step ( ) { } public boolean hasEquippedItem ( ) { } public Effects getEquippedItem ( ) { } public boolean hasInUseItem ( ) { } public Effects getInUseItem ( ) { } public void sendUseItemRequest ( ) { } public void applyEffects ( Effects effect ) { if ( ( effect . snakeRadiusMultiplicator ) != 1.0F ) snk . setSize ( ( 0.5F * ( inUseItem . snakeRadiusMultiplicator ) ) ) ; if ( effect . fatalTrap ) { if ( effect . manualActivation ) { Part head = snk . getHead ( ) ; float lastRadius = head . radius ; <START_BUG> head . radius = 1.5F + ( Player . random . nextFloat ( ) ) ; <END_BUG> head . x += ( ( head . radius ) - lastRadius ) * ( Math . cos ( head . direction ) ) ; head . y += ( ( head . radius ) - lastRadius ) * ( Math . sin ( head . direction ) ) ; head . containingTrap = true ; } else { kill ( effect . player ) ; gameEngineRef . createDeathCertificate ( number , effect . player , Trap ) ; } } if ( effect . sharpTeeth ) ; if ( ( effect . snakeGrowth ) != 0 ) snk . changeLength ( effect . snakeGrowth ) ; } public void finishCurrenEffects ( ) { } void setPadDir ( float dir ) { } public float getSnakeHeadX ( ) { } public float getSnakeHeadY ( ) { } public float getSnakeHeadRadius ( ) { } public void cutSnake ( Part p ) { } public boolean canCollect ( Item item ) { } public void collect ( Item item ) { } protected static void changeKillScore ( Player [ ] players , int murderer , int victim ) { } }

Fix:
head . radius = 1.0F + ( 0.5F * ( Player . random . nextFloat ( ) ) ) ;
Buggy code:
class HelpIndex { public HelpIndex ( ) { } public void indexEditorHelp ( ) throws Exception { String jEditHome = jEdit . getJEditHome ( ) ; if ( jEditHome != null ) { indexDirectory ( MiscUtilities . constructPath ( jEditHome , "doc" , "users-guide" ) ) ; indexDirectory ( MiscUtilities . constructPath ( jEditHome , "doc" , "FAQ" ) ) ; } <START_BUG> EditPlugin [ ] jars = jEdit . getPluginJARs ( ) ; <END_BUG> for ( int i = 0 ; i < ( jars . length ) ; i ++ ) { indexJAR ( jars [ i ] . getZipFile ( ) ) ; } Log . log ( DEBUG , this , ( ( "Indexed<seq2seq4repair_space>" + ( words . size ( ) ) ) + "<seq2seq4repair_space>words" ) ) ; } public void indexDirectory ( String dir ) throws Exception { } public void indexJAR ( ZipFile jar ) throws Exception { } public void indexURL ( String url ) throws Exception { } public HelpIndex . Word lookupWord ( String word ) { } public HelpIndex . HelpFile getFile ( int index ) { } private static HelpIndex . Word . Occurrence [ ] EMPTY_ARRAY = new HelpIndex . Word . Occurrence [ 0 ] ; private static Object IGNORE = new Object ( ) ; private HashMap words ; private ArrayList files ; private void ignoreWord ( String word ) { } private void indexStream ( InputStream _in , String fileName ) throws Exception { } private void addWord ( String word , int file , boolean title ) { } static class Word { static final int TITLE_OCCUR = 10 ; String word ; int occurCount = 0 ; HelpIndex . Word . Occurrence [ ] occurrences ; Word ( String word , int file , boolean title ) { } void addOccurrence ( int file , boolean title ) { } static class Occurrence { int file ; int count ; Occurrence ( int file , boolean title ) { } } } static class HelpFile { String file ; String title ; HelpFile ( String file ) { } public String toString ( ) { } public boolean equals ( Object o ) { } } }

Fix:
PluginJAR [ ] jars = jEdit . getPluginJARs ( ) ;
Buggy code:
public class ModuleConfigImpl implements ModuleConfig { static final String DEPENDENCIES = "dependencies" ; static final String MAIN_CLASS = "main-class" ; static final String MODULE = "module" ; static final String MODULE_NS = "urn:jboss:module:1.1" ; static final String NAME = "name" ; static final String PATH = "path" ; static final String PROPERTY = "property" ; static final String PROPERTIES = "properties" ; static final String RESOURCES = "resources" ; static final String RESOURCE_ROOT = "resource-root" ; static final String VALUE = "value" ; private String schemaVersion = ModuleConfigImpl . MODULE_NS ; private String moduleName ; private String mainClass ; private Collection < Resource > resources ; private Collection < Dependency > dependencies ; private Map < String , String > properties ; public ModuleConfigImpl ( String moduleName ) { } @ Override public String getSchemaVersion ( ) { } @ Override public String getModuleName ( ) { } @ Override public String getMainClass ( ) { } public void setMainClass ( String mainClass ) { } @ Override public Collection < Resource > getResources ( ) { } public void addResource ( Resource res ) { } @ Override public Collection < Dependency > getDependencies ( ) { } public void addDependency ( Dependency dep ) { } @ Override public Map < String , String > getProperties ( ) { } public void setProperty ( String name , String value ) { } @ Override public void writeContent ( XMLExtendedStreamWriter writer , ModuleConfig value ) throws XMLStreamException { } private static final char [ ] NEW_LINE = new char [ ] { '\n' } ; protected static void writeNewLine ( XMLExtendedStreamWriter writer ) throws XMLStreamException { } public static void main ( String [ ] args ) throws Exception { ModuleConfigImpl module = new ModuleConfigImpl ( "o.r.g" ) ; module . setProperty ( "jboss.api" , "private" ) ; module . setProperty ( "prop" , ModuleConfigImpl . VALUE ) ; module . setMainClass ( "o.r.g.MainClass" ) ; module . addResource ( new ResourceRoot ( "a.jar" ) ) ; module . addResource ( new ResourceRoot ( "another.jar" ) ) ; module . addDependency ( new ModuleDependency ( "a.module" ) ) ; module . addDependency ( new ModuleDependency ( "another.module" ) ) ; StringWriter strWriter = new StringWriter ( ) ; <START_BUG> XMLExtendedStreamWriter writer = ModuleConfigImpl . create ( XMLOutputFactory . newFactory ( ) . createXMLStreamWriter ( strWriter ) ) ; <END_BUG> module . writeContent ( writer , module ) ; writer . flush ( ) ; System . out . println ( strWriter . toString ( ) ) ; } public static XMLExtendedStreamWriter create ( XMLStreamWriter writer ) throws Exception { } }

Fix:
XMLExtendedStreamWriter writer = ModuleConfigImpl . create ( XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( strWriter ) ) ;
Buggy code:
public class AddressbookTreeModel extends DefaultTreeModel implements TreeModel { protected DefaultXmlConfig folderXmlConfig ; private final Class [ ] FOLDER_ITEM_ARG = new Class [ ] { FolderItem . class } ; private static AddressbookTreeModel instance = new AddressbookTreeModel ( AddressbookConfig . getInstance ( ) . get ( "tree" ) . getElement ( "//tree" ) ) ; public AddressbookTreeModel ( XmlElement root ) { } public static AddressbookTreeModel getInstance ( ) { } public ISelectFolderDialog getSelectAddressbookFolderDialog ( ) { } public void createDirectories ( XmlElement parentTreeNode , AddressbookTreeNode parentFolder ) { } public AddressbookTreeNode add ( XmlElement childNode , AddressbookTreeNode parentFolder ) { FolderItem item = new FolderItem ( childNode ) ; if ( item == null ) { return null ; } <START_BUG> String name = item . get ( "property" , "name" ) ; <END_BUG> int uid = item . getInteger ( "uid" ) ; if ( ( AddressbookTreeNode . getNextFolderUid ( ) ) <= uid ) AddressbookTreeNode . setNextFolderUid ( ( uid + 1 ) ) ; String type = item . get ( "type" ) ; Object [ ] args = new Object [ ] { item } ; FolderPluginHandler handler = null ; try { handler = ( ( FolderPluginHandler ) ( PluginManager . getInstance ( ) . getHandler ( "org.columba.addressbook.folder" ) ) ) ; } catch ( PluginHandlerNotFoundException ex ) { NotifyDialog d = new NotifyDialog ( ) ; d . showDialog ( ex ) ; } AddressbookTreeNode folder = null ; try { folder = ( ( AddressbookTreeNode ) ( handler . getPlugin ( type , args ) ) ) ; parentFolder . add ( folder ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return folder ; } public AddressbookTreeNode getFolder ( int uid ) { } public IFolder getFolder ( String name ) { } }

Fix:
String name = item . getString ( "property" , "name" ) ;
Buggy code:
public class ElementNSImpl extends ElementImpl { static final long serialVersionUID = - 9142310625494392642L ; static final String xmlURI = "http:////www.w3.org//XML//1998//namespace" ; protected String namespaceURI ; protected String localName ; protected ElementNSImpl ( CoreDocumentImpl ownerDocument , String namespaceURI , String qualifiedName ) throws DOMException { } protected ElementNSImpl ( CoreDocumentImpl ownerDocument , String value ) { } public String getNamespaceURI ( ) { } public String getPrefix ( ) { } public void setPrefix ( String prefix ) throws DOMException { if ( needsSyncData ( ) ) { synchronizeData ( ) ; } if ( ownerDocument ( ) . errorChecking ) { if ( isReadOnly ( ) ) { throw new DOMException ( DOMException . NO_MODIFICATION_ALLOWED_ERR , "DOM001<seq2seq4repair_space>Modification<seq2seq4repair_space>not<seq2seq4repair_space>allowed" ) ; } if ( ! ( CoreDocumentImpl . isXMLName ( prefix ) ) ) { throw new DOMException ( DOMException . INVALID_CHARACTER_ERR , "DOM002<seq2seq4repair_space>Illegal<seq2seq4repair_space>character" ) ; } <START_BUG> if ( ( namespaceURI ) == null ) { <END_BUG> throw new DOMException ( DOMException . NAMESPACE_ERR , "DOM003<seq2seq4repair_space>Namespace<seq2seq4repair_space>error" ) ; } else if ( prefix != null ) { if ( prefix . equals ( "xml" ) ) { if ( ! ( namespaceURI . equals ( ElementNSImpl . xmlURI ) ) ) { throw new DOMException ( DOMException . NAMESPACE_ERR , "DOM003<seq2seq4repair_space>Namespace<seq2seq4repair_space>error" ) ; } } } } name = ( prefix + ":" ) + ( localName ) ; } public String getLocalName ( ) { } }

Fix:
if ( ( ( namespaceURI ) == null ) || ( ( prefix . indexOf ( ':' ) ) >= 0 ) ) {
Buggy code:
public class Player extends Mob { int walkingDirection = Direction . NONE ; int lookingDirection = Direction . UP ; ArrayList < Item > items = new ArrayList < Item > ( ) ; Weapon weapon = null ; public boolean fireButtonPressed = false ; public void walk ( int direction ) { } @ Override public void update ( long timeSinceLastUpdate ) { super . update ( timeSinceLastUpdate ) ; float moveFactor = 0.02F * ( timeSinceLastUpdate // 10000000 ) ; Point2f newPoint = new Point2f ( this . origin ) ; switch ( walkingDirection ) { case Direction . LEFT : newPoint . x -= moveFactor ; break ; case Direction . RIGHT : newPoint . x += moveFactor ; break ; case Direction . UP : newPoint . y -= moveFactor ; break ; case Direction . DOWN : newPoint . y += moveFactor ; break ; } <START_BUG> if ( ! ( level . hitTest ( newPoint , 16 , false ) ) ) { <END_BUG> this . origin = newPoint ; } if ( ( this . weapon ) != null ) { this . weapon . update ( timeSinceLastUpdate ) ; } } public Point2f getFaceVector ( ) { } public Item pickup ( Item item ) { } public Player ( ) { } }

Fix:
if ( ! ( level . hitTest ( newPoint , 16 , true ) ) ) {
Buggy code:
public class ChestTrap extends JavaPlugin { public String pluginname = "ChestTrap" ; private final BListener blockListener = new BListener ( this ) ; private final PListener playerlistener = new PListener ( this ) ; public Data chestData = new Data ( this ) ; public Random randomNumbers = new Random ( System . currentTimeMillis ( ) ) ; public Settings settings = new Settings ( this ) ; public PermissionHandler permissionHandler ; public boolean permissionsExists = false ; public boolean useSuperperms = false ; public void onDisable ( ) { } public void onEnable ( ) { } private void setupPermissions ( ) { Plugin permissionsPlugin = this . getServer ( ) . getPluginManager ( ) . getPlugin ( "Permissions" ) ; if ( ( permissionHandler ) == null ) { if ( permissionsPlugin != null ) { permissionsExists = true ; permissionHandler = ( ( com . nijikokun . bukkit . Permissions . Permissions ) ( permissionsPlugin ) ) . getHandler ( ) ; System . out . println ( ( ( "[" + ( pluginname ) ) + "]<seq2seq4repair_space>Permissions<seq2seq4repair_space>found!" ) ) ; } else { System . out . println ( ( ( "[" + ( pluginname ) ) + "]<seq2seq4repair_space>Permissions<seq2seq4repair_space>not<seq2seq4repair_space>detected.<seq2seq4repair_space>Looking<seq2seq4repair_space>for<seq2seq4repair_space>superperms." ) ) ; permissionsExists = false ; try { @ SuppressWarnings ( "unused" ) Permission fakePerm = new Permission ( "fake.perm" ) ; useSuperperms = true ; <START_BUG> System . out . println ( ( ( "[" + ( pluginname ) ) + "]<seq2seq4repair_space>Superpermis<seq2seq4repair_space>found." ) ) ; <END_BUG> } catch ( Exception e ) { System . out . println ( ( ( "[" + ( pluginname ) ) + "]<seq2seq4repair_space>Superperms<seq2seq4repair_space>not<seq2seq4repair_space>found.<seq2seq4repair_space>Using<seq2seq4repair_space>defaults." ) ) ; } } } } public boolean hasPermission ( Player p , String node ) { } public boolean isInteger ( String str ) { } }

Fix:
System . out . println ( ( ( "[" + ( pluginname ) ) + "]<seq2seq4repair_space>Superperms<seq2seq4repair_space>found." ) ) ;
Buggy code:
@ RunWith ( MockitoJUnitRunner . class ) public class YamlParserTest { @ Rule public ExpectedException exception = ExpectedException . none ( ) ; @ InjectMocks private YamlParser yamlParser = new YamlParser ( ) ; @ Mock private Yaml yaml ; @ Test public void throwExceptionWhenFileIsNotValid ( ) throws Exception { Mockito . when ( yaml . loadAs ( any ( InputStream . class ) , eq ( ParsedSlang . class ) ) ) . thenThrow ( IOException . class ) ; exception . expect ( RuntimeException . class ) ; <START_BUG> exception . expectMessage ( "syntax" ) ; <END_BUG> yamlParser . parse ( new SlangSource ( "a" , "b" ) ) ; } @ Test public void throwExceptionWhenSourceIsEmpty ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
exception . expectMessage ( "parsing" ) ;
Buggy code:
public class Simulation1 extends Simulation { @ Override protected void init ( ) { Road r1 = new Road ( new Point ( 20 , 20 ) , new Point ( 500 , 20 ) ) ; Lane l11 = new Lane ( Direction . IDENTICAL ) ; Lane l12 = new Lane ( Direction . OPPOSITE ) ; r1 . addLane ( l11 ) ; r1 . addLane ( l12 ) ; Road r2 = new Road ( new Point ( 500 , 20 ) , new Point ( 500 , 450 ) ) ; Lane l21 = new Lane ( Direction . IDENTICAL ) ; Lane l22 = new Lane ( Direction . OPPOSITE ) ; r2 . addLane ( l21 ) ; r2 . addLane ( l22 ) ; Road r3 = new Road ( new Point ( 500 , 450 ) , new Point ( 20 , 20 ) ) ; Lane l31 = new Lane ( Direction . IDENTICAL ) ; Lane l32 = new Lane ( Direction . OPPOSITE ) ; r3 . addLane ( l31 ) ; r3 . addLane ( l32 ) ; Road r4 = new Road ( new Point ( 500 , 20 ) , new Point ( 600 , 20 ) ) ; Lane l41 = new Lane ( Direction . IDENTICAL ) ; Lane l42 = new Lane ( Direction . OPPOSITE ) ; r4 . addLane ( l41 ) ; r4 . addLane ( l42 ) ; Road r5 = new Road ( new Point ( 600 , 20 ) , new Point ( 600 , 450 ) ) ; Lane l51 = new Lane ( Direction . IDENTICAL ) ; Lane l52 = new Lane ( Direction . OPPOSITE ) ; r5 . addLane ( l51 ) ; r5 . addLane ( l52 ) ; Road r6 = new Road ( new Point ( 600 , 450 ) , new Point ( 500 , 450 ) ) ; Lane l61 = new Lane ( Direction . IDENTICAL ) ; Lane l62 = new Lane ( Direction . OPPOSITE ) ; r6 . addLane ( l61 ) ; r6 . addLane ( l62 ) ; Road r7 = new Road ( new Point ( 600 , 450 ) , new Point ( 650 , 450 ) ) ; Lane l71 = new Lane ( Direction . IDENTICAL ) ; r7 . addLane ( l71 ) ; Junction j1 = new Junction ( ) ; j1 . connect ( l11 , l21 ) ; j1 . connect ( l11 , l41 ) ; j1 . connect ( l22 , l12 ) ; j1 . connect ( l22 , l41 ) ; j1 . connect ( l42 , l12 ) ; j1 . connect ( l42 , l21 ) ; Junction j2 = new Junction ( ) ; j2 . connect ( l21 , l31 ) ; j2 . connect ( l21 , l62 ) ; j2 . connect ( l32 , l22 ) ; j2 . connect ( l32 , l62 ) ; j2 . connect ( l61 , l22 ) ; j2 . connect ( l61 , l31 ) ; Junction j3 = new Junction ( ) ; j3 . connect ( l31 , l11 ) ; j3 . connect ( l12 , l32 ) ; Junction j4 = new Junction ( ) ; j4 . connect ( l41 , l51 ) ; j4 . connect ( l52 , l42 ) ; Junction j5 = new Junction ( ) ; j5 . connect ( l51 , l61 ) ; j5 . connect ( l51 , l71 ) ; j5 . connect ( l62 , l52 ) ; j5 . connect ( l62 , l71 ) ; map . addRoad ( r1 ) ; map . addRoad ( r2 ) ; map . addRoad ( r3 ) ; map . addRoad ( r4 ) ; map . addRoad ( r5 ) ; map . addRoad ( r6 ) ; map . addRoad ( r7 ) ; map . addJunction ( j1 ) ; map . addJunction ( j2 ) ; map . addJunction ( j3 ) ; map . addJunction ( j4 ) ; map . addJunction ( j5 ) ; addVehicle ( new RecklessCar ( ) , l11 , 1 ) ; <START_BUG> addVehicle ( new NormalCar ( ) , l11 , 20 ) ; <END_BUG> } }

Fix:
addVehicle ( new NormalBus ( ) , l11 , 20 ) ;
Buggy code:
@ RunWith ( JUnit4 . class ) public class SystemTest extends TestLog { public SystemTest ( ) throws Exception { } @ Test public void testMturkHTMLGenerator ( ) throws Exception { } @ Test public void testXMLGenerator ( ) throws Exception { } @ Test public void testColumnPipeline ( ) throws Exception { for ( int i = 0 ; i < ( testsFiles . length ) ; i ++ ) { try { System . out . println ( ( "File:" + ( testsFiles [ i ] ) ) ) ; CSVParser csvParser = new CSVParser ( new edu . umass . cs . surveyman . input . csv . CSVLexer ( testsFiles [ i ] , String . valueOf ( separators [ i ] ) ) ) ; Survey survey = csvParser . parse ( ) ; RandomRespondent rr = new RandomRespondent ( survey , AdversaryType . UNIFORM ) ; String headers = ResponseWriter . outputHeaders ( survey , new ArrayList < String > ( ) ) ; <START_BUG> String output = ResponseWriter . outputSurveyResponse ( survey , ( ( SurveyResponse ) ( rr . getResponse ( ) ) ) ) ; <END_BUG> new SurveyResponse ( "" ) . readSurveyResponses ( survey , new StringReader ( ( headers + output ) ) ) ; } catch ( SurveyException se ) { if ( super . outcome [ i ] ) throw se ; } catch ( NullPointerException npe ) { System . out . println ( String . format ( "Were<seq2seq4repair_space>we<seq2seq4repair_space>expecting<seq2seq4repair_space>survey<seq2seq4repair_space>%s<seq2seq4repair_space>to<seq2seq4repair_space>succeed?<seq2seq4repair_space>%b" , super . testsFiles [ i ] , super . outcome [ i ] ) ) ; if ( super . outcome [ i ] ) throw npe ; else System . out . println ( "THIS<seq2seq4repair_space>NEEDS<seq2seq4repair_space>TO<seq2seq4repair_space>FAIL<seq2seq4repair_space>GRACEFULLY" ) ; } } } No newline ; at end ; of file ; }

Fix:
String output = ResponseWriter . outputSurveyResponse ( survey , new SurveyResponse ( rr . getResponse ( ) ) ) ;
Buggy code:
public class TestIndexReaderCloneNorms extends LuceneTestCase { private class SimilarityOne extends DefaultSimilarity { @ Override public float lengthNorm ( String fieldName , int numTerms ) { } } private static final int NUM_FIELDS = 10 ; private Similarity similarityOne ; private Analyzer anlzr ; private int numDocNorms ; private ArrayList norms ; private ArrayList modifiedNorms ; private float lastNorm = 0 ; private float normDelta = ( ( float ) ( 0.001 ) ) ; public TestIndexReaderCloneNorms ( String s ) { } @ Override protected void setUp ( ) throws Exception { super . setUp ( ) ; similarityOne = new TestIndexReaderCloneNorms . SimilarityOne ( ) ; <START_BUG> anlzr = new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT ) ; <END_BUG> } public void testNorms ( ) throws IOException { } private void doTestNorms ( Directory dir ) throws IOException { } public void testNormsClose ( ) throws IOException { } private void createIndex ( Directory dir ) throws IOException { } private void modifyNormsForF1 ( Directory dir ) throws IOException { } private void modifyNormsForF1 ( IndexReader ir ) throws IOException { } private void verifyIndex ( Directory dir ) throws IOException { } private void verifyIndex ( IndexReader ir ) throws IOException { } private void addDocs ( Directory dir , int ndocs , boolean compound ) throws IOException { } private Document newDoc ( ) { } private float nextNorm ( ) { } }

Fix:
anlzr = new org . apache . lucene . analysis . standard . StandardAnalyzer ( TEST_VERSION_CURRENT ) ;
Buggy code:
public class AboutAction extends Action { private IWorkbenchWindow workbenchWindow ; public AboutAction ( IWorkbenchWindow window ) { } public void run ( ) { <START_BUG> new org . eclipse . ui . internal . dialogs . AboutDialog ( workbenchWindow . getShell ( ) ) . open ( ) ; <END_BUG> } }

Fix:
new org . eclipse . ui . internal . dialogs . AboutDialog ( workbenchWindow ) . open ( ) ;
Buggy code:
public class TestDocCount extends LuceneTestCase { public void testSimple ( ) throws Exception { } private Document doc ( ) { } private void verifyCount ( IndexReader ir ) throws Exception { Fields fields = MultiFields . getFields ( ir ) ; if ( fields == null ) { return ; } FieldsEnum e = fields . iterator ( ) ; String field ; while ( ( field = e . next ( ) ) != null ) { Terms terms = fields . terms ( field ) ; if ( terms == null ) { continue ; } int docCount = terms . getDocCount ( ) ; FixedBitSet visited = new FixedBitSet ( ir . maxDoc ( ) ) ; TermsEnum te = terms . iterator ( null ) ; while ( ( te . next ( ) ) != null ) { <START_BUG> DocsEnum de = _TestUtil . docs ( random ( ) , te , null , null , false ) ; <END_BUG> while ( ( de . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) { visited . set ( de . docID ( ) ) ; } } assertEquals ( visited . cardinality ( ) , docCount ) ; } } }

Fix:
DocsEnum de = _TestUtil . docs ( random ( ) , te , null , null , 0 ) ;
Buggy code:
public class VersionedMarshallingConfigurationService implements VersionedMarshallingConfiguration , Service < VersionedMarshallingConfiguration > { public static ServiceName getServiceName ( ServiceName deploymentUnitServiceName ) { <START_BUG> return deploymentUnitServiceName . append ( "marshalling-configuration" ) ; <END_BUG> } private static final int CURRENT_VERSION = 1 ; private final Map < Integer , MarshallingConfiguration > configurations = new HashMap < > ( ) ; private final Value < ModuleDeployment > deployment ; private final Value < ModuleLoader > loader ; public VersionedMarshallingConfigurationService ( Value < ModuleDeployment > deployment , Value < ModuleLoader > loader ) { } @ Override public void start ( StartContext context ) { } @ Override public void stop ( StopContext context ) { } @ Override public VersionedMarshallingConfiguration getValue ( ) { } @ Override public int getCurrentMarshallingVersion ( ) { } @ Override public MarshallingConfiguration getMarshallingConfiguration ( int version ) { } }

Fix:
return deploymentUnitServiceName . append ( "marshalling" ) ;
Buggy code:
public class TestBeanMap extends AbstractTestMap { public TestBeanMap ( String testName ) { } public static void main ( String [ ] args ) { } public static Test suite ( ) { } public static class BeanWithProperties implements Serializable { private int someInt ; private long someLong ; private double someDouble ; private float someFloat ; private short someShort ; private byte someByte ; private char someChar ; private Integer someInteger ; private String someString ; private Object someObject ; public int getSomeIntValue ( ) { } public void setSomeIntValue ( int value ) { } public long getSomeLongValue ( ) { } public void setSomeLongValue ( long value ) { } public double getSomeDoubleValue ( ) { } public void setSomeDoubleValue ( double value ) { } public float getSomeFloatValue ( ) { } public void setSomeFloatValue ( float value ) { } public short getSomeShortValue ( ) { } public void setSomeShortValue ( short value ) { } public byte getSomeByteValue ( ) { } public void setSomeByteValue ( byte value ) { } public char getSomeCharValue ( ) { } public void setSomeCharValue ( char value ) { } public String getSomeStringValue ( ) { } public void setSomeStringValue ( String value ) { } public Integer getSomeIntegerValue ( ) { } public void setSomeIntegerValue ( Integer value ) { } public Object getSomeObjectValue ( ) { } public void setSomeObjectValue ( Object value ) { } } public Object [ ] getSampleKeys ( ) { } private Object objectInFullMap = new Object ( ) ; public Object [ ] getSampleValues ( ) { } public Object [ ] getNewSampleValues ( ) { } public void verifyValues ( ) { } public boolean isPutAddSupported ( ) { } public boolean isRemoveSupported ( ) { } public Map makeFullMap ( ) { } public Map makeEmptyMap ( ) { } public String [ ] ignoredTests ( ) { } public void testMapClear ( ) { } public void testMapPut ( ) { } public void testBeanMapClone ( ) { } public void testBeanMapPutAllWriteable ( ) { } public void testMethodAccessor ( ) throws Exception { BeanMap map = ( ( BeanMap ) ( makeFullMap ( ) ) ) ; <START_BUG> Method method = TestBeanMap . BeanWithProperties . class . getDeclaredMethod ( "getSomeIntegerValue" , null ) ; <END_BUG> assertEquals ( method , map . getReadMethod ( "someIntegerValue" ) ) ; } public void testMethodMutator ( ) throws Exception { } }

Fix:
Method method = TestBeanMap . BeanWithProperties . class . getDeclaredMethod ( "getSomeIntegerValue" , ( ( Class [ ] ) ( null ) ) ) ;
Buggy code:
public class CommandEventPublisher implements EventPublisher { private final PsiElement psiElement ; private PsiType commandType ; public CommandEventPublisher ( PsiType psiType , PsiElement psiElement ) { } @ Override public boolean canPublishType ( PsiType eventType ) { <START_BUG> return eventType . isAssignableFrom ( commandType ) ; <END_BUG> } @ Override public PsiType getPublishedType ( ) { } @ Override public PsiElement getPsiElement ( ) { } @ Override public boolean isValid ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
return ( eventType != null ) && ( eventType . isAssignableFrom ( commandType ) ) ;
Buggy code:
public class Vocabulary_V2 extends Vocabulary_V1 { @ Override public void checkVersion ( String version ) throws SAXException { <START_BUG> if ( ! ( ( ( ( ( ( ( ( version . equals ( "2.0" ) ) || ( version . startsWith ( "2.1" ) ) ) || ( version . startsWith ( "2.2" ) ) ) || ( version . startsWith ( "2.3" ) ) ) || ( version . startsWith ( "3.0" ) ) ) || ( version . startsWith ( "3.1" ) ) ) || ( version . startsWith ( "3.2" ) ) ) || ( version . startsWith ( "3.2" ) ) ) ) { <END_BUG> throw new SAXException ( ( ( Resources . getMessage ( "WorkerLoad.10" ) ) + version ) ) ; } } @ Override public String getAnonymity ( ) { } @ Override public String getChecked ( ) { } @ Override public String getHeader ( ) { } @ Override public String getId ( ) { } @ Override public String getInfoloss ( ) { } @ Override public String getMax2 ( ) { } @ Override public String getMin2 ( ) { } @ Override public String getNode2 ( ) { } @ Override public String getPredecessors ( ) { } @ Override public String getSuccessors ( ) { } @ Override public String getTransformation ( ) { } @ Override public String getVocabularyVersion ( ) { } }

Fix:
if ( ! ( ( ( ( ( ( ( ( version . equals ( "2.0" ) ) || ( version . startsWith ( "2.1" ) ) ) || ( version . startsWith ( "2.2" ) ) ) || ( version . startsWith ( "2.3" ) ) ) || ( version . startsWith ( "3.0" ) ) ) || ( version . startsWith ( "3.1" ) ) ) || ( version . startsWith ( "3.2" ) ) ) || ( version . startsWith ( "3.3" ) ) ) ) {
Buggy code:
public class UMLSubmachineStateComboBoxModel extends UMLComboBoxModel2 { public UMLSubmachineStateComboBoxModel ( ) { } <START_BUG> protected boolean isValidElement ( MBase element ) { <END_BUG> return ( element instanceof MStateMachine ) && ( element != ( StateMachinesHelper . getHelper ( ) . getStateMachine ( getTarget ( ) ) ) ) ; } protected void buildModelList ( ) { } protected Object getSelectedModelElement ( ) { } }

Fix:
protected boolean isValidElement ( Object element ) {