nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PatchMergeUnitTestCase { static final String name = "jboss-client.jar" ; static final String [ ] path = new String [ ] { "bin" , "client" } ; static byte [ ] one = new byte [ ] { 'a' , 'b' , 'c' , '1' , '2' , '3' } ; static byte [ ] two = new byte [ ] { 'c' , 'd' , 'e' , '4' , '5' , '6' } ; static byte [ ] three = new byte [ ] { 'f' , 'g' , 'h' , '7' , '8' , '9' } ; static byte [ ] four = new byte [ ] { 'i' , 'j' , 'k' , '9' , '8' , '7' } ; @ Test public void testSimple ( ) throws Exception { } @ Test public void testOverrideExisting ( ) throws Exception { } @ Test public void testPreserveExisting ( ) throws Exception { } static Map < Location , PatchingTasks . ContentTaskDefinition > process ( final PatchMergeUnitTestCase . RollbackInfo ... rollbackInfos ) { final Map < Location , PatchingTasks . ContentTaskDefinition > foo = new HashMap < Location , PatchingTasks . ContentTaskDefinition > ( ) ; for ( final PatchMergeUnitTestCase . RollbackInfo info : rollbackInfos ) { <START_BUG> PatchingTasks . rollback ( info . original . getPatchId ( ) , info . original . getModifications ( ) , info . rollback . getModifications ( ) , foo , MISC_ONLY ) ; <END_BUG> } return foo ; } static PatchMergeUnitTestCase . RollbackInfo createRollbackInfo ( String id , byte [ ] ih , byte [ ] rh ) { } static PatchMergeUnitTestCase . RollbackInfo createRollbackInfo ( String id , byte [ ] oih , byte [ ] oth , byte [ ] rih , byte [ ] rth ) { } static class RollbackInfo { final Patch original ; final Patch rollback ; RollbackInfo ( Patch original , Patch rollback ) { } } static Patch createPatch ( final String id , final Patch . PatchType type , final ContentModification ... item ) { } }

Fix:
PatchingTasks . rollback ( info . original . getPatchId ( ) , info . original . getModifications ( ) , info . rollback . getModifications ( ) , foo , MISC_ONLY , false ) ;
Buggy code:
public class IMAPMailCheckingAction extends AbstractMailCheckingAction { private int accountUid ; public IMAPMailCheckingAction ( AccountItem accountItem ) { } public void check ( ) { } public boolean isCheckAll ( ) { IMAPRootFolder imapRootFolder = ( ( IMAPRootFolder ) ( treeModel . getImapFolder ( accountUid ) ) ) ; <START_BUG> return imapRootFolder . getAccountItem ( ) . getImapItem ( ) . getBoolean ( "exclude_from_checkall" , false ) ; <END_BUG> } }

Fix:
return ! ( imapRootFolder . getAccountItem ( ) . getImapItem ( ) . getBoolean ( "exclude_from_checkall" , false ) ) ;
Buggy code:
@ Component public class VerbruikServiceCached { @ Inject MeterstandRepository meterstandRepository ; @ Inject KostenRepository kostenRepository ; @ Cacheable ( cacheNames = "stroomVerbruikInPeriode" ) public Verbruik getPotentiallyCachedVerbruikInPeriode ( Energiesoort energiesoort , long vanMillis , long totEnMetMillis ) { } public Verbruik getVerbruikInPeriode ( Energiesoort energiesoort , long periodeVan , long periodeTotEnMet ) { BigDecimal totaalKosten = BigDecimal . ZERO ; BigDecimal totaalVerbruik = null ; if ( periodeVan < ( System . currentTimeMillis ( ) ) ) { List < Kosten > kostenInPeriod = kostenRepository . getKostenInPeriod ( periodeVan , periodeTotEnMet ) ; if ( CollectionUtils . isNotEmpty ( kostenInPeriod ) ) { for ( Kosten kosten : kostenInPeriod ) { long subVanMillis = kosten . getVan ( ) ; if ( subVanMillis < periodeVan ) { subVanMillis = periodeVan ; } long subTotEnMetMillis = kosten . getTotEnMet ( ) ; if ( subTotEnMetMillis > periodeTotEnMet ) { subTotEnMetMillis = periodeTotEnMet ; } BigDecimal verbruik = getVerbruik ( energiesoort , subVanMillis , subTotEnMetMillis ) ; if ( verbruik != null ) { if ( totaalVerbruik == null ) { totaalVerbruik = BigDecimal . ZERO ; } <START_BUG> totaalKosten = totaalKosten . add ( kosten . getStroomPerKwh ( ) . multiply ( verbruik ) ) ; <END_BUG> totaalVerbruik = totaalVerbruik . add ( verbruik ) ; } } } else { BigDecimal verbruik = getVerbruik ( energiesoort , periodeVan , periodeTotEnMet ) ; if ( verbruik != null ) { totaalVerbruik = verbruik ; } } } Verbruik verbruik = new Verbruik ( ) ; verbruik . setVerbruik ( totaalVerbruik ) ; if ( totaalVerbruik == null ) { verbruik . setEuro ( null ) ; } else { verbruik . setEuro ( totaalKosten . setScale ( 2 , RoundingMode . CEILING ) ) ; } return verbruik ; } private BigDecimal getVerbruik ( Energiesoort energiesoort , long periodeVan , long periodeTotEnMet ) { } }

