nus-yam/ex-repair huggingface dataset:
Buggy code:
public class GameInfoDialog extends GobandroidDialog { @ InjectView ( id . game_name_et ) EditText nameEdit ; @ InjectView ( id . black_name_et ) EditText blackNameEdit ; @ InjectView ( id . user_is_white_btn ) Button user_is_white_btn ; @ InjectView ( id . user_is_black_btn ) Button user_is_black_btn ; @ InjectView ( id . white_name_et ) EditText white_name_et ; @ InjectView ( id . white_rank_et ) EditText white_rank_et ; @ InjectView ( id . komi_et ) EditText game_komi_et ; @ InjectView ( id . game_result_et ) EditText game_result_et ; @ InjectView ( id . game_difficulty_et ) EditText game_difficulty_et ; @ InjectView ( id . black_rank_et ) EditText black_rank_et ; @ InjectView ( id . game_date_et ) EditText game_date_et ; @ OnClick ( id . user_is_black_btn ) void onBlack ( ) { if ( checkUserNamePresent ( ) ) { blackNameEdit . setText ( App . getGobandroidSettings ( ) . getUsername ( ) ) ; <START_BUG> white_rank_et . setText ( App . getGobandroidSettings ( ) . getRank ( ) ) ; <END_BUG> } EditText et ; } @ OnTextChanged ( { id . black_name_et , id . white_name_et } ) void onWhiteTextChanged ( ) { } private boolean checkUserNamePresent ( ) { } @ OnClick ( id . user_is_white_btn ) void onWhite ( ) { } public GameInfoDialog ( final Context context , final GoGame game ) { } private void updateItsMeButtonVisibility ( ) { } No newline ; at end ; of file ; }

Fix:
black_rank_et . setText ( App . getGobandroidSettings ( ) . getRank ( ) ) ;
Buggy code:
public class MetaInfStaticResourceReference extends PackageResourceReference { private static final long serialVersionUID = - 1858339228780709471L ; private static Boolean META_INF_RESOURCES_SUPPORTED = null ; public MetaInfStaticResourceReference ( Class < ? > scope , String name ) { } public Url mapHandler ( IRequestHandler requestHandler ) { } protected boolean isMetaInfResourcesSupported ( ) { if ( ( MetaInfStaticResourceReference . META_INF_RESOURCES_SUPPORTED ) == null ) { int majorVersion = WebApplication . get ( ) . getServletContext ( ) . getMajorVersion ( ) ; MetaInfStaticResourceReference . META_INF_RESOURCES_SUPPORTED = majorVersion >= 3 ; } <START_BUG> return MetaInfStaticResourceReference . META_INF_RESOURCES_SUPPORTED . booleanValue ( ) ; <END_BUG> } }

Fix:
return MetaInfStaticResourceReference . META_INF_RESOURCES_SUPPORTED ;
Buggy code:
public class ConnectionPropertyAdd extends AbstractAddStepHandler implements DescriptionProvider { public static final ConnectionPropertyAdd INSTANCE = new ConnectionPropertyAdd ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode modelNode ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode recoveryEnvModel , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > serviceControllers ) throws OperationFailedException { final String configPropertyValue = Constants . CONNECTION_PROPERTY_VALUE . resolveModelAttribute ( context , recoveryEnvModel ) . asString ( ) ; final ModelNode address = operation . require ( OP_ADDR ) ; PathAddress path = PathAddress . pathAddress ( address ) ; final String jndiName = path . getElement ( ( ( path . size ( ) ) - 2 ) ) . getValue ( ) ; final String configPropertyName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; <START_BUG> ServiceName serviceName = SERVICE_NAME_BASE . append ( jndiName ) . append ( "connetion-properties" ) . append ( configPropertyName ) ; <END_BUG> ServiceName dsServiceName = SERVICE_NAME_BASE . append ( jndiName ) ; final ServiceRegistry registry = context . getServiceRegistry ( true ) ; final ServiceName dataSourceConfigServiceName = SERVICE_NAME_BASE . append ( jndiName ) ; final ServiceController < ? > dataSourceConfigController = registry . getService ( dataSourceConfigServiceName ) ; if ( ( dataSourceConfigController == null ) || ( ! ( ( ( org . jboss . jca . common . api . metadata . ds . DataSource ) ( dataSourceConfigController . getValue ( ) ) ) . isEnabled ( ) ) ) ) { final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; final ConnectionPropertiesService service = new ConnectionPropertiesService ( configPropertyName , configPropertyValue ) ; serviceTarget . addService ( serviceName , service ) . setInitialMode ( NEVER ) . addListener ( verificationHandler ) . install ( ) ; context . addStep ( verificationHandler , VERIFY ) ; } else { context . reloadRequired ( ) ; } } }

Fix:
ServiceName serviceName = SERVICE_NAME_BASE . append ( jndiName ) . append ( "connection-properties" ) . append ( configPropertyName ) ;
Buggy code:
public class TimeSelectActivity extends Activity implements OnClickListener , OnWheelChangedListener { private TextView mCancelTv ; private TextView mConfirmTv ; private WheelView mViewHours ; private WheelView mViewMinutes ; private ArrayWheelAdapter < String > hoursAdapter ; private ArrayWheelAdapter < String > minutesAdapter ; private String [ ] mHours = new String [ 24 ] ; private String [ ] mInutes = new String [ 6 ] ; int currentMonth = 1 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void setUpViews ( ) { } private void setUpListener ( ) { } private void setUpData ( ) { } private void setData ( ) { } private int getNowMinutes ( ) { } private int getNowHours ( ) { } private String getToday ( ) { <START_BUG> String str = TimeUtils . TimeStamp2Date ( String . valueOf ( ( ( System . currentTimeMillis ( ) ) + ( ( 20 * 60 ) * 1000 ) ) ) , FORMAT_PATTERN_DATE ) ; <END_BUG> return str ; } public String getSelectedTime ( ) { } public String getSelectedTimeValue ( ) { } @ Override public void onChanged ( WheelView wheel , int oldValue , int newValue ) { } @ Override public void onClick ( View v ) { } }

