nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ModelAttributeMethodProcessorTests { private ModelAttributeMethodProcessor processor ; private MethodParameter paramNamedValidModelAttr ; private MethodParameter paramErrors ; private MethodParameter paramInt ; private MethodParameter paramModelAttr ; private MethodParameter paramNonSimpleType ; private MethodParameter returnParamNamedModelAttr ; private MethodParameter returnParamNonSimpleType ; private ModelAndViewContainer mavContainer ; private NativeWebRequest webRequest ; @ Before public void setUp ( ) throws Exception { } @ Test public void supportedParameters ( ) throws Exception { } @ Test public void supportedParametersInDefaultResolutionMode ( ) throws Exception { } @ Test public void supportedReturnTypes ( ) throws Exception { } @ Test public void supportedReturnTypesInDefaultResolutionMode ( ) throws Exception { processor = new ModelAttributeMethodProcessor ( true ) ; assertTrue ( processor . supportsReturnType ( returnParamNamedModelAttr ) ) ; <START_BUG> assertFalse ( processor . supportsReturnType ( returnParamNonSimpleType ) ) ; <END_BUG> } @ Test public void validationApplicable ( ) throws Exception { } @ Test public void validationNotApplicable ( ) throws Exception { } @ Test public void bindExceptionRequired ( ) throws Exception { } @ Test public void bindExceptionNotRequired ( ) throws Exception { } @ Test public void getAttributeFromModel ( ) throws Exception { } private void testGetAttributeFromModel ( String expectedAttributeName , MethodParameter param ) throws Exception { } @ Test public void createAttribute ( ) throws Exception { } @ Test public void automaticValidation ( ) throws Exception { } @ Test ( expected = BindException . class ) public void bindException ( ) throws Exception { } @ Test public void handleAnnotatedReturnValue ( ) throws Exception { } @ Test public void handleNotAnnotatedReturnValue ( ) throws Exception { } private static class StubRequestDataBinder extends WebRequestDataBinder { private boolean bindInvoked ; private boolean validateInvoked ; public StubRequestDataBinder ( Object target ) { } public boolean isBindInvoked ( ) { } public boolean isValidateInvoked ( ) { } public void bind ( WebRequest request ) { } public void validate ( ) { } } @ Target ( { ElementType . METHOD , ElementType . FIELD , ElementType . CONSTRUCTOR , ElementType . PARAMETER } ) @ Retention ( RetentionPolicy . RUNTIME ) public @ interface Valid { } @ SessionAttributes ( types = TestBean . class ) private static class ModelAttributeHandler { @ SuppressWarnings ( "unused" ) public void modelAttribute ( @ ModelAttribute ( "attrName" ) @ ModelAttributeMethodProcessorTests . Valid TestBean annotatedAttr , Errors errors , int intArg , @ ModelAttribute TestBean defaultNameAttr , TestBean notAnnotatedAttr ) { } } @ SuppressWarnings ( "unused" ) @ ModelAttribute ( "modelAttrName" ) private String annotatedReturnValue ( ) { } @ SuppressWarnings ( "unused" ) private TestBean notAnnotatedReturnValue ( ) { } }

