nus-yam/ex-repair huggingface dataset:
Buggy code:
class ReadTransformedResourceOperation implements OperationStepHandler { public static final OperationDefinition DEFINITION = new org . jboss . as . controller . SimpleOperationDefinitionBuilder ( READ_TRANSFORMED_RESOURCE_OPERATION , null ) . setPrivateEntry ( ) . build ( ) ; private final TransformerRegistry transformerRegistry ; private final ModelVersion coreModelVersion ; private final ModelVersion subsystemModelVersion ; ReadTransformedResourceOperation ( final TransformerRegistry transformerRegistry , ModelVersion coreModelVersion , ModelVersion subsystemModelVersion ) { } private ModelNode transformReadResourceResult ( final OperationContext context , ModelNode original , String subsystem ) throws OperationFailedException { ModelNode rootData = original . get ( RESULT ) ; Map < PathAddress , ModelVersion > subsystemVersions = new HashMap < PathAddress , ModelVersion > ( ) ; subsystemVersions . put ( EMPTY_ADDRESS . append ( SUBSYSTEM , subsystem ) , subsystemModelVersion ) ; <START_BUG> final TransformationTarget target = TransformationTargetImpl . create ( transformerRegistry , coreModelVersion , subsystemVersions , null , SERVER ) ; <END_BUG> final Transformers transformers = Factory . create ( target ) ; final ImmutableManagementResourceRegistration rr = context . getRootResourceRegistration ( ) ; Resource root = TransformerRegistry . modelToResource ( rr , rootData , true ) ; Resource transformed = transformers . transformRootResource ( context , root ) ; return Tools . readModel ( transformed ) ; } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } }

Fix:
final TransformationTarget target = TransformationTargetImpl . create ( transformerRegistry , coreModelVersion , subsystemVersions , null , SERVER , null ) ;
Buggy code:
@ Stateless public class SensorEJB implements Serializable , SensorEJBLocal , SensorEJBRemote { private static final long serialVersionUID = - 105973508621065464L ; @ PersistenceContext ( unitName = "primary" ) private EntityManager em ; @ Override public List < Sensor > findSensorsById ( Long id ) { } @ Override public List < Sensor > findSensors ( ) { <START_BUG> TypedQuery < Sensor > query = em . createNamedQuery ( "findSensors" , Sensor . class ) ; <END_BUG> return query . getResultList ( ) ; } @ Override public List < Sensor > findRemovedSensors ( ) { } @ Override public void reaffectSensor ( Drone drone , Long sensorId ) { } @ Override public List < Sensor > findDroneSensors ( ) { } @ Override public void createSensor ( int type , String name , String model , Date inServiceDate , Float price , Drone drone ) { } public void deleteSensor ( Long sensorId ) { } }

Fix:
TypedQuery < Sensor > query = em . createNamedQuery ( "findDroneSensors" , Sensor . class ) ;
Buggy code:
public class CMBuilder { private XSDeclarationPool fDeclPool = null ; private static XSEmptyCM fEmptyCM = new XSEmptyCM ( ) ; private int fLeafCount ; private int fParticleCount ; private CMNodeFactory fNodeFactory ; public CMBuilder ( CMNodeFactory nodeFactory ) { } public void setDeclPool ( XSDeclarationPool declPool ) { } public XSCMValidator getContentModel ( XSComplexTypeDecl typeDecl ) { } XSCMValidator createAllCM ( XSParticleDecl particle ) { } XSCMValidator createDFACM ( XSParticleDecl particle ) { } private CMNode buildSyntaxTree ( XSParticleDecl particle ) { } private CMNode expandContentModel ( CMNode node , int minOccurs , int maxOccurs ) { } private CMNode multiNodes ( CMNode node , int num , boolean copyFirst ) { if ( num == 0 ) { return null ; } if ( num == 1 ) { return copyFirst ? copyNode ( node ) : node ; } int num1 = num // 2 ; <START_BUG> return fNodeFactory . getCMBinOpNode ( MODELGROUP_SEQUENCE , multiNodes ( node , num1 , copyFirst ) , multiNodes ( node , ( num - num1 ) , false ) ) ; <END_BUG> } private CMNode copyNode ( CMNode node ) { } }

Fix:
return fNodeFactory . getCMBinOpNode ( MODELGROUP_SEQUENCE , multiNodes ( node , num1 , copyFirst ) , multiNodes ( node , ( num - num1 ) , true ) ) ;
Buggy code:
public class ResourceInjectionAnnotationParsingProcessor extends AbstractComponentConfigProcessor { private static final DotName RESOURCE_ANNOTATION_NAME = DotName . createSimple ( Resource . class . getName ( ) ) ; private static final DotName RESOURCES_ANNOTATION_NAME = DotName . createSimple ( Resources . class . getName ( ) ) ; protected void processComponentConfig ( final DeploymentUnit deploymentUnit , final DeploymentPhaseContext phaseContext , final CompositeIndex index , final ComponentConfiguration componentConfiguration ) { <START_BUG> final ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( componentConfiguration . getBeanClass ( ) ) ) ; <END_BUG> componentConfiguration . addResourceInjectionConfigs ( ResourceInjectionAnnotationParsingProcessor . getResourceConfigurations ( classInfo ) ) ; final List < MethodInterceptorConfiguration > interceptorConfigurations = componentConfiguration . getMethodInterceptorConfigs ( ) ; for ( MethodInterceptorConfiguration interceptorConfiguration : interceptorConfigurations ) { final ClassInfo interceptorClassInfo = index . getClassByName ( DotName . createSimple ( interceptorConfiguration . getInterceptorClassName ( ) ) ) ; interceptorConfiguration . addResourceInjectionConfigs ( ResourceInjectionAnnotationParsingProcessor . getResourceConfigurations ( interceptorClassInfo ) ) ; } } public static List < ResourceInjectionConfiguration > getResourceConfigurations ( final ClassInfo classInfo ) { } public static ResourceInjectionConfiguration getResourceConfiguration ( final ClassInfo classInfo , final AnnotationInstance annotation ) { } private static ResourceInjectionConfiguration processFieldResource ( final AnnotationInstance annotation , final FieldInfo fieldInfo ) { } private static ResourceInjectionConfiguration processMethodResource ( final AnnotationInstance annotation , final MethodInfo methodInfo ) { } private static ResourceInjectionConfiguration processClassResource ( final AnnotationInstance annotation , final ClassInfo classInfo ) { } private static List < ResourceInjectionConfiguration > processClassResources ( final ClassInfo classInfo , final Map < DotName , List < AnnotationInstance > > classAnnotations ) { } private static String getTargetContextName ( final AnnotationInstance resource , final String contextNameSuffix , final String injectionType ) { } private static boolean isEnvironmentEntryType ( final String type ) { } }

Fix:
final ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( componentConfiguration . getComponentClassName ( ) ) ) ;
Buggy code:
public class CommonsMultipartFile implements Serializable , MultipartFile { private static final String CONTENT_TYPE = "Content-Type" ; protected static final Log logger = LogFactory . getLog ( CommonsMultipartFile . class ) ; private final FileItem fileItem ; private final long size ; public CommonsMultipartFile ( FileItem fileItem ) { } public final FileItem getFileItem ( ) { } public String getName ( ) { } public String getOriginalFilename ( ) { } public String getContentType ( ) { } public boolean isEmpty ( ) { } public long getSize ( ) { } public byte [ ] getBytes ( ) { } public InputStream getInputStream ( ) throws IOException { } public void transferTo ( File dest ) throws IOException , IllegalStateException { } protected boolean isAvailable ( ) { } public String getStorageDescription ( ) { } public String getHeader ( String name ) { } public String [ ] getHeaders ( String name ) { } <START_BUG> public Iterator < String > getHeaderNames ( String name ) { <END_BUG> return Collections . singleton ( CommonsMultipartFile . CONTENT_TYPE ) . iterator ( ) ; } }

