nus-yam/ex-repair huggingface dataset:
Buggy code:
public class GameWindow implements Observer { public static final MinuetoColor BACKGROUND_COLOR = ExtendedMinuetoColor . mixColors ( BLACK , WHITE , 0.05 ) ; public static final int DEFAULT_MAP_WIDTH = 1000 ; public static final int DEFAULT_MAP_HEIGHT = 600 ; public static final int CONTROL_LAYOUT_HEIGHT = 150 ; private final ResizableWindow window ; private final MinuetoEventQueue queue ; private MapDisplay md ; private MapComponent mapComp ; private VerticalLayout windowLayout ; private HorizontalLayout controlBarLayout ; private AbstractButton endTurn ; private List < AbstractButton > choiceButtonsList ; public GameWindow ( MapDisplay mapDisp ) { } public MinuetoEventQueue getEventQueue ( ) { } public void render ( ) { } public void registerMouseHandler ( MinuetoMouseHandler h ) { } public void unregisterMouseHandler ( MinuetoMouseHandler h ) { } public void registerKeyboardHandler ( MinuetoKeyboardHandler h ) { } public void unregisterKeyboardHandler ( MinuetoKeyboardHandler h ) { } public void displayVillageResources ( int gold , int wood ) { } public void addChoiceLayout ( ChoiceType choiceType , List < String > choices ) { } public void addEndTurnButton ( ) { } public void removeEndTurnButton ( ) { } public void removeAllChoices ( ) { } public void hideVillageResources ( ) { } public void testAddTextField ( ) { } public void showMessage ( String message ) { } @ Override public void update ( Observable o , Object arg ) { if ( arg instanceof ChangedState ) { ChangedState changedState = ( ( ChangedState ) ( arg ) ) ; WindowComponent comp = ( ( WindowComponent ) ( o ) ) ; int width = comp . getWidth ( ) ; int height = comp . getHeight ( ) ; <START_BUG> if ( ( ( changedState == ( ChangedState . SIZE ) ) && ( comp == ( windowLayout ) ) ) && ( ( width != ( window . getWidth ( ) ) ) || ( height != ( window . getHeight ( ) ) ) ) ) { <END_BUG> System . out . println ( ( ( ( "[GameWindow]<seq2seq4repair_space>The<seq2seq4repair_space>layout<seq2seq4repair_space>now<seq2seq4repair_space>has<seq2seq4repair_space>size<seq2seq4repair_space>" + width ) + ",<seq2seq4repair_space>" ) + height ) ) ; window . resize ( width , height ) ; comp . drawOn ( window ) ; } } render ( ) ; } }

Fix:
if ( ( ( changedState == ( ChangedState . SIZE ) ) && ( comp == ( windowLayout ) ) ) && ( ( width != ( window . getWidth ( ) ) ) || ( height > ( window . getHeight ( ) ) ) ) ) {
Buggy code:
public class ToDoFragment extends Fragment { public static final String EXTRA_TODO_ID = "com.josephoh.williamsScheduler.todo_ID" ; private ToDoItem mToDoItem ; private EditText mTitleText ; private EditText mDescription ; public ToDoFragment ( ) { } public static ToDoFragment newInstance ( UUID id ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; UUID thisID = ( ( UUID ) ( getArguments ( ) . getSerializable ( ToDoFragment . EXTRA_TODO_ID ) ) ) ; <START_BUG> mToDoItem = OtherLab . get ( getActivity ( ) ) . getToDoItem ( thisID ) ; <END_BUG> } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup parent , Bundle savedInstanceState ) { } }

Fix:
mToDoItem = TodayLab . get ( getActivity ( ) ) . getToDoItem ( thisID ) ;
Buggy code:
public class RestClient { public static final String TAG = "RestClient" ; private static String csrfToken = "" ; private void getToken ( ) throws IOException { <START_BUG> getToken ( true ) ; <END_BUG> } private void getToken ( boolean reset ) throws IOException { } public JSONObject get ( String simpleUrl ) throws HttpException , IOException , URISyntaxException , JSONException { } public JSONObject post ( String url ) throws HttpException , IOException , JSONException { } public JSONObject post ( String url , List < NameValuePair > params ) throws HttpAuthenticationFailedException , HttpException , IOException , JSONException { } public JSONObject authpost ( String url , List < NameValuePair > params ) throws HttpAuthenticationFailedException , HttpException , IOException , JSONException { } public JSONObject authpost ( String url ) throws HttpException , IOException , JSONException { } public static void reportError ( Context context , Object obj ) { } protected void doRequiredAuth ( ) throws NoAccountException , IOException , JSONException { } public String stringGet ( String simpleUrl ) throws HttpException , IOException , URISyntaxException { } }

