nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Graph extends JComponent implements Scrollable , Clearable , GraphListener { private static Logger log = LoggingManager . getLoggerFor ( GUI ) ; private boolean data = true ; private boolean average = true ; private boolean deviation = true ; private boolean throughput = true ; private boolean median = true ; private GraphModel model ; private static int width = 2000 ; public Graph ( ) { } public Graph ( GraphModel model ) { } private void setModel ( Object model ) { } public Dimension getPreferredScrollableViewportSize ( ) { } public int getScrollableUnitIncrement ( Rectangle visibleRect , int orientation , int direction ) { } public int getScrollableBlockIncrement ( Rectangle visibleRect , int orientation , int direction ) { } public boolean getScrollableTracksViewportWidth ( ) { <START_BUG> return true ; <END_BUG> } public boolean getScrollableTracksViewportHeight ( ) { } public void clear ( ) { } public void enableData ( boolean value ) { } public void enableAverage ( boolean value ) { } public void enableMedian ( boolean value ) { } public void enableDeviation ( boolean value ) { } public void enableThroughput ( boolean value ) { } public void updateGui ( ) { } public void updateGui ( final Sample oneSample ) { } public void paintComponent ( Graphics g ) { } private void drawSample ( int x , Sample oneSample , Graphics g ) { } }

Fix:
return false ;
Buggy code:
public class CaseExpressionImpl implements CaseExpression , Visitable { private LinkedList < WhenClause > _whens = new LinkedList < WhenClause > ( ) ; private final Object _caseOperand ; public CaseExpressionImpl ( ) { } public CaseExpressionImpl ( Object caseOperand ) { } public Expression elseCase ( Expression arg ) { } public Expression elseCase ( String arg ) { } public Expression elseCase ( Number arg ) { } public Expression elseCase ( Date arg ) { } public Expression elseCase ( Calendar arg ) { } public Expression elseCase ( Class arg ) { } public Expression elseCase ( Enum < ? > arg ) { } public CaseExpression then ( Expression then ) { } public CaseExpression then ( Number then ) { } public CaseExpression then ( String then ) { } public CaseExpression then ( Date then ) { } public CaseExpression then ( Calendar then ) { } public CaseExpression then ( Class then ) { } public CaseExpression then ( Enum < ? > then ) { } public CaseExpression when ( Predicate when ) { } public CaseExpression when ( Expression when ) { } public CaseExpression when ( Number when ) { } public CaseExpression when ( String when ) { } public CaseExpression when ( Date when ) { } public CaseExpression when ( Calendar when ) { } public CaseExpression when ( Class when ) { } public CaseExpression when ( Enum < ? > when ) { } void assertWhenState ( ) { } void assertThenState ( ) { } public String asExpression ( AliasContext ctx ) { <START_BUG> StringBuffer tmp = new StringBuffer ( "CASE<seq2seq4repair_space>" ) ; <END_BUG> if ( ( _caseOperand ) != null ) { tmp . append ( toJPQL ( ctx , _caseOperand ) ) ; } for ( WhenClause when : _whens ) { tmp . append ( when . toJPQL ( ctx ) ) ; } return tmp . toString ( ) ; } public String asProjection ( AliasContext ctx ) { } public String asJoinable ( AliasContext ctx ) { } public String getAliasHint ( AliasContext ctx ) { } String toJPQL ( AliasContext ctx , Object o ) { } }

Fix:
StringBuilder tmp = new StringBuilder ( "CASE<seq2seq4repair_space>" ) ;
Buggy code:
public class Applet extends WebComponent implements IResourceListener , IFormSubmitListener { private static final long serialVersionUID = 1L ; private Class appletClass ; private List classes = new ArrayList ( 2 ) ; public static Object byteArrayToObject ( final byte [ ] data ) { } public static byte [ ] objectToByteArray ( Object object ) { } public Applet ( final String id , final Class appletClass ) { } public Applet ( final String id , final IModel model , final Class appletClass ) { } public void addClass ( final Class c ) { } public void onFormSubmitted ( ) { } public void setAppletModel ( Object model ) { } public Object getAppletModel ( ) { } public void onResourceRequested ( ) { } protected int getHeight ( ) { } protected int getWidth ( ) { } protected void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "applet" ) ; tag . put ( "code" , HostApplet . class . getName ( ) ) ; final String jarName = ( appletClass . getName ( ) ) + ".jar" ; final ResourceReference jarResourceReference = new ResourceReference ( jarName ) { protected Resource newResource ( ) { return new ByteArrayResource ( "application//x-compressed" , jarClasses ( classes ) ) . setCacheable ( false ) ; } } ; String servletPath = ( ( wicket . protocol . http . servlet . ServletWebRequest ) ( getRequest ( ) ) ) . getServletPath ( ) ; tag . put ( "codebase" , ( ( ( servletPath + '//' ) + ( Strings . beforeLastPathComponent ( jarResourceReference . getPath ( ) , '//' ) ) ) + "//" ) ) ; tag . put ( "archive" , jarName ) ; <START_BUG> tag . put ( "name" , getPageRelativePath ( ) ) ; <END_BUG> final int width = getWidth ( ) ; if ( width != ( - 1 ) ) { tag . put ( "width" , width ) ; } final int height = getHeight ( ) ; if ( height != ( - 1 ) ) { tag . put ( "height" , height ) ; } tag . setType ( OPEN ) ; super . onComponentTag ( tag ) ; } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } private void addAppletClass ( final Class appletClass ) { } private byte [ ] jarClasses ( final List classes ) { } }