Fix:
public Iterator < String > getHeaderNames ( ) {
Buggy code:
public class Server { private int serverID ; private String serverTitle ; private String serverHostname ; private int serverPort ; private String password ; private boolean autoConnect ; private String nickname ; private int status ; private boolean isConnected ; private ArrayList < Channel > channels ; private String currentChannel ; private InputThread inputThread ; private Socket socket ; private BufferedReader breader ; private BufferedWriter bwriter ; private String end = "\n\r" ; public Server ( int id , String title , String hostname , int port , String password , String nick ) { } public boolean connect ( ) throws IOException { } public boolean isConnected ( ) { } public void sendTextToChannel ( String channelName , String text ) throws IOException { } public void disconnect ( ) throws IOException { if ( isConnected ) { System . out . println ( ( "removing<seq2seq4repair_space>connection<seq2seq4repair_space>to:<seq2seq4repair_space>" + ( this . socket ) ) ) ; <START_BUG> this . bwriter . write ( ( ( Constants . server_quit ) + "<seq2seq4repair_space>:Disconnecting" ) ) ; <END_BUG> this . bwriter . close ( ) ; this . breader . close ( ) ; this . socket . close ( ) ; this . isConnected = false ; } } public void joinChannel ( String channel ) throws IOException { } public void leaveChannel ( ) throws IOException { } public void sendPong ( String pong ) throws IOException { } public BufferedReader getReader ( ) { } public void setTitle ( String t ) { } public int getServerID ( ) { } public void setID ( int id ) { } public String getServerTitle ( ) { } public String getServerHostname ( ) { } public int getServerPort ( ) { } public String getServerPassword ( ) { } public boolean getAutoConnect ( ) { } public String getNickname ( ) { } public void setNickname ( String newNick ) { } public String toString ( ) { } }

Fix:
this . bwriter . write ( ( ( ( Constants . server_quit ) + "<seq2seq4repair_space>:Disconnecting" ) + ( this . end ) ) ) ;
Buggy code:
public class CSVPrinterTest extends TestCase { String lineSeparator = "\n" ; public void testPrinter1 ( ) throws IOException { } public void testPrinter2 ( ) throws IOException { } public void testPrinter3 ( ) throws IOException { } public void testPrinter4 ( ) throws IOException { } public void testPrinter5 ( ) throws IOException { } public void testPrinter6 ( ) throws IOException { } public void testPrinter7 ( ) throws IOException { } public void testExcelPrinter1 ( ) throws IOException { } public void testExcelPrinter2 ( ) throws IOException { } public void testRandom ( ) throws Exception { } Random r = new Random ( ) ; CSVFormat format ; public void doRandom ( int iter ) throws Exception { } public void doOneRandom ( ) throws Exception { int nLines = ( r . nextInt ( 4 ) ) + 1 ; int nCol = ( r . nextInt ( 3 ) ) + 1 ; String [ ] [ ] lines = new String [ nLines ] [ ] ; for ( int i = 0 ; i < nLines ; i ++ ) { String [ ] line = new String [ nCol ] ; lines [ i ] = line ; for ( int j = 0 ; j < nCol ; j ++ ) { line [ j ] = randStr ( ) ; } } StringWriter sw = new StringWriter ( ) ; CSVPrinter printer = new CSVPrinter ( sw , format ) ; for ( int i = 0 ; i < nLines ; i ++ ) { printer . println ( lines [ i ] ) ; } printer . flush ( ) ; String result = sw . toString ( ) ; StringReader reader = new StringReader ( result ) ; CSVParser parser = new CSVParser ( reader , format ) ; <START_BUG> String [ ] [ ] parseResult = parser . getAllValues ( ) ; <END_BUG> if ( ! ( CSVPrinterTest . equals ( lines , parseResult ) ) ) { System . out . println ( ( "Printer<seq2seq4repair_space>output<seq2seq4repair_space>:" + ( CSVPrinterTest . printable ( result ) ) ) ) ; assertTrue ( false ) ; } } public static boolean equals ( String [ ] [ ] a , String [ ] [ ] b ) { } public static String printable ( String s ) { } public String randStr ( ) { } }

Fix:
String [ ] [ ] parseResult = parser . getRecords ( ) ;
Buggy code:
public class Debt implements Syncable < Debt > { private static final int POSITIVE_COLOR = R . color . green ; private static final int NEGATIVE_COLOR = R . color . red ; private static final int POSITIVE_COLOR_DISABLED = R . color . green_disabled ; private static final int NEGATIVE_COLOR_DISABLED = R . color . red_disabled ; public Person owner ; public UUID id ; public float amount ; public String amountAsString ; public String note ; public long timestamp ; public int color ; public boolean isPaidBack ; public Debt ( Person owner , float amount , String note , UUID id , long timestamp , boolean isPaidBack ) { } public Debt ( Person owner , float amount , String note ) { } public static String amountString ( float amount ) { } public static int getColor ( float amount ) { } public static int getDisabledColor ( float amount ) { } public static String totalString ( float amount , String even , boolean isAll , String allEvenString ) { } public void edit ( Person owner , float amount , String note ) { } public String getShareString ( Context ctx ) { } @ Override public UUID getId ( ) { } @ Override public Debt syncWith ( Debt other ) { } public static Debt sync ( Debt a , Debt b ) { } @ Override public boolean equals ( Object o ) { if ( o == null ) return false ; if ( o == ( this ) ) return true ; if ( ! ( o instanceof Debt ) ) return false ; Debt other = ( ( Debt ) ( o ) ) ; <START_BUG> return ( ( ( id . equals ( other . id ) ) && ( owner . id . equals ( other . owner . id ) ) ) && ( ( amount ) == ( other . amount ) ) ) && ( ( note ) == null ) ? ( other . note ) == null : ( note . equals ( other . note ) ) && ( ( isPaidBack ) == ( other . isPaidBack ) ) ; <END_BUG> } }

Fix:
return ( ( ( ( id . equals ( other . id ) ) && ( owner . id . equals ( other . owner . id ) ) ) && ( ( amount ) == ( other . amount ) ) ) && ( ( note ) == null ? ( other . note ) == null : note . equals ( other . note ) ) ) && ( ( isPaidBack ) == ( other . isPaidBack ) ) ;
Buggy code:
public abstract class AbstractParser { private static CommonLogger log = Logger . getMessageLogger ( CommonLogger . class , AbstractParser . class . getName ( ) ) ; private static CommonBundle bundle = Messages . getBundle ( CommonBundle . class ) ; public String rawElementText ( XMLStreamReader reader ) throws XMLStreamException { String elementtext = reader . getElementText ( ) ; <START_BUG> elementtext = ( elementtext == null ) ? null : elementtext . trim ( ) ; <END_BUG> return elementtext ; } public String rawAttributeText ( XMLStreamReader reader , String attributeName ) { } protected void parseExtension ( XMLExtendedStreamReader reader , String enclosingTag , final ModelNode operation , final SimpleAttributeDefinition extensionclassname , final SimpleAttributeDefinition extensionProperties ) throws XMLStreamException , ParserException , ValidateException { } private static class SecurityActions { private SecurityActions ( ) { } static String getSystemProperty ( final String name ) { } } }

Fix:
elementtext = ( ( elementtext == null ) || ( ( elementtext . trim ( ) . length ( ) ) == 0 ) ) ? null : elementtext . trim ( ) ;
Buggy code:
public class FormatJavadocText extends FormatJavadocNode implements IJavaDocTagConstants { long [ ] separators ; int separatorsPtr = - 1 ; private int htmlTagIndex = - 1 ; FormatJavadocNode [ ] htmlNodes ; int [ ] htmlIndexes ; int htmlNodesPtr = - 1 ; int depth = 0 ; public FormatJavadocText ( int start , int end , int line , int htmlIndex , int htmlDepth ) { } void appendText ( FormatJavadocText text ) { } void appendNode ( FormatJavadocNode node ) { } private void addSeparator ( FormatJavadocNode node ) { } void clean ( ) { } void closeTag ( ) { } int getHtmlTagIndex ( ) { } int getHtmlTagID ( ) { } FormatJavadocNode getLastNode ( ) { } public boolean isClosingHtmlTag ( ) { } public boolean isHtmlTag ( ) { } public boolean isImmutableHtmlTag ( ) { } public boolean isTextAfterHtmlSeparatorTag ( int separatorIndex ) { } public boolean isText ( ) { } void setHeaderLine ( int javadocLineStart ) { } protected void toString ( StringBuffer buffer ) { } public void toStringDebug ( StringBuffer buffer , char [ ] source ) { if ( ( buffer . length ( ) ) > 0 ) { for ( int l = 0 ; l < ( this . linesBefore ) ; l ++ ) { buffer . append ( '\n' ) ; for ( int t = 0 ; t < ( this . depth ) ; t ++ ) buffer . append ( '\t' ) ; } } <START_BUG> if ( ( separatorsPtr ) == ( - 1 ) ) { <END_BUG> super . toStringDebug ( buffer , source ) ; return ; } int ptr = 0 ; int nextStart = this . sourceStart ; int idx = 0 ; while ( ( idx <= ( this . separatorsPtr ) ) || ( ( ( this . htmlNodesPtr ) != ( - 1 ) ) && ( ptr <= ( this . htmlNodesPtr ) ) ) ) { if ( idx > ( this . separatorsPtr ) ) { FormatJavadocNode node = this . htmlNodes [ ( ptr ++ ) ] ; node . toStringDebug ( buffer , source ) ; return ; } int end = ( ( int ) ( ( this . separators [ idx ] ) > > > 32 ) ) ; if ( ( ( ( this . htmlNodesPtr ) >= 0 ) && ( ptr <= ( this . htmlNodesPtr ) ) ) && ( end > ( this . htmlNodes [ ptr ] . sourceStart ) ) ) { FormatJavadocNode node = this . htmlNodes [ ( ptr ++ ) ] ; node . toStringDebug ( buffer , source ) ; } else { if ( ( idx > 1 ) && ( ( source [ nextStart ] ) != '<' ) ) { buffer . append ( '\n' ) ; for ( int t = 0 ; t < ( this . depth ) ; t ++ ) buffer . append ( '\t' ) ; } buffer . append ( source , nextStart , ( ( end - nextStart ) + 1 ) ) ; } nextStart = ( ( int ) ( this . separators [ ( idx ++ ) ] ) ) ; } if ( ( source [ nextStart ] ) == '<' ) { switch ( getHtmlTagID ( ) ) { case JAVADOC_CODE_TAGS_ID : buffer . append ( '\n' ) ; for ( int t = 0 ; t < ( this . depth ) ; t ++ ) buffer . append ( '\t' ) ; break ; } } buffer . append ( source , nextStart , ( ( ( this . sourceEnd ) - nextStart ) + 1 ) ) ; buffer . append ( '<seq2seq4repair_space>' ) ; } }

Fix:
if ( ( this . separatorsPtr ) == ( - 1 ) ) {
Buggy code:
public class PropertyAccessTests extends ExpressionTestCase { @ Test public void testSimpleAccess01 ( ) { } @ Test public void testSimpleAccess02 ( ) { } @ Test public void testSimpleAccess03 ( ) { } @ Test public void testNonExistentPropertiesAndMethods ( ) { } @ Test public void testAccessingOnNullObject ( ) throws Exception { } private void checkException ( Exception e , SpelMessage expectedMessage ) { } @ Test public void testAddingSpecificPropertyAccessor ( ) throws Exception { } @ Test public void testAddingRemovingAccessors ( ) { } private static class StringyPropertyAccessor implements PropertyAccessor { int flibbles = 7 ; public Class < ? > [ ] getSpecificTargetClasses ( ) { } public boolean canRead ( EvaluationContext context , Object target , String name ) throws AccessException { } public boolean canWrite ( EvaluationContext context , Object target , String name ) throws AccessException { } public TypedValue read ( EvaluationContext context , Object target , String name ) throws AccessException { } public void write ( EvaluationContext context , Object target , String name , Object newValue ) throws AccessException { if ( ! ( name . equals ( "flibbles" ) ) ) throw new RuntimeException ( "Assertion<seq2seq4repair_space>Failed!<seq2seq4repair_space>name<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>flibbles" ) ; try { <START_BUG> flibbles = ( ( Integer ) ( context . getTypeConverter ( ) . convertValue ( newValue , TypeDescriptor . valueOf ( Integer . class ) ) ) ) ; <END_BUG> } catch ( EvaluationException e ) { throw new AccessException ( ( ( "Cannot<seq2seq4repair_space>set<seq2seq4repair_space>flibbles<seq2seq4repair_space>to<seq2seq4repair_space>an<seq2seq4repair_space>object<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>'" + ( newValue . getClass ( ) ) ) + "'" ) ) ; } } } }

Fix:
flibbles = ( ( Integer ) ( context . getTypeConverter ( ) . convertValue ( newValue , TypeDescriptor . forObject ( newValue ) , TypeDescriptor . valueOf ( Integer . class ) ) ) ) ;
Buggy code:
public abstract class AbstractRenderableColumn extends AbstractColumn { private boolean contentAsTooltip = false ; private boolean escapeContent = true ; public AbstractRenderableColumn ( ColumnLocation location , String header ) { } public abstract String getNodeValue ( TreeNode node ) { } public boolean isContentAsTooltip ( ) { } public boolean isEscapeContent ( ) { } public Component newCell ( MarkupContainer parent , String id , TreeNode node , int level ) { } public IRenderable newCell ( TreeNode node , int level ) { return new IRenderable ( ) { private static final long serialVersionUID = 1L ; public void render ( TreeNode node , Response response ) { String content = getNodeValue ( node ) ; if ( isEscapeContent ( ) ) { content = Strings . escapeMarkup ( content ) . toString ( ) ; } <START_BUG> response . write ( "<span<seq2seq4repair_space>class=\"text\"" ) ; <END_BUG> if ( isContentAsTooltip ( ) ) { response . write ( ( ( "<seq2seq4repair_space>title=\"" + content ) + "\"" ) ) ; } response . write ( ">" ) ; response . write ( content ) ; response . write ( "<//span>" ) ; } } ; } public void setContentAsTooltip ( boolean contentAsTooltip ) { } public void setEscapeContent ( boolean escapeContent ) { } }

Fix:
response . write ( "<span" ) ;
Buggy code:
@ Singleton public class FacebookAuthProvider extends AuthProvider { private static final Logger LOGGER = LoggerFactory . getLogger ( FacebookAuthProvider . class ) ; private static final String FACEBOOK_PROVIDER_NAME = "Facebook" ; private IdentityProvider identityProvider ; @ EJB private IdentityProviderService identityProviderService ; @ EJB private PropertiesService propertiesService ; @ EJB private ConfigurationService configurationService ; @ EJB private UserService userService ; @ EJB private AccessKeyService accessKeyService ; @ EJB private IdentityProviderUtils identityProviderUtils ; @ PostConstruct private void initialize ( ) { } @ Override public boolean isIdentityProviderAllowed ( ) { } @ Override public AccessKey createAccessKey ( @ NotNull final AccessKeyRequest request ) { } private String getAccessToken ( final String code , final String redirectUrl ) { } private void verifyAccessToken ( final String accessToken ) { } private String getIdentityProviderEmail ( final String accessToken ) { } private User findUser ( final String email ) { final User user = userService . findFacebookUser ( email ) ; if ( user == null ) { FacebookAuthProvider . LOGGER . error ( "No<seq2seq4repair_space>user<seq2seq4repair_space>with<seq2seq4repair_space>email<seq2seq4repair_space>{}<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>identity<seq2seq4repair_space>provider<seq2seq4repair_space>{}" , email , FacebookAuthProvider . FACEBOOK_PROVIDER_NAME ) ; <START_BUG> throw new com . devicehive . exceptions . HiveException ( String . format ( USER_NOT_FOUND , email ) , NOT_FOUND . getStatusCode ( ) ) ; <END_BUG> } else if ( ( user . getStatus ( ) ) != ( UserStatus . ACTIVE ) ) { FacebookAuthProvider . LOGGER . error ( String . format ( USER_NOT_ACTIVE , user . getId ( ) ) ) ; throw new com . devicehive . exceptions . HiveException ( UNAUTHORIZED . getReasonPhrase ( ) , UNAUTHORIZED . getStatusCode ( ) ) ; } return user ; } }

Fix:
throw new com . devicehive . exceptions . HiveException ( String . format ( USER_NOT_FOUND , email ) , UNAUTHORIZED . getStatusCode ( ) ) ;
Buggy code:
public class LoadedProcedureSet { private static final VoltLogger hostLog = new VoltLogger ( "HOST" ) ; ImmutableMap < String , ProcedureRunner > procs = ImmutableMap . < String , ProcedureRunner > builder ( ) . build ( ) ; Map < String , ProcedureRunner > m_defaultProcCache = new HashMap < > ( ) ; final HashMap < Long , ProcedureRunner > m_registeredSysProcPlanFragments = new HashMap < Long , ProcedureRunner > ( ) ; final ProcedureRunnerFactory m_runnerFactory ; CatalogSpecificPlanner m_csp = null ; PlannerTool m_plannerTool = null ; DefaultProcedureManager m_defaultProcManager = null ; final long m_siteId ; final int m_siteIndex ; final SiteProcedureConnection m_site ; public LoadedProcedureSet ( SiteProcedureConnection site , ProcedureRunnerFactory runnerFactory , long siteId , int siteIndex ) { } public ProcedureRunner getSysproc ( long fragmentId ) { } public void registerPlanFragment ( final long pfId , final ProcedureRunner proc ) { } public void loadProcedures ( CatalogContext catalogContext , BackendTarget backendTarget , CatalogSpecificPlanner csp ) { } private Builder < String , ProcedureRunner > loadProceduresFromCatalog ( CatalogContext catalogContext , BackendTarget backendTarget ) { } private static CheckedExceptionVisitor < VoltProcedure , Class < ? > , Exception > procedureInstantiator = new CheckedExceptionVisitor < VoltProcedure , Class < ? > , Exception > ( ) { @ Override public VoltProcedure visitJava ( Class < ? > p ) throws Exception { } @ Override public VoltProcedure visitGroovy ( Class < ? > p ) throws Exception { } } ; private void loadSystemProcedures ( CatalogContext catalogContext , BackendTarget backendTarget , Builder < String , ProcedureRunner > builder ) { } public ProcedureRunner getProcByName ( String procName ) { ProcedureRunner pr = procs . get ( procName ) ; if ( pr == null ) { pr = m_defaultProcCache . get ( procName ) ; } if ( pr == null ) { Procedure catProc = m_defaultProcManager . checkForDefaultProcedure ( procName ) ; if ( catProc != null ) { String sqlText = m_defaultProcManager . sqlForDefaultProc ( catProc ) ; Procedure newCatProc = StatementCompiler . compileDefaultProcedure ( m_plannerTool , catProc , sqlText ) ; VoltProcedure voltProc = new ProcedureRunner . StmtProcedure ( ) ; pr = m_runnerFactory . create ( voltProc , newCatProc , m_csp ) ; <START_BUG> pr . m_procNameToLoadForFragmentTasks = catProc . getTypeName ( ) ; <END_BUG> m_defaultProcCache . put ( procName , pr ) ; } } return pr ; } }

Fix:
pr . setProcNameToLoadForFragmentTasks ( catProc . getTypeName ( ) ) ;
Buggy code:
public abstract class FormComponent extends WebMarkupContainer { protected static final String NO_INVALID_INPUT = "[No<seq2seq4repair_space>invalid<seq2seq4repair_space>input]" ; protected static final short FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL = FLAG_RESERVED1 ; private String invalidInput = FormComponent . NO_INVALID_INPUT ; private boolean persistent = false ; private IValidator validator = IValidator . NULL ; public interface IVisitor { public void formComponent ( FormComponent formComponent ) { } } private static final class ValidatorList implements IValidator { private final IValidator left ; private IValidator right ; ValidatorList ( final IValidator left , final IValidator right ) { } public String toString ( ) { } public void validate ( final FormComponent component ) { } void add ( final IValidator validator ) { } List asList ( ) { } } public FormComponent ( final String id ) { } public FormComponent ( final String id , IModel model ) { } public final FormComponent add ( final IValidator validator ) { } public final Form getForm ( ) { } public final String getInput ( ) { } public final Class getValidationType ( ) { } public final List getValidators ( ) { } public final String getValue ( ) { <START_BUG> return ( invalidInput ) == ( FormComponent . NO_INVALID_INPUT ) ? getModelValue ( ) : invalidInput ; <END_BUG> } public final void invalid ( ) { } public final boolean isPersistent ( ) { } public final boolean isValid ( ) { } public final boolean isValidated ( ) { } public void setModelValue ( final String value ) { } public final void setPersistent ( final boolean persistent ) { } public final void valid ( ) { } protected String getModelValue ( ) { } protected final int inputAsInt ( ) { } protected final int inputAsInt ( final int defaultValue ) { } protected final int [ ] inputAsIntArray ( ) { } protected final String [ ] inputAsStringArray ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onInvalid ( ) { } protected void onModelChanged ( ) { } protected void onValid ( ) { } protected boolean supportsPersistence ( ) { } public abstract void updateModel ( ) { } public final void validate ( ) { } }

Fix:
return FormComponent . NO_INVALID_INPUT . equals ( invalidInput ) ? getModelValue ( ) : invalidInput ;
Buggy code:
public class DormandPrince853IntegratorTest extends TestCase { public DormandPrince853IntegratorTest ( String name ) { } public void testDimensionCheck ( ) { } public void testNullIntervalCheck ( ) { } public void testMinStep ( ) { } public void testIncreasingTolerance ( ) throws DerivativeException , IntegratorException { } public void testBackward ( ) throws DerivativeException , IntegratorException { } public void testEvents ( ) throws DerivativeException , IntegratorException { } public void testKepler ( ) throws DerivativeException , IntegratorException { } public void testVariableSteps ( ) throws DerivativeException , IntegratorException { } public void testNoDenseOutput ( ) throws DerivativeException , IntegratorException { TestProblem1 pb1 = new TestProblem1 ( ) ; <START_BUG> TestProblem1 pb2 = ( ( TestProblem1 ) ( pb1 . clone ( ) ) ) ; <END_BUG> double minStep = 0.1 * ( ( pb1 . getFinalTime ( ) ) - ( pb1 . getInitialTime ( ) ) ) ; double maxStep = ( pb1 . getFinalTime ( ) ) - ( pb1 . getInitialTime ( ) ) ; double scalAbsoluteTolerance = 1.0E-4 ; double scalRelativeTolerance = 1.0E-4 ; FirstOrderIntegrator integ = new DormandPrince853Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; integ . addStepHandler ( DummyStepHandler . getInstance ( ) ) ; integ . integrate ( pb1 , pb1 . getInitialTime ( ) , pb1 . getInitialState ( ) , pb1 . getFinalTime ( ) , new double [ pb1 . getDimension ( ) ] ) ; int callsWithoutDenseOutput = pb1 . getCalls ( ) ; assertEquals ( integ . getEvaluations ( ) , callsWithoutDenseOutput ) ; integ . addStepHandler ( new DormandPrince853IntegratorTest . InterpolatingStepHandler ( ) ) ; integ . integrate ( pb2 , pb2 . getInitialTime ( ) , pb2 . getInitialState ( ) , pb2 . getFinalTime ( ) , new double [ pb2 . getDimension ( ) ] ) ; int callsWithDenseOutput = pb2 . getCalls ( ) ; assertEquals ( integ . getEvaluations ( ) , callsWithDenseOutput ) ; assertTrue ( ( callsWithDenseOutput > callsWithoutDenseOutput ) ) ; } public void testUnstableDerivative ( ) throws DerivativeException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws DerivativeException { } private int nbSteps ; private double maxError ; private TestProblem3 pb ; } private static class VariableHandler implements StepHandler { public VariableHandler ( ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } private boolean firstTime = true ; private double minStep = 0 ; private double maxStep = 0 ; } private static class InterpolatingStepHandler implements StepHandler { public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) throws DerivativeException { } } public static Test suite ( ) { } }