Fix:
String str = TimeUtils . TimeStamp2Date ( String . valueOf ( System . currentTimeMillis ( ) ) , FORMAT_PATTERN_DATE ) ;
Buggy code:
public abstract class Link extends AbstractLink implements ILinkListener { private final class AnchorChange extends Change { private static final long serialVersionUID = 1L ; private Component anchor ; public AnchorChange ( Component anchor ) { } public final void undo ( ) { } } private static final long serialVersionUID = 1L ; private Component anchor ; private boolean autoEnable = false ; private PopupSettings popupSettings = null ; public Link ( final String id ) { } public Link ( final String id , IModel object ) { } public Component getAnchor ( ) { } public final boolean getAutoEnable ( ) { } public PopupSettings getPopupSettings ( ) { } public boolean isEnabled ( ) { } protected boolean getStatelessHint ( ) { } public abstract void onClick ( ) { } public final void onLinkClicked ( ) { } public Link setAnchor ( Component anchor ) { } public final Link setAutoEnable ( final boolean autoEnable ) { } public final Link setPopupSettings ( final PopupSettings popupSettings ) { } protected CharSequence appendAnchor ( final ComponentTag tag , CharSequence url ) { } protected CharSequence getOnClickScript ( final CharSequence url ) { } protected String getOnClickScript ( final String url ) { } protected CharSequence getURL ( ) { } protected boolean linksTo ( final Page page ) { } protected void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; CharSequence url = getURL ( ) ; url = appendAnchor ( tag , url ) ; if ( ! ( isEnabled ( ) ) ) { disableLink ( tag ) ; } else { if ( ( ( tag . getName ( ) . equalsIgnoreCase ( "a" ) ) || ( tag . getName ( ) . equalsIgnoreCase ( "link" ) ) ) || ( tag . getName ( ) . equalsIgnoreCase ( "area" ) ) ) { tag . put ( "href" , Strings . replaceAll ( url , "&" , "&amp;" ) ) ; if ( ( popupSettings ) != null ) { tag . put ( "onclick" , popupSettings . getPopupJavaScript ( ) ) ; } } else if ( ( tag . getName ( ) . equalsIgnoreCase ( "script" ) ) || ( tag . getName ( ) . equalsIgnoreCase ( "style" ) ) ) { tag . put ( "src" , Strings . replaceAll ( url , "&" , "&amp;" ) ) ; } else { if ( ( popupSettings ) != null ) { popupSettings . setTarget ( ( ( "'" + url ) + "'" ) ) ; String popupScript = popupSettings . getPopupJavaScript ( ) ; tag . put ( "onclick" , popupScript ) ; } else { tag . put ( "onclick" , ( ( "window.location.href='" + url ) + "';return<seq2seq4repair_space>false;" ) ) ; } } final CharSequence onClickJavaScript = getOnClickScript ( url ) ; if ( onClickJavaScript != null ) { tag . put ( "onclick" , onClickJavaScript ) ; } if ( ( popupSettings ) != null ) { IPageMap popupPageMap = popupSettings . getPageMap ( this ) ; <START_BUG> if ( popupPageMap != null ) { <END_BUG> tag . put ( "target" , popupPageMap . getName ( ) ) ; } } } } }