Fix:
tag . put ( "name" , getPageRelativePath ( ) . replace ( ':' , '_' ) ) ;
Buggy code:
public class OpenHashMap < K , V > extends AbstractSet implements Map < K , V > { protected static final byte FREE = 0 ; protected static final byte FULL = 1 ; protected static final byte REMOVED = 2 ; protected static final Object NO_KEY_VALUE = null ; protected Object [ ] table ; protected Object [ ] values ; protected byte [ ] state ; protected int freeEntries ; public OpenHashMap ( ) { } public OpenHashMap ( int initialCapacity ) { } public OpenHashMap ( int initialCapacity , double minLoadFactor , double maxLoadFactor ) { } @ Override public void clear ( ) { <START_BUG> Arrays . fill ( this . state , 0 , ( ( state . length ) - 1 ) , OpenHashMap . FREE ) ; <END_BUG> distinct = 0 ; freeEntries = table . length ; trimToSize ( ) ; } @ Override @ SuppressWarnings ( "unchecked" ) public Object clone ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public boolean containsKey ( Object key ) { } @ SuppressWarnings ( "unchecked" ) @ Override public boolean containsValue ( Object value ) { } @ Override public void ensureCapacity ( int minCapacity ) { } @ SuppressWarnings ( "unchecked" ) public boolean forEachKey ( ObjectProcedure < K > procedure ) { } @ SuppressWarnings ( "unchecked" ) public boolean forEachPair ( ObjectObjectProcedure < K , V > procedure ) { } @ SuppressWarnings ( "unchecked" ) @ Override public V get ( Object key ) { } protected int indexOfInsertion ( K key ) { } protected int indexOfKey ( K key ) { } protected int indexOfValue ( V value ) { } @ SuppressWarnings ( "unchecked" ) public void keys ( List < K > list ) { } @ SuppressWarnings ( "unchecked" ) @ Override public V put ( K key , V value ) { } @ SuppressWarnings ( "unchecked" ) protected void rehash ( int newCapacity ) { } @ SuppressWarnings ( "unchecked" ) @ Override public V remove ( Object key ) { } @ Override protected void setUp ( int initialCapacity , double minLoadFactor , double maxLoadFactor ) { } @ Override public void trimToSize ( ) { } void getInternalFactors ( int [ ] capacity , double [ ] minLoadFactor , double [ ] maxLoadFactor ) { } private class MapEntry implements Map . Entry < K , V > { private K key ; private V value ; MapEntry ( K key , V value ) { } @ Override public K getKey ( ) { } @ Override public V getValue ( ) { } @ Override public V setValue ( V value ) { } } @ Override public Set < Map . Entry < K , V > > entrySet ( ) { } @ Override public Set < K > keySet ( ) { } @ Override public void putAll ( Map < ? extends K , ? extends V > m ) { } @ Override public Collection < V > values ( ) { } @ SuppressWarnings ( "unchecked" ) @ Override public boolean equals ( Object obj ) { } @ Override public String toString ( ) { } }

Fix:
Arrays . fill ( this . state , OpenHashMap . FREE ) ;
Buggy code:
public class MethodDeclarationPattern extends MethodPattern { public MethodDeclarationPattern ( char [ ] selector , int matchMode , boolean isCaseSensitive , char [ ] declaringQualification , char [ ] declaringSimpleName , char [ ] returnQualification , char [ ] returnSimpleName , char [ ] [ ] parameterQualifications , char [ ] [ ] parameterSimpleNames ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } public String getPatternName ( ) { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } public boolean matchesBinary ( Object binaryInfo , Object enclosingBinaryInfo ) { } public int matchLevel ( AstNode node , boolean resolve ) { if ( ! ( node instanceof MethodDeclaration ) ) return IMPOSSIBLE_MATCH ; MethodDeclaration method = ( ( MethodDeclaration ) ( node ) ) ; if ( resolve ) { return this . matchLevel ( method . binding ) ; } else { if ( ! ( this . matchesName ( this . selector , method . selector ) ) ) return IMPOSSIBLE_MATCH ; TypeReference methodReturnType = method . returnType ; if ( methodReturnType != null ) { char [ ] [ ] methodReturnTypeName = methodReturnType . getTypeName ( ) ; char [ ] sourceName = this . toArrayName ( methodReturnTypeName [ ( ( methodReturnTypeName . length ) - 1 ) ] , methodReturnType . dimensions ( ) ) ; if ( ! ( this . matchesName ( this . returnSimpleName , sourceName ) ) ) return IMPOSSIBLE_MATCH ; } int parameterCount = ( ( this . parameterSimpleNames ) == null ) ? - 1 : this . parameterSimpleNames . length ; if ( parameterCount > ( - 1 ) ) { int argumentCount = ( ( method . arguments ) == null ) ? 0 : method . arguments . length ; if ( parameterCount != argumentCount ) return IMPOSSIBLE_MATCH ; } <START_BUG> return POSSIBLE_MATCH ; <END_BUG> } } public int matchLevel ( Binding binding ) { } }

Fix:
return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ;
Buggy code:
public class SecurityDependencyProcessor implements DeploymentUnitProcessor { public static final ModuleIdentifier PICKETBOX_ID = ModuleIdentifier . create ( PICKETBOX . getName ( ) , PICKETBOX . getSlot ( ) ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; <START_BUG> final ModuleLoader moduleLoader = Module . getSystemModuleLoader ( ) ; <END_BUG> final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; moduleSpecification . addDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , SecurityDependencyProcessor . PICKETBOX_ID , false , true , false ) ) ; } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ;
Buggy code:
public class EnhancedCheckBoxMenuItem extends JCheckBoxMenuItem { public EnhancedCheckBoxMenuItem ( String label , EditAction action ) { } public Dimension getPreferredSize ( ) { } public void paint ( Graphics g ) { } public String getActionCommand ( ) { } private String shortcutProp1 ; private String shortcutProp2 ; private EditAction action ; private static Font acceleratorFont ; private static Color acceleratorForeground ; private static Color acceleratorSelectionForeground ; private String getShortcut ( ) { } class Model extends DefaultButtonModel { public boolean isSelected ( ) { if ( ! ( isShowing ( ) ) ) return false ; try { <START_BUG> return action . isSelected ( EditAction . getView ( EnhancedCheckBoxMenuItem . this ) ) ; <END_BUG> } catch ( Throwable t ) { Log . log ( Log . ERROR , this , t ) ; return false ; } } public void setSelected ( boolean b ) { } } }

