nus-yam/ex-repair huggingface dataset:
Buggy code:
@ Slow public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase { private static final Integer RUN_LENGTH = Integer . parseInt ( System . getProperty ( "solr.tests.cloud.cm.runlength" , "-1" ) ) ; @ BeforeClass public static void beforeSuperClass ( ) { } @ AfterClass public static void afterSuperClass ( ) { } @ Before @ Override public void setUp ( ) throws Exception { } @ Override @ After public void tearDown ( ) throws Exception { } public ChaosMonkeySafeLeaderTest ( ) { } @ Override public void doTest ( ) throws Exception { handle . clear ( ) ; handle . put ( "QTime" , SKIPVAL ) ; handle . put ( "timestamp" , SKIPVAL ) ; randomlyEnableAutoSoftCommit ( ) ; del ( "*:*" ) ; List < StopableIndexingThread > threads = new ArrayList < StopableIndexingThread > ( ) ; int threadCount = 2 ; for ( int i = 0 ; i < threadCount ; i ++ ) { StopableIndexingThread indexThread = new StopableIndexingThread ( ( 10000 + ( i * 50000 ) ) , true ) ; threads . add ( indexThread ) ; indexThread . start ( ) ; } chaosMonkey . startTheMonkey ( false , 500 ) ; long runLength ; if ( ( ChaosMonkeySafeLeaderTest . RUN_LENGTH ) != ( - 1 ) ) { runLength = ChaosMonkeySafeLeaderTest . RUN_LENGTH ; } else { <START_BUG> int [ ] runTimes = new int [ ] { 5000 , 6000 , 10000 , 15000 , 15000 , 30000 , 30000 , 45000 , 90000 , 120000 } ; <END_BUG> runLength = runTimes [ random ( ) . nextInt ( ( ( runTimes . length ) - 1 ) ) ] ; } try { Thread . sleep ( runLength ) ; } finally { chaosMonkey . stopTheMonkey ( ) ; } for ( StopableIndexingThread indexThread : threads ) { indexThread . safeStop ( ) ; } for ( StopableIndexingThread indexThread : threads ) { indexThread . join ( ) ; } for ( StopableIndexingThread indexThread : threads ) { assertEquals ( 0 , indexThread . getFails ( ) ) ; } Thread . sleep ( 2000 ) ; waitForThingsToLevelOut ( 180000 ) ; checkShardConsistency ( true , true ) ; if ( VERBOSE ) System . out . println ( ( ( "control<seq2seq4repair_space>docs:" + ( controlClient . query ( new SolrQuery ( "*:*" ) ) . getResults ( ) . getNumFound ( ) ) ) + "\n\n" ) ) ; if ( random ( ) . nextBoolean ( ) ) { zkServer . shutdown ( ) ; zkServer = new ZkTestServer ( zkServer . getZkDir ( ) , zkServer . getPort ( ) ) ; zkServer . run ( ) ; } CloudSolrServer client = createCloudClient ( "collection1" ) ; try { createCollection ( null , "testcollection" , 1 , 1 , 1 , client , null , "conf1" ) ; } finally { client . shutdown ( ) ; } List < Integer > numShardsNumReplicas = new ArrayList < Integer > ( 2 ) ; numShardsNumReplicas . add ( 1 ) ; numShardsNumReplicas . add ( 1 ) ; checkForCollection ( "testcollection" , numShardsNumReplicas , null ) ; } private void randomlyEnableAutoSoftCommit ( ) { } @ Override protected void indexr ( Object ... fields ) throws Exception { } }