Fix:
totaalKosten = totaalKosten . add ( kosten . getKosten ( energiesoort ) . multiply ( verbruik ) ) ;
Buggy code:
public final class PlayGame { public static void main ( final String [ ] args ) { System . out . println ( "Please<seq2seq4repair_space>enter<seq2seq4repair_space>three<seq2seq4repair_space>unique<seq2seq4repair_space>suspects<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>matches<seq2seq4repair_space>separated<seq2seq4repair_space>by<seq2seq4repair_space>commas<seq2seq4repair_space>or<seq2seq4repair_space>'q'<seq2seq4repair_space>to<seq2seq4repair_space>quit" ) ; final ThreeOfACrime threeOfACrime = new ThreeOfACrime ( ) ; final Scanner console = new Scanner ( System . in ) ; while ( console . hasNextLine ( ) ) { final String line = console . nextLine ( ) ; if ( line . equalsIgnoreCase ( "q" ) ) { break ; } final String [ ] tokens = line . split ( "," ) ; if ( ( tokens . length ) == 4 ) { <START_BUG> int matches ; <END_BUG> try { matches = Integer . parseInt ( tokens [ 3 ] ) ; } catch ( final NumberFormatException e ) { System . out . println ( "You<seq2seq4repair_space>must<seq2seq4repair_space>enter<seq2seq4repair_space>0,<seq2seq4repair_space>1,<seq2seq4repair_space>or<seq2seq4repair_space>2<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>matches" ) ; continue ; } if ( ( matches < 0 ) || ( matches > 2 ) ) { System . out . println ( "You<seq2seq4repair_space>must<seq2seq4repair_space>enter<seq2seq4repair_space>0,<seq2seq4repair_space>1,<seq2seq4repair_space>or<seq2seq4repair_space>2<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>matches" ) ; continue ; } final SuspectCard suspectCard ; try { suspectCard = SuspectCard . of ( tokens [ 0 ] , tokens [ 1 ] , tokens [ 2 ] ) ; } catch ( final IllegalArgumentException e ) { System . out . println ( e . getMessage ( ) ) ; continue ; } threeOfACrime . matchSuspects ( suspectCard , matches ) ; threeOfACrime . printSuspectCards ( ) ; if ( ( threeOfACrime . getSuspectCards ( ) . size ( ) ) == 1 ) { break ; } } else { System . out . println ( "You<seq2seq4repair_space>must<seq2seq4repair_space>enter<seq2seq4repair_space>three<seq2seq4repair_space>suspects<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>matches" ) ; } } } }

Fix:
final int matches ;
Buggy code:
public class TypeXTestCase extends TestCase { public TypeXTestCase ( String name ) { } public void testUnresolvedTypes ( ) { } public void testNameAndSigWithInners ( ) { } public void testNameAndSigWithParameters ( ) { } public void testTypexGenericSignatureProcessing ( ) { } public void testTypeXForParameterizedTypes ( ) { TypeX stringType = TypeX . forName ( "java//lang//String" ) ; <START_BUG> TypeX listOfStringType = TypeX . forParameterizedTypes ( "java//util//List" , new TypeX [ ] { stringType } ) ; <END_BUG> assertEquals ( "1<seq2seq4repair_space>type<seq2seq4repair_space>param" , 1 , listOfStringType . typeParameters . length ) ; assertEquals ( stringType , listOfStringType . typeParameters [ 0 ] ) ; assertTrue ( listOfStringType . isParameterized ( ) ) ; assertFalse ( listOfStringType . isGeneric ( ) ) ; } private void checkTX ( TypeX tx , boolean shouldBeParameterized , int numberOfTypeParameters ) { } private void isPrimitiveTest ( TypeX [ ] types , boolean [ ] isPrimitives ) { } private void sizeTest ( TypeX [ ] types , int [ ] sizes ) { } private void arrayTest ( TypeX [ ] types , String [ ] components ) { } private void nameSignatureTest ( String [ ] ns , String [ ] ss ) { } }

Fix:
TypeX listOfStringType = TypeX . forParameterizedTypes ( TypeX . forName ( "java//util//List" ) , new TypeX [ ] { stringType } ) ;
Buggy code:
public class WorkspaceSetupHelper { private static final int MAX_RETRY = 10 ; private static final String HELPER_CONTEXT_ID = "helper-context" ; private static boolean isSetup = false ; private static InteractionContext taskscape ; private static IJavaProject project1 ; private static IJavaProject project2 ; private static TestJavaProject jdtCoreDomProject ; private static IWorkspaceRoot workspaceRoot ; private static final IProgressMonitor NULL_MONITOR = new NullProgressMonitor ( ) ; public static IJavaProject createJavaPluginProjectFromZip ( Object source , String projectName , String zipFileName ) throws IOException , ZipException , CoreException { } public static IJavaProject createJavaPluginProjectFromDirectory ( File sourceDirectory , String projectName ) throws IOException , ZipException , CoreException { IProject project = WorkspaceSetupHelper . createProject ( projectName ) ; <START_BUG> CommonTestUtil . copyFolder ( sourceDirectory , project . getLocation ( ) . toFile ( ) ) ; <END_BUG> project . refreshLocal ( IResource . DEPTH_INFINITE , null ) ; IJavaProject javaProject = WorkspaceSetupHelper . createPluginProject ( project ) ; return javaProject ; } public static IJavaProject createPluginProject ( IProject project ) throws CoreException , JavaModelException { } public static IProject createProject ( String projectName ) throws CoreException { } public static void clearWorkspace ( ) throws IOException , CoreException { } public static IWorkspaceRoot setupWorkspace ( ) throws IOException , InterruptedException , InvocationTargetException , CoreException { } public static void delete ( final IResource resource ) throws CoreException { } public static void deleteProject ( String projectName ) throws CoreException { } public static void clearDoiModel ( ) throws CoreException { } public static InteractionContext getContext ( ) throws IOException , InterruptedException , InvocationTargetException , CoreException { } public static IJavaProject getJdtCoreDomProject ( ) throws IOException , InterruptedException , InvocationTargetException , CoreException { } public static IJavaProject getProject1 ( ) throws IOException , InterruptedException , InvocationTargetException , CoreException { } public static IJavaProject getProject2 ( ) throws IOException , InterruptedException , InvocationTargetException , CoreException { } public static IWorkspaceRoot getWorkspaceRoot ( ) throws IOException , InterruptedException , InvocationTargetException , CoreException { } public static IFile getFile ( IJavaProject jp , String name ) throws JavaModelException { } public static IType getType ( IJavaProject jp , String fullyQualifiedName ) throws JavaModelException { } public static IMethod getMethod ( IType t , String methodName , String [ ] params ) { } }