Fix:
TestProblem1 pb2 = pb1 . copy ( ) ;
Buggy code:
public class Learning { public static double [ ] learning = new double [ 999999 ] ; public static Tile [ ] Learning ( Board board , Tile [ ] states , Tile [ ] [ ] newStates , int race ) { } private static Board getNewBoard ( Board boardCopy , Tile [ ] currentState , Tile [ ] newState , int race ) { for ( int moveCount = 0 ; moveCount < ( newState . length ) ; moveCount ++ ) { Tile movetile = new Tile ( currentState [ moveCount ] . xCor , currentState [ moveCount ] . yCor , currentState [ moveCount ] . unit , currentState [ moveCount ] . neighbours ) ; <START_BUG> Movement . moveAiChar ( boardCopy , movetile , newState [ moveCount ] ) ; <END_BUG> } return boardCopy ; } private static double maxLearning ( Board boardCopy , Tile [ ] state , int race ) { } private static double learning ( Tile [ ] state ) { } static void setLearning ( Tile [ ] state , double value ) { } private static int getPositionValue ( Tile [ ] state ) { } public static void readDoubleFromFile ( String filename ) throws IOException { } No newline ; at end ; of file ; }

Fix:
Movement . simulateMove ( boardCopy , movetile , newState [ moveCount ] ) ;
Buggy code:
public class AboutMenuScreen extends MenuScreen { public static final String CREDIT = "Luca<seq2seq4repair_space>Becker,<seq2seq4repair_space>Henrike<seq2seq4repair_space>Hardt,<seq2seq4repair_space>Larissa<seq2seq4repair_space>Schmid,<seq2seq4repair_space>Adrian<seq2seq4repair_space>Schulte,<seq2seq4repair_space>Maik<seq2seq4repair_space>Wiesner" ; private Table table ; public AboutMenuScreen ( RetroMachines game ) { } public void show ( ) { } private class ReturnButtonClickListener extends ClickListener { @ Override public void clicked ( InputEvent event , float x , float y ) { } } @ Override protected void initialize ( ) { skin = AssetManager . menuSkin ; table = new Table ( ) ; table . debug ( ) ; Label title = new Label ( AboutMenuScreen . CREDIT , skin ) ; title . setFontScale ( 2 ) ; title . setWrap ( true ) ; title . setAlignment ( center ) ; Button buttonReturn = new Button ( skin , "back" ) ; buttonReturn . pad ( 100 ) ; buttonReturn . addListener ( new AboutMenuScreen . ReturnButtonClickListener ( ) ) ; table . add ( buttonReturn ) . padTop ( 50 ) . padLeft ( 50 ) . left ( ) . row ( ) ; table . add ( title ) . width ( 1000 ) . expandX ( ) . expandY ( ) . row ( ) ; table . setFillParent ( true ) ; stage . addActor ( table ) ; <START_BUG> input . setInputProcessor ( inputMultiplexer ) ; <END_BUG> } }