Fix:
int [ ] runTimes = new int [ ] { 5000 , 6000 , 10000 , 25000 , 27000 , 30000 , 30000 , 45000 , 90000 , 120000 } ;
Buggy code:
public class SpellCheckComponentTest extends SolrTestCaseJ4 { static String rh = "spellCheckCompRH" ; @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Test public void testExtendedResultsCount ( ) throws Exception { assertJQ ( req ( "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , SPELLCHECK_BUILD , "true" , "q" , "bluo" , SPELLCHECK_COUNT , "5" , SPELLCHECK_EXTENDED_RESULTS , "false" ) , "//spellcheck//suggestions//[0]=='bluo'" , "//spellcheck//suggestions//[1]//numFound==5" ) ; <START_BUG> assertJQ ( req ( "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , "q" , "bluo" , SPELLCHECK_COUNT , "3" , SPELLCHECK_EXTENDED_RESULTS , "true" ) , "//spellcheck//suggestions//[1]//suggestion==[{'word':'blue','freq':1},<seq2seq4repair_space>{'word':'blud','freq':1},<seq2seq4repair_space>{'word':'boue','freq':1}]" ) ; <END_BUG> } @ Test public void test ( ) throws Exception { } @ Test public void testPerDictionary ( ) throws Exception { } @ Test public void testCollate ( ) throws Exception { } @ Test public void testCorrectSpelling ( ) throws Exception { } @ SuppressWarnings ( "unchecked" ) @ Test public void testRelativeIndexDirLocation ( ) throws Exception { } @ Test public void testReloadOnStart ( ) throws Exception { } @ SuppressWarnings ( "unchecked" ) @ Test public void testRebuildOnCommit ( ) throws Exception { } }

Fix:
assertJQ ( req ( "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , "q" , "bluo" , SPELLCHECK_COUNT , "3" , SPELLCHECK_EXTENDED_RESULTS , "true" ) , "//spellcheck//suggestions//[1]//suggestion==[{'word':'blud','freq':1},<seq2seq4repair_space>{'word':'blue','freq':1},<seq2seq4repair_space>{'word':'blee','freq':1}]" ) ;
Buggy code:
class BasicResourceReferenceMapper extends AbstractResourceReferenceMapper { private static final String TIMESTAMP_PREFIX = "-ts" ; private final IPageParametersEncoder pageParametersEncoder ; private final IProvider < Boolean > timestamps ; public BasicResourceReferenceMapper ( IPageParametersEncoder pageParametersEncoder , IProvider < Boolean > timestamps ) { } public IRequestHandler mapRequest ( Request request ) { } private boolean isTimestampsEnabled ( ) { } private String stripTimestampFromResourceName ( final String resourceName ) { } protected Class < ? > resolveClass ( String name ) { } protected String getClassName ( Class < ? > scope ) { } public Url mapHandler ( IRequestHandler requestHandler ) { if ( requestHandler instanceof ResourceReferenceRequestHandler ) { ResourceReferenceRequestHandler referenceRequestHandler = ( ( ResourceReferenceRequestHandler ) ( requestHandler ) ) ; ResourceReference reference = referenceRequestHandler . getResourceReference ( ) ; Url url = new Url ( ) ; List < String > segments = url . getSegments ( ) ; segments . add ( getContext ( ) . getNamespace ( ) ) ; segments . add ( getContext ( ) . getResourceIdentifier ( ) ) ; segments . add ( getClassName ( reference . getScope ( ) ) ) ; StringTokenizer tokens = new StringTokenizer ( reference . getName ( ) , "//" ) ; while ( tokens . hasMoreTokens ( ) ) { String token = tokens . nextToken ( ) ; if ( ( isTimestampsEnabled ( ) ) && ( ( tokens . hasMoreTokens ( ) ) == false ) ) { Time lastModified = reference . getLastModified ( ) ; if ( lastModified != null ) { int extensionAt = token . lastIndexOf ( '.' ) ; StringBuilder filename = new StringBuilder ( ) ; filename . append ( ( extensionAt == ( - 1 ) ? token : token . substring ( 0 , extensionAt ) ) ) ; filename . append ( BasicResourceReferenceMapper . TIMESTAMP_PREFIX ) ; filename . append ( lastModified . getMilliseconds ( ) ) ; if ( extensionAt != ( - 1 ) ) filename . append ( token . substring ( extensionAt ) ) ; token = filename . toString ( ) ; } } segments . add ( token ) ; } encodeResourceReferenceAttributes ( url , reference ) ; PageParameters parameters = referenceRequestHandler . getPageParameters ( ) ; if ( parameters != null ) { parameters = new PageParameters ( parameters ) ; <START_BUG> parameters . clearIndexedParameters ( ) ; <END_BUG> url = encodePageParameters ( url , parameters , pageParametersEncoder ) ; } return url ; } return null ; } public int getCompatibilityScore ( Request request ) { } }

Fix:
parameters . clearIndexed ( ) ;
Buggy code:
class Deck { public LinkedList < Card > deck ; public Deck ( ) { } public void printDeck ( ) { } public Card dealCard ( ) { <START_BUG> return this . deck . getFirst ( ) ; <END_BUG> } public void shuffle ( ) { } public void reset ( ) { } }

Fix:
return this . deck . removeFirst ( ) ;
Buggy code:
public final class ChainReaderHelper { public Reader primaryReader ; public int bufferSize = 8192 ; public Vector filterChains = new Vector ( ) ; private Project project = null ; public final void setPrimaryReader ( Reader rdr ) { } public final void setProject ( final Project project ) { } public final Project getProject ( ) { } public final void setBufferSize ( int size ) { } public final void setFilterChains ( Vector fchain ) { } public final Reader getAssembledReader ( ) throws BuildException { } private void setProjectOnObject ( Object obj ) { if ( ( project ) == null ) return ; if ( obj instanceof BaseFilterReader ) { ( ( BaseFilterReader ) ( obj ) ) . setProject ( project ) ; return ; } <START_BUG> Project . setProjectOnObject ( project , obj ) ; <END_BUG> } public final String readFully ( Reader rdr ) throws IOException { } }

Fix:
project . setProjectReference ( obj ) ;
Buggy code:
public class MechanicListenerAdapter implements Listener { Set < String > signClickTimer = new HashSet < String > ( ) ; @ EventHandler ( priority = EventPriority . HIGH ) public void onPlayerInteract ( final PlayerInteractEvent event ) { if ( ! ( EventUtil . passesFilter ( event ) ) ) return ; Block block = null ; Action action = null ; if ( ( event . getAction ( ) ) == ( Action . RIGHT_CLICK_AIR ) ) { try { <START_BUG> block = event . getPlayer ( ) . getTargetBlock ( null , 5 ) ; <END_BUG> if ( ( block != null ) && ( ( block . getType ( ) ) != ( Material . AIR ) ) ) action = Action . RIGHT_CLICK_BLOCK ; else action = Action . RIGHT_CLICK_AIR ; } catch ( Exception e ) { } } else { block = event . getClickedBlock ( ) ; action = event . getAction ( ) ; } if ( ( block != null ) && ( SignUtil . isSign ( block ) ) ) { if ( ( CraftBookPlugin . inst ( ) . getConfiguration ( ) . signClickTimeout ) > 0 ) { if ( signClickTimer . contains ( event . getPlayer ( ) . getName ( ) ) ) { return ; } else { signClickTimer . add ( event . getPlayer ( ) . getName ( ) ) ; Bukkit . getScheduler ( ) . runTaskLater ( CraftBookPlugin . inst ( ) , new Runnable ( ) { @ Override public void run ( ) { signClickTimer . remove ( event . getPlayer ( ) . getName ( ) ) ; } } , CraftBookPlugin . inst ( ) . getConfiguration ( ) . signClickTimeout ) ; } } SignClickEvent ev = new SignClickEvent ( event . getPlayer ( ) , action , event . getItem ( ) , block , event . getBlockFace ( ) ) ; CraftBookPlugin . inst ( ) . getServer ( ) . getPluginManager ( ) . callEvent ( ev ) ; if ( ev . isCancelled ( ) ) event . setCancelled ( true ) ; } } @ EventHandler ( priority = EventPriority . HIGH ) public void onBlockBreak ( BlockBreakEvent event ) { } @ EventHandler ( priority = EventPriority . HIGH ) public void onBlockPlace ( BlockPlaceEvent event ) { } public void checkBlockChange ( Player player , Block block , boolean build ) { } @ EventHandler ( priority = EventPriority . HIGH ) public void onBlockRedstoneChange ( BlockRedstoneEvent event ) { } public void handleRedstoneForBlock ( Block block , int oldLevel , int newLevel ) { } protected void handleDirectWireInput ( WorldVector pt , Block sourceBlock , int oldLevel , int newLevel ) { } @ EventHandler ( priority = EventPriority . HIGH ) public void onVehicleMove ( VehicleMoveEvent event ) { } @ EventHandler ( priority = EventPriority . HIGH ) public void onVehicleEnter ( VehicleEnterEvent event ) { } @ EventHandler ( priority = EventPriority . HIGH ) public void onChunkLoad ( final ChunkLoadEvent event ) { } @ EventHandler ( priority = EventPriority . HIGH ) public void onChunkUnload ( ChunkUnloadEvent event ) { } No newline ; at end ; of file ; }

Fix:
block = event . getPlayer ( ) . getTargetBlock ( ( ( Set < Material > ) ( null ) ) , 5 ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class EjbLocalRefInjectionTestCase { @ Deployment public static WebArchive deployment ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "war-example.war" ) ; war . addPackage ( HttpRequest . class . getPackage ( ) ) ; war . addClasses ( EjbLocalRefInjectionTestCase . class , EjbLocalRefInjectionServlet . class , NamedSLSB . class , SimpleSLSB . class , Hello . class ) ; <START_BUG> war . addAsWebResource ( EjbLocalRefInjectionTestCase . getWebXml ( ) , "web.xml" ) ; <END_BUG> return war ; } private static String performCall ( String urlPattern ) throws Exception { } @ Test public void testLookup ( ) throws Exception { } @ Test public void testEjbLink ( ) throws Exception { } private static StringAsset getWebXml ( ) { } }

Fix:
war . addAsWebInfResource ( EjbLocalRefInjectionTestCase . getWebXml ( ) , "web.xml" ) ;
Buggy code:
public class DynamicTask extends Task implements DynamicConfigurator { public void execute ( ) { } public void setDynamicAttribute ( String name , String value ) { <START_BUG> project . setNewProperty ( name , value ) ; <END_BUG> } public Object createDynamicElement ( String name ) { } public class Sub implements DynamicConfigurator { public void setDynamicAttribute ( String name , String value ) { getProject ( ) . setNewProperty ( name , value ) ; } public Object createDynamicElement ( String name ) { } } }

Fix:
getProject ( ) . setNewProperty ( name , value ) ;
Buggy code:
public class ProtobufExecutionEncoder extends LifecycleComponent implements ICommandExecutionEncoder < byte [ ] > { private static Logger LOGGER = Logger . getLogger ( ProtobufExecutionEncoder . class ) ; public ProtobufExecutionEncoder ( ) { } @ Override public byte [ ] encode ( IDeviceCommandExecution execution , IDeviceNestingContext nested , IDeviceAssignment assignment ) throws SiteWhereException { } @ Override public byte [ ] encodeSystemCommand ( ISystemCommand command , IDeviceNestingContext nested , IDeviceAssignment assignment ) throws SiteWhereException { switch ( command . getType ( ) ) { case RegistrationAck : { IRegistrationAckCommand ack = ( ( IRegistrationAckCommand ) ( command ) ) ; RegistrationAck . Builder builder = RegistrationAck . newBuilder ( ) ; switch ( ack . getReason ( ) ) { case AlreadyRegistered : { builder . setState ( ALREADY_REGISTERED ) ; break ; } case NewRegistration : { builder . setState ( NEW_REGISTRATION ) ; break ; } } return encodeRegistrationAck ( builder . build ( ) ) ; } case RegistrationFailure : { IRegistrationFailureCommand fail = ( ( IRegistrationFailureCommand ) ( command ) ) ; RegistrationAck . Builder builder = RegistrationAck . newBuilder ( ) ; builder . setState ( REGISTRATION_ERROR ) ; builder . setErrorMessage ( fail . getErrorMessage ( ) ) ; switch ( fail . getReason ( ) ) { case NewDevicesNotAllowed : { builder . setErrorType ( NEW_DEVICES_NOT_ALLOWED ) ; break ; } case InvalidSpecificationToken : { builder . setErrorType ( INVALID_SPECIFICATION ) ; break ; } case SiteTokenRequired : { builder . setErrorType ( SITE_TOKEN_REQUIRED ) ; break ; } } return encodeRegistrationAck ( builder . build ( ) ) ; } case DeviceStreamAck : { IDeviceStreamAckCommand ack = ( ( IDeviceStreamAckCommand ) ( command ) ) ; DeviceStreamAck . Builder builder = DeviceStreamAck . newBuilder ( ) ; switch ( ack . getStatus ( ) ) { case DeviceStreamCreated : { builder . setState ( STREAM_CREATED ) ; break ; } case DeviceStreamExists : { builder . setState ( STREAM_EXISTS ) ; break ; } case DeviceStreamFailed : { builder . setState ( STREAM_FAILED ) ; break ; } } <START_BUG> break ; <END_BUG> } } throw new SiteWhereException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>encode<seq2seq4repair_space>command:<seq2seq4repair_space>" + ( command . getClass ( ) . getName ( ) ) ) ) ; } protected byte [ ] encodeRegistrationAck ( RegistrationAck ack ) throws SiteWhereException { } protected byte [ ] encodeDeviceStreamAck ( DeviceStreamAck ack ) throws SiteWhereException { } @ Override public void start ( ) throws SiteWhereException { } @ Override public Logger getLogger ( ) { } @ Override public void stop ( ) throws SiteWhereException { } No newline ; at end ; of file ; }

Fix:
return encodeDeviceStreamAck ( builder . build ( ) ) ;
Buggy code:
public class OpenWithAttachmentCommand extends FolderCommand { MimePart part ; File tempFile ; public OpenWithAttachmentCommand ( DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( Worker worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; Folder folder = ( ( Folder ) ( r [ 0 ] . getFolder ( ) ) ) ; Object [ ] uids = r [ 0 ] . getUids ( ) ; Integer [ ] address = r [ 0 ] . getAddress ( ) ; part = folder . getMimePart ( uids [ 0 ] , address , worker ) ; Decoder decoder ; MimeHeader header ; tempFile = null ; header = part . getHeader ( ) ; if ( ! ( part . getHeader ( ) . getContentType ( ) . equals ( "message" ) ) ) { try { String filename = part . getHeader ( ) . getFileName ( ) ; if ( filename != null ) { tempFile = TempFileStore . createTempFile ( filename ) ; } else tempFile = TempFileStore . createTempFile ( ) ; decoder = CoderRouter . getDecoder ( header . contentTransferEncoding ) ; <START_BUG> decoder . decode ( new ByteArrayInputStream ( part . getBody ( ) . getBytes ( "US-ASCII" ) ) , new FileOutputStream ( tempFile ) ) ; <END_BUG> } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } }

Fix:
decoder . decode ( new ByteArrayInputStream ( part . getBody ( ) . getBytes ( "ISO_8859_1" ) ) , new FileOutputStream ( tempFile ) ) ;
Buggy code:
public class VoteController extends Controller { private User currentUser ; private Project currentProject ; public Project getCurrentProject ( ) { } public void setCurrentProject ( Project project ) { } public User getCurrentUser ( ) { } public void setCurrentUser ( User user ) { } public static Result manageVote ( ) { User user = find . byId ( ( ( long ) ( 1 ) ) ) ; Project project = Project . find . byId ( ( ( long ) ( 1 ) ) ) ; List < VoteCategory > voteCategories = VoteCategory . find . all ( ) ; Vote vote ; for ( int i = 0 ; i < ( voteCategories . size ( ) ) ; i ++ ) { vote = new Vote ( ) ; vote . category = voteCategories . get ( i ) ; vote . score = 1 ; vote . user = user ; vote . project = project ; vote . save ( ) ; } <START_BUG> return redirect ( Application . index ( ) ) ; <END_BUG> } public static Result vote ( ) { } public static Result result ( ) { } }

Fix:
return redirect ( routes . VoteController . result ( ) ) ;
Buggy code:
public class ClutchImageEngine < O extends IEntity , D extends DescriptorExtractor > extends ClutchAbstractEngine < O , D > { public ClutchImageEngine ( String descriptor ) throws IllegalAccessException , InstantiationException , NoSuchMethodException , InvocationTargetException { } public ClutchImageEngine ( ) throws IllegalAccessException , InstantiationException , NoSuchMethodException , InvocationTargetException { } public void setEngine ( ) throws IllegalAccessException , InstantiationException , NoSuchMethodException , InvocationTargetException { } @ Override protected Result < O > getResultObject ( Result < IEntry > entryResult ) { } public ImageModelLoader getLoader ( ) { } public void setLoader ( ImageModelLoader loader ) { } public Class getModelClass ( ) { } public void setModelClass ( Class model ) { } @ Override public String getType ( ) { } @ Override public void setType ( String type ) { } public void closeIndex ( ) throws IOException { <START_BUG> index . close ( ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
this . index . close ( ) ;
Buggy code:
class PromptService { XPCOMObject supports ; XPCOMObject promptService ; int refCount = 0 ; public PromptService ( ) { } int AddRef ( ) { } void createCOMInterfaces ( ) { } void disposeCOMInterfaces ( ) { } int getAddress ( ) { } int queryInterface ( int riid , int ppvObject ) { } int Release ( ) { } Browser getBrowser ( int aDOMWindow ) { } String getLabel ( int buttonFlag , int index , int buttonTitle ) { } public int Alert ( int parent , int dialogTitle , int text ) { Browser browser = getBrowser ( parent ) ; int length = XPCOM . strlen_PRUnichar ( dialogTitle ) ; char [ ] dest = new char [ length ] ; XPCOM . memmove ( dest , dialogTitle , ( length * 2 ) ) ; String titleLabel = new String ( dest ) ; length = XPCOM . strlen_PRUnichar ( text ) ; dest = new char [ length ] ; XPCOM . memmove ( dest , text , ( length * 2 ) ) ; String textLabel = new String ( dest ) ; <START_BUG> MessageBox messageBox = new MessageBox ( browser . getShell ( ) , SWT . OK ) ; <END_BUG> messageBox . setText ( titleLabel ) ; messageBox . setMessage ( textLabel ) ; messageBox . open ( ) ; return XPCOM . NS_OK ; } public int AlertCheck ( int parent , int dialogTitle , int text , int checkMsg , int checkValue ) { } public int Confirm ( int parent , int dialogTitle , int text , int _retval ) { } public int ConfirmCheck ( int parent , int dialogTitle , int text , int checkMsg , int checkValue , int _retval ) { } public int ConfirmEx ( int parent , int dialogTitle , int text , int buttonFlags , int button0Title , int button1Title , int button2Title , int checkMsg , int checkValue , int _retval ) { } public int Prompt ( int parent , int dialogTitle , int text , int value , int checkMsg , int checkValue , int _retval ) { } public int PromptUsernameAndPassword ( int parent , int dialogTitle , int text , int username , int password , int checkMsg , int checkValue , int _retval ) { } public int PromptPassword ( int parent , int dialogTitle , int text , int password , int checkMsg , int checkValue , int _retval ) { } public int Select ( int parent , int dialogTitle , int text , int count , int selectList , int outSelection , int _retval ) { } }

Fix:
MessageBox messageBox = new MessageBox ( browser . getShell ( ) , ( ( SWT . OK ) | ( SWT . ICON_WARNING ) ) ) ;
Buggy code:
public class StreamUtil { public static void finishStreamRequest ( Message msg , InetAddress to ) { byte [ ] body = msg . getMessageBody ( ) ; ByteArrayInputStream bufIn = new ByteArrayInputStream ( body ) ; try { <START_BUG> StreamRequestMessage srm = StreamRequestMessage . serializer ( ) . deserialize ( new DataInputStream ( bufIn ) ) ; <END_BUG> StreamInSession session = StreamInSession . get ( to , srm . sessionId ) ; session . closeIfFinished ( ) ; } catch ( Exception e ) { System . err . println ( e ) ; e . printStackTrace ( ) ; } } }

Fix:
StreamRequestMessage srm = StreamRequestMessage . serializer ( ) . deserialize ( new DataInputStream ( bufIn ) , version_ ) ;
Buggy code:
public abstract class AbstractDefaultAjaxBehavior extends AbstractAjaxBehavior { private static final long serialVersionUID = 1L ; public static final ResourceReference INDICATOR = new ResourceReference ( AbstractDefaultAjaxBehavior . class , "indicator.gif" ) ; private static final ResourceReference JAVASCRIPT = new JavascriptResourceReference ( AbstractDefaultAjaxBehavior . class , "wicket-ajax.js" ) ; private static final ResourceReference JAVASCRIPT_DEBUG = new JavascriptResourceReference ( AbstractDefaultAjaxBehavior . class , "wicket-ajax-debug.js" ) ; protected void onBind ( ) { } public void renderHead ( IHeaderResponse response ) { } protected IAjaxCallDecorator getAjaxCallDecorator ( ) { } protected CharSequence getCallbackScript ( ) { } protected CharSequence getCallbackScript ( boolean onlyTargetActivePage ) { } protected CharSequence getPreconditionScript ( ) { } protected CharSequence getFailureScript ( ) { } protected CharSequence getSuccessScript ( ) { } protected CharSequence generateCallbackScript ( final CharSequence partialCall ) { } protected String getChannelName ( ) { } private String findIndicatorId ( ) { } public final void onRequest ( ) { <START_BUG> AjaxRequestTarget target = new AjaxRequestTarget ( ) ; <END_BUG> RequestCycle . get ( ) . setRequestTarget ( target ) ; respond ( target ) ; } protected abstract void respond ( AjaxRequestTarget target ) { } public static final CharSequence throttleScript ( CharSequence script , String throttleId , Duration throttleDelay ) { } }

Fix:
AjaxRequestTarget target = new AjaxRequestTarget ( getComponent ( ) . getPage ( ) ) ;
Buggy code:
public class GenesisGenerator { private static Random seedSource = new Random ( ) ; private final RepeatableRandom random ; private final long totalTicks ; private final long lookAheadTime ; private final Distribution < Integer > absoluteJitter ; private final Distribution < Double > relativeJitter ; private final double networkUptime ; private final Distribution < Double > relativePredictionTimeAccuracy ; private final Distribution < Double > relativePredictionAmplitudeAccuracy ; private final Distribution < Long > absolutePredictionTimeAccuracy ; private final Distribution < Integer > absolutePredictionAmplitudeAccuracy ; private final Distribution < Integer > byterate ; private final Distribution < Long > slotLength ; private final Collection < RequestSeries > recurringSeries ; private final Collection < Request > intermittentRequests ; private final Class < ? extends PrefetchAlgorithm > algorithm ; private final Map < String , String > algorithmConfiguration ; public GenesisGenerator ( Configuration configuration ) { } public void seed ( long seed ) { } private long clamp ( long min , long value , long max ) { } private int clamp ( int min , int value , int max ) { } public Genesis generate ( ) { } private void generateSeries ( RepeatableRandom random , List < Request > requests , RequestSeries series ) { } private Map < Long , Integer > generateNetworkQuality ( RepeatableRandom random ) { } private Map < Long , Integer > grainNetworkQuality ( RepeatableRandom random , Map < Long , Integer > networkQuality ) { } private Map < Long , Integer > generateNetworkQualityPrediction ( RepeatableRandom random , Map < Long , Integer > networkQuality ) { RepeatableRandom randomTick = random . fork ( ) ; RepeatableRandom randomAccuracy = random . fork ( ) ; Map < Long , Integer > ret = new HashMap < > ( ) ; for ( long tick : networkQuality . keySet ( ) ) { long predictionTick = 0 ; if ( tick != 0 ) { double relativeTime = this . relativePredictionTimeAccuracy . getValue ( randomTick ) ; long absoluteTime = this . absolutePredictionTimeAccuracy . getValue ( randomTick ) ; predictionTick = ( tick + absoluteTime ) + ( ( long ) ( relativeTime * ( slotLength . getMean ( ) ) ) ) ; } <START_BUG> predictionTick = Math . max ( 0 , Math . min ( totalTicks , predictionTick ) ) ; <END_BUG> double relativeAmplitude = this . relativePredictionAmplitudeAccuracy . getValue ( randomAccuracy ) ; int absoluteAmplitude = this . absolutePredictionAmplitudeAccuracy . getValue ( randomAccuracy ) ; int predictionByterate = networkQuality . get ( tick ) ; predictionByterate = ( ( int ) ( predictionByterate * relativeAmplitude ) ) + absoluteAmplitude ; ret . put ( predictionTick , predictionByterate ) ; } return ret ; } }

Fix:
predictionTick = clamp ( 0 , predictionTick , ( ( totalTicks ) - 1 ) ) ;
Buggy code:
public final class CDMahoutEvaluatorTest extends MahoutTestCase { @ Test public void testEvaluate ( ) throws Exception { int nbrules = 100 ; Random rng = RandomUtils . getRandom ( ) ; int target = 1 ; List < Rule > rules = Lists . newArrayList ( ) ; for ( int index = 0 ; index < nbrules ; index ++ ) { rules . add ( new RandomRule ( index , target , rng ) ) ; } FileSystem fs = FileSystem . get ( new Configuration ( ) ) ; <START_BUG> Path input = fs . makeQualified ( new Path ( Resources . getResource ( "wdbc" ) . toString ( ) ) ) ; <END_BUG> CDMahoutEvaluator . initializeDataSet ( input ) ; List < CDFitness > results = Lists . newArrayList ( ) ; Path output = getTestTempDirPath ( "output" ) ; fs = output . getFileSystem ( new Configuration ( ) ) ; fs . delete ( output , true ) ; CDMahoutEvaluator . evaluate ( rules , target , input , output , results ) ; for ( int index = 0 ; index < nbrules ; index ++ ) { assertEquals ( ( "rule<seq2seq4repair_space>" + index ) , RandomRuleResults . getResult ( index ) , results . get ( index ) ) ; } } }

Fix:
Path input = fs . makeQualified ( new Path ( Resources . getResource ( "wdbc" ) . toURI ( ) ) ) ;
Buggy code:
public class DOMUtils { public static Element getChildByTagOrFail ( Element e , String name ) throws ParserException { } public static Element getFirstChildOrFail ( Element e ) throws ParserException { } public static String getAttributeOrFail ( Element e , String name ) throws ParserException { } public static String getAttributeWithInheritanceOrFail ( Element e , String name ) throws ParserException { } public static String getNonBlankTextOrFail ( Element e ) throws ParserException { } public static Element getChildByTagName ( Element e , String name ) { } public static String getAttributeWithInheritance ( Element element , String attributeName ) { } public static String getChildTextByTagName ( Element e , String tagName ) { } public static Element insertChild ( Element parent , String tagName , String text ) { } public static String getAttribute ( Element element , String attributeName , String deflt ) { } public static float getAttribute ( Element element , String attributeName , float deflt ) { } public static int getAttribute ( Element element , String attributeName , int deflt ) { } public static boolean getAttribute ( Element element , String attributeName , boolean deflt ) { String result = element . getAttribute ( attributeName ) ; if ( ( result == null ) || ( "" . equals ( result ) ) ) { return deflt ; } <START_BUG> return Boolean . getBoolean ( result ) ; <END_BUG> } public static String getText ( Node e ) { } public static Element getFirstChildElement ( Element element ) { } private static void getTextBuffer ( Node e , StringBuffer sb ) { } public static Document loadXML ( Reader is ) { } }

Fix:
return Boolean . valueOf ( result ) . booleanValue ( ) ;
Buggy code:
public abstract class AbstractNaiveBayesClassifier extends AbstractVectorClassifier { private final NaiveBayesModel model ; protected AbstractNaiveBayesClassifier ( NaiveBayesModel model ) { } protected NaiveBayesModel getModel ( ) { } protected abstract double getScoreForLabelFeature ( int label , int feature ) { } protected double getScoreForLabelInstance ( int label , Vector instance ) { double result = 0.0 ; Iterator < Element > elements = instance . iterateNonZero ( ) ; while ( elements . hasNext ( ) ) { Element e = elements . next ( ) ; result += ( e . get ( ) ) * ( getScoreForLabelFeature ( label , e . index ( ) ) ) ; } <START_BUG> return - result ; <END_BUG> } @ Override public int numCategories ( ) { } @ Override public Vector classifyFull ( Vector instance ) { } @ Override public Vector classifyFull ( Vector r , Vector instance ) { } @ Override public double classifyScalar ( Vector instance ) { } @ Override public Vector classify ( Vector instance ) { } }

Fix:
return result ;
Buggy code:
public class ReferenciaController { private static ReferenciaDAO dao ; private static ReferenciaController singleton ; private ReferenciaController ( ) throws Exception { } public static ReferenciaController getInstance ( ) throws Exception { } public List < ReferenciaWithAutoID > getReferencias ( ) throws Exception { } public List < ReferenciaWithAutoID > getReferenciasAsociadas ( String user ) throws Exception { } public List < ReferenciaWithAutoID > getReferenciasEstado ( String estado ) throws Exception { } public ReferenciaWithAutoID getReferenciaCopia ( ObjectId key ) throws Exception { Iterator < ReferenciaWithAutoID > i = ReferenciaController . dao . getReferencias ( ) ; while ( i . hasNext ( ) ) { ReferenciaWithAutoID ref = i . next ( ) ; <START_BUG> if ( ref . getIdEnlaceOriginal ( ) . equals ( key ) ) { <END_BUG> byte [ ] imagenByte = null ; try { imagenByte = Files . readAllBytes ( Paths . get ( ( ( ( Config . getInstance ( ) . getProperty ( PATH_IMAGENES ) ) + ( ref . get_id ( ) ) ) + ".png" ) ) ) ; } catch ( Exception e ) { imagenByte = Files . readAllBytes ( Paths . get ( ( ( Config . getInstance ( ) . getProperty ( PATH_IMAGENES ) ) + "error.png" ) ) ) ; } String imagenBase = DatatypeConverter . printBase64Binary ( imagenByte ) ; ref . setImagenProyecto ( imagenBase ) ; return ref ; } } ReferenciaWithAutoID vacia = new ReferenciaWithAutoID ( ) ; vacia . setAutor ( "vacia" ) ; return vacia ; } public ReferenciaWithAutoID getReferencia ( String key ) throws Exception { } public ReferenciaWithAutoID createReferencia ( ReferenciaWithAutoID r ) throws Exception { } public ObjectId deleteReferencia ( ObjectId key ) throws Exception { } public ReferenciaWithAutoID updateReferencia ( ReferenciaWithAutoID r ) throws Exception { } public ReferenciaWithAutoID updateReferenciaEstado ( Map < String , Object > recursos ) throws Exception { } public void updateReferenciaTecnologia ( Map < String , String > tecnologias ) throws Exception { } public boolean hayReferenciaAsociada ( String tecnologia ) throws Exception { } public void dropReferencia ( ) { } public boolean comprobarCampos ( String campos , ReferenciaWithAutoID r ) throws Exception { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ref . getIdEnlaceOriginal ( ) ) != null ) && ( ref . getIdEnlaceOriginal ( ) . equals ( key ) ) ) {
Buggy code:
public class ResourceLink extends Link implements IResourceListener { private static final long serialVersionUID = 1L ; private final ResourceReference resourceReference ; private final Resource resource ; public ResourceLink ( final String id , final ResourceReference resourceReference ) { } public ResourceLink ( final String id , final Resource resource ) { } public void onClick ( ) { } protected final String getURL ( ) { if ( ( resourceReference ) != null ) { resourceReference . setLocale ( getLocale ( ) ) ; resourceReference . setStyle ( getStyle ( ) ) ; resourceReference . bind ( getApplication ( ) ) ; return getRequestCycle ( ) . urlFor ( resourceReference ) ; } <START_BUG> return urlFor ( RESOURCE_LISTENER_INTERFACE ) ; <END_BUG> } public final void onResourceRequested ( ) { } }

Fix:
return urlFor ( INTERFACE ) ;
Buggy code:
public class ExclusionTest extends BinaryGraphOperatorsTestBase { @ Test public void testSameGraph ( ) throws Exception { } @ Test public void testOverlappingGraphs ( ) throws Exception { FlinkAsciiGraphLoader < GraphHeadPojo , VertexPojo , EdgePojo > loader = getSocialNetworkLoader ( ) ; <START_BUG> loader . appendToDatabaseFromString ( ( "expected1[(eve)];" + "expected2[(carol)-[ckd]->(dave)-[dkc]->(carol)" ) ) ; <END_BUG> LogicalGraph < GraphHeadPojo , VertexPojo , EdgePojo > g0 = loader . getLogicalGraphByVariable ( "g0" ) ; LogicalGraph < GraphHeadPojo , VertexPojo , EdgePojo > g2 = loader . getLogicalGraphByVariable ( "g2" ) ; LogicalGraph < GraphHeadPojo , VertexPojo , EdgePojo > expected1 = loader . getLogicalGraphByVariable ( "expected1" ) ; LogicalGraph < GraphHeadPojo , VertexPojo , EdgePojo > expected2 = loader . getLogicalGraphByVariable ( "expected2" ) ; assertTrue ( "excluding<seq2seq4repair_space>overlapping<seq2seq4repair_space>graphs<seq2seq4repair_space>failed" , expected1 . equalsByElementIdsCollected ( g0 . exclude ( g2 ) ) ) ; assertTrue ( "excluding<seq2seq4repair_space>switched<seq2seq4repair_space>overlapping<seq2seq4repair_space>graphs<seq2seq4repair_space>failed" , expected2 . equalsByElementIdsCollected ( g2 . exclude ( g0 ) ) ) ; } @ Test public void testNonOverlappingGraphs ( ) throws Exception { } @ Test public void testGraphContainment ( ) throws Exception { } }

Fix:
loader . appendToDatabaseFromString ( ( "expected1[(eve)];" + "expected2[(carol)-[ckd]->(dave)-[dkc]->(carol)]" ) ) ;
Buggy code:
public class FlyweightTest { @ Test public void testFlyweight ( ) { <START_BUG> EngineFlyweightFactory engineFactory = new EngineFlyweightFactory ( ) ; <END_BUG> DiagnosticTool engineDiagTool = new EngineDiagnosticTool ( ) ; Engine standard1 = engineFactory . getStandardEngine ( 1300 ) ; standard1 . diagnose ( engineDiagTool ) ; Engine standard2 = engineFactory . getStandardEngine ( 1300 ) ; standard2 . diagnose ( engineDiagTool ) ; Engine standard3 = engineFactory . getStandardEngine ( 1300 ) ; standard3 . diagnose ( engineDiagTool ) ; Engine standard4 = engineFactory . getStandardEngine ( 1600 ) ; standard4 . diagnose ( engineDiagTool ) ; Engine standard5 = engineFactory . getStandardEngine ( 1600 ) ; standard5 . diagnose ( engineDiagTool ) ; assertThat ( standard1 , equalTo ( standard2 ) ) ; assertThat ( standard2 , equalTo ( standard3 ) ) ; assertThat ( standard1 , equalTo ( standard3 ) ) ; assertThat ( standard4 , equalTo ( standard5 ) ) ; assertThat ( standard3 , not ( equalTo ( standard5 ) ) ) ; } }

Fix:
EngineFlyweightFactory engineFactory = EngineFlyweightFactory . INSTANCE ;
Buggy code:
public abstract class Renderer { int winWidth ; int winHeight ; boolean visible = false ; boolean interactiveMode = false ; ArrayList < TFChangeListener > listeners = new ArrayList < TFChangeListener > ( ) ; public Renderer ( ) { } public void setInteractiveMode ( boolean flag ) { } public void setWinWidth ( int w ) { } public void setWinHeight ( int h ) { } public int getWinWidth ( ) { } public int getWinHeight ( ) { } public void setVisible ( boolean flag ) { } public boolean getVisible ( ) { } public void addTFChangeListener ( TFChangeListener l ) { } <START_BUG> public abstract void visualize ( ImageDrawer drawer , double [ ] viewMatrix , long renderingId ) ; <END_BUG> }

Fix:
public abstract void visualize ( double [ ] viewMatrix , long renderingId ) ;
Buggy code:
public abstract class AbstractCompositePredicateTest < T > extends AbstractMockPredicateTest < T > { protected AbstractCompositePredicateTest ( final T testValue ) { } protected abstract Predicate < T > getPredicateInstance ( final Predicate < ? super T > ... predicates ) { } protected abstract Predicate < T > getPredicateInstance ( final Collection < Predicate < T > > predicates ) { } protected final Predicate < T > getPredicateInstance ( final Boolean ... mockReturnValues ) { final List < Predicate < T > > predicates = new java . util . ArrayList < Predicate < T > > ( ) ; <START_BUG> for ( Boolean returnValue : mockReturnValues ) { <END_BUG> predicates . add ( AbstractCompositePredicateTest . createMockPredicate ( returnValue ) ) ; } return getPredicateInstance ( predicates ) ; } @ SuppressWarnings ( "unchecked" ) public void singleElementArrayToGetInstance ( ) { } public void singletonCollectionToGetInstance ( ) { } @ Test ( expected = IllegalArgumentException . class ) public final void nullArrayToGetInstance ( ) { } @ SuppressWarnings ( { "unchecked" } ) @ Test ( expected = IllegalArgumentException . class ) public final void nullElementInArrayToGetInstance ( ) { } @ SuppressWarnings ( { "unchecked" } ) @ Test ( expected = IllegalArgumentException . class ) public final void nullElementsInArrayToGetInstance ( ) { } @ Test ( expected = IllegalArgumentException . class ) public final void nullCollectionToGetInstance ( ) { } @ Test ( expected = IllegalArgumentException . class ) public final void nullElementsInCollectionToGetInstance ( ) { } }

Fix:
for ( final Boolean returnValue : mockReturnValues ) {
Buggy code:
public interface INimbus { void prepare ( Map stormConf , String schedulerLocalDir ) { } <START_BUG> Collection < WorkerSlot > availableSlots ( Collection < SupervisorDetails > existingSupervisors , Collection < WorkerSlot > usedSlots , TopologyDetails topology ) ; <END_BUG> void assignSlots ( Collection < WorkerSlot > slot , TopologyDetails topology ) { } }

Fix:
Collection < WorkerSlot > availableSlots ( Collection < SupervisorDetails > existingSupervisors , Collection < WorkerSlot > usedSlots , Collection < TopologyDetails > topologies ) ;
Buggy code:
public class Label extends Control { String text = "" ; Image image ; boolean isImage ; NSTextField textView ; NSImageView imageView ; public Label ( Composite parent , int style ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { SWTBox widget = ( ( SWTBox ) ( new SWTBox ( ) . alloc ( ) ) ) ; widget . initWithFrame ( new NSRect ( ) ) ; widget . setTag ( jniRef ) ; widget . setTitle ( NSString . stringWith ( "" ) ) ; if ( ( ( style ) & ( SWT . SEPARATOR ) ) != 0 ) { widget . setBoxType ( NSBoxSeparator ) ; } else { widget . setBorderType ( NSNoBorder ) ; NSImageView imageWidget = ( ( NSImageView ) ( new SWTImageView ( ) . alloc ( ) ) ) ; imageWidget . initWithFrame ( new NSRect ( ) ) ; imageWidget . setTag ( jniRef ) ; <START_BUG> NSTextField textWidget = ( ( NSTextField ) ( new NSTextField ( ) . alloc ( ) ) ) ; <END_BUG> textWidget . initWithFrame ( new NSRect ( ) ) ; textWidget . setBordered ( false ) ; textWidget . setEditable ( false ) ; textWidget . setDrawsBackground ( false ) ; textWidget . setTag ( jniRef ) ; if ( ( ( style ) & ( SWT . WRAP ) ) != 0 ) { NSTextFieldCell cell = new NSTextFieldCell ( textWidget . cell ( ) ) ; cell . setWraps ( true ) ; } widget . addSubview_ ( imageWidget ) ; widget . addSubview_ ( textWidget ) ; widget . setContentView ( textWidget ) ; imageView = imageWidget ; textView = textWidget ; _setAlignment ( ) ; } view = widget ; parent . contentView ( ) . addSubview_ ( widget ) ; } NSAttributedString createString ( ) { } public int getAlignment ( ) { } public Image getImage ( ) { } String getNameText ( ) { } public String getText ( ) { } public void setAlignment ( int alignment ) { } void setBackground ( float [ ] color ) { } void _setAlignment ( ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setForeground ( float [ ] color ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } }

Fix:
SWTTextField textWidget = ( ( SWTTextField ) ( new SWTTextField ( ) . alloc ( ) ) ) ;
Buggy code:
public class AAAARecord extends Record { private static AAAARecord member = new AAAARecord ( ) ; private Inet6Address address ; private AAAARecord ( ) { } private AAAARecord ( Name name , short dclass , int ttl ) { } static AAAARecord getMember ( ) { } public AAAARecord ( Name name , short dclass , int ttl , Inet6Address address ) { } Record rrFromWire ( Name name , short type , short dclass , int ttl , int length , DataByteInputStream in ) throws IOException { } Record rdataFromString ( Name name , short dclass , int ttl , MyStringTokenizer st , Name origin ) throws TextParseException { AAAARecord rec = new AAAARecord ( name , dclass , ttl ) ; <START_BUG> rec . address = new Inet6Address ( st . nextToken ( ) ) ; <END_BUG> return rec ; } public String rdataToString ( ) { } public Inet6Address getAddress ( ) { } void rrToWire ( DataByteOutputStream out , Compression c , boolean canonical ) { } }

Fix:
rec . address = new Inet6Address ( nextString ( st ) ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class CSVFileParserTest { private static final File BASE = new File ( "src//test//resources//CSVFileParser" ) ; private final BufferedReader testData ; private final String testName ; public CSVFileParserTest ( final File file ) throws FileNotFoundException { } private String readTestData ( ) throws IOException { } @ Parameters public static Collection < Object [ ] > generateData ( ) { } @ Test public void testCSVFile ( ) throws Exception { String line = readTestData ( ) ; assertNotNull ( "file<seq2seq4repair_space>must<seq2seq4repair_space>contain<seq2seq4repair_space>config<seq2seq4repair_space>line" , line ) ; final String [ ] split = line . split ( "<seq2seq4repair_space>" ) ; assertTrue ( ( ( testName ) + "<seq2seq4repair_space>require<seq2seq4repair_space>1<seq2seq4repair_space>param" ) , ( ( split . length ) >= 1 ) ) ; final BufferedReader csvFile = new BufferedReader ( new FileReader ( new File ( CSVFileParserTest . BASE , split [ 0 ] ) ) ) ; <START_BUG> CSVFormatBuilder builder = CSVFormat . newBuilder ( ',' ) . withQuoteChar ( '"' ) ; <END_BUG> CSVFormat fmt = builder . build ( ) ; boolean checkComments = false ; for ( int i = 1 ; i < ( split . length ) ; i ++ ) { final String option = split [ i ] ; final String [ ] option_parts = option . split ( "=" , 2 ) ; if ( "IgnoreEmpty" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = builder . withIgnoreEmptyLines ( Boolean . parseBoolean ( option_parts [ 1 ] ) ) . build ( ) ; } else if ( "IgnoreSpaces" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = builder . withIgnoreSurroundingSpaces ( Boolean . parseBoolean ( option_parts [ 1 ] ) ) . build ( ) ; } else if ( "CommentStart" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { fmt = builder . withCommentStart ( option_parts [ 1 ] . charAt ( 0 ) ) . build ( ) ; } else if ( "CheckComments" . equalsIgnoreCase ( option_parts [ 0 ] ) ) { checkComments = true ; } else { fail ( ( ( ( testName ) + "<seq2seq4repair_space>unexpected<seq2seq4repair_space>option:<seq2seq4repair_space>" ) + option ) ) ; } } line = readTestData ( ) ; assertEquals ( ( ( testName ) + "<seq2seq4repair_space>Expected<seq2seq4repair_space>format<seq2seq4repair_space>" ) , line , fmt . toString ( ) ) ; for ( final CSVRecord rec : fmt . parse ( csvFile ) ) { String parsed = rec . toString ( ) ; if ( checkComments ) { final String comment = rec . getComment ( ) . replace ( "\n" , "\\n" ) ; if ( comment != null ) { parsed += "#" + comment ; } } final int count = rec . size ( ) ; assertEquals ( testName , readTestData ( ) , ( ( count + ":" ) + parsed ) ) ; } } }

Fix:
final CSVFormatBuilder builder = CSVFormat . newBuilder ( ',' ) . withQuoteChar ( '"' ) ;
Buggy code:
public class ParameterizedQualifiedTypeReference extends ArrayQualifiedTypeReference { public TypeReference [ ] [ ] typeArguments ; public boolean didResolve = false ; public ParameterizedQualifiedTypeReference ( char [ ] [ ] tokens , TypeReference [ ] [ ] typeArguments , int dim , long [ ] positions ) { } public void checkBounds ( Scope scope ) { } public void checkBounds ( ReferenceBinding type , Scope scope , int index ) { if ( ( index > 0 ) && ( ( type . enclosingType ( ) ) != null ) ) { checkBounds ( type . enclosingType ( ) , scope , ( index - 1 ) ) ; } if ( type . isParameterizedType ( ) ) { ParameterizedTypeBinding parameterizedType = ( ( ParameterizedTypeBinding ) ( type ) ) ; <START_BUG> ReferenceBinding currentType = parameterizedType . type ; <END_BUG> TypeVariableBinding [ ] typeVariables = currentType . typeVariables ( ) ; TypeBinding [ ] argTypes = parameterizedType . arguments ; if ( ( argTypes != null ) && ( typeVariables != null ) ) { parameterizedType . boundCheck ( scope , this . typeArguments [ index ] ) ; } } } public TypeReference copyDims ( int dim ) { } public char [ ] [ ] getParameterizedTypeName ( ) { } protected TypeBinding getTypeBinding ( Scope scope ) { } private TypeBinding internalResolveType ( Scope scope , boolean checkBounds ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope , boolean checkBounds ) { } public TypeBinding resolveType ( ClassScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } }

Fix:
ReferenceBinding currentType = parameterizedType . genericType ( ) ;
Buggy code:
public class CommandLibrary { public HashMap < String , Command > commandTable ; HashMap < String , ArgumentType < ? > > usedArgumentTypes ; public Context context ; public CommandLibrary ( Main plugin ) { } public void printErrorLn ( String msg ) { } public void unknownCommand ( String name ) { } public void handleArgumentException ( ArgumentException e , Command cmd ) { } public void setCommandSender ( CommandSender sender ) { } public String execute ( String name , String arguments ) { } public CommandWithArgs getCommandWithArgs ( String name , String arguments ) { } public CommandWithArgs getCommandWithArgs ( String command ) { } public CommandWithLateArgs getCommandWithLateArgs ( String name , String arguments ) { } public CommandWithLateArgs getCommandWithLateArgs ( String command ) { } public String execute ( String command ) { } public String handleCommand ( CommandSender cs , org . bukkit . command . Command cmd , String label , String [ ] args ) { } private String joinStr ( String baseStr , String [ ] args ) { } public void addCommand ( Command cmd ) { commandTable . put ( cmd . name ( ) . toLowerCase ( ) , cmd ) ; for ( Argument arg : cmd . args ( ) ) { ArgumentType < ? > at = arg . type ( ) ; <START_BUG> usedArgumentTypes . put ( at . name ( ) , at ) ; <END_BUG> } } public void addCommands ( Command ... commands ) { } public class HelpCommand implements Command { @ Override public String name ( ) { } @ Override public String description ( ) { } @ Override public String execute ( Map < String , Object > args , Context ctx ) { } private void printLongDescription ( Command cmd , Context ctx ) { } private void printShortDescription ( Command cmd , Context ctx ) { } @ Override public List < Argument > args ( ) { } } public Context getContext ( ) { } }

Fix:
usedArgumentTypes . put ( at . name ( ) . toLowerCase ( ) , at ) ;