Fix:
if ( ( popupPageMap != null ) && ( ( popupPageMap . getName ( ) ) != null ) ) {
Buggy code:
public class ServiceMBeanSupport extends NotificationBroadcasterSupport implements MBeanRegistration , ServiceMBean { protected Logger log ; protected MBeanServer server ; protected ObjectName serviceName ; private int state = UNREGISTERED ; private final AtomicLong sequenceNumber = new AtomicLong ( 0 ) ; private boolean createIgnored = false ; private boolean startIgnored = false ; private boolean stopIgnored = false ; private boolean destroyIgnored = false ; private boolean unregisterIgnored = false ; public ServiceMBeanSupport ( ) { } public ServiceMBeanSupport ( final Class < ? > type ) { } public ServiceMBeanSupport ( final String category ) { } public ServiceMBeanSupport ( final Logger log ) { } public String getName ( ) { } public ObjectName getServiceName ( ) { } public MBeanServer getServer ( ) { } public int getState ( ) { } public String getStateString ( ) { } public Logger getLog ( ) { } public void create ( ) throws Exception { } public void start ( ) throws Exception { } public void stop ( ) { } public void destroy ( ) { } protected String jbossInternalDescription ( ) { } public void jbossInternalLifecycle ( String method ) throws Exception { } protected void jbossInternalCreate ( ) throws Exception { } protected void jbossInternalStart ( ) throws Exception { } protected void jbossInternalStop ( ) { } protected void jbossInternalDestroy ( ) { } public ObjectName preRegister ( MBeanServer server , ObjectName name ) throws Exception { } public void postRegister ( Boolean registrationDone ) { if ( ! ( registrationDone . booleanValue ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Registration<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>done<seq2seq4repair_space>-><seq2seq4repair_space>stop" ) ; } stop ( ) ; } else { state = REGISTERED ; if ( createIgnored ) { try { create ( ) ; } catch ( Exception e ) { <START_BUG> log . error ( e ) ; <END_BUG> } } } } public void preDeregister ( ) throws Exception { } public void postDeregister ( ) { } protected ObjectName getObjectName ( MBeanServer server , ObjectName name ) throws MalformedObjectNameException { } protected void createService ( ) throws Exception { } protected void startService ( ) throws Exception { } protected void stopService ( ) throws Exception { } protected void destroyService ( ) throws Exception { } public long nextNotificationSequenceNumber ( ) { } protected long getNextNotificationSequenceNumber ( ) { } private void sendStateChangeNotification ( int oldState , int newState , String msg , Throwable t ) { } }

Fix:
log . error ( ROOT_LOGGER . postRegisterInitializationFailed ( ) , e ) ;
Buggy code:
public class ArrayReference extends Reference { public Expression receiver ; public Expression position ; public ArrayReference ( Expression rec , Expression pos ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean compoundAssignment ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { receiver . generateCode ( currentScope , codeStream , true ) ; if ( ( ( receiver ) instanceof CastExpression ) && ( ( ( ( CastExpression ) ( receiver ) ) . innermostCastedExpression ( ) . resolvedType ) == ( NullBinding ) ) ) { codeStream . checkcast ( receiver . resolvedType ) ; } position . generateCode ( currentScope , codeStream , true ) ; codeStream . dup2 ( ) ; codeStream . arrayAt ( this . resolvedType . id ) ; int operationTypeID ; <START_BUG> if ( ( operationTypeID = ( implicitConversion ) > > 4 ) == ( T_String ) ) { <END_BUG> codeStream . generateStringConcatenationAppend ( currentScope , null , expression ) ; } else { codeStream . generateImplicitConversion ( implicitConversion ) ; if ( expression == ( IntLiteral . One ) ) { codeStream . generateConstant ( expression . constant , implicitConversion ) ; } else { expression . generateCode ( currentScope , codeStream , true ) ; } codeStream . sendOperator ( operator , operationTypeID ) ; codeStream . generateImplicitConversion ( assignmentImplicitConversion ) ; } codeStream . arrayAtPut ( this . resolvedType . id , valueRequired ) ; } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( operationTypeID = ( ( implicitConversion ) & ( TypeIds . IMPLICIT_CONVERSION_MASK ) ) > > 4 ) == ( T_String ) ) {
Buggy code:
public class TestAssocOverridesXML extends AbstractPersistenceTestCase { protected List < String > _sql = new ArrayList < String > ( ) ; public void testElementCollectionAssocOverrides ( ) { _sql . clear ( ) ; HashMap < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( "openjpa.jdbc.JDBCListeners" , new JDBCListener [ ] { new TestAssocOverridesXML . SQLListener ( ) } ) ; OpenJPAEntityManagerFactorySPI emf1 = ( ( OpenJPAEntityManagerFactorySPI ) ( OpenJPAPersistence . createEntityManagerFactory ( "AssocOverPU" , ( "org//apache//openjpa//persistence//embed//" + "embed-persistence.xml" ) , props ) ) ) ; EntityManager em = emf1 . createEntityManager ( ) ; XMLAssocOverEntityA ea = new XMLAssocOverEntityA ( ) ; XMLAssocOverEntityB eb = new XMLAssocOverEntityB ( ) ; XMLAssocOverEntityB meb = new XMLAssocOverEntityB ( ) ; XMLAssocOverEmbed emb = new XMLAssocOverEmbed ( ) ; eb . setName ( "XMLAssocOverEntityB" ) ; meb . setName ( "XMLAssocOverEntityBM21" ) ; List < XMLAssocOverEntityA > eaList1 = new ArrayList < XMLAssocOverEntityA > ( ) ; eaList1 . add ( ea ) ; List < XMLAssocOverEntityA > eaList2 = new ArrayList < XMLAssocOverEntityA > ( ) ; eaList2 . add ( ea ) ; eb . setEaList ( eaList1 ) ; meb . setEaList ( eaList2 ) ; emb . setName ( "XMLAssocOverEmbed" ) ; emb . setEb ( eb ) ; emb . setMeb ( meb ) ; List < XMLAssocOverEmbed > embList = new ArrayList < XMLAssocOverEmbed > ( ) ; embList . add ( emb ) ; ea . setEmbA ( embList ) ; em . getTransaction ( ) . begin ( ) ; em . persist ( ea ) ; em . getTransaction ( ) . commit ( ) ; em . close ( ) ; try { assertSQLFragnments ( _sql , ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>XML_EMBALIST<seq2seq4repair_space>.*" + "<seq2seq4repair_space>.*emba_entb.*emba_mentb" ) ) ; <START_BUG> assertSQLFragnments ( _sql , ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>XML_EMBAMAP_1<seq2seq4repair_space>.*" + ( "<seq2seq4repair_space>.*key_emba_entb.*key_emba_mentb" + "<seq2seq4repair_space>.*value_emba_entb.*value_emba_mentb" ) ) ) ; <END_BUG> } finally { try { if ( emf1 != null ) cleanupEMF ( emf1 ) ; } catch ( Exception e ) { fail ( e . getMessage ( ) ) ; } } } void assertSQLFragnments ( List < String > list , String ... keys ) { } private static String toString ( List < String > list ) { } private void cleanupEMF ( OpenJPAEntityManagerFactorySPI emf1 ) throws Exception { } public class SQLListener extends AbstractJDBCListener { @ Override public void beforeExecuteStatement ( JDBCEvent event ) { } } }

Fix:
assertSQLFragnments ( _sql , ( "CREATE<seq2seq4repair_space>TABLE<seq2seq4repair_space>XML_EMBAMAP_3<seq2seq4repair_space>.*" + ( "<seq2seq4repair_space>.*key_emba_entb.*key_emba_mentb" + "<seq2seq4repair_space>.*value_emba_entb.*value_emba_mentb" ) ) ) ;
Buggy code:
public class DBConnection { static String account = "ccs108yzzhu" ; static String password = "aebaujei" ; static String server = "mysql-user-master.stanford.edu" ; static String database = "c_cs108_yzzhu" ; public static Connection con = DBConnection . initConnection ( ) ; private static Connection initConnection ( ) { Connection thisCon = null ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; thisCon = DriverManager . getConnection ( ( "jdbc:mysql:////" + ( DBConnection . server ) ) , DBConnection . account , DBConnection . password ) ; <START_BUG> Statement stmt = DBConnection . con . createStatement ( ) ; <END_BUG> stmt . executeQuery ( ( "USE<seq2seq4repair_space>" + ( DBConnection . database ) ) ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; } return thisCon ; } public static ResultSet DBQuery ( PreparedStatement stmt ) { } public static int DBUpdate ( PreparedStatement stmt ) { } public static void DBClose ( ) { } }

Fix:
Statement stmt = thisCon . createStatement ( ) ;
Buggy code:
class AsmListenerImpl extends AsmBaseListener { private List < LineNumberedException > exceptionList ; private List < InstructionElement > instructionList ; private Map < String , Integer > labelMap ; private Map < String , String > ruleMap ; private Set < String > registerNameSet ; private Set < String > portNameSet ; public AsmListenerImpl ( Set < String > registerNameSet , Set < String > portNameSet ) { } @ Override public void exitPreprocessorRule ( AsmParser . PreprocessorRuleContext ctx ) { } @ Override public void exitLabel ( AsmParser . LabelContext ctx ) { } @ Override public void exitInstruction ( AsmParser . InstructionContext ctx ) { } @ Override public void exitProgram ( AsmParser . ProgramContext ctx ) { } public List < LineNumberedException > getExceptionList ( ) { } public List < InstructionElement > getInstructionList ( ) { } public Map < String , Integer > getLabelMap ( ) { } public Map < String , String > getRuleMap ( ) { } private void addLabel ( AsmParser . LabelContext ctx , boolean isPositionKnown ) throws DuplicateLabelNameException , LabelNameCollisionException { } private void addInstruction ( AsmParser . InstructionContext ctx ) { String opcode = ctx . opcode ( ) . getText ( ) ; ArgumentElement [ ] args = ctx . argument ( ) . stream ( ) . map ( ( arg ) -> { return new ArgumentElement ( Location . fromParserRuleContext ( arg ) , arg . getText ( ) ) ; } ) . toArray ( ArgumentElement [ ] :: new ) ; <START_BUG> instructionList . add ( new InstructionElement ( Location . fromParserRuleContext ( ctx ) , opcode , args ) ) ; <END_BUG> } private ArgumentElement evaluateArgumentType ( ArgumentElement arg ) throws UnknownArgumentTypeException { } private void updateUnsetLabels ( Integer value ) { } }

Fix:
instructionList . add ( new InstructionElement ( Location . fromParserRuleContext ( ctx . opcode ( ) ) , opcode , args ) ) ;
Buggy code:
public class ConcurrentMergeScheduler extends MergeScheduler { private int mergeThreadPriority = - 1 ; protected List mergeThreads = new ArrayList ( ) ; private int maxThreadCount = 3 ; private List exceptions = new ArrayList ( ) ; protected Directory dir ; private boolean closed ; protected IndexWriter writer ; protected int mergeThreadCount ; public ConcurrentMergeScheduler ( ) { } public void setMaxThreadCount ( int count ) { } public int getMaxThreadCount ( ) { } public synchronized int getMergeThreadPriority ( ) { } public synchronized void setMergeThreadPriority ( int pri ) { } private boolean verbose ( ) { } private void message ( String message ) { } private synchronized void initMergeThreadPriority ( ) { } public void close ( ) { } public synchronized void sync ( ) { } private synchronized int mergeThreadCount ( ) { } public void merge ( IndexWriter writer ) throws IOException , CorruptIndexException { } protected void doMerge ( MergePolicy . OneMerge merge ) throws IOException { } protected synchronized ConcurrentMergeScheduler . MergeThread getMergeThread ( IndexWriter writer , MergePolicy . OneMerge merge ) throws IOException { } protected class MergeThread extends Thread { IndexWriter writer ; OneMerge startMerge ; OneMerge runningMerge ; public MergeThread ( IndexWriter writer , MergePolicy . OneMerge startMerge ) throws IOException { } public synchronized void setRunningMerge ( MergePolicy . OneMerge merge ) { } public synchronized OneMerge getRunningMerge ( ) { } public void setThreadPriority ( int pri ) { } public void run ( ) { } public String toString ( ) { } } protected void handleMergeException ( Throwable exc ) { } static boolean anyExceptions = false ; public static boolean anyUnhandledExceptions ( ) { } public static void clearUnhandledExceptions ( ) { } private void addMyself ( ) { synchronized ( ConcurrentMergeScheduler . allInstances ) { <START_BUG> final int size = 0 ; <END_BUG> int upto = 0 ; for ( int i = 0 ; i < size ; i ++ ) { final ConcurrentMergeScheduler other = ( ( ConcurrentMergeScheduler ) ( ConcurrentMergeScheduler . allInstances . get ( i ) ) ) ; if ( ! ( ( other . closed ) && ( 0 == ( other . mergeThreadCount ( ) ) ) ) ) ConcurrentMergeScheduler . allInstances . set ( ( upto ++ ) , other ) ; } ConcurrentMergeScheduler . allInstances . subList ( upto , ConcurrentMergeScheduler . allInstances . size ( ) ) . clear ( ) ; ConcurrentMergeScheduler . allInstances . add ( this ) ; } } private boolean suppressExceptions ; void setSuppressExceptions ( ) { } void clearSuppressExceptions ( ) { } private static List allInstances ; public static void setTestMode ( ) { } }

Fix:
final int size = ConcurrentMergeScheduler . allInstances . size ( ) ;
Buggy code:
class PreviewEditorMouseListener implements EditorMouseListener , EditorMouseMotionListener { private InputPanel inputPanel ; public PreviewEditorMouseListener ( InputPanel inputPanel ) { } @ Override public void mouseExited ( EditorMouseEvent e ) { } @ Override public void mouseClicked ( EditorMouseEvent e ) { } @ Override public void mouseMoved ( EditorMouseEvent e ) { int offset = getEditorCharOffset ( e ) ; if ( offset < 0 ) return ; Editor editor = e . getEditor ( ) ; ANTLRv4PluginController controller = ANTLRv4PluginController . getInstance ( editor . getProject ( ) ) ; PreviewState previewState = controller . getPreviewState ( ) ; if ( previewState == null ) { return ; } MouseEvent mouseEvent = e . getMouseEvent ( ) ; InputPanel . removeTokenInfoHighlighters ( editor ) ; if ( ( mouseEvent . isMetaDown ( ) ) && ( ( previewState . parsingResult ) != null ) ) { inputPanel . showTokenInfoUponMeta ( editor , previewState , offset ) ; } else if ( ( mouseEvent . isAltDown ( ) ) && ( ( previewState . parsingResult ) != null ) ) { HintManager . getInstance ( ) . hideAllHints ( ) ; inputPanel . showParseRegion ( e , editor , previewState , offset ) ; } else { <START_BUG> inputPanel . showTooltips ( editor , previewState , offset ) ; <END_BUG> } } public int getEditorCharOffset ( EditorMouseEvent e ) { } @ Override public void mousePressed ( EditorMouseEvent e ) { } @ Override public void mouseReleased ( EditorMouseEvent e ) { } @ Override public void mouseEntered ( EditorMouseEvent e ) { } @ Override public void mouseDragged ( EditorMouseEvent e ) { } }

Fix:
InputPanel . showTooltips ( e , editor , previewState , offset ) ;
Buggy code:
public class AddressbookAction extends AbstractColumbaAction { public AddressbookAction ( ComposerController composerController ) { } public void actionPerformed ( ActionEvent evt ) { ComposerController composerController = ( ( ComposerController ) ( getFrameMediator ( ) ) ) ; composerController . getHeaderController ( ) . getView ( ) . cleanupHeaderItemList ( ) ; <START_BUG> SelectAddressDialog dialog = new SelectAddressDialog ( composerController . getView ( ) , composerController . getHeaderController ( ) . getHeaderItemLists ( ) ) ; <END_BUG> Folder folder = ( ( Folder ) ( addressbookTreeModel . getFolder ( 101 ) ) ) ; dialog . setHeaderList ( folder . getHeaderItemList ( ) ) ; dialog . setVisible ( true ) ; composerController . getHeaderController ( ) . setHeaderItemLists ( dialog . getHeaderItemLists ( ) ) ; } }

Fix:
SelectAddressDialog dialog = new SelectAddressDialog ( composerController . getView ( ) . getFrame ( ) , composerController . getHeaderController ( ) . getHeaderItemLists ( ) ) ;
Buggy code:
public class APILogParser { private static DateFormat apiTimeFormat = new SimpleDateFormat ( "d//MMM//yyyy:HH:m:s<seq2seq4repair_space>Z" ) ; private static final Logger LOG = Logger . getLogger ( APILogParser . class ) ; public UniformAPILogEntry parseEvent ( String line ) throws Exception { try { String [ ] splits = line . substring ( 0 , line . lastIndexOf ( "<seq2seq4repair_space>-<seq2seq4repair_space>" ) ) . split ( ":" ) ; String hostName = splits [ 1 ] . trim ( ) ; Integer statusCode = Integer . parseInt ( splits [ 2 ] ) ; Integer responseSizeInBytes = ( ! ( splits [ 3 ] . equals ( "-" ) ) ) ? Integer . parseInt ( splits [ 3 ] ) : null ; Float processingTime = ( ! ( splits [ 4 ] . equals ( "-" ) ) ) ? Float . parseFloat ( splits [ 4 ] ) : null ; String ip = ( ! ( splits [ 5 ] . equals ( "-" ) ) ) ? splits [ 5 ] : null ; String requestString = ( ! ( splits [ 6 ] . equals ( "-" ) ) ) ? splits [ 6 ] : null ; String applicationInfo = ( ! ( splits [ 7 ] . equals ( "-" ) ) ) ? splits [ 7 ] : null ; String deviceId = ( ! ( splits [ 8 ] . equals ( "-" ) ) ) ? splits [ 8 ] : null ; String countryCode = ( ! ( splits [ 9 ] . equals ( "-" ) ) ) ? splits [ 9 ] : null ; String languageCode = ( ! ( splits [ 10 ] . equals ( "-" ) ) ) ? splits [ 10 ] : null ; String platform = ( ! ( splits [ 11 ] . equals ( "-" ) ) ) ? splits [ 11 ] : null ; Integer version = ( ! ( splits [ 12 ] . equals ( "-" ) ) ) ? Integer . parseInt ( splits [ 12 ] ) : null ; String datePart = line . substring ( ( ( line . lastIndexOf ( "[" ) ) + 1 ) , line . lastIndexOf ( "]" ) ) ; APILogParser . LOG . debug ( ( "datePart<seq2seq4repair_space>=<seq2seq4repair_space>" + datePart ) ) ; Long timeStamp = APILogParser . apiTimeFormat . parse ( datePart ) . getTime ( ) ; String reqType = line . substring ( line . lastIndexOf ( "-<seq2seq4repair_space>" ) ) . split ( "<seq2seq4repair_space>" ) [ 1 ] ; UniformAPILogEntry logEntry = new UniformAPILogEntry ( reqType ) ; logEntry . setHostName ( hostName ) ; logEntry . setStatusCode ( statusCode ) ; logEntry . setResponseSizeInBytes ( responseSizeInBytes ) ; logEntry . setProcessingTime ( processingTime ) ; logEntry . setIp ( ip ) ; logEntry . setRequestString ( requestString ) ; logEntry . setApplicationInfo ( applicationInfo ) ; logEntry . setDeviceId ( deviceId ) ; logEntry . setCountryCode ( countryCode ) ; logEntry . setLanguageCode ( languageCode ) ; logEntry . setPlatform ( platform ) ; logEntry . setAppVersion ( version ) ; logEntry . setRequestTime ( timeStamp ) ; return logEntry ; } catch ( Exception e ) { <START_BUG> APILogParser . LOG . error ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>parser" , e ) ; <END_BUG> throw new Exception ( e ) ; } } }

Fix:
APILogParser . LOG . error ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>parser,<seq2seq4repair_space>line<seq2seq4repair_space>=<seq2seq4repair_space>" + line ) , e ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class InfinispanSubsystemTestCase extends ClusteringSubsystemTest { String xmlFile = null ; int operations = 0 ; public InfinispanSubsystemTestCase ( String xmlFile , int operations ) { } @ Parameters public static Collection < Object [ ] > data ( ) { <START_BUG> Object [ ] [ ] data = new Object [ ] [ ] { new Object [ ] { "subsystem-infinispan_1_0.xml" , 31 } , new Object [ ] { "subsystem-infinispan_1_1.xml" , 31 } , new Object [ ] { "subsystem-infinispan_1_2.xml" , 31 } } ; <END_BUG> return Arrays . asList ( data ) ; } @ Override protected ValidationConfiguration getModelValidationConfiguration ( ) { } @ Test public void testParseSubsystem ( ) throws Exception { } @ Test public void testInstallIntoController ( ) throws Exception { } @ Test public void testParseAndMarshalModel ( ) throws Exception { } @ Test public void testDescribeHandler ( ) throws Exception { } }

Fix:
Object [ ] [ ] data = new Object [ ] [ ] { new Object [ ] { "subsystem-infinispan_1_0.xml" , 31 } , new Object [ ] { "subsystem-infinispan_1_1.xml" , 31 } , new Object [ ] { "subsystem-infinispan_1_2.xml" , 35 } } ;
Buggy code:
public class ExecuteQuery extends Query { public ExecuteQuery ( String sql , List < Object > parameters ) { } public ExecuteQuery ( String sql , Object ... parameters ) { } public Boolean execute ( Connection conn ) throws SQLException { PreparedStatement pstmt = conn . prepareStatement ( sql ) ; if ( ( parameters ) != null ) for ( int j = 0 ; j < ( parameters . size ( ) ) ; j ++ ) { pstmt . setObject ( ( j + 1 ) , parameters . get ( j ) ) ; } pstmt . execute ( ) ; int result = pstmt . getUpdateCount ( ) ; if ( pstmt != null ) try { pstmt . close ( ) ; } catch ( SQLException sqle ) { } <START_BUG> return result == 1 ; <END_BUG> } }

Fix:
return result != 0 ;
Buggy code:
public class Fragment extends WebMarkupContainerWithAssociatedMarkup { private static final long serialVersionUID = 1L ; private String markupId ; private final MarkupContainer markupProvider ; public Fragment ( final String id , final String markupId , final MarkupContainer markupProvider ) { } public Fragment ( final String id , final String markupId , final MarkupContainer markupProvider , final IModel < ? > model ) { } public final void setMarkupTagReferenceId ( final String markupId ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected MarkupStream chooseMarkupStream ( final MarkupStream markupStream ) { MarkupStream stream = null ; if ( ( markupProvider ) == null ) { stream = markupStream ; } else { stream = markupProvider . getAssociatedMarkupStream ( false ) ; if ( stream == null ) { <START_BUG> stream = markupProvider . getMarkupStream ( ) ; <END_BUG> } } return stream ; } private void renderFragment ( final MarkupStream providerMarkupStream , final ComponentTag openTag ) { } @ Override public boolean hasAssociatedMarkup ( ) { } @ Override public MarkupStream getAssociatedMarkupStream ( boolean throwException ) { } public final MarkupContainer getMarkupProvider ( ) { } @ Override public IMarkupFragment getMarkup ( final Component child ) { } }

Fix:
stream = new MarkupStream ( markupProvider . getMarkup ( null ) ) ;
Buggy code:
public class PiEngine { private static GLFWErrorCallback errorCallback ; public static GameInstance instance ; public static final int ORTHO_ID = 0 ; public static final int CAMERA_3D_ID = 1 ; public static final int CAMERA_2D_ID = 2 ; public static int TEXTURE_ID ; public static int COLOR_ID ; public static int TEXT_ID ; public static int TEXTURE_C ; public static final float PIXELS_PER_METER = 0.1F // 2 ; public static int monitor = 0 ; public static boolean debug = false ; public static int glMajor = - 1 ; public static int glMinor = - 1 ; public static GLCapabilities capabilities ; public static void start ( GameInstance inst ) { assert inst != null ; System . setProperty ( "org.lwjgl.librarypath" , "libs//lwjgl//native" ) ; glfwSetErrorCallback ( ( PiEngine . errorCallback = GLFWErrorCallback . createPrint ( System . err ) ) ) ; <START_BUG> if ( ( glfwInit ( ) ) != ( GLFW_TRUE ) ) <END_BUG> throw new IllegalStateException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>initialize<seq2seq4repair_space>GLFW" ) ; glfwDefaultWindowHints ( ) ; glfwWindowHint ( GLFW_VISIBLE , GL_FALSE ) ; glfwWindowHint ( GLFW_RESIZABLE , GL_TRUE ) ; long window = glfwCreateWindow ( 100 , 100 , "" , NULL , NULL ) ; glfwMakeContextCurrent ( window ) ; PiEngine . capabilities = GL . createCapabilities ( ) ; String glVersion = glGetString ( GL_VERSION ) ; int index = glVersion . indexOf ( '.' ) ; PiEngine . glMajor = Integer . parseInt ( glVersion . substring ( 0 , index ) ) ; PiEngine . glMinor = Integer . parseInt ( glVersion . substring ( ( index + 1 ) , glVersion . indexOf ( '.' , ( index + 1 ) ) ) ) ; if ( ( PiEngine . glMajor ) == 1 ) throw new IllegalStateException ( "OpenGL<seq2seq4repair_space>version<seq2seq4repair_space>2.0<seq2seq4repair_space>not<seq2seq4repair_space>supported,<seq2seq4repair_space>program<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>work" ) ; glfwWindowHint ( GLFW_CONTEXT_VERSION_MAJOR , PiEngine . glMajor ) ; glfwWindowHint ( GLFW_CONTEXT_VERSION_MINOR , PiEngine . glMinor ) ; if ( ( ( PiEngine . glMajor ) > 3 ) || ( ( ( PiEngine . glMajor ) == 3 ) && ( ( PiEngine . glMinor ) > 1 ) ) ) { glfwWindowHint ( GLFW_OPENGL_FORWARD_COMPAT , GL_TRUE ) ; glfwWindowHint ( GLFW_OPENGL_PROFILE , GLFW_OPENGL_CORE_PROFILE ) ; } glfwDestroyWindow ( window ) ; PiEngine . instance = inst ; PiEngine . instance . init ( ) ; PiEngine . instance . start ( ) ; PiEngine . errorCallback . free ( ) ; glfwTerminate ( ) ; } }

Fix:
if ( ! ( glfwInit ( ) ) )
Buggy code:
public class Sql { private static class CachedConnection { protected Connection connection ; protected long cachedTime ; } public static final int WAIT_TIMEOUT_SECONDS = 1800 ; public static final int REGULAR_VISIT_TYPE_ID = 1 ; public static final int ONE_OFF_VISIT_TYPE_ID = 2 ; private static final SimpleDateFormat SIMPLE_DATE_TIME_FORMAT = new SimpleDateFormat ( "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss.SSS" ) ; private static final Queue < Sql . CachedConnection > connectionPool = new LinkedList < Sql . CachedConnection > ( ) ; public static Connection connect ( ) { } public static void close ( Connection conn ) { } public static void close ( ResultSet rs ) { } public static ResultSet query ( Connection conn , String sql ) { } public static ResultSet query ( Connection conn , String sql , Level loggerLevel ) { } public static boolean resultExists ( Connection conn , String sql ) { } public static boolean execute ( Connection conn , String sql ) { Mediator . getLogger ( Sql . class . getName ( ) ) . log ( Level . FINE , "SQL<seq2seq4repair_space>Execute:\n{0}" , sql ) ; boolean returnValue = true ; try { PreparedStatement stmt = conn . prepareStatement ( sql ) ; <START_BUG> returnValue = stmt . execute ( ) ; <END_BUG> int updateCount = stmt . getUpdateCount ( ) ; Mediator . getLogger ( Sql . class . getName ( ) ) . log ( Level . FINE , "{0}<seq2seq4repair_space>rows<seq2seq4repair_space>updated." , updateCount ) ; } catch ( SQLException ex ) { Logger . getLogger ( Mpi . class . getName ( ) ) . log ( Level . SEVERE , ( "Error<seq2seq4repair_space>executing<seq2seq4repair_space>SQL<seq2seq4repair_space>statement<seq2seq4repair_space>" + sql ) , ex ) ; returnValue = false ; } return returnValue ; } public static void startTransaction ( Connection conn ) { } public static void commit ( Connection conn ) { } public static void rollback ( Connection conn ) { } public static String getLastInsertId ( Connection conn ) { } public static String getLookupId ( Connection conn , String lookupTable , String idColumn , String nameColumn , String lookupString ) { } public static String getMaritalStatusId ( Connection conn , Person . MaritalStatus maritalStatus ) { } public static String getVillageId ( Connection conn , String villageName ) { } public static String getAddressId ( Connection conn , String address ) { } public static String quote ( String s ) { } public static String quote ( Date d ) { } public static String quote ( byte [ ] byteArray ) { } }

Fix:
stmt . execute ( ) ;
Buggy code:
public class LocalDomainControllerRemoveHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "remove-local-domain-controller" ; public static final LocalDomainControllerRemoveHandler INSTANCE = new LocalDomainControllerRemoveHandler ( ) ; protected LocalDomainControllerRemoveHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; model . get ( DOMAIN_CONTROLLER ) . setEmptyObject ( ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( final Locale locale ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class DropDownChoice extends AbstractSingleSelectChoice implements IOnChangeListener { private static final long serialVersionUID = 1L ; public DropDownChoice ( final String id ) { } public DropDownChoice ( final String id , final List choices ) { } public DropDownChoice ( final String id , final List data , final IChoiceRenderer renderer ) { } public DropDownChoice ( final String id , IModel model , final List choices ) { } public DropDownChoice ( final String id , IModel model , final List data , final IChoiceRenderer renderer ) { } public DropDownChoice ( String id , IModel choices ) { } public DropDownChoice ( String id , IModel model , IModel choices ) { } public DropDownChoice ( String id , IModel choices , IChoiceRenderer renderer ) { } public DropDownChoice ( String id , IModel model , IModel choices , IChoiceRenderer renderer ) { } public final void onSelectionChanged ( ) { <START_BUG> convert ( ) ; <END_BUG> updateModel ( ) ; onSelectionChanged ( getModelObject ( ) ) ; } protected void onComponentTag ( final ComponentTag tag ) { } protected void onSelectionChanged ( final Object newSelection ) { } protected boolean wantOnSelectionChangedNotifications ( ) { } protected boolean getStatelessHint ( ) { } }

Fix:
convertInput ( ) ;
Buggy code:
public class HttpManagementRemoveHandler extends AbstractRemoveStepHandler { private final LocalHostControllerInfoImpl hostControllerInfo ; private final HostControllerEnvironment environment ; public HttpManagementRemoveHandler ( final LocalHostControllerInfoImpl hostControllerInfo , final HostControllerEnvironment environment ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { HttpManagementAddHandler . populateHostControllerInfo ( hostControllerInfo , context , model ) ; <START_BUG> HttpManagementAddHandler . installHttpManagementServices ( context . getRunningMode ( ) , context . getServiceTarget ( ) , hostControllerInfo , environment , null ) ; <END_BUG> } static void clearHostControllerInfo ( LocalHostControllerInfoImpl hostControllerInfo ) { } static void removeHttpManagementService ( final OperationContext context ) { } }

Fix:
HttpManagementAddHandler . installHttpManagementServices ( context . getRunningMode ( ) , context . getServiceTarget ( ) , hostControllerInfo , environment , null , false ) ;
Buggy code:
public abstract class EffectComponent { private final ArrayList < EffectComponent > children = new ArrayList < EffectComponent > ( ) ; protected final Settings settings = new Settings ( ) ; protected Skill skill ; private String key ; private String type = "trigger" ; protected boolean executeChildren ( LivingEntity caster , int level , List < LivingEntity > targets ) { } protected PlayerSkill getSkillData ( LivingEntity caster ) { } public abstract boolean execute ( LivingEntity caster , int level , List < LivingEntity > targets ) { } private static final String TYPE = "type" ; public void save ( ConfigurationSection config ) { } public void load ( Skill skill , ConfigurationSection config ) { this . skill = skill ; if ( config == null ) { return ; } settings . load ( config . getConfigurationSection ( "data" ) ) ; ConfigurationSection children = config . getConfigurationSection ( "children" ) ; if ( children != null ) { for ( String key : children . getKeys ( false ) ) { String type = children . getConfigurationSection ( key ) . getString ( EffectComponent . TYPE , "missing" ) . toLowerCase ( ) ; HashMap < String , Class < ? extends EffectComponent > > map ; if ( type . equals ( "target" ) ) { map = EffectComponent . targets ; } else if ( type . equals ( "condition" ) ) { map = EffectComponent . conditions ; } else if ( type . equals ( "mechanic" ) ) { map = EffectComponent . mechanics ; } else { Bukkit . getLogger ( ) . warning ( ( "Invalid<seq2seq4repair_space>component<seq2seq4repair_space>type<seq2seq4repair_space>-<seq2seq4repair_space>" + type ) ) ; continue ; } if ( map . containsKey ( key . toLowerCase ( ) ) ) { try { <START_BUG> EffectComponent child = map . get ( key . toLowerCase ( ) ) . newInstance ( ) ; <END_BUG> child . key = key ; child . type = type ; child . load ( skill , children . getConfigurationSection ( key ) ) ; this . children . add ( child ) ; } catch ( Exception ex ) { } } } } } private static final HashMap < String , Class < ? extends EffectComponent > > targets = new HashMap < String , Class < ? extends EffectComponent > > ( ) { } ; private static final HashMap < String , Class < ? extends EffectComponent > > conditions = new HashMap < String , Class < ? extends EffectComponent > > ( ) { } ; private static final HashMap < String , Class < ? extends EffectComponent > > mechanics = new HashMap < String , Class < ? extends EffectComponent > > ( ) { } ; }

Fix:
EffectComponent child = map . get ( key . toLowerCase ( ) . replaceAll ( "-.+" , "" ) ) . newInstance ( ) ;
Buggy code:
public class CharSequenceReader extends Reader implements Serializable { private final CharSequence charSequence ; private int idx ; private int mark ; public CharSequenceReader ( CharSequence charSequence ) { } @ Override public void close ( ) { } @ Override public void mark ( int readAheadLimit ) { } @ Override public boolean markSupported ( ) { } @ Override public int read ( ) { } @ Override public int read ( char [ ] array , int offset , int length ) { if ( ( idx ) >= ( charSequence . length ( ) ) ) { return - 1 ; } if ( array == null ) { throw new NullPointerException ( "Character<seq2seq4repair_space>array<seq2seq4repair_space>is<seq2seq4repair_space>missing" ) ; } <START_BUG> if ( ( length < 0 ) || ( ( offset + length ) > ( array . length ) ) ) { <END_BUG> throw new IndexOutOfBoundsException ( ( ( ( ( ( "Array<seq2seq4repair_space>Size=" + ( array . length ) ) + ",<seq2seq4repair_space>offset=" ) + offset ) + ",<seq2seq4repair_space>length=" ) + length ) ) ; } int count = 0 ; for ( int i = 0 ; i < length ; i ++ ) { int c = read ( ) ; if ( c == ( - 1 ) ) { return count ; } array [ ( offset + i ) ] = ( ( char ) ( c ) ) ; count ++ ; } return count ; } @ Override public void reset ( ) { } @ Override public long skip ( long n ) { } @ Override public String toString ( ) { } }

Fix:
if ( ( ( length < 0 ) || ( offset < 0 ) ) || ( ( offset + length ) > ( array . length ) ) ) {
Buggy code:
public class DataLoaderTask extends AsyncTask < Void , Void , ArrayList < String > > { private Searchable mSearchable ; public DataLoaderTask ( Searchable searchable ) { } @ Override protected ArrayList < String > doInBackground ( Void ... obj ) { final int randomStringLength = 30 ; <START_BUG> final int randomStringListSize = 1000 ; <END_BUG> RandomStringGenerator randomStringGenerator = new RandomStringGenerator ( ) ; return randomStringGenerator . loadRandomAlphanumericStrings ( randomStringLength , randomStringListSize ) ; } protected void onPostExecute ( ArrayList < String > searchableList ) { } }

Fix:
final int randomStringListSize = 10000 ;
Buggy code:
@ SuppressWarnings ( "boxing" ) public class MapUtilsTest extends BulkTest { public MapUtilsTest ( final String name ) { } public static Test suite ( ) { } public Predicate < Object > getPredicate ( ) { } public void testPredicatedMap ( ) { } public void testLazyMapFactory ( ) { } public void testLazyMapTransformer ( ) { } public void testInvertMap ( ) { } public void testPutAll_Map_array ( ) { } public void testConvertResourceBundle ( ) { } public void testDebugAndVerbosePrintCasting ( ) { } public void testDebugAndVerbosePrintNullMap ( ) { } public void testVerbosePrintNullLabel ( ) { } public void testDebugPrintNullLabel ( ) { } public void testVerbosePrintNullLabelAndMap ( ) { } public void testDebugPrintNullLabelAndMap ( ) { } public void testVerbosePrintNullStream ( ) { } public void testDebugPrintNullStream ( ) { } public void testDebugPrintNullKey ( ) { } public void testVerbosePrintNullKey ( ) { } public void testDebugPrintNullKeyToMap1 ( ) { } public void testVerbosePrintNullKeyToMap1 ( ) { } public void testDebugPrintNullKeyToMap2 ( ) { } public void testVerbosePrintNullKeyToMap2 ( ) { } public void testVerbosePrint ( ) { } public void testDebugPrint ( ) { } public void testVerbosePrintSelfReference ( ) { } public void testDebugPrintSelfReference ( ) { } public void testEmptyIfNull ( ) { } public void testIsEmptyWithEmptyMap ( ) { } public void testIsEmptyWithNonEmptyMap ( ) { } public void testIsEmptyWithNull ( ) { } public void testIsNotEmptyWithEmptyMap ( ) { } public void testIsNotEmptyWithNonEmptyMap ( ) { } public void testIsNotEmptyWithNull ( ) { } public void testPopulateMap ( ) { } public static class X implements Comparable < MapUtilsTest . X > { int key ; String name ; public X ( int key , String name ) { } public int compareTo ( MapUtilsTest . X o ) { <START_BUG> return ( key ) - ( o . key ) ; <END_BUG> } } public void testPopulateMultiMap ( ) { } public void testIterableMap ( ) { } public void testIterableSortedMap ( ) { } }

Fix:
return ( ( key ) - ( o . key ) ) | ( name . compareTo ( o . name ) ) ;
Buggy code:
public class EditorPlugin extends AbstractUIPlugin { private static EditorPlugin plugin ; private ResourceBundle resourceBundle ; public EditorPlugin ( ) { } public void start ( BundleContext context ) throws Exception { } public void stop ( BundleContext context ) throws Exception { } public static EditorPlugin getDefault ( ) { } public static String getResourceString ( String key ) { } public ResourceBundle getResourceBundle ( ) { } public void log ( Throwable t ) { } public synchronized ISharedDataGraph subscribe ( String path , IUpdateConsumer consumer ) throws ECFException { } public synchronized ISharedDataGraph publish ( String path , DataGraph dataGraph , IUpdateConsumer consumer ) throws ECFException { } public synchronized boolean isPublished ( String path ) throws ECFException { } public synchronized void checkConnected ( IProject project ) throws ECFException { } private ISharedObjectContainer getContainer ( IProject project ) throws ECFException { } private PublishedGraphTracker getTracker ( ISharedObjectContainer container ) throws ECFException { ID id = IDFactory . makeStringID ( PublishedGraphTracker . class . getName ( ) ) ; PublishedGraphTracker tracker = ( ( PublishedGraphTracker ) ( container . getSharedObjectManager ( ) . getSharedObject ( id ) ) ) ; if ( tracker == null ) { tracker = new PublishedGraphTracker ( ) ; <START_BUG> container . getSharedObjectManager ( ) . addSharedObject ( id , tracker , null , null ) ; <END_BUG> } return tracker ; } }

Fix:
container . getSharedObjectManager ( ) . addSharedObject ( id , tracker , null ) ;