nus-yam/ex-repair huggingface dataset:
Buggy code:
class StyledTextDragAndDropEffect extends DragAndDropEffect { StyledText text ; StyledTextDragAndDropEffect ( StyledText control ) { } void showDropTargetEffect ( int effect , int x , int y ) { if ( ( effect & ( DND . FEEDBACK_SELECT ) ) != 0 ) { Point pt = text . getDisplay ( ) . map ( null , text , x , y ) ; int oldOffset = text . getCaretOffset ( ) ; int newOffset = - 1 ; try { newOffset = text . getOffsetAtLocation ( pt ) ; } catch ( IllegalArgumentException ex1 ) { int maxOffset = text . getCharCount ( ) ; Point maxLocation = text . getLocationAtOffset ( maxOffset ) ; if ( ( pt . y ) >= ( maxLocation . y ) ) { if ( ( pt . x ) >= ( maxLocation . x ) ) { newOffset = maxOffset ; } else { try { newOffset = text . getOffsetAtLocation ( new Point ( pt . x , maxLocation . y ) ) ; } catch ( IllegalArgumentException ex2 ) { newOffset = - 1 ; } } } else { try { <START_BUG> int startOffset = text . getOffsetAtLocation ( new Point ( 2 , pt . y ) ) ; <END_BUG> int endOffset = maxOffset ; int line = text . getLineAtOffset ( startOffset ) ; int lineCount = text . getLineCount ( ) ; if ( ( line + 1 ) < lineCount ) { endOffset = ( text . getOffsetAtLine ( ( line + 1 ) ) ) - 1 ; } int lineHeight = text . getLineHeight ( startOffset ) ; for ( int i = endOffset ; i >= startOffset ; i -- ) { Point p = text . getLocationAtOffset ( i ) ; if ( ( ( ( p . x ) < ( pt . x ) ) && ( ( p . y ) < ( pt . y ) ) ) && ( ( ( p . y ) + lineHeight ) > ( pt . y ) ) ) { newOffset = i ; break ; } } } catch ( IllegalArgumentException ex2 ) { newOffset = - 1 ; } } } if ( ( newOffset != ( - 1 ) ) && ( newOffset != oldOffset ) ) { text . setFocus ( ) ; OS . ImageList_DragShowNolock ( false ) ; text . setCaretOffset ( newOffset ) ; OS . ImageList_DragShowNolock ( true ) ; } } } }

Fix:
int startOffset = text . getOffsetAtLocation ( new Point ( 0 , pt . y ) ) ;
Buggy code:
public class AnalyticsSparkSQLTest { private AnalyticsDataService service ; @ BeforeSuite public void setup ( ) throws IOException , NamingException , AnalyticsException { } @ AfterSuite public void done ( ) throws IOException , NamingException , AnalyticsException { } @ Test public void testExecutionContextInit ( ) { } @ Test ( dependsOnMethods = "testExecutionContextInit" ) public void testExecutionSelectQuery ( ) throws AnalyticsException { List < Record > records = AnalyticsRecordStoreTest . generateRecords ( 1 , "Log" , 0 , 10 , ( - 1 ) , ( - 1 ) ) ; this . service . deleteTable ( 1 , "Log" ) ; this . service . createTable ( 1 , "Log" ) ; this . service . insert ( records ) ; AnalyticsExecutionContext . executeQuery ( 1 , ( "define<seq2seq4repair_space>table<seq2seq4repair_space>Log<seq2seq4repair_space>server_name<seq2seq4repair_space>STRING,<seq2seq4repair_space>" + "ip<seq2seq4repair_space>STRING,<seq2seq4repair_space>tenant<seq2seq4repair_space>INTEGER,<seq2seq4repair_space>sequence<seq2seq4repair_space>LONG,<seq2seq4repair_space>summary<seq2seq4repair_space>STRING" ) ) ; <START_BUG> AnalyticsQueryResult result = AnalyticsExecutionContext . executeQuery ( 1 , "SELECT<seq2seq4repair_space>*<seq2seq4repair_space>FROM<seq2seq4repair_space>Log" ) ; <END_BUG> Assert . assertEquals ( result . getRows ( ) . size ( ) , 10 ) ; System . out . println ( result ) ; this . service . deleteTable ( 1 , "Log" ) ; } }

Fix:
AnalyticsQueryResult result = AnalyticsExecutionContext . executeQuery ( 1 , "SELECT<seq2seq4repair_space>ip<seq2seq4repair_space>FROM<seq2seq4repair_space>Log" ) ;
Buggy code:
public class AttrImpl extends NodeImpl implements Attr { static final long serialVersionUID = 7277707688218972102L ; protected Object value = null ; protected String name ; protected static TextImpl textNode = null ; protected AttrImpl ( DocumentImpl ownerDocument , String name ) { } protected AttrImpl ( ) { } protected void makeChildNode ( ) { } void setOwnerDocument ( DocumentImpl doc ) { if ( needsSyncChildren ( ) ) { synchronizeChildren ( ) ; } super . setOwnerDocument ( doc ) ; if ( ! ( hasStringValue ( ) ) ) { <START_BUG> for ( ChildNode child = firstChild ; child != null ; child = child . nextSibling ) { <END_BUG> child . setOwnerDocument ( doc ) ; } } } public Node cloneNode ( boolean deep ) { } public short getNodeType ( ) { } public String getNodeName ( ) { } public void setNodeValue ( String value ) throws DOMException { } public String getNodeValue ( ) { } public String getName ( ) { } public void setValue ( String newvalue ) { } public String getValue ( ) { } public boolean getSpecified ( ) { } public Element getElement ( ) { } public Element getOwnerElement ( ) { } public void normalize ( ) { } public void setSpecified ( boolean arg ) { } public String toString ( ) { } public boolean hasChildNodes ( ) { } public NodeList getChildNodes ( ) { } public Node getFirstChild ( ) { } public Node getLastChild ( ) { } final ChildNode lastChild ( ) { } final void lastChild ( ChildNode node ) { } public Node insertBefore ( Node newChild , Node refChild ) throws DOMException { } Node internalInsertBefore ( Node newChild , Node refChild , int mutationMask ) throws DOMException { } public Node removeChild ( Node oldChild ) throws DOMException { } Node internalRemoveChild ( Node oldChild , int mutationMask ) throws DOMException { } public Node replaceChild ( Node newChild , Node oldChild ) throws DOMException { } public int getLength ( ) { } public Node item ( int index ) { } public void setReadOnly ( boolean readOnly , boolean deep ) { } protected void synchronizeChildren ( ) { } protected final void synchronizeChildren ( int nodeIndex ) { } void checkNormalizationAfterInsert ( ChildNode insertedChild ) { } void checkNormalizationAfterRemove ( ChildNode previousSibling ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } private void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } }

Fix:
for ( ChildNode child = ( ( ChildNode ) ( value ) ) ; child != null ; child = child . nextSibling ) {
Buggy code:
public final class ActivityManager implements IActivityManager { static boolean isActivityDefinitionChildOf ( String ancestor , String id , Map activityDefinitionsById ) { } private Set activeActivityIds = new HashSet ( ) ; private Map activitiesById = new HashMap ( ) ; private Map activityDefinitionsById = new HashMap ( ) ; private IActivityManagerEvent activityManagerEvent ; private List activityManagerListeners ; private IActivityRegistry activityRegistry ; private Set definedActivityIds = new HashSet ( ) ; private Set enabledActivityIds = new HashSet ( ) ; private Map patternBindingsByActivityId = new HashMap ( ) ; public ActivityManager ( ) { } public ActivityManager ( IActivityRegistry activityRegistry ) { } public void addActivityManagerListener ( IActivityManagerListener activityManagerListener ) { } public Set getActiveActivityIds ( ) { } public IActivity getActivity ( String activityId ) { } public Set getDefinedActivityIds ( ) { } public Set getEnabledActivityIds ( ) { } public boolean match ( String string , Set activityIds ) { } public void removeActivityManagerListener ( IActivityManagerListener activityManagerListener ) { } public void setActiveActivityIds ( Set activeActivityIds ) { } public void setEnabledActivityIds ( Set enabledActivityIds ) { } private void fireActivityManagerChanged ( ) { if ( ( activityManagerListeners ) != null ) for ( int i = 0 ; i < ( activityManagerListeners . size ( ) ) ; i ++ ) { if ( ( activityManagerEvent ) == null ) <START_BUG> activityManagerEvent = new ActivityManagerEvent ( this ) ; <END_BUG> ( ( IActivityManagerListener ) ( activityManagerListeners . get ( i ) ) ) . activityManagerChanged ( activityManagerEvent ) ; } } private void notifyActivities ( Collection activityIds ) { } private void readRegistry ( ) { } private boolean updateActivity ( Activity activity ) { } private Collection updateActivities ( Collection activityIds ) { } }

Fix:
activityManagerEvent = new ActivityManagerEvent ( this , false , false , false ) ;
Buggy code:
public class OperatingSystemMXBeanReadResourceHandler implements OperationStepHandler { public static final OperatingSystemMXBeanReadResourceHandler INSTANCE = new OperatingSystemMXBeanReadResourceHandler ( ) ; private OperatingSystemMXBeanReadResourceHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode result = context . getResult ( ) ; for ( String attribute : PlatformMBeanConstants . OPERATING_SYSTEM_READ_ATTRIBUTES ) { final ModelNode store = result . get ( attribute ) ; try { OperatingSystemMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( SecurityException ignored ) { } catch ( UnsupportedOperationException ignored ) { } } for ( String attribute : PlatformMBeanConstants . OPERATING_SYSTEM_METRICS ) { final ModelNode store = result . get ( attribute ) ; try { OperatingSystemMXBeanAttributeHandler . storeResult ( attribute , store ) ; } catch ( SecurityException ignored ) { } catch ( UnsupportedOperationException ignored ) { } } if ( ( PlatformMBeanUtil . JVM_MAJOR_VERSION ) > 6 ) { final ModelNode store = result . get ( OBJECT_NAME ) ; OperatingSystemMXBeanAttributeHandler . storeResult ( OBJECT_NAME , store ) ; } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class OnlineBroadCast implements Runnable { private Logger log = Logger . getLogger ( OnlineBroadCast . class . getName ( ) ) ; public void run ( ) { PeykUser sourceUser = PeykUser . getSourceUser ( ) ; while ( true ) { DatagramSocket datagramSocket ; try { datagramSocket = new DatagramSocket ( ) ; datagramSocket . setBroadcast ( true ) ; byte [ ] sendData = sourceUser . serialize ( ) ; InetAddress broadcast = PeykUser . getMyBroadcast ( ) ; DatagramPacket packet = new DatagramPacket ( sendData , sendData . length , broadcast , sourceUser . getPort ( ) ) ; datagramSocket . send ( packet ) ; log . info ( ( "broadcast:<seq2seq4repair_space>" + broadcast ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } for ( PeykUser u : sourceUser . getFriendsList ( ) ) { <START_BUG> if ( ( ( new Date ( ) . getTime ( ) ) - ( u . getReceiveDate ( ) . getTime ( ) ) ) > ( 60000 * 4 ) ) { <END_BUG> sourceUser . getFriendsList ( ) . remove ( u ) ; } } try { Thread . sleep ( 3000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } public void start ( ) { } }

Fix:
if ( ( ( new Date ( ) . getTime ( ) ) - ( u . getReceiveDate ( ) . getTime ( ) ) ) > 4000 ) {
Buggy code:
public class BeanMethodPolymorphismTests { @ Test public void beanMethodOverloadingWithoutInheritance ( ) { <START_BUG> @ SuppressWarnings ( { "unused" , "hiding" } ) <END_BUG> @ Configuration class Config { @ Bean String aString ( ) { return "na" ; } @ Bean String aString ( Integer dependency ) { return "na" ; } } try { new AnnotationConfigApplicationContext ( Config . class ) ; fail ( "expected<seq2seq4repair_space>bean<seq2seq4repair_space>method<seq2seq4repair_space>overloading<seq2seq4repair_space>exception" ) ; } catch ( BeanDefinitionParsingException ex ) { assertTrue ( ex . getMessage ( ) , ex . getMessage ( ) . contains ( "2<seq2seq4repair_space>overloaded<seq2seq4repair_space>@Bean<seq2seq4repair_space>methods<seq2seq4repair_space>named<seq2seq4repair_space>'aString'" ) ) ; } } @ Test public void beanMethodOverloadingWithInheritance ( ) { } @ Configuration static class SuperConfig { @ Bean String aString ( ) { } } @ Configuration static class SubConfig { @ Bean Integer anInt ( ) { } @ Bean String aString ( Integer dependency ) { } } @ Test public void beanMethodShadowing ( ) { } @ Import ( BeanMethodPolymorphismTests . SubConfig . class ) @ Configuration static class ShadowConfig { @ Bean String aString ( ) { } } @ Test public void beanMethodsDetectedOnSuperClass ( ) { } @ Configuration static class BaseConfig { @ Bean public TestBean testBean ( ) { } } @ Configuration static class Config extends BeanMethodPolymorphismTests . BaseConfig { } }

Fix:
@ SuppressWarnings ( { "hiding" } )
Buggy code:
@ Repository ( "supplierDAO" ) public class SupplierDAOImp implements SupplierDAO { private static final Log log = LogFactory . getLog ( SupplierDAOImp . class ) ; private static final String SUPPLIER = "supplier" ; private static final String PUBLISHER = "publisher" ; @ Autowired HibernateTemplate hibernateTemplate ; public HibernateTemplate getHibernateTemplate ( ) { } public void setHibernateTemplate ( HibernateTemplate hibernateTemplate ) { } @ Override public List findByPropertyAccurate ( String propertyName , String value ) { } @ Override public List findByPropertyFuzzy ( String propertyName , String value ) { } public List likeFindByPub ( String publisher ) { } public List findBySubPub ( String supplier , String publisher ) { } public List accfindBySubPub ( String supplier , String publisher ) { } public boolean updateSup ( Supplier sup ) { } public boolean save ( Supplier transientInstance ) { } public boolean delete ( Supplier persistentInstance ) { } public Supplier findById ( String id ) { } public List findBySupplier ( String supplier ) { } public List findByPublisher ( String publisher ) { } public List findAll ( ) { SupplierDAOImp . log . debug ( "finding<seq2seq4repair_space>all<seq2seq4repair_space>publisher<seq2seq4repair_space>instances" ) ; List list = null ; try { <START_BUG> String queryString = "from<seq2seq4repair_space>Supplier<seq2seq4repair_space>s<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>convert_gbk(s.publisher)<seq2seq4repair_space>asc" ; <END_BUG> list = getHibernateTemplate ( ) . find ( queryString ) ; } catch ( RuntimeException re ) { SupplierDAOImp . log . error ( "find<seq2seq4repair_space>all<seq2seq4repair_space>failed" , re ) ; } return list ; } public List findAllSupplier ( ) { } public List findAllOrderByPublisher ( ) { } public List findAllOrderByIdsp ( ) { } No newline ; at end ; of file ; }

Fix:
String queryString = "from<seq2seq4repair_space>Supplier<seq2seq4repair_space>s" ;
Buggy code:
public class HTTPArgumentsPanel extends ArgumentsPanel { private static final long serialVersionUID = 240L ; private static final String ENCODE_OR_NOT = "encode?" ; private static final String INCLUDE_EQUALS = "include_equals" ; @ Override protected void initializeTableModel ( ) { } public static boolean testFunctors ( ) { } @ Override protected void sizeColumns ( JTable table ) { } @ Override protected HTTPArgument makeNewArgument ( ) { } public HTTPArgumentsPanel ( ) { } @ Override public TestElement createTestElement ( ) { } public Arguments getParameters ( ) { } private Arguments getUnclonedParameters ( ) { } @ Override public void configure ( TestElement el ) { super . configure ( el ) ; if ( el instanceof Arguments ) { tableModel . clearData ( ) ; HTTPArgument . convertArgumentsToHTTP ( ( ( Arguments ) ( el ) ) ) ; PropertyIterator iter = ( ( Arguments ) ( el ) ) . getArguments ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { HTTPArgument arg = ( ( HTTPArgument ) ( iter . next ( ) . getObjectValue ( ) ) ) ; tableModel . addRow ( arg ) ; } } <START_BUG> checkDeleteStatus ( ) ; <END_BUG> } protected boolean isMetaDataNormal ( HTTPArgument arg ) { } @ Override protected Argument createArgumentFromClipboard ( String [ ] clipboardCols ) { } }

Fix:
checkButtonsStatus ( ) ;
Buggy code:
class StormServerHandler extends SimpleChannelUpstreamHandler { private static final Logger LOG = LoggerFactory . getLogger ( StormServerHandler . class ) ; Server server ; private AtomicInteger failure_count ; StormServerHandler ( Server server ) { } @ Override public void channelConnected ( ChannelHandlerContext ctx , ChannelStateEvent e ) { } @ Override public void messageReceived ( ChannelHandlerContext ctx , MessageEvent e ) { List < TaskMessage > msgs = ( ( List < TaskMessage > ) ( e . getMessage ( ) ) ) ; if ( msgs == null ) { return ; } try { <START_BUG> server . enqueue ( msgs , e . getRemoteAddress ( ) . toString ( ) ) ; <END_BUG> } catch ( InterruptedException e1 ) { StormServerHandler . LOG . info ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>enqueue<seq2seq4repair_space>a<seq2seq4repair_space>request<seq2seq4repair_space>message" , e ) ; failure_count . incrementAndGet ( ) ; } } @ Override public void exceptionCaught ( ChannelHandlerContext ctx , ExceptionEvent e ) { } }

Fix:
server . enqueue ( msgs ) ;
Buggy code:
public interface IObjectStreamFactory { public static final class DefaultObjectStreamFactory implements IObjectStreamFactory { private static final Logger log = LoggerFactory . getLogger ( IObjectStreamFactory . DefaultObjectStreamFactory . class ) ; public ObjectInputStream newObjectInputStream ( InputStream in ) throws IOException { } public ObjectOutputStream newObjectOutputStream ( final OutputStream out ) throws IOException { final ObjectOutputStream oos = new ObjectOutputStream ( out ) ; return new ObjectOutputStream ( ) { <START_BUG> protected void writeObjectOverride ( final Object obj ) throws IOException { <END_BUG> try { oos . writeObject ( obj ) ; } catch ( IOException e ) { if ( SerializableChecker . isAvailable ( ) ) { new SerializableChecker ( ( ( NotSerializableException ) ( e ) ) ) . writeObject ( obj ) ; throw e ; } throw e ; } catch ( RuntimeException e ) { IObjectStreamFactory . DefaultObjectStreamFactory . log . error ( ( ( ( "error<seq2seq4repair_space>writing<seq2seq4repair_space>object<seq2seq4repair_space>" + obj ) + ":<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) , e ) ; throw e ; } } public void flush ( ) throws IOException { oos . flush ( ) ; super . flush ( ) ; } public void close ( ) throws IOException { oos . close ( ) ; super . close ( ) ; } } ; } } ObjectInputStream newObjectInputStream ( InputStream in ) throws IOException { } ObjectOutputStream newObjectOutputStream ( OutputStream out ) throws IOException ; }

Fix:
protected final void writeObjectOverride ( final Object obj ) throws IOException {
Buggy code:
public class ResolvedSourceType extends SourceType { private String uniqueKey ; public ResolvedSourceType ( JavaElement parent , String name , String uniqueKey ) { } public String getFullyQualifiedParameterizedName ( ) throws JavaModelException { <START_BUG> return getFullyQualifiedParameterizedName ( getFullyQualifiedName ( ) , this . uniqueKey ) ; <END_BUG> } public String getKey ( ) { } public boolean isResolved ( ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { } public JavaElement unresolved ( ) { } }

Fix:
return getFullyQualifiedParameterizedName ( getFullyQualifiedName ( '.' ) , this . uniqueKey ) ;
Buggy code:
public class ReportFaultsActivity extends BaseActivity { private static final String TAG = "ReportFaultsActivity" ; private Report report ; private ListView mListView ; private SimpleAdapter mAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private List < Map < String , String > > getDataList ( ) { ArrayList < Map < String , String > > dataList = new ArrayList < Map < String , String > > ( ) ; HashMap < String , String > map ; SimpleDateFormat format1 = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm" ) ; map = new HashMap < String , String > ( ) ; map . put ( "loop" , "Loop" ) ; map . put ( "device" , "Device//Group" ) ; map . put ( "serial" , "Serial<seq2seq4repair_space>number" ) ; map . put ( "location" , "Location" ) ; map . put ( "description" , "Fault<seq2seq4repair_space>description" ) ; dataList . add ( map ) ; if ( ( report ) != null ) { for ( int i = 0 ; i < ( report . getFaultyDeviceList ( ) . size ( ) ) ; i ++ ) { map = new HashMap < String , String > ( ) ; <START_BUG> ArrayList < Integer > list = ( ( ArrayList < Integer > ) ( report . getFaultyDeviceList ( ) . get ( i ) ) ) ; <END_BUG> int address = list . get ( 0 ) ; int fs = list . get ( 1 ) ; long serialNumber = ( ( ( list . get ( 2 ) ) + ( 256 * ( list . get ( 3 ) ) ) ) + ( 65536 * ( list . get ( 4 ) ) ) ) + ( 16777216L * ( list . get ( 5 ) ) ) ; map . put ( "loop" , ( ( address & 128 ) == 0 ? "01" : "02" ) ) ; map . put ( "device" , Integer . toString ( ( address & 63 ) ) ) ; map . put ( "serial" , Long . toString ( serialNumber ) ) ; map . put ( "location" , "-" ) ; map . put ( "description" , Device . getFailureStatusText ( fs ) ) ; dataList . add ( map ) ; } } return dataList ; } public String getFailureStatusText ( int failureStatus ) { } }

Fix:
List < Integer > list = report . getFaultyDeviceList ( ) . get ( i ) ;
Buggy code:
abstract class AbstractAPI { private static final String PARAMS = "params" ; protected abstract String getPrefix ( ) { } protected JSONObject createRequest ( String methodName ) throws JSONException { final JSONObject request = new JSONObject ( ) ; request . put ( "jsonrpc" , "2.0" ) ; <START_BUG> request . put ( "id" , System . currentTimeMillis ( ) ) ; <END_BUG> request . put ( "method" , ( ( getPrefix ( ) ) + methodName ) ) ; return request ; } protected JSONObject getParameters ( JSONObject request ) throws JSONException { } protected static JSONArray toJSONArray ( String [ ] items ) { } }

Fix:
request . put ( "id" , String . valueOf ( System . currentTimeMillis ( ) ) ) ;
Buggy code:
public class ManpageMacro extends InlineMacroProcessor { public ManpageMacro ( String macroName , Map < String , Object > config ) { } @ Override protected String process ( AbstractBlock parent , String target , Map < String , Object > attributes ) { Map < String , Object > options = new HashMap < String , Object > ( ) ; options . put ( "type" , ":link" ) ; options . put ( "target" , ( target + ".html" ) ) ; <START_BUG> return createInline ( parent , "anchor" , target , attributes , options ) . render ( ) ; <END_BUG> } }

Fix:
return createInline ( parent , "anchor" , target , attributes , options ) . convert ( ) ;
Buggy code:
public class ModClusterStopContext implements OperationStepHandler , DescriptionProvider { private static final Logger log = Logger . getLogger ( "org.jboss.as.modcluster" ) ; static final ModClusterStopContext INSTANCE = new ModClusterStopContext ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; ModClusterStopContext . log . debug ( ( "stop-context:<seq2seq4repair_space>" + operation ) ) ; ContextHost contexthost = new ContextHost ( operation ) ; <START_BUG> modcluster . stopContext ( contexthost . webhost , contexthost . webcontext ) ; <END_BUG> context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
modcluster . stopContext ( contexthost . webhost , contexthost . webcontext , contexthost . waittime ) ;
Buggy code:
public class ReceivedTextDialog extends DialogFragment implements View . OnClickListener { private TextView lblClipboard ; private TextView lblDelete ; private int index ; private String text ; private int width ; private int height ; public ReceivedTextDialog ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onClick ( View v ) { if ( v == ( this . lblClipboard ) ) <START_BUG> Clipboard . getInstance ( this . getContext ( ) ) . setClipboardTextAndClean ( this . text ) ; <END_BUG> else if ( v == ( this . lblDelete ) ) CommunicationsManager . getInstance ( ) . deleteText ( this . index ) ; this . dismiss ( ) ; } @ Override public void onResume ( ) { } }

Fix:
Clipboard . getInstance ( this . getActivity ( ) ) . setClipboardTextAndClean ( this . text ) ;
Buggy code:
public class ProfileMetaModel implements MetaModel { public Profile profile ; private TypeSystem typeSystem ; private class InternaleProfileMetaModel extends UML2MetaModelBase { private final Cache < String , Type > typeForNameCache = new Cache < String , Type > ( ) { @ Override protected Type createNew ( final String typeName ) { } } ; @ Override public Type getTypeForName ( final String typeName ) { } private NamedElement getNamedElementRec ( final NamedElement [ ] elements , final String name ) { } } private ProfileMetaModel . InternaleProfileMetaModel internalProfileMetaModel ; private boolean errorIfStereotypeMissing = true ; private final Set < String > namespaces = new TreeSet < String > ( ) ; public void setErrorIfStereotypeMissing ( final boolean errorIfStereotypeMissing ) { } public ProfileMetaModel ( ) { } public ProfileMetaModel ( final Profile profile ) { } public void setProfile ( final String profile ) { } private Map < String , Type > stereoTypes = null ; private void init ( ) { } private List < org . eclipse . uml2 . uml . Type > getAllOwnedTypes ( final Package pck ) { } private static String normalizedName ( String name ) { String [ ] fragments = name . split ( NS_DELIM ) ; StringBuffer result = new StringBuffer ( name . length ( ) ) ; result . append ( fragments [ 0 ] . replaceAll ( "\\W" , "_" ) ) ; for ( int i = 1 ; i < ( fragments . length ) ; i ++ ) { result . append ( NS_DELIM ) ; <START_BUG> result . append ( fragments [ 1 ] . replaceAll ( "\\W" , "_" ) ) ; <END_BUG> } return result . toString ( ) ; } public String getFullName ( final org . eclipse . uml2 . uml . Type type ) { } public Type getTypeForName ( final String typeName ) { } public Type getType ( final Object obj ) { } public Set < Type > getKnownTypes ( ) { } public TypeSystem getTypeSystem ( ) { } public void setTypeSystem ( final TypeSystem typeSystem ) { } public String getName ( ) { } public Set < String > getNamespaces ( ) { } }

Fix:
result . append ( fragments [ i ] . replaceAll ( "\\W" , "_" ) ) ;
Buggy code:
public class SlickApp extends BasicGame { private Image background ; private Timers timers ; private Rectangle timerBar ; private TrueTypeFont font ; private static Controller controller ; private GameObserver observer ; public SlickApp ( String gamename ) { } public void init ( GameContainer gc ) throws SlickException { } public void update ( GameContainer gc , int delta ) throws SlickException { } public void render ( GameContainer gc , Graphics graphics ) throws SlickException { } private void drawCountDown ( GameContainer gc , Graphics graphics ) { } private void drawPlayers ( Graphics graphics ) throws SlickException { } private void drawBubbles ( Graphics graphics ) { } private void drawTimer ( Graphics graphics ) { } private void drawLives ( Graphics graphics ) throws SlickException { SpriteSheet livesImage = new SpriteSheet ( "Sprites//lives_spritesheet.jpg" , 381 , 171 ) ; int lives = Model . getPlayers ( ) . get ( 0 ) . getLives ( ) ; if ( lives >= 0 ) { <START_BUG> graphics . drawImage ( livesImage . getSprite ( 0 , 0 ) . getScaledCopy ( 109 , 49 ) , 225 , 851 ) ; <END_BUG> } } private void drawScore ( Graphics graphics ) throws SlickException { } public static void main ( String [ ] args ) { } public static Controller getController ( ) { } No newline ; at end ; of file ; }

Fix:
livesImage . getSprite ( lives , 0 ) . draw ( 225 , 851 , ( ( float ) ( 0.286 ) ) ) ;
Buggy code:
public class AlgoJuryAssignationImpl implements AlgoJuryAssignation { private Collection < OralDefense > oralDefenses ; private Collection < Unavailability > unavailabilities ; private Map < Person , List < OralDefense > > followings ; private Map < Person , List < OralDefense > > assignations ; private Collection < AlgoJuryAssignationImpl . AssignationCandidate > candidates ; private boolean hasNewAssignation = false ; private class AssignationCandidate { private OralDefense oralDefense ; private List < Person > possibleJurys ; public AssignationCandidate ( OralDefense oralDefense ) { } public OralDefense getOralDefense ( ) { } public List < Person > getPossibleJurys ( ) { } } public void configure ( Collection < OralDefense > oralDefenses , Collection < Unavailability > unavailabilities ) { } public Collection < OralDefense > execute ( ) { } private void tryAllocation ( final AlgoJuryAssignationImpl . AssignationCandidate candidate , final boolean withUnavailabilities ) { } private void forceAllocation ( ) { } private Person getPossibleJuryWith ( AlgoJuryAssignationImpl . AssignationCandidate selected ) { Person followingTeacher = selected . getOralDefense ( ) . getComposition ( ) . getFollowingTeacher ( ) ; Comparator < Person > byNbAssignations = new Comparator < Person > ( ) { public int compare ( Person p1 , Person p2 ) { Integer nb1 = assignations . get ( p1 ) . size ( ) ; Integer nb2 = assignations . get ( p2 ) . size ( ) ; return nb1 . compareTo ( nb2 ) ; } } ; Collection < Person > possibilities = Ordering . from ( byNbAssignations ) . sortedCopy ( assignations . keySet ( ) ) ; for ( Person p : possibilities ) { int nbAssignations = assignations . get ( p ) . size ( ) ; int nbFollowed = followings . get ( p ) . size ( ) ; <START_BUG> if ( ( nbAssignations < ( nbFollowed * 2 ) ) && ( ! ( p . equals ( followingTeacher ) ) ) ) { <END_BUG> return p ; } } return null ; } private void assignJury ( AlgoJuryAssignationImpl . AssignationCandidate candidate , Person jury ) { } }

Fix:
if ( ( nbAssignations < nbFollowed ) && ( ! ( p . equals ( followingTeacher ) ) ) ) {
Buggy code:
public class ShortPrefixToStringStyleTest extends TestCase { private final Integer base = new Integer ( 5 ) ; private final String baseStr = "Integer" ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testBlank ( ) { } public void testAppendSuper ( ) { } public void testObject ( ) { } public void testPerson ( ) { Person p = new Person ( ) ; p . name = "John<seq2seq4repair_space>Q.<seq2seq4repair_space>Public" ; p . age = 45 ; p . smoker = true ; <START_BUG> String pBaseStr = p . getClass ( ) . getName ( ) ; <END_BUG> assertEquals ( ( pBaseStr + "[name=John<seq2seq4repair_space>Q.<seq2seq4repair_space>Public,age=45,smoker=true]" ) , new ToStringBuilder ( p ) . append ( "name" , p . name ) . append ( "age" , p . age ) . append ( "smoker" , p . smoker ) . toString ( ) ) ; } public void testLong ( ) { } public void testObjectArray ( ) { } public void testLongArray ( ) { } public void testLongArrayArray ( ) { } }

Fix:
String pBaseStr = "ToStringStyleTest.Person" ;
Buggy code:
public class SimpleType extends Type { public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( SimpleType . class , "name" , Name . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Name typeName = null ; SimpleType ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Name getName ( ) { if ( ( this . typeName ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . typeName ) == null ) { preLazyInit ( ) ; this . typeName = new SimpleName ( this . ast ) ; postLazyInit ( this . typeName , SimpleType . NAME_PROPERTY ) ; } } } return this . typeName ; } public void setName ( Name typeName ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class DropBoxFileList { static final String uri = "http:////mylibrary.kbb1.com//api//morning_lessons.json?lang=%2$s" ; static List < FileInfo > fileList = null ; private static MediaDownloaderService caller ; public static void startDownLoadFileList ( int offset , MediaDownloaderService mediaDownloaderService ) { } public static synchronized void pushFileList ( String fileListJson , String dateFilter ) { } private static void startDownloadFileList ( int offset ) { } private static void startGetUrlTextContent ( final URL url , final File localFileList , final String dateFilter ) { } private static byte [ ] readToString ( InputStream is ) throws IOException { } private static List < FileInfo > parseFileListJson ( String flieListJson , String dateFilter ) throws JSONException { } public static void deleteFileListsOlderThanNDays ( int nRemoveFiles ) { final Calendar date = Calendar . getInstance ( ) ; <START_BUG> final Pattern datepattern = Pattern . compile ( ( ( date . get ( Calendar . YEAR ) ) + "\\d{4}.txt" ) ) ; <END_BUG> date . add ( Calendar . DAY_OF_YEAR , ( - nRemoveFiles ) ) ; final File dir = new File ( FileSystemUtilities . getLocalPath ( ) ) ; if ( dir != null ) { dir . mkdirs ( ) ; final File [ ] toDelete = dir . listFiles ( new FilenameFilter ( ) { public boolean accept ( File dir , String filename ) { if ( datepattern . matcher ( filename ) . matches ( ) ) { try { String year = filename . substring ( 0 , 4 ) ; String month = filename . substring ( 4 , 6 ) ; String day = filename . substring ( 6 , 8 ) ; int iYear = Integer . parseInt ( year ) ; int iMonth = ( Integer . parseInt ( month ) ) - 1 ; int iDay = Integer . parseInt ( day ) ; Calendar cal = new GregorianCalendar ( ) ; cal . setTime ( new Date ( ( iYear - 1900 ) , iMonth , iDay ) ) ; return date . before ( cal ) ; } catch ( Exception e ) { return false ; } } else return false ; } } ) ; if ( toDelete != null ) for ( final File f : toDelete ) { if ( f . exists ( ) ) f . delete ( ) ; } } } }

Fix:
final Pattern datepattern = Pattern . compile ( "\\d{4}\\-\\d{2}\\-\\d{2}.{3}.txt" ) ;
Buggy code:
public class JMeterTest extends JMeterTestCase { private static Logger log = LoggingManager . getLoggerForClass ( ) ; private static Set guiTitles ; public JMeterTest ( String name ) { } private TestElement testItem ; public JMeterTest ( String testName , TestElement te ) { } private Serializable serObj ; public JMeterTest ( String testName , Serializable ser ) { } private JMeterGUIComponent guiItem ; public JMeterTest ( String testName , JMeterGUIComponent gc ) { } public static Test suite ( ) throws Exception { } public void createTitleSet ( ) throws Exception { } private static Test suiteGUIComponents ( ) throws Exception { } private static Test suiteBeanComponents ( ) throws Exception { } public void runGUITitle ( ) throws Exception { if ( ( JMeterTest . guiTitles . size ( ) ) > 0 ) { String title = guiItem . getStaticLabel ( ) ; boolean ct = JMeterTest . guiTitles . contains ( title ) ; if ( ( ( title . indexOf ( "(ALPHA" ) ) == ( - 1 ) ) && ( ( title . indexOf ( "(BETA" ) ) == ( - 1 ) ) ) { <START_BUG> assertTrue ( ( "Component<seq2seq4repair_space>ref<seq2seq4repair_space>should<seq2seq4repair_space>contain<seq2seq4repair_space>entry<seq2seq4repair_space>for<seq2seq4repair_space>" + title ) , ct ) ; <END_BUG> } } } public void GUIComponents1 ( ) throws Exception { } public void GUIComponents2 ( ) throws Exception { } private static Test suiteSerializableElements ( ) throws Exception { } public void runSerialTest ( ) throws Exception { } private static Test suiteTestElements ( ) throws Exception { } public void runTestElement ( ) throws Exception { } private static Collection getObjects ( Class extendsClass ) throws Exception { } private static void cloneTesting ( TestElement item , TestElement clonedItem ) { } private static void checkElementCloning ( TestElement item ) { } }

Fix:
assertTrue ( ( ( ( "component_reference.xml<seq2seq4repair_space>needs<seq2seq4repair_space>'" + title ) + "'<seq2seq4repair_space>anchor<seq2seq4repair_space>for<seq2seq4repair_space>" ) + ( guiItem . getClass ( ) . getName ( ) ) ) , ct ) ;
Buggy code:
public class PageRequestTarget implements IPageRequestTarget { private final Page page ; public PageRequestTarget ( Page page ) { } public void respond ( RequestCycle requestCycle ) { <START_BUG> if ( requestCycle . getRedirect ( ) ) { <END_BUG> requestCycle . redirectTo ( page ) ; } else { page . renderPage ( ) ; } } public final Page getPage ( ) { } public void detach ( RequestCycle requestCycle ) { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
if ( requestCycle . isRedirect ( ) ) {
Buggy code:
public class Articles extends ListFragment { public static final String PREFS_NAME = "UserPrefs" ; private ProgressDialog pDialog ; private LoadResource loadResource ; JSONParser jsonParser = new JSONParser ( ) ; ArrayList < Resource > resourceArrayList = new ArrayList < Resource > ( ) ; private RecyclerView mRecyclerView ; private Adapter mAdapter ; private LayoutManager mLayoutManager ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View rootView = inflater . inflate ( fragment_article , container , false ) ; restorePreferences ( ) ; String [ ] sub = new String [ ] { "Visual<seq2seq4repair_space>Art" , "Science" } ; resourceArrayList = new ArrayList < Resource > ( ) ; <START_BUG> mRecyclerView = ( ( RecyclerView ) ( rootView . findViewById ( my_recycler_view ) ) ) ; <END_BUG> mRecyclerView . setHasFixedSize ( true ) ; mLayoutManager = new android . support . v7 . widget . LinearLayoutManager ( getActivity ( ) ) ; mRecyclerView . setLayoutManager ( mLayoutManager ) ; loadResource = new LoadResource ( getActivity ( ) , mRecyclerView , sub , "LowerElem" , 0 ) ; loadResource . execute ( ) ; return rootView ; } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onListItemClick ( ListView l , View v , int position , long id ) { } private void restorePreferences ( ) { } private void checkResponseForRequest ( JSONObject resourceObj ) { } }

Fix:
mRecyclerView = ( ( RecyclerView ) ( rootView . findViewById ( recycler_res ) ) ) ;
Buggy code:
public class JeremiePRODelegate implements PortableRemoteObjectDelegate { private static String className = "org.objectweb.jeremie.libs.binding.moa.UnicastRemoteObject" ; private static Class unicastClass = null ; public JeremiePRODelegate ( ) throws Exception { } public void exportObject ( Remote obj ) throws RemoteException { } public void unexportObject ( Remote obj ) throws NoSuchObjectException { } public void connect ( Remote target , Remote source ) throws RemoteException { } public Object narrow ( Object obj , Class newClass ) throws ClassCastException { } public Remote toStub ( Remote obj ) throws NoSuchObjectException { try { <START_BUG> Method exportO = JeremiePRODelegate . unicastClass . getMethod ( "exportObject" , new Class [ ] { Remote . class } ) ; <END_BUG> return ( ( Remote ) ( exportO . invoke ( JeremiePRODelegate . unicastClass , new Object [ ] { obj } ) ) ) ; } catch ( Exception e ) { throw new NoSuchObjectException ( e . toString ( ) ) ; } } }

Fix:
Method exportO = JeremiePRODelegate . unicastClass . getMethod ( "toStub" , new Class [ ] { Remote . class } ) ;
Buggy code:
public class GafToLegoIndividualTranslator { private static Logger logger = Logger . getLogger ( GafToLegoIndividualTranslator . class ) ; private final OWLGraphWrapper graph ; private final OWLObjectProperty partOf ; private final OWLObjectProperty occursIn ; private final OWLObjectProperty inTaxon ; private OWLClass mf ; private OWLObjectProperty enabledBy ; private Map < String , OWLObject > allOWLObjectsByAltId ; private final boolean addLineNumber ; public GafToLegoIndividualTranslator ( OWLGraphWrapper graph , boolean addLineNumber ) { } protected void reportError ( String error , GeneAnnotation annotation ) { } protected void reportWarn ( String warning , GeneAnnotation annotation ) { } public OWLOntology translate ( GafDocument gaf ) throws OWLException { } public void translate ( Collection < GeneAnnotation > annotations , final OWLOntology lego ) throws OWLException { } public void translate ( GeneAnnotation annotation , Set < OWLAxiom > axioms ) throws OWLException { } private void translate ( GeneAnnotation annotation , OWLClassExpression ce , Set < OWLAxiom > axioms ) throws OWLException { } private void handleNegated ( OWLClass bioentityClass , String aspect , Set < OWLAnnotation > annotations , OWLClassExpression ce , Set < OWLAxiom > axioms , OWLDataFactory f ) { } private OWLClass addBioentityCls ( String id , String lbl , String taxon , Set < OWLAxiom > axioms , OWLDataFactory f ) { } private OWLClass getOwlClass ( String id ) { } private static final IRI GAF_LINE_NUMBER = IRI . create ( "http:////gaf//line_number" ) ; private OWLAnnotationProperty getLineNumberProperty ( Set < OWLAxiom > axioms , OWLDataFactory f ) { } private IRI generateNewIRI ( String type , OWLClassExpression ce ) { if ( ( ce . isAnonymous ( ) ) == false ) { OWLClass c = ce . asOWLClass ( ) ; <START_BUG> String id = StringUtils . replaceOnce ( IdStringManager . getId ( c . getIRI ( ) ) , ":" , "_" ) ; <END_BUG> type = ( type + "-" ) + id ; } return IRI . create ( ( ( ( "http:////geneontology.org//lego//" + type ) + "-" ) + ( UUID . randomUUID ( ) . toString ( ) ) ) ) ; } }

Fix:
String id = StringUtils . replaceOnce ( IdStringManager . getId ( c ) , ":" , "_" ) ;
Buggy code:
public class SimpleLocaleContext implements LocaleContext { private final Locale locale ; public SimpleLocaleContext ( Locale locale ) { } @ Override public Locale getLocale ( ) { } @ Override public String toString ( ) { <START_BUG> return this . locale . toString ( ) ; <END_BUG> } }

Fix:
return ( this . locale ) != null ? this . locale . toString ( ) : "-" ;
Buggy code:
@ WebServlet ( "//createGroup" ) public class createGroup extends HttpServlet { private static final long serialVersionUID = 1L ; public createGroup ( ) { } public createGroup ( String name , String id ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String groupName = request . getParameter ( "groupName" ) ; String groupId = request . getParameter ( "groupId" ) ; String uName = request . getParameter ( "uName" ) ; group g = new group ( groupId , groupName ) ; g . addMember ( uName ) ; HttpSession session = request . getSession ( ) ; <START_BUG> session . setMaxInactiveInterval ( ( 60 * 60 ) ) ; <END_BUG> session . setAttribute ( "uName" , uName ) ; session . setAttribute ( "groupId" , groupId ) ; GroupList glist = ( ( GroupList ) ( getServletContext ( ) . getAttribute ( "glist" ) ) ) ; glist . addGroup ( g ) ; response . sendRedirect ( "chat.jsp" ) ; } }

Fix:
session . setMaxInactiveInterval ( ( ( 60 * 60 ) * 2 ) ) ;
Buggy code:
public class JavaScriptCallerService { private Applet applet ; public JavaScriptCallerService ( Applet appletWindow ) { } public void RegisterPatient ( String fingerprintData ) { } public void callRegisterPatientJavaScriptFunction ( String fingerprintData ) { } public String alertMessage ( ) { } public PatientFingerPrintModel identifyPatient ( String fingerprint ) throws JSONException { String JSONPatient = callIdentifyPatientJavascriptFunction ( fingerprint ) ; <START_BUG> if ( JSONPatient . equals ( "[no<seq2seq4repair_space>data<seq2seq4repair_space>found]" ) ) { <END_BUG> return null ; } PatientFingerPrintModel patient = PatientFingerPrintModelBuilder ( JSONPatient ) ; return patient ; } private String callIdentifyPatientJavascriptFunction ( String fingerprintData ) { } private PatientFingerPrintModel PatientFingerPrintModelBuilder ( String jsonPatients ) throws JSONException { } }

Fix:
if ( ( JSONPatient . equals ( "[no<seq2seq4repair_space>data<seq2seq4repair_space>found]" ) ) || ( JSONPatient . equals ( "[]" ) ) ) {
Buggy code:
public class QuizGameClient { public static void main ( String [ ] args ) { } public void launch ( ) { } private void playQuiz ( String user , QuizGameService service ) throws RemoteException { String chosenQuiz = selectQuiz ( service ) ; QuizObject theQuiz = service . getQuizByID ( chosenQuiz ) ; int score = 0 ; <START_BUG> for ( int i = 0 ; i < ( theQuiz . getQuestions ( ) . size ( ) ) ; i ++ ) { <END_BUG> System . out . println ( theQuiz . getQuestions ( ) . get ( i ) . getQuestion ( ) ) ; System . out . println ( "Select<seq2seq4repair_space>(by<seq2seq4repair_space>typing<seq2seq4repair_space>the<seq2seq4repair_space>number)<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>Following;" ) ; theQuiz . getQuestions ( ) . get ( i ) . printAnswers ( ) ; int selection = ValidInputFunctions . getValidAnswerSelection ( ) ; if ( selection == ( theQuiz . getQuestions ( ) . get ( i ) . getCorrectAnswerKey ( ) ) ) { System . out . println ( "Correct<seq2seq4repair_space>Answer.<seq2seq4repair_space>Well<seq2seq4repair_space>done!" ) ; score ++ ; } else { System . out . println ( "Incorrect<seq2seq4repair_space>Answer.<seq2seq4repair_space>Unlucky!" ) ; } } System . out . println ( ( ( ( "Well<seq2seq4repair_space>done,<seq2seq4repair_space>you<seq2seq4repair_space>scored:<seq2seq4repair_space>" + score ) + "//" ) + ( theQuiz . getQuestions ( ) . size ( ) ) ) ) ; service . getQuizByID ( chosenQuiz ) . addPlayerScore ( service . getPlayerByUser ( user ) , score ) ; } private String selectQuiz ( QuizGameService service ) throws RemoteException { } private String createUserID ( ) { } private String createName ( ) { } private void printQuizIDs ( List < String > quizIDs ) { } }

Fix:
for ( int i = 1 ; i < ( theQuiz . getQuestions ( ) . size ( ) ) ; i ++ ) {
Buggy code:
public class Filter extends DefaultItem { public Filter ( XmlElement root ) { } public FilterActionList getFilterActionList ( ) { } public FilterRule getFilterRule ( ) { } public boolean getEnabled ( ) { } public void setEnabled ( boolean bool ) { } public void setName ( String s ) { } public String getName ( ) { } public CompoundCommand getCommand ( Folder srcFolder , Object [ ] uids ) throws Exception { CompoundCommand c = new CompoundCommand ( ) ; <START_BUG> FilterActionPluginHandler pluginHandler = ( ( FilterActionPluginHandler ) ( pluginManager . getHandler ( "filter_actions" ) ) ) ; <END_BUG> FilterActionList list = getFilterActionList ( ) ; for ( int i = 0 ; i < ( list . getChildCount ( ) ) ; i ++ ) { FilterAction action = list . get ( i ) ; String name = action . getAction ( ) ; AbstractFilterAction instance = null ; try { instance = ( ( AbstractFilterAction ) ( ( ( org . columba . mail . plugin . AbstractFilterPluginHandler ) ( pluginHandler ) ) . getActionPlugin ( name , null ) ) ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } Command command = instance . getCommand ( action , srcFolder , uids ) ; if ( command != null ) c . add ( command ) ; } return c ; } }

Fix:
FilterActionPluginHandler pluginHandler = ( ( FilterActionPluginHandler ) ( pluginManager . getHandler ( "org.columba.mail.filteraction" ) ) ) ;
Buggy code:
public class OneCompactionTest { private void testCompaction ( String columnFamilyName , int insertsPerTable ) throws IOException , InterruptedException , ExecutionException { Table table = Table . open ( "Keyspace1" ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( columnFamilyName ) ; Set < String > inserted = new HashSet < String > ( ) ; for ( int j = 0 ; j < insertsPerTable ; j ++ ) { String key = String . valueOf ( j ) ; RowMutation rm = new RowMutation ( "Keyspace1" , key ) ; rm . add ( new QueryPath ( columnFamilyName , null , "0" . getBytes ( ) ) , new byte [ 0 ] , j ) ; rm . apply ( ) ; inserted . add ( key ) ; store . forceBlockingFlush ( ) ; Assert . assertEquals ( inserted . size ( ) , table . getColumnFamilyStore ( columnFamilyName ) . getKeyRange ( "" , "" , 10000 ) . keys . size ( ) ) ; } <START_BUG> Future < Integer > ft = MinorCompactionManager . instance ( ) . submit ( store , 2 , 32 ) ; <END_BUG> ft . get ( ) ; Assert . assertEquals ( 1 , store . getSSTables ( ) . size ( ) ) ; Assert . assertEquals ( table . getColumnFamilyStore ( columnFamilyName ) . getKeyRange ( "" , "" , 10000 ) . keys . size ( ) , inserted . size ( ) ) ; } @ Test public void testCompaction1 ( ) throws IOException , InterruptedException , ExecutionException { } @ Test public void testCompaction2 ( ) throws IOException , InterruptedException , ExecutionException { } }

Fix:
Future < Integer > ft = CompactionManager . instance ( ) . submit ( store , 2 , 32 ) ;