nus-yam/ex-repair huggingface dataset:
Buggy code:
class DLPlayerConfig { Player player = null ; int material = 262 ; int amount = 64 ; int wandItem = 269 ; short damageValue = 0 ; boolean singleClearMode = false ; boolean blockAreaMode = false ; boolean singleFillMode = false ; Block areaBlock1 = null ; Block areaBlock2 = null ; int lastAreaBlockSet = 0 ; boolean clearOnce = false ; boolean fillOnce = false ; static Logger log = null ; static DispenserLoader plugin = null ; boolean chestMode = false ; @ SuppressWarnings ( "static-access" ) DLPlayerConfig ( int m , int a , Player p , DispenserLoader plugin ) { } void setWandItem ( int item ) { } void setMaterial ( int material ) { } void materialAndDamage ( String str ) { } void setAmount ( int amount ) { } void toggleAreaMode ( ) { if ( ( this . blockAreaMode ) == true ) { this . disableAreaMode ( ) ; this . fillOnce = false ; this . clearOnce = false ; this . singleClearMode = false ; this . singleFillMode = false ; this . singleClearMode = false ; this . singleFillMode = false ; this . clearOnce = false ; this . fillOnce = false ; <START_BUG> player . sendMessage ( "Area<seq2seq4repair_space>mode<seq2seq4repair_space>disabled,<seq2seq4repair_space>now<seq2seq4repair_space>in<seq2seq4repair_space>single-block<seq2seq4repair_space>adding<seq2seq4repair_space>mode" ) ; <END_BUG> } else { this . blockAreaMode = true ; player . sendMessage ( ( ( ChatColor . DARK_AQUA ) + "Now<seq2seq4repair_space>in<seq2seq4repair_space>cuboid<seq2seq4repair_space>mode:<seq2seq4repair_space>left-click<seq2seq4repair_space>to<seq2seq4repair_space>select<seq2seq4repair_space>opposite<seq2seq4repair_space>points,<seq2seq4repair_space>then<seq2seq4repair_space>type<seq2seq4repair_space>//dload<seq2seq4repair_space>area<seq2seq4repair_space>[material<seq2seq4repair_space>amount<seq2seq4repair_space>//<seq2seq4repair_space>fill<seq2seq4repair_space>//<seq2seq4repair_space>empty]" ) ) ; } if ( DLPlayerConfig . plugin . debug ) DLPlayerConfig . log . info ( ( ( ( ( "DL:<seq2seq4repair_space>toggleAreaMode<seq2seq4repair_space>called<seq2seq4repair_space>for<seq2seq4repair_space>player<seq2seq4repair_space>" + ( player . getName ( ) ) ) + "<seq2seq4repair_space>(areamode<seq2seq4repair_space>now<seq2seq4repair_space>" ) + ( this . blockAreaMode ) ) + ")." ) ) ; } void toggleSingleFillFlag ( boolean once ) { } void toggleSingleClearFlag ( boolean once ) { } void disableAreaMode ( ) { } void dbgPrintInfo ( ) { } void setChestMode ( boolean mode ) { } No newline ; at end ; of file ; }

Fix:
player . sendMessage ( ( ( ChatColor . DARK_AQUA ) + "Area<seq2seq4repair_space>mode<seq2seq4repair_space>disabled,<seq2seq4repair_space>now<seq2seq4repair_space>in<seq2seq4repair_space>single-block<seq2seq4repair_space>adding<seq2seq4repair_space>mode" ) ) ;
Buggy code:
public class AwardsPostedNotification extends BaseNotification { private String eventName ; private String eventKey ; private List < Award > awards ; public AwardsPostedNotification ( String messageData ) { } @ Override public void parseMessageData ( ) throws JsonParseException { JsonObject jsonData = JSONManager . getasJsonObject ( messageData ) ; if ( ! ( jsonData . has ( "event_key" ) ) ) { throw new JsonParseException ( "Notification<seq2seq4repair_space>data<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>'event_key'" ) ; } eventKey = jsonData . get ( "event_key" ) . getAsString ( ) ; if ( ! ( jsonData . has ( "event_name" ) ) ) { throw new JsonParseException ( "Notification<seq2seq4repair_space>data<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>'event_name'" ) ; } eventName = jsonData . get ( "event_name" ) . getAsString ( ) ; <START_BUG> if ( ( ! ( jsonData . has ( "awards" ) ) ) || ( jsonData . get ( "awards" ) . isJsonArray ( ) ) ) { <END_BUG> throw new JsonParseException ( "Notification<seq2seq4repair_space>data<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>'awards'<seq2seq4repair_space>list" ) ; } JsonArray awardArray = jsonData . get ( "awards" ) . getAsJsonArray ( ) ; for ( JsonElement element : awardArray ) { awards . add ( gson . fromJson ( element , Award . class ) ) ; } } @ Override public Notification buildNotification ( Context context ) { } @ Override public void updateDataLocally ( Context c ) { } @ Override public int getNotificationId ( ) { } }

