nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CreateCompilationUnitOperation extends JavaModelOperation { protected String fName ; protected String fSource = null ; public CreateCompilationUnitOperation ( IPackageFragment parentElement , String name , String source , boolean force ) { } protected void executeOperation ( ) throws JavaModelException { } protected ICompilationUnit getCompilationUnit ( ) { } protected ISchedulingRule getSchedulingRule ( ) { <START_BUG> return getParentElement ( ) . getResource ( ) ; <END_BUG> } public IJavaModelStatus verify ( ) { } }

Fix:
return getParentElement ( ) . getSchedulingRule ( ) ;
Buggy code:
public class KClosestNodesSearch { private Key targetKey ; private List < KBucketEntry > entries ; private int max_entries ; private DHT owner ; private Comparator < KBucketEntry > comp ; public Predicate < KBucketEntry > filter = KBucketEntry :: eligibleForNodesList ; public KClosestNodesSearch ( Key key , int max_entries , DHT owner ) { } public Key getSearchTarget ( ) { } public int getNumEntries ( ) { } public void fill ( ) { } private void insertBucket ( KBucket bucket ) { } private void shave ( ) { } public void fill ( boolean includeOurself ) { RoutingTable table = owner . getNode ( ) . table ( ) ; final int initialIdx = table . indexForId ( targetKey ) ; int currentIdx = initialIdx ; Node . RoutingTableEntry current = table . get ( initialIdx ) ; while ( true ) { insertBucket ( current . getBucket ( ) ) ; if ( ( entries . size ( ) ) >= ( max_entries ) ) break ; Prefix bucketPrefix = current . prefix ; Prefix targetToBucketDistance = new Prefix ( targetKey . distance ( bucketPrefix ) , bucketPrefix . depth ) ; Key incrementedDistance = targetToBucketDistance . add ( Key . setBit ( targetToBucketDistance . depth ) ) ; Key nextBucketTarget = targetKey . distance ( incrementedDistance ) ; int dir = Integer . signum ( nextBucketTarget . compareTo ( current . prefix ) ) ; int idx ; current = null ; idx = currentIdx + dir ; if ( ( 0 <= idx ) && ( idx < ( table . size ( ) ) ) ) current = table . get ( idx ) ; if ( ( current == null ) || ( ! ( current . prefix . isPrefixOf ( nextBucketTarget ) ) ) ) { idx = table . indexForId ( nextBucketTarget ) ; current = table . get ( idx ) ; } currentIdx = idx ; if ( currentIdx == initialIdx ) break ; } shave ( ) ; RPCServer srv = owner . getServerManager ( ) . getRandomActiveServer ( true ) ; <START_BUG> if ( ( includeOurself && ( ( srv . getPublicAddress ( ) ) != null ) ) && ( ( entries . size ( ) ) < ( max_entries ) ) ) { <END_BUG> InetSocketAddress sockAddr = new InetSocketAddress ( srv . getPublicAddress ( ) , srv . getPort ( ) ) ; entries . add ( new KBucketEntry ( sockAddr , srv . getDerivedID ( ) ) ) ; } } public boolean isFull ( ) { } public byte [ ] pack ( ) { } public NodeList asNodeList ( ) { } public List < KBucketEntry > getEntries ( ) { } }

