nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TextAreaDialog extends EnhancedDialog { public TextAreaDialog ( Frame frame , String title , String caption , Icon icon , String text ) { } public TextAreaDialog ( Frame frame , String name , Throwable t ) { } public TextAreaDialog ( Dialog frame , String title , String caption , Icon icon , String text ) { } public TextAreaDialog ( Dialog frame , String name , Throwable t ) { } private void init ( String title , String caption , Icon icon , String text ) { JPanel content = new JPanel ( new BorderLayout ( 12 , 12 ) ) ; content . setBorder ( new EmptyBorder ( 12 , 12 , 12 , 12 ) ) ; setContentPane ( content ) ; Box iconBox = new Box ( BoxLayout . Y_AXIS ) ; iconBox . add ( new JLabel ( icon ) ) ; iconBox . add ( Box . createGlue ( ) ) ; content . add ( BorderLayout . WEST , iconBox ) ; JPanel centerPanel = new JPanel ( new BorderLayout ( 6 , 6 ) ) ; centerPanel . add ( BorderLayout . NORTH , GUIUtilities . createMultilineLabel ( caption ) ) ; JTextArea textArea = new JTextArea ( 10 , 80 ) ; textArea . setText ( text ) ; textArea . setLineWrap ( true ) ; textArea . setCaretPosition ( 0 ) ; centerPanel . add ( BorderLayout . CENTER , new JScrollPane ( textArea ) ) ; content . add ( BorderLayout . CENTER , centerPanel ) ; Box buttons = new Box ( BoxLayout . X_AXIS ) ; buttons . add ( Box . createGlue ( ) ) ; JButton ok = new JButton ( jEdit . getProperty ( "common.ok" ) ) ; ok . addActionListener ( new TextAreaDialog . ActionHandler ( ) ) ; buttons . add ( ok ) ; buttons . add ( Box . createGlue ( ) ) ; content . add ( BorderLayout . SOUTH , buttons ) ; getRootPane ( ) . setDefaultButton ( ok ) ; pack ( ) ; setLocationRelativeTo ( getParent ( ) ) ; <START_BUG> show ( ) ; <END_BUG> } public void ok ( ) { } public void cancel ( ) { } class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } }

Fix:
setVisible ( true ) ;
Buggy code:
public class TestSumDocFreq extends LuceneTestCase { public void testSumDocFreq ( ) throws Exception { final int numDocs = atLeast ( 500 ) ; Directory dir = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir ) ; Document doc = new Document ( ) ; Field id = newStringField ( "id" , "" , NO ) ; Field field1 = newTextField ( "foo" , "" , NO ) ; Field field2 = newTextField ( "bar" , "" , NO ) ; doc . add ( id ) ; doc . add ( field1 ) ; doc . add ( field2 ) ; for ( int i = 0 ; i < numDocs ; i ++ ) { id . setStringValue ( ( "" + i ) ) ; char ch1 = ( ( char ) ( TestUtil . nextInt ( random ( ) , 'a' , 'z' ) ) ) ; char ch2 = ( ( char ) ( TestUtil . nextInt ( random ( ) , 'a' , 'z' ) ) ) ; field1 . setStringValue ( ( ( ( "" + ch1 ) + "<seq2seq4repair_space>" ) + ch2 ) ) ; ch1 = ( ( char ) ( TestUtil . nextInt ( random ( ) , 'a' , 'z' ) ) ) ; ch2 = ( ( char ) ( TestUtil . nextInt ( random ( ) , 'a' , 'z' ) ) ) ; field2 . setStringValue ( ( ( ( "" + ch1 ) + "<seq2seq4repair_space>" ) + ch2 ) ) ; writer . addDocument ( doc ) ; } IndexReader ir = writer . getReader ( ) ; assertSumDocFreq ( ir ) ; ir . close ( ) ; int numDeletions = atLeast ( 20 ) ; for ( int i = 0 ; i < numDeletions ; i ++ ) { writer . deleteDocuments ( new Term ( "id" , ( "" + ( random ( ) . nextInt ( numDocs ) ) ) ) ) ; } writer . forceMerge ( 1 ) ; <START_BUG> writer . close ( ) ; <END_BUG> ir = DirectoryReader . open ( dir ) ; assertSumDocFreq ( ir ) ; ir . close ( ) ; dir . close ( ) ; } private void assertSumDocFreq ( IndexReader ir ) throws Exception { } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class CpioArchiveOutputStream extends ArchiveOutputStream implements CpioConstants { private CpioArchiveEntry entry ; private boolean closed = false ; private boolean finished ; private final short entryFormat ; private final HashMap names = new HashMap ( ) ; private long crc = 0 ; private long written ; private final OutputStream out ; public CpioArchiveOutputStream ( final OutputStream out , final short format ) { } public CpioArchiveOutputStream ( final OutputStream out ) { } private void ensureOpen ( ) throws IOException { } public void putArchiveEntry ( ArchiveEntry entry ) throws IOException { } private void writeHeader ( final CpioArchiveEntry e ) throws IOException { } private void writeNewEntry ( final CpioArchiveEntry entry ) throws IOException { } private void writeOldAsciiEntry ( final CpioArchiveEntry entry ) throws IOException { } private void writeOldBinaryEntry ( final CpioArchiveEntry entry , final boolean swapHalfWord ) throws IOException { } public void closeArchiveEntry ( ) throws IOException { } public void write ( final byte [ ] b , final int off , final int len ) throws IOException { } public void finish ( ) throws IOException { ensureOpen ( ) ; if ( finished ) { throw new IOException ( "This<seq2seq4repair_space>archive<seq2seq4repair_space>has<seq2seq4repair_space>already<seq2seq4repair_space>been<seq2seq4repair_space>finished" ) ; } if ( ( this . entry ) != null ) { <START_BUG> throw new IOException ( "This<seq2seq4repair_space>archives<seq2seq4repair_space>contains<seq2seq4repair_space>unclosed<seq2seq4repair_space>entries." ) ; <END_BUG> } this . entry = new CpioArchiveEntry ( this . entryFormat ) ; this . entry . setName ( CPIO_TRAILER ) ; this . entry . setNumberOfLinks ( 1 ) ; writeHeader ( this . entry ) ; closeArchiveEntry ( ) ; finished = true ; } public void close ( ) throws IOException { } private void pad ( int count ) throws IOException { } private void writeBinaryLong ( final long number , final int length , final boolean swapHalfWord ) throws IOException { } private void writeAsciiLong ( final long number , final int length , final int radix ) throws IOException { } private void writeCString ( final String str ) throws IOException { } public ArchiveEntry createArchiveEntry ( File inputFile , String entryName ) throws IOException { } }