Fix:
inputMultiplexer . addProcessor ( stage ) ;
Buggy code:
public class PatchConfigXml { private static final XMLMapper MAPPER = Factory . create ( ) ; private static final PatchConfigXml_1_0 INSTANCE = new PatchConfigXml_1_0 ( ) ; private static final XMLInputFactory INPUT_FACTORY = XMLInputFactory . newInstance ( ) ; private static final QName ROOT_ELEMENT = new QName ( PatchConfigXml . Namespace . PATCH_1_0 . getNamespace ( ) , PATCH_CONFIG . name ) ; enum Namespace { PATCH_1_0 ( "urn:jboss:patch-config:1.0" ) , UNKNOWN ( null ) ; private final String namespace ; Namespace ( String namespace ) { } public String getNamespace ( ) { } } public static PatchConfig parse ( final InputStream stream ) throws XMLStreamException { try { final XMLInputFactory inputFactory = PatchConfigXml . INPUT_FACTORY ; PatchConfigXml . setIfSupported ( inputFactory , XMLInputFactory . IS_VALIDATING , Boolean . FALSE ) ; PatchConfigXml . setIfSupported ( inputFactory , XMLInputFactory . SUPPORT_DTD , Boolean . FALSE ) ; final XMLStreamReader streamReader = inputFactory . createXMLStreamReader ( stream ) ; final PatchConfigBuilder builder = new PatchConfigBuilder ( ) ; PatchConfigXml . MAPPER . parseDocument ( builder , streamReader ) ; <START_BUG> return builder ; <END_BUG> } finally { IoUtils . safeClose ( stream ) ; } } private static void setIfSupported ( final XMLInputFactory inputFactory , final String property , final Object value ) { } private PatchConfigXml ( ) { } }