Fix:
if ( ( ( includeOurself && ( srv != null ) ) && ( ( srv . getPublicAddress ( ) ) != null ) ) && ( ( entries . size ( ) ) < ( max_entries ) ) ) {
Buggy code:
public class JCacheNamespaceDrivenTests extends AbstractJCacheAnnotationTests { @ Override protected ApplicationContext getApplicationContext ( ) { } @ Test public void cacheResolver ( ) { ConfigurableApplicationContext context = new GenericXmlApplicationContext ( "//org//springframework//cache//jcache//config//jCacheNamespaceDriven-resolver.xml" ) ; DefaultJCacheOperationSource ci = context . getBean ( DefaultJCacheOperationSource . class ) ; <START_BUG> assertSame ( context . getBean ( "cacheResolver" ) , ci . getDefaultCacheResolver ( ) ) ; <END_BUG> context . close ( ) ; } @ Test public void testCacheErrorHandler ( ) { } }

Fix:
assertSame ( context . getBean ( "cacheResolver" ) , ci . getCacheResolver ( ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//api//user" ) public class AuthenticationController { @ Autowired private UserRepository ur ; @ Autowired private TokenRepository tr ; @ RequestMapping ( value = "//login" , method = RequestMethod . POST ) public ApiResponseEntity loginUser ( @ RequestBody User login ) throws UnsupportedEncodingException , NoSuchAlgorithmException { User user = ur . findOneByUsername ( login . getUsername ( ) ) ; Token existingToken = tr . findOneByUserId ( user . getId ( ) ) ; if ( ( user != null ) && ( existingToken == null ) ) { String providedData = PasswordTools . sha256Hash ( ( ( user . getPasswordSalt ( ) ) + ( login . getPasswordHash ( ) ) ) ) ; String storedData = PasswordTools . sha256Hash ( ( ( user . getPasswordSalt ( ) ) + ( user . getPasswordHash ( ) ) ) ) ; if ( providedData . equals ( storedData ) ) { Token token = new Token ( user . getId ( ) ) ; tr . save ( token ) ; return ResponseFactory . okResponse ( token ) ; } else { return ResponseFactory . authErrorResponse ( "Incorrect<seq2seq4repair_space>Password" ) ; } } else if ( existingToken != null ) { return ResponseFactory . okResponse ( "Already<seq2seq4repair_space>logged<seq2seq4repair_space>in" ) ; } else { <START_BUG> return ResponseFactory . notFoundResponse ( "No<seq2seq4repair_space>user<seq2seq4repair_space>found<seq2seq4repair_space>by<seq2seq4repair_space>ID" ) ; <END_BUG> } } @ RequestMapping ( value = "//logout" , method = RequestMethod . POST ) public Object loginUser ( @ RequestHeader ( "Token" ) String token ) { } }

Fix:
return ResponseFactory . notFoundResponse ( "User<seq2seq4repair_space>Not<seq2seq4repair_space>Found" ) ;
Buggy code:
public class TestDateFilter extends TestCase { public TestDateFilter ( String name ) { } public static void testBefore ( ) throws IOException { } public static void testAfter ( ) throws IOException { RAMDirectory indexStore = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( indexStore , new SimpleAnalyzer ( ) , true ) ; long now = System . currentTimeMillis ( ) ; Document doc = new Document ( ) ; <START_BUG> doc . add ( Field . Keyword ( "datefield" , DateField . timeToString ( ( now - 888888 ) ) ) ) ; <END_BUG> doc . add ( Field . Text ( "body" , "Today<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>very<seq2seq4repair_space>sunny<seq2seq4repair_space>day<seq2seq4repair_space>in<seq2seq4repair_space>New<seq2seq4repair_space>York<seq2seq4repair_space>City" ) ) ; writer . addDocument ( doc ) ; writer . optimize ( ) ; writer . close ( ) ; IndexSearcher searcher = new IndexSearcher ( indexStore ) ; DateFilter df1 = DateFilter . After ( "datefield" , now ) ; DateFilter df2 = DateFilter . After ( "datefield" , ( now + 999999 ) ) ; Query query1 = new TermQuery ( new Term ( "body" , "NoMatchForThis" ) ) ; Query query2 = new TermQuery ( new Term ( "body" , "sunny" ) ) ; Hits result ; result = searcher . search ( query1 ) ; assertEquals ( 0 , result . length ( ) ) ; result = searcher . search ( query2 ) ; assertEquals ( 1 , result . length ( ) ) ; result = searcher . search ( query1 , df1 ) ; assertEquals ( 0 , result . length ( ) ) ; result = searcher . search ( query1 , df2 ) ; assertEquals ( 0 , result . length ( ) ) ; result = searcher . search ( query2 , df1 ) ; assertEquals ( 1 , result . length ( ) ) ; result = searcher . search ( query2 , df2 ) ; assertEquals ( 0 , result . length ( ) ) ; } }

Fix:
doc . add ( Field . Keyword ( "datefield" , DateField . timeToString ( ( now + 888888 ) ) ) ) ;
Buggy code:
public class Jar extends Zip { private static final String INDEX_NAME = "META-INF//INDEX.LIST" ; private File manifestFile ; private Manifest manifest ; private Manifest execManifest ; private boolean buildFileManifest = false ; private boolean index = false ; public Jar ( ) { } public void setWhenempty ( WhenEmpty we ) { } public void setJarfile ( File jarFile ) { } public void setIndex ( boolean flag ) { } public void addConfiguredManifest ( Manifest newManifest ) throws ManifestException { } public void setManifest ( File manifestFile ) { } public void addMetainf ( ZipFileSet fs ) { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void finalizeZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } private void createIndexList ( ZipOutputStream zOut ) throws IOException { } private void zipManifestEntry ( InputStream is ) throws IOException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } protected void zipFile ( InputStream is , ZipOutputStream zOut , String vPath , long lastModified ) throws IOException { } protected boolean isUpToDate ( FileScanner [ ] scanners , File zipFile ) throws BuildException { } protected boolean createEmptyZip ( File zipFile ) { <START_BUG> return false ; <END_BUG> } protected void cleanUp ( ) { } }

Fix:
return true ;
Buggy code:
public class SecurePackageResourceGuard extends PackageResourceGuard { private static final Logger log = LoggerFactory . getLogger ( SecurePackageResourceGuard . class ) ; private static final char PATH_SEPARATOR = '//' ; private List < SecurePackageResourceGuard . SearchPattern > pattern = new ArrayList < SecurePackageResourceGuard . SearchPattern > ( ) ; private final ConcurrentHashMap < String , Boolean > cache ; public SecurePackageResourceGuard ( ) { } public ConcurrentHashMap < String , Boolean > newCache ( ) { } public void clearCache ( ) { } @ Override protected boolean acceptAbsolutePath ( String path ) { if ( ( cache ) != null ) { Boolean rtn = cache . get ( path ) ; if ( rtn != null ) { <START_BUG> return rtn . booleanValue ( ) ; <END_BUG> } } if ( ( super . acceptAbsolutePath ( path ) ) == false ) { return false ; } boolean hit = false ; for ( SecurePackageResourceGuard . SearchPattern pattern : this . pattern ) { if ( ( pattern != null ) && ( pattern . isActive ( ) ) ) { if ( pattern . matches ( path ) ) { hit = pattern . isInclude ( ) ; } } } if ( ( cache ) != null ) { cache . put ( path , ( hit ? Boolean . TRUE : Boolean . FALSE ) ) ; } if ( hit == false ) { SecurePackageResourceGuard . log . warn ( ( "Access<seq2seq4repair_space>denied<seq2seq4repair_space>to<seq2seq4repair_space>shared<seq2seq4repair_space>(static)<seq2seq4repair_space>resource:<seq2seq4repair_space>" + path ) ) ; } return hit ; } public List < SecurePackageResourceGuard . SearchPattern > getPattern ( ) { } public void setPattern ( List < SecurePackageResourceGuard . SearchPattern > pattern ) { } public void addPattern ( String pattern ) { } public static class SearchPattern { private String pattern ; private Pattern regex ; private boolean include ; private boolean active = true ; private boolean fileOnly ; public SearchPattern ( final String pattern ) { } private Pattern convertToRegex ( final String pattern ) { } public String getPattern ( ) { } public Pattern getRegex ( ) { } public void setPattern ( String pattern ) { } public boolean matches ( String path ) { } public boolean isInclude ( ) { } public void setInclude ( boolean include ) { } public boolean isActive ( ) { } public void setActive ( boolean active ) { } @ Override public String toString ( ) { } } public static class SimpleCache extends ConcurrentHashMap < String , Boolean > { private static final long serialVersionUID = 1L ; private final ConcurrentLinkedQueue < String > fifo = new ConcurrentLinkedQueue < String > ( ) ; private final int maxSize ; public SimpleCache ( int maxSize ) { } @ Override public Boolean put ( String key , Boolean value ) { } } }

Fix:
return rtn ;
Buggy code:
public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResolver , HandlerMethodReturnValueHandler { protected Log logger = LogFactory . getLog ( this . getClass ( ) ) ; private final boolean annotationNotRequired ; public ModelAttributeMethodProcessor ( boolean annotationNotRequired ) { } public boolean supportsParameter ( MethodParameter parameter ) { } public final Object resolveArgument ( MethodParameter parameter , ModelAndViewContainer mavContainer , NativeWebRequest request , WebDataBinderFactory binderFactory ) throws Exception { } protected Object createAttribute ( String attributeName , MethodParameter parameter , WebDataBinderFactory binderFactory , NativeWebRequest request ) throws Exception { } protected void bindRequestParameters ( WebDataBinder binder , NativeWebRequest request ) { } protected void validateIfApplicable ( WebDataBinder binder , MethodParameter parameter ) { Annotation [ ] annotations = parameter . getParameterAnnotations ( ) ; for ( Annotation annot : annotations ) { <START_BUG> if ( "Valid" . equals ( annot . annotationType ( ) . getSimpleName ( ) ) ) { <END_BUG> Object hints = AnnotationUtils . getValue ( annot ) ; binder . validate ( ( hints instanceof Object [ ] ? ( ( Object [ ] ) ( hints ) ) : new Object [ ] { hints } ) ) ; } } } protected boolean isBindExceptionRequired ( WebDataBinder binder , MethodParameter parameter ) { } public boolean supportsReturnType ( MethodParameter returnType ) { } public void handleReturnValue ( Object returnValue , MethodParameter returnType , ModelAndViewContainer mavContainer , NativeWebRequest webRequest ) throws Exception { } }

Fix:
if ( annot . annotationType ( ) . getSimpleName ( ) . startsWith ( "Valid" ) ) {
Buggy code:
public final class WicketTagIdentifier extends AbstractMarkupFilter { private static List < String > wellKnownTagNames ; private final IMarkup markup ; public WicketTagIdentifier ( final IMarkup markup , final IMarkupFilter parent ) { } public MarkupElement nextTag ( ) throws ParseException { <START_BUG> XmlTag xmlTag = ( ( XmlTag ) ( getParent ( ) . nextTag ( ) ) ) ; <END_BUG> if ( xmlTag == null ) { return xmlTag ; } final String namespace = this . markup . getWicketNamespace ( ) ; ComponentTag tag ; if ( namespace . equalsIgnoreCase ( xmlTag . getNamespace ( ) ) ) { tag = new ComponentTag ( xmlTag ) ; tag . setWicketTag ( true ) ; tag . setId ( ( "_" + ( tag . getName ( ) ) ) ) ; if ( ( WicketTagIdentifier . wellKnownTagNames . contains ( xmlTag . getName ( ) ) ) == false ) { throw new ParseException ( ( ( "Unkown<seq2seq4repair_space>tag<seq2seq4repair_space>name<seq2seq4repair_space>with<seq2seq4repair_space>Wicket<seq2seq4repair_space>namespace:<seq2seq4repair_space>'" + ( xmlTag . getName ( ) ) ) + "'.<seq2seq4repair_space>Might<seq2seq4repair_space>be<seq2seq4repair_space>you<seq2seq4repair_space>haven't<seq2seq4repair_space>installed<seq2seq4repair_space>the<seq2seq4repair_space>appropriate<seq2seq4repair_space>resolver?" ) , tag . getPos ( ) ) ; } } else { tag = new ComponentTag ( xmlTag ) ; } final String value = tag . getAttributes ( ) . getString ( ( namespace + ":id" ) ) ; if ( value != null ) { if ( ( value . trim ( ) . length ( ) ) == 0 ) { throw new ParseException ( "The<seq2seq4repair_space>wicket:id<seq2seq4repair_space>attribute<seq2seq4repair_space>value<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>empty.<seq2seq4repair_space>May<seq2seq4repair_space>be<seq2seq4repair_space>unmatched<seq2seq4repair_space>quotes?!?" , tag . getPos ( ) ) ; } tag . setId ( value ) ; } return tag ; } public static final void registerWellKnownTagName ( final String name ) { } }

Fix:
final XmlTag xmlTag = ( ( XmlTag ) ( getParent ( ) . nextTag ( ) ) ) ;
Buggy code:
public class NavigationDrawerFragment extends BaseFragment implements ViewPager . OnPageChangeListener , View . OnClickListener { public static final String TAG = NavigationDrawerFragment . class . getName ( ) ; private static final int INDEX_SOUND_SHEETS = 0 ; private static final int INDEX_PLAYLIST = 1 ; private ViewPager tabContent ; private NavigationDrawerFragment . TabContentAdapter tabContentAdapter ; private SoundLayoutsList soundLayoutList ; private SoundLayoutsListAdapter soundLayoutListAdapter ; private Playlist playlist ; private PlaylistAdapter playlistAdapter ; private SoundSheets soundSheets ; private SoundSheetsAdapter soundSheetsAdapter ; private View contextualActionContainer ; private View deleteSelected ; public Playlist getPlaylist ( ) { } public SoundSheetsAdapter getSoundSheetsAdapter ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } private void initSoundLayoutsAndAdapter ( ) { } private void initSoundSheetsAndAdapter ( ) { } private void initPlayListAndAdapter ( ) { } @ Override public void onPause ( ) { } @ Override public void onClick ( View v ) { } public void onActionModeStart ( ) { this . deleteSelected . setVisibility ( VISIBLE ) ; int distance = this . contextualActionContainer . getWidth ( ) ; this . deleteSelected . setTranslationX ( ( - distance ) ) ; <START_BUG> this . deleteSelected . animate ( ) . translationX ( 0 ) . setDuration ( this . getResources ( ) . getInteger ( config_shortAnimTime ) ) . setInterpolator ( new DecelerateInterpolator ( ) ) . start ( ) ; <END_BUG> } public void onActionModeFinished ( ) { } @ Override public void onPageScrolled ( int position , float positionOffset , int positionOffsetPixels ) { } @ Override public void onPageSelected ( int position ) { } @ Override public void onPageScrollStateChanged ( int state ) { } private class TabContentAdapter extends PagerAdapter { @ Override public CharSequence getPageTitle ( int position ) { } @ Override public int getCount ( ) { } @ Override public boolean isViewFromObject ( View view , Object object ) { } @ Override public Object instantiateItem ( ViewGroup container , int position ) { } } private void adjustViewPagerToContent ( ) { } private class ViewPagerContentObserver extends RecyclerView . AdapterDataObserver { @ Override public void onChanged ( ) { } } }

Fix:
this . deleteSelected . animate ( ) . translationX ( 0 ) . setDuration ( this . getResources ( ) . getInteger ( config_mediumAnimTime ) ) . setInterpolator ( new DecelerateInterpolator ( ) ) . start ( ) ;
Buggy code:
public class FixedIterationNumberConvergenceCriterion implements ConvergenceCriterion { private final int iterationsToConvergence ; private final int averagingIterations ; private Double finalObjectiveFunctionValue = null ; public FixedIterationNumberConvergenceCriterion ( final int iterationsToConvergence , final int averagingIterations ) { } @ Override public void evaluate ( final TransitionSequence < ? > transitionSequence ) { <START_BUG> if ( ( transitionSequence . size ( ) ) < ( this . iterationsToConvergence ) ) { <END_BUG> this . finalObjectiveFunctionValue = null ; } else { final List < Double > objectiveFunctionValues = transitionSequence . getObjectiveFunctionValues ( ) ; this . finalObjectiveFunctionValue = 0.0 ; for ( int i = ( transitionSequence . size ( ) ) - ( this . averagingIterations ) ; i < ( transitionSequence . size ( ) ) ; i ++ ) { this . finalObjectiveFunctionValue += objectiveFunctionValues . get ( i ) ; } this . finalObjectiveFunctionValue //= this . averagingIterations ; } } @ Override public boolean isConverged ( ) { } @ Override public Double getFinalObjectiveFunctionValue ( ) { } @ Override public void reset ( ) { } }

Fix:
if ( ( transitionSequence . iterations ( ) ) < ( this . iterationsToConvergence ) ) {
Buggy code:
public class QualityGatesProviderTest { @ InjectMocks QualityGatesProvider qualityGatesProvider ; @ Mock QualityGateResponseParser qualityGateResponseParser ; @ Mock SonarHttpRequester sonarHttpRequester ; @ Mock JobConfigData jobConfigData ; @ Mock GlobalConfigDataForSonarInstance globalConfigDataForSonarInstance ; @ Mock SonarInstanceValidationService sonarInstanceValidationService ; @ Before public void setUp ( ) { } @ Test public void testGetAPIResultsForQualityGates ( ) throws JSONException , QGException { QualityGatesStatus qualityGatesStatus = new QualityGatesStatus ( "OK" ) ; doReturn ( "" ) . when ( globalConfigDataForSonarInstance ) . getName ( ) ; doReturn ( "" ) . when ( globalConfigDataForSonarInstance ) . getUsername ( ) ; <START_BUG> doReturn ( "" ) . when ( globalConfigDataForSonarInstance ) . getPassword ( ) ; <END_BUG> doReturn ( "" ) . when ( globalConfigDataForSonarInstance ) . getSonarUrl ( ) ; doReturn ( "" ) . when ( jobConfigData ) . getProjectKey ( ) ; doReturn ( "" ) . when ( sonarHttpRequester ) . getAPIInfo ( any ( JobConfigData . class ) , any ( GlobalConfigDataForSonarInstance . class ) ) ; doReturn ( globalConfigDataForSonarInstance ) . when ( sonarInstanceValidationService ) . validateData ( globalConfigDataForSonarInstance ) ; doReturn ( qualityGatesStatus ) . when ( qualityGateResponseParser ) . getQualityGateResultFromJSON ( anyString ( ) ) ; assertEquals ( qualityGatesStatus , qualityGatesProvider . getAPIResultsForQualityGates ( jobConfigData , globalConfigDataForSonarInstance ) ) ; } @ Test public void testGetAPIResultsForQualityGatesNotEqualStatuses ( ) throws JSONException { } No newline ; at end ; of file ; }

Fix:
doReturn ( "" ) . when ( globalConfigDataForSonarInstance ) . getPass ( ) ;
Buggy code:
public class TestFiles { private static MiniDFSCluster cluster ; private static URI clusterUri ; @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ AfterClass public static void teardownClass ( ) throws Exception { } private static MiniDFSCluster startMini ( String testName ) throws IOException { } @ Test public void testCreateDirectories ( ) throws IOException { Path rootPath = Paths . get ( TestFiles . clusterUri ) ; Path dir = rootPath . resolve ( rootPath . resolve ( "tmp//1//2//3//4//5" ) ) ; Path dir2 = Files . createDirectories ( dir ) ; assertTrue ( Files . exists ( dir2 ) ) ; <START_BUG> Files . delete ( rootPath . resolve ( "tmp" ) ) ; <END_BUG> } @ Test public void testIsReadable ( ) throws IOException { } @ Test public void testGetLastModifiedTime ( ) throws IOException { } @ Test public void testGetBasicFileAttributeView ( ) throws IOException { } @ Test public void testGetPosixFileAttributeView ( ) throws IOException { } @ Test public void testGetHadoopFileAttributeView ( ) throws IOException { } @ Test public void testGetAttributeBasic ( ) throws IOException { } @ Test public void testGetPosixView ( ) throws IOException { } }

Fix:
Files . delete ( rootPath . resolve ( "tmp//1" ) ) ;
Buggy code:
public class Logic implements GameHandler { private HashMap < UUID , Game > map ; private Card [ ] cards ; public Logic ( data [ ] cards ) { } @ Override public String createNewGame ( String playerId ) { } @ Override public GameStatus getGameStatus ( String gameId , String playerId ) { } @ Override public Card getCard ( String gameId , String playerId ) { } @ Override public Card getCardFromCompetitor ( String gameId , String playerId ) { Game game = map . get ( UUID . fromString ( gameId ) ) ; <START_BUG> if ( ! ( game . getStatus ( ) . getGameState ( ) . equals ( WaitForCommit ) ) ) { <END_BUG> throw new IllegalStateException ( ) ; } if ( UUID . fromString ( playerId ) . equals ( game . getPlayer1ID ( ) ) ) { return cards [ game . getPlayer2Card ( ) ] ; } else { return null ; } } @ Override public void makeMove ( String gameId , String playerId , int categoryID ) { } @ Override public void commitRound ( String gameId , String playerId ) { } @ Override public void commitCard ( String gameId , String playerId ) { } @ Override public void abortGame ( String gameId , String playerId ) { } private void compareCategories ( Game game , int categoryID ) { } }

Fix:
if ( ! ( game . getStatus ( ) . getGameState ( ) . equals ( WaitForCommit . toString ( ) ) ) ) {
Buggy code:
@ Service public class UserCodeServiceImpl implements UserCodeService { @ Resource private UserMapper userMapper ; @ Resource private UserCodeMapper userCodeMapper ; @ Override public boolean sendSignupAuthCode ( String mobilePhone ) throws CrudException { } @ Override public boolean sendResetPwdAuthCode ( String mobilePhone ) throws CrudException { } @ Override public boolean sendTestAuthCode ( String mobilePhone ) throws CrudException { } @ Override public String genAndSaveUserSalt ( String mobilePhone , int type ) { } private String sendAndSaveSmsCode ( String mobilePhone , int type ) throws AuthCodeSendException { } @ Override public UserCode fetchByUserName ( String mobilePhone , int type ) { } @ Override public boolean verifyAuthCode ( String mobilePhone , int type , String authCode ) throws CrudException { } @ Override public boolean sendWarningMsg ( String mobilePhone , String btyImei ) throws CrudException { boolean send = false ; int type = BTY_WARNING . getType ( ) ; UserCode userCode = fetchByUserName ( btyImei , type ) ; Date now = new Date ( ) ; if ( userCode == null ) { userCode = new UserCode ( ) ; userCode . setMobilePhone ( btyImei ) ; userCode . setCodeType ( type ) ; userCode . setDynamicCode ( mobilePhone ) ; userCode . setSendTimes ( 1 ) ; userCode . setStatus ( true ) ; userCode . setSendDate ( now ) ; userCode . setExpiryDate ( DateUtils . addMinutes ( now , EXPIRY_TIME ) ) ; userCodeMapper . insert ( userCode ) ; send = true ; } int sendTimes = ( DateUtils . isSameDay ( now , userCode . getSendDate ( ) ) ) ? ( userCode . getSendTimes ( ) ) + 1 : 1 ; <START_BUG> if ( ( now . after ( userCode . getExpiryDate ( ) ) ) || ( sendTimes <= ( SamConstants . MXA_WARNING_SEND_TIME ) ) ) { <END_BUG> userCode . setSendTimes ( ( ( userCode . getSendTimes ( ) ) + 1 ) ) ; userCode . setSendDate ( now ) ; userCode . setExpiryDate ( DateUtils . addMinutes ( now , EXPIRY_TIME ) ) ; userCodeMapper . updateByPrimaryKey ( userCode ) ; send = true ; } if ( send ) { SmsSendUtils . sendWarningMsg ( mobilePhone , btyImei ) ; } return send ; } }

Fix:
if ( ( now . after ( userCode . getExpiryDate ( ) ) ) && ( sendTimes <= ( SamConstants . MXA_WARNING_SEND_TIME ) ) ) {
Buggy code:
public final class Paths { private Paths ( ) { } public static int getRankDistance ( final Square start , final Square end ) { } public static int getFileDistance ( final Square start , final Square end ) { } public static boolean isSameDiagonal ( final Square start , final Square end ) { } public static boolean isPathClear ( final Square start , final Square end ) { } private static boolean isSameSquareOrKnightMove ( final Square start , final Square end ) { } private static boolean isPathClearSameRank ( final boolean towardKingside , final int startIndex , final int endIndex , final Square [ ] squares ) { } private static boolean isPathClearSameFile ( final boolean towardEighthRank , final int startIndex , final int endIndex , final Square [ ] squares ) { } private static boolean isPathClearSameDiagonal ( final int rankDistance , final int fileDistance , final int startIndex , final int endIndex , final Square [ ] squares ) { boolean clear = true ; int increment ; if ( ( MathUtils . signum ( rankDistance ) ) == ( MathUtils . signum ( fileDistance ) ) ) { increment = ( DefaultChessboard . NUM_FILES ) + 1 ; if ( rankDistance > 0 ) { for ( int i = startIndex + increment ; i < endIndex ; i += increment ) clear &= squares [ i ] . isEmpty ( ) ; } else { for ( int i = endIndex - increment ; i > startIndex ; i -= increment ) clear &= squares [ i ] . isEmpty ( ) ; } } else { increment = ( DefaultChessboard . NUM_FILES ) - 1 ; if ( rankDistance > 0 ) { for ( int i = startIndex + increment ; i < endIndex ; i += increment ) clear &= squares [ i ] . isEmpty ( ) ; } else { <START_BUG> for ( int i = endIndex - increment ; i > startIndex ; i -= increment ) <END_BUG> clear &= squares [ i ] . isEmpty ( ) ; } } return clear ; } private static boolean isValidPair ( final Square a , final Square b ) { } }

Fix:
for ( int i = startIndex - increment ; i > endIndex ; i -= increment )
Buggy code:
public class LuingActivity extends Activity implements SensorEventListener { private SensorManager mSensorManager ; private Sensor mAccelerometer ; private int peekCount = 0 ; private TextView totalTextView ; private LineChart mChart ; private LineData mSensorData ; private float [ ] lastSensorData = new float [ ] { 0 , 0 , 0 } ; private Calendar startTime ; private RecordType mode ; private ArrayList < String > xVals = new ArrayList < String > ( ) ; ArrayList < RecordPoint > points = new ArrayList < RecordPoint > ( ) ; Handler timerHandler = new Handler ( ) ; Runnable doRecord = new Runnable ( ) { @ Override public void run ( ) { } } ; public int getCount ( ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onStop ( ) { super . onStop ( ) ; Calendar curr = Calendar . getInstance ( ) ; try { <START_BUG> Record record = new Record ( mode , startTime , ( ( curr . getTimeInMillis ( ) ) - ( startTime . getTimeInMillis ( ) ) ) , count ) ; <END_BUG> record . getEntries ( ) . addAll ( points ) ; App . getDatabase ( ) . newRecord ( record ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } @ Override public void onAccuracyChanged ( Sensor sensor , int accuracy ) { } @ Override public void onSensorChanged ( SensorEvent event ) { } public void onStopButtonClick ( View view ) { } private void addPoint ( float x , float y ) { } }

Fix:
Record record = new Record ( mode , startTime , ( ( curr . getTimeInMillis ( ) ) - ( startTime . getTimeInMillis ( ) ) ) , getCount ( ) ) ;
Buggy code:
public class TestIndexWriterNRTIsCurrent extends LuceneTestCase { public static class ReaderHolder { volatile DirectoryReader reader ; volatile boolean stop = false ; } public void testIsCurrentWithThreads ( ) throws IOException , InterruptedException { Directory dir = newDirectory ( ) ; IndexWriterConfig conf = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; IndexWriter writer = new IndexWriter ( dir , conf ) ; TestIndexWriterNRTIsCurrent . ReaderHolder holder = new TestIndexWriterNRTIsCurrent . ReaderHolder ( ) ; TestIndexWriterNRTIsCurrent . ReaderThread [ ] threads = new TestIndexWriterNRTIsCurrent . ReaderThread [ atLeast ( 3 ) ] ; final CountDownLatch latch = new CountDownLatch ( 1 ) ; TestIndexWriterNRTIsCurrent . WriterThread writerThread = new TestIndexWriterNRTIsCurrent . WriterThread ( holder , writer , atLeast ( 500 ) , random ( ) , latch ) ; for ( int i = 0 ; i < ( threads . length ) ; i ++ ) { threads [ i ] = new TestIndexWriterNRTIsCurrent . ReaderThread ( holder , latch ) ; threads [ i ] . start ( ) ; } writerThread . start ( ) ; writerThread . join ( ) ; boolean failed = ( writerThread . failed ) != null ; if ( failed ) writerThread . failed . printStackTrace ( ) ; for ( int i = 0 ; i < ( threads . length ) ; i ++ ) { threads [ i ] . join ( ) ; if ( ( threads [ i ] . failed ) != null ) { threads [ i ] . failed . printStackTrace ( ) ; failed = true ; } } assertFalse ( failed ) ; <START_BUG> writer . close ( ) ; <END_BUG> dir . close ( ) ; } public static class WriterThread extends Thread { private final TestIndexWriterNRTIsCurrent . ReaderHolder holder ; private final IndexWriter writer ; private final int numOps ; private boolean countdown = true ; private final CountDownLatch latch ; Throwable failed ; WriterThread ( TestIndexWriterNRTIsCurrent . ReaderHolder holder , IndexWriter writer , int numOps , Random random , CountDownLatch latch ) { } @ Override public void run ( ) { } } public static final class ReaderThread extends Thread { private final TestIndexWriterNRTIsCurrent . ReaderHolder holder ; private final CountDownLatch latch ; Throwable failed ; ReaderThread ( TestIndexWriterNRTIsCurrent . ReaderHolder holder , CountDownLatch latch ) { } @ Override public void run ( ) { } } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class ReportExitCommand implements Command { public static final String EXIT = "exit" ; private static final Set < String > commands = new HashSet < String > ( ) ; public ReportExitCommand ( ) { } @ Override public Set < String > getActionNames ( ) { } @ Override public void doAction ( ActionEvent e ) { ReportActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , ReportCheckDirty . CHECK_DIRTY ) ) ; if ( ReportGuiPackage . getInstance ( ) . isDirty ( ) ) { <START_BUG> int chosenOption = JOptionPane . showConfirmDialog ( ReportGuiPackage . getInstance ( ) . getMainFrame ( ) , JMeterUtils . getResString ( "cancel_exit_to_save" ) , JMeterUtils . getResString ( "Save?" ) , JOptionPane . YES_NO_CANCEL_OPTION , JOptionPane . QUESTION_MESSAGE ) ; <END_BUG> if ( chosenOption == ( JOptionPane . NO_OPTION ) ) { System . exit ( 0 ) ; } else if ( chosenOption == ( JOptionPane . YES_OPTION ) ) { ReportActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( e . getSource ( ) , e . getID ( ) , ReportSave . SAVE_ALL_AS ) ) ; if ( ! ( ReportGuiPackage . getInstance ( ) . isDirty ( ) ) ) { System . exit ( 0 ) ; } } } else { System . exit ( 0 ) ; } } }

Fix:
int chosenOption = JOptionPane . showConfirmDialog ( ReportGuiPackage . getInstance ( ) . getMainFrame ( ) , JMeterUtils . getResString ( "cancel_exit_to_save" ) , JMeterUtils . getResString ( "save?" ) , JOptionPane . YES_NO_CANCEL_OPTION , JOptionPane . QUESTION_MESSAGE ) ;
Buggy code:
public class launcher extends Activity { Context content = null ; String tag = getClass ( ) . getSimpleName ( ) ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( board ) ; content = this ; ListView apps = ( ( ListView ) ( findViewById ( listView1 ) ) ) ; apps . setChoiceMode ( CHOICE_MODE_SINGLE ) ; <START_BUG> final String [ ] values = new String [ ] { "FM<seq2seq4repair_space>Paralxx<seq2seq4repair_space>27984" , "Volt<seq2seq4repair_space>Graph" , "Simple<seq2seq4repair_space>App" , "Switches" , "Test<seq2seq4repair_space>Cutom<seq2seq4repair_space>Controls" } ; <END_BUG> ArrayAdapter < String > adapter = new ArrayAdapter < String > ( this , layout . simple_list_item_1 , id . text1 , values ) ; apps . setAdapter ( adapter ) ; apps . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , final View v , int position , long id ) { Log . i ( tag , ( "onTouchListener:<seq2seq4repair_space>" + ( values [ position ] ) ) ) ; Intent intent = null ; switch ( position ) { case 0 : intent = new Intent ( content , FM_Activity . class ) ; break ; case 1 : intent = new Intent ( content , GraphActivity . class ) ; break ; case 2 : intent = new Intent ( content , IOIOSimpleApp . class ) ; break ; case 3 : intent = new Intent ( content , MainActivity . class ) ; break ; case 4 : intent = new Intent ( content , TestCustomControlsActivity . class ) ; } startActivity ( intent ) ; } } ) ; } }

Fix:
final String [ ] values = new String [ ] { "FM<seq2seq4repair_space>Paralxx<seq2seq4repair_space>27984" , "Volt<seq2seq4repair_space>Graph" , "Simple<seq2seq4repair_space>App" , "Switches" , "Test<seq2seq4repair_space>Custom<seq2seq4repair_space>Controls" } ;
Buggy code:
public class PreviousResults { private final String testClass ; private final String testName ; private Map < String , PermutationResult > results = new HashMap < > ( ) ; public PreviousResults ( String testClass , String testName ) { } public String getTestClass ( ) { } public String getTestName ( ) { } public void addResult ( PermutationResult result ) { } public List < PermutationResult > getResults ( ) { } public PermutationResult getResult ( String key ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return results . get ( key ) ;
Buggy code:
public class DigitalClockCustom extends TextView { Calendar calendar ; private Runnable ticker ; private Handler handler ; private boolean tickerStopped = false ; private boolean is24h ; private Context mContext ; public DigitalClockCustom ( Context context ) { } public DigitalClockCustom ( Context context , AttributeSet attrs ) { } private void initClock ( Context context ) { } @ Override protected void onAttachedToWindow ( ) { tickerStopped = false ; super . onAttachedToWindow ( ) ; handler = new Handler ( ) ; ticker = new Runnable ( ) { public void run ( ) { if ( tickerStopped ) return ; calendar . setTimeInMillis ( System . currentTimeMillis ( ) ) ; int hour = calendar . get ( Calendar . HOUR_OF_DAY ) ; int minute = calendar . get ( Calendar . MINUTE ) ; Typeface face = Typeface . createFromAsset ( mContext . getAssets ( ) , "fonts//clock.ttf" ) ; setTypeface ( face ) ; String timeText ; if ( is24h ) { setText ( String . format ( "%02d:%02d" , hour , minute ) ) ; } else { final Boolean isPM = hour > 12 ; if ( hour == 0 ) hour = 12 ; final String format12H = String . format ( "%02d:%02d" , ( isPM ? hour - 12 : hour ) , minute ) ; final String amPm = ( isPM ) ? mContext . getString ( pm ) : mContext . getString ( am ) ; int n = format12H . length ( ) ; int m = amPm . length ( ) ; Spannable span = new SpannableString ( ( ( format12H + "<seq2seq4repair_space>" ) + amPm ) ) ; span . setSpan ( new RelativeSizeSpan ( 1.0F ) , 0 , n , SPAN_EXCLUSIVE_EXCLUSIVE ) ; span . setSpan ( new RelativeSizeSpan ( 0.5F ) , n , ( ( n + m ) + 1 ) , SPAN_EXCLUSIVE_EXCLUSIVE ) ; if ( ( mContext ) != null ) setText ( span ) ; else setText ( String . format ( "%02d:%02d" , hour , minute ) ) ; } invalidate ( ) ; long now = SystemClock . uptimeMillis ( ) ; <START_BUG> long next = now + ( 60000 - ( now % 60000 ) ) ; <END_BUG> handler . postAtTime ( ticker , next ) ; } } ; ticker . run ( ) ; } @ Override protected void onDetachedFromWindow ( ) { } public void set24Hmode ( Boolean enable ) { } }

Fix:
long next = now + ( 2000 - ( now % 2000 ) ) ;
Buggy code:
public abstract class TypeReference extends Expression { public TypeReference ( ) { } public void aboutToResolve ( Scope scope ) { } public static final TypeReference baseTypeReference ( int baseType , int dim ) { } public abstract TypeReference copyDims ( int dim ) { } public int dimensions ( ) { } public abstract TypeBinding getTypeBinding ( Scope scope ) { } public abstract char [ ] [ ] getTypeName ( ) { } public boolean isTypeReference ( ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ( this . resolvedType ) != null ) { if ( ! ( this . resolvedType . isValidBinding ( ) ) ) return null ; } else { this . resolvedType = getTypeBinding ( scope ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { scope . problemReporter ( ) . invalidType ( this , this . resolvedType ) ; return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) scope . problemReporter ( ) . deprecatedType ( this . resolvedType , this ) ; } <START_BUG> return this . resolvedType = this . resolvedType ; <END_BUG> } public abstract void traverse ( IAbstractSyntaxTreeVisitor visitor , ClassScope classScope ) { } }

Fix:
return this . resolvedType ;
Buggy code:
public class ToolBar extends Composite { int drawCount ; int itemCount ; ToolItem [ ] items ; ToolItem lastFocus ; public ToolBar ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( int index ) { } void createItem ( ToolItem item , int index ) { } void createWidget ( int index ) { } void destroyItem ( ToolItem item ) { } public boolean forceFocus ( ) { } public ToolItem getItem ( int index ) { } public ToolItem getItem ( Point pt ) { } public int getItemCount ( ) { } public ToolItem [ ] getItems ( ) { } public int getRowCount ( ) { } public int indexOf ( ToolItem item ) { } int [ ] layoutHorizontal ( int width , int height , boolean resize ) { } int [ ] layoutVertical ( int width , int height , boolean resize ) { } int [ ] layout ( int nWidth , int nHeight , boolean resize ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void propagateWidget ( boolean enabled ) { } void relayout ( ) { } void releaseChildren ( boolean destroy ) { if ( ( items ) != null ) { for ( int i = 0 ; i < ( itemCount ) ; i ++ ) { ToolItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } items = null ; } super . releaseChildren ( destroy ) ; } void removeControl ( Control control ) { } void setBackgroundPixel ( int pixel ) { } boolean setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } public void setFont ( Font font ) { } void setForegroundPixel ( int pixel ) { } public void setRedraw ( boolean redraw ) { } boolean setTabItemFocus ( boolean next ) { } int traversalCode ( int key , XKeyEvent xEvent ) { } int xFocusIn ( XFocusChangeEvent xEvent ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public class JoinCondition implements QueryCondition { private final JoinType joinType ; private final Class < ? extends ModelWithId > model ; private final ModelField modelField1 ; private final ModelField modelField2 ; public JoinCondition ( JoinType joinType , Class < ? extends ModelWithId > model , ModelField modelField1 , ModelField modelField2 ) { } @ Override public String getSqlStatement ( ) { <START_BUG> String tableName = Utility . getTableNameFromModel ( model ) ; <END_BUG> return ( ( ( ( ( ( joinType . getSqlKeyword ( ) ) + "<seq2seq4repair_space>" ) + tableName ) + "<seq2seq4repair_space>ON<seq2seq4repair_space>" ) + ( modelField1 . getSqlKeyword ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( modelField2 . getSqlKeyword ( ) ) ; } }

Fix:
String tableName = Utility . getTableName ( model ) ;
Buggy code:
public class TreeLopper extends SpongeMechanic { @ Subscribe public void onBlockBreak ( PlayerBreakBlockEvent event ) { if ( ( ( event . getBlock ( ) . getType ( ) ) == ( BlockTypes . LOG ) ) || ( ( event . getBlock ( ) . getType ( ) ) == ( BlockTypes . LOG2 ) ) ) { <START_BUG> checkBlocks ( event . getBlock ( ) , event . getEntity ( ) , event . getBlock ( ) . getState ( ) . getManipulator ( TreeData . class ) . get ( ) . getValue ( ) , new ArrayList < Location > ( ) ) ; <END_BUG> } } public void checkBlocks ( Location block , Player player , TreeType type , List < Location > traversed ) { } }

Fix:
checkBlocks ( event . getBlock ( ) , event . getEntity ( ) , event . getBlock ( ) . getData ( TreeData . class ) . get ( ) . getValue ( ) , new ArrayList < Location > ( ) ) ;
Buggy code:
public class ACommand implements CommandExecutor { private Match match ; public ACommand ( ) { } public boolean onCommand ( CommandSender sender , Command cmd , String label , String [ ] args ) { if ( sender instanceof Player ) { Player player = ( ( Player ) ( sender ) ) ; if ( cmd . getName ( ) . equalsIgnoreCase ( "a" ) ) { Channel channel = ChannelUtils . getChannel ( player ) ; if ( ( player . isOp ( ) ) || ( player . hasPermission ( "channel.admin.join" ) ) ) { ChannelChangeEvent event = new ChannelChangeEvent ( player , channel , ChannelUtils . getAdminChannel ( ) ) ; this . match . getPluginManager ( ) . callEvent ( event ) ; } else { <START_BUG> player . sendMessage ( ( ( RED ) + "You<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>op<seq2seq4repair_space>in<seq2seq4repair_space>order<seq2seq4repair_space>to<seq2seq4repair_space>join<seq2seq4repair_space>the<seq2seq4repair_space>" ) ) ; <END_BUG> } } } else { sender . sendMessage ( ( ( RED ) + "You<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>player<seq2seq4repair_space>to<seq2seq4repair_space>join<seq2seq4repair_space>the<seq2seq4repair_space>admin<seq2seq4repair_space>channel" ) ) ; } return false ; } }

Fix:
player . sendMessage ( ( ( ( RED ) + "You<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>op<seq2seq4repair_space>in<seq2seq4repair_space>order<seq2seq4repair_space>to<seq2seq4repair_space>join<seq2seq4repair_space>the<seq2seq4repair_space>" ) + ( ChannelUtils . getAdminChannel ( ) . getName ( ) ) ) ) ;
Buggy code:
public class MultiEditorPane extends JPanel implements MouseListener , ChangeListener , QuadrantPanel { protected static Category cat = Category . getInstance ( MultiEditorPane . class ) ; protected Object _target ; protected JTabbedPane _tabs = new JTabbedPane ( JTabbedPane . BOTTOM ) ; protected Editor _ed ; protected Vector _tabPanels = new Vector ( ) ; protected Component _lastTab ; public MultiEditorPane ( ) { } public Dimension getPreferredSize ( ) { } public Dimension getMinimumSize ( ) { } public void setTarget ( Object target ) { if ( ( _target ) == target ) return ; int nextTab = - 1 ; int currentTab = _tabs . getSelectedIndex ( ) ; int tabCount = _tabs . getTabCount ( ) ; _target = target ; for ( int i = 0 ; i < tabCount ; i ++ ) { Component tab = _tabs . getComponentAt ( i ) ; if ( tab instanceof TabModelTarget ) { TabModelTarget tabMT = ( ( TabModelTarget ) ( tab ) ) ; tabMT . setTarget ( _target ) ; <START_BUG> boolean shouldEnable = tabMT . shouldBeEnabled ( ) ; <END_BUG> _tabs . setEnabledAt ( i , shouldEnable ) ; if ( shouldEnable && ( ( nextTab == ( - 1 ) ) || ( i == currentTab ) ) ) nextTab = i ; } } if ( target != null ) select ( target ) ; } public Object getTarget ( ) { } public int getIndexOfNamedTab ( String tabName ) { } public void selectTabNamed ( String tabName ) { } public void selectNextTab ( ) { } public void select ( Object o ) { } public void stateChanged ( ChangeEvent e ) { } public void mousePressed ( MouseEvent me ) { } public void mouseReleased ( MouseEvent me ) { } public void mouseEntered ( MouseEvent me ) { } public void mouseExited ( MouseEvent me ) { } public void mouseClicked ( MouseEvent me ) { } public void mySingleClick ( int tab ) { } public void myDoubleClick ( int tab ) { } public void addNavigationListener ( NavigationListener navListener ) { } public void removeNavigationListener ( NavigationListener navListener ) { } public int getQuadrant ( ) { } public void removePresentationFor ( Object obj , Vector diagrams ) { } public List findPresentationsFor ( Object o , Vector diagrams ) { } }

Fix:
boolean shouldEnable = tabMT . shouldBeEnabled ( _target ) ;
Buggy code:
public class MappingRepositoryValue extends PluginValue { public MappingRepositoryValue ( String prop ) { } public Object newInstance ( String clsName , Class type , Configuration conf , boolean fatal ) { try { <START_BUG> Class cls = Strings . toClass ( clsName , ( ( ClassLoader ) ( AccessController . doPrivileged ( J2DoPrivHelper . getClassLoaderAction ( type ) ) ) ) ) ; <END_BUG> return cls . getConstructor ( new Class [ ] { JDBCConfiguration . class } ) . newInstance ( new Object [ ] { conf } ) ; } catch ( RuntimeException e ) { throw e ; } catch ( InvocationTargetException e ) { if ( ( e . getTargetException ( ) ) instanceof RuntimeException ) throw ( ( RuntimeException ) ( e . getTargetException ( ) ) ) ; return super . newInstance ( clsName , type , conf , fatal ) ; } catch ( Exception e ) { return super . newInstance ( clsName , type , conf , fatal ) ; } } }

Fix:
Class cls = Strings . toClass ( clsName , AccessController . doPrivileged ( J2DoPrivHelper . getClassLoaderAction ( type ) ) ) ;