Fix:
throw new IOException ( "This<seq2seq4repair_space>archive<seq2seq4repair_space>contains<seq2seq4repair_space>unclosed<seq2seq4repair_space>entries." ) ;
Buggy code:
public class TryStatement extends Statement { public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( TryStatement . class , "body" , Block . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildListPropertyDescriptor CATCH_CLAUSES_PROPERTY = new ChildListPropertyDescriptor ( TryStatement . class , "catchClauses" , CatchClause . class , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor FINALLY_PROPERTY = new ChildPropertyDescriptor ( TryStatement . class , "finally" , Block . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Block body = null ; private ASTNode . NodeList catchClauses = new ASTNode . NodeList ( TryStatement . CATCH_CLAUSES_PROPERTY ) ; private Block optionalFinallyBody = null ; TryStatement ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { TryStatement result = new TryStatement ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . copyLeadingComment ( this ) ; result . setBody ( ( ( Block ) ( getBody ( ) . clone ( target ) ) ) ) ; result . catchClauses ( ) . addAll ( ASTNode . copySubtrees ( target , catchClauses ( ) ) ) ; result . setFinally ( ( ( Block ) ( ASTNode . copySubtree ( target , getFinally ( ) ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Block getBody ( ) { } public void setBody ( Block body ) { } public List catchClauses ( ) { } public Block getFinally ( ) { } public void setFinally ( Block block ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class ScriptDefBase extends Task implements DynamicConfigurator { private Map nestedElementMap = new HashMap ( ) ; private Map attributes = new HashMap ( ) ; public void execute ( ) { <START_BUG> getScript ( ) . executeScript ( attributes , nestedElementMap ) ; <END_BUG> } private ScriptDef getScript ( ) { } public Object createDynamicElement ( String name ) { } public void setDynamicAttribute ( String name , String value ) { } }

Fix:
getScript ( ) . executeScript ( attributes , nestedElementMap , this ) ;
Buggy code:
public class CmpEntityBeanHomeRemoveInterceptorFactory extends EntityBeanHomeRemoveInterceptorFactory { public CmpEntityBeanHomeRemoveInterceptorFactory ( Method ejbRemove ) { } protected void afterRemove ( final EntityBeanComponentInstance instance ) throws RemoteException , RemoveException { final CmpEntityBeanComponentInstance cmpInstance = CmpEntityBeanComponentInstance . class . cast ( instance ) ; <START_BUG> cmpInstance . getComponent ( ) . getStoreManager ( ) . removeEntity ( cmpInstance . getEntityContext ( ) ) ; <END_BUG> super . afterRemove ( instance ) ; } }

Fix:
cmpInstance . getComponent ( ) . getStoreManager ( ) . removeEntity ( cmpInstance . getEjbContext ( ) ) ;
Buggy code:
public class AimAndShootWithVision extends Command { private NetworkTable ntserver = NetworkTable . getTable ( "SmartDashboard" ) ; private int step ; private boolean isComplete ; private final double ImageW = 640 ; private final double ImageH = 360 ; private final double FoV = 68.5 ; private final double CameraPivotHeight = 0.3 ; private final double CameraArmLength = 0.7 ; private final double TargetHeight = 8.0 * 0.3048 ; private final double G = 9.801 ; private final double Vfire = 15.0 ; private double aspect ; private double vFoV ; private double Vfire2 ; private final double turnTolerance = 0.15 ; private final double turnDegreesToSpeedScale = 30.0 ; private double targetHeading ; private double currentHeading ; private final double elevTolerance = 0.15 ; private final double elevDegreesToSpeedScale = 30.0 ; private double targetElevation ; private double currentElevation ; public AimAndShootWithVision ( ) { } @ Override protected void initialize ( ) { } @ Override protected void execute ( ) { switch ( step ) { case 0 : if ( updateVision ( ) ) { ( step ) ++ ; } break ; case 1 : { boolean turnComplete = updateTurn ( ) ; boolean elevComplete = updateElevation ( ) ; if ( turnComplete && elevComplete ) { if ( updateVision ( ) ) { ( step ) ++ ; } } } break ; case 2 : { boolean turnComplete = updateTurn ( ) ; boolean elevComplete = updateElevation ( ) ; if ( turnComplete && elevComplete ) { ( step ) ++ ; } } break ; case 3 : <START_BUG> if ( shooter . IsCocked ( ) ) { <END_BUG> shooter . retractPin ( ) ; isComplete = true ; ( step ) ++ ; } break ; } } protected boolean updateVision ( ) { } private void Turn ( double firingAngle ) { } private boolean updateTurn ( ) { } private void Elevate ( double firingAngle ) { } private boolean updateElevation ( ) { } @ Override protected boolean isFinished ( ) { } @ Override protected void end ( ) { } @ Override protected void interrupted ( ) { } }

Fix:
if ( shooter . isCocked ( ) ) {
Buggy code:
public class DatasourcesSubsystemTestCase extends AbstractSubsystemBaseTest { public DatasourcesSubsystemTestCase ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { <START_BUG> return "<subsystem<seq2seq4repair_space>xmlns=\"urn:jboss:domain:datasources:1.0\">" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<seq2seq4repair_space><datasources>" + "<seq2seq4repair_space><datasource<seq2seq4repair_space>jndi-name=\"java:jboss//datasources//ExampleDS\"<seq2seq4repair_space>use-java-context=\"true\"<seq2seq4repair_space>pool-name=\"H2DS\">" ) + "<seq2seq4repair_space><connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1<//connection-url>" ) + "<seq2seq4repair_space><driver>h2<//driver>" ) + "<seq2seq4repair_space><security>" ) + "<seq2seq4repair_space><user-name>sa<//user-name>" ) + "<seq2seq4repair_space><password>sa<//password>" ) + "<seq2seq4repair_space><//security>" ) + "<seq2seq4repair_space><//datasource>" ) + "<seq2seq4repair_space><drivers>" ) + "<seq2seq4repair_space><driver<seq2seq4repair_space>name=\"h2\"<seq2seq4repair_space>module=\"com.h2database.h2\">" ) + "<seq2seq4repair_space><xa-datasource-class>org.h2.jdbcx.JdbcDataSource<//xa-datasource-class>" ) + "<seq2seq4repair_space><//driver>" ) + "<seq2seq4repair_space><//drivers>" ) + "<seq2seq4repair_space><//datasources>" ) + "<//subsystem>" ) ; <END_BUG> } protected AdditionalInitialization createAdditionalInitialization ( ) { } }