Fix:
if ( ( ! ( jsonData . has ( "awards" ) ) ) || ( ! ( jsonData . get ( "awards" ) . isJsonArray ( ) ) ) ) {
Buggy code:
public abstract class MSVSS extends Task { private String m_SSDir = "" ; private String m_vssLogin = null ; private String m_vssPath = null ; private String m_serverPath = null ; public final void setSsdir ( String dir ) { } public final String getSSCommand ( ) { } public final void setLogin ( String login ) { } public void getLoginCommand ( Commandline cmd ) { } public final void setVsspath ( String vssPath ) { } public String getVsspath ( ) { } public final void setServerpath ( String serverPath ) { } protected int run ( Commandline cmd ) { try { Execute exe = new Execute ( new org . apache . tools . ant . taskdefs . LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ) ; if ( ( m_serverPath ) != null ) { String [ ] env = exe . getEnvironment ( ) ; if ( env == null ) { env = new String [ 0 ] ; } String [ ] newEnv = new String [ ( env . length ) + 1 ] ; for ( int i = 0 ; i < ( env . length ) ; i ++ ) { newEnv [ i ] = env [ i ] ; } newEnv [ env . length ] = "SSDIR=" + ( m_serverPath ) ; exe . setEnvironment ( newEnv ) ; } exe . setAntRun ( getProject ( ) ) ; exe . setWorkingDirectory ( getProject ( ) . getBaseDir ( ) ) ; exe . setCommandline ( cmd . getCommandline ( ) ) ; return exe . execute ( ) ; } catch ( IOException e ) { <START_BUG> throw new org . apache . tools . ant . BuildException ( e , location ) ; <END_BUG> } } private static final String SS_EXE = "ss" ; public static final String PROJECT_PREFIX = "$" ; public static final String COMMAND_CP = "CP" ; public static final String COMMAND_ADD = "Add" ; public static final String COMMAND_GET = "Get" ; public static final String COMMAND_CHECKOUT = "Checkout" ; public static final String COMMAND_CHECKIN = "Checkin" ; public static final String COMMAND_LABEL = "Label" ; public static final String COMMAND_HISTORY = "History" ; public static final String COMMAND_CREATE = "Create" ; public static final String FLAG_LOGIN = "-Y" ; public static final String FLAG_OVERRIDE_WORKING_DIR = "-GL" ; public static final String FLAG_AUTORESPONSE_DEF = "-I-" ; public static final String FLAG_AUTORESPONSE_YES = "-I-Y" ; public static final String FLAG_AUTORESPONSE_NO = "-I-N" ; public static final String FLAG_RECURSION = "-R" ; public static final String FLAG_VERSION = "-V" ; public static final String FLAG_VERSION_DATE = "-Vd" ; public static final String FLAG_VERSION_LABEL = "-VL" ; public static final String FLAG_WRITABLE = "-W" ; public static final String VALUE_NO = "-N" ; public static final String VALUE_YES = "-Y" ; public static final String FLAG_QUIET = "-O-" ; }

Fix:
throw new org . apache . tools . ant . BuildException ( e , getLocation ( ) ) ;
Buggy code:
public class PrefixLevel1TypeBufferLevel2NameCompletionTestCase extends AbstractGeneratedAddressCompleterTest { @ Test public void testStringValues ( ) { assertAllCandidates ( Arrays . asList ( "last3" , "link3" , "other3" ) ) ; assertSelectedCandidates ( Arrays . asList ( "last3" , "link3" ) ) ; assertBufferPrefix ( ".//link2//" ) ; <START_BUG> assertContextPrefix ( "link1" ) ; <END_BUG> } @ Override protected int getBufferLevel ( ) { } @ Override protected int getPrefixLevel ( ) { } }

Fix:
assertContextPrefix ( "//link1" ) ;
Buggy code:
public class SampleSenderFactory { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String MODE_STANDARD = "Standard" ; private static final String MODE_HOLD = "Hold" ; private static final String MODE_BATCH = "Batch" ; private static final String MODE_STATISTICAL = "Statistical" ; private static final String MODE_STRIPPED = "Stripped" ; private static final String MODE_STRIPPED_BATCH = "StrippedBatch" ; private static final boolean holdSamples = JMeterUtils . getPropDefault ( "hold_samples" , false ) ; private static final String type = JMeterUtils . getPropDefault ( "mode" , SampleSenderFactory . MODE_STANDARD ) ; static SampleSender getInstance ( RemoteSampleListener listener ) { if ( ( SampleSenderFactory . holdSamples ) || ( SampleSenderFactory . type . equalsIgnoreCase ( SampleSenderFactory . MODE_HOLD ) ) ) { HoldSampleSender h = new HoldSampleSender ( listener ) ; return h ; } else if ( SampleSenderFactory . type . equalsIgnoreCase ( SampleSenderFactory . MODE_BATCH ) ) { BatchSampleSender b = new BatchSampleSender ( listener ) ; return b ; } else if ( SampleSenderFactory . type . equalsIgnoreCase ( SampleSenderFactory . MODE_STATISTICAL ) ) { StatisticalSampleSender s = new StatisticalSampleSender ( listener ) ; return s ; } else if ( SampleSenderFactory . type . equalsIgnoreCase ( SampleSenderFactory . MODE_STANDARD ) ) { StandardSampleSender s = new StandardSampleSender ( listener ) ; return s ; } else if ( SampleSenderFactory . type . equalsIgnoreCase ( SampleSenderFactory . MODE_STRIPPED_BATCH ) ) { return new DataStrippingSampleSender ( new BatchSampleSender ( listener ) ) ; } else if ( SampleSenderFactory . type . equalsIgnoreCase ( SampleSenderFactory . MODE_STRIPPED ) ) { return new DataStrippingSampleSender ( listener ) ; } else { SampleSender s = null ; try { Class < ? > clazz = Class . forName ( SampleSenderFactory . type ) ; Constructor < ? > cons = clazz . getConstructor ( new Class [ ] { RemoteSampleListener . class } ) ; s = ( ( SampleSender ) ( cons . newInstance ( new Object [ ] { listener } ) ) ) ; } catch ( Exception e ) { SampleSenderFactory . log . error ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>a<seq2seq4repair_space>sample<seq2seq4repair_space>sender<seq2seq4repair_space>from<seq2seq4repair_space>class<seq2seq4repair_space>" + ( SampleSenderFactory . type ) ) ) ; <START_BUG> throw new IllegalArgumentException ( e . getMessage ( ) ) ; <END_BUG> } return s ; } } }

Fix:
throw new IllegalArgumentException ( e . getMessage ( ) , e ) ;
Buggy code:
public class BasicResourceTestCase { private static PathElement PATH = PathElement . pathElement ( "toto" , "testSubsystem" ) ; private static PathElement DISCARD = PathElement . pathElement ( "discard" ) ; private static PathElement CONFIGURATION_TEST = PathElement . pathElement ( "configuration" , "test" ) ; private static PathElement TEST_CONFIGURATION = PathElement . pathElement ( "test" , "configuration" ) ; private static PathElement SETTING_DIRECTORY = PathElement . pathElement ( "setting" , "directory" ) ; private static PathElement DIRECTORY_SETTING = PathElement . pathElement ( "directory" , "setting" ) ; private Resource resourceRoot = Factory . create ( ) ; private TransformerRegistry registry = TransformerRegistry . Factory . create ( null ) ; private ManagementResourceRegistration resourceRegistration = ManagementResourceRegistration . Factory . create ( BasicResourceTestCase . ROOT ) ; private static final TransformationDescription description ; @ Before public void setUp ( ) { } @ Test public void testResourceTransformation ( ) throws Exception { } @ Test public void testAddOperation ( ) throws Exception { } @ Test public void testWriteAttribute ( ) throws Exception { } @ Test public void testAlias ( ) throws Exception { } @ Test public void testOperationOverride ( ) throws Exception { } @ Test public void testOperationTransformer ( ) throws Exception { } @ Test public void testRenameOperation ( ) throws Exception { } private Resource transformResource ( ) throws OperationFailedException { } private TransformedOperation transformOperation ( final ModelNode operation ) throws OperationFailedException { } private ResourceTransformationContext createContext ( final TransformationTarget target ) { } private Transformers getTransfomers ( final TransformationTarget target ) { } protected TransformationTarget create ( final TransformerRegistry registry , ModelVersion version ) { } protected TransformationTarget create ( final TransformerRegistry registry , ModelVersion version , TransformationTarget . TransformationTargetType type ) { <START_BUG> return TransformationTargetImpl . create ( registry , version , Collections . < PathAddress , ModelVersion > emptyMap ( ) , null , type ) ; <END_BUG> } private static final ResourceDefinition ROOT = new org . jboss . as . controller . SimpleResourceDefinition ( PathElement . pathElement ( "test" ) , new NonResolvingResourceDescriptionResolver ( ) ) ; private static ModelNode success ( ) { } }

Fix:
return TransformationTargetImpl . create ( registry , version , Collections . < PathAddress , ModelVersion > emptyMap ( ) , null , type , null ) ;
Buggy code:
public class AuthorizationInterceptor implements Interceptor { private final EJBMethodSecurityMetaData ejbMethodSecurityMetaData ; private final String viewClassName ; private final Method viewMethod ; public AuthorizationInterceptor ( final EJBMethodSecurityMetaData ejbMethodSecurityMetaData , final String viewClassName , final Method viewMethod ) { } @ Override public Object processInvocation ( InterceptorContext context ) throws Exception { final Component component = context . getPrivateData ( Component . class ) ; if ( ( component instanceof EJBComponent ) == false ) { throw EjbMessages . MESSAGES . unexpectedComponent ( component , EJBComponent . class ) ; } final Method invokedMethod = context . getMethod ( ) ; final ComponentView componentView = context . getPrivateData ( ComponentView . class ) ; final String viewClassOfInvokedMethod = componentView . getViewClass ( ) . getName ( ) ; if ( ( ! ( this . viewClassName . equals ( viewClassOfInvokedMethod ) ) ) || ( ! ( this . viewMethod . equals ( invokedMethod ) ) ) ) { throw EjbMessages . MESSAGES . failProcessInvocation ( this . getClass ( ) . getName ( ) , invokedMethod , viewClassOfInvokedMethod , viewMethod , viewClassName ) ; } final EJBComponent ejbComponent = ( ( EJBComponent ) ( component ) ) ; <START_BUG> if ( ejbMethodSecurityMetaData . isAccessDenied ( ) ) { <END_BUG> throw EjbMessages . MESSAGES . invocationOfMethodNotAllowed ( invokedMethod , ejbComponent . getComponentName ( ) ) ; } if ( ! ( ejbMethodSecurityMetaData . isPermitAll ( ) ) ) { final Collection < String > allowedRoles = ejbMethodSecurityMetaData . getRolesAllowed ( ) ; if ( ! ( allowedRoles . isEmpty ( ) ) ) { final SimpleSecurityManager securityManager = ejbComponent . getSecurityManager ( ) ; if ( ! ( securityManager . isCallerInRole ( ejbComponent . getSecurityMetaData ( ) . getSecurityRoles ( ) , allowedRoles . toArray ( new String [ allowedRoles . size ( ) ] ) ) ) ) { throw EjbMessages . MESSAGES . invocationOfMethodNotAllowed ( invokedMethod , ejbComponent . getComponentName ( ) ) ; } } } return context . proceed ( ) ; } }

Fix:
if ( ejbMethodSecurityMetaData . isDenyAll ( ) ) {
Buggy code:
public class VehicleYearFragment extends ListFragment { ListView lv ; ArrayAdapter < String > ad ; String [ ] years ; String selected ; @ Nullable @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle state ) { } @ Override public void onListItemClick ( ListView lv , View v , int pos , long id ) { } private class GetMakes extends AsyncTask < String , Void , String > { @ Override protected String doInBackground ( String ... params ) { } @ Override protected void onPostExecute ( String ret ) { try { JSONObject json = new JSONObject ( ret ) ; JSONArray a = json . getJSONArray ( "makes" ) ; String makes = "" ; for ( int i = 0 ; i < ( a . length ( ) ) ; i ++ ) { makes += a . getJSONObject ( i ) . getString ( "name" ) ; <START_BUG> makes += ",<seq2seq4repair_space>" ; <END_BUG> } if ( ! ( makes . isEmpty ( ) ) ) { mk . setList ( makes ) ; } else { mk . setList ( "None" ) ; } } catch ( JSONException e ) { } } } }

Fix:
makes += "^" ;
Buggy code:
public class SRVRecord extends Record { private short priority ; private short weight ; private short port ; private Name target ; private SRVRecord ( ) { } public SRVRecord ( Name _name , short _dclass , int _ttl , int _priority , int _weight , int _port , Name _target ) { } public SRVRecord ( Name _name , short _dclass , int _ttl , int length , DataByteInputStream in , Compression c ) throws IOException { } public SRVRecord ( Name _name , short _dclass , int _ttl , MyStringTokenizer st , Name origin ) throws IOException { } public String toString ( ) { } public short getPriority ( ) { } public short getWeight ( ) { } public short getPort ( ) { } public Name getTarget ( ) { } void rrToWire ( DataByteOutputStream out , Compression c ) throws IOException { } void rrToWireCanonical ( DataByteOutputStream out ) throws IOException { if ( ( target ) == null ) return ; out . writeShort ( priority ) ; out . writeShort ( weight ) ; out . writeShort ( port ) ; <START_BUG> target . toWireCanonical ( out , null ) ; <END_BUG> } }

Fix:
target . toWireCanonical ( out ) ;
Buggy code:
public class TaskSubmitFragment extends ChildFragment < KeyValueHolder > { private DelegateWrapper delegateWrapper ; private ArrayList < KeyValueView > keyValueViews ; public TaskSubmitFragment ( ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } private Button initSubmitButton ( ) { } @ Override protected void setItemView ( KeyValueHolder holder , View convertView ) { String viewClassName = ( "edu.fudan.se.crowdservice.core.dui." + ( holder . getClass ( ) . getSimpleName ( ) ) ) + "View" ; try { Class clazz = Class . forName ( viewClassName ) ; <START_BUG> KeyValueView view = ( ( KeyValueView ) ( clazz . getConstructor ( Context . class , KeyValueHolder . class ) . newInstance ( this , holder ) ) ) ; <END_BUG> ( ( LinearLayout ) ( convertView ) ) . addView ( view , new LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . WRAP_CONTENT ) ) ; keyValueViews . add ( view ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public void setDelegateWrapper ( DelegateWrapper delegateWrapper ) { } public void submit ( ) { } }

Fix:
KeyValueView view = ( ( KeyValueView ) ( clazz . getConstructor ( Context . class , KeyValueHolder . class ) . newInstance ( getActivity ( ) , holder ) ) ) ;
Buggy code:
public final class World implements Serializable { private static final long serialVersionUID = 2605757003325366045L ; public static transient World current = new World ( ) ; private List < Level > levels = new LinkedList < Level > ( ) ; private static transient Level level ; private static transient int levelIndex = 0 ; private static transient String localName ; private static transient boolean playing ; public static boolean playing ( ) { } public static void setPlaying ( boolean value ) { } public static void reset ( final boolean addBlank ) { } public static boolean save ( ) { } public static boolean save ( String name ) { } private static final int MIN_WORLD_CHAR_LENGTH = 10 ; public static void load ( String name ) { World . localName = name ; World . reset ( false ) ; String filename = ResManager . getFilename ( World . class , name ) ; File file = new File ( filename ) ; String data = null ; try { data = FileUtils . readFileToString ( file ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } <START_BUG> if ( ( data . length ( ) ) >= ( World . MIN_WORLD_CHAR_LENGTH ) ) { <END_BUG> try { World . current = Main . getGson ( ) . fromJson ( data , World . class ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } else { World . addBlankLevel ( ) ; } World . setLevelByIndex ( 0 ) ; } public static boolean hasLevelIndex ( int destination ) { } public static void setLevelByIndex ( int destination ) { } public static void update ( ) { } public List < Entity > getEntities ( ) { } public static void drawBackground ( ) { } public static void drawForeground ( ) { } public static void addEntity ( final Entity entity ) { } public static Rectangle getLevelRect ( ) { } public static void addPremadeLevel ( final Level lvl ) { } public static Level getCurrentLevel ( ) { } public static void addBlankLevel ( ) { } public static int getLevelCount ( ) { } public static void removeLevelByIndex ( int index ) { } public static String getName ( ) { } public static void replaceCurrentLevel ( final Level lvl ) { } public static int getCurrentLevelIndex ( ) { } }

Fix:
if ( ( data != null ) && ( ( data . length ( ) ) >= ( World . MIN_WORLD_CHAR_LENGTH ) ) ) {
Buggy code:
public class EventPublicationInterceptorTests { private ApplicationEventPublisher publisher ; @ Before public void setUp ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithNoApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithNonApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithAbstractStraightApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithApplicationEventClassThatDoesntExposeAValidCtor ( ) throws Exception { } @ Test public void testExpectedBehavior ( ) throws Exception { TestBean target = new TestBean ( ) ; final TestListener listener = new TestListener ( ) ; class TestContext extends StaticApplicationContext { @ Override protected void onRefresh ( ) throws BeansException { <START_BUG> addListener ( listener ) ; <END_BUG> } } StaticApplicationContext ctx = new TestContext ( ) ; MutablePropertyValues pvs = new MutablePropertyValues ( ) ; pvs . add ( "applicationEventClass" , EventPublicationInterceptorTests . TestEvent . class . getName ( ) ) ; ctx . registerSingleton ( "publisher" , EventPublicationInterceptor . class , pvs ) ; ctx . registerSingleton ( "otherListener" , EventPublicationInterceptorTests . FactoryBeanTestListener . class ) ; ctx . refresh ( ) ; EventPublicationInterceptor interceptor = ( ( EventPublicationInterceptor ) ( ctx . getBean ( "publisher" ) ) ) ; ProxyFactory factory = new ProxyFactory ( target ) ; factory . addAdvice ( 0 , interceptor ) ; ITestBean testBean = ( ( ITestBean ) ( factory . getProxy ( ) ) ) ; testBean . getAge ( ) ; assertTrue ( "Interceptor<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>published<seq2seq4repair_space>2<seq2seq4repair_space>events" , ( ( listener . getEventCount ( ) ) == 2 ) ) ; TestListener otherListener = ( ( TestListener ) ( ctx . getBean ( "&otherListener" ) ) ) ; assertTrue ( "Interceptor<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>published<seq2seq4repair_space>2<seq2seq4repair_space>events" , ( ( otherListener . getEventCount ( ) ) == 2 ) ) ; } @ SuppressWarnings ( "serial" ) public static class TestEvent extends ApplicationEvent { public TestEvent ( Object source ) { } } @ SuppressWarnings ( "serial" ) public static final class TestEventWithNoValidOneArgObjectCtor extends ApplicationEvent { public TestEventWithNoValidOneArgObjectCtor ( ) { } } public static class FactoryBeanTestListener extends TestListener implements FactoryBean < Object > { @ Override public Object getObject ( ) throws Exception { } @ Override public Class < String > getObjectType ( ) { } @ Override public boolean isSingleton ( ) { } } }

Fix:
addApplicationListener ( listener ) ;
Buggy code:
public class JavaSampler extends AbstractSampler implements TestListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 232L ; private static final Set < String > APPLIABLE_CONFIG_CLASSES = new HashSet < String > ( Arrays . asList ( new String [ ] { "org.apache.jmeter.protocol.java.config.gui.JavaConfigGui" , "org.apache.jmeter.config.gui.SimpleConfigGui" } ) ) ; public static final String CLASSNAME = "classname" ; public static final String ARGUMENTS = "arguments" ; private transient JavaSamplerClient javaClient = null ; private transient JavaSamplerContext context = null ; private static final Set < JavaSampler > allSamplers = new HashSet < JavaSampler > ( ) ; public JavaSampler ( ) { } public void setArguments ( Arguments args ) { } public Arguments getArguments ( ) { } private void releaseJavaClient ( ) { } public void setClassname ( String classname ) { } public String getClassname ( ) { } public SampleResult sample ( Entry entry ) { Arguments args = getArguments ( ) ; args . addArgument ( NAME , getName ( ) ) ; context = new JavaSamplerContext ( args ) ; if ( ( javaClient ) == null ) { <START_BUG> JavaSampler . log . debug ( ( ( whoAmI ( ) ) + "Creating<seq2seq4repair_space>Java<seq2seq4repair_space>Client" ) ) ; <END_BUG> createJavaClient ( ) ; javaClient . setupTest ( context ) ; } SampleResult result = createJavaClient ( ) . runTest ( context ) ; if ( ( result != null ) && ( ( result . getSampleLabel ( ) . length ( ) ) == 0 ) ) { result . setSampleLabel ( getName ( ) ) ; } return result ; } private JavaSamplerClient createJavaClient ( ) { } private String whoAmI ( ) { } public void testStarted ( ) { } public void testStarted ( String host ) { } public void testEnded ( ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } class ErrorSamplerClient extends AbstractJavaSamplerClient { public SampleResult runTest ( JavaSamplerContext p_context ) { } } @ Override public boolean applies ( ConfigTestElement configElement ) { } }

Fix:
JavaSampler . log . debug ( ( ( whoAmI ( ) ) + "\tCreating<seq2seq4repair_space>Java<seq2seq4repair_space>Client" ) ) ;
Buggy code:
public class JGroupsSubsystemDescribe implements OperationStepHandler { public static final JGroupsSubsystemDescribe INSTANCE = new JGroupsSubsystemDescribe ( ) ; @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode result = new ModelNode ( ) ; final PathAddress rootAddress = PathAddress . pathAddress ( PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) . getLastElement ( ) ) ; final ModelNode subModel = Tools . readModel ( context . readResource ( EMPTY_ADDRESS ) ) ; result . add ( JGroupsSubsystemAdd . createOperation ( rootAddress . toModelNode ( ) , subModel ) ) ; if ( subModel . hasDefined ( STACK ) ) { for ( final Property stack : subModel . get ( STACK ) . asPropertyList ( ) ) { final ModelNode stackAddress = rootAddress . toModelNode ( ) ; stackAddress . add ( STACK , stack . getName ( ) ) ; result . add ( ProtocolStackAdd . createOperation ( stackAddress , stack . getValue ( ) ) ) ; if ( stack . getValue ( ) . get ( TRANSPORT , TRANSPORT_NAME ) . isDefined ( ) ) { ModelNode transport = stack . getValue ( ) . get ( TRANSPORT , TRANSPORT_NAME ) ; ModelNode transportAddress = stackAddress . clone ( ) ; transportAddress . add ( TRANSPORT , TRANSPORT_NAME ) ; result . add ( StackConfigOperationHandlers . createOperation ( TRANSPORT_PARAMETERS , transportAddress , transport ) ) ; addProtocolPropertyCommands ( transport , transportAddress , result ) ; } if ( stack . getValue ( ) . get ( PROTOCOL ) . isDefined ( ) ) { for ( Property protocol : ProtocolStackAdd . getOrderedProtocolPropertyList ( stack . getValue ( ) ) ) { result . add ( StackConfigOperationHandlers . createProtocolOperation ( PROTOCOL_PARAMETERS , stackAddress , protocol . getValue ( ) ) ) ; ModelNode protocolAddress = stackAddress . clone ( ) ; protocolAddress . add ( PROTOCOL , protocol . getName ( ) ) ; addProtocolPropertyCommands ( protocol . getValue ( ) , protocolAddress , result ) ; } } } } context . getResult ( ) . set ( result ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } private void addProtocolPropertyCommands ( ModelNode protocol , ModelNode address , ModelNode result ) throws OperationFailedException { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class MainActivity extends Activity { public static ArrayAdapter < Task > sAdapter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void populateListView ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { int id = item . getItemId ( ) ; if ( id == ( id . action_settings ) ) { return true ; } else <START_BUG> if ( id == ( id . add_task_button ) ) { <END_BUG> Intent intent = new Intent ( this , AddTaskActivity . class ) ; startActivity ( intent ) ; } return super . onOptionsItemSelected ( item ) ; } }

Fix:
if ( id == ( id . add_task_menu_button ) ) {
Buggy code:
public class ModuleContextProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( isEarDeployment ( deploymentUnit ) ) { return ; } final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ServiceName moduleContextServiceName = ContextServiceNameBuilder . module ( deploymentUnit ) ; final RootContextService contextService = new RootContextService ( ) ; serviceTarget . addService ( moduleContextServiceName , contextService ) . install ( ) ; final BinderService < String > moduleNameBinder = new BinderService < String > ( "ModuleName" , Values . immediateValue ( getModuleName ( deploymentUnit ) ) ) ; <START_BUG> serviceTarget . addService ( moduleContextServiceName . append ( "module-name" ) , moduleNameBinder ) . addDependency ( moduleContextServiceName , Context . class , moduleNameBinder . getContextInjector ( ) ) . install ( ) ; <END_BUG> final ContextService envContextService = new ContextService ( JndiName . of ( "env" ) ) ; serviceTarget . addService ( moduleContextServiceName . append ( "env" ) , envContextService ) . addDependency ( moduleContextServiceName , Context . class , envContextService . getParentContextInjector ( ) ) . install ( ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( MODULE_CONTEXT_CONFIG , new NamingContextConfig ( moduleContextServiceName ) ) ; } private String getModuleName ( final DeploymentUnit deploymentUnit ) { } public void undeploy ( DeploymentUnit context ) { } }

Fix:
serviceTarget . addService ( moduleContextServiceName . append ( "ModuleName" ) , moduleNameBinder ) . addDependency ( moduleContextServiceName , Context . class , moduleNameBinder . getContextInjector ( ) ) . install ( ) ;
Buggy code:
public abstract class InstanceFactory { @ Nonnull final Class < ? > concreteClass ; @ Nullable Object lastInstance ; InstanceFactory ( @ Nonnull Class < ? > concreteClass ) { } @ Nonnull public abstract Object create ( ) ; @ Nullable public final Object getLastInstance ( ) { } public abstract void clearLastInstance ( ) { } static final class InterfaceInstanceFactory extends InstanceFactory { @ Nullable private Object emptyProxy ; InterfaceInstanceFactory ( @ Nonnull Object emptyProxy ) { } @ Nonnull @ Override public Object create ( ) { if ( ( emptyProxy ) == null ) { <START_BUG> emptyProxy = ConstructorReflection . newInstanceUsingDefaultConstructor ( concreteClass ) ; <END_BUG> } lastInstance = emptyProxy ; return emptyProxy ; } @ Override public void clearLastInstance ( ) { } } static final class ClassInstanceFactory extends InstanceFactory { ClassInstanceFactory ( @ Nonnull Class < ? > concreteClass ) { } @ Override @ Nonnull public Object create ( ) { lastInstance = ConstructorReflection . newUninitializedInstance ( concreteClass ) ; return lastInstance ; } @ Override public void clearLastInstance ( ) { } } }

Fix:
emptyProxy = ConstructorReflection . newUninitializedInstance ( concreteClass ) ;
Buggy code:
public class InitialContext extends InitialDirContext { private static volatile Map < String , ObjectFactory > urlContextFactories = Collections . emptyMap ( ) ; public static synchronized void addUrlContextFactory ( final String scheme , ObjectFactory factory ) { } public static synchronized void removeUrlContextFactory ( final String scheme , ObjectFactory factory ) { } public InitialContext ( Hashtable environment ) throws NamingException { } @ Override protected void init ( Hashtable environment ) throws NamingException { } @ Override protected Context getDefaultInitCtx ( ) throws NamingException { if ( ! ( gotDefault ) ) { final String factoryClassName = ( ( myProps ) != null ) ? ( ( String ) ( myProps . get ( Context . INITIAL_CONTEXT_FACTORY ) ) ) : null ; if ( ( factoryClassName == null ) || ( InitialContextFactory . class . getName ( ) . equals ( factoryClassName ) ) ) { defaultInitCtx = new InitialContext . DefaultInitialContext ( myProps ) ; } else { final ClassLoader classLoader = WildFlySecurityManager . getCurrentContextClassLoaderPrivileged ( ) ; try { final Class < ? > factoryClass = Class . forName ( factoryClassName , true , classLoader ) ; defaultInitCtx = ( ( javax . naming . spi . InitialContextFactory ) ( factoryClass . newInstance ( ) ) ) . getInitialContext ( myProps ) ; } catch ( Exception e ) { <START_BUG> throw NamingMessages . MESSAGES . failedToInstantiate ( "InitialContextFactory" , factoryClassName , classLoader ) ; <END_BUG> } } gotDefault = true ; } return defaultInitCtx ; } @ Override protected Context getURLOrDefaultInitCtx ( String name ) throws NamingException { } @ Override protected Context getURLOrDefaultInitCtx ( Name name ) throws NamingException { } private static String getURLScheme ( String str ) { } private interface ParsedName { String namespace ( ) { } Name remaining ( ) { } } static class DefaultInitialContext extends NamingContext { public DefaultInitialContext ( Hashtable environment ) { } private Context findContext ( final Name name , final InitialContext . ParsedName parsedName ) throws NamingException { } private InitialContext . ParsedName parse ( final Name name ) throws NamingException { } public Object lookup ( final Name name , boolean dereference ) throws NamingException { } public NamingEnumeration < Binding > listBindings ( final Name name ) throws NamingException { } public NamingEnumeration < NameClassPair > list ( final Name name ) throws NamingException { } public void bind ( Name name , Object object ) throws NamingException { } public void rebind ( Name name , Object object ) throws NamingException { } public void unbind ( Name name ) throws NamingException { } public void destroySubcontext ( Name name ) throws NamingException { } public Context createSubcontext ( Name name ) throws NamingException { } } }

Fix:
throw NamingMessages . MESSAGES . failedToInstantiate ( e , "InitialContextFactory" , factoryClassName , classLoader ) ;
Buggy code:
public class BUnzip2 extends Unpack { private static final int BUFFER_SIZE = 8 * 1024 ; private static final String DEFAULT_EXTENSION = ".bz2" ; protected String getDefaultExtension ( ) { } protected void extract ( ) { if ( ( source . lastModified ( ) ) > ( dest . lastModified ( ) ) ) { log ( ( ( ( "Expanding<seq2seq4repair_space>" + ( source . getAbsolutePath ( ) ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( dest . getAbsolutePath ( ) ) ) ) ; FileOutputStream out = null ; CBZip2InputStream zIn = null ; InputStream fis = null ; BufferedInputStream bis = null ; try { out = new FileOutputStream ( dest ) ; fis = srcResource . getInputStream ( ) ; bis = new BufferedInputStream ( fis ) ; int b = bis . read ( ) ; if ( b != 'B' ) { throw new org . apache . tools . ant . BuildException ( "Invalid<seq2seq4repair_space>bz2<seq2seq4repair_space>file." , getLocation ( ) ) ; } b = bis . read ( ) ; if ( b != 'Z' ) { throw new org . apache . tools . ant . BuildException ( "Invalid<seq2seq4repair_space>bz2<seq2seq4repair_space>file." , getLocation ( ) ) ; } <START_BUG> zIn = new CBZip2InputStream ( bis ) ; <END_BUG> byte [ ] buffer = new byte [ BUnzip2 . BUFFER_SIZE ] ; int count = 0 ; do { out . write ( buffer , 0 , count ) ; count = zIn . read ( buffer , 0 , buffer . length ) ; } while ( count != ( - 1 ) ) ; } catch ( IOException ioe ) { String msg = "Problem<seq2seq4repair_space>expanding<seq2seq4repair_space>bzip2<seq2seq4repair_space>" + ( ioe . getMessage ( ) ) ; throw new org . apache . tools . ant . BuildException ( msg , ioe , getLocation ( ) ) ; } finally { FileUtils . close ( bis ) ; FileUtils . close ( fis ) ; FileUtils . close ( out ) ; FileUtils . close ( zIn ) ; } } } protected boolean supportsNonFileResources ( ) { } }

Fix:
zIn = new CBZip2InputStream ( bis , true ) ;
Buggy code:
public class CodeSnippetFieldReference extends FieldReference implements ProblemReasons , EvaluationConstants { EvaluationContext evaluationContext ; FieldBinding delegateThis ; public CodeSnippetFieldReference ( char [ ] source , long pos , EvaluationContext evaluationContext ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( ( constant ) != ( NotAConstant ) ) { if ( valueRequired ) { codeStream . generateConstant ( constant , implicitConversion ) ; } } else { boolean isStatic = binding . isStatic ( ) ; receiver . generateCode ( currentScope , codeStream , ( ( valueRequired && ( ! isStatic ) ) && ( ( binding . constant ) == ( NotAConstant ) ) ) ) ; if ( valueRequired ) { if ( ( binding . constant ) == ( NotAConstant ) ) { if ( ( binding . declaringClass ) == null ) { codeStream . arraylength ( ) ; } else { if ( binding . canBeSeenBy ( receiverType , this , currentScope ) ) { if ( isStatic ) { codeStream . getstatic ( binding ) ; } else { codeStream . getfield ( binding ) ; } } else { if ( isStatic ) { codeStream . aconst_null ( ) ; } ( ( CodeSnippetCodeStream ) ( codeStream ) ) . generateEmulatedReadAccessForField ( binding ) ; } } codeStream . generateImplicitConversion ( implicitConversion ) ; } else { codeStream . generateConstant ( binding . constant , implicitConversion ) ; } } } <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public void manageSyntheticReadAccessIfNecessary ( BlockScope currentScope ) { } public void manageSyntheticWriteAccessIfNecessary ( BlockScope currentScope ) { } public TypeBinding resolveType ( BlockScope scope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class StatisticsParser { private static final Pattern PLAYLIST_PATTERN = Pattern . compile ( "^Playlist=(\\d+).*" ) ; public Statistics parse ( String text ) throws UnsupportedEncodingException { } private Rank parseLine ( String line ) throws UnsupportedEncodingException { final String [ ] parameters = URLDecoder . decode ( line , "UTF-8" ) . split ( "&" ) ; BigDecimal mu = new BigDecimal ( 0 ) ; BigDecimal sigma = new BigDecimal ( 0 ) ; BigDecimal mmr = new BigDecimal ( 0 ) ; Tier tier = Tier . UNRANKED ; Integer division = 0 ; Integer matchesPlayed = 0 ; Integer rating = 0 ; for ( String parameter : parameters ) { final String [ ] parameterParts = parameter . split ( "=" ) ; if ( 2 == ( parameterParts . length ) ) { switch ( parameterParts [ 0 ] ) { case "Mu" : mu = new BigDecimal ( parameterParts [ 1 ] ) ; break ; case "Sigma" : sigma = new BigDecimal ( parameterParts [ 1 ] ) ; break ; case "MMR" : mmr = new BigDecimal ( parameterParts [ 1 ] ) ; break ; case "Tier" : tier = Tier . findByTier ( Integer . parseInt ( parameterParts [ 1 ] ) ) ; break ; case "Division" : <START_BUG> division = Integer . parseInt ( parameterParts [ 1 ] ) ; <END_BUG> break ; case "MatchesPlayed" : matchesPlayed = Integer . parseInt ( parameterParts [ 1 ] ) ; break ; case "Rating" : rating = Integer . parseInt ( parameterParts [ 1 ] ) ; break ; } } } final Skill skill = new Skill ( mu , sigma , mmr , matchesPlayed ) ; final Rank rank = new Rank ( tier , division , rating , null ) ; rank . setSkill ( skill ) ; return rank ; } }

Fix:
division = ( Integer . parseInt ( parameterParts [ 1 ] ) ) + 1 ;
Buggy code:
public class ReportSave implements Command { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public static final String SAVE_ALL_AS = "save_all_as" ; public static final String SAVE_AS = "save_as" ; public static final String SAVE = "save" ; private static final Set < String > commands = new HashSet < String > ( ) ; public ReportSave ( ) { } public Set < String > getActionNames ( ) { } public void doAction ( ActionEvent e ) throws IllegalUserActionException { HashTree subTree = null ; if ( ! ( ReportSave . commands . contains ( e . getActionCommand ( ) ) ) ) { throw new IllegalUserActionException ( ( "Invalid<seq2seq4repair_space>user<seq2seq4repair_space>command:" + ( e . getActionCommand ( ) ) ) ) ; } if ( e . getActionCommand ( ) . equals ( ReportSave . SAVE_AS ) ) { subTree = ReportGuiPackage . getInstance ( ) . getCurrentSubTree ( ) ; } else { subTree = ReportGuiPackage . getInstance ( ) . getTreeModel ( ) . getReportPlan ( ) ; } String updateFile = ReportGuiPackage . getInstance ( ) . getReportPlanFile ( ) ; if ( ( ! ( ReportSave . SAVE . equals ( e . getActionCommand ( ) ) ) ) || ( updateFile == null ) ) { JFileChooser chooser = ReportFileDialoger . promptToSaveFile ( ( ( ReportGuiPackage . getInstance ( ) . getTreeListener ( ) . getCurrentNode ( ) . getName ( ) ) + ".jmr" ) ) ; if ( chooser == null ) { return ; } updateFile = chooser . getSelectedFile ( ) . getAbsolutePath ( ) ; if ( ! ( e . getActionCommand ( ) . equals ( ReportSave . SAVE_AS ) ) ) { ReportGuiPackage . getInstance ( ) . setReportPlanFile ( updateFile ) ; } } ReportActionRouter . getInstance ( ) . doActionNow ( new ActionEvent ( subTree , e . getID ( ) , ReportCheckDirty . SUB_TREE_SAVED ) ) ; try { convertSubTree ( subTree ) ; } catch ( Exception err ) { } FileOutputStream ostream = null ; try { ostream = new FileOutputStream ( updateFile ) ; SaveService . saveTree ( subTree , ostream ) ; ReportSave . log . info ( "saveTree" ) ; <START_BUG> } catch ( Throwable ex ) { <END_BUG> ReportGuiPackage . getInstance ( ) . setReportPlanFile ( null ) ; ReportSave . log . error ( "" , ex ) ; throw new IllegalUserActionException ( ( "Couldn't<seq2seq4repair_space>save<seq2seq4repair_space>test<seq2seq4repair_space>plan<seq2seq4repair_space>to<seq2seq4repair_space>file:<seq2seq4repair_space>" + updateFile ) ) ; } finally { JOrphanUtils . closeQuietly ( ostream ) ; } } private void convertSubTree ( HashTree tree ) { } }

Fix:
} catch ( Exception ex ) {
Buggy code:
public final class LongId extends OpenJPAId { private final long key ; public LongId ( Class cls , Long key ) { } public LongId ( Class cls , String key ) { } public LongId ( Class cls , long key ) { } public LongId ( Class cls , long key , boolean subs ) { } public long getId ( ) { } public Object getIdObject ( ) { <START_BUG> return Numbers . valueOf ( key ) ; <END_BUG> } protected int idHash ( ) { } protected boolean idEquals ( OpenJPAId o ) { } }

Fix:
return key ;
Buggy code:
class TransactionSubsystem10Parser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > { public static final TransactionSubsystem10Parser INSTANCE = new TransactionSubsystem10Parser ( ) ; private TransactionSubsystem10Parser ( ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } static void parseObjectStoreEnvironmentElementAndEnrichOperation ( final XMLExtendedStreamReader reader , ModelNode operation ) throws XMLStreamException { } static void parseCoordinatorEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseCoreEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseProcessIdEnvironmentElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseSocketProcessIdElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseRecoveryEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { Set < Attribute > required = EnumSet . of ( BINDING , STATUS_BINDING ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; required . remove ( attribute ) ; switch ( attribute ) { case BINDING : TransactionSubsystemRootResourceDefinition . BINDING . parseAndSetParameter ( value , operation , reader ) ; break ; case STATUS_BINDING : TransactionSubsystemRootResourceDefinition . STATUS_BINDING . parseAndSetParameter ( value , operation , reader ) ; break ; case RECOVERY_LISTENER : RECOVERY_LISTENER . parseAndSetParameter ( value , operation , reader ) ; break ; default : <START_BUG> throw unexpectedAttribute ( reader , i ) ; <END_BUG> } } if ( ! ( required . isEmpty ( ) ) ) { throw missingRequired ( reader , required ) ; } requireNoContent ( reader ) ; } }

Fix:
unexpectedAttribute ( reader , i ) ;
Buggy code:
public final class dns { private static Resolver res ; private static Cache cache ; private static Name [ ] searchPath ; private static boolean searchPathSet ; private dns ( ) { } static boolean matchType ( short type1 , short type2 ) { } public static String inaddrString ( InetAddress addr ) { byte [ ] address = addr . getAddress ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 3 ; i >= 0 ; i -- ) { sb . append ( ( ( address [ i ] ) & 255 ) ) ; sb . append ( "." ) ; } <START_BUG> sb . append ( ".IN-ADDR.ARPA." ) ; <END_BUG> return sb . toString ( ) ; } public static String inaddrString ( String s ) { } public static void setResolver ( Resolver _res ) { } public static void setSearchPath ( String [ ] domains ) { } private static Record [ ] lookup ( Name name , short type , short dclass , byte cred ) { } public static Record [ ] getRecords ( String namestr , short type , short dclass , byte cred ) { } public static Record [ ] getRecords ( String namestr , short type , short dclass ) { } public static Record [ ] getAnyRecords ( String namestr , short type , short dclass ) { } public static Record [ ] getRecords ( String name , short type ) { } public static Record [ ] getAnyRecords ( String name , short type ) { } public static Record [ ] getRecordsByAddress ( String addr , short type ) { } public static Record [ ] getAnyRecordsByAddress ( String addr , short type ) { } }

Fix:
sb . append ( "IN-ADDR.ARPA." ) ;
Buggy code:
public class RegisterOperation extends AbstractNetworkOperation < Void > { private String userName ; private String passWord ; private String email ; private boolean hasErrors ; public RegisterOperation ( String userName , String passWord , String email ) { } public OperationResult < Void > execute ( ) { HttpResponse response = null ; this . hasErrors = true ; List < NameValuePair > body = new ArrayList < NameValuePair > ( ) ; body . add ( new BasicNameValuePair ( "account[name]" , this . userName ) ) ; body . add ( new BasicNameValuePair ( "account[mail]" , this . email ) ) ; body . add ( new BasicNameValuePair ( "account[pass]" , this . passWord ) ) ; response = NetworkCalls . performPostRequest ( ( ( Constants . API_URL ) + "user.json" ) , body , null ) ; <START_BUG> hasErrors = false ; <END_BUG> return new OperationResult < Void > ( hasErrors , response . getStatusLine ( ) . getStatusCode ( ) , response . getStatusLine ( ) . getReasonPhrase ( ) , null ) ; } }

Fix:
hasErrors = ( response . getStatusLine ( ) . getStatusCode ( ) ) != 200 ;