Fix:
return builder . build ( ) ;
Buggy code:
public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( AnnotationTypeDeclaration . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( AnnotationTypeDeclaration . class ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = AbstractTypeDeclaration . internalNamePropertyFactory ( AnnotationTypeDeclaration . class ) ; public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = AbstractTypeDeclaration . internalBodyDeclarationPropertyFactory ( AnnotationTypeDeclaration . class ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } AnnotationTypeDeclaration ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final ChildPropertyDescriptor internalNameProperty ( ) { } final ChildListPropertyDescriptor internalBodyDeclarationsProperty ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { AnnotationTypeDeclaration result = new AnnotationTypeDeclaration ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setJavadoc ( ( ( Javadoc ) ( ASTNode . copySubtree ( target , getJavadoc ( ) ) ) ) ) ; result . modifiers ( ) . addAll ( ASTNode . copySubtrees ( target , modifiers ( ) ) ) ; result . setName ( ( ( SimpleName ) ( getName ( ) . clone ( target ) ) ) ) ; result . bodyDeclarations ( ) . addAll ( ASTNode . copySubtrees ( target , bodyDeclarations ( ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } ITypeBinding internalResolveBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class AuthenticatedHtmlPage extends HtmlPage { protected boolean checkAccess ( ) { final RequestCycle cycle = getRequestCycle ( ) ; boolean signedIn = ( cycle . getSession ( ) . getProperty ( "wicket.examples.signin2.user" ) ) != null ; if ( ! signedIn ) { <START_BUG> cycle . redirectToInterceptPage ( SignIn2 . class ) ; <END_BUG> } return signedIn ; } }

Fix:
cycle . redirectToInterceptPage ( new SignIn2 ( null ) ) ;
Buggy code:
public class FieldDeclaration extends BodyDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( FieldDeclaration . class ) ; public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = BodyDeclaration . internalModifiersPropertyFactory ( FieldDeclaration . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( FieldDeclaration . class ) ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( FieldDeclaration . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor ( FieldDeclaration . class , "fragments" , VariableDeclarationFragment . class , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private Type baseType = null ; private ASTNode . NodeList variableDeclarationFragments = new ASTNode . NodeList ( FieldDeclaration . FRAGMENTS_PROPERTY ) ; FieldDeclaration ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int internalGetSetIntProperty ( SimplePropertyDescriptor property , boolean get , int value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { FieldDeclaration result = new FieldDeclaration ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setJavadoc ( ( ( Javadoc ) ( ASTNode . copySubtree ( target , getJavadoc ( ) ) ) ) ) ; if ( ( this . ast . apiLevel ) == ( AST . JLS2_INTERNAL ) ) { result . internalSetModifiers ( getModifiers ( ) ) ; } if ( ( this . ast . apiLevel ) >= ( AST . JLS3 ) ) { result . modifiers ( ) . addAll ( ASTNode . copySubtrees ( target , modifiers ( ) ) ) ; } result . setType ( ( ( Type ) ( getType ( ) . clone ( target ) ) ) ) ; result . fragments ( ) . addAll ( ASTNode . copySubtrees ( target , fragments ( ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getType ( ) { } public void setType ( Type type ) { } public List fragments ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class DeferredWorldCheck implements Runnable { Player player ; MIPlayerListener listener ; public DeferredWorldCheck ( Player player , MIPlayerListener listener ) { } @ Override public void run ( ) { if ( ( ( player ) != null ) && ( player . isOnline ( ) ) ) { if ( ( logoutworld . containsKey ( player . getName ( ) ) ) && ( ( logoutworld . get ( player . getName ( ) ) ) != null ) ) { String logoutworld = logoutworld . get ( player . getName ( ) ) ; String currentworld = MIPlayerListener . getGroup ( player . getWorld ( ) ) ; log . debug ( ( ( ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>logged<seq2seq4repair_space>in<seq2seq4repair_space>in<seq2seq4repair_space>world<seq2seq4repair_space>" ) + currentworld ) + ".<seq2seq4repair_space>Logout<seq2seq4repair_space>world<seq2seq4repair_space>was:<seq2seq4repair_space>" ) + logoutworld ) ) ; <START_BUG> if ( ( ! ( MIYamlFiles . saveonquit ) ) && ( ! ( currentworld . equals ( logoutworld ) ) ) ) { <END_BUG> if ( ! ( player . hasPermission ( "multiinv.enderchestexempt" ) ) ) { listener . saveEnderchestState ( player , logoutworld ) ; listener . loadEnderchestState ( player , currentworld ) ; } if ( ! ( player . hasPermission ( "multiinv.exempt" ) ) ) { listener . savePlayerState ( player , logoutworld ) ; listener . loadPlayerState ( player , currentworld ) ; } MIYamlFiles . savePlayerLogoutWorld ( player . getUniqueId ( ) , currentworld ) ; } else if ( MIYamlFiles . saveonquit ) { if ( ! ( player . hasPermission ( "multiinv.enderchestexempt" ) ) ) { listener . loadEnderchestState ( player , currentworld ) ; } if ( ! ( player . hasPermission ( "multiinv.exempt" ) ) ) { listener . loadPlayerState ( player , currentworld ) ; } } } } } }

Fix:
if ( ( ! ( MIYamlFiles . saveonquit ) ) || ( ! ( currentworld . equals ( logoutworld ) ) ) ) {
Buggy code:
public class TestXorRawEncoder { private Random RAND = new Random ( ) ; private static final int DATA_SIZE = 10 ; private static final int CHUNK_SIZE = 16 * 1024 ; private static final int ERASED_INDEX = 0 ; @ Test public void testBytesCoding ( ) { } @ Test public void testBufferCoding ( ) { } @ Test public void testECChunkCoding ( ) { } private byte [ ] [ ] generateEncodingData ( ) { } private byte [ ] [ ] generateDecodingData ( byte [ ] [ ] encodingData , byte [ ] parityData ) { } private byte [ ] eraseData ( byte [ ] [ ] encodingData ) { } private ByteBuffer [ ] toBuffers ( byte [ ] [ ] bytes ) { ByteBuffer [ ] buffers = new ByteBuffer [ bytes . length ] ; for ( int i = 0 ; i < ( buffers . length ) ; i ++ ) { <START_BUG> buffers [ i ] = ByteBuffer . allocateDirect ( TestXorRawEncoder . CHUNK_SIZE ) ; <END_BUG> buffers [ i ] . put ( bytes [ i ] ) ; buffers [ i ] . flip ( ) ; } return buffers ; } private ECChunk [ ] toECChunks ( byte [ ] [ ] bytes ) { } }

Fix:
buffers [ i ] = ByteBuffer . allocateDirect ( bytes [ i ] . length ) ;
Buggy code:
public final class IntrospectionUtils { public static boolean hasHook ( Object obj , String methodN ) { try { Method [ ] myMethods = obj . getClass ( ) . getMethods ( ) ; for ( int i = 0 ; i < ( myMethods . length ) ; i ++ ) { if ( methodN . equals ( myMethods [ i ] . getName ( ) ) ) { Class declaring = myMethods [ i ] . getDeclaringClass ( ) ; Class parentOfDeclaring = declaring . getSuperclass ( ) ; <START_BUG> if ( ! ( "java.jang.Object" . equals ( parentOfDeclaring . getName ( ) ) ) ) { <END_BUG> return true ; } } } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return false ; } }

Fix:
if ( ! ( "java.lang.Object" . equals ( parentOfDeclaring . getName ( ) ) ) ) {
Buggy code:
public class DisplayAllQuestions extends HttpServlet { private static final long serialVersionUID = 1L ; public DisplayAllQuestions ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { Long userId = ( ( Long ) ( request . getSession ( ) . getAttribute ( "userId" ) ) ) ; MemberService memberService = new MemberService ( ) ; MemberInfo user = null ; try { Long userIdLong = 0L ; if ( userId != null ) { userIdLong = userId ; user = memberService . getUserAndQuestions ( userIdLong ) ; request . setAttribute ( "user" , user ) ; <START_BUG> request . getRequestDispatcher ( "//memberhome.jsp" ) . forward ( request , response ) ; <END_BUG> } else { request . getRequestDispatcher ( "//login.jsp" ) . forward ( request , response ) ; } } catch ( Exception e ) { } } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
request . getRequestDispatcher ( "memberhome.jsp" ) . forward ( request , response ) ;
Buggy code:
@ Entity ( name = "Dica" ) public abstract class Dica implements Comparable { @ Id @ GeneratedValue private Long id ; private int [ ] votos ; @ ManyToOne ( fetch = FetchType . LAZY , cascade = CascadeType . ALL ) private Disciplina disciplina ; public Dica ( ) { } public double getAprovacao ( ) { } public int getVotosNegavitos ( ) { } public int getVotosPositivos ( ) { } public Disciplina getDisciplina ( ) { } public void votar ( int v ) { } public void setDisciplina ( Disciplina disciplina ) { } public int [ ] getVotos ( ) { } public void setVotos ( int [ ] votos ) { } public Long getId ( ) { } public void setId ( Long id ) { } @ Override public int compareTo ( Object o ) { if ( ( o . getClass ( ) ) != ( Dica . class ) ) return - 1 ; Dica other = ( ( Dica ) ( o ) ) ; <START_BUG> return ( ( this . getAprovacao ( ) ) - ( other . getAprovacao ( ) ) ) > 0 ? 1 : - 1 ; <END_BUG> } }

Fix:
return Double . compare ( this . getAprovacao ( ) , other . getAprovacao ( ) ) ;
Buggy code:
public class FlattenerTest { Archetype device ; Archetype bloodPressureObservation ; Archetype reportResult ; Archetype bloodPressureComposition ; SimpleArchetypeRepository repository ; Flattener flattener ; @ Before public void setup ( ) throws Exception { } @ Test public void test ( ) { <START_BUG> Archetype flattened = flattener . flatten ( bloodPressureObservation ) ; <END_BUG> } }

Fix:
Archetype flattened = flattener . flatten ( bloodPressureComposition ) ;
Buggy code:
public class UndertowConnector implements Connector { private final ListenerService < ? > listener ; public UndertowConnector ( ListenerService < ? > listener ) { } @ Override public boolean isReverse ( ) { <START_BUG> return false ; <END_BUG> } @ Override public Type getType ( ) { } @ Override public InetAddress getAddress ( ) { } @ Override public void setAddress ( InetAddress address ) { } @ Override public int getPort ( ) { } @ Override public boolean isAvailable ( ) { } @ Override public int getMaxThreads ( ) { } @ Override public int getBusyThreads ( ) { } @ Override public long getBytesSent ( ) { } @ Override public long getBytesReceived ( ) { } @ Override public long getRequestCount ( ) { } @ Override public String toString ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public int hashCode ( ) { } }

Fix:
return true ;