Fix:
return "<subsystem<seq2seq4repair_space>xmlns=\"urn:jboss:domain:datasources:1.1\">" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<seq2seq4repair_space><datasources>" + "<seq2seq4repair_space><datasource<seq2seq4repair_space>jndi-name=\"java:jboss//datasources//ExampleDS\"<seq2seq4repair_space>use-java-context=\"true\"<seq2seq4repair_space>pool-name=\"H2DS\">" ) + "<seq2seq4repair_space><connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1<//connection-url>" ) + "<seq2seq4repair_space><driver>h2<//driver>" ) + "<seq2seq4repair_space><security>" ) + "<seq2seq4repair_space><user-name>sa<//user-name>" ) + "<seq2seq4repair_space><password>sa<//password>" ) + "<seq2seq4repair_space><//security>" ) + "<seq2seq4repair_space><//datasource>" ) + "<seq2seq4repair_space><drivers>" ) + "<seq2seq4repair_space><driver<seq2seq4repair_space>name=\"h2\"<seq2seq4repair_space>module=\"com.h2database.h2\">" ) + "<seq2seq4repair_space><xa-datasource-class>org.h2.jdbcx.JdbcDataSource<//xa-datasource-class>" ) + "<seq2seq4repair_space><//driver>" ) + "<seq2seq4repair_space><//drivers>" ) + "<seq2seq4repair_space><//datasources>" ) + "<//subsystem>" ) ;
Buggy code:
public abstract class AbstractServicePublicationTest extends TestCase implements RemoteServicePublication , IDistributionConstants { protected IContainer container ; protected String [ ] ifaces ; protected ServiceRegistration registration ; protected abstract IContainer createContainer ( ) throws Exception { } protected abstract String [ ] createInterfaces ( ) throws Exception { } protected ServiceReference reference ; public ServiceReference getReference ( ) { } protected void setUp ( ) throws Exception { } void removeFromContainerManager ( IContainer container ) { } protected void tearDown ( ) throws Exception { } public IContainer getContainer ( ) { } public String [ ] getInterfaces ( ) { } public void setContainer ( IContainer container ) { } public void testServicePublication ( ) throws InterruptedException , InvalidSyntaxException { final BundleContext context = Activator . getDefault ( ) . getContext ( ) ; final Dictionary props = new Hashtable ( ) ; props . put ( SERVICE_EXPORTED_INTERFACES , getInterfaces ( ) ) ; final ServiceTracker tracker = new ServiceTracker ( context , TestServiceInterface1 . class . getName ( ) , null ) ; <START_BUG> tracker . open ( ) ; <END_BUG> registration = context . registerService ( TestServiceInterface1 . class . getName ( ) , new TestService1 ( ) , props ) ; tracker . waitForService ( 10000 ) ; final ServiceReference [ ] refs = context . getServiceReferences ( ServicePublication . class . getName ( ) , null ) ; assertTrue ( ( refs != null ) ) ; for ( int i = 0 ; i < ( refs . length ) ; i ++ ) { ServiceReference ref = refs [ i ] ; final Object o = ref . getProperty ( SERVICE_INTERFACE_NAME ) ; assertTrue ( ( o instanceof Collection ) ) ; final Collection refIfaces = ( ( Collection ) ( o ) ) ; if ( Arrays . equals ( getInterfaces ( ) , ( ( String [ ] ) ( refIfaces . toArray ( new String [ ] { } ) ) ) ) ) { return ; } } fail ( "registered<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>found." ) ; } public void setInterfaces ( String [ ] interfaces ) { } }

Fix:
tracker . open ( true ) ;
Buggy code:
public class IndexTaskTest extends TestCase { private static final String docHandler = "org.apache.lucene.ant.FileExtensionDocumentHandler" ; private String docsDir = System . getProperty ( "docs.dir" ) ; private String indexDir = System . getProperty ( "index.dir" ) ; private Searcher searcher ; private Analyzer analyzer ; public void setUp ( ) throws Exception { } public void testSearch ( ) throws Exception { <START_BUG> Query query = QueryParser . parse ( "test" , "contents" , analyzer ) ; <END_BUG> Hits hits = searcher . search ( query ) ; assertEquals ( "Find<seq2seq4repair_space>document(s)" , 2 , hits . length ( ) ) ; } public void tearDown ( ) throws IOException { } }

Fix:
Query query = new org . apache . lucene . queryParser . QueryParser ( "contents" , analyzer ) . parse ( "test" ) ;
Buggy code:
public class ModClusterDefinition extends SimpleResourceDefinition { public static final SimpleAttributeDefinition PORT = SimpleAttributeDefinitionBuilder . create ( CommonAttributes . PORT , INT , false ) . setFlags ( RESTART_ALL_SERVICES ) . setStorageRuntime ( ) . build ( ) ; public static final SimpleAttributeDefinition HOST = SimpleAttributeDefinitionBuilder . create ( CommonAttributes . HOST , STRING , false ) . setFlags ( RESTART_ALL_SERVICES ) . setStorageRuntime ( ) . build ( ) ; public static final SimpleAttributeDefinition VIRUTAL_HOST = SimpleAttributeDefinitionBuilder . create ( CommonAttributes . VIRUTAL_HOST , STRING , false ) . addFlag ( RESTART_ALL_SERVICES ) . setStorageRuntime ( ) . build ( ) ; public static final SimpleAttributeDefinition CONTEXT = SimpleAttributeDefinitionBuilder . create ( CommonAttributes . CONTEXT , STRING , false ) . setFlags ( RESTART_ALL_SERVICES ) . setStorageRuntime ( ) . build ( ) ; public static final SimpleAttributeDefinition WAIT_TIME = SimpleAttributeDefinitionBuilder . create ( CommonAttributes . WAIT_TIME , INT , true ) . setFlags ( RESTART_ALL_SERVICES ) . setStorageRuntime ( ) . build ( ) ; private final boolean runtimeOnly ; protected ModClusterDefinition ( boolean runtimeOnly ) { } @ Override public void registerOperations ( ManagementResourceRegistration registration ) { super . registerOperations ( registration ) ; <START_BUG> registration . registerOperationHandler ( DESCRIBE , INSTANCE , INSTANCE , false , PRIVATE ) ; <END_BUG> if ( runtimeOnly ) { registerRuntimeOperations ( registration ) ; } } public void registerRuntimeOperations ( ManagementResourceRegistration registration ) { } }

