nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Entity @ Table ( name = "ppl_graph" ) public class PipelineGraph implements DataObject { @ Id @ GeneratedValue ( strategy = GenerationType . SEQUENCE , generator = "seq_ppl_graph" ) @ SequenceGenerator ( name = "seq_ppl_graph" , allocationSize = 1 ) @ SuppressWarnings ( "unused" ) private Long id ; @ OneToOne ( fetch = FetchType . EAGER ) @ JoinColumn ( name = "pipeline_id" , unique = true , nullable = false ) private Pipeline pipeline ; @ OneToMany ( cascade = CascadeType . ALL , mappedBy = "graph" , fetch = FetchType . EAGER , orphanRemoval = true ) private Set < Node > nodes = new HashSet < > ( ) ; @ OneToMany ( cascade = CascadeType . ALL , mappedBy = "graph" , fetch = FetchType . EAGER , orphanRemoval = true ) private Set < Edge > edges = new HashSet < > ( ) ; public PipelineGraph ( ) { } @ SuppressWarnings ( "LeakingThisInConstructor" ) public PipelineGraph ( PipelineGraph graph ) { } public void addNode ( Node node ) { } public boolean removeNode ( Node node ) { } public Set < Node > getNodes ( ) { } public void setNodes ( Set < Node > newNodes ) { } public Set < Edge > getEdges ( ) { } public void setEdges ( Set < Edge > edges ) { } public Node addDpuInstance ( DPUInstanceRecord dpuInstance ) { } public Node removeDpu ( int dpuId ) { } public Edge addEdge ( Node from , Node to ) { } public boolean removeEdge ( Edge edge ) { } public int addEdge ( int fromId , int toId ) { } public Edge removeEdge ( int edgeId ) { } public Edge getEdgeById ( int id ) { } public Node getNodeById ( int id ) { } public boolean moveNode ( int dpuId , int newX , int newY ) { Node node = getNodeById ( dpuId ) ; if ( node == null ) { throw new IllegalArgumentException ( "Node<seq2seq4repair_space>with<seq2seq4repair_space>supplied<seq2seq4repair_space>id<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found!" ) ; } <START_BUG> if ( ( ( node . getPosition ( ) . getX ( ) ) == newX ) && ( ( node . getPosition ( ) . getY ( ) ) == newY ) ) { <END_BUG> return false ; } node . setPosition ( new Position ( newX , newY ) ) ; return true ; } public Pipeline getPipeline ( ) { } public void setPipeline ( Pipeline pipeline ) { } public String validateNewEdge ( int fromId , int toId ) { } private boolean newEdgeCreateCycle ( Edge newEdge ) { } private boolean sameEdgeExists ( Node from , Node to ) { } public Position getBounds ( ) { } public PipelineGraph cloneGraph ( ) { } @ Override public Long getId ( ) { } public List < Edge > getEdgesTo ( Node node ) { } public List < Edge > getEdgesFrom ( Node node ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } }

Fix:
if ( ( ( ( node . getPosition ( ) ) != null ) && ( ( node . getPosition ( ) . getX ( ) ) == newX ) ) && ( ( node . getPosition ( ) . getY ( ) ) == newY ) ) {
Buggy code:
public class ListListener extends MouseAdapter { private CommandEngine engine ; private List list ; public ListListener ( List list , CommandEngine engine ) { } public void mouseClicked ( MouseEvent event ) { if ( SwingUtilities . isRightMouseButton ( event ) ) { event . consume ( ) ; try { list . setSelectedIndex ( list . locationToIndex ( event . getPoint ( ) ) ) ; if ( ( list . getSelectedIndex ( ) ) != ( - 1 ) ) { Object [ ] data = ( ( Object [ ] ) ( list . getSelectedValue ( ) ) ) ; PopupMenuVM menu = new PopupMenuVM ( engine , ( ( VirtualMachine ) ( data [ 3 ] ) ) ) ; menu . show ( event . getComponent ( ) , event . getX ( ) , event . getY ( ) ) ; } } catch ( Exception e ) { LOG . printStackTrace ( e ) ; } } else { if ( ( ( ( event . getClickCount ( ) ) == 2 ) && ( ! ( event . isConsumed ( ) ) ) ) && ( SwingUtilities . isLeftMouseButton ( event ) ) ) { event . consume ( ) ; Object vm = null ; <START_BUG> if ( ( list . getSelectedIndex ( ) ) != ( - 1 ) ) { <END_BUG> Object [ ] data = ( ( Object [ ] ) ( list . getModel ( ) . getElementAt ( list . getSelectedIndex ( ) ) ) ) ; vm = data [ 3 ] ; } if ( vm != null ) { engine . launchConsole ( ( ( VirtualMachine ) ( vm ) ) ) ; } } } } }

Fix:
if ( ( ( list . getSelectedIndex ( ) ) != ( - 1 ) ) && ( ( list . getModel ( ) . getElementAt ( list . getSelectedIndex ( ) ) ) != null ) ) {
Buggy code:
public class RaAdd extends AbstractRaOperation implements NewStepHandler { static final RaAdd INSTANCE = new RaAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) { } public void execute ( NewOperationContext context , ModelNode operation ) { final ModelNode subModel = context . readModelForUpdate ( EMPTY_ADDRESS ) ; populateModel ( operation , subModel ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final String archive = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; operation . get ( Constants . ARCHIVE ) . set ( archive ) ; if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new NewStepHandler ( ) { public void execute ( NewOperationContext context , ModelNode operation ) throws OperationFailedException { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; ModifiableResourceAdaptors resourceAdapters = buildResourceAdaptersObject ( operation ) ; final ServiceController < ? > raService = context . getServiceRegistry ( false ) . getService ( RESOURCEADAPTERS_SERVICE ) ; ServiceController < ? > controller = null ; if ( raService == null ) { controller = serviceTarget . addService ( RESOURCEADAPTERS_SERVICE , new ResourceAdaptersService ( resourceAdapters ) ) . setInitialMode ( ACTIVE ) . addListener ( verificationHandler ) . install ( ) ; } else { ( ( ModifiableResourceAdaptors ) ( raService . getValue ( ) ) ) . addAllResourceAdapters ( resourceAdapters . getResourceAdapters ( ) ) ; } context . addStep ( verificationHandler , VERIFY ) ; if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { if ( controller != null ) { <START_BUG> context . removeService ( controller ) ; <END_BUG> } } } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
context . removeService ( RESOURCEADAPTERS_SERVICE ) ;
Buggy code:
public class ProxyListValidator implements ParameterValidator { @ Override public void validateParameter ( String parameterName , ModelNode value ) throws OperationFailedException { if ( value . isDefined ( ) ) { String str = value . asString ( ) ; String [ ] results = str . split ( "," ) ; for ( String result : results ) { int i = result . lastIndexOf ( ":" ) ; int port = 0 ; String host = null ; if ( i > 0 ) { host = result . substring ( 0 , i ) ; port = Integer . valueOf ( result . substring ( ( i + 1 ) ) ) ; } try { InetAddress . getByName ( host ) ; } catch ( UnknownHostException e ) { host = null ; } if ( ( host == null ) || ( port == 0 ) ) { <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( ROOT_LOGGER . needHostAndPort ( ) ) ) ; <END_BUG> } } } } @ Override public void validateResolvedParameter ( String parameterName , ModelNode value ) throws OperationFailedException { } }

Fix:
throw new OperationFailedException ( ROOT_LOGGER . needHostAndPort ( ) ) ;
Buggy code:
public class IntroPageFragment extends Fragment { public static final String TAG = "IntroPageFragment" ; FragmentManager fm ; final int PERMISSION_REQUEST_CODE = 5 ; public IntroPageFragment ( ) { } @ Override public View onCreateView ( final LayoutInflater inflater , final ViewGroup container , Bundle savedInstanceState ) { fm = getFragmentManager ( ) ; final View view = inflater . inflate ( fragment_intro_page , container , false ) ; final Button btnAddTeam = ( ( Button ) ( view . findViewById ( btnAddTeam ) ) ) ; final Button btnTradeData = ( ( Button ) ( view . findViewById ( btnTradeData ) ) ) ; <START_BUG> String [ ] PERMISSIONS = new String [ ] { permission . WRITE_EXTERNAL_STORAGE , permission . CAMERA } ; <END_BUG> if ( ! ( IntroPageFragment . hasPermissions ( getActivity ( ) , PERMISSIONS ) ) ) { ActivityCompat . requestPermissions ( getActivity ( ) , PERMISSIONS , PERMISSION_REQUEST_CODE ) ; } btnTradeData . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { TradeData ( v ) ; } } ) ; btnAddTeam . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { AddTeamFragment atf = new AddTeamFragment ( ) ; Bundle bundle = new Bundle ( ) ; bundle . putString ( "updateTeam" , "noUpdate" ) ; atf . setArguments ( bundle ) ; fm . beginTransaction ( ) . replace ( fragContainer , atf , AddTeamFragment . TAG ) . commit ( ) ; } } ) ; final ListView lvwListTeams = ( ( ListView ) ( view . findViewById ( lvwExistingTeams ) ) ) ; Button btnViewTeam = ( ( Button ) ( view . findViewById ( btnViewTeams ) ) ) ; btnViewTeam . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { lvwListTeams . setVisibility ( VISIBLE ) ; updateTeams ( lvwListTeams ) ; } } ) ; lvwListTeams . setOnItemLongClickListener ( new AdapterView . OnItemLongClickListener ( ) { @ Override public boolean onItemLongClick ( AdapterView < ? > parent , View view , int position , long id ) { Integer teamNum = Integer . parseInt ( lvwListTeams . getItemAtPosition ( position ) . toString ( ) ) ; Bundle bundle = new Bundle ( ) ; bundle . putString ( "updateTeam" , "update" ) ; bundle . putInt ( "teamNum" , teamNum ) ; AddTeamFragment atf = new AddTeamFragment ( ) ; atf . setArguments ( bundle ) ; fm . beginTransaction ( ) . replace ( fragContainer , atf , AddTeamFragment . TAG ) . commit ( ) ; return true ; } } ) ; return view ; } public static boolean hasPermissions ( Context context , String ... permissions ) { } private void updateTeams ( ListView lvw ) { } public void TradeData ( View view ) { } }

Fix:
String [ ] PERMISSIONS = new String [ ] { permission . WRITE_EXTERNAL_STORAGE , permission . CAMERA , permission . ACCESS_FINE_LOCATION } ;
Buggy code:
public class CommandCompleter implements Completor { private final OperationRequestCompleter opCompleter ; private final Set < String > commands ; public CommandCompleter ( Set < String > commands , OperationRequestCompleter opCompleter ) { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) @ Override public int complete ( String buffer , int cursor , List candidates ) { int firstCharIndex = 0 ; while ( firstCharIndex < ( buffer . length ( ) ) ) { if ( ! ( Character . isWhitespace ( buffer . charAt ( firstCharIndex ) ) ) ) { break ; } ++ firstCharIndex ; } if ( firstCharIndex == ( buffer . length ( ) ) ) { candidates . addAll ( commands ) ; return firstCharIndex ; } char firstChar = buffer . charAt ( firstCharIndex ) ; if ( ( ( firstChar == '.' ) || ( firstChar == ':' ) ) || ( firstChar == '//' ) ) { return - 1 ; } if ( ( buffer . startsWith ( "cd<seq2seq4repair_space>" , firstCharIndex ) ) || ( buffer . startsWith ( "cn<seq2seq4repair_space>" , firstCharIndex ) ) ) { String opBuffer = buffer . substring ( ( firstCharIndex + 3 ) ) ; <START_BUG> int result = opCompleter . complete ( opBuffer , cursor , candidates ) ; <END_BUG> if ( result >= 0 ) { return ( firstCharIndex + 3 ) + result ; } else { return result ; } } String cmdChunk = buffer . substring ( firstCharIndex ) ; for ( String command : commands ) { if ( command . startsWith ( cmdChunk ) ) candidates . add ( command ) ; } return ( buffer . length ( ) ) - ( cmdChunk . length ( ) ) ; } }

