nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class EnvEntryInjectionSource extends InjectionSource { private final Object value ; public EnvEntryInjectionSource ( final Object value ) { } <START_BUG> public void getResourceValue ( final ComponentConfiguration componentConfiguration , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) throws DeploymentUnitProcessingException { <END_BUG> injector . inject ( new org . jboss . as . naming . ValueManagedReferenceFactory ( Values . immediateValue ( value ) ) ) ; } public boolean equals ( final Object injectionSource ) { } private boolean equals ( final EnvEntryInjectionSource injectionSource ) { } }

Fix:
public void getResourceValue ( final ResolutionContext resolutionContext , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) throws DeploymentUnitProcessingException {
Buggy code:
public class ComponentTest extends WicketTestCase { public ComponentTest ( String name ) { } public void testDetachPage ( ) throws Exception { } public void testDetachPageAjaxRequest ( ) throws Exception { executeTest ( TestDetachPage . class , "TestDetachPageExpectedResult.html" ) ; TestDetachPage page = ( ( TestDetachPage ) ( tester . getLastRenderedPage ( ) ) ) ; assertTrue ( ( ( page . getNrComponentDetachModelCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrComponentDetachModelsCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrComponentOnDetachCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrPageDetachModelCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrPageDetachModelsCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrPageOnDetachCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrModelDetachCalls ( ) ) > 0 ) ) ; assertTrue ( ( ( page . getNrAjaxBehaviorDetachModelCalls ( ) ) > 0 ) ) ; AjaxEventBehavior behavior = page . getAjaxBehavior ( ) ; <START_BUG> executedBehavior ( TestDetachPage . class , behavior , "TestDetachPageAjaxResult.html" ) ; <END_BUG> assertTrue ( ( 1 <= ( page . getNrComponentDetachModelCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrComponentDetachModelsCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrComponentOnDetachCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrPageDetachModelCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrPageDetachModelsCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrPageOnDetachCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrModelDetachCalls ( ) ) ) ) ; assertTrue ( ( 1 <= ( page . getNrAjaxBehaviorDetachModelCalls ( ) ) ) ) ; } public void testRenderHomePage_1 ( ) throws Exception { } }

Fix:
executeBehavior ( behavior , "TestDetachPageAjaxResult.html" ) ;
Buggy code:
public class RemoteServiceProxyTest extends AbstractRemoteServiceTest { RemoteServiceTracker remoteServiceTracker ; protected String getClientContainerName ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected IRemoteService getRemoteService ( IRemoteServiceContainerAdapter adapter , String clazz , String filter ) { } public void testRemoteServiceProxy ( ) throws Exception { } IRemoteService remoteService ; boolean done ; public void testServiceListener ( ) throws Exception { final IRemoteServiceContainerAdapter [ ] adapters = getRemoteServiceAdapters ( ) ; done = false ; final Object lock = new Object ( ) ; adapters [ 1 ] . addRemoteServiceListener ( new IRemoteServiceListener ( ) { public void handleServiceEvent ( IRemoteServiceEvent event ) { if ( event instanceof IRemoteServiceRegisteredEvent ) { IRemoteServiceRegisteredEvent e = ( ( IRemoteServiceRegisteredEvent ) ( event ) ) ; IRemoteServiceReference ref = e . getReference ( ) ; remoteService = adapters [ 1 ] . getRemoteService ( ref ) ; assertNotNull ( remoteService ) ; synchronized ( lock ) { done = true ; lock . notify ( ) ; } } } } ) ; adapters [ 0 ] . registerRemoteService ( new String [ ] { IConcatService . class . getName ( ) } , createService ( ) , customizeProperties ( null ) ) ; int count = 0 ; synchronized ( lock ) { while ( ( ! ( done ) ) && ( ( count ++ ) < 10 ) ) { try { lock . wait ( 1000 ) ; } catch ( InterruptedException e ) { fail ( ) ; } } } assertTrue ( done ) ; if ( ( remoteService ) == null ) return ; assertTrue ( ( ( remoteService ) != null ) ) ; traceCallStart ( "callAsynchResult" ) ; final IFuture result = remoteService . callAsync ( createRemoteConcat ( "ECF<seq2seq4repair_space>AsynchResults<seq2seq4repair_space>" , "are<seq2seq4repair_space>cool" ) ) ; traceCallEnd ( "callAsynch" ) ; assertNotNull ( result ) ; <START_BUG> Thread . sleep ( ASYNC_WAITTIME ) ; <END_BUG> } }

Fix:
Thread . sleep ( SLEEPTIME ) ;
Buggy code:
public class ByFormatter extends By { private ByFormatter ( String locator , String formatter ) { } private String _locator ; private String _formatter ; private static final String FORMATTER_CLASSNAME = "className" ; private static final String FORMATTER_CSSSELECTOR = "cssSelector" ; private static final String FORMATTER_ID = "id" ; private static final String FORMATTER_LINKTEXT = "linkText" ; private static final String FORMATTER_PARTIALLINKTEXT = "partialLinkText" ; private static final String FORMATTER_NAME = "name" ; private static final String FORMATTER_TAGNAME = "tagName" ; private static final String FORMATTER_XPATH = "xpath" ; public static ByFormatter className ( String locator ) { } public static ByFormatter cssSelector ( String locator ) { } public static ByFormatter id ( String locator ) { } public static ByFormatter linkText ( String locator ) { } public static ByFormatter partialLinkText ( String locator ) { } public static ByFormatter name ( String locator ) { } public static ByFormatter tagName ( String locator ) { } public static ByFormatter xpath ( String locator ) { } @ Override public String toString ( ) { } public By format ( String ... vars ) { int numVars = vars . length ; String by = _locator ; for ( int i = 0 ; i < numVars ; i ++ ) { String replacement = "%s" ; <START_BUG> by = by . replace ( replacement , vars [ i ] ) ; <END_BUG> } switch ( _formatter ) { case ByFormatter . FORMATTER_CLASSNAME : return By . className ( by ) ; case ByFormatter . FORMATTER_CSSSELECTOR : return By . cssSelector ( by ) ; case ByFormatter . FORMATTER_ID : return By . id ( by ) ; case ByFormatter . FORMATTER_LINKTEXT : return By . linkText ( by ) ; case ByFormatter . FORMATTER_PARTIALLINKTEXT : return By . name ( by ) ; case ByFormatter . FORMATTER_NAME : return By . partialLinkText ( by ) ; case ByFormatter . FORMATTER_TAGNAME : return By . tagName ( by ) ; case ByFormatter . FORMATTER_XPATH : return By . xpath ( by ) ; default : return null ; } } @ Override public List < WebElement > findElements ( SearchContext context ) { } }

Fix:
by = by . replaceFirst ( replacement , vars [ i ] ) ;
Buggy code:
public class RealtimeTuningConfig implements TuningConfig { private static final int defaultMaxRowsInMemory = 500000 ; private static final Period defaultIntermediatePersistPeriod = new Period ( "PT10M" ) ; private static final Period defaultWindowPeriod = new Period ( "PT10M" ) ; private static final File defaultBasePersistDirectory = Files . createTempDir ( ) ; private static final VersioningPolicy defaultVersioningPolicy = new IntervalStartVersioningPolicy ( ) ; private static final RejectionPolicyFactory defaultRejectionPolicyFactory = new ServerTimeRejectionPolicyFactory ( ) ; private static final int defaultMaxPendingPersists = 0 ; private static final ShardSpec defaultShardSpec = new NoneShardSpec ( ) ; private static final boolean defaultPersistInHeap = false ; private static final boolean defaultIngestOffheap = false ; private static final int defaultBufferSize = ( 128 * 1024 ) * 1024 ; public static RealtimeTuningConfig makeDefaultTuningConfig ( ) { } private final int maxRowsInMemory ; private final Period intermediatePersistPeriod ; private final Period windowPeriod ; private final File basePersistDirectory ; private final VersioningPolicy versioningPolicy ; private final RejectionPolicyFactory rejectionPolicyFactory ; private final int maxPendingPersists ; private final ShardSpec shardSpec ; private final boolean persistInHeap ; private final boolean ingestOffheap ; private final int bufferSize ; @ JsonCreator public RealtimeTuningConfig ( @ JsonProperty ( "maxRowsInMemory" ) Integer maxRowsInMemory , @ JsonProperty ( "intermediatePersistPeriod" ) Period intermediatePersistPeriod , @ JsonProperty ( "windowPeriod" ) Period windowPeriod , @ JsonProperty ( "basePersistDirectory" ) File basePersistDirectory , @ JsonProperty ( "versioningPolicy" ) VersioningPolicy versioningPolicy , @ JsonProperty ( "rejectionPolicy" ) RejectionPolicyFactory rejectionPolicyFactory , @ JsonProperty ( "maxPendingPersists" ) Integer maxPendingPersists , @ JsonProperty ( "shardSpec" ) ShardSpec shardSpec , @ JsonProperty ( "persistInHeap" ) Boolean persistInHeap , @ JsonProperty ( "ingestOffheap" ) Boolean ingestOffheap , @ JsonProperty ( "buffersize" ) Integer bufferSize ) { } @ JsonProperty public int getMaxRowsInMemory ( ) { } @ JsonProperty public Period getIntermediatePersistPeriod ( ) { } @ JsonProperty public Period getWindowPeriod ( ) { } @ JsonProperty public File getBasePersistDirectory ( ) { } @ JsonProperty public VersioningPolicy getVersioningPolicy ( ) { } <START_BUG> @ JsonProperty <END_BUG> public RejectionPolicyFactory getRejectionPolicyFactory ( ) { return rejectionPolicyFactory ; } @ JsonProperty public int getMaxPendingPersists ( ) { } @ JsonProperty public ShardSpec getShardSpec ( ) { } @ JsonProperty public boolean isPersistInHeap ( ) { } @ JsonProperty public boolean isIngestOffheap ( ) { } @ JsonProperty public int getBufferSize ( ) { } public RealtimeTuningConfig withVersioningPolicy ( VersioningPolicy policy ) { } public RealtimeTuningConfig withBasePersistDirectory ( File dir ) { } }

Fix:
@ JsonProperty ( "rejectionPolicy" )
Buggy code:
public class ThreadMonitor { private static int MONITOR_INTERVAL = 500 ; private static int WARN_NO_THD_PROGRESS_TIME = 300 ; private static int THD_LIVENESS_INFO_INTERVAL = 3000 ; private static int RUNTIME_INFO_INTERVAL = 60 ; public static enum DebugFlag implements DebugUtils . DebugFlagBase { THD_LIVENESS_INFO ( 1 ) , WARN_NO_THD_PROGRESS ( 2 ) , RUNTIME_INFO ( 4 ) ; public final int value ; DebugFlag ( int value ) { } public int toInt ( ) { } } private static class ThreadInfo { private Thread thd ; private String thdDesc ; private Thread . State lastState = Thread . State . NEW ; private StackTraceElement lastStackElem = null ; private long lastProgress ; private long lastLivenessInfo = 0 ; private boolean warned = false ; private boolean equals ( Thread . State state , StackTraceElement [ ] stackTrace ) { } private void outputWarning ( Thread . State thdState , StackTraceElement [ ] stackTrace , long noProgressTime ) { } private void outputLivenessInfos ( Thread . State thdState , StackTraceElement [ ] stackTrace ) { } public ThreadInfo ( Thread thd , String thdDesc ) { } public Thread . State getCurrentThdState ( ) { } public void checkAndUpdate ( Thread . State currThdState ) { } } private static class MonitoringThread extends Thread { private static final int MB = 1024 * 1024 ; private AtomicBoolean shutdownReq = new AtomicBoolean ( false ) ; private void outputRuntimeInfos ( ) { } public void run ( ) { } public void shutdown ( ) { } } private static ThreadMonitor . MonitoringThread monitoringThd = new ThreadMonitor . MonitoringThread ( ) ; private static Map < Thread , ThreadMonitor . ThreadInfo > monitoredThds = new HashMap < Thread , ThreadMonitor . ThreadInfo > ( ) ; public static void start ( ) { } public static void shutdown ( ) { } public static void addThread ( Thread thd , String thdDesc ) { if ( DebugUtils . canDebug ( ThreadMonitor . class , ThreadMonitor . DebugFlag . WARN_NO_THD_PROGRESS , ThreadMonitor . DebugFlag . THD_LIVENESS_INFO , ThreadMonitor . DebugFlag . RUNTIME_INFO ) ) { synchronized ( ThreadMonitor . monitoredThds ) { ThreadMonitor . monitoredThds . put ( thd , new ThreadMonitor . ThreadInfo ( thd , thdDesc ) ) ; <START_BUG> if ( ( ( ThreadMonitor . monitoredThds . size ( ) ) == 1 ) && ( ! ( ThreadMonitor . monitoringThd . isAlive ( ) ) ) ) <END_BUG> ThreadMonitor . monitoringThd . start ( ) ; } } } public static void addThread ( Thread thd ) { } public static void removeThread ( Thread thd ) { } }

Fix:
if ( ! ( ThreadMonitor . monitoringThd . isAlive ( ) ) )
Buggy code:
public class CacheFactoryResourceDefinition extends SimpleResourceDefinition { public static final ListAttributeDefinition ALIASES = new CacheFactoryResourceDefinition . StringListAttributeDefinition ( EJB3SubsystemModel . ALIASES , EJB3SubsystemXMLAttribute . ALIASES . getLocalName ( ) , true ) ; public static final SimpleAttributeDefinition PASSIVATION_STORE = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( EJB3SubsystemModel . PASSIVATION_STORE , ModelType . STRING , true ) . setXmlName ( PASSIVATION_STORE_REF . getLocalName ( ) ) . setAllowExpression ( true ) . setFlags ( RESTART_NONE ) . build ( ) ; private static final AttributeDefinition [ ] ATTRIBUTES = new AttributeDefinition [ ] { CacheFactoryResourceDefinition . ALIASES , CacheFactoryResourceDefinition . PASSIVATION_STORE } ; private static final CacheFactoryAdd ADD_HANDLER = new CacheFactoryAdd ( CacheFactoryResourceDefinition . ATTRIBUTES ) ; private static final CacheFactoryRemove REMOVE_HANDLER = new CacheFactoryRemove ( CacheFactoryResourceDefinition . ADD_HANDLER ) ; public static final CacheFactoryResourceDefinition INSTANCE = new CacheFactoryResourceDefinition ( ) ; private CacheFactoryResourceDefinition ( ) { } @ Override public void registerAttributes ( ManagementResourceRegistration resourceRegistration ) { ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler ( CacheFactoryResourceDefinition . ATTRIBUTES ) ; for ( AttributeDefinition attribute : CacheFactoryResourceDefinition . ATTRIBUTES ) { <START_BUG> resourceRegistration . registerReadOnlyAttribute ( attribute , handler ) ; <END_BUG> } } private static class StringListAttributeDefinition extends ListAttributeDefinition { StringListAttributeDefinition ( String name , String xmlName , boolean allowNull ) { } @ Override protected void addValueTypeDescription ( ModelNode node , ResourceBundle bundle ) { } @ Override protected void addAttributeValueTypeDescription ( ModelNode node , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { } @ Override protected void addOperationParameterValueTypeDescription ( ModelNode node , String operationName , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { } private void setValueType ( ModelNode node ) { } @ Override public void marshallAsElement ( ModelNode model , XMLStreamWriter writer ) throws XMLStreamException { } } }

Fix:
resourceRegistration . registerReadWriteAttribute ( attribute , null , handler ) ;
Buggy code:
public class RecoveryManager2Test extends CleanupHelper { @ Test public void testWithFlush ( ) throws IOException , InterruptedException , ExecutionException { <START_BUG> instance . disableCompactions ( ) ; <END_BUG> for ( int i = 0 ; i < 100 ; i ++ ) { String key = "key" + i ; insertRow ( key ) ; } Table table1 = Table . open ( "Keyspace1" ) ; ColumnFamilyStore cfs = table1 . getColumnFamilyStore ( "Standard1" ) ; cfs . forceBlockingFlush ( ) ; cfs . clearUnsafe ( ) ; RecoveryManager . doRecovery ( ) ; Set < String > foundKeys = new HashSet < String > ( cfs . getKeyRange ( "" , "" , 1000 ) . keys ) ; assert foundKeys . equals ( Collections . emptySet ( ) ) ; } private void insertRow ( String key ) throws IOException { } }

Fix:
instance . disableAutoCompaction ( ) ;
Buggy code:
public class ThreadListBuilder { private static final int bufSize_ = ( 64 * 1024 ) * 1024 ; private static final int count_ = ( 128 * 1024 ) * 1024 ; public static void main ( String [ ] args ) throws Throwable { if ( ( args . length ) != 2 ) { <START_BUG> System . out . println ( "Usage<seq2seq4repair_space>:<seq2seq4repair_space>java<seq2seq4repair_space>com.facebook.infrastructure.tools.ThreadListBuilder<seq2seq4repair_space><directory<seq2seq4repair_space>containing<seq2seq4repair_space>files<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>processed><seq2seq4repair_space><directory<seq2seq4repair_space>to<seq2seq4repair_space>dump<seq2seq4repair_space>the<seq2seq4repair_space>bloom<seq2seq4repair_space>filter<seq2seq4repair_space>in.>" ) ; <END_BUG> System . exit ( 1 ) ; } File directory = new File ( args [ 0 ] ) ; File [ ] files = directory . listFiles ( ) ; List < DataOutputBuffer > buffers = new ArrayList < DataOutputBuffer > ( ) ; BloomFilter bf = new BloomFilter ( ThreadListBuilder . count_ , 8 ) ; int keyCount = 0 ; for ( File file : files ) { System . out . println ( ( "Processing<seq2seq4repair_space>file<seq2seq4repair_space>" + file ) ) ; BufferedReader bufReader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( file ) ) , ThreadListBuilder . bufSize_ ) ; String line = null ; while ( ( line = bufReader . readLine ( ) ) != null ) { if ( ( keyCount > 0 ) && ( ( keyCount % ( ThreadListBuilder . count_ ) ) == 0 ) ) { DataOutputBuffer bufOut = new DataOutputBuffer ( ) ; BloomFilter . serializer ( ) . serialize ( bf , bufOut ) ; System . out . println ( "Finished<seq2seq4repair_space>serializing<seq2seq4repair_space>the<seq2seq4repair_space>bloom<seq2seq4repair_space>filter" ) ; buffers . add ( bufOut ) ; bf = new BloomFilter ( ThreadListBuilder . count_ , 8 ) ; } line = line . trim ( ) ; bf . add ( line ) ; ++ keyCount ; } } DataOutputBuffer bufOut = new DataOutputBuffer ( ) ; BloomFilter . serializer ( ) . serialize ( bf , bufOut ) ; buffers . add ( bufOut ) ; int size = buffers . size ( ) ; for ( int i = 0 ; i < size ; ++ i ) { DataOutputBuffer buffer = buffers . get ( i ) ; String file = ( ( ( ( args [ 1 ] ) + ( File . separator ) ) + "Bloom-Filter-" ) + i ) + ".dat" ; RandomAccessFile raf = new RandomAccessFile ( file , "rw" ) ; raf . write ( buffer . getData ( ) , 0 , buffer . getLength ( ) ) ; raf . close ( ) ; buffer . close ( ) ; } System . out . println ( "Done<seq2seq4repair_space>writing<seq2seq4repair_space>the<seq2seq4repair_space>bloom<seq2seq4repair_space>filter<seq2seq4repair_space>to<seq2seq4repair_space>disk" ) ; } }

Fix:
System . out . println ( "Usage<seq2seq4repair_space>:<seq2seq4repair_space>java<seq2seq4repair_space>org.apache.cassandra.tools.ThreadListBuilder<seq2seq4repair_space><directory<seq2seq4repair_space>containing<seq2seq4repair_space>files<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>processed><seq2seq4repair_space><directory<seq2seq4repair_space>to<seq2seq4repair_space>dump<seq2seq4repair_space>the<seq2seq4repair_space>bloom<seq2seq4repair_space>filter<seq2seq4repair_space>in.>" ) ;
Buggy code:
public class Choice { UUID id ; CardState state ; @ JsonIgnore Player target ; @ JsonIgnore Player owner ; @ JsonIgnore Game game ; Card source ; Card displayCard ; String message ; boolean isComplete ; boolean isRequired ; Set < String > textOptions ; Set < Card > cardOptions ; OptionType expectedAnswerType ; @ JsonIgnore Choice parentChoice ; @ JsonIgnore ChoiceResponse response ; byte number ; Range range ; @ JsonIgnore Effect effect ; public Choice ( Player target , Card source ) { } public void bind ( Effect effect ) { } public void apply ( ChoiceResponse choiceResponse , Turn turn ) { } public void resolveIfComplete ( Turn turn ) { Set < Choice > choices = target . getChoices ( ) ; Set < Choice > resolved = turn . getResolvedChoices ( ) ; if ( isComplete ) { choices . remove ( this ) ; resolved . add ( this ) ; if ( ( choices . size ( ) ) == 0 ) { <START_BUG> turn . setPhase ( ACTION ) ; <END_BUG> } } } public String getMessage ( ) { } public void setMessage ( String message ) { } public Set < String > getTextOptions ( ) { } public void setTextOptions ( Set < String > textOptions ) { } public Set < Card > getCardOptions ( ) { } public void setCardOptions ( Set < Card > cardOptions ) { } public Effect getEffect ( ) { } public void setEffect ( Effect effect ) { } public Range getRange ( ) { } public void setRange ( Range range ) { } public byte getNumber ( ) { } public void setNumber ( byte number ) { } public Player getTarget ( ) { } public void setTarget ( Player target ) { } public Player getOwner ( ) { } public void setOwner ( Player owner ) { } public Card getSource ( ) { } public void setSource ( Card source ) { } public UUID getId ( ) { } public void setId ( UUID id ) { } public boolean isComplete ( ) { } public void setComplete ( boolean isComplete ) { } public Choice getParentChoice ( ) { } public void setParentChoice ( Choice parentChoice ) { } public ChoiceResponse getResponse ( ) { } public void setResponse ( ChoiceResponse response ) { } public Game getGame ( ) { } public void setGame ( Game game ) { } public boolean isRequired ( ) { } public void setRequired ( boolean isRequired ) { } public OptionType getExpectedAnswerType ( ) { } public void setExpectedAnswerType ( OptionType expectedAnswerType ) { } public Card getDisplayCard ( ) { } public void setDisplayCard ( Card displayCard ) { } public CardState getState ( ) { } public void setState ( CardState state ) { } }

Fix:
game . getTurn ( ) . setPhase ( ACTION ) ;
Buggy code:
class AttributeTransformationRule extends TransformationRule { private final Map < String , AttributeTransformationDescription > descriptions ; AttributeTransformationRule ( Map < String , AttributeTransformationDescription > descriptions ) { } @ Override void transformOperation ( final ModelNode operation , PathAddress address , ChainedOperationContext context ) throws OperationFailedException { } @ Override void transformResource ( final Resource resource , final PathAddress address , final ChainedResourceContext context ) throws OperationFailedException { } private void doTransform ( PathAddress address , ModelNode modelOrOp , ModelNode operation , AbstractChainedContext context , RejectedAttributesLogContext rejectedAttributes ) { Map < String , String > renames = new HashMap < String , String > ( ) ; Map < String , ModelNode > adds = new HashMap < String , ModelNode > ( ) ; for ( final Map . Entry < String , AttributeTransformationDescription > entry : descriptions . entrySet ( ) ) { final String attributeName = entry . getKey ( ) ; final ModelNode attributeValue = modelOrOp . get ( attributeName ) ; AttributeTransformationDescription description = entry . getValue ( ) ; boolean discarded = false ; <START_BUG> if ( description . shouldDiscard ( attributeValue , operation , context ) ) { <END_BUG> modelOrOp . remove ( attributeName ) ; discarded = true ; } description . rejectAttributes ( rejectedAttributes , attributeValue ) ; boolean isNewAttribute ; if ( operation != null ) { isNewAttribute = ! ( operation . has ( attributeName ) ) ; } else { isNewAttribute = ! ( modelOrOp . has ( attributeName ) ) ; } description . convertValue ( address , attributeValue , operation , context ) ; if ( ! ( attributeValue . isDefined ( ) ) ) { modelOrOp . remove ( attributeName ) ; } else if ( isNewAttribute && ( ! discarded ) ) { adds . put ( attributeName , attributeValue ) ; } String newName = description . getNewName ( ) ; if ( newName != null ) { renames . put ( attributeName , newName ) ; } } if ( ( renames . size ( ) ) > 0 ) { for ( Map . Entry < String , String > entry : renames . entrySet ( ) ) { if ( modelOrOp . has ( entry . getKey ( ) ) ) { ModelNode model = modelOrOp . remove ( entry . getKey ( ) ) ; if ( model . isDefined ( ) ) { modelOrOp . get ( entry . getValue ( ) ) . set ( model ) ; } } } } if ( ( adds . size ( ) ) > 0 ) { for ( Map . Entry < String , ModelNode > entry : adds . entrySet ( ) ) { modelOrOp . get ( entry . getKey ( ) ) . set ( entry . getValue ( ) ) ; } } } }

Fix:
if ( description . shouldDiscard ( address , attributeValue , operation , context ) ) {
Buggy code:
public class Run extends Meld { public void setMeld ( GroupOfCards theOnesInYourHand , Integer greaterThan ) { ArrayList < GroupOfCards > runholder = new ArrayList < GroupOfCards > ( ) ; for ( Integer cardint : theOnesInYourHand . getThecards ( ) . keySet ( ) ) { boolean createNewRun = true ; if ( ( runholder . size ( ) ) == 0 ) { GroupOfCards firstone = new GroupOfCards ( ) ; firstone . addCard ( cardint , theOnesInYourHand . getThecards ( ) . get ( cardint ) ) ; runholder . add ( firstone ) ; } else { for ( GroupOfCards pos_run : runholder ) { Integer pos_runs_int = ( ( Integer ) ( pos_run . getThecards ( ) . keySet ( ) . toArray ( ) [ 0 ] ) ) ; if ( ( ( Math . abs ( ( pos_runs_int - cardint ) ) ) == 1 ) && ( ( pos_run . getSuits ( ) [ 0 ] ) == ( theOnesInYourHand . getThecards ( ) . get ( cardint ) . getSuit ( ) ) ) ) { pos_run . addCard ( cardint , theOnesInYourHand . getThecards ( ) . get ( cardint ) ) ; createNewRun = false ; } } if ( createNewRun ) { GroupOfCards tryanother = new GroupOfCards ( ) ; tryanother . addCard ( cardint , theOnesInYourHand . getThecards ( ) . get ( cardint ) ) ; runholder . add ( tryanother ) ; } } } boolean willrun = true ; do { int k = 0 ; if ( willrun ) { willrun = false ; while ( k < ( runholder . size ( ) ) ) { GroupOfCards run1 = runholder . get ( k ) ; String suit1 = run1 . getSuits ( ) [ 0 ] ; Integer lowestCard1 = ( ( Integer ) ( run1 . getThecards ( ) . keySet ( ) . toArray ( ) [ 0 ] ) ) ; Integer highestCard1 = ( ( Integer ) ( run1 . getThecards ( ) . keySet ( ) . toArray ( ) [ ( ( run1 . numberOfCards ( ) ) - 1 ) ] ) ) ; int i = k + 1 ; while ( i < ( runholder . size ( ) ) ) { GroupOfCards run2 = runholder . get ( i ) ; String suit2 = run2 . getSuits ( ) [ 0 ] ; Integer lowestCard2 = ( ( Integer ) ( run2 . getThecards ( ) . keySet ( ) . toArray ( ) [ 0 ] ) ) ; Integer highestCard2 = ( ( Integer ) ( run2 . getThecards ( ) . keySet ( ) . toArray ( ) [ ( ( run2 . numberOfCards ( ) ) - 1 ) ] ) ) ; if ( ( suit1 == suit2 ) && ( ( ( lowestCard2 - highestCard1 ) == 1 ) || ( ( lowestCard1 - highestCard2 ) == 1 ) ) ) { run1 . mergeCards ( run2 . getThecards ( ) ) ; runholder . remove ( i ) ; willrun = true ; } i ++ ; } k ++ ; } } } while ( willrun ) ; ArrayList < GroupOfCards > results = new ArrayList < GroupOfCards > ( ) ; for ( GroupOfCards run : runholder ) { <START_BUG> if ( ( run . numberOfCards ( ) ) >= 3 ) { <END_BUG> results . add ( run ) ; } } this . meld = results ; } public void rankMeld ( ) { } }

Fix:
if ( ( run . numberOfCards ( ) ) >= greaterThan ) {
Buggy code:
public class TestPortugueseMinimalStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testExamples ( ) throws IOException { } public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class EjbLookupInjectionSource extends InjectionSource { private final String lookup ; private final String targetTypeName ; private final Class < ? > targetType ; public EjbLookupInjectionSource ( final String lookup , final String targetType ) { } public EjbLookupInjectionSource ( final String lookup , final Class < ? > targetType ) { } @ Override public void getResourceValue ( final ResolutionContext resolutionContext , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) throws DeploymentUnitProcessingException { final Class < ? > type ; if ( ( targetType ) != null ) { type = targetType ; } else if ( ( targetTypeName ) != null ) { final DeploymentClassIndex index = phaseContext . getDeploymentUnit ( ) . getAttachment ( CLASS_INDEX ) ; try { type = index . classIndex ( targetTypeName ) . getModuleClass ( ) ; } catch ( ClassNotFoundException e ) { <START_BUG> throw new RuntimeException ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>load<seq2seq4repair_space>EJB<seq2seq4repair_space>type<seq2seq4repair_space>" + ( targetTypeName ) ) , e ) ; <END_BUG> } } else { type = null ; } injector . inject ( new ManagedReferenceFactory ( ) { @ Override public ManagedReference getReference ( ) { try { final Object value = new InitialContext ( ) . lookup ( lookup ) ; return new ManagedReference ( ) { @ Override public void release ( ) { } @ Override public Object getInstance ( ) { if ( ( type != null ) && ( value instanceof org . omg . CORBA . Object ) ) { return PortableRemoteObject . narrow ( value , type ) ; } else { return value ; } } } ; } catch ( NamingException e ) { throw new RuntimeException ( e ) ; } } } ) ; } @ Override public boolean equals ( final Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
throw new RuntimeException ( e ) ;
Buggy code:
public class UnboundedQueueThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( ACTIVE_COUNT , COMPLETED_TASK_COUNT , CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT , TASK_COUNT ) ; public UnboundedQueueThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final UnboundedQueueThreadPoolService pool = ( ( UnboundedQueueThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . ACTIVE_COUNT ) ) { context . getResult ( ) . set ( pool . getActiveCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . COMPLETED_TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getCompletedTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getTaskCount ( ) ) ; } else { <START_BUG> throw new IllegalStateException ( ( ( "Unsupported<seq2seq4repair_space>attribute<seq2seq4repair_space>'" + attributeName ) + "'" ) ) ; <END_BUG> } } }

Fix:
throw MESSAGES . unsupportedUnboundedQueueThreadPoolMetric ( attributeName ) ;
Buggy code:
public class AdministrationForm implements Serializable { private static final long serialVersionUID = 5648439270064158243L ; private static final Logger myLogger = Logger . getLogger ( AdministrationForm . class ) ; private String passwort ; private boolean istPasswortRichtig = false ; private boolean rusFullExport = false ; public static final String DIRECTORY_SUFFIX = "_tif" ; public String Weiter ( ) { this . passwort = new MD5 ( this . passwort ) . getMD5 ( ) ; String adminMd5 = ConfigMain . getParameter ( "superadminpassword" ) ; this . istPasswortRichtig = this . passwort . equals ( adminMd5 ) ; if ( ! ( this . istPasswortRichtig ) ) { <START_BUG> Helper . setFehlerMeldung ( "wrong<seq2seq4repair_space>passworwd" , "" ) ; <END_BUG> } return "" ; } public String getPasswort ( ) { } public void setPasswort ( String passwort ) { } public void restartStorageCalculationScheduler ( ) { } public void startStorageCalculationForAllProcessesNow ( ) { } public boolean isIstPasswortRichtig ( ) { } public void createIndex ( ) { } public void ProzesseDurchlaufen ( ) throws DAOException { } public void AnzahlenErmitteln ( ) throws DAOException , SwapException , IOException , InterruptedException { } public void SiciKorr ( ) throws DAOException { } public void StandardRegelsatzSetzen ( ) throws DAOException { } public void PasswoerterVerschluesseln ( ) { } public void ProzesseDatumSetzen ( ) throws DAOException { } @ SuppressWarnings ( "unchecked" ) public void ImagepfadKorrigieren ( ) throws DAOException { } @ SuppressWarnings ( "unchecked" ) public void PPNsKorrigieren ( ) throws DAOException { } @ SuppressWarnings ( "unchecked" ) public static void PPNsFuerStatistischesJahrbuchKorrigieren2 ( ) { } @ SuppressWarnings ( "unchecked" ) public void PPNsFuerStatistischesJahrbuchKorrigieren ( ) throws DAOException { } public boolean isRusFullExport ( ) { } public void setRusFullExport ( boolean rusFullExport ) { } }

Fix:
Helper . setFehlerMeldung ( "wrong<seq2seq4repair_space>password" , "" ) ;
Buggy code:
public class SourcePersister implements ScanPersister { private final MyBatis mybatis ; private final System2 system2 ; private final ProjectTree projectTree ; private final ResourceCache resourceCache ; private final InputPathCache inputPathCache ; private final SourceDataFactory dataFactory ; public SourcePersister ( InputPathCache inputPathCache , MyBatis mybatis , System2 system2 , ProjectTree projectTree , ResourceCache resourceCache , SourceDataFactory dataFactory ) { } @ Override public void persist ( ) { } private void persist ( DbSession session , FileSourceMapper mapper , DefaultInputFile inputFile , Map < String , FileSourceDto > previousDtosByUuid ) { } @ CheckForNull private String lineHashesAsMd5Hex ( DefaultInputFile f ) { if ( ( f . lines ( ) ) == 0 ) { return null ; } final StringBuilder result = new StringBuilder ( ( ( f . lines ( ) ) * ( 32 + 1 ) ) ) ; FileMetadata . computeLineHashesForIssueTracking ( f , new LineHashConsumer ( ) { @ Override public void consume ( int lineIdx , @ Nullable byte [ ] hash ) { <START_BUG> if ( lineIdx > 0 ) { <END_BUG> result . append ( "\n" ) ; } result . append ( ( hash != null ? Hex . encodeHexString ( hash ) : "" ) ) ; } } ) ; return result . toString ( ) ; } private byte [ ] computeData ( DefaultInputFile inputFile , InputFileMetadata metadata ) { } }

Fix:
if ( lineIdx > 1 ) {
Buggy code:
public class HttpTests extends AndroidTestCase { @ Override protected void setUp ( ) throws Exception { } public void testString ( ) throws Exception { } public void testMultipartFileContentType ( ) throws Exception { } public void testStringWithCallback ( ) throws Exception { } public void testJsonObject ( ) throws Exception { } public void testPostJsonObject ( ) throws Exception { } public void testUrlEncodedFormBody ( ) throws Exception { } public void testUrlEncodedFormBodyWithNull ( ) throws Exception { } public void testMultipart ( ) throws Exception { } public void testCookie ( ) throws Exception { Ion ion = Ion . getDefault ( getContext ( ) ) ; ion . getCookieMiddleware ( ) . clear ( ) ; ion . build ( getContext ( ) ) . load ( "http:////google.com" ) . asString ( ) . get ( ) ; for ( HttpCookie cookie : ion . getCookieMiddleware ( ) . getCookieStore ( ) . get ( URI . create ( "http:////www.google.com" ) ) ) { Log . i ( "CookieTest" , ( ( ( cookie . getName ( ) ) + ":<seq2seq4repair_space>" ) + ( cookie . getValue ( ) ) ) ) ; } assertTrue ( ( ( ion . getCookieMiddleware ( ) . getCookieManager ( ) . get ( URI . create ( "http:////www.google.com//test//path" ) , new Multimap ( ) ) . size ( ) ) > 0 ) ) ; <START_BUG> CookieMiddleware deserialize = new CookieMiddleware ( getContext ( ) , ion . getDefault ( getContext ( ) ) . getName ( ) ) ; <END_BUG> assertTrue ( ( ( deserialize . getCookieManager ( ) . get ( URI . create ( "http:////www.google.com//test//path" ) , new Multimap ( ) ) . size ( ) ) > 0 ) ) ; } public void testGroupCancel ( ) throws Exception { } public static class Dummy { public String foo ; } public void testGson ( ) throws Exception { } boolean wasProxied ; public void testProxy ( ) throws Exception { } public void testSSLNullRef ( ) throws Exception { } public void testPut ( ) throws Exception { } }

Fix:
CookieMiddleware deserialize = new CookieMiddleware ( ion ) ;
Buggy code:
public class EJBSelectBridge implements SelectorBridge { private static final byte SINGLE = 0 ; private static final byte COLLECTION = 2 ; private final JDBCQueryMetaData metadata ; private final QueryCommand command ; private final byte returnType ; private final Schema schema ; private boolean syncBeforeSelect ; private TransactionManager tm ; public EJBSelectBridge ( final JDBCStoreManager2 manager , CmpEntityBeanComponent component , Schema schema , JDBCQueryMetaData metadata , QueryCommand command ) { } public Object invoke ( CmpEntityBeanContext instance , Method method , Object [ ] args ) throws Exception { } public String getSelectorName ( ) { } public Method getMethod ( ) { } public Object execute ( CmpEntityBeanContext ctx , Object [ ] args ) throws FinderException { JDBCStoreManager2 manager = command . getStoreManager ( ) ; final CmpEntityBeanComponent selectedComponent = manager . getComponent ( ) ; JDBCQueryCommand . EntityProxyFactory factory = new JDBCQueryCommand . EntityProxyFactory ( ) { public Object getEntityObject ( Object primaryKey ) { <START_BUG> return ( metadata . isResultTypeMappingLocal ( ) ) && ( ( selectedComponent . getLocalHomeClass ( ) ) != null ) ? selectedComponent . getEjbLocalObject ( primaryKey ) : selectedComponent . getEJBObject ( primaryKey ) ; <END_BUG> } } ; Object result ; switch ( returnType ) { case EJBSelectBridge . SINGLE : result = command . fetchOne ( schema , args , factory ) ; if ( ( result == null ) && ( getMethod ( ) . getReturnType ( ) . isPrimitive ( ) ) ) { throw new FinderException ( ( "Cannot<seq2seq4repair_space>return<seq2seq4repair_space>null<seq2seq4repair_space>as<seq2seq4repair_space>a<seq2seq4repair_space>value<seq2seq4repair_space>of<seq2seq4repair_space>primitive<seq2seq4repair_space>type<seq2seq4repair_space>" + ( getMethod ( ) . getReturnType ( ) . getName ( ) ) ) ) ; } break ; case EJBSelectBridge . COLLECTION : result = command . fetchCollection ( schema , args , factory ) ; break ; default : throw new IllegalStateException ( ( "Unexpected<seq2seq4repair_space>return<seq2seq4repair_space>type:<seq2seq4repair_space>" + ( returnType ) ) ) ; } return result ; } }

Fix:
return ( metadata . isResultTypeMappingLocal ( ) ) && ( ( selectedComponent . getLocalHomeClass ( ) ) != null ) ? selectedComponent . getEJBLocalObject ( primaryKey ) : selectedComponent . getEJBObject ( primaryKey ) ;
Buggy code:
public class BasicNewFolderResourceWizard extends BasicNewResourceWizard { private WizardNewFolderMainPage mainPage ; private WizardNewLinkPage linkPage ; public BasicNewFolderResourceWizard ( ) { } public void addPages ( ) { super . addPages ( ) ; mainPage = new WizardNewFolderMainPage ( ResourceMessages . getString ( "NewFolder.text" ) , getSelection ( ) ) ; addPage ( mainPage ) ; linkPage = new WizardNewLinkPage ( "newLinkPage" , IResource . FOLDER ) ; linkPage . setTitle ( ResourceMessages . getString ( "NewLink.pageTitle" ) ) ; <START_BUG> linkPage . setDescription ( ResourceMessages . getString ( "NewLink.description" ) ) ; <END_BUG> addPage ( linkPage ) ; } public IWizardPage getNextPage ( IWizardPage page ) { } public void init ( IWorkbench workbench , IStructuredSelection currentSelection ) { } protected void initializeDefaultPageImageDescriptor ( ) { } public boolean performFinish ( ) { } }

Fix:
linkPage . setDescription ( ResourceMessages . getString ( "NewLink.folderDescription" ) ) ;
Buggy code:
public class GLayeredPanel extends GPanel { private final List < GComponent > mChildren ; private final List < Integer > mLayers ; public GLayeredPanel ( ) { } private GLayeredPanel ( List < GComponent > children ) { } @ Override public void addChild ( GComponent child ) { } public synchronized void addChild ( int layer , GComponent child ) { } @ Override public synchronized void removeChild ( GComponent child ) { } @ Override public synchronized void clearChildren ( ) { } @ Override public synchronized GComponent mouseFocusableComponentAt ( int x , int y ) { if ( ( ! ( hasMouseFocusableComponent ( ) ) ) || ( ! ( contains ( x , y ) ) ) ) { return null ; } int size = mChildren . size ( ) ; Integer topLayer = null ; while ( ( size -- ) > 0 ) { GComponent child = mChildren . get ( size ) ; Integer layer = mLayers . get ( size ) ; if ( topLayer == null ) { if ( child . hasMouseFocusableComponent ( ) ) { topLayer = layer ; } else { continue ; } } else if ( ( layer . intValue ( ) ) != ( topLayer . intValue ( ) ) ) { break ; } GComponent ret = child . mouseFocusableComponentAt ( ( x - ( child . x ( ) ) ) , ( y - ( child . y ( ) ) ) ) ; if ( ret != null ) { return ret ; } } <START_BUG> return ( topLayer == null ) && ( GToolkit . isMouseFocusable ( this ) ) ? this : null ; <END_BUG> } }

Fix:
return GToolkit . isMouseFocusable ( this ) ? this : null ;
Buggy code:
public class Bootstrap { private static final Class [ ] FACTORY_ARGS = new Class [ ] { ConfigurationProvider . class } ; private static Localizer s_loc = Localizer . forPackage ( Bootstrap . class ) ; public static BrokerFactory newBrokerFactory ( ) { } public static BrokerFactory newBrokerFactory ( ConfigurationProvider conf , ClassLoader loader ) { } public static BrokerFactory getBrokerFactory ( ) { } public static BrokerFactory getBrokerFactory ( ConfigurationProvider conf , ClassLoader loader ) { } private static Class getFactoryClass ( ConfigurationProvider conf , ClassLoader loader ) { if ( loader == null ) loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; <START_BUG> Object cls = BrokerFactoryValue . getBrokerFactoryClassName ( conf ) ; <END_BUG> if ( cls instanceof Class ) return ( ( Class ) ( cls ) ) ; BrokerFactoryValue value = new BrokerFactoryValue ( ) ; value . setString ( ( ( String ) ( cls ) ) ) ; String clsName = value . getClassName ( ) ; if ( clsName == null ) throw new org . apache . openjpa . util . UserException ( Bootstrap . s_loc . get ( "no-brokerfactory" , conf . getProperties ( ) ) ) . setFatal ( true ) ; try { return Class . forName ( clsName , true , loader ) ; } catch ( Exception e ) { throw new org . apache . openjpa . util . UserException ( Bootstrap . s_loc . get ( "bad-brokerfactory-class" , clsName ) , e ) . setFatal ( true ) ; } } }

Fix:
Object cls = BrokerFactoryValue . get ( conf ) ;
Buggy code:
public class TataServlet extends HttpServlet { private Logger logger = Logger . getLogger ( TataServlet . class ) ; public void init ( ) throws ServletException { } public void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String name = request . getParameter ( "name" ) ; response . setContentType ( "text//html" ) ; PrintWriter out = response . getWriter ( ) ; logger . info ( ( "About<seq2seq4repair_space>to<seq2seq4repair_space>say<seq2seq4repair_space>Tata<seq2seq4repair_space>to<seq2seq4repair_space>" + name ) ) ; out . println ( "<HTML><BODY>" ) ; <START_BUG> out . println ( ( ( "<H2><seq2seq4repair_space>Tata<seq2seq4repair_space>" + name ) + ".<seq2seq4repair_space>How<seq2seq4repair_space>are<seq2seq4repair_space>you?<//H2>" ) ) ; <END_BUG> out . println ( "<//BODY><//HTML>" ) ; out . close ( ) ; } }

Fix:
out . println ( ( ( "<H2>Many<seq2seq4repair_space>tata's<seq2seq4repair_space>to<seq2seq4repair_space>you<seq2seq4repair_space>" + name ) + ".<seq2seq4repair_space>How<seq2seq4repair_space>are<seq2seq4repair_space>you<seq2seq4repair_space>today?<//H2>" ) ) ;
Buggy code:
class UsersResource extends BaseRestResource { public static final Resource INSTANCE = new UsersResource ( ) ; @ Override protected ImmutableMap . Builder < String , ScriptCommand > baseCommands ( ) { } private ScriptCommand getFriends ( boolean following ) { } protected JsonNode friendshipUpdate ( JsonNode command , JsonCallback unused ) throws CommandException { } private JsonNode doUnfollow ( JsonNode command , String from , String to ) throws CommandExecutionException { } private JsonNode doFollow ( JsonNode command , String from , String to ) throws CommandExecutionException { } protected JsonNode suspend ( JsonNode command ) throws CommandException { } private String getUsername ( JsonNode command ) throws CommandException { } protected JsonNode reactivate ( JsonNode command ) throws CommandException { } @ Override protected JsonNode delete ( JsonNode command ) throws CommandException { } @ Override protected JsonNode put ( JsonNode command ) throws CommandException { String username = getUsername ( command ) ; JsonNode params = command . get ( PARAMS ) ; <START_BUG> String role = ( ( params . get ( "role" ) ) == null ) ? params . get ( "role" ) . asText ( ) : null ; <END_BUG> JsonNode userVisible = params . get ( ATTRIBUTES_VISIBLE_ONLY_BY_THE_USER ) ; JsonNode friendsVisible = params . get ( ATTRIBUTES_VISIBLE_BY_FRIENDS_USER ) ; JsonNode registeredVisible = params . get ( ATTRIBUTES_VISIBLE_BY_REGISTERED_USER ) ; JsonNode anonymousVisible = params . get ( ATTRIBUTES_VISIBLE_BY_ANONYMOUS_USER ) ; try { ODocument doc = UserService . updateProfile ( username , role , anonymousVisible , userVisible , friendsVisible , registeredVisible ) ; String s = JSONFormats . prepareDocToJson ( doc , USER ) ; return Json . mapper ( ) . readTree ( s ) ; } catch ( Exception e ) { throw new CommandExecutionException ( command , ( "Error<seq2seq4repair_space>updating<seq2seq4repair_space>user:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } @ Override protected JsonNode post ( JsonNode command ) throws CommandException { } @ Override protected JsonNode list ( JsonNode command ) throws CommandException { } @ Override protected JsonNode get ( JsonNode command ) throws CommandException { } @ Override public String name ( ) { } private String prepareResponseToJson ( List < ODocument > listOfDoc ) { } }

Fix:
String role = ( ( params . get ( "role" ) ) != null ) ? params . get ( "role" ) . asText ( ) : null ;
Buggy code:
public class TypeScriptPluginTest { TypeScriptPlugin plugin ; @ Before public void setUp ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } @ Test public void advertisesAppropriateExtensions ( ) { List extensions = this . plugin . getExtensions ( ) ; <START_BUG> assertEquals ( 5 , extensions . size ( ) ) ; <END_BUG> assertTrue ( extensions . contains ( TypeScriptRuleProfile . class ) ) ; assertTrue ( extensions . contains ( TypeScriptLanguage . class ) ) ; assertTrue ( extensions . contains ( TsLintSensor . class ) ) ; assertTrue ( extensions . contains ( TsCoverageSensor . class ) ) ; assertTrue ( extensions . contains ( TsRulesDefinition . class ) ) ; } @ Test public void decoratedWithPropertiesAnnotation ( ) { } @ Test public void definesExpectedProperties ( ) { } @ Test public void tsLintPathSetting_definedAppropriately ( ) { } @ Test public void excludeTypeDefinitionFilesSetting_definedAppropriately ( ) { } @ Test public void lcovReportPathSetting_definedAppropriately ( ) { } @ Test public void forceZeroCoverageSetting_definedAppropriately ( ) { } private Property findPropertyByName ( String property ) { } private static Property findPropertyByName ( Property [ ] properties , final String name ) { } }

Fix:
assertEquals ( 6 , extensions . size ( ) ) ;