Fix:
registration . registerOperationHandler ( DEFINITION , INSTANCE ) ;
Buggy code:
public final class PrependContextPathHandler extends AbstractMarkupFilter { private static final Log log = LogFactory . getLog ( PrependContextPathHandler . class ) ; private static final String [ ] attributeNames = new String [ ] { "href" , "src" } ; private final Application application ; public PrependContextPathHandler ( Application application ) { } public MarkupElement nextTag ( ) throws ParseException { final ComponentTag tag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ; if ( ( tag == null ) || ( ( tag . getId ( ) ) != null ) ) { return tag ; } if ( ( tag . getId ( ) ) != null ) { return tag ; } String contextPath = application . getApplicationSettings ( ) . getContextPath ( ) ; if ( contextPath == null ) { contextPath = "" ; } else if ( ( contextPath . endsWith ( "//" ) ) == false ) { contextPath += "//" ; } if ( ( contextPath . length ( ) ) > 0 ) { for ( int i = 0 ; i < ( PrependContextPathHandler . attributeNames . length ) ; i ++ ) { String attrName = PrependContextPathHandler . attributeNames [ i ] ; String attrValue = tag . getAttributes ( ) . getString ( attrName ) ; <START_BUG> if ( ( ( attrValue != null ) && ( ( attrValue . startsWith ( "//" ) ) == false ) ) && ( ( attrValue . indexOf ( ":" ) ) < 0 ) ) { <END_BUG> String url = contextPath + attrValue ; tag . getAttributes ( ) . put ( attrName , url ) ; tag . setModified ( true ) ; } } } return tag ; } }

Fix:
if ( ( ( ( attrValue != null ) && ( ( attrValue . startsWith ( "//" ) ) == false ) ) && ( ( attrValue . indexOf ( ":" ) ) < 0 ) ) && ( ! ( attrValue . startsWith ( "#" ) ) ) ) {
Buggy code:
public class RPCID extends URIID { private static final long serialVersionUID = - 713344242499901489L ; public RPCID ( Namespace namespace , URI uri ) { } public String toString ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( "XMLRPCID[" ) ; <END_BUG> sb . append ( getName ( ) ) . append ( "]" ) ; return sb . toString ( ) ; } }

Fix:
StringBuffer sb = new StringBuffer ( "XmlRpcId[" ) ;
Buggy code:
public class QuickResponseService extends MasterSecretIntentService { private static final String TAG = QuickResponseService . class . getSimpleName ( ) ; public QuickResponseService ( ) { } @ Override protected void onHandleIntent ( Intent intent , @ Nullable MasterSecret masterSecret ) { if ( ! ( ACTION_RESPOND_VIA_MESSAGE . equals ( intent . getAction ( ) ) ) ) { Log . w ( QuickResponseService . TAG , ( "Received<seq2seq4repair_space>unknown<seq2seq4repair_space>intent:<seq2seq4repair_space>" + ( intent . getAction ( ) ) ) ) ; return ; } if ( masterSecret == null ) { Log . w ( QuickResponseService . TAG , "Got<seq2seq4repair_space>quick<seq2seq4repair_space>response<seq2seq4repair_space>request<seq2seq4repair_space>when<seq2seq4repair_space>locked..." ) ; Toast . makeText ( this , QuickResponseService_quick_response_unavailable_when_TextSecure_is_locked , LENGTH_LONG ) . show ( ) ; return ; } try { Rfc5724Uri uri = new Rfc5724Uri ( intent . getDataString ( ) ) ; String content = intent . getStringExtra ( EXTRA_TEXT ) ; String numbers = uri . getPath ( ) ; if ( numbers . contains ( "%" ) ) { numbers = URLDecoder . decode ( numbers ) ; } <START_BUG> Recipients recipients = RecipientFactory . getRecipientsFromString ( this , uri . getPath ( ) , false ) ; <END_BUG> if ( ! ( TextUtils . isEmpty ( content ) ) ) { if ( recipients . isSingleRecipient ( ) ) { MessageSender . send ( this , masterSecret , new org . thoughtcrime . securesms . sms . OutgoingTextMessage ( recipients , content ) , ( - 1 ) , false ) ; } else { MessageSender . send ( this , masterSecret , new org . thoughtcrime . securesms . mms . OutgoingMediaMessage ( this , recipients , new SlideDeck ( ) , content , DistributionTypes . DEFAULT ) , ( - 1 ) , false ) ; } } } catch ( URISyntaxException e ) { Toast . makeText ( this , QuickResponseService_problem_sending_message , LENGTH_LONG ) . show ( ) ; Log . w ( QuickResponseService . TAG , e ) ; } } }