Fix:
CommonTestUtil . copyFolderRecursively ( sourceDirectory , project . getLocation ( ) . toFile ( ) ) ;
Buggy code:
public class CatchClause extends ASTNode { public static final ChildPropertyDescriptor EXCEPTION_PROPERTY = new ChildPropertyDescriptor ( CatchClause . class , "exception" , SingleVariableDeclaration . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( CatchClause . class , "body" , Block . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Block body = null ; private SingleVariableDeclaration exceptionDecl = null ; CatchClause ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { CatchClause result = new CatchClause ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setBody ( ( ( Block ) ( getBody ( ) . clone ( target ) ) ) ) ; result . setException ( ( ( SingleVariableDeclaration ) ( ASTNode . copySubtree ( target , getException ( ) ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SingleVariableDeclaration getException ( ) { } public void setException ( SingleVariableDeclaration exception ) { } public Block getBody ( ) { } public void setBody ( Block body ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public abstract class AbstractMapperTest extends TestCase { public AbstractMapperTest ( ) { } protected TestMapperContext context = new TestMapperContext ( ) ; @ Override protected void setUp ( ) throws Exception { } protected Request getRequest ( final Url url ) { return new Request ( ) { @ Override public Url getUrl ( ) { return url ; } @ Override public Locale getLocale ( ) { return null ; } @ Override public Charset getCharset ( ) { return Charset . forName ( "UTF-8" ) ; } @ Override <START_BUG> public Url getBaseUrl ( ) { <END_BUG> return url ; } } ; } protected void checkPage ( IRequestablePage page , int id ) { } }

Fix:
public Url getClientUrl ( ) {
Buggy code:
public class UnaryComparisonOperatorNode extends UnaryOperatorNode { public ValueNode bindExpression ( FromList fromList , SubqueryList subqueryList , Vector aggregateVector ) throws StandardException { } public void bindComparisonOperator ( ) throws StandardException { } ValueNode eliminateNots ( boolean underNotNode ) throws StandardException { } UnaryOperatorNode getNegation ( ValueNode operand ) throws StandardException { } public ColumnReference getColumnOperand ( Optimizable optTable , int columnPosition ) { } public ColumnReference getColumnOperand ( Optimizable optTable ) { } public ValueNode getOperand ( ColumnReference cRef , int refSetSize , boolean otherSide ) { } public boolean selfComparison ( ColumnReference cr ) { } public ValueNode getExpressionOperand ( int tableNumber , int columnNumber , FromTable ft ) { } public void generateExpressionOperand ( Optimizable optTable , int columnPosition , ExpressionClassBuilder acb , MethodBuilder mb ) throws StandardException { } public int getStartOperator ( Optimizable optTable ) { } public int getStopOperator ( Optimizable optTable ) { } public void generateOrderedNulls ( MethodBuilder mb ) { } public void generateQualMethod ( ExpressionClassBuilder acb , MethodBuilder mb , Optimizable optTable ) throws StandardException { } public void generateAbsoluteColumnId ( MethodBuilder mb , Optimizable optTable ) { } public void generateRelativeColumnId ( MethodBuilder mb , Optimizable optTable ) { } private int getAbsoluteColumnPosition ( Optimizable optTable ) { ColumnReference cr = ( ( ColumnReference ) ( operand ) ) ; int columnPosition ; ConglomerateDescriptor bestCD ; columnPosition = cr . getSource ( ) . getColumnPosition ( ) ; bestCD = optTable . getTrulyTheBestAccessPath ( ) . getConglomerateDescriptor ( ) ; if ( bestCD . isIndex ( ) ) { <START_BUG> columnPosition = bestCD . getIndexDescriptor ( ) . getKeyColumnPosition ( new Integer ( columnPosition ) ) . intValue ( ) ; <END_BUG> if ( SanityManager . DEBUG ) { SanityManager . ASSERT ( ( columnPosition > 0 ) , "Base<seq2seq4repair_space>column<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>index" ) ; } } return columnPosition - 1 ; } public boolean orderedNulls ( ) { } public boolean isQualifier ( Optimizable optTable , boolean forPush ) { } public int getOrderableVariantType ( Optimizable optTable ) throws StandardException { } }

Fix:
columnPosition = bestCD . getIndexDescriptor ( ) . getKeyColumnPosition ( columnPosition ) ;
Buggy code:
public class MenuState extends State { private TextImage title ; private float transitionVal ; private boolean startTransition ; public MenuState ( GSM gsm ) { } public void handleInput ( ) { <START_BUG> if ( input . justTouched ( ) ) { <END_BUG> mouse . set ( input . getX ( ) , input . getY ( ) , 0 ) ; cam . unproject ( mouse ) ; startTransition = true ; transitionVal = 0.0F ; } } private void transition ( float dt ) { } public void update ( float dt ) { } public void render ( SpriteBatch sb ) { } public void shapeRender ( ShapeRenderer sr ) { } }

Fix:
if ( ( input . justTouched ( ) ) && ( ! ( startTransition ) ) ) {
Buggy code:
public class SampleSubjectType implements EntitlementSubject { public static final String NAME_FIELD = "name" ; private String name ; public String getName ( ) { } public void setName ( String name ) { } @ Override public void setState ( String state ) { } @ Override public String getState ( ) { } @ Override public Map < String , Set < String > > getSearchIndexAttributes ( ) { } @ Override public Set < String > getRequiredAttributeNames ( ) { } @ Override public SubjectDecision evaluate ( String realm , SubjectAttributesManager mgr , Subject subject , String resourceName , Map < String , Set < String > > environment ) throws EntitlementException { boolean authorized = false ; for ( Principal principal : subject . getPrincipals ( ) ) { String userDn = principal . getName ( ) ; int start = userDn . indexOf ( '=' ) ; int end = userDn . indexOf ( ',' ) ; if ( end <= start ) { <START_BUG> throw new EntitlementException ( EntitlementException . CONDITION_EVALUTATION_FAILED , ( "Name<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>DN:<seq2seq4repair_space>" + userDn ) ) ; <END_BUG> } String userName = userDn . substring ( ( start + 1 ) , end ) ; if ( userName . equals ( getName ( ) ) ) { authorized = true ; } } return new SubjectDecision ( authorized , Collections . EMPTY_MAP ) ; } @ Override public boolean isIdentity ( ) { } }

Fix:
throw new EntitlementException ( EntitlementException . CONDITION_EVALUATION_FAILED , ( "Name<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>DN:<seq2seq4repair_space>" + userDn ) ) ;
Buggy code:
public class ImportAction extends AbstractColumbaAction implements ActionListener { public ImportAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> new ImportWizardLauncher ( ) . launchWizard ( ) ; <END_BUG> } }

Fix:
new org . columba . mail . gui . config . mailboximport . ImportWizardLauncher ( getFrameMediator ( ) ) . launchWizard ( ) ;
Buggy code:
public class Test_org_eclipse_swt_graphics_Image extends SwtPerformanceTestCase { public Test_org_eclipse_swt_graphics_Image ( String name ) { } public static void main ( String [ ] args ) { } protected void setUp ( ) throws Exception { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceII ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageI ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_Rectangle ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageData ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLorg_eclipse_swt_graphics_ImageDataLorg_eclipse_swt_graphics_ImageData ( ) { final int COUNT = 4000 ; Image [ ] images = new Image [ COUNT ] ; String name = getPath ( ( ( ( imageFilenames [ 0 ] ) + "." ) + ( imageFormats [ 0 ] ) ) ) ; FileInputStream inStream = null ; try { inStream = new FileInputStream ( name ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } ImageData imageData = new ImageLoader ( ) . load ( inStream ) [ 0 ] ; <START_BUG> ImageData imageData1 = new ImageData ( imageData . width , imageData . height , 4 , new PaletteData ( new RGB [ ] { new RGB ( 0 , 0 , 0 ) } ) ) ; <END_BUG> try { inStream . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } PerformanceMeter meter = createMeter ( "Image<seq2seq4repair_space>constr.(Device,ImageData,ImageData)" ) ; meter . start ( ) ; for ( int i = 0 ; i < COUNT ; i ++ ) { images [ i ] = new Image ( display , imageData , imageData1 ) ; } meter . stop ( ) ; for ( int i = 0 ; i < COUNT ; i ++ ) { images [ i ] . dispose ( ) ; } disposeMeter ( meter ) ; } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_io_InputStream ( ) { } public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_lang_String ( ) { } public void test_dispose ( ) { } public void test_equalsLjava_lang_Object ( ) { } public void test_getBackground ( ) { } public void test_getBounds ( ) { } public void test_getImageData ( ) { } public void test_hashCode ( ) { } public void test_isDisposed ( ) { } public void test_setBackgroundLorg_eclipse_swt_graphics_Color ( ) { } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } Display display ; }

Fix:
ImageData imageData1 = new ImageData ( imageData . width , imageData . height , 1 , new PaletteData ( new RGB [ ] { new RGB ( 0 , 0 , 0 ) , new RGB ( 255 , 255 , 255 ) } ) ) ;
Buggy code:
public class Coverage extends Task { protected Commandline cmdl = new Commandline ( ) ; protected CommandlineJava cmdlJava = new CommandlineJava ( ) ; protected String function = "coverage" ; protected boolean applet = false ; protected String exitPrompt = "never" ; protected Filters filters = new Filters ( ) ; protected String finalSnapshot = "coverage" ; protected String recordFromStart = "coverage" ; protected boolean trackNatives = false ; protected int warnLevel = 0 ; protected Vector filesets = new Vector ( ) ; protected File home ; protected File inputFile ; protected File javaExe ; protected String seedName ; protected File snapshotDir ; protected Socket socket ; protected Triggers triggers ; protected String vm ; protected File workingDir ; public Coverage ( ) { } public void setApplet ( boolean value ) { } public void setClassname ( String value ) { } public void setExitprompt ( String value ) { } public void setFinalsnapshot ( String value ) { } public void setHome ( File value ) { } public void setInputfile ( File value ) { } public void setJavaexe ( File value ) { } public void setRecordfromstart ( Coverage . Recordfromstart value ) { } public void setSeedname ( String value ) { } public void setSnapshotdir ( File value ) { } public void setTracknatives ( boolean value ) { } public void setVm ( Coverage . Javavm value ) { } public void setWarnlevel ( Integer value ) { } public void setWorkingdir ( File value ) { } public void addFileset ( FileSet fs ) { } public Argument createArg ( ) { } public Path createClasspath ( ) { <START_BUG> return cmdlJava . createClasspath ( project ) . createPath ( ) ; <END_BUG> } public Filters createFilters ( ) { } public Argument createJvmarg ( ) { } public Socket createSocket ( ) { } public Triggers createTriggers ( ) { } public void execute ( ) throws TaskException { } protected String [ ] getParameters ( ) throws TaskException { } protected void checkOptions ( ) throws TaskException { } protected File createParamFile ( ) throws TaskException { } protected File createTmpFile ( ) { } public static class Finalsnapshot extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public static class Javavm extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public static class Recordfromstart extends EnumeratedAttribute { public String [ ] getValues ( ) { } } static class CoverageStreamHandler extends LogStreamHandler { CoverageStreamHandler ( Task task ) { } public void setProcessInputStream ( OutputStream os ) { } } }

Fix:
return cmdlJava . createClasspath ( getProject ( ) ) . createPath ( ) ;
Buggy code:
public class XMLGrammarPreparser { protected static final String SYMBOL_TABLE = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SYMBOL_TABLE_PROPERTY ) ; protected static final String ERROR_REPORTER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ERROR_REPORTER_PROPERTY ) ; protected static final String ERROR_HANDLER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ERROR_HANDLER_PROPERTY ) ; protected static final String ENTITY_RESOLVER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ENTITY_RESOLVER_PROPERTY ) ; protected static final String GRAMMAR_POOL = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . XMLGRAMMAR_POOL_PROPERTY ) ; private static final Hashtable KNOWN_LOADERS = new Hashtable ( ) ; private static final String [ ] RECOGNIZED_PROPERTIES = new String [ ] { XMLGrammarPreparser . SYMBOL_TABLE , XMLGrammarPreparser . ERROR_REPORTER , XMLGrammarPreparser . ERROR_HANDLER , XMLGrammarPreparser . ENTITY_RESOLVER , XMLGrammarPreparser . GRAMMAR_POOL } ; protected SymbolTable fSymbolTable ; protected XMLErrorReporter fErrorReporter ; protected XMLEntityResolver fEntityResolver ; protected XMLGrammarPool fGrammarPool ; protected Locale fLocale ; private Hashtable fLoaders ; public XMLGrammarPreparser ( ) { } public XMLGrammarPreparser ( SymbolTable symbolTable ) { } public boolean registerPreparser ( String grammarType , XMLGrammarLoader loader ) { if ( loader == null ) { if ( XMLGrammarPreparser . KNOWN_LOADERS . containsKey ( grammarType ) ) { String loaderName = ( ( String ) ( XMLGrammarPreparser . KNOWN_LOADERS . get ( grammarType ) ) ) ; try { ClassLoader cl = ObjectFactory . findClassLoader ( ) ; <START_BUG> XMLGrammarLoader gl = ( ( XMLGrammarLoader ) ( ObjectFactory . newInstance ( loaderName , cl ) ) ) ; <END_BUG> fLoaders . put ( grammarType , gl ) ; } catch ( Exception e ) { return false ; } return true ; } return false ; } fLoaders . put ( grammarType , loader ) ; return true ; } public Grammar preparseGrammar ( String type , XMLInputSource is ) throws IOException , XNIException { } public void setLocale ( Locale locale ) { } public Locale getLocale ( ) { } public void setErrorHandler ( XMLErrorHandler errorHandler ) { } public XMLErrorHandler getErrorHandler ( ) { } public void setEntityResolver ( XMLEntityResolver entityResolver ) { } public XMLEntityResolver getEntityResolver ( ) { } public void setGrammarPool ( XMLGrammarPool grammarPool ) { } public XMLGrammarPool getGrammarPool ( ) { } public XMLGrammarLoader getLoader ( String type ) { } public void setFeature ( String featureId , boolean value ) { } public void setProperty ( String propId , Object value ) { } public boolean getFeature ( String type , String featureId ) { } public Object getProperty ( String type , String propertyId ) { } }

Fix:
XMLGrammarLoader gl = ( ( XMLGrammarLoader ) ( ObjectFactory . newInstance ( loaderName , cl , true ) ) ) ;
Buggy code:
public class RegistryActor extends UntypedActor { LoggingAdapter log = Logging . getLogger ( getContext ( ) . system ( ) , this ) ; private MediatorConfig config ; protected ActorRef resolvePatientIDActor ; private ActorRef requestHandler ; private String xForwardedFor ; private String messageBuffer ; private Identifier patientIdBuffer ; public RegistryActor ( MediatorConfig config ) { } private void parseMessage ( MediatorHTTPRequest request ) { } private void lookupEnterpriseIdentifier ( ) { } private void enrichEnterpriseIdentifier ( ResolvePatientIdentifierResponse msg ) { } private void forwardEnrichedMessage ( EnrichRegistryStoredQueryResponse msg ) { } private void finalizeResponse ( MediatorHTTPResponse response ) { } private void sendAuditMessage ( ATNAAudit . TYPE type ) { } @ Override public void onReceive ( Object msg ) throws Exception { if ( msg instanceof MediatorHTTPRequest ) { log . info ( "Parsing<seq2seq4repair_space>registry<seq2seq4repair_space>stored<seq2seq4repair_space>query<seq2seq4repair_space>request..." ) ; parseMessage ( ( ( MediatorHTTPRequest ) ( msg ) ) ) ; } else if ( msg instanceof ParsedRegistryStoredQuery ) { log . info ( "Parsed<seq2seq4repair_space>contents.<seq2seq4repair_space>Resolving<seq2seq4repair_space>patient<seq2seq4repair_space>enterprise<seq2seq4repair_space>identifier..." ) ; patientIdBuffer = ( ( ParsedRegistryStoredQuery ) ( msg ) ) . getPatientId ( ) ; lookupEnterpriseIdentifier ( ) ; sendAuditMessage ( REGISTRY_QUERY_RECEIVED ) ; } else if ( msg instanceof ResolvePatientIdentifierResponse ) { enrichEnterpriseIdentifier ( ( ( ResolvePatientIdentifierResponse ) ( msg ) ) ) ; } else if ( msg instanceof EnrichRegistryStoredQueryResponse ) { log . info ( "Sending<seq2seq4repair_space>enriched<seq2seq4repair_space>request<seq2seq4repair_space>to<seq2seq4repair_space>XDS.b<seq2seq4repair_space>Registry" ) ; forwardEnrichedMessage ( ( ( EnrichRegistryStoredQueryResponse ) ( msg ) ) ) ; } else if ( msg instanceof MediatorHTTPResponse ) { log . info ( "Received<seq2seq4repair_space>response<seq2seq4repair_space>from<seq2seq4repair_space>XDS.b<seq2seq4repair_space>Registry" ) ; finalizeResponse ( ( ( MediatorHTTPResponse ) ( msg ) ) ) ; <START_BUG> sendAuditMessage ( REGISTRY_QUERY_RESPONSE ) ; <END_BUG> } else { unhandled ( msg ) ; } } }

Fix:
sendAuditMessage ( REGISTRY_QUERY_ENRICHED ) ;
Buggy code:
public class ProcessTracker { public static boolean isResultStored ( DBConnPool dbConnPool , long reNum ) throws Exception , TimeoutException { boolean retBoolean = false ; if ( true ) { Boolean result = RunEntryCore . getResult ( dbConnPool , reNum ) ; <START_BUG> retBoolean = ( result != null ) && ( ( result . booleanValue ( ) ) == true ) ; <END_BUG> } return retBoolean ; } private RunnerService runnerService = null ; public ProcessTracker ( RunnerService runnerService ) { } public boolean isRunning ( long reNum ) throws Exception , TimeoutException { } No newline ; at end ; of file ; }

Fix:
retBoolean = result != null ;
Buggy code:
public class JMSBridgeAdd extends AbstractAddStepHandler { public static final JMSBridgeAdd INSTANCE = new JMSBridgeAdd ( ) ; private JMSBridgeAdd ( ) { } @ 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 { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; String moduleName = resolveAttribute ( MODULE , context , model ) ; final JMSBridge bridge = createJMSBridge ( context , model ) ; final String bridgeName = address . getLastElement ( ) . getValue ( ) ; final JMSBridgeService bridgeService = new JMSBridgeService ( moduleName , bridgeName , bridge ) ; final ServiceName bridgeServiceName = MessagingServices . getJMSBridgeServiceName ( bridgeName ) ; final ServiceBuilder < JMSBridge > jmsBridgeServiceBuilder = context . getServiceTarget ( ) . addService ( bridgeServiceName , bridgeService ) . addListener ( verificationHandler ) . addDependency ( JBOSS_TXN_TRANSACTION_MANAGER ) . setInitialMode ( ACTIVE ) ; addServerExecutorDependency ( jmsBridgeServiceBuilder , bridgeService . getExecutorInjector ( ) , false ) ; if ( dependsOnLocalResources ( model , SOURCE_CONTEXT ) ) { addDependencyForJNDIResource ( jmsBridgeServiceBuilder , model , context , SOURCE_CONNECTION_FACTORY ) ; addDependencyForJNDIResource ( jmsBridgeServiceBuilder , model , context , SOURCE_DESTINATION ) ; } if ( dependsOnLocalResources ( model , TARGET_CONTEXT ) ) { addDependencyForJNDIResource ( jmsBridgeServiceBuilder , model , context , TARGET_CONNECTION_FACTORY ) ; addDependencyForJNDIResource ( jmsBridgeServiceBuilder , model , context , TARGET_DESTINATION ) ; } newControllers . add ( jmsBridgeServiceBuilder . install ( ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } } , RUNTIME ) ; } private boolean dependsOnLocalResources ( ModelNode model , AttributeDefinition attr ) throws OperationFailedException { } private void addDependencyForJNDIResource ( final ServiceBuilder < JMSBridge > builder , final ModelNode model , final OperationContext context , final AttributeDefinition attribute ) throws OperationFailedException { } private JMSBridge createJMSBridge ( OperationContext context , ModelNode model ) throws OperationFailedException { } private Properties resolveContextProperties ( AttributeDefinition attribute , OperationContext context , ModelNode model ) throws OperationFailedException { } private String resolveAttribute ( SimpleAttributeDefinition attr , OperationContext context , ModelNode model ) throws OperationFailedException { } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public abstract class CodePiece { <START_BUG> public abstract String getText ( ) ; <END_BUG> public abstract int getStartPosition ( ) { } public abstract int getEndPosition ( ) { } public abstract int getStartLine ( ) { } public abstract int getEndLine ( ) { } }

Fix:
public abstract StringBuffer getText ( ) ;
Buggy code:
public class IronJacamarDeploymentParsingProcessor implements DeploymentUnitProcessor { public IronJacamarDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final ResourceRoot resourceRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile deploymentRoot = resourceRoot . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) return ; <START_BUG> final String deploymentRootName = deploymentRoot . getLowerCaseName ( ) ; <END_BUG> VirtualFile serviceXmlFile = null ; if ( deploymentRootName . endsWith ( ".rar" ) ) { serviceXmlFile = deploymentRoot . getChild ( "//META-INF//ironjacamar.xml" ) ; } if ( ( serviceXmlFile == null ) || ( ! ( serviceXmlFile . exists ( ) ) ) ) return ; InputStream xmlStream = null ; IronJacamar result = null ; try { xmlStream = serviceXmlFile . openStream ( ) ; result = new IronJacamarParser ( ) . parse ( xmlStream ) ; if ( result != null ) { IronJacamarXmlDescriptor xmlDescriptor = new IronJacamarXmlDescriptor ( result ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; } else throw ConnectorMessages . MESSAGES . failedToParseServiceXml ( serviceXmlFile ) ; } catch ( Exception e ) { throw ConnectorMessages . MESSAGES . failedToParseServiceXml ( e , serviceXmlFile ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final String deploymentRootName = deploymentRoot . getName ( ) . toLowerCase ( ) ;
Buggy code:
public final class SlopeOnePrefsToDiffsJob { private SlopeOnePrefsToDiffsJob ( ) { } public static void main ( String [ ] args ) throws IOException { } public static JobConf buildJobConf ( String prefsFile , String outputPath ) throws IOException { Path prefsFilePath = new Path ( prefsFile ) ; Path outputPathPath = new Path ( outputPath ) ; JobConf jobConf = new JobConf ( SlopeOnePrefsToDiffsJob . class ) ; <START_BUG> FileSystem fs = FileSystem . get ( jobConf ) ; <END_BUG> if ( fs . exists ( outputPathPath ) ) { fs . delete ( outputPathPath , true ) ; } jobConf . setInputFormat ( TextInputFormat . class ) ; FileInputFormat . setInputPaths ( jobConf , prefsFilePath ) ; jobConf . setMapperClass ( SlopeOnePrefsToDiffsMapper . class ) ; jobConf . setMapOutputKeyClass ( Text . class ) ; jobConf . setMapOutputValueClass ( ItemPrefWritable . class ) ; jobConf . setReducerClass ( SlopeOnePrefsToDiffsReducer . class ) ; jobConf . setOutputKeyClass ( ItemItemWritable . class ) ; jobConf . setOutputValueClass ( DoubleWritable . class ) ; jobConf . setOutputFormat ( SequenceFileOutputFormat . class ) ; SequenceFileOutputFormat . setOutputCompressionType ( jobConf , RECORD ) ; FileOutputFormat . setOutputPath ( jobConf , outputPathPath ) ; return jobConf ; } }

Fix:
FileSystem fs = FileSystem . get ( outputPathPath . toUri ( ) , jobConf ) ;
Buggy code:
public class TypeActivity extends BaseActivity { private MyEditText mMyEditTextName ; private Button mButtonAddType ; private Dao < OptionValue , Integer > optionValueDao ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_type ) ; DatabaseHelper databaseHelper = OpenHelperManager . getHelper ( this , DatabaseHelper . class ) ; optionValueDao = databaseHelper . getOptionValueDao ( ) ; HeadView headView = ( ( HeadView ) ( findViewById ( head_view ) ) ) ; headView . setTitleText ( "增加规格" ) ; mMyEditTextName = ( ( MyEditText ) ( findViewById ( type_name ) ) ) ; mButtonAddType = ( ( Button ) ( findViewById ( add_type ) ) ) ; mMyEditTextName . setTitle ( "规格" ) ; mButtonAddType . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { String typeValue = mMyEditTextName . getText ( ) . trim ( ) ; if ( StringUtil . isEmpty ( typeValue ) ) { ToastUtil . shortShow ( TypeActivity . this , "规格名字不能为空!" ) ; return ; } Map < String , Object > params = new HashMap < > ( ) ; params . put ( "option_value" , typeValue ) ; <START_BUG> params . put ( "is_deleted" , 0 ) ; <END_BUG> try { List < OptionValue > values = optionValueDao . queryForFieldValues ( params ) ; if ( ( values . size ( ) ) > 0 ) { ToastUtil . shortShow ( TypeActivity . this , "规格已经存在!" ) ; return ; } } catch ( SQLException e ) { e . printStackTrace ( ) ; } OptionValue optionValue = new OptionValue ( ) ; optionValue . setOptionValue ( typeValue ) ; optionValue . setOptionId ( 1 ) ; try { int result = optionValueDao . create ( optionValue ) ; if ( 1 == result ) { ToastUtil . shortShow ( TypeActivity . this , "添加规格成功" ) ; } TypeActivity . this . finish ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } } ) ; } }

Fix:
params . put ( "is_deleted" , false ) ;
Buggy code:
public class Cab extends MatchingTask { private ArrayList m_filesets = new ArrayList ( ) ; private boolean m_compress = true ; private File m_baseDir ; private File m_cabFile ; private String m_options ; public void setBasedir ( final File baseDir ) { } public void setCabfile ( final File cabFile ) { } public void setCompress ( final boolean compress ) { } public void setOptions ( final String options ) { } public void addFileset ( final FileSet set ) { } public void execute ( ) throws TaskException { } protected ArrayList getFileList ( ) throws TaskException { } protected boolean isUpToDate ( ArrayList files ) { } protected void appendFiles ( ArrayList files , DirectoryScanner ds ) { } protected void checkConfiguration ( ) throws TaskException { } protected Commandline createCommand ( final File listFile ) throws TaskException { final Commandline cmd = new Commandline ( ) ; cmd . setExecutable ( "cabarc" ) ; cmd . addArgument ( "-r" ) ; cmd . addArgument ( "-p" ) ; if ( ! ( m_compress ) ) { cmd . addArgument ( "-m" ) ; cmd . addArgument ( "none" ) ; } if ( ( m_options ) != null ) { <START_BUG> cmd . createArgument ( ) . setLine ( m_options ) ; <END_BUG> } cmd . addArgument ( "n" ) ; cmd . addArgument ( m_cabFile ) ; cmd . addArgument ( ( "@" + ( listFile . getAbsolutePath ( ) ) ) ) ; return cmd ; } protected File createListFile ( ArrayList files ) throws IOException { } }

Fix:
cmd . addLine ( m_options ) ;
Buggy code:
public class WorkbenchLayoutSettingsTransfer extends WorkbenchSettingsTransfer { public WorkbenchLayoutSettingsTransfer ( ) { } public XMLMemento recordSharableWorkbenchState ( ) { } private IStatus saveSettings ( XMLMemento memento ) { } private IStatus saveState ( WorkbenchWindow window , IMemento memento ) { } private IStatus saveState ( WorkbenchPage page , IMemento memento ) { } private void saveEditorState ( IMemento memento ) { } private String getCurrentPresentationClassName ( ) { String currentPresentationFactoryId = PrefUtil . getAPIPreferenceStore ( ) . getString ( PRESENTATION_FACTORY_ID ) ; AbstractPresentationFactory factory = WorkbenchPlugin . getDefault ( ) . getPresentationFactory ( currentPresentationFactoryId ) ; if ( factory == null ) <START_BUG> factory = WorkbenchPlugin . getDefault ( ) . getPresentationFactory ( "org.eclipse.ui.presentations.default" ) ; <END_BUG> return factory . getClass ( ) . getName ( ) ; } private IWorkbench getWorkbench ( ) { } public IStatus transferSettings ( IPath newWorkspaceRoot ) { } private File createFileAndDirectories ( IPath newWorkspaceRoot ) { } public String getName ( ) { } }

Fix:
factory = WorkbenchPlugin . getDefault ( ) . getPresentationFactory ( DEFAULT_PRESENTATION_ID ) ;
Buggy code:
public class TestUnitVectorizerJob extends MahoutTestCase { private static final double [ ] [ ] RAW = new double [ ] [ ] { new double [ ] { 1 , 2 , 3 } , new double [ ] { 4 , 5 , 6 } , new double [ ] { 7 , 8 , 9 } } ; @ Test public void testUnitVectorizerMapper ( ) throws Exception { UnitVectorizerMapper mapper = new UnitVectorizerMapper ( ) ; <START_BUG> Configuration conf = new Configuration ( ) ; <END_BUG> DummyRecordWriter < IntWritable , VectorWritable > writer = new DummyRecordWriter < IntWritable , VectorWritable > ( ) ; Context context = DummyRecordWriter . build ( mapper , conf , writer ) ; for ( int i = 0 ; i < ( TestUnitVectorizerJob . RAW . length ) ; i ++ ) { Vector vector = new RandomAccessSparseVector ( TestUnitVectorizerJob . RAW [ i ] . length ) ; vector . assign ( TestUnitVectorizerJob . RAW [ i ] ) ; mapper . map ( new IntWritable ( i ) , new VectorWritable ( vector ) , context ) ; } assertEquals ( "Number<seq2seq4repair_space>of<seq2seq4repair_space>map<seq2seq4repair_space>results" , TestUnitVectorizerJob . RAW . length , writer . getData ( ) . size ( ) ) ; for ( int i = 0 ; i < ( TestUnitVectorizerJob . RAW . length ) ; i ++ ) { IntWritable key = new IntWritable ( i ) ; List < VectorWritable > list = writer . getValue ( key ) ; assertEquals ( "Only<seq2seq4repair_space>one<seq2seq4repair_space>element<seq2seq4repair_space>per<seq2seq4repair_space>row" , 1 , list . size ( ) ) ; Vector v = list . get ( 0 ) . get ( ) ; assertTrue ( "Unit<seq2seq4repair_space>vector<seq2seq4repair_space>sum<seq2seq4repair_space>is<seq2seq4repair_space>1<seq2seq4repair_space>or<seq2seq4repair_space>differs<seq2seq4repair_space>by<seq2seq4repair_space>0.0001" , ( ( Math . abs ( ( ( v . norm ( 2 ) ) - 1 ) ) ) < 1.0E-6 ) ) ; } } }

Fix:
Configuration conf = getConfiguration ( ) ;
Buggy code:
class Task { TaskStack mStack ; final AppTokenList mAppTokens = new AppTokenList ( ) ; final int taskId ; final int mUserId ; boolean mDeferRemoval = false ; Task ( AppWindowToken wtoken , TaskStack stack , int userId ) { } DisplayContent getDisplayContent ( ) { } void addAppToken ( int addPos , AppWindowToken wtoken ) { } boolean removeAppToken ( AppWindowToken wtoken ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "{taskId=" + ( taskId ) ) + "<seq2seq4repair_space>appTokens=" ) + ( mAppTokens ) ) + "}" ; <END_BUG> } }

Fix:
return ( ( ( ( ( "{taskId=" + ( taskId ) ) + "<seq2seq4repair_space>appTokens=" ) + ( mAppTokens ) ) + "<seq2seq4repair_space>mdr=" ) + ( mDeferRemoval ) ) + "}" ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class PersistentIntervalTimerManagementTestCase extends AbstractTimerManagementTestCase { @ Deployment public static Archive createDeployment ( ) { } @ After public void clean ( ) { } @ Before public void setup ( ) throws Exception { } @ Test @ InSequence ( 1 ) public void testResourceExistence ( ) throws Exception { } @ Test @ InSequence ( 2 ) public void testSuspendAndActivate ( ) throws Exception { } @ Test @ InSequence ( 3 ) public void testCancel ( ) throws Exception { } @ Test @ InSequence ( 4 ) public void testTrigger ( ) throws Exception { } @ Test @ InSequence ( 5 ) public void testSuspendAndTrigger ( ) throws Exception { } protected String getBeanClassName ( ) { } private Serializable info = "PersistentIntervalTimerCLITestCase" ; @ Override protected Serializable getInfo ( ) { } @ Override protected boolean isPersistent ( ) { <START_BUG> return false ; <END_BUG> } @ Override protected void assertCalendar ( final ModelNode timerDetails ) { } }

Fix:
return true ;
Buggy code:
@ Service class ResetPasswordLinkGeneratorImpl implements ResetPasswordLinkGenerator { @ Value ( "${reset.password.link.port}" ) private int port ; @ Value ( "${reset.password.link.host}" ) private String host ; private final ResetPasswordTokenHandler resetPasswordTokenHandler ; @ Autowired ResetPasswordLinkGeneratorImpl ( UserRepository userRepository , ResetPasswordTokenHandler resetPasswordTokenHandler ) { } @ Override public String link ( String username ) { <START_BUG> return ( ( ( ( "http:////" + ( host ) ) + ":" ) + ( ( port ) == 80 ? "" : port ) ) + "//v1//users//password//edit?reset_password_token=" ) + ( getPasswordResetToken ( username ) ) ; <END_BUG> } private String getPasswordResetToken ( String username ) { } }

Fix:
return ( ( ( "http:////" + ( host ) ) + ( ( port ) == 80 ? "" : ":" + ( port ) ) ) + "//v1//users//password//edit?reset_password_token=" ) + ( getPasswordResetToken ( username ) ) ;
Buggy code:
public class PatchMultiHost extends Patch { public PatchMultiHost ( String name ) { } @ Override public void formatConfig ( HashMap < String , Object > json ) { } @ Override public boolean shouldProcessPacket ( Packet packet ) { } @ Override public void processPacket ( Packet packet ) { RequestPacket request = ( ( RequestPacket ) ( packet ) ) ; String host = request . headers . getHeader ( "Host" ) ; HashMap < String , Object > forward = ( ( HashMap < String , Object > ) ( pcfg . get ( "forward" ) ) ) ; <START_BUG> if ( request . httpVersion . equals ( "HTTP//1.0" ) ) <END_BUG> for ( Object key : forward . keySet ( ) ) { String [ ] spl = ( ( String ) ( key ) ) . split ( "," ) ; for ( String c : spl ) { if ( c . equals ( host ) ) { request . target = ( forward . get ( key ) ) + ( request . target ) ; return ; } } } request . target = ( ( String ) ( pcfg . get ( "default" ) ) ) + ( request . target ) ; } @ Override public boolean shouldProcessResponse ( ResponsePacket response , RequestPacket request , byte [ ] data ) { } @ Override public byte [ ] processResponse ( ResponsePacket response , RequestPacket request , byte [ ] data ) { } @ Override public void processMethod ( RequestPacket request , ResponsePacket response ) { } }

Fix:
if ( ! ( request . httpVersion . equals ( "HTTP//1.0" ) ) )
Buggy code:
public class Main { String installDir ; String libBase ; String homeDir ; static final String DEFAULT_CONFIG = "conf//server.xml" ; boolean doStop = false ; String configFile ; static boolean jdk12 = false ; public Main ( ) { } public static void main ( String [ ] args ) { } void log ( String s ) { } public String guessTomcatHome ( ) { String h = System . getProperty ( "tomcat.home" ) ; if ( h != null ) return h ; String cpath = System . getProperty ( "java.class.path" ) ; String pathSep = System . getProperty ( "path.separator" ) ; StringTokenizer st = new StringTokenizer ( cpath , pathSep ) ; while ( st . hasMoreTokens ( ) ) { String path = st . nextToken ( ) ; if ( path . endsWith ( "tomcat.jar" ) ) { h = path . substring ( 0 , ( ( path . length ( ) ) - ( "tomcat.jar" . length ( ) ) ) ) ; try { File f = new File ( h ) ; File f1 = new File ( h , ".." ) ; h = f1 . getCanonicalPath ( ) ; <START_BUG> System . setProperty ( "tomcat.home" , h ) ; <END_BUG> return h ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } } return null ; } public void setLibDir ( String base ) { } URL getURL ( String base , String file ) { } public String getLibDir ( ) { } ClassLoader getURLClassLoader ( URL [ ] urls , ClassLoader parent ) throws Exception { } void execute ( String [ ] args ) throws Exception { } Object instantiate ( ClassLoader cl , String classN ) throws Exception { } void setAttribute ( Object proxy , String n , Object v ) throws Exception { } void execute ( Object proxy , String method ) throws Exception { } String [ ] args0 = new String [ ] { "help" , "stop" , "g" , "generateConfigs" } ; String [ ] args1 = new String [ ] { "f" , "config" , "h" , "home" } ; void processArgs ( Object proxy , String [ ] args ) throws Exception { } public String [ ] getJarFiles ( String ld ) { } }

Fix:
System . getProperties ( ) . put ( "tomcat.home" , h ) ;