Fix:
assertTrue ( processor . supportsReturnType ( returnParamNonSimpleType ) ) ;
Buggy code:
public class ReflectivityCalculator { public double getModSqrdSpecRef ( double waveVectorQ , double wavelength , Tile [ ] tiles ) { double modSqrdSpecRef = 0.0 ; if ( wavelength > 0.0 ) { Tile tile ; Complex aNm1Sq ; Complex fNm1N ; Complex rNm1N = new Complex ( 0.0 , 0.0 ) ; Complex one = new Complex ( 1.0 , 0.0 ) ; Complex qN = new Complex ( 0.0 , 0.0 ) ; Complex rNNp1 = new Complex ( 0.0 , 0.0 ) ; int nLayers = tiles . length ; tile = tiles [ ( nLayers - 1 ) ] ; double qCSq = ( 16.0 * ( Math . PI ) ) * ( tile . scatteringLength ) ; double muLAbs = tile . trueAbsLength ; double mulInc = tile . incAbsLength ; double thickness = tile . thickness ; double betaNm1 = ( 4.0 * ( Math . PI ) ) * ( muLAbs + ( mulInc // wavelength ) ) ; Complex qNm1 = new Complex ( ( ( waveVectorQ * waveVectorQ ) - qCSq ) , ( ( - 2.0 ) * betaNm1 ) ) ; <START_BUG> qNm1 = qNm1 . multiply ( qNm1 ) ; <END_BUG> for ( int i = nLayers - 1 ; i > 0 ; i -- ) { tile = tiles [ ( i - 1 ) ] ; qN = qNm1 ; qCSq = ( 16.0 * ( Math . PI ) ) * ( tile . scatteringLength ) ; muLAbs = tile . trueAbsLength ; mulInc = tile . incAbsLength ; thickness = tile . thickness ; betaNm1 = ( 4.0 * ( Math . PI ) ) * ( muLAbs + ( mulInc // wavelength ) ) ; qNm1 = new Complex ( ( ( waveVectorQ * waveVectorQ ) - qCSq ) , ( ( - 2.0 ) * betaNm1 ) ) ; qNm1 = qNm1 . sqrt ( ) ; aNm1Sq = new Complex ( qNm1 . getImaginary ( ) , qNm1 . getReal ( ) ) . multiply ( ( ( - 0.5 ) * thickness ) ) . exp ( ) ; fNm1N = qNm1 . subtract ( qN ) . divide ( qNm1 . add ( qN ) ) ; Complex y = rNNp1 . multiply ( fNm1N ) . add ( one ) ; Complex z = rNNp1 . add ( fNm1N ) ; rNm1N = aNm1Sq . multiply ( aNm1Sq ) . multiply ( z . divide ( y ) ) ; rNNp1 = rNm1N ; } modSqrdSpecRef = ( ( rNm1N . getReal ( ) ) * ( rNm1N . getReal ( ) ) ) + ( ( rNm1N . getImaginary ( ) ) * ( rNm1N . getImaginary ( ) ) ) ; } return modSqrdSpecRef ; } }

Fix:
qNm1 = qNm1 . sqrt ( ) ;
Buggy code:
public class SOSVirtualSensorOutput extends AbstractSensorOutput < SOSVirtualSensor > { SOSVirtualSensor parentSensor ; DataComponent recordStructure ; DataEncoding recordEncoding ; DataBlock latestRecord ; double lastRecordTime = Double . NEGATIVE_INFINITY ; double avgSamplingPeriod = 100 ; int avgSampleCount = 0 ; public SOSVirtualSensorOutput ( SOSVirtualSensor sensor , DataComponent recordStructure , DataEncoding recordEncoding ) { } @ Override protected void init ( ) throws SensorException { } @ Override public String getName ( ) { } @ Override public double getAverageSamplingPeriod ( ) { } @ Override public DataComponent getRecordDescription ( ) { } @ Override public DataEncoding getRecommendedEncoding ( ) { } @ Override public DataBlock getLatestRecord ( ) throws SensorException { } @ Override public double getLatestRecordTime ( ) { } public void publishNewRecord ( DataBlock dataBlock ) { } protected void updateSamplingPeriod ( double timeStamp ) { if ( ( lastRecordTime ) < 0 ) return ; if ( ( avgSampleCount ) < 100 ) { if ( ( avgSampleCount ) == 0 ) avgSamplingPeriod = 0.0 ; else avgSamplingPeriod *= ( ( double ) ( avgSampleCount ) ) // ( ( avgSampleCount ) + 1 ) ; ( avgSampleCount ) ++ ; avgSamplingPeriod += ( timeStamp - ( lastRecordTime ) ) // ( avgSampleCount ) ; <START_BUG> log . debug ( ( ( "Computed<seq2seq4repair_space>sampling<seq2seq4repair_space>period<seq2seq4repair_space>is<seq2seq4repair_space>" + ( avgSamplingPeriod ) ) + "s" ) ) ; <END_BUG> } } }

Fix:
log . trace ( ( ( "Sampling<seq2seq4repair_space>period<seq2seq4repair_space>=<seq2seq4repair_space>" + ( avgSamplingPeriod ) ) + "s" ) ) ;
Buggy code:
@ Default public class CancelRequisitionService implements Serializable { private static final long serialVersionUID = 1L ; @ Inject private RequisitionsRepository requisitionsRepository ; @ Inject private StockService stockService ; @ Transactional public Requisition cancel ( final Requisition requisition ) { final Requisition req = this . requisitionsRepository . getById ( requisition . getId ( ) ) ; <START_BUG> if ( req . isCancelable ( ) ) { <END_BUG> throw new org . xine . marketplace . business . BusinessException ( ( ( "Requisition<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>canceled<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>state<seq2seq4repair_space>" + ( req . getStatus ( ) . getDescription ( ) ) ) + "." ) ) ; } if ( req . isIssued ( ) ) { this . stockService . restoreRequisitionLines ( req ) ; } req . setStatus ( CANCELLED ) ; return this . requisitionsRepository . save ( req ) ; } }

Fix:
if ( req . isNotCancelable ( ) ) {
Buggy code:
public class ReadEnvironmentVariablesTestCase { private static DomainTestSupport testSupport ; private static DomainLifecycleUtil domainMasterLifecycleUtil ; private static DomainLifecycleUtil domainSlaveLifecycleUtil ; @ BeforeClass public static void setupDomain ( ) throws Exception { } @ AfterClass public static void tearDownDomain ( ) throws Exception { } @ Test public void testReadEnvironmentVariablesForServers ( ) throws Exception { DomainClient client = ReadEnvironmentVariablesTestCase . domainMasterLifecycleUtil . createDomainClient ( ) ; DomainDeploymentManager manager = client . getDeploymentManager ( ) ; try { WebArchive archive = ShrinkWrap . create ( WebArchive . class , "env-test.war" ) . addClass ( EnvironmentTestServlet . class ) ; archive . addAsResource ( new StringAsset ( "Manifest-Version:<seq2seq4repair_space>1.0\nDependencies:<seq2seq4repair_space>org.jboss.dmr<seq2seq4repair_space>\n" ) , "META-INF//MANIFEST.MF" ) ; System . out . println ( archive . toString ( true ) ) ; final InputStream contents = archive . as ( ZipExporter . class ) . exportAsInputStream ( ) ; try { DeploymentPlan plan = manager . newDeploymentPlan ( ) . add ( "env-test.war" , contents ) . deploy ( "env-test.war" ) . toServerGroup ( "main-server-group" ) . toServerGroup ( "other-server-group" ) . build ( ) ; DeploymentPlanResult result = manager . execute ( plan ) . get ( ) ; Assert . assertTrue ( result . isValid ( ) ) ; } finally { IoUtils . safeClose ( contents ) ; } Map < String , String > env = getEnvironmentVariables ( client , "master" , "main-one" , "standard-sockets" ) ; checkEnvironmentVariable ( env , "DOMAIN_TEST_MAIN_GROUP" , "main_group" ) ; checkEnvironmentVariable ( env , "DOMAIN_TEST_SERVER" , "server" ) ; checkEnvironmentVariable ( env , "DOMAIN_TEST_JVM" , "jvm" ) ; env = getEnvironmentVariables ( client , "slave" , "main-three" , "standard-sockets" ) ; checkEnvironmentVariable ( env , "DOMAIN_TEST_MAIN_GROUP" , "main_group" ) ; Assert . assertFalse ( env . containsKey ( "DOMAIN_TEST_SERVER" ) ) ; Assert . assertFalse ( env . containsKey ( "DOMAIN_TEST_JVM" ) ) ; <START_BUG> env = getEnvironmentVariables ( client , "slave" , "other-two" , "osgi-sockets" ) ; <END_BUG> Assert . assertFalse ( env . containsKey ( "DOMAIN_TEST_MAIN_GROUP" ) ) ; Assert . assertFalse ( env . containsKey ( "DOMAIN_TEST_SERVER" ) ) ; Assert . assertFalse ( env . containsKey ( "DOMAIN_TEST_JVM" ) ) ; } finally { DeploymentPlanResult result = manager . execute ( manager . newDeploymentPlan ( ) . undeploy ( "env-test.war" ) . build ( ) ) . get ( ) ; Assert . assertTrue ( result . isValid ( ) ) ; IoUtils . safeClose ( client ) ; } } private void checkEnvironmentVariable ( Map < String , String > env , String name , String expected ) { } private Map < String , String > getEnvironmentVariables ( DomainClient client , String host , String server , String socketBindingGroup ) throws Exception { } }

Fix:
env = getEnvironmentVariables ( client , "slave" , "other-two" , "other-sockets" ) ;
Buggy code:
public class P4Fstat extends P4Base { private int changelist ; private String addCmd = "" ; private Vector filesets = new Vector ( ) ; private int cmdLength = 300 ; private static final int SHOW_ALL = 0 ; private static final int SHOW_EXISTING = 1 ; private static final int SHOW_NON_EXISTING = 2 ; private int show = P4Fstat . SHOW_NON_EXISTING ; private FStatP4OutputHandler handler ; private StringBuffer filelist ; private int fileNum = 0 ; private int doneFileNum = 0 ; private boolean debug = false ; private static final String EXISTING_HEADER = "Following<seq2seq4repair_space>files<seq2seq4repair_space>exist<seq2seq4repair_space>in<seq2seq4repair_space>perforce" ; private static final String NONEXISTING_HEADER = "Following<seq2seq4repair_space>files<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>in<seq2seq4repair_space>perforce" ; public void setShowFilter ( String filter ) { } public void setChangelist ( int changelist ) throws BuildException { } public void addFileset ( FileSet set ) { } public void execute ( ) throws BuildException { handler = new FStatP4OutputHandler ( this ) ; if ( ( P4View ) != null ) { addCmd = P4View ; } P4CmdOpts = ( ( changelist ) > 0 ) ? "-c<seq2seq4repair_space>" + ( changelist ) : "" ; filelist = new StringBuffer ( ) ; for ( int i = 0 ; i < ( filesets . size ( ) ) ; i ++ ) { FileSet fs = ( ( FileSet ) ( filesets . elementAt ( i ) ) ) ; DirectoryScanner ds = fs . getDirectoryScanner ( getProject ( ) ) ; String [ ] srcFiles = ds . getIncludedFiles ( ) ; fileNum = srcFiles . length ; if ( srcFiles != null ) { for ( int j = 0 ; j < ( srcFiles . length ) ; j ++ ) { File f = new File ( ds . getBasedir ( ) , srcFiles [ j ] ) ; filelist . append ( "<seq2seq4repair_space>" ) . append ( '"' ) . append ( f . getAbsolutePath ( ) ) . append ( '"' ) ; ( doneFileNum ) ++ ; if ( ( filelist . length ( ) ) > ( cmdLength ) ) { execP4Fstat ( filelist ) ; <START_BUG> filelist . setLength ( 0 ) ; <END_BUG> } } if ( ( filelist . length ( ) ) > 0 ) { execP4Fstat ( filelist ) ; } } else { log ( "No<seq2seq4repair_space>files<seq2seq4repair_space>specified<seq2seq4repair_space>to<seq2seq4repair_space>add!" , MSG_WARN ) ; } } if ( ( ( show ) == ( P4Fstat . SHOW_ALL ) ) || ( ( show ) == ( P4Fstat . SHOW_EXISTING ) ) ) { printRes ( handler . getExisting ( ) , P4Fstat . EXISTING_HEADER ) ; } if ( ( ( show ) == ( P4Fstat . SHOW_ALL ) ) || ( ( show ) == ( P4Fstat . SHOW_NON_EXISTING ) ) ) { printRes ( handler . getNonExisting ( ) , P4Fstat . NONEXISTING_HEADER ) ; } } public int getLengthOfTask ( ) { } int getPasses ( ) { } private void printRes ( ArrayList ar , String header ) { } private void execP4Fstat ( StringBuffer list ) { } }

Fix:
filelist = new StringBuffer ( ) ;
Buggy code:
public class Hierarchy implements LoggerRepository , RendererSupport { private LoggerFactory defaultFactory ; private Vector listeners ; Hashtable ht ; Logger root ; RendererMap rendererMap ; int thresholdInt ; Level threshold ; boolean emittedNoAppenderWarning = false ; boolean emittedNoResourceBundleWarning = false ; public Hierarchy ( Logger root ) { } public void addRenderer ( Class classToRender , ObjectRenderer or ) { } public void addHierarchyEventListener ( HierarchyEventListener listener ) { if ( listeners . contains ( listener ) ) { LogLog . warn ( "Ignoring<seq2seq4repair_space>attempt<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>an<seq2seq4repair_space>existent<seq2seq4repair_space>listener." ) ; } else { <START_BUG> listeners . add ( listener ) ; <END_BUG> } } public void clear ( ) { } public void emitNoAppenderWarning ( Category cat ) { } public Logger exists ( String name ) { } public void setThreshold ( String levelStr ) { } public void setThreshold ( Level l ) { } public void fireAddAppenderEvent ( Category logger , Appender appender ) { } void fireRemoveAppenderEvent ( Category logger , Appender appender ) { } public Level getThreshold ( ) { } public Logger getLogger ( String name ) { } public Logger getLogger ( String name , LoggerFactory factory ) { } public Enumeration getCurrentLoggers ( ) { } public Enumeration getCurrentCategories ( ) { } public RendererMap getRendererMap ( ) { } public Logger getRootLogger ( ) { } public boolean isDisabled ( int level ) { } public void overrideAsNeeded ( String override ) { } public void resetConfiguration ( ) { } public void setDisableOverride ( String override ) { } public void setRenderer ( Class renderedClass , ObjectRenderer renderer ) { } public void shutdown ( ) { } private final void updateParents ( Logger cat ) { } private final void updateChildren ( ProvisionNode pn , Logger logger ) { } }

Fix:
listeners . addElement ( listener ) ;
Buggy code:
final class MappingConversionService extends DefaultConversionService { @ Override protected GenericConverter getDefaultConverter ( TypeDescriptor sourceType , TypeDescriptor targetType ) { <START_BUG> return new MappingConverter ( new SpelMapper ( ) ) ; <END_BUG> } }

Fix:
return new MappingConverter ( new SpelMapper ( ) , null ) ;
Buggy code:
public final class MarkupParserTest extends WicketTestCase { private static Log log = LogFactory . getLog ( MarkupParserTest . class ) ; public MarkupParserTest ( String name ) { } public final void testTagParsing ( ) throws Exception { } public final void test ( ) throws Exception { } public final void testXhtmlDocument ( ) throws Exception { } private MarkupResourceStream newMarkupResourceStream ( final IResourceStreamLocator locator , final Class c , final String style , final Locale locale , final String extension ) { } public final void testFileDocument ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testWicketTag ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testDefaultWicketTag ( ) throws IOException , ParseException , ResourceStreamNotFoundException { final MarkupParser parser = new MarkupParser ( new XmlPullParser ( ) ) ; parser . setWicketNamespace ( "wcn" ) ; Markup markup = parser . parse ( "<span<seq2seq4repair_space>wcn:id=\"test\"//>" ) ; assertEquals ( 1 , markup . size ( ) ) ; markup = parser . parse ( "<span<seq2seq4repair_space>wicket:id=\"test\"//>" ) ; assertEquals ( 1 , markup . size ( ) ) ; <START_BUG> WicketTagIdentifier . registerWellKownTagName ( "xxx" ) ; <END_BUG> markup = parser . parse ( "<wcn:xxx><seq2seq4repair_space><//wcn:xxx>" ) ; assertEquals ( 3 , markup . size ( ) ) ; } public final void testScript ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } public final void testBalancing ( ) throws IOException , ResourceStreamNotFoundException { } }

Fix:
WicketTagIdentifier . registerWellKnownTagName ( "xxx" ) ;
Buggy code:
public class CentralActivity extends AppCompatActivity implements GoogleApiClient . OnConnectionFailedListener , OnMapReadyCallback { private static final LatLngBounds BOUNDS_GREATER_SYDNEY = new LatLngBounds ( new LatLng ( ( - 34.041458 ) , 150.7901 ) , new LatLng ( ( - 33.682247 ) , 151.383362 ) ) ; protected GoogleApiClient mGoogleApiClient ; protected GeoApiContext context ; protected DirectionsManager directionsManager = null ; private AllRoutes allRoutes ; private Button searchBtn ; private Button clearBtn ; private Button showGraphBtn ; private Button bikePathButton ; private Button singleBikePathButton ; private ArrayList < com . google . maps . model . LatLng > points = new ArrayList < > ( ) ; private GoogleMap mMap ; private ClearableAutoCompleteTextView to ; private ClearableAutoCompleteTextView from ; private ClearableAutoCompleteTextView to2 ; private ClearableAutoCompleteTextView from2 ; private PopupWindow graphPopupWindow ; private LayoutInflater layoutInflater ; private PathElevationGraphDrawer graphDrawer ; private GraphView graph ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void disableSlidingPanel ( ) { } private void enableSlidingPanel ( ) { } private void updateInfoTable ( ) { BikeableRoute currentRoute = allRoutes . getSelectedRoute ( ) ; if ( currentRoute == null ) { return ; } TextView pathDurationTextView = ( ( TextView ) ( findViewById ( path_duration ) ) ) ; TextView pathPercTextView = ( ( TextView ) ( findViewById ( bike_path_perc ) ) ) ; TextView pathDistanceTextView = ( ( TextView ) ( findViewById ( path_distance ) ) ) ; TextView pathUphillAverageTextView = ( ( TextView ) ( findViewById ( path_difficulty ) ) ) ; pathDurationTextView . setText ( "" ) ; pathPercTextView . setText ( "" ) ; pathDistanceTextView . setText ( "" ) ; pathUphillAverageTextView . setText ( "" ) ; pathDurationTextView . setText ( String . format ( "%d" , currentRoute . getDuration ( ) ) ) ; pathPercTextView . setText ( String . format ( "%f" , currentRoute . getBikePathPercentage ( ) ) ) ; <START_BUG> pathDistanceTextView . setText ( String . format ( "%ld" , currentRoute . getDistance ( ) ) ) ; <END_BUG> pathUphillAverageTextView . setText ( String . format ( "%f" , currentRoute . getAverageUphillDegree ( ) ) ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onConnectionFailed ( ConnectionResult connectionResult ) { } @ Override public void onMapReady ( GoogleMap googleMap ) { } }

Fix:
pathDistanceTextView . setText ( String . format ( "%d" , currentRoute . getDistance ( ) ) ) ;
Buggy code:
public class DayOfMonth extends IntegerBasedExpression { private static Logger logger = Logger . getLogger ( DayOfMonth . class ) ; public static final Integer MAX_DAY_OF_MONTH = 31 ; public static final Integer MIN_DAY_OF_MONTH = - 7 ; private static final Map < String , Integer > DAY_OF_MONTH_ALIAS = new HashMap < String , Integer > ( ) ; private static final Set < String > ORDINALS = new HashSet < String > ( ) ; private static final Map < String , Integer > ORDINAL_TO_WEEK_NUMBER_MAPPING = new HashMap < String , Integer > ( ) ; public DayOfMonth ( String value ) { } @ Override protected Integer getMaxValue ( ) { } @ Override protected Integer getMinValue ( ) { } public Integer getNextMatch ( Calendar currentCal ) { } @ Override protected void assertValid ( Integer value ) throws IllegalArgumentException { } private boolean hasRelativeDayOfMonth ( ) { } private SortedSet < Integer > getEligibleDaysOfMonth ( Calendar cal ) { if ( ( this . hasRelativeDayOfMonth ( ) ) == false ) { return this . absoluteValues ; } SortedSet < Integer > eligibleDaysOfMonth = new TreeSet < Integer > ( this . absoluteValues ) ; for ( ScheduleValue relativeValue : this . relativeValues ) { if ( relativeValue instanceof SingleValue ) { SingleValue singleValue = ( ( SingleValue ) ( relativeValue ) ) ; String value = singleValue . getValue ( ) ; Integer absoluteDayOfMonth = this . getAbsoluteDayOfMonth ( cal , value ) ; eligibleDaysOfMonth . add ( absoluteDayOfMonth ) ; } else if ( relativeValue instanceof RangeValue ) { RangeValue range = ( ( RangeValue ) ( relativeValue ) ) ; String start = range . getStart ( ) ; String end = range . getEnd ( ) ; Integer dayOfMonthStart = null ; if ( this . isRelativeValue ( start ) ) { dayOfMonthStart = this . getAbsoluteDayOfMonth ( cal , start ) ; } else { dayOfMonthStart = this . parseInt ( start ) ; } Integer dayOfMonthEnd = null ; if ( this . isRelativeValue ( end ) ) { dayOfMonthEnd = this . getAbsoluteDayOfMonth ( cal , end ) ; } else { dayOfMonthEnd = this . parseInt ( end ) ; } this . assertValid ( dayOfMonthStart ) ; this . assertValid ( dayOfMonthEnd ) ; <START_BUG> if ( dayOfMonthStart == dayOfMonthEnd ) { <END_BUG> eligibleDaysOfMonth . add ( dayOfMonthEnd ) ; continue ; } if ( dayOfMonthStart > dayOfMonthEnd ) { for ( int i = dayOfMonthStart ; i <= ( this . getMaxValue ( ) ) ; i ++ ) { eligibleDaysOfMonth . add ( i ) ; } for ( int i = this . getMinValue ( ) ; i <= dayOfMonthEnd ; i ++ ) { eligibleDaysOfMonth . add ( i ) ; } } else { for ( int i = dayOfMonthStart ; i <= dayOfMonthEnd ; i ++ ) { eligibleDaysOfMonth . add ( i ) ; } } } } return eligibleDaysOfMonth ; } private int getAbsoluteDayOfMonth ( Calendar cal , String relativeDayOfMonth ) { } private boolean isValidNegativeDayOfMonth ( String dayOfMonth ) { } private boolean isDayOfWeekBased ( String relativeVal ) { } @ Override public boolean isRelativeValue ( String value ) { } @ Override protected boolean accepts ( ScheduleExpressionType scheduleExprType ) { } public Integer getFirstMatch ( Calendar cal ) { } @ Override protected Integer parseInt ( String alias ) { } }

Fix:
if ( dayOfMonthStart . equals ( dayOfMonthEnd ) ) {
Buggy code:
@ Entity public class Tema { public static final String TABLE = "tema" ; public static final String ID = "ID" ; @ Id @ GeneratedValue private int id ; public static final String NOMBRE = "NOMBRE" ; private String nombre ; public static final String PREGUNTA = "PREGUNTA" ; private String pregunta ; public Tema ( ) { } public Tema ( String nombre , String pregunta ) { } public int getId ( ) { } public void setId ( int id ) { } public String getNombre ( ) { } public void setNombre ( String nombre ) { } public String getPregunta ( ) { } public void setPregunta ( String pregunta ) { } @ Override public boolean equals ( Object temaObj ) { Tema tema = ( ( Tema ) ( temaObj ) ) ; <START_BUG> return ( ( ( this . getId ( ) ) == ( tema . getId ( ) ) ) && ( ( this . getNombre ( ) ) == ( tema . getNombre ( ) ) ) ) && ( ( this . getPregunta ( ) ) == ( tema . getPregunta ( ) ) ) ; <END_BUG> } }

Fix:
return ( ( ( this . getId ( ) ) == ( tema . getId ( ) ) ) && ( this . getNombre ( ) . equals ( tema . getNombre ( ) ) ) ) && ( this . getPregunta ( ) . equals ( tema . getPregunta ( ) ) ) ;
Buggy code:
public abstract class AbstractPropertyModel extends AbstractDetachableModel { private transient OgnlContext context ; private final Object nestedModel ; public AbstractPropertyModel ( final Object modelObject ) { } public final Object getNestedModel ( ) { } protected Object modelObject ( final Component component ) { } protected abstract String ognlExpression ( Component component ) { } protected void onAttach ( ) { } protected void onDetach ( ) { } protected Object onGetObject ( final Component component ) { final String expression = ognlExpression ( component ) ; if ( Strings . isEmpty ( expression ) ) { return modelObject ( component ) ; } final Object modelObject = modelObject ( component ) ; if ( modelObject != null ) { try { return Ognl . getValue ( expression , getContext ( component ) , modelObject , propertyType ( component ) ) ; } catch ( OgnlException e ) { <START_BUG> throw new wicket . WicketRuntimeException ( e ) ; <END_BUG> } } return null ; } protected void onSetObject ( final Component component , Object object ) { } protected abstract Class propertyType ( Component component ) { } private final OgnlContext getContext ( final Component component ) { } }

Fix:
throw new wicket . WicketRuntimeException ( ( ( ( ( "OGNL<seq2seq4repair_space>Exception:<seq2seq4repair_space>expression='" + expression ) + "';<seq2seq4repair_space>component='" ) + ( component . getPath ( ) ) ) + "'" ) , e ) ;
Buggy code:
public class FieldReference extends Reference implements InvocationSite { public static final int READ = 0 ; public static final int WRITE = 1 ; public Expression receiver ; public char [ ] token ; public FieldBinding binding ; protected FieldBinding codegenBinding ; public MethodBinding [ ] syntheticAccessors ; public long nameSourcePosition ; public TypeBinding receiverType ; public TypeBinding genericCast ; public FieldReference ( char [ ] source , long pos ) { } public FlowInfo analyseAssignment ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , Assignment assignment , boolean isCompound ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { boolean nonStatic = ! ( binding . isStatic ( ) ) ; receiver . analyseCode ( currentScope , flowContext , flowInfo , nonStatic ) ; if ( nonStatic ) { <START_BUG> receiver . checkNPE ( currentScope , flowContext , flowInfo , true ) ; <END_BUG> } if ( valueRequired || ( ( currentScope . compilerOptions ( ) . complianceLevel ) >= ( ClassFileConstants . JDK1_4 ) ) ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo , true ) ; } return flowInfo ; } public void computeConversion ( Scope scope , TypeBinding runtimeTimeType , TypeBinding compileTimeType ) { } public FieldBinding fieldBinding ( ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo , boolean isReadAccess ) { } public int nullStatus ( FlowInfo flowInfo ) { } public Constant optimizedBooleanConstant ( ) { } public TypeBinding postConversionType ( Scope scope ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int index ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
receiver . checkNPE ( currentScope , flowContext , flowInfo ) ;
Buggy code:
public class AlertFromWidget extends Service implements LocationListener { double latitude ; double longitude ; int n ; String geoLocation ; String message ; ProgressDialog cancelDialog ; LocationManager loc ; String provider ; DbConnect dbObj ; private boolean netThreadFailed = false ; private boolean geoThreadFailed = false ; private boolean netConnection = true ; private boolean isGPSOn = true ; private boolean locationFound = true ; @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { dbObj = new DbConnect ( getApplicationContext ( ) ) ; <START_BUG> n = dbObj . getname ( ) . getCount ( ) ; <END_BUG> if ( ( n ) == 0 ) { Toast . makeText ( getApplicationContext ( ) , "Add<seq2seq4repair_space>emergency<seq2seq4repair_space>contacts<seq2seq4repair_space>first" , LENGTH_LONG ) . show ( ) ; stopSelf ( ) ; } else { AlertFromWidget . NetworkCheck obj = new AlertFromWidget . NetworkCheck ( this ) ; obj . execute ( ) ; Toast . makeText ( getApplicationContext ( ) , "Sending<seq2seq4repair_space>Emergency<seq2seq4repair_space>Alert" , LENGTH_SHORT ) . show ( ) ; } return super . onStartCommand ( intent , flags , startId ) ; } private boolean isNetworkAvailable ( ) { } public boolean hasActiveInternetConnection ( Context context ) { } class NetworkCheck extends AsyncTask < Void , Void , Boolean > { Context context ; public NetworkCheck ( Context context ) { } @ Override protected Boolean doInBackground ( Void ... params ) { } @ Override protected void onPostExecute ( Boolean result ) { } } public void location ( ) { } @ Override public void onLocationChanged ( Location location ) { } public class MyGeoCoder extends AsyncTask < Location , Void , String > { Context context ; Geocoder geo ; public MyGeoCoder ( Context context ) { } @ Override protected String doInBackground ( Location ... params ) { } @ Override protected void onPostExecute ( String result ) { } } public void send ( ) { } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onProviderDisabled ( String provider ) { } @ Override public IBinder onBind ( Intent intent ) { } }

Fix:
n = dbObj . getInfo ( ) . getCount ( ) ;
Buggy code:
public final class EditBook extends AuthenticatedHtmlPage { static final Book otherBook = new Book ( "Frisbee<seq2seq4repair_space>Techniques" , "Marty<seq2seq4repair_space>van<seq2seq4repair_space>Hoff" , Book . FICTION ) ; public EditBook ( final Book book ) { } public static PageLink link ( final String name , final long id ) { } public static final class EditBookForm extends Form { private Book book ; public EditBookForm ( final String componentName , final Book book , final FeedbackPanel feedback ) { } public final void handleSubmit ( ) { final RequestCycle cycle = getRequestCycle ( ) ; PageParameters parameters = new PageParameters ( ) ; parameters . put ( "id" , new Long ( book . getId ( ) ) ) ; <START_BUG> cycle . setPage ( cycle . getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ; <END_BUG> cycle . setRedirect ( true ) ; } } }

Fix:
cycle . setPage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ;
Buggy code:
public class SFTP { private ChannelSftp mySftpChannel ; public SFTP ( ChannelSftp sftpChannel ) { } public void upload ( String filePath , String destination ) { } public void download ( String fileToDownload , String destination ) { } public void downloadProgramsDir ( ) { } public boolean fileExists ( ) { try { mySftpChannel . cd ( "cademons//incu//" ) ; <START_BUG> boolean result = mySftpChannel . ls ( mySftpChannel . pwd ( ) ) . toString ( ) . contains ( "Checked" ) ; <END_BUG> mySftpChannel . cd ( "..//..//" ) ; return result ; } catch ( SftpException e ) { e . printStackTrace ( ) ; return false ; } } public void createFile ( ) { } public void removeFile ( ) { } public void exit ( ) { } }

Fix:
boolean result = mySftpChannel . ls ( mySftpChannel . pwd ( ) ) . toString ( ) . contains ( "<seq2seq4repair_space>Checked," ) ;
Buggy code:
public class AntClassLoaderTest extends BuildFileTest { private Project p ; public AntClassLoaderTest ( String name ) { } public void setUp ( ) { } public void tearDown ( ) { } public void testJarWithManifestInDirWithSpace ( ) { } public void testJarWithManifestInNonAsciiDir ( ) { } public void testCleanup ( ) throws BuildException { Path path = new Path ( p , "." ) ; <START_BUG> AntClassLoader loader = new AntClassLoader ( p , path ) ; <END_BUG> try { loader . findClass ( "fubar" ) ; fail ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>expect<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>fubar<seq2seq4repair_space>class" ) ; } catch ( ClassNotFoundException e ) { } loader . cleanup ( ) ; try { loader . findClass ( "fubar" ) ; fail ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>expect<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>fubar<seq2seq4repair_space>class" ) ; } catch ( ClassNotFoundException e ) { } catch ( NullPointerException e ) { fail ( "loader<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>fail<seq2seq4repair_space>even<seq2seq4repair_space>if<seq2seq4repair_space>cleaned<seq2seq4repair_space>up" ) ; } p . fireBuildFinished ( null ) ; try { loader . findClass ( "fubar" ) ; fail ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>expect<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>fubar<seq2seq4repair_space>class" ) ; } catch ( ClassNotFoundException e ) { } catch ( NullPointerException e ) { fail ( "loader<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>fail<seq2seq4repair_space>even<seq2seq4repair_space>if<seq2seq4repair_space>project<seq2seq4repair_space>finished" ) ; } } }

Fix:
AntClassLoader loader = p . createClassLoader ( path ) ;
Buggy code:
public class PlaceCommand extends AbstractCommand { private RobotInfo robotInfo ; @ SuppressWarnings ( "unused" ) private Command command ; private String initParams ; public PlaceCommand ( Command command , RobotInfo robotInfo ) { } public PlaceCommand ( Command command , String initParams , RobotInfo robotInfo ) { } @ Override public void executeAction ( ) { } private boolean validateParams ( String [ ] initParamArray ) { } private boolean validateUnitParam ( String unit ) { if ( Utils . isNumeric ( unit ) ) { int x = Integer . parseInt ( unit ) ; <START_BUG> if ( x <= ( robotInfo . getMaxUnits ( ) ) ) { <END_BUG> return true ; } else { printErrorInfo ( "Sorry,unit<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>greater<seq2seq4repair_space>then<seq2seq4repair_space>MAX_UNITS" ) ; return false ; } } else { printErrorInfo ( "Sorry,unit<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>integer!" ) ; return false ; } } private boolean validateFacingParam ( String facing ) { } private void printErrorInfo ( String errorInfo ) { } }

Fix:
if ( ( x < ( robotInfo . getMaxUnits ( ) ) ) && ( x > ( - 1 ) ) ) {
Buggy code:
public class DeclarationOfReferencedMethodsPattern extends MethodReferencePattern { HashSet knownMethods ; IJavaElement enclosingElement ; public DeclarationOfReferencedMethodsPattern ( IJavaElement enclosingElement ) { } protected void matchReportReference ( AstNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } private void reportDeclaration ( MethodBinding methodBinding , MatchLocator locator ) throws CoreException { ReferenceBinding declaringClass = methodBinding . declaringClass ; IType type = locator . lookupType ( declaringClass ) ; if ( type == null ) return ; char [ ] selector = methodBinding . selector ; TypeBinding [ ] parameters = methodBinding . parameters ; int parameterLength = parameters . length ; String [ ] parameterTypes = new String [ parameterLength ] ; for ( int i = 0 ; i < parameterLength ; i ++ ) { parameterTypes [ i ] = Signature . createTypeSignature ( parameters [ i ] . sourceName ( ) , false ) ; } IMethod method = type . getMethod ( new String ( selector ) , parameterTypes ) ; if ( this . knownMethods . contains ( method ) ) return ; this . knownMethods . add ( method ) ; <START_BUG> IResource resource = type . getUnderlyingResource ( ) ; <END_BUG> boolean isBinary = type . isBinary ( ) ; IBinaryType info = null ; if ( isBinary ) { if ( resource == null ) { resource = type . getJavaProject ( ) . getProject ( ) ; } info = locator . getBinaryInfo ( ( ( ClassFile ) ( type . getClassFile ( ) ) ) , resource ) ; locator . reportBinaryMatch ( resource , method , info , IJavaSearchResultCollector . EXACT_MATCH ) ; } else { TypeDeclaration typeDecl = ( ( SourceTypeBinding ) ( declaringClass ) ) . scope . referenceContext ; AbstractMethodDeclaration methodDecl = null ; AbstractMethodDeclaration [ ] methodDecls = typeDecl . methods ; for ( int i = 0 , length = methodDecls . length ; i < length ; i ++ ) { if ( CharOperation . equals ( selector , methodDecls [ i ] . selector ) ) { methodDecl = methodDecls [ i ] ; break ; } } if ( methodDecl != null ) { locator . report ( resource , methodDecl . sourceStart , methodDecl . sourceEnd , method , IJavaSearchResultCollector . EXACT_MATCH ) ; } } } }

Fix:
IResource resource = type . getResource ( ) ;
Buggy code:
public class MockWebApplicationTest extends TestCase { private WicketTester application ; private static final IFeedbackMessageFilter RENDERED_MESSAGES = new IFeedbackMessageFilter ( ) { private static final long serialVersionUID = 1L ; public boolean accept ( FeedbackMessage message ) { } } ; public MockWebApplicationTest ( String name ) { } @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void testRenderHomePage ( ) throws Exception { <START_BUG> String document = application . getServletResponse ( ) . getDocument ( ) ; <END_BUG> DiffUtil . validatePage ( document , getClass ( ) , "MockPage_expectedResult.html" , true ) ; MockPage p = ( ( MockPage ) ( application . getLastRenderedPage ( ) ) ) ; Assert . assertEquals ( "Link<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>clicked<seq2seq4repair_space>0<seq2seq4repair_space>times" , 0 , p . getLinkClickCount ( ) ) ; } public void testSessionFeedbackMessagesCleanUp ( ) { } public void testClickLink ( ) throws Exception { } public void testProvidesDefaultResourceFinderIfNotSetByApplication ( ) { } public void testHonorsResourceFinderSettingsSetByApplication ( ) { } }

Fix:
String document = application . getLastResponseAsString ( ) ;
Buggy code:
public class FileSystemUtils { private static final FileSystemUtils INSTANCE = new FileSystemUtils ( ) ; private static final int INIT_PROBLEM = - 1 ; private static final int OTHER = 0 ; private static final int WINDOWS = 1 ; private static final int UNIX = 2 ; private static final int POSIX_UNIX = 3 ; private static final int OS ; private static final String DF ; public FileSystemUtils ( ) { } @ Deprecated public static long freeSpace ( String path ) throws IOException { } public static long freeSpaceKb ( String path ) throws IOException { } public static long freeSpaceKb ( String path , long timeout ) throws IOException { } public static long freeSpaceKb ( ) throws IOException { } public static long freeSpaceKb ( long timeout ) throws IOException { } long freeSpaceOS ( String path , int os , boolean kb , long timeout ) throws IOException { } long freeSpaceWindows ( String path , long timeout ) throws IOException { <START_BUG> path = FilenameUtils . normalize ( path ) ; <END_BUG> if ( ( ( path . length ( ) ) > 0 ) && ( ( path . charAt ( 0 ) ) != '"' ) ) { path = ( "\"" + path ) + "\"" ; } String [ ] cmdAttribs = new String [ ] { "cmd.exe" , "//C" , "dir<seq2seq4repair_space>//-c<seq2seq4repair_space>" + path } ; List < String > lines = performCommand ( cmdAttribs , Integer . MAX_VALUE , timeout ) ; for ( int i = ( lines . size ( ) ) - 1 ; i >= 0 ; i -- ) { String line = lines . get ( i ) ; if ( ( line . length ( ) ) > 0 ) { return parseDir ( line , path ) ; } } throw new IOException ( ( ( ( "Command<seq2seq4repair_space>line<seq2seq4repair_space>'dir<seq2seq4repair_space>//-c'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>return<seq2seq4repair_space>any<seq2seq4repair_space>info<seq2seq4repair_space>" + "for<seq2seq4repair_space>path<seq2seq4repair_space>'" ) + path ) + "'" ) ) ; } long parseDir ( String line , String path ) throws IOException { } long freeSpaceUnix ( String path , boolean kb , boolean posix , long timeout ) throws IOException { } long parseBytes ( String freeSpace , String path ) throws IOException { } List < String > performCommand ( String [ ] cmdAttribs , int max , long timeout ) throws IOException { } Process openProcess ( String [ ] cmdAttribs ) throws IOException { } }

Fix:
path = FilenameUtils . normalize ( path , false ) ;
Buggy code:
public class AnnotationPatternList extends PatternNode { private AnnotationTypePattern [ ] typePatterns ; int ellipsisCount = 0 ; public static final AnnotationPatternList EMPTY = new AnnotationPatternList ( new AnnotationTypePattern [ ] { } ) ; public static final AnnotationPatternList ANY = new AnnotationPatternList ( new AnnotationTypePattern [ ] { AnnotationTypePattern . ELLIPSIS } ) ; public AnnotationPatternList ( ) { } public AnnotationPatternList ( AnnotationTypePattern [ ] arguments ) { } public AnnotationPatternList ( List l ) { } protected AnnotationTypePattern [ ] getAnnotationPatterns ( ) { } public void resolve ( World inWorld ) { } public FuzzyBoolean matches ( ResolvedTypeX [ ] someArgs ) { int numArgsMatchedByEllipsis = ( ( someArgs . length ) + ( ellipsisCount ) ) - ( typePatterns . length ) ; if ( numArgsMatchedByEllipsis < 0 ) return FuzzyBoolean . NO ; if ( ( numArgsMatchedByEllipsis > 0 ) && ( ( ellipsisCount ) == 0 ) ) { return FuzzyBoolean . NO ; } FuzzyBoolean ret = FuzzyBoolean . YES ; int argsIndex = 0 ; for ( int i = 0 ; i < ( typePatterns . length ) ; i ++ ) { if ( ( typePatterns [ i ] ) == ( AnnotationTypePattern . ELLIPSIS ) ) { argsIndex += numArgsMatchedByEllipsis ; } else if ( ( typePatterns [ i ] ) == ( AnnotationTypePattern . ANY ) ) { argsIndex ++ ; } else { ExactAnnotationTypePattern ap = ( ( ExactAnnotationTypePattern ) ( typePatterns [ i ] ) ) ; <START_BUG> FuzzyBoolean matches = ap . matches ( someArgs [ argsIndex ] ) ; <END_BUG> if ( matches == ( FuzzyBoolean . NO ) ) { return FuzzyBoolean . MAYBE ; } else { argsIndex ++ ; ret = ret . and ( matches ) ; } } } return ret ; } public int size ( ) { } public AnnotationTypePattern get ( int index ) { } public AnnotationPatternList resolveBindings ( IScope scope , Bindings bindings , boolean allowBinding ) { } public AnnotationPatternList resolveReferences ( IntMap bindings ) { } public String toString ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public static AnnotationPatternList read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public void write ( DataOutputStream s ) throws IOException { } }

Fix:
FuzzyBoolean matches = ap . matchesRuntimeType ( someArgs [ argsIndex ] ) ;
Buggy code:
public class SoapSampler extends HTTPSampler2 { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String XML_DATA = "HTTPSamper.xml_data" ; public static final String URL_DATA = "SoapSampler.URL_DATA" ; public static final String SOAP_ACTION = "SoapSampler.SOAP_ACTION" ; public static final String SEND_SOAP_ACTION = "SoapSampler.SEND_SOAP_ACTION" ; public static final String XML_DATA_FILE = "SoapSampler.xml_data_file" ; private static final String DOUBLE_QUOTE = "\"" ; private static final String SOAPACTION = "SOAPAction" ; public void setXmlData ( String data ) { } public String getXmlData ( ) { } public void setXmlFile ( String filename ) { } public String getXmlFile ( ) { } public String getURLData ( ) { } public void setURLData ( String url ) { } public String getSOAPAction ( ) { } public String getSOAPActionQuoted ( ) { } public void setSOAPAction ( String action ) { } public boolean getSendSOAPAction ( ) { } public void setSendSOAPAction ( boolean action ) { } protected void setPostHeaders ( PostMethod post ) { } protected void sendPostData ( PostMethod post ) { final String xmlFile = getXmlFile ( ) ; if ( ( xmlFile != null ) && ( ( getXmlFile ( ) . length ( ) ) > 0 ) ) { post . setRequestEntity ( new RequestEntity ( ) { public boolean isRepeatable ( ) { return true ; } public void writeRequest ( OutputStream out ) throws IOException { byte [ ] buf = new byte [ 1024 ] ; int read ; InputStream in = new FileInputStream ( xmlFile ) ; while ( ( read = in . read ( buf ) ) > 0 ) { out . write ( buf , 0 , read ) ; } in . close ( ) ; out . flush ( ) ; } public long getContentLength ( ) { return - 1 ; } public String getContentType ( ) { return "text//xml" ; } } ) ; } else { post . setRequestEntity ( new RequestEntity ( ) { public boolean isRepeatable ( ) { return true ; } public void writeRequest ( OutputStream out ) throws IOException { PrintWriter printer = new PrintWriter ( out ) ; printer . print ( getXmlData ( ) ) ; printer . flush ( ) ; } public long getContentLength ( ) { <START_BUG> return - 1 ; <END_BUG> } public String getContentType ( ) { return "text//xml" ; } } ) ; } } protected HTTPSampleResult sample ( URL url , String method , boolean areFollowingRedirect , int frameDepth ) { } public URL getUrl ( ) throws MalformedURLException { } }

Fix:
return getXmlData ( ) . length ( ) ;
Buggy code:
public class CovMerge extends Task { private File home = null ; private File tofile = null ; private ArrayList filesets = new ArrayList ( ) ; private boolean verbose ; public CovMerge ( ) { } public void setHome ( File value ) { } public void setTofile ( File value ) { } public void setVerbose ( boolean flag ) { } public void addFileset ( FileSet fs ) { } public void execute ( ) throws TaskException { checkOptions ( ) ; File paramfile = createParamFile ( ) ; try { Commandline cmdl = new Commandline ( ) ; cmdl . setExecutable ( new File ( home , "jpcovmerge" ) . getAbsolutePath ( ) ) ; if ( verbose ) { cmdl . createArgument ( ) . setValue ( "-v" ) ; } cmdl . createArgument ( ) . setValue ( ( "-jp_paramfile=" + ( paramfile . getAbsolutePath ( ) ) ) ) ; final Execute exe = new Execute ( ) ; exe . setOutput ( new org . apache . tools . ant . taskdefs . exec . LogOutputStream ( this , Project . MSG_INFO ) ) ; exe . setError ( new org . apache . tools . ant . taskdefs . exec . LogOutputStream ( this , Project . MSG_WARN ) ) ; <START_BUG> log ( cmdl . toString ( ) , MSG_VERBOSE ) ; <END_BUG> exe . setCommandline ( cmdl . getCommandline ( ) ) ; int exitValue = exe . execute ( ) ; if ( exitValue != 0 ) { throw new TaskException ( ( ( "JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Merging<seq2seq4repair_space>failed<seq2seq4repair_space>(" + exitValue ) + ")" ) ) ; } } catch ( IOException e ) { throw new TaskException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>run<seq2seq4repair_space>JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Merge:<seq2seq4repair_space>" + e ) ) ; } finally { paramfile . delete ( ) ; } } protected File [ ] getSnapshots ( ) throws TaskException { } protected void checkOptions ( ) throws TaskException { } protected File createParamFile ( ) throws TaskException { } protected File createTmpFile ( ) { } }

Fix:
getLogger ( ) . debug ( cmdl . toString ( ) ) ;