Fix:
Recipients recipients = RecipientFactory . getRecipientsFromString ( this , numbers , false ) ;
Buggy code:
public class Block extends Statement { public Statement [ ] statements ; public int explicitDeclarations ; public BlockScope scope ; public Block ( int explicitDeclarations ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public static final Block EmptyWith ( int sourceStart , int sourceEnd ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public boolean isEmptyBlock ( ) { } public void resolve ( BlockScope upperScope ) { } public void resolveUsing ( BlockScope givenScope ) { } public String toString ( int tab ) { } public String toStringStatements ( int tab ) { if ( ( this . statements ) == null ) return "" ; StringBuffer buffer = new StringBuffer ( ) ; for ( int i = 0 ; i < ( statements . length ) ; i ++ ) { buffer . append ( statements [ i ] . toString ( ( tab + 1 ) ) ) ; <START_BUG> if ( ( statements [ i ] ) instanceof Block ) { <END_BUG> buffer . append ( "\n" ) ; } else { buffer . append ( ";\n" ) ; } } return buffer . toString ( ) ; } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } public void branchChainTo ( Label label ) { } }

Fix:
if ( ( ( statements [ i ] ) instanceof Block ) || ( ( statements [ i ] ) instanceof EmptyStatement ) ) {
Buggy code:
public class VampireEntityEventHandler { @ SubscribeEvent public void onEntityConstructing ( EntityConstructing event ) { } @ SubscribeEvent public void onEntityJoinWorld ( EntityJoinWorldEvent event ) { if ( ( event . entity ) instanceof EntityVampireHunter ) { EntityVampireHunter e = ( ( EntityVampireHunter ) ( event . entity ) ) ; if ( ( e . isLookingForHome ( ) ) == false ) return ; Village v = event . world . villageCollectionObj . findNearestVillage ( MathHelper . floor_double ( e . posX ) , MathHelper . floor_double ( e . posY ) , MathHelper . floor_double ( e . posZ ) , 20 ) ; if ( v != null ) { int r = v . getVillageRadius ( ) ; AxisAlignedBB box = AxisAlignedBB . getBoundingBox ( ( ( v . getCenter ( ) . posX ) - r ) , 0 , ( ( v . getCenter ( ) . posZ ) - r ) , ( ( v . getCenter ( ) . posX ) + r ) , event . world . getActualHeight ( ) , ( ( v . getCenter ( ) . posZ ) + r ) ) ; ChunkCoordinates cc = v . getCenter ( ) ; e . setHomeArea ( cc . posX , cc . posY , cc . posZ , r ) ; e . setFoundHome ( ) ; } } else if ( ( event . entity ) instanceof EntityIronGolem ) { EntityIronGolem golem = ( ( EntityIronGolem ) ( event . entity ) ) ; EntityAITasks targetTasks = ( ( EntityAITasks ) ( Reflection . getPrivateFinalField ( EntityLiving . class , golem , "targetTasks" ) ) ) ; if ( targetTasks == null ) { Logger . w ( "VampireEntityEventHandler" , "Cannot<seq2seq4repair_space>change<seq2seq4repair_space>the<seq2seq4repair_space>target<seq2seq4repair_space>tasks<seq2seq4repair_space>of<seq2seq4repair_space>irongolem" ) ; } else { for ( Object o : targetTasks . taskEntries ) { EntityAIBase t = ( ( EntityAITasks . EntityAITaskEntry ) ( o ) ) . action ; if ( t instanceof EntityAINearestAttackableTarget ) { targetTasks . removeTask ( t ) ; targetTasks . addTask ( 3 , new EntityAINearestAttackableTarget ( golem , EntityLiving . class , 0 , false , true , new IEntitySelector ( ) { @ Override public boolean isEntityApplicable ( Entity entity ) { if ( ( entity instanceof IMob ) && ( ! ( entity instanceof EntityVampireHunter ) ) ) { return true ; } return false ; } } ) ) ; break ; } } } } else if ( ( event . entity ) instanceof EntityCreeper ) { EntityCreeper creeper = ( ( EntityCreeper ) ( event . entity ) ) ; <START_BUG> EntityAITasks tasks = ( ( EntityAITasks ) ( Reflection . getPrivateFinalField ( EntityLiving . class , creeper , "tasks" ) ) ) ; <END_BUG> if ( tasks == null ) { Logger . w ( "VampireEntityEventHandler" , "Cannot<seq2seq4repair_space>change<seq2seq4repair_space>the<seq2seq4repair_space>target<seq2seq4repair_space>tasks<seq2seq4repair_space>of<seq2seq4repair_space>creeper" ) ; } else { tasks . addTask ( 3 , new EntityAIAvoidVampirePlayer ( creeper , 12.0F , 1.0 , 1.2 , BALANCE . VAMPIRE_PLAYER_CREEPER_AVOID_LEVEL ) ) ; } } } }

Fix:
EntityAITasks tasks = ( ( EntityAITasks ) ( Reflection . getPrivateFinalField ( EntityLiving . class , ( ( EntityLiving ) ( creeper ) ) , "tasks" ) ) ) ;
Buggy code:
public class BananaForestWell extends BananaWellArchetype { private OctaveGenerator l1 ; private OctaveGenerator l2 ; public BananaForestWell ( World world , long seed , int wellX , int wellZ ) { } @ Override public void generateChunk ( ByteChunk chunk , int chunkX , int chunkZ ) { double y ; double sh ; int highest ; for ( int x = 0 ; x < 16 ; x ++ ) { int noiseX = getNoiseValue ( chunkX , x ) ; for ( int z = 0 ; z < 16 ; z ++ ) { int noiseZ = getNoiseValue ( chunkZ , z ) ; y = l1 . noise ( noiseX , noiseZ , 7 , 1 ) ; <START_BUG> double my = l1 . noise ( ( noiseX // 2 ) , ( noiseZ // 2 ) , 7 , 1 ) ; <END_BUG> sh = l2 . noise ( noiseX , noiseZ , 7 , 1 ) ; double ry = 1 - my ; int ht = ( ( int ) ( ( ry * 4 ) + 64 ) ) ; chunk . setBlocks ( x , 1 , ( ht - 10 ) , z , byteStone ) ; chunk . setBlocks ( x , ( ht - 10 ) , ht , z , byteStone ) ; chunk . setBlock ( x , ht , z , byteGrass ) ; int dx = ( ( int ) ( y * 100 ) ) // 20 ; int dsh = ( ( int ) ( sh * 100 ) ) // 10 ; highest = ( ( int ) ( ( dx + ( dsh * 2 ) ) + 80 ) ) ; if ( y > 0.6 ) { chunk . setBlocks ( x , ht , highest , z , byteLog ) ; chunk . setBlocks ( x , highest , ( highest + 5 ) , z , byteLeaves ) ; } else if ( y >= 0 ) { double u = l1 . noise ( ( noiseX + 1 ) , noiseZ , 7 , 1 ) ; double d = l1 . noise ( ( noiseX - 1 ) , noiseZ , 7 , 1 ) ; double l = l1 . noise ( noiseX , ( noiseZ + 1 ) , 7 , 1 ) ; double r = l1 . noise ( noiseX , ( noiseZ - 1 ) , 7 , 1 ) ; double ul = l1 . noise ( ( noiseX + 1 ) , ( noiseZ + 1 ) , 7 , 1 ) ; double ur = l1 . noise ( ( noiseX + 1 ) , ( noiseZ - 1 ) , 7 , 1 ) ; double dl = l1 . noise ( ( noiseX - 1 ) , ( noiseZ + 1 ) , 7 , 1 ) ; double dr = l1 . noise ( ( noiseX - 1 ) , ( noiseZ - 1 ) , 7 , 1 ) ; double uu = l1 . noise ( ( noiseX + 2 ) , noiseZ , 7 , 1 ) ; double dd = l1 . noise ( ( noiseX - 2 ) , noiseZ , 7 , 1 ) ; double ll = l1 . noise ( noiseX , ( noiseZ + 2 ) , 7 , 1 ) ; double rr = l1 . noise ( noiseX , ( noiseZ - 2 ) , 7 , 1 ) ; if ( ( ( ( ( ( ( ( ( ( ( ( u > 0.6 ) || ( d > 0.6 ) ) || ( l > 0.6 ) ) || ( r > 0.6 ) ) || ( ul > 0.6 ) ) || ( ur > 0.6 ) ) || ( dl > 0.6 ) ) || ( dr > 0.6 ) ) || ( uu > 0.6 ) ) || ( dd > 0.6 ) ) || ( ll > 0.6 ) ) || ( rr > 0.6 ) ) { for ( int i = 80 - ( ( Math . abs ( ( 80 - highest ) ) ) // 2 ) ; i < highest ; i ++ ) chunk . setBlock ( x , i , z , byteLeaves ) ; for ( int i = highest ; i < ( highest + 5 ) ; i ++ ) chunk . setBlock ( x , i , z , byteLeaves ) ; } } } } } @ Override public void populateBlocks ( Chunk chunk , int chunkX , int chunkZ ) { } @ Override protected void calculateMaterials ( ) { } }

Fix:
double my = l1 . noise ( ( noiseX // 2.0 ) , ( noiseZ // 2.0 ) , 7 , 1 ) ;
Buggy code:
public class MParse extends Task { private Path classpath = null ; private Path sourcepath = null ; private File metahome = null ; private File target = null ; private boolean verbose = false ; private boolean debugparser = false ; private boolean debugscanner = false ; private boolean cleanup = false ; private CommandlineJava cmdl = new CommandlineJava ( ) ; private File optionsFile = null ; public void setMetamatahome ( File metamatahome ) { } public void setTarget ( File target ) { } public Path createClasspath ( ) { } public Path createSourcepath ( ) { } public void setVerbose ( boolean flag ) { } public void setDebugscanner ( boolean flag ) { } public void setDebugparser ( boolean flag ) { } public void setCleanup ( boolean value ) { } public Argument createJvmarg ( ) { } public void setMaxmemory ( String max ) { } public MParse ( ) { } public void execute ( ) throws BuildException { } protected ExecuteStreamHandler createStreamHandler ( ) { } protected void setUp ( ) throws BuildException { } protected void _execute ( ExecuteStreamHandler handler ) throws BuildException { String pathname = target . getAbsolutePath ( ) ; int pos = ( pathname . length ( ) ) - ( ".jj" . length ( ) ) ; pathname = ( pathname . substring ( 0 , pos ) ) + ".java" ; File javaFile = new File ( pathname ) ; if ( ( javaFile . exists ( ) ) && ( ( target . lastModified ( ) ) < ( javaFile . lastModified ( ) ) ) ) { project . log ( ( ( "Target<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>build<seq2seq4repair_space>-<seq2seq4repair_space>skipping<seq2seq4repair_space>(" + ( target ) ) + ")" ) ) ; return ; } final Execute process = new Execute ( handler ) ; <START_BUG> log ( cmdl . toString ( ) , MSG_VERBOSE ) ; <END_BUG> process . setCommandline ( cmdl . getCommandline ( ) ) ; try { if ( ( process . execute ( ) ) != 0 ) { throw new BuildException ( "Metamata<seq2seq4repair_space>task<seq2seq4repair_space>failed." ) ; } } catch ( IOException e ) { throw new BuildException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>launch<seq2seq4repair_space>Metamata<seq2seq4repair_space>task:<seq2seq4repair_space>" + e ) ) ; } } protected void cleanUp ( ) { } protected File [ ] getMetamataLibs ( ) { } protected void checkOptions ( ) throws BuildException { } protected String [ ] getOptions ( ) { } protected void generateOptionsFile ( File tofile , String [ ] options ) throws BuildException { } protected static final File createTmpFile ( ) { } }

Fix:
log ( cmdl . describeCommand ( ) , MSG_VERBOSE ) ;
Buggy code:
public class JarDeploymentActivator implements ServiceActivator { public static final long JAR_DEPLOYMENT_CHAIN_PRIORITY = 1000000L ; public static final ServiceName JAR_DEPLOYMENT_CHAIN_SERVICE_NAME = SERVICE_NAME . append ( "jar" ) ; public void activate ( final ServiceActivatorContext context ) { } private < T extends DeploymentUnitProcessor > void addDeploymentProcessor ( final BatchBuilder batchBuilder , final T deploymentUnitProcessor , final long priority ) { final DeploymentUnitProcessorService < T > deploymentUnitProcessorService = new DeploymentUnitProcessorService < T > ( deploymentUnitProcessor ) ; <START_BUG> batchBuilder . addService ( DEPLOYMENT_PROCESSOR_SERVICE_NAME . append ( deploymentUnitProcessor . getClass ( ) . getName ( ) ) , deploymentUnitProcessorService ) . addDependency ( JarDeploymentActivator . JAR_DEPLOYMENT_CHAIN_SERVICE_NAME , DeploymentChain . class , new DeploymentChainProcessorInjector < T > ( deploymentUnitProcessorService , priority ) ) ; <END_BUG> } }

Fix:
batchBuilder . addService ( JarDeploymentActivator . JAR_DEPLOYMENT_CHAIN_SERVICE_NAME . append ( deploymentUnitProcessor . getClass ( ) . getName ( ) ) , deploymentUnitProcessorService ) . addDependency ( JarDeploymentActivator . JAR_DEPLOYMENT_CHAIN_SERVICE_NAME , DeploymentChain . class , new DeploymentChainProcessorInjector < T > ( deploymentUnitProcessorService , priority ) ) ;
Buggy code:
public class ReportTreeListener implements KeyListener , MouseListener , MouseMotionListener , TreeSelectionListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private TreePath currentPath ; private ActionListener actionHandler ; private ReportTreeModel model ; private JTree tree ; private boolean dragging = false ; private ReportTreeNode [ ] draggedNodes ; private JLabel dragIcon = new JLabel ( JMeterUtils . getImage ( "leafnode.gif" ) ) ; public ReportTreeListener ( ReportTreeModel model ) { } public ReportTreeListener ( ) { } public void setModel ( ReportTreeModel m ) { } public void setActionHandler ( ActionListener ah ) { } public void setJTree ( JTree tree ) { } public void setEndWindow ( Container window ) { } public JTree getJTree ( ) { } public ReportTreeNode getCurrentNode ( ) { } public ReportTreeNode [ ] getSelectedNodes ( ) { } public TreePath removedSelectedNode ( ) { } public void valueChanged ( TreeSelectionEvent e ) { } public void mouseClicked ( MouseEvent ev ) { } public void mouseReleased ( MouseEvent e ) { } public ReportTreeNode [ ] getDraggedNodes ( ) { } private boolean isValidDragAction ( ReportTreeNode [ ] source , ReportTreeNode dest ) { } public void mouseEntered ( MouseEvent e ) { } private void changeSelectionIfDragging ( MouseEvent e ) { } private boolean contains ( Object [ ] container , Object item ) { } public void mousePressed ( MouseEvent e ) { ReportMainFrame mainFrame = ReportGuiPackage . getInstance ( ) . getMainFrame ( ) ; mainFrame . closeMenu ( ) ; int selRow = tree . getRowForLocation ( e . getX ( ) , e . getY ( ) ) ; if ( ( tree . getPathForLocation ( e . getX ( ) , e . getY ( ) ) ) != null ) { ReportTreeListener . log . debug ( "mouse<seq2seq4repair_space>pressed,<seq2seq4repair_space>updating<seq2seq4repair_space>currentPath" ) ; currentPath = tree . getPathForLocation ( e . getX ( ) , e . getY ( ) ) ; } if ( selRow != ( - 1 ) ) { if ( isRightClick ( e ) ) { if ( ( tree . getSelectionCount ( ) ) < 2 ) { tree . setSelectionPath ( currentPath ) ; } <START_BUG> if ( ( getCurrentNode ( ) ) instanceof ReportTreeNode ) { <END_BUG> ReportTreeListener . log . debug ( "About<seq2seq4repair_space>to<seq2seq4repair_space>display<seq2seq4repair_space>pop-up" ) ; displayPopUp ( e ) ; } } } } public void mouseDragged ( MouseEvent e ) { } public void mouseMoved ( MouseEvent e ) { } public void mouseExited ( MouseEvent ev ) { } public void keyPressed ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } public void keyTyped ( KeyEvent e ) { } private boolean isRightClick ( MouseEvent e ) { } private void displayPopUp ( MouseEvent e ) { } private void displayPopUp ( MouseEvent e , JPopupMenu popup ) { } }

Fix:
if ( ( getCurrentNode ( ) ) != null ) {
Buggy code:
@ Controller public class FileUploadController { @ Autowired private UserRepository userRepository ; @ Autowired private FileRepository fileRepository ; @ Autowired private OwnRepository ownRepository ; @ Autowired private ChargeRepository chargeRepository ; @ RequestMapping ( value = "//upload" , method = RequestMethod . GET ) public String DisplayForm ( ) { } @ RequestMapping ( value = "//savefiles" , method = RequestMethod . POST ) public String Save ( @ ModelAttribute ( "uploadForm" ) FileUpload uploadForm , Model map ) throws IOException , IllegalStateException { String currentWorkdirectory = System . getProperty ( "user.dir" ) ; String saveDirectory = currentWorkdirectory + "//upload//" ; File saveDirec = new File ( saveDirectory ) ; if ( ! ( saveDirec . exists ( ) ) ) { saveDirec . mkdirs ( ) ; } List < MultipartFile > Files = uploadForm . getFiles ( ) ; List < String > fileNames = new ArrayList < String > ( ) ; if ( ( null != Files ) && ( ( Files . size ( ) ) > 0 ) ) { for ( MultipartFile multipartFile : Files ) { String fileName = multipartFile . getOriginalFilename ( ) ; if ( ! ( "" . equalsIgnoreCase ( fileName ) ) ) { addFileToDatabase ( multipartFile ) ; multipartFile . transferTo ( new File ( ( saveDirectory + fileName ) ) ) ; fileNames . add ( fileName ) ; } } } map . addAttribute ( "files" , fileNames ) ; <START_BUG> return "homepage" ; <END_BUG> } private void fileCalcuation ( MultipartFile file , Long userId ) { } private void fileUpdate ( MultipartFile file ) { } private void ownUpdate ( long user_id , String fileName ) { } private void chargeCalculation ( MultipartFile file , Long userId ) { } public void addFileToDatabase ( MultipartFile file ) { } public Long getOnlineUserID ( ) { } No newline ; at end ; of file ; }

Fix:
return "uploadfilesuccess" ;
Buggy code:
public class ServerTest implements Runnable { private Server server ; public ServerTest ( Server s ) { } @ Override public void run ( ) { <START_BUG> while ( ( server . getClientCount ( ) ) < 0 ) { <END_BUG> ThreadHelper . sleep ( 100 ) ; } server . runDownCommandAll ( "setvalue~hi~hi2" ) ; server . runDownCommandAll ( "setvalue~david~bad" ) ; server . runDownCommandAll ( "setvalue~dicksddddd~good" ) ; } }

Fix:
while ( ( server . getClientCount ( ) ) < 1 ) {
Buggy code:
public class ConsultarIptuCampinasTest { private static ConsultarIptuCampinas consultarIptuCampinas ; @ Before public void setBefore ( ) { } private String solveCaptcha ( String name , byte [ ] captchaImage ) { } @ Test public void testConsultaIPTU ( ) { } @ Test public void testConsultaIPTUCodCartograficoInvalido ( ) { } @ Test public void testConsultaIPTUNaoQuitado ( ) { RespostaCaptcha captcha = null ; try { captcha = ConsultarIptuCampinasTest . consultarIptuCampinas . requestCaptcha ( ) ; } catch ( IPTUSPException e ) { Assert . fail ( ( "Exceção<seq2seq4repair_space>requisição<seq2seq4repair_space>de<seq2seq4repair_space>captcha<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } String respCaptcha = solveCaptcha ( "IPTU<seq2seq4repair_space>Campinas" , captcha . getCaptchaImage ( ) ) ; try { String htmlRetorno = ConsultarIptuCampinasTest . consultarIptuCampinas . consultaBoletos ( captcha . getSessionId ( ) , respCaptcha , "3421.41.47.0073.01006" ) ; Assert . assertNotNull ( htmlRetorno ) ; <START_BUG> FileOutputStream fos = new FileOutputStream ( "//home//eduardo//Documents//iptu-cps-devido.html" ) ; <END_BUG> fos . write ( htmlRetorno . getBytes ( ) ) ; fos . close ( ) ; System . out . println ( "Iptu<seq2seq4repair_space>Campinas<seq2seq4repair_space>-<seq2seq4repair_space>quitado<seq2seq4repair_space>salvo." ) ; } catch ( ClientProtocolException e ) { Assert . fail ( e . getMessage ( ) ) ; } catch ( IOException e ) { Assert . fail ( e . getMessage ( ) ) ; } catch ( IPTUSPException e ) { Assert . fail ( e . getMessage ( ) ) ; } } @ Test public void testConsultaIPTUBoletos ( ) { } @ Test public void testConsultaIPTUCampinas ( ) { } }

Fix:
FileOutputStream fos = new FileOutputStream ( ( ( System . getProperty ( "user.home" ) ) + "//Documents//iptu-cps-devido.html" ) ) ;
Buggy code:
public class LetterDistributionDFE extends FeatureExtractorResource_ImplBase implements DocumentFeatureExtractor { public static final String FN_LETTER_RATIO_PREFIX = "LetterRatio_" ; public static final String LETTERS = "abcdefghijklmnopqrstuvwxyzßäöü" ; public List < Feature > extract ( JCas jcas ) throws TextClassificationException { String documentText = jcas . getDocumentText ( ) . toLowerCase ( ) ; HashMap < Character , Double > letterCount = new HashMap < Character , Double > ( ) ; for ( char l : LetterDistributionDFE . LETTERS . toCharArray ( ) ) letterCount . put ( l , 0.0 ) ; double totalLetterCount = 0 ; for ( char l : documentText . toCharArray ( ) ) { if ( letterCount . containsKey ( l ) ) { letterCount . put ( l , ( ( letterCount . get ( l ) ) + 1 ) ) ; <START_BUG> totalLetterCount += 1 ; <END_BUG> } } List < Feature > featList = new ArrayList < Feature > ( ) ; for ( char letter : letterCount . keySet ( ) ) { String letter_str = new String ( new char [ ] { letter } ) ; double countLetter = letterCount . get ( letter ) ; featList . add ( new Feature ( ( ( LetterDistributionDFE . FN_LETTER_RATIO_PREFIX ) + ( letter_str . toUpperCase ( ) ) ) , ( countLetter // totalLetterCount ) ) ) ; } return featList ; } }

Fix:
totalLetterCount ++ ;
Buggy code:
public class MainActivity extends ActionBarActivity { public static final String EXTRA_MESSAGE = "com.wkuglen.myfirstapp.message" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void sendMessage ( View view ) { <START_BUG> Intent intent = new Intent ( this , DisplayMessa ) ; <END_BUG> EditText editText = ( ( EditText ) ( findViewById ( edit_message ) ) ) ; String message = editText . getText ( ) . toString ( ) ; intent . putExtra ( MainActivity . EXTRA_MESSAGE , message ) ; startActivity ( intent ) ; } }

Fix:
Intent intent = new Intent ( this , DisplayMessageActivity . class ) ;
Buggy code:
@ Named @ Stateful @ RequestScoped @ Join ( path = "//workspace//{workspaceUrlName}//materials" , to = "//workspaces//materials.jsf" ) @ LoggedIn public class WorkspaceMaterialsBackingBean { @ Parameter private String workspaceUrlName ; @ Inject private WorkspaceController workspaceController ; @ Inject private WorkspaceMaterialController workspaceMaterialController ; @ Inject @ Named private WorkspaceNavigationBackingBean workspaceNavigationBackingBean ; @ RequestAction public String init ( ) { String urlName = getWorkspaceUrlName ( ) ; if ( StringUtils . isBlank ( urlName ) ) { return NavigationRules . NOT_FOUND ; } WorkspaceEntity workspaceEntity = workspaceController . findWorkspaceEntityByUrlName ( urlName ) ; if ( workspaceEntity == null ) { return NavigationRules . NOT_FOUND ; } rootFolder = workspaceMaterialController . findWorkspaceRootFolderByWorkspaceEntity ( workspaceEntity ) ; workspaceNavigationBackingBean . setWorkspaceUrlName ( urlName ) ; Workspace workspace = workspaceController . findWorkspace ( workspaceEntity ) ; workspaceName = workspace . getName ( ) ; workspaceEntityId = workspaceEntity . getId ( ) ; contentNodes = new ArrayList ( ) ; <START_BUG> List < WorkspaceNode > rootMaterialNodes = workspaceMaterialController . listWorkspaceNodesByParentSortByOrderNumber ( rootFolder ) ; <END_BUG> for ( WorkspaceNode rootMaterialNode : rootMaterialNodes ) { ContentNode node = workspaceMaterialController . createContentNode ( rootMaterialNode ) ; contentNodes . add ( node ) ; } return null ; } public WorkspaceRootFolder getRootFolder ( ) { } public void setRootFolder ( WorkspaceRootFolder rootFolder ) { } public String getWorkspaceUrlName ( ) { } public void setWorkspaceUrlName ( String workspaceUrlName ) { } public String getWorkspaceName ( ) { } public Long getWorkspaceEntityId ( ) { } public void setWorkspaceEntityId ( Long workspaceEntityId ) { } public List < ContentNode > getContentNodes ( ) { } private WorkspaceRootFolder rootFolder ; private List < ContentNode > contentNodes ; private String workspaceName ; private Long workspaceEntityId ; }

Fix:
List < WorkspaceNode > rootMaterialNodes = workspaceMaterialController . listVisibleWorkspaceNodesByParentSortByOrderNumber ( rootFolder ) ;
Buggy code:
@ Controller @ RequestMapping ( "//auth" ) public class AuthController { @ Resource private UserService userService ; @ RequestMapping ( "//login" ) public String index ( Model model ) { } @ RequestMapping ( value = "//register" , method = RequestMethod . POST ) public String register ( @ RequestParam String username , @ RequestParam String password ) { if ( this . getUserService ( ) . existsUser ( ) ) { throw new IllegalStateException ( "Already<seq2seq4repair_space>exists<seq2seq4repair_space>users." ) ; } <START_BUG> this . getUserService ( ) . registerUser ( username , password , "ADMIN" ) ; <END_BUG> return "redirect://auth//logout//" ; } @ RequestMapping ( "//logout" ) public String logout ( ) { } public UserService getUserService ( ) { } }

Fix:
this . getUserService ( ) . registerUser ( username , password ) ;
Buggy code:
public class SSLTest extends BaseJDBCTestCase { private InputStream [ ] _inputStreamHolder ; private NetworkServerTestSetup nsTestSetup ; public SSLTest ( String testName ) { } public static Test suite ( ) { } protected void tearDown ( ) throws Exception { } private static Test decorateTest ( String testName ) { } private static String [ ] getStartupProperties ( ) { } public void testSSLBasicDSConnect ( ) throws Exception { } public void testSSLBasicDSPlainConnect ( ) throws Exception { DataSource ds = JDBCDataSource . getDataSource ( ) ; JDBCDataSource . setBeanProperty ( ds , "createDatabase" , "create" ) ; try { Connection c2 = ds . getConnection ( ) ; c2 . close ( ) ; fail ( ) ; } catch ( SQLException e ) { <START_BUG> assertSQLState ( "58009" , e ) ; <END_BUG> } } }

Fix:
assertSQLState ( "08006" , e ) ;
Buggy code:
public abstract class AbstractPropertyModel < T > implements IChainingModel < T > , IObjectClassAwareModel < T > , IPropertyReflectionAwareModel < T > { private static final Logger logger = LoggerFactory . getLogger ( AbstractPropertyModel . class ) ; private static final long serialVersionUID = 1L ; private Object target ; public AbstractPropertyModel ( final Object modelObject ) { } public void detach ( ) { } public IModel < ? > getChainedModel ( ) { } @ SuppressWarnings ( "unchecked" ) public T getObject ( ) { } public final String getPropertyExpression ( ) { } public void setChainedModel ( IModel < ? > model ) { } @ SuppressWarnings ( "unchecked" ) public void setObject ( T object ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer sb = new StringBuffer ( "Model:classname=[" ) ; <END_BUG> sb . append ( getClass ( ) . getName ( ) ) . append ( "]" ) ; sb . append ( ":nestedModel=[" ) . append ( target ) . append ( "]" ) ; return sb . toString ( ) ; } public final Object getTarget ( ) { } @ SuppressWarnings ( "unchecked" ) public Class < T > getObjectClass ( ) { } public Field getPropertyField ( ) { } public Method getPropertyGetter ( ) { } public Method getPropertySetter ( ) { } protected abstract String propertyExpression ( ) { } }

Fix:
StringBuilder sb = new StringBuilder ( "Model:classname=[" ) ;