nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EmptySpaceMenuController { protected static final String TAG = "EmptySpaceMenuController" ; static ContactListController contactListController ; private static Context context ; public EmptySpaceMenuController ( Context context ) { } public static void showFreeSpaceMenu ( ) { if ( ( EmptySpaceMenuController . context ) == null ) Log . v ( "Empty<seq2seq4repair_space>Space<seq2seq4repair_space>Menu" , "NULL" ) ; AlertDialog . Builder builder = new AlertDialog . Builder ( EmptySpaceMenuController . context ) ; builder . setItems ( emptyspaceMenu , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int item ) { if ( Values . emptyspaceMenu [ item ] . equals ( "Add<seq2seq4repair_space>Users" ) ) { Log . v ( EmptySpaceMenuController . TAG , "pressed<seq2seq4repair_space>Add<seq2seq4repair_space>Users" ) ; ContactListController . showBuddyList ( ) ; } else if ( Values . emptyspaceMenu [ item ] . equals ( "Delete<seq2seq4repair_space>Users" ) ) { Log . v ( EmptySpaceMenuController . TAG , "pressed<seq2seq4repair_space>Delete<seq2seq4repair_space>Users" ) ; ParticipantView . deleteParticipants ( ) ; } else if ( Values . emptyspaceMenu [ item ] . equals ( "Leave<seq2seq4repair_space>Chat" ) ) { Log . v ( EmptySpaceMenuController . TAG , "pressed<seq2seq4repair_space>Leave<seq2seq4repair_space>Chat" ) ; if ( user_primary . equals ( screen . getSpace ( ) . getOwner ( ) ) ) { <START_BUG> ParticipantView . whatHappen ( ) ; <END_BUG> } else { screen . getSpace ( ) . getParticipantController ( ) . leaveSpace ( screen . getSpace ( ) . equals ( Space . getMainSpace ( ) ) ) ; } } else if ( Values . emptyspaceMenu [ item ] . equals ( "Cancel" ) ) { Log . v ( EmptySpaceMenuController . TAG , "pressed<seq2seq4repair_space>Cancel" ) ; } } } ) ; builder . setTitle ( "Empty<seq2seq4repair_space>Space<seq2seq4repair_space>Menu" ) . create ( ) ; AlertDialog alert = builder . create ( ) ; alert . show ( ) ; } }

Fix:
ParticipantView . leaveOrDestroy ( ) ;
Buggy code:
public class BuildArgParserTestCase extends TestCase { private static final String TEST_DIR = ( ( ( AjdtAjcTests . TESTDATA_PATH ) + ( File . separator ) ) + "ajc" ) + ( File . separator ) ; private MessageWriter messageWriter = new MessageWriter ( new PrintWriter ( System . out ) , false ) ; public BuildArgParserTestCase ( String name ) { } private AjBuildConfig genBuildConfig ( String [ ] args , IMessageHandler handler ) { } public void testDefaultClasspathAndTargetCombo ( ) throws Exception { } public void testPathResolutionFromConfigArgs ( ) { } public void testAjOptions ( ) throws InvalidInputException { } public void testAspectpath ( ) throws InvalidInputException { } public void testInJars ( ) throws InvalidInputException { } public void testBadInJars ( ) throws InvalidInputException { } public void testBadPathToSourceFiles ( ) { } public void testMultipleSourceRoots ( ) throws IOException , InvalidInputException { } private String getCanonicalPath ( File file ) { } public void testSourceRootDir ( ) throws IOException , InvalidInputException { } public void testBadSourceRootDir ( ) throws InvalidInputException { } public void testSourceRootDirWithFiles ( ) throws IOException , InvalidInputException { } public void testExtDirs ( ) throws Exception { } public void testBootclasspath ( ) throws InvalidInputException { <START_BUG> final String PATH = "mumble//rt.jar" ; <END_BUG> AjBuildConfig config = genBuildConfig ( new String [ ] { "-bootclasspath" , PATH } , messageWriter ) ; assertTrue ( config . getClasspath ( ) . toString ( ) , ( ( ( ( String ) ( config . getClasspath ( ) . get ( 0 ) ) ) . indexOf ( PATH ) ) != ( - 1 ) ) ) ; config = genBuildConfig ( new String [ ] { } , messageWriter ) ; assertTrue ( config . getClasspath ( ) . toString ( ) , ( ! ( config . getClasspath ( ) . get ( 0 ) . equals ( PATH ) ) ) ) ; } public void testOutputJar ( ) throws InvalidInputException { } public void testCombinedOptions ( ) throws InvalidInputException { } public void testOutputDirectorySetting ( ) throws InvalidInputException { } public void testClasspathSetting ( ) throws InvalidInputException { } public void testArgInConfigFile ( ) throws InvalidInputException { } public void testNonExistentConfigFile ( ) throws IOException { } public void testXlint ( ) throws InvalidInputException { } public void testXlintfile ( ) throws InvalidInputException { } public void testOptions ( ) throws InvalidInputException { } public void testLstFileExpansion ( ) throws FileNotFoundException , IOException , InvalidInputException { } public void testAjFileInclusion ( ) throws InvalidInputException { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } }

Fix:
final String PATH = ( "mumble" + ( File . separator ) ) + "rt.jar" ;
Buggy code:
public class WebMarkupContainer extends MarkupContainer { public WebMarkupContainer ( final String id ) { } public WebMarkupContainer ( final String id , IModel model ) { } public final String getMarkupType ( ) { } protected void onRender ( ) { } <START_BUG> public HeaderPart getHeaderPart ( int index ) { <END_BUG> return null ; } }