Fix:
return action . isSelected ( GUIUtilities . getView ( EnhancedCheckBoxMenuItem . this ) ) ;
Buggy code:
public abstract class JavaSourceGenerator { private static final String LS = System . getProperty ( "line.separator" , "\n" ) ; private String encoding ; private String templateResourceName ; private String template ; private transient CompiledTemplate compiledTemplate ; protected JavaSourceGenerator ( ) { } public String getEncoding ( ) { } public void setEncoding ( final String encoding ) { } public String getTemplateResourceName ( ) { } public void setTemplateResourceName ( final String resourceName ) { } protected URL getTemplateResource ( ) { } public String getTemplate ( ) throws IOException { if ( ( this . template ) == null ) { final URL templateURL = this . getTemplateResource ( ) ; if ( templateURL == null ) { throw new IllegalStateException ( String . format ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>a<seq2seq4repair_space>template<seq2seq4repair_space>resource.<seq2seq4repair_space>The<seq2seq4repair_space>template<seq2seq4repair_space>resource<seq2seq4repair_space>name<seq2seq4repair_space>was<seq2seq4repair_space>%s" , this . getTemplateResourceName ( ) ) ) ; } BufferedReader reader = null ; InputStream stream = null ; try { stream = templateURL . openStream ( ) ; if ( stream != null ) { <START_BUG> reader = new BufferedReader ( new InputStreamReader ( stream ) ) ; <END_BUG> String line = null ; final StringBuilder sb = new StringBuilder ( ) ; while ( ( line = reader . readLine ( ) ) != null ) { sb . append ( line ) ; sb . append ( JavaSourceGenerator . LS ) ; } this . template = sb . toString ( ) ; } } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( final IOException nothingWeCanDo ) { } } if ( reader != null ) { try { reader . close ( ) ; } catch ( final IOException nothingWeCanDo ) { } } } } return this . template ; } public void setTemplate ( String template ) { } protected CompiledTemplate getCompiledTemplate ( ) throws IOException { } protected static final String getSimpleName ( final String name ) { } protected static final String getPackage ( final String name ) { } }

Fix:
reader = new BufferedReader ( new InputStreamReader ( stream , "UTF-8" ) ) ;
Buggy code:
public class ECFGenericHyperlink extends AbstractURLHyperlink { public ECFGenericHyperlink ( IRegion region , URI uri ) { } protected IConnectWizard createConnectWizard ( ) { } protected IContainer createContainer ( ) throws ContainerCreateException { } public void open ( ) { <START_BUG> new JoinGroupWizardAction ( ) . run ( null ) ; <END_BUG> } }

Fix:
new org . eclipse . ecf . internal . example . collab . actions . JoinGroupWizardAction ( getURI ( ) . toString ( ) ) . run ( null ) ;
Buggy code:
public class OSGiExtension implements Extension { public static final String SUBSYSTEM_NAME = "osgi" ; @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public void initialize ( ExtensionContext context ) { final SubsystemRegistration subsystem = context . registerSubsystem ( OSGiExtension . SUBSYSTEM_NAME ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( SUBSYSTEM ) ; registration . registerOperationHandler ( ADD , INSTANCE , DESCRIPTION , false ) ; <START_BUG> registration . registerReadWriteAttribute ( ACTIVATION , null , new ActivationAttributeHandler ( ) , EnumSet . of ( STORAGE_CONFIGURATION , RESTART_JVM ) ) ; <END_BUG> registration . registerReadWriteAttribute ( STARTLEVEL , READ_HANDLER , WRITE_HANDLER , RUNTIME ) ; registration . registerOperationHandler ( ACTIVATE , ActivateOperationHandler . INSTANCE , ActivateOperationHandler . INSTANCE , EnumSet . of ( RESTART_NONE ) ) ; registration . registerOperationHandler ( DESCRIBE , OSGiSubsystemDescribeHandler . INSTANCE , DESCRIPTION , false , PRIVATE ) ; ManagementResourceRegistration configuration = registration . registerSubModel ( PathElement . pathElement ( CONFIGURATION ) , CONFIGURATION_DESCRIPTION ) ; configuration . registerOperationHandler ( ADD , OSGiConfigurationAdd . INSTANCE , OSGiConfigurationAdd . DESCRIPTION , false ) ; configuration . registerOperationHandler ( REMOVE , OSGiConfigurationRemove . INSTANCE , OSGiConfigurationRemove . DESCRIPTION , false ) ; ManagementResourceRegistration properties = registration . registerSubModel ( PathElement . pathElement ( PROPERTY ) , PROPERTY_DESCRIPTION ) ; properties . registerOperationHandler ( ADD , OSGiFrameworkPropertyAdd . INSTANCE , OSGiFrameworkPropertyAdd . DESCRIPTION , false ) ; properties . registerOperationHandler ( REMOVE , OSGiFrameworkPropertyRemove . INSTANCE , OSGiFrameworkPropertyRemove . DESCRIPTION , false ) ; properties . registerReadWriteAttribute ( VALUE , null , OSGiFrameworkPropertyWrite . INSTANCE , Storage . CONFIGURATION ) ; ManagementResourceRegistration capabilities = registration . registerSubModel ( PathElement . pathElement ( CAPABILITY ) , CAPABILITY_DESCRIPTION ) ; capabilities . registerOperationHandler ( ADD , OSGiCapabilityAdd . INSTANCE , OSGiCapabilityAdd . DESCRIPTION , false ) ; capabilities . registerOperationHandler ( REMOVE , OSGiCapabilityRemove . INSTANCE , OSGiCapabilityRemove . DESCRIPTION , false ) ; if ( context . getProcessType ( ) . isServer ( ) ) { ManagementResourceRegistration bundles = registration . registerSubModel ( PathElement . pathElement ( BUNDLE ) , BUNDLE_DESCRIPTION ) ; BundleRuntimeHandler . INSTANCE . register ( bundles ) ; } subsystem . registerXMLElementWriter ( OSGiSubsystemWriter . INSTANCE ) ; } }

Fix:
registration . registerReadWriteAttribute ( ACTIVATION , null , ActivationAttributeHandler . INSTANCE , EnumSet . of ( STORAGE_CONFIGURATION , RESTART_JVM ) ) ;
Buggy code:
class TreeTab extends ScrollableTab { Tree tree1 ; Tree tree2 ; TreeItem textNode1 ; TreeItem imageNode1 ; Group treeGroup ; Group imageTreeGroup ; Group itemGroup ; Button checkButton ; Button fullSelectionButton ; Button multipleColumns ; Button moveableColumns ; Button headerVisibleButton ; Button linesVisibleButton ; Button itemForegroundButton ; Button itemBackgroundButton ; Button itemFontButton ; Color itemForegroundColor ; Color itemBackgroundColor ; Image itemForegroundImage ; Image itemBackgroundImage ; Font itemFont ; static String [ ] columnTitles = new String [ ] { ControlExample . getResourceString ( "TableTitle_0" ) , ControlExample . getResourceString ( "TableTitle_1" ) , ControlExample . getResourceString ( "TableTitle_2" ) , ControlExample . getResourceString ( "TableTitle_3" ) } ; static String [ ] [ ] tableData = new String [ ] [ ] { new String [ ] { ControlExample . getResourceString ( "TableLine0_0" ) , ControlExample . getResourceString ( "TableLine0_1" ) , ControlExample . getResourceString ( "TableLine0_2" ) , ControlExample . getResourceString ( "TableLine0_3" ) } , new String [ ] { ControlExample . getResourceString ( "TableLine1_0" ) , ControlExample . getResourceString ( "TableLine1_1" ) , ControlExample . getResourceString ( "TableLine1_2" ) , ControlExample . getResourceString ( "TableLine1_3" ) } , new String [ ] { ControlExample . getResourceString ( "TableLine2_0" ) , ControlExample . getResourceString ( "TableLine2_1" ) , ControlExample . getResourceString ( "TableLine2_2" ) , ControlExample . getResourceString ( "TableLine2_3" ) } } ; TreeTab ( ControlExample instance ) { } void createColorGroup ( ) { } void createOtherGroup ( ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void setItemText ( TreeItem item , int i , String node ) { } void createStyleGroup ( ) { } Item [ ] getExampleWidgetItems ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "Selection" , "SortDirection" , "TopItem" } ; <END_BUG> } Object [ ] parameterForType ( String typeName , String value , Control control ) { } TreeItem findItem ( String value , TreeItem [ ] items ) { } String getTabText ( ) { } void packColumns ( Tree tree ) { } void setColumnsMoveable ( ) { } void resetColorsAndFonts ( ) { } void setExampleWidgetState ( ) { } void setItemBackground ( ) { } void setItemForeground ( ) { } void setItemFont ( ) { } void setWidgetHeaderVisible ( ) { } void setWidgetLinesVisible ( ) { } }

Fix:
return new String [ ] { "ColumnOrder" , "Selection" , "SortDirection" , "TopItem" } ;
Buggy code:
@ RunWith ( Arquillian . class ) public class SimpleWebserviceEndpointTestCase { private static final Logger log = Logger . getLogger ( SimpleWebserviceEndpointTestCase . class . getName ( ) ) ; @ Deployment public static WebArchive createDeployment ( ) { final WebArchive war = ShrinkWrap . create ( WebArchive . class , "ws-endpoint-example.war" ) ; war . addPackage ( SimpleWebserviceEndpointImpl . class . getPackage ( ) ) ; war . addClass ( SimpleWebserviceEndpointImpl . class ) ; <START_BUG> war . addAsWebResource ( WebXml . get ( ( "<servlet>" + ( ( ( ( ( ( "<seq2seq4repair_space><servlet-name>TestService<//servlet-name>" + "<seq2seq4repair_space><servlet-class>org.jboss.as.testsuite.integration.ws.SimpleWebserviceEndpointImpl<//servlet-class>" ) + "<seq2seq4repair_space><//servlet>" ) + "<seq2seq4repair_space><servlet-mapping>" ) + "<seq2seq4repair_space><servlet-name>TestService<//servlet-name>" ) + "<seq2seq4repair_space><url-pattern>//SimpleService<//url-pattern>" ) + "<seq2seq4repair_space><//servlet-mapping>" ) ) ) , "web.xml" ) ; <END_BUG> SimpleWebserviceEndpointTestCase . log . info ( war . toString ( true ) ) ; return war ; } @ Test public void testSimpleStatelessWebserviceEndpoint ( ) throws Exception { } }

Fix:
war . addAsWebInfResource ( WebXml . get ( ( "<servlet>" + ( ( ( ( ( ( "<seq2seq4repair_space><servlet-name>TestService<//servlet-name>" + "<seq2seq4repair_space><servlet-class>org.jboss.as.testsuite.integration.ws.SimpleWebserviceEndpointImpl<//servlet-class>" ) + "<seq2seq4repair_space><//servlet>" ) + "<seq2seq4repair_space><servlet-mapping>" ) + "<seq2seq4repair_space><servlet-name>TestService<//servlet-name>" ) + "<seq2seq4repair_space><url-pattern>//SimpleService<//url-pattern>" ) + "<seq2seq4repair_space><//servlet-mapping>" ) ) ) , "web.xml" ) ;
Buggy code:
public class ReconcileWorkingCopyOperation extends JavaModelOperation { public static boolean PERF = false ; public int astLevel ; public boolean resolveBindings ; public HashMap problems ; boolean forceProblemDetection ; boolean enableStatementsRecovery ; WorkingCopyOwner workingCopyOwner ; public CompilationUnit ast ; public JavaElementDeltaBuilder deltaBuilder ; public ReconcileWorkingCopyOperation ( IJavaElement workingCopy , int astLevel , boolean forceProblemDetection , boolean enableStatementsRecovery , WorkingCopyOwner workingCopyOwner ) { } protected void executeOperation ( ) throws JavaModelException { } protected CompilationUnit getWorkingCopy ( ) { } public boolean isReadOnly ( ) { } public CompilationUnit makeConsistent ( CompilationUnit workingCopy , IProblemRequestor problemRequestor ) throws JavaModelException { if ( ! ( workingCopy . isConsistent ( ) ) ) { if ( ( this . problems ) == null ) this . problems = new HashMap ( ) ; <START_BUG> this . ast = workingCopy . makeConsistent ( this . astLevel , this . resolveBindings , this . problems , this . progressMonitor ) ; <END_BUG> this . deltaBuilder . buildDeltas ( ) ; if ( ( ( this . ast ) != null ) && ( ( this . deltaBuilder . delta ) != null ) ) this . deltaBuilder . delta . changedAST ( this . ast ) ; return this . ast ; } if ( ( this . ast ) != null ) return this . ast ; if ( ( this . forceProblemDetection ) && ( this . resolveBindings ) ) { if ( JavaProject . hasJavaNature ( workingCopy . getJavaProject ( ) . getProject ( ) ) ) { if ( ( this . problems ) == null ) this . problems = new HashMap ( ) ; CompilationUnitDeclaration unit = null ; try { char [ ] contents = workingCopy . getContents ( ) ; unit = CompilationUnitProblemFinder . process ( workingCopy , contents , this . workingCopyOwner , this . problems , ( ( this . astLevel ) != ( ICompilationUnit . NO_AST ) ) , this . enableStatementsRecovery , this . progressMonitor ) ; if ( ( this . progressMonitor ) != null ) this . progressMonitor . worked ( 1 ) ; if ( ( ( this . astLevel ) != ( ICompilationUnit . NO_AST ) ) && ( unit != null ) ) { Map options = workingCopy . getJavaProject ( ) . getOptions ( true ) ; this . ast = AST . convertCompilationUnit ( this . astLevel , unit , contents , options , true , workingCopy , this . progressMonitor ) ; if ( ( this . ast ) != null ) { this . deltaBuilder . delta = new JavaElementDelta ( workingCopy ) ; this . deltaBuilder . delta . changedAST ( this . ast ) ; } if ( ( this . progressMonitor ) != null ) this . progressMonitor . worked ( 1 ) ; } } finally { if ( unit != null ) { unit . cleanUp ( ) ; } } } return this . ast ; } return null ; } private void notifyParticipants ( final CompilationUnit workingCopy ) { } protected IJavaModelStatus verify ( ) { } }

Fix:
this . ast = workingCopy . makeConsistent ( this . astLevel , this . resolveBindings , this . enableStatementsRecovery , this . problems , this . progressMonitor ) ;
Buggy code:
public class SpringMvcInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { @ Override protected Class < ? > [ ] getRootConfigClasses ( ) { <START_BUG> return new Class [ ] { HibernateConfiguration . class , SecurityConfiguration . class } ; <END_BUG> } @ Override protected Class < ? > [ ] getServletConfigClasses ( ) { } @ Override protected String [ ] getServletMappings ( ) { } @ Override protected Filter [ ] getServletFilters ( ) { } No newline ; at end ; of file ; }

Fix:
return new Class [ ] { HibernateConfiguration . class , SecurityConfiguration . class , ApacheTilesViewConfiguration . class } ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws FileNotFoundException , Exception { Board board = new Board ( new File ( "board.txt" ) ) ; List < Actor > actors = new ArrayList < Actor > ( ) ; <START_BUG> for ( int i = 0 ; i < 4 ; ++ i ) { <END_BUG> Actor a = new actors . Ghost ( board ) ; actors . add ( new actors . Ghost ( board ) ) ; board . registerActor ( a ) ; a . spawn ( board . getGhostSpawn ( ) ) ; } PacmanUI u = new PacmanUI ( board ) ; for ( int i = 0 ; i < 10000 ; ++ i ) { board . boardTick ( ) ; u . redrawGrid ( board ) ; Thread . sleep ( 100 ) ; System . out . println ( board . toString ( ) ) ; } } }

Fix:
for ( int i = 0 ; i < 10 ; ++ i ) {
Buggy code:
public class MSVSSGET extends MSVSS { private String m_LocalPath = null ; private boolean m_Recursive = false ; private boolean m_Writable = false ; private String m_Version = null ; private String m_Date = null ; private String m_Label = null ; private String m_AutoResponse = null ; public void execute ( ) throws BuildException { } public void setLocalpath ( Path localPath ) { } public void getLocalpathCommand ( Commandline cmd ) { if ( ( m_LocalPath ) == null ) { return ; } else { File dir = project . resolveFile ( m_LocalPath ) ; if ( ! ( dir . exists ( ) ) ) { boolean done = dir . mkdirs ( ) ; if ( done == false ) { <START_BUG> String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesfull<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; <END_BUG> throw new BuildException ( msg , location ) ; } project . log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } cmd . createArgument ( ) . setValue ( ( ( FLAG_OVERRIDE_WORKING_DIR ) + ( m_LocalPath ) ) ) ; } } public void setRecursive ( boolean recursive ) { } public void getRecursiveCommand ( Commandline cmd ) { } public final void setWritable ( boolean argWritable ) { } public void getWritableCommand ( Commandline cmd ) { } public void setVersion ( String version ) { } public void setDate ( String date ) { } public void setLabel ( String label ) { } public void getVersionCommand ( Commandline cmd ) { } public void setAutoresponse ( String response ) { } public void getAutoresponse ( Commandline cmd ) { } }

Fix:
String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "successful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ;
Buggy code:
public class MainActivity extends Activity implements OnClickListener { String firstSubType ; String secondSubType ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onClick ( View v ) { EditText firstSub = ( ( EditText ) ( findViewById ( first_substance ) ) ) ; EditText secondSub = ( ( EditText ) ( findViewById ( second_substance ) ) ) ; TextView result = ( ( TextView ) ( findViewById ( result ) ) ) ; switch ( v . getId ( ) ) { case id . enter : Recogniser rec = new Recogniser ( ) ; firstSubType = rec . recognise ( ( ( String ) ( firstSub . getText ( ) . toString ( ) ) ) ) ; Substance firstSubstance = new Substance ( firstSubType , firstSub . getText ( ) . toString ( ) ) ; secondSubType = rec . recognise ( ( ( String ) ( secondSub . getText ( ) . toString ( ) ) ) ) ; Substance secondSubstance = new Substance ( secondSubType , secondSub . getText ( ) . toString ( ) ) ; try { <START_BUG> result . setText ( ( ( CharSequence ) ( ( ( firstSubstance . toString ( ) ) + "<seq2seq4repair_space>+<seq2seq4repair_space>" ) + ( secondSubstance . toString ( ) ) ) ) ) ; <END_BUG> } catch ( Exception e ) { Toast . makeText ( this , e . getMessage ( ) , LENGTH_LONG ) . show ( ) ; } Toast . makeText ( this , ( ( ( firstSubstance . getType ( ) ) + "<seq2seq4repair_space>+<seq2seq4repair_space>" ) + ( secondSubstance . getType ( ) ) ) , LENGTH_LONG ) . show ( ) ; break ; case id . clear : firstSubType = "" ; secondSubType = "" ; result . setText ( "" ) ; break ; case id . about : Intent intent = new Intent ( this , AboutActivity . class ) ; startActivity ( intent ) ; break ; } } }

Fix:
result . setText ( ( ( CharSequence ) ( Substance . react ( firstSubstance , secondSubstance ) ) ) ) ;
Buggy code:
public class HomeArmAuto extends SequenceOpMode { @ Override public void addSteps ( LinkedList < SequenceStep > steps ) { RobotGoatEFoster robot = new RobotGoatEFoster ( this ) ; <START_BUG> steps . add ( new ArmHomeStep ( robot ) ) ; <END_BUG> } }

Fix:
steps . add ( robot . arm . new HomeStep ( ) ) ;
Buggy code:
public class Sequence { private final boolean DEBUG = false ; private String basepairs ; private String foldedStruct ; private int maxPairings ; private int [ ] [ ] completedMatrix = null ; public String getBasepairs ( ) { } public void setBasepairs ( String basepairs ) { } public Sequence ( String basepairs ) { } public String getFoldedStruct ( ) { } public int getMaxPairings ( ) { } public void fold ( ) { } private void print ( int [ ] [ ] a ) { } private int [ ] [ ] getPairingMatrix ( ) { int [ ] [ ] m = new int [ basepairs . length ( ) ] [ basepairs . length ( ) ] ; for ( int i = 0 ; i < ( m . length ) ; i ++ ) { m [ i ] [ i ] = 0 ; if ( i > 0 ) { m [ i ] [ ( i - 1 ) ] = 0 ; } if ( i < ( ( m . length ) - 1 ) ) { m [ i ] [ ( i + 1 ) ] = ( isValidPair ( i , ( i + 1 ) ) ) ? 1 : 0 ; } } <START_BUG> for ( int end = 1 ; end < ( ( m . length ) - 1 ) ; end ++ ) { <END_BUG> for ( int start = end - 1 ; start > ( - 1 ) ; start -- ) { int max = 0 ; if ( isValidPair ( start , end ) ) { if ( ( ( m [ ( start + 1 ) ] [ ( end - 1 ) ] ) + 1 ) > max ) max = ( m [ ( start + 1 ) ] [ ( end - 1 ) ] ) + 1 ; System . out . println ( ( ( ( ( start + ":" ) + end ) + "<seq2seq4repair_space>is<seq2seq4repair_space>valid<seq2seq4repair_space>pair<seq2seq4repair_space>" ) + max ) ) ; } if ( ( m [ ( start + 1 ) ] [ end ] ) > max ) max = m [ ( start + 1 ) ] [ end ] ; if ( ( m [ start ] [ ( end - 1 ) ] ) > max ) max = m [ start ] [ ( end - 1 ) ] ; for ( int i = start + 1 ; i < end ; i ++ ) { int curBpCount = ( m [ start ] [ i ] ) + ( m [ ( i + 1 ) ] [ end ] ) ; if ( curBpCount > max ) max = curBpCount ; } m [ start ] [ end ] = max ; print ( m ) ; } } this . completedMatrix = m ; return m ; } private boolean isValidPair ( int x , int y ) { } @ Override public String toString ( ) { } }

Fix:
for ( int end = 1 ; end < ( m . length ) ; end ++ ) {
Buggy code:
public class BayesTfIdfDriver { private static final Logger log = LoggerFactory . getLogger ( BayesTfIdfDriver . class ) ; private BayesTfIdfDriver ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void runJob ( String input , String output ) throws IOException { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( BayesTfIdfDriver . class ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( DoubleWritable . class ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-termDocCount" ) ) ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-wordFreq" ) ) ) ; FileInputFormat . addInputPath ( conf , new Path ( ( output + "//trainer-featureCount" ) ) ) ; Path outPath = new Path ( ( output + "//trainer-tfIdf" ) ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setNumMapTasks ( 100 ) ; conf . setMapperClass ( BayesTfIdfMapper . class ) ; conf . setInputFormat ( SequenceFileInputFormat . class ) ; conf . setCombinerClass ( BayesTfIdfReducer . class ) ; conf . setReducerClass ( BayesTfIdfReducer . class ) ; conf . setOutputFormat ( BayesTfIdfOutputFormat . class ) ; conf . set ( "io.serializations" , "org.apache.hadoop.io.serializer.JavaSerialization,org.apache.hadoop.io.serializer.WritableSerialization" ) ; <START_BUG> FileSystem dfs = FileSystem . get ( conf ) ; <END_BUG> if ( dfs . exists ( outPath ) ) dfs . delete ( outPath , true ) ; Path interimFile = new Path ( ( output + "//trainer-docCount//part-*" ) ) ; Map < String , Double > labelDocumentCounts = SequenceFileModelReader . readLabelDocumentCounts ( dfs , interimFile , conf ) ; DefaultStringifier < Map < String , Double > > mapStringifier = new DefaultStringifier < Map < String , Double > > ( conf , GenericsUtil . getClass ( labelDocumentCounts ) ) ; String labelDocumentCountString = mapStringifier . toString ( labelDocumentCounts ) ; BayesTfIdfDriver . log . info ( "Counts<seq2seq4repair_space>of<seq2seq4repair_space>documents<seq2seq4repair_space>in<seq2seq4repair_space>Each<seq2seq4repair_space>Label" ) ; Map < String , Double > c = mapStringifier . fromString ( labelDocumentCountString ) ; BayesTfIdfDriver . log . info ( "{}" , c ) ; conf . set ( "cnaivebayes.labelDocumentCounts" , labelDocumentCountString ) ; client . setConf ( conf ) ; JobClient . runJob ( conf ) ; } }

Fix:
FileSystem dfs = FileSystem . get ( outPath . toUri ( ) , conf ) ;
Buggy code:
final class JVMEnvironmentVariableAddHandler implements OperationStepHandler , DescriptionProvider { static final String OPERATION_NAME = "add-item-to-environment-variables-list" ; static final JVMEnvironmentVariableAddHandler INSTANCE = new JVMEnvironmentVariableAddHandler ( ) ; private final ParameterValidator validator = new StringLengthValidator ( 1 ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { validator . validateParameter ( NAME , operation . get ( NAME ) ) ; validator . validateParameter ( VALUE , operation . get ( VALUE ) ) ; final Resource resource = context . readResourceForUpdate ( EMPTY_ADDRESS ) ; final ModelNode model = resource . getModel ( ) ; final String name = operation . require ( NAME ) . asString ( ) ; final String value = operation . require ( VALUE ) . asString ( ) ; ModelNode variables = model . get ( JVM_ENV_VARIABLES ) ; if ( variables . isDefined ( ) ) { for ( ModelNode varNode : variables . asList ( ) ) { if ( varNode . asProperty ( ) . getName ( ) . equals ( name ) ) { throw HostControllerMessages . MESSAGES . envVariableAlreadyExists ( varNode . asProperty ( ) . getName ( ) ) ; } } } model . get ( JVM_ENV_VARIABLES ) . add ( name , value ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public class GDataItem implements HasNonBeanPropertyDescriptors , Plottable , TimeStampedDataItem { public static final String LOCATION = "Location" ; public static interface Setter { public void setValue ( String name , Object value ) { } } public final class GDataInfo extends Griddable { private NonBeanPropertyDescriptor [ ] _myGridProps ; private PropertyDescriptor [ ] _myInfoPropertyDescriptors ; public GDataInfo ( final GDataItem data ) { } @ Override public final String getDisplayName ( ) { } @ Override public PropertyDescriptor [ ] getGriddablePropertyDescriptors ( ) { <START_BUG> return null ; <END_BUG> } public final BeanInfo [ ] getAdditionalBeanInfo ( ) { } public final PropertyDescriptor [ ] getPropertyDescriptors ( ) { } public final MethodDescriptor [ ] getMethodDescriptors ( ) { } public final SubjectAction [ ] getUndoableActions ( ) { } @ Override public NonBeanPropertyDescriptor [ ] getNonBeanGriddableDescriptors ( ) { } } private final HashMap < String , Object > _myData ; private final String _name ; private final GDataItem . Setter _setter ; private final Color _color ; public GDataItem ( final String name , final HashMap < String , Object > fields , final GDataItem . Setter setter , Color color ) { } @ Override public String getName ( ) { } @ Override public boolean hasEditor ( ) { } @ Override public EditorType getInfo ( ) { } @ Override public int compareTo ( final Plottable o ) { } public HiResDate getTime ( ) { } @ Override public void paint ( final CanvasType dest ) { } @ Override public WorldArea getBounds ( ) { } @ Override public boolean getVisible ( ) { } @ Override public void setVisible ( final boolean val ) { } @ Override public double rangeFrom ( final WorldLocation other ) { } @ Override public HiResDate getDTG ( ) { } @ Override public void setDTG ( final HiResDate date ) { } public Object getValue ( final String fieldName ) { } @ Override public void setValue ( final String fieldName , final Object newVal ) { } public TimeStampedDataItem makeCopy ( ) { } @ Override public Color getColor ( ) { } No newline ; at end ; of file ; }

Fix:
return new PropertyDescriptor [ 0 ] ;
Buggy code:
public class RatingsPage extends BasePage { public static final ResourceReference WICKETSTAR0 = new ResourceReference ( RatingsPage . class , "WicketStar0.png" ) ; public static final ResourceReference WICKETSTAR1 = new ResourceReference ( RatingsPage . class , "WicketStar1.png" ) ; private static final long serialVersionUID = 1L ; private final class ResetRatingLink extends Link { private static final long serialVersionUID = 1L ; public ResetRatingLink ( String id , IModel object ) { } public void onClick ( ) { <START_BUG> RatingsPage . RatingModel rating = ( ( RatingsPage . RatingModel ) ( getModelObject ( ) ) ) ; <END_BUG> rating . nrOfVotes = 0 ; rating . rating = 0 ; rating . sumOfRatings = 0 ; } } public static class RatingModel implements IClusterable { private int nrOfVotes = 0 ; private int sumOfRatings = 0 ; private double rating = 0 ; public boolean isActive ( int star ) { } public Integer getNrOfVotes ( ) { } public void addRating ( int nrOfStars ) { } public Double getRating ( ) { } public int getSumOfRatings ( ) { } } private static RatingsPage . RatingModel rating1 = new RatingsPage . RatingModel ( ) ; private static RatingsPage . RatingModel rating2 = new RatingsPage . RatingModel ( ) ; private Boolean hasVoted = Boolean . FALSE ; public RatingsPage ( ) { } public Boolean getHasVoted ( ) { } }

Fix:
RatingsPage . RatingModel rating = ( ( RatingsPage . RatingModel ) ( getDefaultModelObject ( ) ) ) ;
Buggy code:
@ Transactional public class UserDao { @ PersistenceContext private EntityManager em ; public UserDao ( ) { } public Long save ( User user ) { } public long updateUser ( User user ) { } public List < User > getAll ( ) { } public List < User > getOne ( String username ) { } public ArrayList < Document > getAddsforUser ( String username , int numberOfMentioned ) { } public ArrayList < Document > getAddsforUserbyFriends ( String username , int depth , int numberOfMentioned ) { } public List < User > getInfluentUsers ( int limit ) { System . out . println ( "#2" ) ; <START_BUG> return em . createQuery ( "SELECT<seq2seq4repair_space>u<seq2seq4repair_space>FROM<seq2seq4repair_space>User<seq2seq4repair_space>u<seq2seq4repair_space>WHERE<seq2seq4repair_space>(u.favorites+u.retweets+u.numOfFollowers)>100<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>(u.favorites+u.retweets+u.numOfFollowers)<seq2seq4repair_space>desc" , User . class ) . setMaxResults ( limit ) . getResultList ( ) ; <END_BUG> } public List < User > findUsersInterestedFocused ( int count ) { } public List < User > findUsersInterestedInBroadRangeOfTopics ( int count ) { } }

Fix:
return em . createQuery ( "SELECT<seq2seq4repair_space>u<seq2seq4repair_space>FROM<seq2seq4repair_space>User<seq2seq4repair_space>u<seq2seq4repair_space>WHERE<seq2seq4repair_space>u.favorites>100<seq2seq4repair_space>and<seq2seq4repair_space>u.retweets>100<seq2seq4repair_space>and<seq2seq4repair_space>u.numOfFollowers>100<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>(u.favorites+u.retweets+u.numOfFollowers)<seq2seq4repair_space>desc" , User . class ) . setMaxResults ( limit ) . getResultList ( ) ;
Buggy code:
class FakeProject extends AbstractProject { static String PROJECT_ROOT = "//tmp//project-x//" ; private Collection < ProjectFile > col ; public FakeProject ( ) { } public ProjectFile getFileByName ( String n ) { } @ Override public void init ( OffListModel model ) { this . model = model ; final List < String > sourceGroups = Collections . singletonList ( FakeProject . PROJECT_ROOT ) ; String projectRootDir = FakeProject . PROJECT_ROOT ; <START_BUG> this . model . reinit ( sourceGroups , projectRootDir ) ; <END_BUG> for ( ProjectFile pf : col ) { this . model . addFile ( pf ) ; } } }

Fix:
this . model . reinit ( sourceGroups ) ;
Buggy code:
public class AutoJavadoc implements Consumer < Class > { @ Override public void accept ( Class model ) { } private static < T extends Documentable & Generable > T generateJavadocFor ( T m ) { if ( ! ( m . getJavadoc ( ) . isPresent ( ) ) ) { final Javadoc doc = new Javadoc ( "Write<seq2seq4repair_space>some<seq2seq4repair_space>documentation<seq2seq4repair_space>here." ) ; if ( m instanceof Class ) { <START_BUG> doc . add ( AUTHOR . setName ( "Your<seq2seq4repair_space>Name" ) ) ; <END_BUG> } AutoJavadoc . paramsForGenerable ( doc , m ) ; m . setJavadoc ( doc ) ; } return m ; } private static Generable < ? > paramsForGenerable ( Javadoc doc , Generable < ? > gen ) { } private static Method paramsForMethod ( Method m ) { } }

Fix:
doc . add ( AUTHOR . setValue ( "Your<seq2seq4repair_space>Name" ) ) ;
Buggy code:
public class ParseTreeConverter extends KLQBaseVisitor < ANode > { @ Override public ANode visitQuestionnaire ( KLQParser . QuestionnaireContext ctx ) { } @ Override public ANode visitUncondQuestion ( KLQParser . UncondQuestionContext ctx ) { } @ Override public ANode visitCondQuestion ( KLQParser . CondQuestionContext ctx ) { } @ Override public ANode visitDate ( KLQParser . DateContext ctx ) { } @ Override public ANode visitNumber ( KLQParser . NumberContext ctx ) { } @ Override public ANode visitString ( KLQParser . StringContext ctx ) { } @ Override public ANode visitAddSub ( KLQParser . AddSubContext ctx ) { } @ Override public ANode visitMulDiv ( KLQParser . MulDivContext ctx ) { } @ Override public ANode visitComparators ( @ NotNull KLQParser . ComparatorsContext ctx ) { ANode leftChild = visit ( ctx . expr ( 0 ) ) ; ANode rightChild = visit ( ctx . expr ( 1 ) ) ; ANode node ; <START_BUG> if ( ( ctx . operator . getType ( ) ) == ( KLQParser . G ) ) { <END_BUG> node = new GreaterThanNode ( leftChild , rightChild ) ; } else { node = new GreaterThanNode ( leftChild , rightChild ) ; } return node ; } @ Override public ANode visitParens ( KLQParser . ParensContext ctx ) { } No newline ; at end ; of file ; }

Fix:
if ( ( ctx . operator . getType ( ) ) == ( KLQParser . GT ) ) {
Buggy code:
public class DefaultSamplerCreator extends AbstractSamplerCreator { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public DefaultSamplerCreator ( ) { } @ Override public String [ ] getManagedContentTypes ( ) { } @ Override public HTTPSamplerBase createSampler ( HttpRequestHdr request , Map < String , String > pageEncodings , Map < String , String > formEncodings ) { } @ Override public final void populateSampler ( HTTPSamplerBase sampler , HttpRequestHdr request , Map < String , String > pageEncodings , Map < String , String > formEncodings ) throws Exception { } protected void computeFromHeader ( HTTPSamplerBase sampler , HttpRequestHdr request , Map < String , String > pageEncodings , Map < String , String > formEncodings ) throws Exception { } protected void computeFromPostBody ( HTTPSamplerBase sampler , HttpRequestHdr request ) throws Exception { } private static final boolean isPotentialXml ( String postData ) { try { SAXParserFactory spf = SAXParserFactory . newInstance ( ) ; SAXParser saxParser = spf . newSAXParser ( ) ; XMLReader xmlReader = saxParser . getXMLReader ( ) ; DefaultSamplerCreator . ErrorDetectionHandler detectionHandler = new DefaultSamplerCreator . ErrorDetectionHandler ( ) ; xmlReader . setContentHandler ( detectionHandler ) ; xmlReader . parse ( new InputSource ( new StringReader ( postData ) ) ) ; <START_BUG> return detectionHandler . isErrorDetected ( ) ; <END_BUG> } catch ( ParserConfigurationException e ) { return false ; } catch ( SAXException e ) { return false ; } catch ( IOException e ) { return false ; } } private static final class ErrorDetectionHandler extends DefaultHandler { private boolean errorDetected = false ; public ErrorDetectionHandler ( ) { } @ Override public void error ( SAXParseException e ) throws SAXException { } @ Override public void fatalError ( SAXParseException e ) throws SAXException { } public boolean isErrorDetected ( ) { } } protected void computeSamplerName ( HTTPSamplerBase sampler , HttpRequestHdr request ) { } protected void computePath ( HTTPSamplerBase sampler , HttpRequestHdr request ) { } protected void computeContentEncoding ( HTTPSamplerBase sampler , HttpRequestHdr request , Map < String , String > pageEncodings , Map < String , String > formEncodings ) throws MalformedURLException { } protected String computeContentEncoding ( HttpRequestHdr request , Map < String , String > pageEncodings , Map < String , String > formEncodings , String urlWithoutQuery ) { } protected void computeProtocol ( HTTPSamplerBase sampler , HttpRequestHdr request ) { } protected void computePort ( HTTPSamplerBase sampler , HttpRequestHdr request ) { } protected void computeMethod ( HTTPSamplerBase sampler , HttpRequestHdr request ) { } protected void computeDomain ( HTTPSamplerBase sampler , HttpRequestHdr request ) { } }

Fix:
return ! ( detectionHandler . isErrorDetected ( ) ) ;