Fix:
getToken ( false ) ;
Buggy code:
public class Snippet29 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; Menu bar = new Menu ( shell , SWT . BAR ) ; shell . setMenuBar ( bar ) ; MenuItem fileItem = new MenuItem ( bar , SWT . CASCADE ) ; <START_BUG> fileItem . setText ( "File" ) ; <END_BUG> Menu submenu = new Menu ( shell , SWT . DROP_DOWN ) ; fileItem . setMenu ( submenu ) ; MenuItem item = new MenuItem ( submenu , SWT . PUSH ) ; item . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event e ) { System . out . println ( "Select<seq2seq4repair_space>All" ) ; } } ) ; item . setText ( "Select<seq2seq4repair_space>&All\tCtrl+A" ) ; item . setAccelerator ( ( ( SWT . MOD1 ) + 'A' ) ) ; shell . setSize ( 200 , 200 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
fileItem . setText ( "&File" ) ;
Buggy code:
public class AbstractProjectTest extends AbstractMyrmidonTest { private DefaultEmbeddor m_embeddor ; public AbstractProjectTest ( final String name ) { } protected void tearDown ( ) throws Exception { } protected Embeddor getEmbeddor ( ) throws Exception { if ( ( m_embeddor ) == null ) { Thread . currentThread ( ) . setContextClassLoader ( getClass ( ) . getClassLoader ( ) ) ; <START_BUG> final Logger logger = createLogger ( ) ; <END_BUG> m_embeddor = new DefaultEmbeddor ( ) ; m_embeddor . enableLogging ( logger ) ; final Parameters params = new Parameters ( ) ; final File instDir = getHomeDirectory ( ) ; params . setParameter ( "myrmidon.home" , instDir . getAbsolutePath ( ) ) ; m_embeddor . parameterize ( params ) ; m_embeddor . initialize ( ) ; m_embeddor . start ( ) ; } return m_embeddor ; } protected void executeTargetExpectError ( final File projectFile , final String targetName , final String message ) { } protected void executeTargetExpectError ( final File projectFile , final String targetName , final String [ ] messages ) { } protected void executeTarget ( final File projectFile , final String targetName ) throws Exception { } protected void executeTarget ( final File projectFile , final String targetName , final ProjectListener listener ) throws Exception { } }

Fix:
final Logger logger = getLogger ( ) ;
Buggy code:
public class Trading { NPC npc ; Player player ; ItemRepository itemRepo = GameBeans . getItemRepository ( ) ; public Trading ( NPC npc , Player player ) { } public void trade ( boolean buy , boolean sell ) { List < MenuItem > tradeList = new ArrayList < > ( ) ; String buyCommand = "Buy<seq2seq4repair_space>from<seq2seq4repair_space>" + ( npc . getName ( ) ) ; String sellCommand = "Sell<seq2seq4repair_space>to<seq2seq4repair_space>" + ( npc . getName ( ) ) ; if ( buy ) { tradeList . add ( new MenuItem ( buyCommand , null ) ) ; } if ( sell ) { tradeList . add ( new MenuItem ( sellCommand , null ) ) ; } tradeList . add ( new MenuItem ( "Exit" , null ) ) ; Menus tradeMenu = new Menus ( ) ; MenuItem response = tradeMenu . displayMenu ( tradeList ) ; String command = response . getCommand ( ) ; if ( ( command . equals ( buyCommand ) ) && buy ) { playerBuy ( ) ; } else if ( ( command . equals ( sellCommand ) ) && sell ) { playerSell ( ) ; } else <START_BUG> if ( command . equals ( "exit" ) ) { <END_BUG> return ; } trade ( buy , sell ) ; } public void playerBuy ( ) { } public void playerSell ( ) { } private Item tradeItem ( Entity seller , Entity buyer , String itemName ) { } }

Fix:
if ( command . equals ( "Exit" ) ) {
Buggy code:
public class SDClientDriver { private Registry registry ; private SDMasterService masterService ; public SDClientDriver ( ) { } public void lookup ( String method , Object [ ] args ) { if ( method == "create" ) { try { <START_BUG> masterService . createFile ( ( ( String ) ( args [ 0 ] ) ) , ( ( Integer ) ( args [ 1 ] ) ) ) ; <END_BUG> } catch ( RemoteException e ) { e . printStackTrace ( ) ; } } } }

Fix:
masterService . createFile ( ( ( String ) ( args [ 0 ] ) ) , ( ( Integer ) ( args [ 1 ] ) ) , true ) ;
Buggy code:
public class Desiderata { private ArrayList < Club > listeClub ; private int club1 ; private int club2 ; private String op ; public Desiderata ( int club1 , int club2 , String op , ArrayList < Club > listeClub ) throws IllegalArgumentException { } public int getClub1 ( ) { } public void setClub1 ( int club1 ) throws IllegalArgumentException { } public int getClub2 ( ) { } public void setClub2 ( int club2 ) throws IllegalArgumentException { boolean ok = false ; for ( Club c : this . listeClub ) { <START_BUG> if ( ( c . getId ( ) ) == ( club1 ) ) { <END_BUG> this . club2 = club2 ; ok = true ; } } if ( ! ok ) { throw new IllegalArgumentException ( ( club2 + "<seq2seq4repair_space>:<seq2seq4repair_space>id<seq2seq4repair_space>non<seq2seq4repair_space>compris<seq2seq4repair_space>dans<seq2seq4repair_space>la<seq2seq4repair_space>division" ) ) ; } } public String getOp ( ) { } public void setOp ( String op ) { } public String toString ( ) { } }

Fix:
if ( ( c . getId ( ) ) == club2 ) {
Buggy code:
public class MutableFloatTest extends TestCase { public MutableFloatTest ( String testName ) { } public void testConstructors ( ) { assertEquals ( 0.0F , new MutableFloat ( ) . floatValue ( ) , 1.0E-4F ) ; assertEquals ( 1.0F , new MutableFloat ( 1.0F ) . floatValue ( ) , 1.0E-4F ) ; assertEquals ( 2.0F , new MutableFloat ( new Float ( 2.0F ) ) . floatValue ( ) , 1.0E-4F ) ; assertEquals ( 3.0F , new MutableFloat ( new MutableFloat ( 3.0F ) ) . floatValue ( ) , 1.0E-4F ) ; <START_BUG> assertEquals ( 2.0F , new MutableDouble ( "2.0" ) . floatValue ( ) , 1.0E-4F ) ; <END_BUG> try { new MutableFloat ( ( ( Number ) ( null ) ) ) ; fail ( ) ; } catch ( NullPointerException ex ) { } } public void testGetSet ( ) { } public void testNanInfinite ( ) { } public void testEquals ( ) { } public void testHashCode ( ) { } public void testCompareTo ( ) { } public void testPrimitiveValues ( ) { } public void testToFloat ( ) { } public void testIncrement ( ) { } public void testDecrement ( ) { } public void testAddValuePrimitive ( ) { } public void testAddValueObject ( ) { } public void testSubtractValuePrimitive ( ) { } public void testSubtractValueObject ( ) { } public void testToString ( ) { } }

Fix:
assertEquals ( 2.0F , new MutableFloat ( "2.0" ) . floatValue ( ) , 1.0E-4F ) ;
Buggy code:
public class CTXCommandMenu extends JMenu implements CommandListener , ActionListener { public CTXCommandMenu ( String name ) { } public synchronized void add ( Command command ) { } public synchronized void add ( Command command , MenuShortcut shortcut ) { } public synchronized void addCheckItem ( Command command ) { } public synchronized void add ( CommandMenuItem item ) { } public synchronized void add ( CommandCheckBoxMenuItem checkItem ) { } protected void addMenuItem ( JMenuItem m ) { } public synchronized void remove ( Command command ) { } public synchronized void remove ( MenuItem item ) { } public synchronized void enable ( String name , boolean state ) { for ( int i = 0 ; i < ( getItemCount ( ) ) ; i ++ ) { JMenuItem item = getItem ( i ) ; <START_BUG> if ( name . equals ( item . getLabel ( ) ) ) { <END_BUG> item . setEnabled ( state ) ; return ; } } } public synchronized void checkEnabled ( ) { } public void actionPerformed ( ActionEvent e ) { } public void commandExecuted ( EventObject commandEvent ) { } public void commandExecutable ( EventObject commandEvent ) { } public void commandNotExecutable ( EventObject commandEvent ) { } }

Fix:
if ( name . equals ( item . getText ( ) ) ) {
Buggy code:
public abstract class SessionSafeFunctionHandler implements FunctionHandler { private static final String PROCESS_MANAGERTOKEN_ID = "processManagertokenId" ; private static final String CANCEL_PARAMETER = "cancel" ; @ Override public final String getDestination ( String function , ProcessManagerSessionController session , HttpServletRequest request ) throws ProcessManagerException { List < FileItem > items = null ; String currentTokenId = session . getCurrentTokenId ( ) ; if ( FileUploadUtil . isRequestMultipart ( request ) ) { try { items = new ArrayList < FileItem > ( ) ; items . addAll ( FileUploadUtil . parseRequest ( request ) ) ; } catch ( UtilException e ) { <START_BUG> SilverTrace . error ( "processManager" , "SessionSafeFunctionHandler.getDestination()" , "processManager.EX_CHECKING_TOKENID" , e ) ; <END_BUG> } } if ( ! ( checkTokenId ( session , currentTokenId , request , items ) ) ) { return "//processManager//jsp//multiWindowDetected.jsp" ; } return computeDestination ( function , session , request , items ) ; } private boolean checkTokenId ( ProcessManagerSessionController session , String currentTokenId , HttpServletRequest request , List < FileItem > items ) { } private boolean doVerifications ( String currentTokenId , String givenTokenId , boolean isCancellation ) { } protected void generateTokenId ( ProcessManagerSessionController session , HttpServletRequest request ) { } protected void resetTokenId ( ProcessManagerSessionController session , HttpServletRequest request ) { } protected abstract String computeDestination ( String function , ProcessManagerSessionController session , HttpServletRequest request , List < FileItem > items ) throws ProcessManagerException { } }

Fix:
SilverTrace . error ( "processManager" , "SessionSafeFunctionHandler.getDestination()" , "processManager.TOKENID_CHECK_FAILURE" , e ) ;
Buggy code:
public class InterpreterHandler extends AbstractPluginHandler { private Hashtable interpreterTable ; public InterpreterHandler ( ) { } public String [ ] getPluginIdList ( ) { } public AbstractInterpreter getInterpreter ( String type ) { } public void addExtension ( String id , XmlElement extension ) { XmlElement interpreter = extension . getElement ( "interpreter" ) ; try { <START_BUG> interpreterTable . put ( interpreter . getAttribute ( "name" ) , PluginLoader . loadExternalPlugin ( interpreter . getAttribute ( "main_class" ) , pluginManager . getPluginType ( id ) , pluginManager . getPluginDir ( id ) , null ) ) ; <END_BUG> } catch ( Exception e ) { e . printStackTrace ( ) ; } } }

Fix:
interpreterTable . put ( interpreter . getAttribute ( "name" ) , PluginLoader . loadExternalPlugin ( interpreter . getAttribute ( "main_class" ) , pluginManager . getPluginType ( id ) , pluginManager . getJarFile ( id ) , null ) ) ;
Buggy code:
public class GoClassifierToBeh implements TreeModelPrereqs { public String toString ( ) { <START_BUG> return Localizer . localize ( "Tree" , "Class->Operation" ) ; <END_BUG> } public Object getRoot ( ) { } public void setRoot ( Object r ) { } public Object getChild ( Object parent , int index ) { } public int getChildCount ( Object parent ) { } public int getIndexOfChild ( Object parent , Object child ) { } public boolean isLeaf ( Object node ) { } public void valueForPathChanged ( TreePath path , Object newValue ) { } public void addTreeModelListener ( TreeModelListener l ) { } public void removeTreeModelListener ( TreeModelListener l ) { } public Vector getPrereqs ( ) { } public Vector getProvidedTypes ( ) { } }

Fix:
return Localizer . localize ( "Tree" , "misc.class.operation" ) ;
Buggy code:
public class CartesianPolyFilterBuilder { public static final double MILES_FLOOR = 1.0 ; private IProjector projector = new SinusoidalProjector ( ) ; private final String tierPrefix ; private int minTier ; private int maxTier ; public CartesianPolyFilterBuilder ( String tierPrefix , int minTierIndexed , int maxTierIndexed ) { } public Shape getBoxShape ( double latitude , double longitude , double miles ) { if ( miles < ( CartesianPolyFilterBuilder . MILES_FLOOR ) ) { miles = CartesianPolyFilterBuilder . MILES_FLOOR ; } LLRect box1 = LLRect . createBox ( new FloatLatLng ( latitude , longitude ) , miles , miles ) ; LatLng lowerLeft = box1 . getLowerLeft ( ) ; LatLng upperRight = box1 . getUpperRight ( ) ; double latUpperRight = upperRight . getLat ( ) ; double latLowerLeft = lowerLeft . getLat ( ) ; double longUpperRight = upperRight . getLng ( ) ; double longLowerLeft = lowerLeft . getLng ( ) ; <START_BUG> CartesianTierPlotter ctp = new CartesianTierPlotter ( miles , projector , tierPrefix ) ; <END_BUG> Shape shape = new Shape ( ctp . getTierLevelId ( ) ) ; if ( longUpperRight < longLowerLeft ) { addBoxes ( shape , ctp , latLowerLeft , longLowerLeft , latUpperRight , LONGITUDE_DEGREE_MAX ) ; addBoxes ( shape , ctp , latLowerLeft , ( - ( LatLng . LONGITUDE_DEGREE_MIN ) ) , latUpperRight , longUpperRight ) ; } else { addBoxes ( shape , ctp , latLowerLeft , longLowerLeft , latUpperRight , longUpperRight ) ; } return shape ; } private void addBoxes ( Shape shape , CartesianTierPlotter tierPlotter , double lat1 , double long1 , double lat2 , double long2 ) { } public Filter getBoundingArea ( double latitude , double longitude , double miles ) { } }

Fix:
CartesianTierPlotter ctp = new CartesianTierPlotter ( miles , projector , tierPrefix , minTier , maxTier ) ;
Buggy code:
public class BundleResolveProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { DeploymentUnit depUnit = phaseContext . getDeploymentUnit ( ) ; Deployment deployment = depUnit . getAttachment ( DEPLOYMENT_KEY ) ; <START_BUG> XBundle bundle = depUnit . getAttachment ( INSTALLED_BUNDLE ) ; <END_BUG> if ( ( bundle == null ) || ( ( deployment . isAutoStart ( ) ) == false ) ) return ; if ( depUnit . hasAttachment ( MODULE ) ) return ; XBundleRevision brev = bundle . getBundleRevision ( ) ; XEnvironment env = depUnit . getAttachment ( ENVIRONMENT_KEY ) ; XResolver resolver = depUnit . getAttachment ( RESOLVER_KEY ) ; XResolveContext context = resolver . createResolveContext ( env , Collections . singleton ( brev ) , null ) ; try { Map < Resource , Wiring > wiremap = resolver . resolveAndApply ( context ) ; BundleWiring wiring = ( ( BundleWiring ) ( wiremap . get ( brev ) ) ) ; depUnit . putAttachment ( BUNDLE_WIRING_KEY , wiring ) ; } catch ( ResolutionException ex ) { OSGiLogger . LOGGER . warnCannotResolve ( ex . getUnresolvedRequirements ( ) ) ; } } @ Override public void undeploy ( final DeploymentUnit depUnit ) { } }

Fix:
XBundle bundle = depUnit . getAttachment ( INSTALLED_BUNDLE_KEY ) ;
Buggy code:
public abstract class AjaxFormChoiceComponentUpdatingBehavior extends AbstractDefaultAjaxBehavior { private static final long serialVersionUID = 1L ; public AjaxFormChoiceComponentUpdatingBehavior ( ) { } public void renderHead ( IHeaderResponse response ) { super . renderHead ( response ) ; AppendingStringBuffer asb = new AppendingStringBuffer ( ) ; asb . append ( "function<seq2seq4repair_space>attachChoiceHandlers(markupId,<seq2seq4repair_space>callbackScript)<seq2seq4repair_space>{\n" ) ; asb . append ( "<seq2seq4repair_space>var<seq2seq4repair_space>inputNodes<seq2seq4repair_space>=<seq2seq4repair_space>wicketGet(markupId).getElementsByTagName(\'input\');\n" ) ; asb . append ( "<seq2seq4repair_space>for<seq2seq4repair_space>(var<seq2seq4repair_space>i<seq2seq4repair_space>=<seq2seq4repair_space>0<seq2seq4repair_space>;<seq2seq4repair_space>i<seq2seq4repair_space><<seq2seq4repair_space>inputNodes.length<seq2seq4repair_space>;<seq2seq4repair_space>i<seq2seq4repair_space>++)<seq2seq4repair_space>{\n" ) ; asb . append ( "<seq2seq4repair_space>var<seq2seq4repair_space>inputNode<seq2seq4repair_space>=<seq2seq4repair_space>inputNodes[i];\n" ) ; asb . append ( "<seq2seq4repair_space>if<seq2seq4repair_space>(!inputNode.type)<seq2seq4repair_space>continue;\n" ) ; asb . append ( "<seq2seq4repair_space>var<seq2seq4repair_space>inputType<seq2seq4repair_space>=<seq2seq4repair_space>inputNode.type.toLowerCase();\n" ) ; <START_BUG> asb . append ( "<seq2seq4repair_space>if<seq2seq4repair_space>(inputType<seq2seq4repair_space>==<seq2seq4repair_space>\'check\'<seq2seq4repair_space>||<seq2seq4repair_space>inputType<seq2seq4repair_space>==<seq2seq4repair_space>\'radio\')<seq2seq4repair_space>{\n" ) ; <END_BUG> asb . append ( "<seq2seq4repair_space>Wicket.Event.add(inputNode,<seq2seq4repair_space>\'click\',<seq2seq4repair_space>callbackScript);\n" ) ; asb . append ( "<seq2seq4repair_space>}\n" ) ; asb . append ( "<seq2seq4repair_space>}\n" ) ; asb . append ( "}\n" ) ; response . renderJavascript ( asb , "attachChoice" ) ; response . renderOnLoadJavascript ( ( ( ( ( "attachChoiceHandlers('" + ( getComponent ( ) . getMarkupId ( ) ) ) + "',<seq2seq4repair_space>function()<seq2seq4repair_space>{" ) + ( getEventHandler ( ) ) ) + "});" ) ) ; } protected abstract void onUpdate ( AjaxRequestTarget target ) { } protected void onError ( AjaxRequestTarget target , RuntimeException e ) { } protected void onBind ( ) { } protected final FormComponent getFormComponent ( ) { } protected final CharSequence getEventHandler ( ) { } protected final void respond ( final AjaxRequestTarget target ) { } }

Fix:
asb . append ( "<seq2seq4repair_space>if<seq2seq4repair_space>(inputType<seq2seq4repair_space>==<seq2seq4repair_space>\'checkbox\'<seq2seq4repair_space>||<seq2seq4repair_space>inputType<seq2seq4repair_space>==<seq2seq4repair_space>\'radio\')<seq2seq4repair_space>{\n" ) ;
Buggy code:
public class TestRunTime extends JMeterTestCase { public TestRunTime ( String name ) { } public void testProcessing ( ) throws Exception { RunTime controller = new RunTime ( ) ; controller . setRuntime ( 10 ) ; TestSampler samp1 = new TestSampler ( "Sample<seq2seq4repair_space>1" , 500 ) ; <START_BUG> TestSampler samp2 = new TestSampler ( "Sample<seq2seq4repair_space>2" , 500 ) ; <END_BUG> LoopController sub1 = new LoopController ( ) ; sub1 . setLoops ( 2 ) ; sub1 . setContinueForever ( false ) ; sub1 . addTestElement ( samp1 ) ; LoopController sub2 = new LoopController ( ) ; sub2 . setLoops ( 40 ) ; sub2 . setContinueForever ( false ) ; sub2 . addTestElement ( samp2 ) ; controller . addTestElement ( sub1 ) ; controller . addTestElement ( sub2 ) ; controller . setRunningVersion ( true ) ; sub1 . setRunningVersion ( true ) ; sub2 . setRunningVersion ( true ) ; controller . initialize ( ) ; Sampler sampler = null ; int loops = 0 ; long now = System . currentTimeMillis ( ) ; while ( ( sampler = controller . next ( ) ) != null ) { loops ++ ; sampler . sample ( null ) ; } long elapsed = ( System . currentTimeMillis ( ) ) - now ; assertTrue ( ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>20<seq2seq4repair_space>loops<seq2seq4repair_space>" + loops ) , ( loops >= 20 ) ) ; assertTrue ( ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>fewer<seq2seq4repair_space>than<seq2seq4repair_space>30<seq2seq4repair_space>loops<seq2seq4repair_space>" + loops ) , ( loops < 30 ) ) ; assertTrue ( ( "Should<seq2seq4repair_space>take<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>10<seq2seq4repair_space>seconds<seq2seq4repair_space>" + elapsed ) , ( elapsed >= 10000 ) ) ; assertTrue ( ( "Should<seq2seq4repair_space>take<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>12<seq2seq4repair_space>seconds<seq2seq4repair_space>" + elapsed ) , ( elapsed <= 12000 ) ) ; assertEquals ( "Sampler<seq2seq4repair_space>1<seq2seq4repair_space>should<seq2seq4repair_space>run<seq2seq4repair_space>2<seq2seq4repair_space>times" , 2 , samp1 . getSamples ( ) ) ; assertTrue ( "Sampler<seq2seq4repair_space>2<seq2seq4repair_space>should<seq2seq4repair_space>run<seq2seq4repair_space>>=<seq2seq4repair_space>18<seq2seq4repair_space>times" , ( ( samp2 . getSamples ( ) ) >= 18 ) ) ; } }

Fix:
TestSampler samp2 = new TestSampler ( "Sample<seq2seq4repair_space>2" , 490 ) ;
Buggy code:
public interface StandaloneClient { ServerModel getServerModel ( ) { } <START_BUG> StandaloneUpdateResult < ? > applyUpdates ( List < AbstractServerModelUpdate < ? > > updates ) ; <END_BUG> byte [ ] addDeploymentContent ( String name , String runtimeName , InputStream stream ) { } ServerDeploymentManager getDeploymentManager ( ) { } class Factory { public StandaloneClient create ( final InetAddress address , int port ) { } } }

Fix:
List < StandaloneUpdateResult < ? > > applyUpdates ( List < AbstractServerModelUpdate < ? > > updates ) ;
Buggy code:
@ ThreadSafe public class PlayerConnection extends ClientConnection { private final TridentPlayer player ; @ GuardedBy ( "this" ) private int keepAliveId = - 1 ; @ GuardedBy ( "this" ) private int readCounter = 0 ; @ GuardedBy ( "this" ) private int writeCounter = 0 ; private PlayerConnection ( ClientConnection connection , TridentPlayer player ) { } public static PlayerConnection createPlayerConnection ( ClientConnection connection , TridentPlayer player ) { } public static PlayerConnection getConnection ( InetSocketAddress address ) { } public TridentPlayer getPlayer ( ) { } @ InternalUseOnly public synchronized void sendKeepAlive ( ) { int oldId = keepAliveId ; if ( oldId != ( - 1 ) ) return ; <START_BUG> int id = ThreadLocalRandom . current ( ) . nextInt ( ) ; <END_BUG> OutPacket packet = new PacketPlayOutKeepAlive ( ) ; packet . set ( "keepAliveId" , id ) ; keepAliveId = id ; sendPacket ( packet ) ; } @ InternalUseOnly public synchronized void handleKeepAlive ( PacketPlayInKeepAlive keepAlive ) { } @ InternalUseOnly public synchronized void resetReadCounter ( ) { } @ Override public void sendPacket ( Packet packet ) { } synchronized void tick ( ) { } public synchronized boolean hasSentKeepAlive ( ) { } }

Fix:
int id = ThreadLocalRandom . current ( ) . nextInt ( 2293760 ) ;
Buggy code:
public class PhotosFragment extends Fragment { public static final String TAG = "photos.fragment" ; private String mAlbumTitle = null ; private Integer mAlbumId = null ; private GridView gridView ; private GridView mPhotosGridView = null ; private PhotoGridAdapter mPhotoGridAdapter = null ; public PhotosFragment ( ) { } @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void getPhotos ( ) { } private class OnPhotoClickListener implements AdapterView . OnItemClickListener { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { VKApiPhoto photo = ( ( VKApiPhoto ) ( parent . getAdapter ( ) . getItem ( position ) ) ) ; Bundle bundle = new Bundle ( ) ; <START_BUG> bundle . putString ( FULL_SCREEN_PHOTO , photo . photo_807 ) ; <END_BUG> PhotoFragment photoFragment = new PhotoFragment ( ) ; photoFragment . setArguments ( bundle ) ; getFragmentManager ( ) . beginTransaction ( ) . addToBackStack ( PhotoFragment . TAG ) . add ( main_activity_fragment_holder , photoFragment , PhotosFragment . TAG ) . hide ( PhotosFragment . this ) . commit ( ) ; } } }

Fix:
bundle . putString ( FULL_SCREEN_PHOTO , photo . photo_604 ) ;
Buggy code:
public class ClientPlugin extends AbstractUIPlugin implements ClientPluginConstants { private static ClientPlugin plugin ; private ResourceBundle resourceBundle ; private static URL pluginLocation ; private ImageRegistry registry = null ; private FontRegistry fontRegistry = null ; private ServerStartup serverStartup = null ; private DiscoveryStartup discoveryStartup = null ; public static final String TCPSERVER_DISCOVERY_TYPE = "_ecftcp._tcp.local." ; protected static String [ ] serviceTypes = new String [ ] { ClientPlugin . TCPSERVER_DISCOVERY_TYPE } ; public static URL getPluginTopLocation ( ) { } public static void log ( String message ) { } public static void log ( String message , Throwable e ) { <START_BUG> ClientPlugin . getDefault ( ) . getLog ( ) . log ( new org . eclipse . core . runtime . Status ( org . eclipse . core . runtime . IStatus . ERROR , ClientPlugin . getDefault ( ) . getBundle ( ) . getSymbolicName ( ) , org . eclipse . core . runtime . IStatus . OK , "Caught<seq2seq4repair_space>exception" , e ) ) ; <END_BUG> } public ClientPlugin ( ) { } protected IDiscoveryController getDiscoveryController ( ) { } protected void setPreferenceDefaults ( ) { } public void start ( BundleContext context ) throws Exception { } public synchronized void initDiscovery ( ) throws Exception { } public synchronized void initServer ( ) throws Exception { } public synchronized void registerServers ( ) { } public synchronized boolean isDiscoveryActive ( ) { } public synchronized boolean isServerActive ( ) { } public synchronized void disposeDiscovery ( ) { } public synchronized void disposeServer ( ) { } public void stop ( BundleContext context ) throws Exception { } public FontRegistry getFontRegistry ( ) { } public Shell getActiveShell ( ) { } protected ImageRegistry createImageRegistry ( ) { } public static ClientPlugin getDefault ( ) { } public static String getResourceString ( String key ) { } public ResourceBundle getResourceBundle ( ) { } }

Fix:
ClientPlugin . getDefault ( ) . getLog ( ) . log ( new org . eclipse . core . runtime . Status ( org . eclipse . core . runtime . IStatus . ERROR , ClientPlugin . getDefault ( ) . getBundle ( ) . getSymbolicName ( ) , org . eclipse . core . runtime . IStatus . OK , message , e ) ) ;
Buggy code:
public final class dns { private static Resolver _res ; static boolean matchType ( short type1 , short type2 ) { } public static void init ( String defaultResolver ) { } public static Record [ ] getRecords ( Resolver res , String name , short type , short dclass ) { Message query = new Message ( ) ; Message response ; Record question ; Record [ ] answers ; int answerCount = 0 ; int i = 0 ; Enumeration e ; if ( ( res == ( dns . _res ) ) && ( ( dns . _res ) == null ) ) { try { <START_BUG> dns . _res = new Resolver ( ) ; <END_BUG> } catch ( UnknownHostException uhe ) { System . out . println ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>initialize<seq2seq4repair_space>resolver" ) ; System . exit ( ( - 1 ) ) ; } } query . getHeader ( ) . setOpcode ( QUERY ) ; query . getHeader ( ) . setFlag ( RD ) ; question = Record . newRecord ( new Name ( name ) , type , dclass ) ; query . addRecord ( QUESTION , question ) ; try { response = res . send ( query ) ; } catch ( IOException ioe ) { return null ; } if ( ( response . getHeader ( ) . getRcode ( ) ) != ( Rcode . NOERROR ) ) return null ; e = response . getSection ( ANSWER ) ; while ( e . hasMoreElements ( ) ) { Record r = ( ( Record ) ( e . nextElement ( ) ) ) ; if ( dns . matchType ( r . getType ( ) , type ) ) answerCount ++ ; } if ( answerCount == 0 ) return null ; answers = new Record [ answerCount ] ; e = response . getSection ( ANSWER ) ; while ( e . hasMoreElements ( ) ) { Record r = ( ( Record ) ( e . nextElement ( ) ) ) ; if ( dns . matchType ( r . getType ( ) , type ) ) answers [ ( i ++ ) ] = r ; } return answers ; } public static Record [ ] getRecords ( Resolver res , String name , short type ) { } public static Record [ ] getRecords ( String name , short type , short dclass ) { } public static Record [ ] getRecords ( String name , short type ) { } public static Record [ ] getRecordsByAddress ( Resolver res , String addr , short type ) { } public static Record [ ] getRecordsByAddress ( String addr , short type ) { } }

Fix:
res = dns . _res = new Resolver ( ) ;
Buggy code:
public class ImportDataLayer { private LongIntMap osmNodeIdToInternalNodeMap ; private TIntHashSet trafficNodes ; private TIntIntHashMap edgeDelaySignature ; private TLongLongHashMap barrierAccessFlags ; private TLongHashSet skippedBarrierEdges ; protected ImportDataLayer ( LongIntMap osmNodeIdToInternalNodeMap ) { } public void markBarrierNode ( OSMNode osmNode , EncodingManager encodingManager ) { } public void markDelayNode ( OSMNode osmNode , EncodingManager encodingManager ) { <START_BUG> if ( osmNode . hasTag ( "highway" , "traffic_lights" ) ) { <END_BUG> int internalNodeId = osmNodeIdToInternalNodeMap . get ( osmNode . getId ( ) ) ; if ( ( Math . abs ( internalNodeId ) ) < 3 ) { throw new IllegalStateException ( "Can't<seq2seq4repair_space>acces<seq2seq4repair_space>node<seq2seq4repair_space>without<seq2seq4repair_space>definitve<seq2seq4repair_space>ID<seq2seq4repair_space>to<seq2seq4repair_space>nodesFlagMap" ) ; } trafficNodes . add ( internalNodeId ) ; } } public boolean hasTrafficLight ( long osmNodeId ) { } public long getNodeBarrierFlags ( long osmNodeId , EncodingManager encodingManager ) { } public void setTrafficLightSignature ( int edgeId , int trafficLightCount ) { } public int getDelaySignature ( int edgeId ) { } public String getSizeInfo ( ) { } }

Fix:
if ( osmNode . hasTag ( "highway" , "traffic_signals" ) ) {
Buggy code:
public class ScheduleInitializer { public static void initializeSchedule ( Calendar firstWeekMonday , boolean firstWeekIsEven , int weeksCount , int [ ] controlPoints ) throws SQLException { int daysInWeek = 7 ; Calendar calDay = firstWeekMonday ; ScheduleDBHelper helper = HelperFactory . getHelper ( ) ; boolean isEven = firstWeekIsEven ; for ( int weekN = 1 ; weekN <= weeksCount ; weekN ++ ) { boolean isControl = false ; for ( int i : controlPoints ) { if ( i == weekN ) { isControl = true ; } } Week week = new Week ( weekN , ( ! isEven ) , isControl , helper . getWeekDAO ( ) ) ; for ( int dayN = 1 ; dayN <= daysInWeek ; dayN ++ ) { <START_BUG> Day day = new Day ( new Date ( calDay . getTimeInMillis ( ) ) , dayNt ) ; <END_BUG> week . addDay ( day ) ; calDay . add ( Calendar . DATE , 1 ) ; } helper . getWeekDAO ( ) . create ( week ) ; isEven = ! isEven ; } } public static void insertDefaultData ( Resources res ) { } }

Fix:
Day day = new Day ( new Date ( calDay . getTimeInMillis ( ) ) , dayN ) ;
Buggy code:
public class ScopedComponentResolverTest extends WicketTestCase { private static Log log = LogFactory . getLog ( ScopedComponentResolverTest . class ) ; public ScopedComponentResolverTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> application . getRequestCycleSettings ( ) . getComponentResolvers ( ) . add ( new ScopedComponentResolver ( ) ) ; <END_BUG> } public void testRenderHomePage ( ) throws Exception { } }

Fix:
application . getPageSettings ( ) . addComponentResolver ( new ScopedComponentResolver ( ) ) ;
Buggy code:
public class KeyTest { @ Test ( expected = IllegalArgumentException . class ) public void keyNotExistTest ( ) { } @ Test public void key1ATest ( ) { } @ Test public void keyETest ( ) { } @ Test public void keyNormalizedTest ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void keyNormalizedInvalidTest ( ) { } @ Test public void setTest ( ) { } @ Test public void zeroKeyTest ( ) { } @ Test public void setTestTwo ( ) { } @ Test public void setTestThree ( ) { <START_BUG> Key key = new Key ( "Dd" ) ; <END_BUG> assertEquals ( key . getNormalizedKeyNumber ( ) , 3 ) ; assertEquals ( key . getNormalizedKeyFlag ( ) , "B" ) ; } @ Test public void setTestFour ( ) { } @ Test public void setTestFive ( ) { } @ Test public void setTestSix ( ) { } @ Test public void setTestSeven ( ) { } @ Test public void setTestEight ( ) { } @ Test public void setTestNine ( ) { } @ Test public void setTestTen ( ) { } @ Test public void setTestEleven ( ) { } @ Test public void setTestTwelve ( ) { } @ Test public void setTestThirteen ( ) { } @ Test public void setTestFourteen ( ) { } @ Test public void setTestFifteen ( ) { } @ Test public void setTestSixteen ( ) { } @ Test public void setTestSeventeen ( ) { } @ Test public void setTestEighteen ( ) { } @ Test public void setTestNineteen ( ) { } @ Test public void setTestTwenty ( ) { } @ Test public void toStringTest ( ) { } }

Fix:
Key key = new Key ( "Db" ) ;
Buggy code:
public class GLWallpaperService extends WallpaperService { private static final String TAG = "GLWallpaperService" ; static Context context ; @ Override public Engine onCreateEngine ( ) { } static class UniqueDrawerCreator { CommonGLDrawer uniqueDrawer ; private synchronized CommonGLDrawer createUniqueDrawer ( int sizeX , int sizeY , boolean isPreview , SurfaceHolder holder ) { if ( ( sizeX < 0 ) || ( sizeY < 0 ) ) { return null ; } if ( ( uniqueDrawer ) != null ) { synchronized ( uniqueDrawer ) { <START_BUG> uniqueDrawer . destroy ( ) ; <END_BUG> uniqueDrawer = null ; } } SharedPreferences prefs = GLWallpaperService . context . getSharedPreferences ( GLWallpaperService . context . getPackageName ( ) , 0 ) ; uniqueDrawer = new CommonGLDrawer ( Integer . parseInt ( prefs . getString ( "num_petals" , "50" ) ) , ( ( prefs . getBoolean ( "use_scroll" , false ) ) && ( ! isPreview ) ) , holder , sizeX , sizeY ) ; return uniqueDrawer ; } } static final GLWallpaperService . UniqueDrawerCreator uniqueDrawerCreator = new GLWallpaperService . UniqueDrawerCreator ( ) ; public class CommonEngine extends Engine implements SharedPreferences . OnSharedPreferenceChangeListener { private CommonGLDrawer wallDrawer ; private volatile boolean visible = false ; private volatile boolean quitRequested = false ; private float offset = 0.5F ; private int sizeX = - 1 ; private int sizeY = - 1 ; private float touchX = - 1 ; private float touchY = - 1 ; public double getTime ( ) { } class RenderThread extends Thread { public void run ( ) { } } private final GLWallpaperService . CommonEngine . RenderThread renderThread = new GLWallpaperService . CommonEngine . RenderThread ( ) ; public CommonEngine ( ) { } @ Override public void onCreate ( SurfaceHolder holder ) { } @ Override public void onDestroy ( ) { } @ Override public void onSurfaceChanged ( SurfaceHolder holder , int format , int width , int height ) { } @ Override public synchronized void onSurfaceDestroyed ( SurfaceHolder holder ) { } @ Override public void onOffsetsChanged ( float xOffset , float yOffset , float xStep , float yStep , int xPixels , int yPixels ) { } @ Override public void onTouchEvent ( MotionEvent e ) { } @ Override public synchronized void onVisibilityChanged ( boolean visible_ ) { } private void drawLoop ( ) { } private void drawFrame ( ) { } public void onSharedPreferenceChanged ( SharedPreferences sharedPreferences , String key ) { } } }

Fix:
uniqueDrawer . destroy ( "UniqueDrawerCreator" ) ;
Buggy code:
public class BreadCrumbPanelLink extends BreadCrumbLink { private static final long serialVersionUID = 1L ; private final IBreadCrumbModel breadCrumbModel ; private final IBreadCrumbPanelFactory breadCrumbPanelFactory ; public BreadCrumbPanelLink ( MarkupContainer parent , final String id , final BreadCrumbPanel caller , final Class panelClass ) { } public BreadCrumbPanelLink ( MarkupContainer parent , final String id , final IBreadCrumbModel breadCrumbModel , final Class panelClass ) { } public BreadCrumbPanelLink ( MarkupContainer parent , final String id , final IBreadCrumbModel breadCrumbModel , final IBreadCrumbPanelFactory breadCrumbPanelFactory ) { } @ Override protected final IBreadCrumbParticipant getParticipant ( String componentId ) { <START_BUG> return breadCrumbPanelFactory . create ( componentId , breadCrumbModel ) ; <END_BUG> } }

Fix:
return breadCrumbPanelFactory . create ( getParent ( ) , componentId , breadCrumbModel ) ;
Buggy code:
public class SystemMenuMove extends ContributionItem { private IPresentablePart presentablePart ; private IStackPresentationSite stackPresentationSite ; public SystemMenuMove ( IPresentablePart presentablePart , IStackPresentationSite stackPresentationSite ) { } public void dispose ( ) { } protected void fill ( Menu menu , int index , String movePart ) { MenuItem menuItem = new MenuItem ( menu , SWT . CASCADE ) ; menuItem . setText ( WorkbenchMessages . getString ( "PartPane.move" ) ) ; Menu moveMenu = new Menu ( menu ) ; menuItem . setMenu ( moveMenu ) ; final Display display = moveMenu . getDisplay ( ) ; MenuItem menuItem2 = new MenuItem ( moveMenu , SWT . NONE ) ; menuItem2 . setText ( WorkbenchMessages . getString ( movePart ) ) ; menuItem2 . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { stackPresentationSite . dragStart ( presentablePart , display . getCursorLocation ( ) , true ) ; } } ) ; menuItem2 . setEnabled ( ( ( ( presentablePart ) != null ) && ( stackPresentationSite . isMoveable ( presentablePart ) ) ) ) ; MenuItem menuItem3 = new MenuItem ( moveMenu , SWT . NONE ) ; menuItem3 . setText ( WorkbenchMessages . getString ( "ViewPane.moveFolder" ) ) ; menuItem3 . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { stackPresentationSite . dragStart ( display . getCursorLocation ( ) , true ) ; } } ) ; <START_BUG> menuItem3 . setEnabled ( true ) ; <END_BUG> } public boolean isDynamic ( ) { } }

Fix:
menuItem3 . setEnabled ( stackPresentationSite . isMoveable ( null ) ) ;
Buggy code:
public class BookLoanDAO extends BaseDAO { public BookLoanDAO ( Connection conn ) throws Exception { } public void create ( BookLoan bookLoan ) throws Exception { } public void update ( BookLoan bookLoan ) throws Exception { } public void delete ( BookLoan bookLoan ) throws Exception { } public List < BookLoan > readAll ( ) throws Exception { } public BookLoan readOne ( int bookId , int cardNo , int branchId ) throws Exception { } @ Override public List < BookLoan > extractData ( ResultSet rs ) throws Exception { List < BookLoan > bookLoans = new ArrayList < BookLoan > ( ) ; BookDAO bookdao = new BookDAO ( getConnection ( ) ) ; LibraryBranchDAO lbranchdao = new LibraryBranchDAO ( getConnection ( ) ) ; BorrowerDAO borrowerdao = new BorrowerDAO ( getConnection ( ) ) ; while ( rs . next ( ) ) { BookLoan bl = new BookLoan ( ) ; bl . setDateIn ( rs . getTimestamp ( "dateIn" ) ) ; bl . setDateOut ( rs . getTimestamp ( "dateOut" ) ) ; bl . setDueDate ( rs . getTimestamp ( "dueDate" ) ) ; bl . setBook ( bookdao . readOne ( rs . getInt ( "bookId" ) ) ) ; bl . setBorrower ( borrowerdao . readOne ( rs . getInt ( "cardNo" ) ) ) ; <START_BUG> bl . setLibraryBranch ( lbranchdao . readOne ( rs . getInt ( "cardNo" ) ) ) ; <END_BUG> bookLoans . add ( bl ) ; } return bookLoans ; } @ Override public List < BookLoan > extractDataFirstLevel ( ResultSet rs ) throws Exception { } }

Fix:
bl . setLibraryBranch ( lbranchdao . readOne ( rs . getInt ( "branchId" ) ) ) ;
Buggy code:
public final class XmlPullParser implements IXmlPullParser { private static final Pattern encodingPattern = Pattern . compile ( "[\\s\\n\\r]*<\\?xml\\s+(.*\\s)?encoding\\s*=\\s*([\"\'](.*?)[\"\']|(\\S]*)).*\\?>" ) ; private static final Log log = LogFactory . getLog ( XmlPullParser . class ) ; private int columnNumber = 1 ; private String encoding ; private String input ; private int inputPosition ; private int lastLineCountIndex ; private int lineNumber = 1 ; private int positionMarker ; private boolean stripComments ; public XmlPullParser ( ) { } public String getEncoding ( ) { } public final CharSequence getInputFromPositionMarker ( int toPos ) { } public final CharSequence getInputSubsequence ( final int fromPos , final int toPos ) { } public final IMarkupFilter getParent ( ) { } public final MarkupElement nextTag ( ) throws ParseException { } public void parse ( final CharSequence string ) throws IOException , ResourceNotFoundException { } public void parse ( final IResource resource ) throws IOException , ResourceNotFoundException { } public final void setPositionMarker ( ) { } public void setStripComments ( boolean stripComments ) { } public String toString ( ) { } private void countLinesTo ( final String string , final int end ) { } private final String determineEncoding ( final InputStream in , final int readAheadSize ) throws IOException { } private XmlTag parseTagText ( final String tagText ) throws ParseException { final int tagTextLength = tagText . length ( ) ; final TagNameParser tagnameParser = new TagNameParser ( tagText ) ; if ( tagnameParser . matcher ( ) . lookingAt ( ) ) { final XmlTag tag = new XmlTag ( ) ; tag . name = tagnameParser . getName ( ) ; tag . namespace = tagnameParser . getNamespace ( ) ; int pos = tagnameParser . matcher ( ) . end ( 0 ) ; if ( pos == tagTextLength ) { return tag ; } final VariableAssignmentParser attributeParser = new VariableAssignmentParser ( tagText ) ; while ( attributeParser . matcher ( ) . find ( pos ) ) { String value = attributeParser . getValue ( ) ; if ( value == null ) { value = "" ; } pos = attributeParser . matcher ( ) . end ( 0 ) ; if ( ( value . startsWith ( "\"" ) ) || ( value . startsWith ( "\'" ) ) ) { value = value . substring ( 1 , ( ( value . length ( ) ) - 1 ) ) ; } value = value . trim ( ) ; final String key = attributeParser . getKey ( ) ; <START_BUG> if ( null != ( tag . attributes . put ( key , value ) ) ) { <END_BUG> throw new ParseException ( ( "Same<seq2seq4repair_space>attribute<seq2seq4repair_space>found<seq2seq4repair_space>twice:<seq2seq4repair_space>" + key ) , this . inputPosition ) ; } if ( pos == tagTextLength ) { return tag ; } } return tag ; } return null ; } private void setInput ( final CharSequence input ) { } }

Fix:
if ( null != ( tag . put ( key , value ) ) ) {
Buggy code:
public class HashKeyTest { public static void main ( String [ ] args ) { <START_BUG> System . out . println ( BatchWorker . generateHashKey ( 26473973523L ) ) ; <END_BUG> } }

Fix:
System . out . println ( BatchWorker . generateChangeBatchHashKey ( 26473973523L ) ) ;
Buggy code:
public class SymbolTable { protected final HashMap2 < String , INamedElement > map = new HashMap2 ( ) ; public HashMap < String , INamedElement > getMap ( ) { } public Set < Map . Entry < String , INamedElement > > getEntries ( ) { } public Collection2 < INamedElement > getElements ( ) { } public void addSymbols ( SymbolTable symbolTable ) { } public void addSymbols ( Iterable < INamedElement > values ) { } public void addSymbol ( INamedElement newElement ) { String name = newElement . getNameInRegularNamespace ( ) ; INamedElement existingNamedElement = map . get ( name ) ; if ( ( existingNamedElement instanceof PackageNamespace ) && ( newElement instanceof PackageNamespace ) ) { PackageNamespace existingNamespace = ( ( PackageNamespace ) ( existingNamedElement ) ) ; PackageNamespace newNamespace = ( ( PackageNamespace ) ( newElement ) ) ; if ( existingNamespace . isCompleted ( ) ) { <START_BUG> existingNamespace = existingNamespace . doCloneTree ( newNamespace ) ; <END_BUG> map . put ( name , existingNamespace ) ; } existingNamespace . getNamespaceForModification ( ) . addSymbols ( newNamespace . getContainedElements ( ) ) ; } else { addEntryToMap ( name , newElement ) ; } } protected void addEntryToMap ( String name , INamedElement newElement ) { } public void doAddEntryToMap ( String name , INamedElement newElement ) { } public void addVisibleSymbols ( SymbolTable symbolTable ) { } No newline ; at end ; of file ; }

Fix:
existingNamespace = existingNamespace . doCloneTree ( ) ;
Buggy code:
public interface CommandHandler { boolean isAvailable ( CommandContext ctx ) { } <START_BUG> CommandArgumentCompleter getArgumentCompleter ( ) ; <END_BUG> boolean isBatchMode ( ) { } void handle ( CommandContext ctx ) { } }

Fix:
CommandLineCompleter getArgumentCompleter ( ) ;