Fix:
int result = opCompleter . doComplete ( opBuffer , candidates , false ) ;
Buggy code:
public class WeldEjbInterceptorIntegrationProcessor implements DeploymentUnitProcessor { private static final Logger log = Logger . getLogger ( "org.jboss.as.weld" ) ; private static final String CDI_INTERCEPTOR = Jsr299BindingsInterceptor . class . getName ( ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; <START_BUG> if ( ! ( WeldDeploymentMarker . isPartOfWeldDeployment ( deploymentUnit ) ) ) { <END_BUG> return ; } final EEModuleDescription moduleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final EEModuleClassDescription cdiInterceptorClass = moduleDescription . getOrAddClassByName ( WeldEjbInterceptorIntegrationProcessor . CDI_INTERCEPTOR ) ; cdiInterceptorClass . setPostConstructMethod ( MethodIdentifier . getIdentifier ( void . class , "doPostConstruct" , InvocationContext . class ) ) ; cdiInterceptorClass . setPreDestroyMethod ( MethodIdentifier . getIdentifier ( void . class , "doPreDestroy" , InvocationContext . class ) ) ; cdiInterceptorClass . setAroundInvokeMethod ( MethodIdentifier . getIdentifier ( Object . class , "doAroundInvoke" , InvocationContext . class ) ) ; for ( final ComponentDescription component : moduleDescription . getComponentDescriptions ( ) ) { if ( component instanceof SessionBeanComponentDescription ) { component . addClassInterceptor ( new InterceptorDescription ( WeldEjbInterceptorIntegrationProcessor . CDI_INTERCEPTOR ) ) ; } } } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
if ( ! ( WeldDeploymentMarker . isWeldDeployment ( deploymentUnit ) ) ) {
Buggy code:
@ Path ( "//currency" ) public class CurrencyResource { private static final Logger log = Logger . getLogger ( CurrencyResource . class . getSimpleName ( ) ) ; @ Inject DAOBean dao ; @ Inject UserVSBean userVSBean ; @ Inject TransactionVSBean transactionVSBean ; @ Inject ConfigVS config ; @ Inject SignatureBean signatureBean ; @ Inject CurrencyBean currencyBean ; private MessagesVS messages = MessagesVS . getCurrentInstance ( ) ; @ Path ( "//request" ) @ GET public Object request ( @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws IOException , ServletException { } @ Path ( "//issuedLog" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Object issuedLog ( @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws IOException , ServletException { } @ Path ( "//requestLog" ) @ GET @ Produces ( MediaType . APPLICATION_JSON ) public Object processReques ( @ Context ServletContext context , @ Context HttpServletRequest req , @ Context HttpServletResponse resp ) throws IOException , ServletException { } @ Path ( "//hash//{hashCertVSHex}//state" ) @ GET public Response state ( @ PathParam ( "hashCertVSHex" ) String hashCertVSHex ) { HexBinaryAdapter hexConverter = new HexBinaryAdapter ( ) ; String hashCertVSBase64 = new String ( hexConverter . unmarshal ( hashCertVSHex ) ) ; Query query = dao . getEM ( ) . createQuery ( "select<seq2seq4repair_space>c<seq2seq4repair_space>from<seq2seq4repair_space>Currency<seq2seq4repair_space>c<seq2seq4repair_space>where<seq2seq4repair_space>c.hashCertVS<seq2seq4repair_space>=:hashCertVS" ) . setParameter ( "hashCertVS" , hashCertVSBase64 ) ; Currency currency = dao . getSingleResult ( Currency . class , query ) ; if ( currency == null ) return Response . status ( SC_NOT_FOUND ) . entity ( messages . get ( "currencyNotFoundErrorMsg" ) ) . build ( ) ; switch ( currency . getState ( ) ) { case EXPENDED : return Response . status ( SC_CURRENCY_EXPENDED ) . entity ( messages . get ( "currencyExpendedShortErrorMsg" ) ) . build ( ) ; case OK : if ( currency . getValidTo ( ) . after ( new Date ( ) ) ) { <START_BUG> return Response . status ( 999 ) . entity ( messages . get ( "currencyOKMsg" ) ) . build ( ) ; <END_BUG> } else { dao . merge ( currency . setState ( LAPSED ) ) ; return Response . status ( SC_CURRENCY_LAPSED ) . entity ( messages . get ( "currencyLapsedShortErrorMsg" ) ) . build ( ) ; } case LAPSED : return Response . status ( SC_CURRENCY_LAPSED ) . entity ( messages . get ( "currencyLapsedShortErrorMsg" ) ) . build ( ) ; default : return Response . status ( BAD_REQUEST ) . entity ( ( "unknown<seq2seq4repair_space>currency<seq2seq4repair_space>state:<seq2seq4repair_space>" + ( currency . getState ( ) ) ) ) . build ( ) ; } } @ Path ( "//bundleState" ) @ POST @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response bundleState ( List < String > hashCertVSList ) throws JsonProcessingException { } }

Fix:
return Response . status ( SC_CURRENCY_OK ) . entity ( messages . get ( "currencyOKMsg" ) ) . build ( ) ;
Buggy code:
public class ExpandItem extends Item { ExpandBar parent ; Control control ; ImageList imageList ; int clientHandle ; int boxHandle ; int labelHandle ; int imageHandle ; public ExpandItem ( ExpandBar parent , int style ) { } public ExpandItem ( ExpandBar parent , int style , int index ) { } protected void checkSubclass ( ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } void deregister ( ) { } public void dispose ( ) { } public Control getControl ( ) { } public boolean getExpanded ( ) { } public int getHeight ( ) { } public ExpandBar getParent ( ) { } int gtk_activate ( int widget ) { Event event = new Event ( ) ; event . item = this ; <START_BUG> int type = ( OS . gtk_expander_get_expanded ( handle ) ) ? SWT . Expand : SWT . Collapse ; <END_BUG> parent . sendEvent ( type , event ) ; return 0 ; } int gtk_size_allocate ( int widget , int allocation ) { } void hookEvents ( ) { } void register ( ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } void resizeControl ( int yScroll ) { } public void setControl ( Control control ) { } public void setExpanded ( boolean expanded ) { } public void setImage ( Image image ) { } public void setHeight ( int height ) { } public void setText ( String string ) { } void showWidget ( int index ) { } int windowProc ( int handle , int user_data ) { } }

Fix:
int type = ( OS . gtk_expander_get_expanded ( handle ) ) ? SWT . Collapse : SWT . Expand ;
Buggy code:
public class AjBuildManagerTest extends TestCase { private StreamPrintWriter outputWriter = new StreamPrintWriter ( new PrintWriter ( System . out ) ) ; private MessageWriter messageWriter = new MessageWriter ( outputWriter , false ) ; public static File source1 = new File ( "testdata//src1//A.java" ) ; public static File source2 = new File ( "testdata//src1//Hello.java" ) ; public static File source3 = new File ( "testdata//src1//X.java" ) ; public static void assertCompileMessagesValid ( MessageHandler handler ) { } public AjBuildManagerTest ( String name ) { } public void testSimpleStructure ( ) throws IOException , CoreException { AjBuildManager manager = new AjBuildManager ( messageWriter ) ; BuildArgParser parser = new BuildArgParser ( ) ; String javaClassPath = System . getProperty ( "java.class.path" ) ; AjBuildConfig buildConfig = parser . genBuildConfig ( new String [ ] { "-d" , "out" , "-classpath" , javaClassPath , "testdata//src1//A.java" } , messageWriter ) ; String err = parser . getOtherMessages ( true ) ; assertTrue ( err , ( null == err ) ) ; <START_BUG> manager . setStructureModel ( StructureModelManager . getDefault ( ) . getStructureModel ( ) ) ; <END_BUG> MessageHandler handler = new MessageHandler ( ) ; manager . batchBuild ( buildConfig , handler ) ; AjBuildManagerTest . assertCompileMessagesValid ( handler ) ; } private void touch ( File file , boolean isAppend ) throws IOException { } }

Fix:
manager . setStructureModel ( StructureModelManager . getDefault ( ) . getModel ( ) ) ;
Buggy code:
public class WorkDao { public int insertGoToWork ( final User user , final String storeSeq ) { JdbcTemplate jdbcTemplate = new JdbcTemplate ( ) ; <START_BUG> String sql = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>WORK(WORK_STO_SEQ,<seq2seq4repair_space>WORK_USER_SEQ,<seq2seq4repair_space>WORK_START)<seq2seq4repair_space>VALUES(?,?,NOW())" ; <END_BUG> return jdbcTemplate . executeUpdate ( sql , Integer . parseInt ( storeSeq ) , user . getSeq ( ) ) ; } public int insertLeaveWork ( final User user , final String storeSeq ) { } public ArrayList < Work > selectWork ( final String storeSeq ) { } private RowMapper < Work > resultSetOfWorkAndName ( ) { } public ArrayList < Work > showWork ( final User user ) { } public ArrayList < Work > showWorkOfStore ( final String storeSeq ) { } public Work getConfirmWorkData ( final String seq ) { } private RowMapper < Work > resultSetOfWork ( ) { } public int confirmGoToWork ( final Work work ) { } public int confirmLeaveWork ( final Work work ) { } public int confirmBoth ( final Work work ) { } public int confirmWork ( final Work work , String sql ) { } public List < Work > selectWorkForAlba ( User user ) { } public List < Work > selectWorkForManager ( String storeSeq ) { } private RowMapper < Work > resultSetOfWorkAndStore ( String key ) { } }

Fix:
String sql = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>WORK(WORK_STO_SEQ,<seq2seq4repair_space>WORK_USER_SEQ,<seq2seq4repair_space>WORK_START,<seq2seq4repair_space>WORK_FINISH)<seq2seq4repair_space>VALUES(?,?,NOW(),NOW())" ;
Buggy code:
public class OpenIndexTask extends PerfTask { public static final int DEFAULT_MAX_BUFFERED = IndexWriter . DEFAULT_MAX_BUFFERED_DOCS ; public static final int DEFAULT_MAX_FIELD_LENGTH = IndexWriter . DEFAULT_MAX_FIELD_LENGTH ; public static final int DEFAULT_MERGE_PFACTOR = LogMergePolicy . DEFAULT_MERGE_FACTOR ; public static final double DEFAULT_RAM_FLUSH_MB = ( ( int ) ( IndexWriter . DEFAULT_RAM_BUFFER_SIZE_MB ) ) ; public static final boolean DEFAULT_AUTO_COMMIT = true ; public OpenIndexTask ( PerfRunData runData ) { } public int doLogic ( ) throws IOException { PerfRunData runData = getRunData ( ) ; Config config = runData . getConfig ( ) ; <START_BUG> IndexWriter writer = new IndexWriter ( runData . getDirectory ( ) , config . get ( "autocommit" , OpenIndexTask . DEFAULT_AUTO_COMMIT ) , runData . getAnalyzer ( ) , false , MaxFieldLength . LIMITED ) ; <END_BUG> CreateIndexTask . setIndexWriterConfig ( writer , config ) ; runData . setIndexWriter ( writer ) ; return 1 ; } }

Fix:
IndexWriter writer = new IndexWriter ( runData . getDirectory ( ) , config . get ( "autocommit" , OpenIndexTask . DEFAULT_AUTO_COMMIT ) , runData . getAnalyzer ( ) , false ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { private Button mStartRecordButton ; private Button mEndRecordButton ; private TextView mRecordingStatus ; private ATTSpeechService speechService ; private ATTSpeechResultListener mResultListener ; private ATTSpeechErrorListener mErrorListener ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void startRecording ( View v ) throws IOException , URISyntaxException { mStartRecordButton . setEnabled ( false ) ; mEndRecordButton . setEnabled ( true ) ; mResultListener = new ATTSpeechResultListener ( ) { @ Override public void onResult ( ATTSpeechResult attSpeechResult ) { JSONObject jObj = attSpeechResult . getJSON ( ) ; <START_BUG> if ( ( ( nbest ) != null ) && ( ( nbest . size ( ) ) > 0 ) ) <END_BUG> new MainActivity . SendTextString ( ) . execute ( jObj . toString ( ) , "1.1.1.1" ) ; } } ; mErrorListener = new ATTSpeechErrorListener ( ) { @ Override public void onError ( ATTSpeechError attSpeechError ) { Context c = MainActivity . this . getApplicationContext ( ) ; CharSequence msg = "AT&T<seq2seq4repair_space>has<seq2seq4repair_space>failed<seq2seq4repair_space>us!<seq2seq4repair_space>Noooo!" ; int duration = Toast . LENGTH_SHORT ; Toast t = Toast . makeText ( c , msg , duration ) ; t . show ( ) ; } } ; speechService = ATTSpeechService . getSpeechService ( this ) ; speechService . setRecognitionURL ( new URI ( "https:////api.att.com//speech//v3//speechToText" ) ) ; speechService . setSpeechContext ( "Generic" ) ; speechService . setBearerAuthToken ( "BF-ACSI~4~20150517033520~zMd5uybWzGecO2Hg2Jb2asfxCHaIHkZ5" ) ; speechService . setSpeechResultListener ( mResultListener ) ; speechService . setSpeechErrorListener ( mErrorListener ) ; speechService . setEndingSilence ( 10000 ) ; speechService . startListening ( ) ; } public void stopRecording ( View v ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private class SendTextString extends AsyncTask < String , Void , Void > { protected Void doInBackground ( String ... arg0 ) { } } }

Fix:
if ( jObj != null )
Buggy code:
public class PerkStore { private static ArrayList < Perk > perks = new ArrayList < Perk > ( ) ; private static HashMap < String , ArrayList < Slug > > blockMap = new HashMap < String , ArrayList < Slug > > ( ) ; private static HashMap < String , ArrayList < Slug > > entityMap = new HashMap < String , ArrayList < Slug > > ( ) ; private static HashMap < String , ArrayList < Slug > > itemMap = new HashMap < String , ArrayList < Slug > > ( ) ; private static ArrayList < TitlePerk > titlePerks = new ArrayList < TitlePerk > ( ) ; private static HashMap < Slug , Perk > perksMap = new HashMap < Slug , Perk > ( ) ; private static PerkStore instance = null ; private PerkStore ( ) { } public static void addPerk ( Perk perk ) { } public static void Clear ( ) { } public static PerkStore getInstance ( ) { } public static Perk getPerk ( String perkSlug ) { } public static ArrayList < Perk > getPerks ( ) { } public static ArrayList < Slug > getSlugs ( Block block ) { } public static ArrayList < Slug > getSlugs ( Entity entity ) { <START_BUG> return PerkStore . entityMap . get ( entity . getCommandSenderName ( ) ) ; <END_BUG> } public static ArrayList < Slug > getSlugs ( Item item ) { } public static void putPerk ( BlockPerk block ) { } public static void putPerk ( EntityPerk entity ) { } public static void putPerk ( ItemPerk item ) { } public static void putPerk ( RegexBlockPerk perk ) { } public static void putPerk ( RegexEntityPerk perk ) { } public static void putPerk ( RegexItemPerk perk ) { } public static void putPerk ( TitlePerk title ) { } }

Fix:
return PerkStore . entityMap . get ( entity . getClass ( ) . getSimpleName ( ) ) ;
Buggy code:
public class LruCache < K , V > implements Cache < K , V > { private static final int REMOVE_ALL = - 1 ; private static final int DEFAULT_CAPACITY = 10 ; private final Map < K , V > map ; private final int maxMemorySize ; private int memorySize ; public LruCache ( ) { } public LruCache ( int capacity ) { } @ Override public final V get ( K key ) { } @ Override public final V put ( K key , V value ) { } @ Override public final V remove ( K key ) { } @ Override public final synchronized void clear ( ) { } @ Override public final synchronized int getMaxMemorySize ( ) { } @ Override public final synchronized int getMemorySize ( ) { } public final synchronized Map < K , V > snapshot ( ) { } protected String getClassName ( ) { } protected int getValueSize ( V value ) { } private void trimToSize ( int maxSize ) { while ( true ) { if ( ( ( memorySize ) <= maxSize ) || ( map . isEmpty ( ) ) ) { break ; } if ( ( ( memorySize ) < 0 ) || ( ( map . isEmpty ( ) ) && ( ( memorySize ) != 0 ) ) ) { <START_BUG> throw new IllegalStateException ( ( ( getClassName ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>reporting<seq2seq4repair_space>inconsistent<seq2seq4repair_space>results" ) ) ; <END_BUG> } Map . Entry < K , V > toRemove = map . entrySet ( ) . iterator ( ) . next ( ) ; map . remove ( toRemove . getKey ( ) ) ; memorySize -= getValueSize ( toRemove . getValue ( ) ) ; } } @ Override public final synchronized String toString ( ) { } }

Fix:
throw new IllegalStateException ( ( ( getClassName ( ) ) + ".getValueSize()<seq2seq4repair_space>is<seq2seq4repair_space>reporting<seq2seq4repair_space>inconsistent<seq2seq4repair_space>results" ) ) ;
Buggy code:
public class DomainSocketBindingGroupRemoveHandler extends AbstractRemoveStepHandler { public static final String OPERATION_NAME = REMOVE ; public static final DomainSocketBindingGroupRemoveHandler INSTANCE = new DomainSocketBindingGroupRemoveHandler ( ) ; private volatile ServerInventory serverInventory ; protected DomainSocketBindingGroupRemoveHandler ( ) { } public void initializeServerInventory ( ServerInventory serverInventory ) { } protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected void performRemove ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { if ( ! ( context . getProcessType ( ) . isServer ( ) ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { String socketBindingGroupName = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) . getLastElement ( ) . getValue ( ) ; Set < String > serverGroups = new HashSet < String > ( ) ; for ( ResourceEntry entry : context . readResourceFromRoot ( EMPTY_ADDRESS ) . getChildren ( SERVER_GROUP ) ) { if ( entry . getModel ( ) . get ( SOCKET_BINDING_GROUP ) . asString ( ) . equals ( socketBindingGroupName ) ) { serverGroups . add ( entry . getName ( ) ) ; } } Set < String > runningServers = new HashSet < String > ( ) ; for ( ResourceEntry entry : context . readResourceFromRoot ( EMPTY_ADDRESS ) . getChildren ( HOST ) . iterator ( ) . next ( ) . getChildren ( SERVER_CONFIG ) ) { ModelNode configModel = entry . getModel ( ) ; if ( configModel . hasDefined ( SOCKET_BINDING_GROUP ) ) { if ( configModel . get ( SOCKET_BINDING_GROUP ) . asString ( ) . equals ( socketBindingGroupName ) ) { if ( isRunningServer ( entry . getName ( ) ) ) { runningServers . add ( entry . getName ( ) ) ; } } } else { if ( serverGroups . contains ( configModel . get ( GROUP ) . asString ( ) ) ) { if ( isRunningServer ( entry . getName ( ) ) ) { runningServers . add ( entry . getName ( ) ) ; } } } } if ( ! ( runningServers . isEmpty ( ) ) ) { throw new OperationFailedException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>remove<seq2seq4repair_space>socket-binding-group<seq2seq4repair_space>since<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>servers<seq2seq4repair_space>are<seq2seq4repair_space>running:<seq2seq4repair_space>" + runningServers ) ) ; } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } } , MODEL ) ; } super . performRemove ( context , operation , model ) ; } private boolean isRunningServer ( String serverName ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { private final String TAG = getClass ( ) . getSimpleName ( ) ; public static final String PREFS_NAME = "RASTEMP" ; public Builder alert ; public RHTThread rhtt ; public Button ConnBtn ; private SharedPreferences spShared ; public void updateStatus ( int statusRes ) { } public void updateInfo ( int t , int rh ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void connectToServer ( View v ) { } public void onStop ( ) { super . onStop ( ) ; try { rhtt . sock . close ( ) ; <START_BUG> } catch ( IOException ioe ) { <END_BUG> } rhtt . interrupt ( ) ; try { if ( rhtt . isAlive ( ) ) rhtt . join ( 1000 ) ; } catch ( InterruptedException ie ) { } } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class DummyClientInterceptor implements JClientRequestInterceptor { private static int SERVER_CTX_ID = 50 ; private static int CLIENT_CTX_ID = 51 ; private String interceptorName = null ; public DummyClientInterceptor ( String name ) { } public String name ( ) { } public void send_request ( JClientRequestInfo jri ) throws IOException { <START_BUG> jri . add_request_service_context ( new DummyClientServiceContext ( DummyClientInterceptor . CLIENT_CTX_ID , InetAddress . getLocalHost ( ) . getHostName ( ) ) , true ) ; <END_BUG> } public void receive_reply ( JClientRequestInfo jri ) throws IOException { } public void send_poll ( JClientRequestInfo jri ) throws IOException { } public void receive_exception ( JClientRequestInfo jri ) throws IOException { } public void receive_other ( JClientRequestInfo jri ) throws IOException { } }

Fix:
jri . add_request_service_context ( new DummyClientServiceContext ( DummyClientInterceptor . CLIENT_CTX_ID , InetAddress . getLocalHost ( ) . getHostName ( ) ) ) ;
Buggy code:
public class PcAppTaskSvcImpl implements PcAppTaskSvc { @ Autowired PcAppTaskDao pcAppTaskDao ; @ Autowired PcAppDao pcAppDao ; @ Autowired PcAppDepHistoryDao pcAppDepHistoryDao ; @ Autowired PcAppVersionDao pcAppVersionDao ; @ Override public void save ( PcAppTask record ) { } @ Override public PcAppTask queryById ( Long id ) { } @ Override public Page < PcAppTask > queryPage ( Integer pageNum , Integer pageSize , CPcAppTask cdt , String orders ) { } @ Override public void update ( PcAppTask record ) { } @ Override public Page < PcAppTaskInfo > queryPcAppTaskInfo ( Integer pageNum , Integer pageSize , CPcAppTask cdt , String orders ) { Page < PcAppTask > pageTask = pcAppTaskDao . selectPage ( pageNum , pageSize , cdt , orders ) ; List < PcAppTaskInfo > pcAppTaskInfoList = new ArrayList < > ( ) ; for ( PcAppTask task : pageTask . getData ( ) ) { PcAppTaskInfo pcAppTaskInfo = new PcAppTaskInfo ( ) ; pcAppTaskInfo . setPcAppTask ( task ) ; PcAppVersion pcAppVersion = pcAppVersionDao . selectById ( task . getAppVnoId ( ) ) ; pcAppTaskInfo . setVersionNo ( pcAppVersion . getVersionNo ( ) ) ; pcAppTaskInfoList . add ( pcAppTaskInfo ) ; } Page < PcAppTaskInfo > result = new Page ( ) ; result . setData ( pcAppTaskInfoList ) ; result . setPageNum ( pageTask . getPageNum ( ) ) ; result . setPageSize ( pageTask . getPageSize ( ) ) ; result . setTotalPages ( pageTask . getTotalPages ( ) ) ; result . setTotalRows ( pageTask . getTotalRows ( ) ) ; <START_BUG> return null ; <END_BUG> } }

Fix:
return result ;
Buggy code:
public class CollectionsHandler extends RequestHandlerBase { protected static Logger log = LoggerFactory . getLogger ( CollectionsHandler . class ) ; protected final CoreContainer coreContainer ; public CollectionsHandler ( ) { } public CollectionsHandler ( final CoreContainer coreContainer ) { } @ Override public final void init ( NamedList args ) { } public CoreContainer getCoreContainer ( ) { } @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } private void handleReloadAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws InterruptedException , KeeperException { } private void handleSyncShardAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws IOException , InterruptedException , SolrServerException , KeeperException { } private void handleDeleteAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws InterruptedException , KeeperException { } private void handleCreateAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws InterruptedException , KeeperException { CollectionsHandler . log . info ( ( "Creating<seq2seq4repair_space>Collection<seq2seq4repair_space>:<seq2seq4repair_space>" + ( req . getParamString ( ) ) ) ) ; <START_BUG> Integer numReplicas = req . getParams ( ) . getInt ( REPLICATION_FACTOR , 0 ) ; <END_BUG> String name = req . getParams ( ) . required ( ) . get ( "name" ) ; String configName = req . getParams ( ) . get ( "collection.configName" ) ; String numShards = req . getParams ( ) . get ( NUM_SLICES ) ; String maxShardsPerNode = req . getParams ( ) . get ( MAX_SHARDS_PER_NODE ) ; ZkNodeProps m = new ZkNodeProps ( Overseer . QUEUE_OPERATION , OverseerCollectionProcessor . CREATECOLLECTION , OverseerCollectionProcessor . REPLICATION_FACTOR , numReplicas . toString ( ) , "name" , name , "collection.configName" , configName , OverseerCollectionProcessor . NUM_SLICES , numShards , OverseerCollectionProcessor . MAX_SHARDS_PER_NODE , maxShardsPerNode ) ; coreContainer . getZkController ( ) . getOverseerCollectionQueue ( ) . offer ( ZkStateReader . toJSON ( m ) ) ; } public static ModifiableSolrParams params ( String ... params ) { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } }

Fix:
Integer numReplicas = req . getParams ( ) . getInt ( REPLICATION_FACTOR , 1 ) ;
Buggy code:
@ SuppressWarnings ( "restriction" ) public class Java2WSConfigWidgetFactory implements INamedWidgetContributorFactory { private SimpleWidgetContributor java2WSWidgetContributor ; private Java2WSConfigWidget java2WSConfigWidget = new Java2WSConfigWidget ( ) ; public Java2WSConfigWidgetFactory ( ) { } public INamedWidgetContributor getFirstNamedWidget ( ) { } public INamedWidgetContributor getNextNamedWidget ( INamedWidgetContributor widgetContributor ) { } public void registerDataMappings ( DataMappingRegistry dataRegistry ) { } public void setJava2WSDataModel ( Java2WSDataModel model ) { } private void init ( ) { java2WSWidgetContributor = new SimpleWidgetContributor ( ) ; CXFContext context = CXFCorePlugin . getDefault ( ) . getJava2WSContext ( ) ; <START_BUG> String title = CXFCreationUIMessages . bind ( JAVA2WS_PAGE_TITLE , new Object [ ] { CXFCorePlugin . getEdition ( ) , context . getCxfRuntimeVersion ( ) } ) ; <END_BUG> java2WSWidgetContributor . setTitle ( title ) ; java2WSWidgetContributor . setDescription ( JAVA2WS_PAGE_DESCRIPTION ) ; java2WSWidgetContributor . setFactory ( new WidgetContributorFactory ( ) { public WidgetContributor create ( ) { return java2WSConfigWidget ; } } ) ; } }

Fix:
String title = CXFCreationUIMessages . bind ( JAVA2WS_PAGE_TITLE , new Object [ ] { context . getCxfRuntimeEdition ( ) , context . getCxfRuntimeVersion ( ) } ) ;
Buggy code:
public class MoveUpAction extends AbstractColumbaAction implements SelectionListener { public MoveUpAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent arg0 ) { } public void selectionChanged ( SelectionChangedEvent e ) { if ( ( ( ( org . columba . mail . gui . tree . selection . TreeSelectionChangedEvent ) ( e ) ) . getSelected ( ) . length ) > 0 ) { AbstractFolder folder = ( ( org . columba . mail . gui . tree . selection . TreeSelectionChangedEvent ) ( e ) ) . getSelected ( ) [ 0 ] ; if ( ( folder != null ) && ( folder instanceof MessageFolder ) ) { <START_BUG> FolderItem item = folder . getFolderItem ( ) ; <END_BUG> if ( item . get ( "property" , "accessrights" ) . equals ( "user" ) ) { int index = folder . getParent ( ) . getIndex ( folder ) ; if ( index > 0 ) { setEnabled ( true ) ; } else { setEnabled ( false ) ; } } else { setEnabled ( false ) ; } } } else { setEnabled ( false ) ; } } }

Fix:
FolderItem item = folder . getConfiguration ( ) ;
Buggy code:
public class InterceptorAnnotationParsingProcessor extends AbstractComponentConfigProcessor { private static final DotName INTERCEPTORS_ANNOTATION_NAME = DotName . createSimple ( Interceptors . class . getName ( ) ) ; private static final DotName AROUND_INVOKE_ANNOTATION_NAME = DotName . createSimple ( AroundInvoke . class . getName ( ) ) ; protected void processComponentConfig ( final DeploymentUnit deploymentUnit , final DeploymentPhaseContext phaseContext , final CompositeIndex index , final ComponentConfiguration componentConfiguration ) { <START_BUG> final ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( componentConfiguration . getBeanClass ( ) ) ) ; <END_BUG> componentConfiguration . addMethodInterceptorConfigs ( getInterceptorConfigs ( classInfo , index ) ) ; } private List < MethodInterceptorConfiguration > getInterceptorConfigs ( final ClassInfo classInfo , final CompositeIndex index ) { } private void getInterceptorConfigs ( final ClassInfo classInfo , final CompositeIndex index , final List < MethodInterceptorConfiguration > classLevelInterceptorConfigurations , final List < MethodInterceptorConfiguration > methodLevelInterceptorConfigurations , final List < MethodInterceptorConfiguration > componentDefinedInterceptors ) { } private MethodInfo getAroundInvokeMethod ( final ClassInfo classInfo ) { } private void validateArgumentType ( final ClassInfo classInfo , final MethodInfo methodInfo ) { } }

Fix:
final ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( componentConfiguration . getComponentClassName ( ) ) ) ;
Buggy code:
public abstract class Actions extends CommandGene implements IMutateable { public Actions ( final GPConfiguration a_conf ) throws InvalidConfigurationException { } int timeToPeformAction ; public abstract boolean arePreconditionsSatisfied ( CostRewardObject cr ) { } public abstract void results ( CostRewardObject cr ) { } public abstract int getTime ( ) { } public abstract String getPrismSucessString ( ) { } public abstract String getPrismFailureString ( ) { } public abstract double getFailureRate ( ) { } @ Override public CommandGene applyMutation ( int arg0 , double arg1 ) throws InvalidConfigurationException { double val = Math . random ( ) ; if ( val < arg1 ) { CommandGene [ ] [ ] possibleCommands = RunGA . nodeSets ; Random rand ; CommandGene result = null ; <START_BUG> while ( ! ( ! ( result instanceof Actions ) ) ) { <END_BUG> rand = new Random ( ) ; int choice = rand . nextInt ( possibleCommands [ 0 ] . length ) ; result = possibleCommands [ 0 ] [ choice ] ; } return result ; } return this ; } }

Fix:
while ( ! ( result instanceof Actions ) ) {
Buggy code:
public class MyMainActivity extends Activity { MyMainActivity myThis ; Context context ; private ConnectivityManager connManager ; private NetworkInfo wifiNetworkInfo ; private Button btnWFDGroupOwner ; private Button btnWFDClient ; private Button btnP2PWFDClient ; private Button btnWiFiClient ; private Button btnRelay ; private Button btnClient ; private TextView tvMainWiFiState ; private Button btnMainWiFiTurnOn ; private Button btnMainWiFiTurnOff ; private boolean p2pSuported = false ; private WifiManager wifiManager ; private final IntentFilter intentFilter = new IntentFilter ( ) ; BroadcastReceiver receiver ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void setLogToFile ( ) { <START_BUG> SimpleDateFormat sdf = new SimpleDateFormat ( "yy-MM-dd_HH_mm_ss" ) ; <END_BUG> String timestamp = sdf . format ( new Date ( ) ) ; String appName = getResources ( ) . getString ( app_name ) ; appName = appName . replace ( '<seq2seq4repair_space>' , '-' ) ; String cmd = ( ( ( ( "logcat<seq2seq4repair_space>-v<seq2seq4repair_space>time<seq2seq4repair_space>-f<seq2seq4repair_space>" + "//storage//sdcard0//logs//" ) + timestamp ) + "_" ) + appName ) + ".txt" ; try { File logDir = new File ( "//storage//sdcard0//logs" ) ; if ( ! ( logDir . exists ( ) ) ) logDir . mkdir ( ) ; Runtime . getRuntime ( ) . exec ( cmd ) ; if ( ( btnMainWiFiTurnOff ) == null ) throw new RuntimeException ( "ehhhhhh" ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } @ Override public void onResume ( ) { } private void adjustWifiStateButtons ( ) { } private void setButtonsListeners ( ) { } private boolean isWifiDirectSupported ( Context ctx ) { } private boolean isWifiOnDevice ( ) { } private boolean isWifiActive ( ) { } private void enableAllWiFiActivityButtons ( boolean enable , boolean p2pSuported ) { } No newline ; at end ; of file ; }

Fix:
SimpleDateFormat sdf = new SimpleDateFormat ( "yy-MM-dd_HH'h'mm'm'ss's'" ) ;
Buggy code:
public class TestS3TaskProvider extends S3ProviderTestBase { private S3TaskProvider taskProvider ; @ Before public void setUp ( ) throws Exception { <START_BUG> taskProvider = new S3TaskProvider ( null , null , null , null ) ; <END_BUG> } @ Test public void testPerformTask ( ) throws Exception { } @ Test public void testGetTaskStatus ( ) throws Exception { } }

Fix:
taskProvider = new S3TaskProvider ( null , null , null , null , null , null , null ) ;
Buggy code:
public class StatCalculator implements Serializable { List values = new ArrayList ( ) ; double sum = 0 ; double sumOfSquares = 0 ; double mean = 0 ; double deviation = 0 ; int count = 0 ; long bytes = 0 ; public void clear ( ) { } public void addValue ( long newValue ) { } public void addValue ( int newValue ) { } public void addValue ( float newValue ) { } public void addValue ( double newValue ) { } public void addBytes ( long newValue ) { } public void addAll ( StatCalculator calc ) { <START_BUG> Iterator iter = values . iterator ( ) ; <END_BUG> while ( iter . hasNext ( ) ) { addValue ( ( ( Number ) ( iter . next ( ) ) ) ) ; } } public Number getMedian ( ) { } public long getTotalBytes ( ) { } public Number getPercentPoint ( float percent ) { } public Number getPercentPoint ( double percent ) { } public synchronized HashMap getDistribution ( ) { } public double getMean ( ) { } public double getStandardDeviation ( ) { } public Number getMin ( ) { } public Number getMax ( ) { } public int getCount ( ) { } public void addValue ( Number val ) { } private void addSortedValue ( Number val ) { } }

Fix:
Iterator iter = calc . values . iterator ( ) ;
Buggy code:
final class KeyAssistDialog extends PopupDialog { private static final String BINDING_KEY = "Binding.bindings.jface.eclipse.org" ; private static final int NO_REMEMBERED_WIDTH = - 1 ; private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle . getBundle ( KeyAssistDialog . class . getName ( ) ) ; private final IActivityManager activityManager ; private final IBindingService bindingService ; private Binding binding = null ; private final List bindings = new ArrayList ( ) ; private final ICommandService commandService ; private Table completionsTable = null ; private boolean hasRememberedState = false ; private final KeyBindingState keyBindingState ; private int previousWidth = KeyAssistDialog . NO_REMEMBERED_WIDTH ; private final WorkbenchKeyboard workbenchKeyboard ; private SortedMap conflictMatches ; KeyAssistDialog ( final IWorkbench workbench , final WorkbenchKeyboard associatedKeyboard , final KeyBindingState associatedState ) { } final void clearRememberedState ( ) { } public final boolean close ( ) { } public final boolean close ( final boolean rememberState ) { } private final boolean close ( final boolean rememberState , final boolean resetState ) { } private final void configureLocation ( final Point size ) { } private final Point configureSize ( ) { } private String getKeySequenceString ( ) { } protected final Control createDialogArea ( final Composite parent ) { } private final void createEmptyDialogArea ( final Composite parent ) { } private final void createTableDialogArea ( final Composite parent , final SortedMap partialMatches ) { } private final void editKeyBinding ( ) { <START_BUG> final String keysPageId = "org.eclipse.ui.preferencePages.NewKeys" ; <END_BUG> final PreferenceDialog dialog = PreferencesUtil . createPreferenceDialogOn ( getShell ( ) , keysPageId , null , binding ) ; clearRememberedState ( ) ; dialog . open ( ) ; } private final void executeKeyBinding ( final Event trigger ) { } private final SortedMap getPartialMatches ( ) { } private final boolean hasRememberedState ( ) { } public final int open ( ) { } public final int open ( Collection bindings ) { } private final void registerShellType ( ) { } private final void rememberState ( final int previousWidth , final Binding binding ) { } protected final void setParentShell ( final Shell newParentShell ) { } }

Fix:
final String keysPageId = "org.eclipse.ui.preferencePages.Keys" ;