Fix:
public WebMarkupContainer getHeaderPart ( int index ) {
Buggy code:
public class ModuleConfigProcessor implements DeploymentUnitProcessor { public static final long PRIORITY = MODULARIZE . plus ( 100L ) ; private static final Dependency [ ] NO_DEPS = new ModuleConfig . Dependency [ 0 ] ; public void processDeployment ( DeploymentUnitContext context ) throws DeploymentUnitProcessingException { if ( ( context . getAttachment ( ATTACHMENT_KEY ) ) != null ) return ; final VirtualFile deploymentRoot = getVirtualFileAttachment ( context ) ; final MountHandle deploymentRootMountHandler = context . getAttachment ( MountHandle . ATTACHMENT_KEY ) ; <START_BUG> final ModuleIdentifier moduleIdentifier = ModuleIdentifier . create ( ( ( "org.jboss.deployments" + "." ) + ( deploymentRoot . getName ( ) ) ) ) ; <END_BUG> final ModuleConfig [ ] resourceRoots = new ModuleConfig . ResourceRoot [ ] { new ModuleConfig . ResourceRoot ( deploymentRoot , deploymentRootMountHandler ) } ; final ModuleDependencies dependenciesAttachment = ModuleDependencies . getAttachedDependencies ( context ) ; final ModuleConfig [ ] dependencies = ( dependenciesAttachment != null ) ? dependenciesAttachment . getDependencies ( ) : ModuleConfigProcessor . NO_DEPS ; final ModuleConfig moduleConfig = new ModuleConfig ( moduleIdentifier , dependencies , resourceRoots ) ; context . putAttachment ( ATTACHMENT_KEY , moduleConfig ) ; } }

Fix:
final ModuleIdentifier moduleIdentifier = ModuleIdentifier . create ( ( "deployment." + ( deploymentRoot . getName ( ) ) ) ) ;
Buggy code:
public final class LongRangeTest extends AbstractRangeTest { public LongRangeTest ( String name ) { } public static Test suite ( ) { } @ Override public void setUp ( ) { } @ Override protected Range createRange ( Integer integer1 , Integer integer2 ) { } @ Override protected Range createRange ( Integer integer ) { } public void testConstructor1a ( ) { } public void testConstructor1b ( ) { LongRange nr = new LongRange ( long8 ) ; assertSame ( long8 , nr . getMinimumNumber ( ) ) ; assertSame ( long8 , nr . getMaximumNumber ( ) ) ; <START_BUG> Range r = new LongRange ( nonComparableNumber ) ; <END_BUG> try { new LongRange ( null ) ; fail ( ) ; } catch ( IllegalArgumentException ex ) { } } public void testConstructor2a ( ) { } public void testConstructor2b ( ) { } public void testContainsNumber ( ) { } public void testContainsLongBig ( ) { } public void testToArray ( ) { } }

Fix:
new LongRange ( nonComparableNumber ) ;
Buggy code:
public class ShortValuesCreator extends CachedArrayCreator < ShortValues > { protected ShortParser parser ; public ShortValuesCreator ( String field , ShortParser parser , int options ) { } public ShortValuesCreator ( String field , ShortParser parser ) { } @ Override public Class getArrayType ( ) { } @ Override public Parser getParser ( ) { } @ Override public Type getSortType ( ) { } @ Override public ShortValues create ( IndexReader reader ) throws IOException { } @ Override public synchronized ShortValues validate ( ShortValues entry , IndexReader reader ) throws IOException { } protected void fillShortValues ( ShortValues vals , IndexReader reader , String field ) throws IOException { if ( ( parser ) == null ) { parser = FieldCache . DEFAULT_SHORT_PARSER ; } setParserAndResetCounts ( vals , parser ) ; Terms terms = MultiFields . getTerms ( reader , field ) ; int maxDoc = reader . maxDoc ( ) ; vals . values = new short [ maxDoc ] ; if ( terms != null ) { final TermsEnum termsEnum = terms . iterator ( ) ; FixedBitSet validBits = ( hasOption ( OPTION_CACHE_BITS ) ) ? new FixedBitSet ( maxDoc ) : null ; DocsEnum docs = null ; try { while ( true ) { final BytesRef term = termsEnum . next ( ) ; if ( term == null ) { break ; } <START_BUG> final Short termval = parser . parseShort ( term ) ; <END_BUG> docs = termsEnum . docs ( null , docs ) ; while ( true ) { final int docID = docs . nextDoc ( ) ; if ( docID == ( DocIdSetIterator . NO_MORE_DOCS ) ) { break ; } vals . values [ docID ] = termval ; ( vals . numDocs ) ++ ; if ( validBits != null ) { validBits . set ( docID ) ; } } ( vals . numTerms ) ++ ; } } catch ( FieldCache stop ) { } if ( ( vals . valid ) == null ) { vals . valid = checkMatchAllBits ( validBits , vals . numDocs , maxDoc ) ; } } if ( ( ( vals . valid ) == null ) && ( ( vals . numDocs ) < 1 ) ) { vals . valid = new Bits . MatchNoBits ( maxDoc ) ; } } }

Fix:
final short termval = parser . parseShort ( term ) ;
Buggy code:
public class PrivateClassEnvironment extends Environment { public List < PDefinition > getDefinitions ( ) { } private final SClassDefinition classdef ; public PrivateClassEnvironment ( ITypeCheckerAssistantFactory af , SClassDefinition classdef ) { } public PrivateClassEnvironment ( ITypeCheckerAssistantFactory af , SClassDefinition classdef , Environment env ) { } @ Override public PDefinition findName ( ILexNameToken sought , NameScope scope ) { PDefinition def = af . createPDefinitionAssistant ( ) . findName ( classdef , sought , scope ) ; <START_BUG> if ( def != null ) { <END_BUG> return def ; } return ( outer ) == null ? null : outer . findName ( sought , scope ) ; } @ Override public PDefinition findType ( ILexNameToken name , String fromModule ) { } @ Override public Set < PDefinition > findMatches ( ILexNameToken name ) { } @ Override public void unusedCheck ( ) { } @ Override public AStateDefinition findStateDefinition ( ) { } @ Override public boolean isVDMPP ( ) { } @ Override public boolean isSystem ( ) { } @ Override public SClassDefinition findClassDefinition ( ) { } @ Override public boolean isStatic ( ) { } }

Fix:
if ( ( def != null ) && ( ! ( ExcludedDefinitions . isExcluded ( def ) ) ) ) {
Buggy code:
public class TodoServiceWithQBitServiceTest { boolean ok ; @ Test public void testCallbackWithObjectNameAndMethodName ( ) { } @ Test public void testUsingProxyWithAutoFlush ( ) { ServiceQueue serviceQueue = serviceBuilder ( ) . setServiceAddress ( "//todo-service" ) . setServiceObject ( new TodoService ( ) ) . build ( ) ; serviceQueue . start ( ) . startCallBackHandler ( ) ; TodoServiceClient todoServiceClient = serviceQueue . createProxyWithAutoFlush ( TodoServiceClient . class , 50 , TimeUnit . MILLISECONDS ) ; todoServiceClient . add ( new TodoItem ( "foo" , "foo" , null ) ) ; AtomicReference < List < TodoItem > > items = new AtomicReference < > ( ) ; todoServiceClient . list ( ( todoItems ) -> items . set ( todoItems ) ) ; <START_BUG> Sys . sleep ( 200 ) ; <END_BUG> ok = ( ( items . get ( ) ) != null ) || ( die ( ) ) ; ok = ( ( items . get ( ) . size ( ) ) > 0 ) || ( die ( ) ) ; ok = ( items . get ( ) . get ( 0 ) . getDescription ( ) . equals ( "foo" ) ) || ( die ( ) ) ; } @ Test public void testCallbackWithAddress ( ) { } }

Fix:
Sys . sleep ( 2000 ) ;
Buggy code:
public final class ResourceAdaptersAdd extends AbstractSubsystemAdd < ResourceAdaptersSubsystemElement > { private static final long serialVersionUID = - 874698675049495644L ; private ResourceAdapters resourceAdapters ; public ResourceAdapters getDatasources ( ) { } public void setResourceAdapters ( ResourceAdapters resourceAdapters ) { } protected ResourceAdaptersAdd ( ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { } @ Override protected void applyUpdateBootAction ( final BootUpdateContext updateContext ) { applyUpdate ( updateContext , NULL , null ) ; <START_BUG> updateContext . addDeploymentProcessor ( new org . jboss . as . connector . deployers . processors . ResourceAdaptersAttachingProcessor ( resourceAdapters ) , RESOURCE_ADAPTERS_ATTACHING_PROCESSOR ) ; <END_BUG> } protected ResourceAdaptersSubsystemElement createSubsystemElement ( ) { } }

Fix:
updateContext . addDeploymentProcessor ( INIT_ME , new org . jboss . as . connector . deployers . processors . ResourceAdaptersAttachingProcessor ( resourceAdapters ) , RESOURCE_ADAPTERS_ATTACHING_PROCESSOR ) ;
Buggy code:
public final class WicketTagIdentifier extends AbstractMarkupFilter { private static List wellKnownTagNames ; private final Markup markup ; public WicketTagIdentifier ( final Markup markup , final IMarkupFilter parent ) { } public MarkupElement nextTag ( ) throws ParseException { XmlTag xmlTag = ( ( XmlTag ) ( getParent ( ) . nextTag ( ) ) ) ; if ( xmlTag == null ) { return xmlTag ; } final String namespace = this . markup . getWicketNamespace ( ) ; ComponentTag tag ; if ( namespace . equalsIgnoreCase ( xmlTag . getNamespace ( ) ) ) { tag = new wicket . markup . WicketTag ( xmlTag ) ; <START_BUG> tag . setId ( tag . getName ( ) ) ; <END_BUG> 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:
tag . setId ( ( "_" + ( tag . getName ( ) ) ) ) ;
Buggy code:
public class ScheduledThreadPoolAdd extends AbstractAddStepHandler implements DescriptionProvider { static final ScheduledThreadPoolAdd INSTANCE = new ScheduledThreadPoolAdd ( ) ; static final AttributeDefinition [ ] ATTRIBUTES = new AttributeDefinition [ ] { PoolAttributeDefinitions . KEEPALIVE_TIME , PoolAttributeDefinitions . MAX_THREADS , PoolAttributeDefinitions . PROPERTIES , PoolAttributeDefinitions . THREAD_FACTORY } ; static final AttributeDefinition [ ] RW_ATTRIBUTES = new AttributeDefinition [ ] { } ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { for ( final AttributeDefinition attribute : ScheduledThreadPoolAdd . ATTRIBUTES ) { <START_BUG> attribute . validateResolvedOperation ( model ) ; <END_BUG> } final BaseOperationParameters params = ThreadsSubsystemThreadPoolOperationUtils . parseScheduledThreadPoolOperationParameters ( operation ) ; ServiceTarget target = context . getServiceTarget ( ) ; final ServiceName serviceName = ThreadsServices . executorName ( params . getName ( ) ) ; final ScheduledThreadPoolService service = new ScheduledThreadPoolService ( params . getMaxThreads ( ) . getScaledCount ( ) , params . getKeepAliveTime ( ) ) ; final ServiceBuilder < ManagedScheduledExecutorService > serviceBuilder = target . addService ( serviceName , service ) ; ThreadsSubsystemThreadPoolOperationUtils . addThreadFactoryDependency ( params . getThreadFactory ( ) , serviceName , serviceBuilder , service . getThreadFactoryInjector ( ) , target , ( ( params . getName ( ) ) + "-threads" ) ) ; serviceBuilder . addListener ( verificationHandler ) ; serviceBuilder . install ( ) ; } }

Fix:
attribute . resolveModelAttribute ( context , model ) ;
Buggy code:
public class CyberoamParser extends V1LogParser { private final Logger slog = org . slf4j . LoggerFactory . getLogger ( CyberoamParser . class ) ; @ Override public Map < String , Object > parse ( Map < String , Object > params ) { String line = ( ( String ) ( params . get ( "line" ) ) ) ; if ( line == null ) return params ; try { Map < String , Object > m = new HashMap < String , Object > ( ) ; int b = 0 ; int e = ( line . indexOf ( ">" ) ) + 1 ; StringBuilder builder = new StringBuilder ( line ) ; builder . delete ( b , e ) ; while ( ( e = builder . indexOf ( "=" , b ) ) > 0 ) { String key = builder . substring ( b , e ) ; if ( key . equals ( "src_mac" ) ) { String value = builder . substring ( ( e + 1 ) , ( e + 18 ) ) ; m . put ( key , value ) ; <START_BUG> b = e + 20 ; <END_BUG> } else { if ( ( builder . charAt ( ( e + 1 ) ) ) == '"' ) { String value = "" ; int i = e + 2 ; while ( true ) { char ch = builder . charAt ( i ) ; try { if ( ( ch == '"' ) && ( ( builder . charAt ( ( i + 1 ) ) ) == '<seq2seq4repair_space>' ) ) { value = builder . substring ( ( e + 2 ) , i ) ; break ; } i ++ ; } catch ( IndexOutOfBoundsException ex ) { value = builder . substring ( ( e + 2 ) , i ) ; break ; } } m . put ( key , value ) ; b = i + 2 ; } else { int endPos = builder . indexOf ( "<seq2seq4repair_space>" , ( e + 1 ) ) ; String value ; if ( endPos == ( - 1 ) ) { value = builder . substring ( ( e + 1 ) ) ; m . put ( key , value ) ; break ; } else { value = builder . substring ( ( e + 1 ) , endPos ) ; m . put ( key , value ) ; b = endPos + 1 ; } } } } return m ; } catch ( Throwable t ) { if ( slog . isDebugEnabled ( ) ) slog . debug ( "araqne<seq2seq4repair_space>log<seq2seq4repair_space>api:<seq2seq4repair_space>cannot<seq2seq4repair_space>parse<seq2seq4repair_space>cyberoam<seq2seq4repair_space>format<seq2seq4repair_space>-<seq2seq4repair_space>line<seq2seq4repair_space>[{}]" , line ) ; return params ; } } }

Fix:
b = e + 19 ;
Buggy code:
public final class PlayerLoginListener implements Listener { AreaShop plugin ; public PlayerLoginListener ( AreaShop plugin ) { } @ EventHandler ( priority = EventPriority . MONITOR ) public void onPlayerLogin ( PlayerLoginEvent event ) { if ( ( event . getResult ( ) ) != ( Result . ALLOWED ) ) { return ; } final Player player = event . getPlayer ( ) ; if ( ( plugin . updateAvailable ( ) ) && ( player . hasPermission ( "areashop.notifyupdate" ) ) ) { AreaShop . getInstance ( ) . message ( player , "update-playerNotify" , AreaShop . getInstance ( ) . getDescription ( ) . getVersion ( ) , AreaShop . getInstance ( ) . getUpdater ( ) . getLatestName ( ) ) ; } new BukkitRunnable ( ) { @ Override public void run ( ) { if ( ! ( plugin . isReady ( ) ) ) { return ; } if ( ! ( player . isOnline ( ) ) ) { this . cancel ( ) ; return ; } for ( RentRegion region : plugin . getFileManager ( ) . getRents ( ) ) { if ( region . isRenter ( player ) ) { String warningSetting = region . getStringSetting ( "rent.warningOnLoginTime" ) ; if ( ( warningSetting == null ) || ( warningSetting . isEmpty ( ) ) ) { continue ; } <START_BUG> long warningTime = region . durationStringToLong ( warningSetting ) ; <END_BUG> if ( ( region . getTimeLeft ( ) ) < warningTime ) { AreaShop . getInstance ( ) . message ( player , "rent-expireWarning" , region ) ; } } } this . cancel ( ) ; } } . runTaskTimer ( plugin , 25 , 25 ) ; final List < GeneralRegion > regions = new ArrayList < GeneralRegion > ( plugin . getFileManager ( ) . getRegions ( ) ) ; new BukkitRunnable ( ) { private int current = 0 ; @ Override public void run ( ) { if ( ! ( plugin . isReady ( ) ) ) { return ; } for ( int i = 0 ; i < ( plugin . getConfig ( ) . getInt ( "nameupdate.regionsPerTick" ) ) ; i ++ ) { if ( ( current ) < ( regions . size ( ) ) ) { GeneralRegion region = regions . get ( current ) ; if ( region . isOwner ( player ) ) { if ( region . isBuyRegion ( ) ) { if ( ! ( player . getName ( ) . equals ( region . getStringSetting ( "buy.buyerName" ) ) ) ) { region . setSetting ( "buy.buyerName" , player . getName ( ) ) ; region . updateRegionFlags ( ) ; region . updateSigns ( ) ; } } else if ( region . isRentRegion ( ) ) { if ( ! ( player . getName ( ) . equals ( region . getStringSetting ( "rent.renterName" ) ) ) ) { region . setSetting ( "rent.renterName" , player . getName ( ) ) ; region . updateRegionFlags ( ) ; region . updateSigns ( ) ; } } } ( current ) ++ ; } } if ( ( current ) >= ( regions . size ( ) ) ) { this . cancel ( ) ; } } } . runTaskTimer ( plugin , 22 , 1 ) ; } }

Fix:
long warningTime = plugin . durationStringToLong ( warningSetting ) ;
Buggy code:
public class HeartRateDeviceService extends DConnectMessageService { private final Logger mLogger = Logger . getLogger ( "heartrate.dplugin" ) ; private final BroadcastReceiver mSensorReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; private final Handler mHandler = new Handler ( ) ; @ Override public void onCreate ( ) { } @ Override public void onDestroy ( ) { } @ Override protected SystemProfile getSystemProfile ( ) { } @ Override protected ServiceDiscoveryProfile getServiceDiscoveryProfile ( ) { <START_BUG> return new HeartRateServiceDiscoveryProfile ( ) ; <END_BUG> } @ Override protected ServiceInformationProfile getServiceInformationProfile ( ) { } private void registerBluetoothFilter ( ) { } private void unregisterBlutoothFilter ( ) { } private HeartRateManager getManager ( ) { } }

Fix:
return new HeartRateServiceDiscoveryProfile ( this ) ;
Buggy code:
public class ChoiceRenderer implements IChoiceRenderer { private static final long serialVersionUID = 1L ; private final String displayExpression ; private final String idExpression ; public ChoiceRenderer ( ) { } public ChoiceRenderer ( String displayExpression ) { } public ChoiceRenderer ( String displayExpression , String idExpression ) { } <START_BUG> public String getDisplayValue ( Object object ) { <END_BUG> Object returnValue = object ; if ( ( ( displayExpression ) != null ) && ( object != null ) ) { returnValue = PropertyResolver . getValue ( displayExpression , object ) ; } if ( returnValue == null ) { return "" ; } return returnValue . toString ( ) ; } public String getIdValue ( Object object , int index ) { } }

Fix:
public Object getDisplayValue ( Object object ) {
Buggy code:
public class Like extends SqlClause { public Like ( Field fieldName , Serializable value ) { } @ Override public String getSign ( ) { } @ Override public SimpleExpression asRestriction ( ) { <START_BUG> return Restrictions . like ( this . getFieldName ( ) , ( ( "%" + ( this . getValue ( ) ) ) + "%" ) ) ; <END_BUG> } }

Fix:
return Restrictions . like ( this . getFieldName ( ) , ( ( "%" + ( this . getValue ( ) ) ) + "%" ) ) . ignoreCase ( ) ;
Buggy code:
public class ViewRisksClassDistributionTable extends ViewRisks < AnalysisContextRisk > { private Composite root ; private DynamicTable table ; private List < TableItem > items ; private List < DynamicTableColumn > columns ; private DecimalFormat format ; private AnalysisManager manager ; public ViewRisksClassDistributionTable ( final Composite parent , final Controller controller , final ModelPart target , final ModelPart reset ) { } @ Override public void update ( ModelEvent event ) { } @ Override protected Control createControl ( Composite parent ) { } @ Override protected AnalysisContextRisk createViewConfig ( AnalysisContext context ) { } @ Override protected void doReset ( ) { } @ Override protected void doUpdate ( final AnalysisContextRisk context ) { if ( ! ( this . isEnabled ( ) ) ) { if ( ( manager ) != null ) { manager . stop ( ) ; } this . setStatusEmpty ( ) ; return ; } Analysis analysis = new Analysis ( ) { RiskEstimateBuilderInterruptible builder = getBuilder ( context ) ; private boolean stopped = false ; private int [ ] distribution ; private double numClasses ; @ Override public int getProgress ( ) { return 0 ; } @ Override public void onError ( ) { setStatusEmpty ( ) ; } @ Override public void onFinish ( ) { if ( ( stopped ) || ( ! ( isEnabled ( ) ) ) ) { return ; } for ( final TableItem i : items ) { i . dispose ( ) ; } items . clear ( ) ; for ( int i = 0 ; i < ( distribution . length ) ; i += 2 ) { TableItem item = new TableItem ( table , SWT . NONE ) ; item . setText ( 0 , String . valueOf ( distribution [ i ] ) ) ; item . setText ( 1 , String . valueOf ( distribution [ ( i + 1 ) ] ) ) ; item . setText ( 2 , format . format ( ( ( ( ( double ) ( distribution [ ( i + 1 ) ] ) ) // ( numClasses ) ) * 100.0 ) ) ) ; items . add ( item ) ; } root . layout ( ) ; setStatusDone ( ) ; } @ Override public void onInterrupt ( ) { <START_BUG> if ( ( stopped ) || ( ! ( isEnabled ( ) ) ) ) { <END_BUG> setStatusEmpty ( ) ; } else { setStatusWorking ( ) ; } } @ Override public void run ( ) throws InterruptedException { long time = System . currentTimeMillis ( ) ; RiskModelEquivalenceClasses model = builder . getEquivalenceClassModel ( ) ; distribution = model . getEquivalenceClasses ( ) ; numClasses = model . getNumClasses ( ) ; while ( ( ( ( System . currentTimeMillis ( ) ) - time ) < ( MINIMAL_WORKING_TIME ) ) && ( ! ( stopped ) ) ) { Thread . sleep ( 10 ) ; } } @ Override public void stop ( ) { builder . interrupt ( ) ; this . stopped = true ; } } ; this . manager . start ( analysis ) ; } @ Override protected ComponentStatusLabelProgressProvider getProgressProvider ( ) { } @ Override protected ViewRisk getViewType ( ) { } protected boolean isRunning ( ) { } }

Fix:
if ( ! ( isEnabled ( ) ) ) {
Buggy code:
public final class NodeBuildingVisitor extends AbstractVisitor { private static final String DEFINE = "define" ; private NodeBuilder nodeBuilder ; private String source ; public NodeBuildingVisitor ( NodeBuilder nodeBuilder , String source ) { } @ Override public boolean visit ( InLineHtml inLineHtml ) { } @ Override public boolean visit ( InterfaceDeclaration interfaceDeclaration ) { } @ Override public boolean visit ( ClassDeclaration classDeclaration ) { } @ Override public boolean visit ( FieldsDeclaration fieldsDeclaration ) { } @ Override public boolean visit ( Include include ) { } public boolean visit ( FunctionInvocation functionInvocation ) { } @ Override public boolean visit ( ConstantDeclaration node ) { } @ Override public boolean visit ( NamespaceDeclaration node ) { } @ Override public boolean visit ( UseStatement node ) { } @ Override public boolean visit ( FunctionDeclaration functionDeclaration ) { } @ Override public boolean visit ( TryStatement tryStatement ) { } @ Override public boolean visit ( CatchClause catchClause ) { } @ Override public boolean visit ( DoStatement doStatement ) { } @ Override public boolean visit ( ForEachStatement forEachStatement ) { } @ Override public boolean visit ( ForStatement forStatement ) { } @ Override public boolean visit ( IfStatement ifStatement ) { } @ Override public boolean visit ( SwitchCase switchCase ) { } @ Override public boolean visit ( SwitchStatement switchStatement ) { } @ Override public boolean visit ( WhileStatement whileStatement ) { } @ Override public void endVisit ( CatchClause catchClause ) { } @ Override public void endVisit ( DoStatement doStatement ) { } @ Override public void endVisit ( ForEachStatement forEachStatement ) { } @ Override public void endVisit ( ForStatement forStatement ) { } @ Override public void endVisit ( IfStatement ifStatement ) { <START_BUG> if ( ( ifStatement . getTrueStatement ( ) ) != null ) { <END_BUG> nodeBuilder . handleCommonDeclarationEnd ( ) ; } if ( ( ifStatement . getFalseStatement ( ) ) != null ) { nodeBuilder . handleCommonDeclarationEnd ( ) ; } } @ Override public void endVisit ( SwitchCase switchCase ) { } @ Override public void endVisit ( SwitchStatement switchStatement ) { } @ Override public void endVisit ( TryStatement tryStatement ) { } @ Override public void endVisit ( WhileStatement whileStatement ) { } @ Override public void endVisit ( ClassDeclaration classDeclaration ) { } @ Override public void endVisit ( FunctionDeclaration functionDeclaration ) { } @ Override public void endVisit ( InterfaceDeclaration interfaceDeclaration ) { } @ Override public void endVisit ( NamespaceDeclaration namespaceDeclaration ) { } private void handleInterfaces ( List < Identifier > interfaces ) { } private PHPDocBlockImp convertToDocBlock ( PHPDocBlock docComment ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ( ifStatement . getTrueStatement ( ) ) != null ) && ( ( ifStatement . getTrueStatement ( ) . getType ( ) ) != ( ASTNode . IF_STATEMENT ) ) ) {
Buggy code:
public class SpellCheckComponentTest extends SolrTestCaseJ4 { static String rh = "spellCheckCompRH" ; @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } @ Test public void testExtendedResultsCount ( ) throws Exception { } @ Test public void test ( ) throws Exception { } @ Test public void testPerDictionary ( ) throws Exception { } @ Test public void testCollate ( ) throws Exception { assertJQ ( req ( "json.nl" , "map" , "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , SPELLCHECK_BUILD , "true" , "q" , "documemt" , SPELLCHECK_COLLATE , "true" ) , "//spellcheck//suggestions//collation=='document'" ) ; assertJQ ( req ( "json.nl" , "map" , "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , "q" , "documemt<seq2seq4repair_space>lowerfilt:broen^4" , SPELLCHECK_COLLATE , "true" ) , "//spellcheck//suggestions//collation=='document<seq2seq4repair_space>lowerfilt:brown^4'" ) ; assertJQ ( req ( "json.nl" , "map" , "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , "q" , "documemtsss<seq2seq4repair_space>broens" , SPELLCHECK_COLLATE , "true" ) , "//spellcheck//suggestions//collation=='document<seq2seq4repair_space>brown'" ) ; <START_BUG> assertJQ ( req ( "json.nl" , "map" , "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , "q" , "pixma-a-b-c-d-e-f-g" , SPELLCHECK_COLLATE , "true" ) , "//spellcheck//suggestions//collation=='pixmaa'" ) ; <END_BUG> } @ 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 { } @ Test public void testThresholdTokenFrequency ( ) throws Exception { } }

Fix:
assertJQ ( req ( "json.nl" , "map" , "qt" , SpellCheckComponentTest . rh , COMPONENT_NAME , "true" , "q" , "pixma" , SPELLCHECK_COLLATE , "true" ) , "//spellcheck//suggestions//collation=='pixmaa'" ) ;
Buggy code:
public class Snippet240 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setText ( "Text<seq2seq4repair_space>spans<seq2seq4repair_space>two<seq2seq4repair_space>columns<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>TreeItem" ) ; shell . setLayout ( new FillLayout ( ) ) ; final Tree tree = new Tree ( shell , ( ( SWT . MULTI ) | ( SWT . FULL_SELECTION ) ) ) ; tree . setHeaderVisible ( true ) ; int columnCount = 4 ; for ( int i = 0 ; i < columnCount ; i ++ ) { TreeColumn column = new TreeColumn ( tree , SWT . NONE ) ; column . setText ( ( "Column<seq2seq4repair_space>" + i ) ) ; } int itemCount = 8 ; for ( int i = 0 ; i < itemCount ; i ++ ) { TreeItem item = new TreeItem ( tree , SWT . NONE ) ; item . setText ( 0 , ( ( "item<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>a" ) ) ; item . setText ( 3 , ( ( "item<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>d" ) ) ; for ( int j = 0 ; j < 3 ; j ++ ) { TreeItem subItem = new TreeItem ( item , SWT . NONE ) ; subItem . setText ( 0 , ( ( ( ( "subItem<seq2seq4repair_space>" + i ) + "-" ) + j ) + "<seq2seq4repair_space>a" ) ) ; subItem . setText ( 3 , ( ( ( ( "subItem<seq2seq4repair_space>" + i ) + "-" ) + j ) + "<seq2seq4repair_space>d" ) ) ; } } final String string = "text<seq2seq4repair_space>that<seq2seq4repair_space>spans<seq2seq4repair_space>two<seq2seq4repair_space>columns" ; GC gc = new GC ( tree ) ; final Point extent = gc . stringExtent ( string ) ; gc . dispose ( ) ; final Color red = display . getSystemColor ( COLOR_RED ) ; Listener paintListener = new Listener ( ) { public void handleEvent ( Event event ) { switch ( event . type ) { case SWT . MeasureItem : { if ( ( ( event . index ) == 1 ) || ( ( event . index ) == 2 ) ) { event . width = ( extent . x ) // 2 ; event . height = Math . max ( event . height , ( ( extent . y ) + 2 ) ) ; } break ; } case SWT . PaintItem : { if ( ( ( event . index ) == 1 ) || ( ( event . index ) == 2 ) ) { int offset = 0 ; if ( ( event . index ) == 2 ) { TreeColumn column1 = tree . getColumn ( 1 ) ; offset = column1 . getWidth ( ) ; } event . gc . setForeground ( red ) ; int y = ( event . y ) + ( ( ( event . height ) - ( extent . y ) ) // 2 ) ; <START_BUG> event . gc . drawString ( string , ( ( event . x ) - offset ) , y ) ; <END_BUG> } break ; } } } } ; tree . addListener ( MeasureItem , paintListener ) ; tree . addListener ( PaintItem , paintListener ) ; for ( int i = 0 ; i < columnCount ; i ++ ) { tree . getColumn ( i ) . pack ( ) ; } shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
event . gc . drawString ( string , ( ( event . x ) - offset ) , y , true ) ;
Buggy code:
public class SubjectDoAsHandler implements HttpHandler { private final HttpHandler wrapped ; public SubjectDoAsHandler ( final HttpHandler toWrap ) { } @ Override public void handleRequest ( final HttpServerExchange exchange ) throws Exception { <START_BUG> final SecurityContext securityContext = exchange . getSecurityContext ( ) ; <END_BUG> final Subject useSubject ; if ( securityContext != null ) { final Account account = securityContext . getAuthenticatedAccount ( ) ; if ( account instanceof SubjectAccount ) { useSubject = ( ( SubjectAccount ) ( account ) ) . getSubject ( ) ; } else { useSubject = new Subject ( ) ; } } else { useSubject = new Subject ( ) ; } handleRequest ( exchange , useSubject ) ; } void handleRequest ( final HttpServerExchange exchange , final Subject subject ) throws Exception { } }

Fix:
final SecurityContext securityContext = exchange . getAttachment ( ATTACHMENT_KEY ) ;
Buggy code:
public class LTWWorld extends BcelWorld implements IReflectionWorld { private AnnotationFinder annotationFinder ; private ClassLoader loader ; protected static final Class concurrentMapClass = LTWWorld . makeConcurrentMapClass ( ) ; protected static Map bootstrapTypes = LTWWorld . makeConcurrentMap ( ) ; public LTWWorld ( ClassLoader loader , IMessageHandler handler , ICrossReferenceHandler xrefHandler ) { } public ClassLoader getClassLoader ( ) { } protected ReferenceTypeDelegate resolveDelegate ( ReferenceType ty ) { } protected ReferenceTypeDelegate resolveIfBootstrapDelegate ( ReferenceType ty ) { String name = ty . getName ( ) ; Reference bootRef = ( ( Reference ) ( LTWWorld . bootstrapTypes . get ( name ) ) ) ; if ( bootRef != null ) { ReferenceTypeDelegate rtd = ( ( ReferenceTypeDelegate ) ( bootRef . get ( ) ) ) ; if ( rtd != null ) { return rtd ; } } char fc = name . charAt ( 0 ) ; if ( ( ( ( fc == 'j' ) || ( fc == 'c' ) ) || ( fc == 'o' ) ) || ( fc == 's' ) ) { if ( ( ( ( ( name . startsWith ( "java" ) ) || ( name . startsWith ( "com.sun." ) ) ) || ( name . startsWith ( "org.w3c" ) ) ) || ( name . startsWith ( "sun." ) ) ) || ( name . startsWith ( "org.omg" ) ) ) { <START_BUG> ReferenceTypeDelegate bootstrapLoaderDelegate = resolveReflectionTypeDelegate ( ty , loader ) ; <END_BUG> if ( bootstrapLoaderDelegate != null ) { LTWWorld . bootstrapTypes . put ( ty . getName ( ) , new WeakReference ( bootstrapLoaderDelegate ) ) ; } return bootstrapLoaderDelegate ; } } return null ; } private ReferenceTypeDelegate resolveReflectionTypeDelegate ( ReferenceType ty , ClassLoader resolutionLoader ) { } public void loadedClass ( Class clazz ) { } private static final long serialVersionUID = 1 ; public AnnotationFinder getAnnotationFinder ( ) { } public ResolvedType resolve ( Class aClass ) { } private static Map makeConcurrentMap ( ) { } private static Class makeConcurrentMapClass ( ) { } public boolean isRunMinimalMemory ( ) { } }

Fix:
ReferenceTypeDelegate bootstrapLoaderDelegate = resolveReflectionTypeDelegate ( ty , null ) ;
Buggy code:
public class ModifyContactTest extends AbstractFolderTstCase { public ModifyContactTest ( String arg0 ) { } public void testModify ( ) throws Exception { ContactModel c = new ContactModel ( ) ; c . setNickName ( "nickname" ) ; <START_BUG> Object uid = getSourceFolder ( ) . add ( c ) ; <END_BUG> c . setNickName ( "new" ) ; getSourceFolder ( ) . modify ( uid , c ) ; IContactModel c2 = getSourceFolder ( ) . get ( uid ) ; assertEquals ( "nichname" , "new" , c2 . getNickName ( ) ) ; } }

Fix:
String uid = getSourceFolder ( ) . add ( c ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class DOMParserTestCase { @ Inject public BundleContext context ; @ Inject public Bundle bundle ; @ Deployment @ StartLevelAware ( startLevel = 4 ) public static JavaArchive createdeployment ( ) { final JavaArchive archive = ShrinkWrap . create ( JavaArchive . class , "example-xml-parser" ) ; archive . addClass ( OSGiTestSupport . class ) ; archive . addAsResource ( "osgi//xml//example-xml-parser.xml" , "example-xml-parser.xml" ) ; archive . setManifest ( new Asset ( ) { public InputStream openStream ( ) { OSGiManifestBuilder builder = OSGiManifestBuilder . newInstance ( ) ; builder . addBundleSymbolicName ( archive . getName ( ) ) ; builder . addBundleManifestVersion ( 2 ) ; <START_BUG> builder . addImportPackages ( StartLevel . class ) ; <END_BUG> return builder . openStream ( ) ; } } ) ; return archive ; } @ Test public void testDOMParser ( ) throws Exception { } private DocumentBuilder getDocumentBuilder ( ) throws ParserConfigurationException , InvalidSyntaxException { } }

Fix:
builder . addImportPackages ( StartLevel . class , DocumentBuilder . class , Document . class ) ;
Buggy code:
public abstract class AdaptiveStepsizeIntegrator extends AbstractIntegrator { public AdaptiveStepsizeIntegrator ( final String name , final double minStep , final double maxStep , final double scalAbsoluteTolerance , final double scalRelativeTolerance ) { } public AdaptiveStepsizeIntegrator ( final String name , final double minStep , final double maxStep , final double [ ] vecAbsoluteTolerance , final double [ ] vecRelativeTolerance ) { } public void setInitialStepSize ( final double initialStepSize ) { } @ Override protected void sanityChecks ( final FirstOrderDifferentialEquations equations , final double t0 , final double [ ] y0 , final double t , final double [ ] y ) throws IntegratorException { } public double initializeStep ( final FirstOrderDifferentialEquations equations , final boolean forward , final int order , final double [ ] scale , final double t0 , final double [ ] y0 , final double [ ] yDot0 , final double [ ] y1 , final double [ ] yDot1 ) throws DerivativeException { } protected double filterStep ( final double h , final boolean forward , final boolean acceptSmall ) throws IntegratorException { double filteredH = h ; if ( ( Math . abs ( h ) ) < ( minStep ) ) { if ( acceptSmall ) { filteredH = ( forward ) ? minStep : - ( minStep ) ; } else { <START_BUG> throw new IntegratorException ( "minimal<seq2seq4repair_space>step<seq2seq4repair_space>size<seq2seq4repair_space>({0})<seq2seq4repair_space>reached,<seq2seq4repair_space>integration<seq2seq4repair_space>needs<seq2seq4repair_space>{1}" , minStep , Math . abs ( h ) ) ; <END_BUG> } } if ( filteredH > ( maxStep ) ) { filteredH = maxStep ; } else if ( filteredH < ( - ( maxStep ) ) ) { filteredH = - ( maxStep ) ; } return filteredH ; } public abstract double integrate ( FirstOrderDifferentialEquations equations , double t0 , double [ ] y0 , double t , double [ ] y ) throws DerivativeException , IntegratorException { } @ Override public double getCurrentStepStart ( ) { } protected void resetInternalState ( ) { } public double getMinStep ( ) { } public double getMaxStep ( ) { } private double minStep ; private double maxStep ; private double initialStep ; protected double scalAbsoluteTolerance ; protected double scalRelativeTolerance ; protected double [ ] vecAbsoluteTolerance ; protected double [ ] vecRelativeTolerance ; }

Fix:
throw new IntegratorException ( "minimal<seq2seq4repair_space>step<seq2seq4repair_space>size<seq2seq4repair_space>({0,number,0.00E00})<seq2seq4repair_space>reached,<seq2seq4repair_space>integration<seq2seq4repair_space>needs<seq2seq4repair_space>{1,number,0.00E00}" , minStep , Math . abs ( h ) ) ;
Buggy code:
public class SharedResourceRequestTargetUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy { private final String resourceKey ; public SharedResourceRequestTargetUrlCodingStrategy ( final String mountPath , final String resourceKey ) { } public IRequestTarget decode ( RequestParameters requestParameters ) { } public CharSequence encode ( IRequestTarget requestTarget ) { } public boolean matches ( IRequestTarget requestTarget ) { if ( requestTarget instanceof ISharedResourceRequestTarget ) { <START_BUG> SharedResourceRequestTarget target = ( ( SharedResourceRequestTarget ) ( requestTarget ) ) ; <END_BUG> return target . getRequestParameters ( ) . getResourceKey ( ) . equals ( resourceKey ) ; } else return false ; } }

Fix:
ISharedResourceRequestTarget target = ( ( ISharedResourceRequestTarget ) ( requestTarget ) ) ;
Buggy code:
public class Tstamp extends Task { private Vector customFormats = new Vector ( ) ; private String prefix = "" ; public void setPrefix ( String prefix ) { } public Tstamp . CustomFormat createFormat ( ) { } public void execute ( ) throws TaskException { try { Date d = new Date ( ) ; SimpleDateFormat dstamp = new SimpleDateFormat ( "yyyyMMdd" ) ; setProperty ( ( ( prefix ) + "DSTAMP" ) , dstamp . format ( d ) ) ; SimpleDateFormat tstamp = new SimpleDateFormat ( "HHmm" ) ; setProperty ( ( ( prefix ) + "TSTAMP" ) , tstamp . format ( d ) ) ; SimpleDateFormat today = new SimpleDateFormat ( "MMMM<seq2seq4repair_space>d<seq2seq4repair_space>yyyy" , Locale . US ) ; setProperty ( ( ( prefix ) + "TODAY" ) , today . format ( d ) ) ; Enumeration i = customFormats . elements ( ) ; while ( i . hasMoreElements ( ) ) { Tstamp . CustomFormat cts = ( ( Tstamp . CustomFormat ) ( i . nextElement ( ) ) ) ; <START_BUG> cts . execute ( project , d ) ; <END_BUG> } } catch ( Exception e ) { throw new TaskException ( "Error" , e ) ; } } public static class Unit extends EnumeratedAttribute { private static final String MILLISECOND = "millisecond" ; private static final String SECOND = "second" ; private static final String MINUTE = "minute" ; private static final String HOUR = "hour" ; private static final String DAY = "day" ; private static final String WEEK = "week" ; private static final String MONTH = "month" ; private static final String YEAR = "year" ; private static final String [ ] units = new String [ ] { Tstamp . Unit . MILLISECOND , Tstamp . Unit . SECOND , Tstamp . Unit . MINUTE , Tstamp . Unit . HOUR , Tstamp . Unit . DAY , Tstamp . Unit . WEEK , Tstamp . Unit . MONTH , Tstamp . Unit . YEAR } ; private Hashtable calendarFields = new Hashtable ( ) ; public Unit ( ) { } public int getCalendarField ( ) { } public String [ ] getValues ( ) { } } public class CustomFormat { private int offset = 0 ; private int field = Calendar . DATE ; private String prefix = "" ; private String country ; private String language ; private String pattern ; private String propertyName ; private TimeZone timeZone ; private String variant ; public CustomFormat ( String prefix ) { } public void setLocale ( String locale ) throws TaskException { } public void setOffset ( int offset ) { } public void setPattern ( String pattern ) { } public void setProperty ( String propertyName ) { } public void setTimezone ( String id ) { } public void setUnit ( Tstamp . Unit unit ) { } public void execute ( Project project , Date date ) throws TaskException { } } }

Fix:
cts . execute ( getProject ( ) , d ) ;
Buggy code:
public class Player { private static final float cursorSpeed = 0.02F ; private int controllerIndex = - 1 ; private Circle drawCircle = new Circle ( 8.0F , 4.5F , 0.2F ) ; Player ( int controllerIndex ) { } public void update ( Input input , int passedTimeMS ) { } public void render ( Graphics g ) { } public int getControlerIndex ( ) { <START_BUG> return controlerIndex ; <END_BUG> } }

Fix:
return controllerIndex ;
Buggy code:
public final class NumberRange extends Range implements Serializable { private static final long serialVersionUID = 71849363892710L ; private final Number min ; private final Number max ; private transient int hashCode = 0 ; private transient String toString = null ; public NumberRange ( Number num ) { } public NumberRange ( Number num1 , Number num2 ) { } @ Override public Number getMinimumNumber ( ) { } @ Override public Number getMaximumNumber ( ) { } @ Override public boolean containsNumber ( Number number ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { if ( ( toString ) == null ) { <START_BUG> StringBuffer buf = new StringBuffer ( 32 ) ; <END_BUG> buf . append ( "Range[" ) ; buf . append ( min ) ; buf . append ( ',' ) ; buf . append ( max ) ; buf . append ( ']' ) ; toString = buf . toString ( ) ; } return toString ; } }

Fix:
StringBuilder buf = new StringBuilder ( 32 ) ;