nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LevelParser { List < Sprite > tileArray = new ArrayList < Sprite > ( ) ; Map < Character , String > tileMapping = new HashMap < Character , String > ( ) ; Point offset = new Point ( 0 , 0 ) ; Dimension levelSize = new Dimension ( 0 , 0 ) ; Dimension tileSize ; JPanel frame ; public LevelParser ( Dimension tileSize , JPanel frame ) { } public LevelParser ( int w , int h , JPanel applet ) { } public List < Sprite > getTiles ( ) { } public List < Sprite > getTileArray ( ) { } public void setTileArray ( List < Sprite > tileArray ) { } public Map < Character , String > getTileMapping ( ) { } public void setTileMapping ( Map < Character , String > tileMapping ) { } public void setTiles ( List < Sprite > tiles ) { } public Dimension getTileSize ( ) { } public void setTileSize ( Dimension tileSize ) { } public JPanel getApplet ( ) { } public void setApplet ( JPanel applet ) { } public int getTileWidth ( ) { } public void setTileWidth ( int w ) { } public int getTileHeight ( ) { } public void setTileHeight ( int h ) { } public Point getOffset ( ) { } public void setOffset ( Point offset ) { } public Dimension getLevelSize ( ) { } public void setLevelSize ( Dimension levelSize ) { } public void setLevelWidth ( int w ) { } public int getLevelWidth ( ) { } public void setLevelHeight ( int h ) { } public int getLevelHeight ( ) { } public boolean checkCollision ( AstroSprite plyr ) { } public void drawTiles ( Graphics g ) { } public void updateTiles ( ) { } boolean onScreen ( Sprite spr , JPanel applet ) { } public void parseTileMapping ( String filename ) { } public void parseLevel ( String filename ) { } public void parseTiles ( BufferedReader reader ) { } void parseLine ( String line , int count ) { int x = 0 ; int y = count ; for ( int i = 0 ; i < ( line . length ( ) ) ; i ++ ) { char c = line . charAt ( i ) ; Image img = null ; if ( tileMapping . containsKey ( c ) ) { <START_BUG> img = Toolkit . getDefaultToolkit ( ) . getImage ( tileMapping . get ( c ) ) ; <END_BUG> } if ( img != null ) { Sprite s = new Sprite ( new Point ( ( x * ( getTileWidth ( ) ) ) , ( y * ( getTileHeight ( ) ) ) ) , new Dimension ( getTileWidth ( ) , getTileHeight ( ) ) , img ) ; if ( Character . isDigit ( c ) ) s . setCollideable ( false ) ; tileArray . add ( s ) ; } x ++ ; setLevelWidth ( Math . max ( ( x * ( getTileWidth ( ) ) ) , getLevelWidth ( ) ) ) ; setLevelHeight ( Math . max ( ( y * ( getTileHeight ( ) ) ) , getLevelHeight ( ) ) ) ; } } }

Fix:
img = Toolkit . getDefaultToolkit ( ) . getImage ( ( "data//" + ( tileMapping . get ( c ) ) ) ) ;
Buggy code:
public interface IProblemFactory { <START_BUG> IProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] problemArguments , String [ ] messageArguments , int severity , int startPosition , int endPosition , int lineNumber ) ; <END_BUG> Locale getLocale ( ) { } String getLocalizedMessage ( int problemId , String [ ] messageArguments ) { } }

Fix:
CategorizedProblem createProblem ( char [ ] originatingFileName , int problemId , String [ ] problemArguments , String [ ] messageArguments , int severity , int startPosition , int endPosition , int lineNumber ) ;
Buggy code:
public class TestTypeInheritence extends ExternalsTestBase { @ Test public void test_superclasses ( ) throws Exception { compile ( "type_inheritence.js" ) ; ClassReference EventTarget = model . getInterfaceReference ( "EventTarget" ) ; ClassReference Object = model . getClassReference ( "Object" ) ; ClassReference Foo = model . getClassReference ( "Foo" ) ; ClassReference Bar = model . getClassReference ( "Bar" ) ; ClassReference Baz = model . getClassReference ( "Baz" ) ; assertNotNull ( Object ) ; assertNotNull ( EventTarget ) ; assertNotNull ( Foo ) ; assertNotNull ( Bar ) ; assertNotNull ( Baz ) ; assertSame ( EventTarget , Foo . getImplementedInterfaces ( ) . get ( 0 ) ) ; assertSame ( Object , Foo . getSuperClass ( ) ) ; assertSame ( Foo , Bar . getSuperClass ( ) ) ; assertSame ( Bar , Baz . getSuperClass ( ) ) ; List < ClassReference > superClasses = Baz . getSuperClasses ( ) ; assertEquals ( 3 , superClasses . size ( ) ) ; assertSame ( Bar , superClasses . get ( 0 ) ) ; assertSame ( Foo , superClasses . get ( 1 ) ) ; assertSame ( Object , superClasses . get ( 2 ) ) ; <START_BUG> assertTrue ( Foo . hasMethod ( "addEventListener" ) ) ; <END_BUG> String result = client . getEmitter ( ) . emit ( Foo . getInstanceMethod ( "addEventListener" ) ) ; assertEquals ( ( "<seq2seq4repair_space>//**\n<seq2seq4repair_space>" + ( ( ( "*<seq2seq4repair_space>@param<seq2seq4repair_space>opt_useCapture<seq2seq4repair_space>[(boolean|undefined)]<seq2seq4repair_space>\n<seq2seq4repair_space>" + "*<seq2seq4repair_space>@see<seq2seq4repair_space>[type_inheritence]\n<seq2seq4repair_space>*//\n" ) + "<seq2seq4repair_space>public<seq2seq4repair_space>function<seq2seq4repair_space>addEventListener(type:String,<seq2seq4repair_space>listener:Object,<seq2seq4repair_space>useCapture:Boolean):Object<seq2seq4repair_space>//*<seq2seq4repair_space>undefined<seq2seq4repair_space>*//<seq2seq4repair_space>" ) + "{<seq2seq4repair_space>return<seq2seq4repair_space>null;<seq2seq4repair_space>}\n" ) ) , result ) ; } @ Override protected void configure ( ExternCConfiguration config ) throws IOException { } }

Fix:
assertTrue ( Foo . hasInstanceMethod ( "addEventListener" ) ) ;
Buggy code:
public class PrivilegedHandler implements IPrivilegedHandler { private AspectDeclaration inAspect ; private Map accessors = new HashMap ( ) ; public PrivilegedHandler ( AspectDeclaration inAspect ) { } public FieldBinding getPrivilegedAccessField ( FieldBinding baseField , AstNode location ) { } public MethodBinding getPrivilegedAccessMethod ( MethodBinding baseMethod , AstNode location ) { } public void notePrivilegedTypeAccess ( ReferenceBinding type , AstNode location ) { } private void checkWeaveAccess ( TypeX typeX , AstNode location ) { <START_BUG> World world = inAspect . world ; <END_BUG> Lint . Kind check = world . getLint ( ) . typeNotExposedToWeaver ; if ( check . isEnabled ( ) ) { if ( ! ( world . resolve ( typeX ) . isExposedToWeaver ( ) ) ) { ISourceLocation loc = null ; if ( location != null ) { loc = new EclipseSourceLocation ( inAspect . compilationResult , location . sourceStart , location . sourceEnd ) ; } check . signal ( ( ( typeX . getName ( ) ) + "<seq2seq4repair_space>(needed<seq2seq4repair_space>for<seq2seq4repair_space>privileged<seq2seq4repair_space>access)" ) , loc ) ; } } } public ResolvedMember [ ] getMembers ( ) { } }

Fix:
World world = inAspect . world . getWorld ( ) ;
Buggy code:
public class ModClusterSubsystemXMLReader_1_0 implements XMLElementReader < List < ModelNode > > { @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } void parseModClusterConfig ( XMLExtendedStreamReader reader , List < ModelNode > list , PathAddress parent ) throws XMLStreamException { } void parsePropConf ( XMLExtendedStreamReader reader , ModelNode conf ) throws XMLStreamException { } void parseSSL ( XMLExtendedStreamReader reader , List < ModelNode > list , PathAddress parent ) throws XMLStreamException { } void parseSimpleLoadProvider ( XMLExtendedStreamReader reader , ModelNode operation ) throws XMLStreamException { } void parseDynamicLoadProvider ( XMLExtendedStreamReader reader , List < ModelNode > list , PathAddress parent ) throws XMLStreamException { } void parseLoadMetric ( XMLExtendedStreamReader reader , List < ModelNode > list , PathAddress address ) throws XMLStreamException { } static void readProperties ( XMLExtendedStreamReader reader , ModelNode metric ) throws XMLStreamException { } void parseCustomLoadMetric ( XMLExtendedStreamReader reader , List < ModelNode > list , PathAddress address ) throws XMLStreamException { final ModelNode customMetric = new ModelNode ( ) ; final int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case CAPACITY : CAPACITY . parseAndSetParameter ( value , customMetric , reader ) ; break ; case WEIGHT : WEIGHT . parseAndSetParameter ( value , customMetric , reader ) ; break ; case CLASS : CLASS . parseAndSetParameter ( value , customMetric , reader ) ; break ; default : throw unexpectedAttribute ( reader , i ) ; } } <START_BUG> PathElement pe = PathElement . pathElement ( CUSTOM_LOAD_METRIC . getKey ( ) , customMetric . get ( TYPE ) . asString ( ) ) ; <END_BUG> customMetric . get ( OP ) . set ( ADD ) ; customMetric . get ( OP_ADDR ) . set ( address . append ( pe ) . toModelNode ( ) ) ; ModClusterSubsystemXMLReader_1_0 . readProperties ( reader , customMetric ) ; list . add ( customMetric ) ; } }

Fix:
PathElement pe = PathElement . pathElement ( CUSTOM_LOAD_METRIC . getKey ( ) , customMetric . get ( CommonAttributes . CLASS ) . asString ( ) ) ;
Buggy code:
class InvocationCancellationMessageHandler extends AbstractMessageHandler { private static final Logger logger = Logger . getLogger ( InvocationCancellationMessageHandler . class ) ; private final RemoteAsyncInvocationCancelStatusService remoteAsyncInvocationCancelStatus ; InvocationCancellationMessageHandler ( final RemoteAsyncInvocationCancelStatusService asyncInvocationCancelStatus ) { } @ Override public void processMessage ( ChannelAssociation channelAssociation , InputStream inputStream ) throws IOException { final DataInputStream input = new DataInputStream ( inputStream ) ; final short invocationToCancel = input . readShort ( ) ; final CancellationFlag cancellationFlag = this . remoteAsyncInvocationCancelStatus . getCancelStatus ( invocationToCancel ) ; if ( cancellationFlag == null ) { return ; } cancellationFlag . set ( true ) ; <START_BUG> InvocationCancellationMessageHandler . logger . debugf ( "Invocation<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>%s<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>marked<seq2seq4repair_space>as<seq2seq4repair_space>cancelled,<seq2seq4repair_space>as<seq2seq4repair_space>requested" , invocationToCancel ) ; <END_BUG> } }

Fix:
InvocationCancellationMessageHandler . logger . debug ( ( ( "Invocation<seq2seq4repair_space>with<seq2seq4repair_space>id<seq2seq4repair_space>" + invocationToCancel ) + "<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>marked<seq2seq4repair_space>as<seq2seq4repair_space>cancelled,<seq2seq4repair_space>as<seq2seq4repair_space>requested" ) ) ;
Buggy code:
public class Designer extends APosition implements Сontractor { private int hourlyRate ; private double hoursWorked ; private float amountHoursOneInstructions ; public Designer ( String name ) { } @ Override public void setHourlyRate ( int hourlyRate ) { } @ Override public void setAmountHoursOneInstructions ( float amountHoursOneInstructions ) { } @ Override public double calcSalary ( ) { } @ Override public void getToWork ( ) { <START_BUG> hourlyRate += amountHoursOneInstructions ; <END_BUG> } @ Override public double paySalary ( ) { } }

Fix:
hoursWorked += amountHoursOneInstructions ;
Buggy code:
public class TestLatvianAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new LatvianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new LatvianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
class PluginStep extends AbstractStep implements ListSelectionListener { protected DataModel data ; protected MultiLineLabel descriptionLabel ; private ImportPluginHandler pluginHandler ; public PluginStep ( DataModel data ) { } protected JComponent createComponent ( ) { } public void valueChanged ( ListSelectionEvent event ) { try { DefaultMailboxImporter importer = ( ( DefaultMailboxImporter ) ( pluginHandler . getPlugin ( ( ( String ) ( data . getData ( "Plugin.ID" ) ) ) , null ) ) ) ; String description = importer . getDescription ( ) ; descriptionLabel . setText ( description ) ; } catch ( Exception e ) { NotifyDialog d = new NotifyDialog ( ) ; <START_BUG> d . showDialog ( e ) ; <END_BUG> } } public void prepareRendering ( ) { } }

Fix:
d . showDialog ( MailResourceLoader . getString ( "dialog" , "error" , "mailimport" ) ) ;
Buggy code:
public abstract class Request { public static Request method ( Class < ? > clazz , String methodName ) { } public static Request aClass ( Class < ? > clazz ) { } public static Request classes ( String collectionName , Class < ? > ... classes ) { <START_BUG> return new ClassesRequest ( collectionName , classes ) ; <END_BUG> } public static Request errorReport ( Class < ? > klass , Throwable cause ) { } public abstract Runner getRunner ( ) { } public Request filterWith ( Filter filter ) { } public Request filterWith ( final Description desiredDescription ) { } public Request sortWith ( Comparator < Description > comparator ) { } public static Request classWithoutSuiteMethod ( Class < ? > newTestClass ) { } }

Fix:
return new ClassesRequest ( classes ) ;
Buggy code:
public final class WorkbenchActivityHelper { public static final String createUnifiedId ( IPluginContribution contribution ) { } public static final boolean filterItem ( Object object ) { } public static final boolean isFiltering ( ) { IWorkbenchActivitySupport support = ( ( IWorkbenchActivitySupport ) ( PlatformUI . getWorkbench ( ) . getAdapter ( IWorkbenchActivitySupport . class ) ) ) ; if ( support == null ) return false ; <START_BUG> return support . getActivityManager ( ) . getDefinedCategoryIds ( ) . isEmpty ( ) ; <END_BUG> } private WorkbenchActivityHelper ( ) { } }

Fix:
return ! ( support . getActivityManager ( ) . getDefinedCategoryIds ( ) . isEmpty ( ) ) ;
Buggy code:
public class DeleteJmsResourceHandler extends BatchModeCommandHandler { public DeleteJmsResourceHandler ( ) { } @ Override protected void doHandle ( CommandContext ctx ) { } @ Override public ModelNode buildRequest ( CommandContext ctx ) throws OperationFormatException { <START_BUG> if ( ! ( ctx . hasArguments ( ) ) ) { <END_BUG> throw new OperationFormatException ( "Arguments<seq2seq4repair_space>are<seq2seq4repair_space>missing" ) ; } String jndiName = null ; String [ ] args = ctx . getArgumentsString ( ) . split ( "\\s+" ) ; int i = 0 ; while ( i < ( args . length ) ) { String arg = args [ ( i ++ ) ] ; if ( arg . equals ( "--target" ) ) { } else { jndiName = arg ; } } if ( jndiName == null ) { throw new OperationFormatException ( "name<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } ModelControllerClient client = ctx . getModelControllerClient ( ) ; final String resource ; if ( Util . isTopic ( client , jndiName ) ) { resource = "topic" ; } else if ( Util . isQueue ( client , jndiName ) ) { resource = "queue" ; } else if ( Util . isConnectionFactory ( client , jndiName ) ) { resource = "connection-factory" ; } else { throw new OperationFormatException ( ( ( "'" + jndiName ) + "'<seq2seq4repair_space>wasn't<seq2seq4repair_space>found<seq2seq4repair_space>among<seq2seq4repair_space>existing<seq2seq4repair_space>JMS<seq2seq4repair_space>resources." ) ) ; } DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; builder . addNode ( "subsystem" , "jms" ) ; builder . addNode ( resource , jndiName ) ; builder . setOperationName ( "remove" ) ; return builder . buildRequest ( ) ; } }

Fix:
if ( ! ( ctx . getParsedArguments ( ) . hasArguments ( ) ) ) {
Buggy code:
public class BindingAddHandler extends SocketBindingAddHandler { public static final BindingAddHandler INSTANCE = new BindingAddHandler ( ) ; private static final InetAddress ANY_IPV6 ; private BindingAddHandler ( ) { } @ Override protected void populateModel ( final OperationContext context , final ModelNode operation , final Resource resource ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected boolean requiresRuntimeVerification ( ) { } public static ServiceController < SocketBinding > installBindingService ( OperationContext context , ModelNode config , String name ) throws UnknownHostException , OperationFailedException { } public static List < ClientMapping > parseClientMappings ( ModelNode mappings ) throws OperationFailedException { List < ClientMapping > clientMappings = new ArrayList < ClientMapping > ( ) ; for ( ModelNode mappingNode : mappings . asList ( ) ) { ModelNode sourceNode = mappingNode . get ( SOURCE_NETWORK ) ; final InetAddress sourceAddress ; final int mask ; final String destination ; final int port ; if ( sourceNode . isDefined ( ) ) { MaskedAddressValidator . ParsedResult parsedResult = MaskedAddressValidator . parseMasked ( sourceNode ) ; sourceAddress = parsedResult . address ; mask = parsedResult . mask ; } else { sourceAddress = BindingAddHandler . ANY_IPV6 ; mask = 0 ; } ModelNode destinationNode = mappingNode . get ( DESTINATION_ADDRESS ) ; if ( ! ( destinationNode . isDefined ( ) ) ) { <START_BUG> throw new OperationFailedException ( MESSAGES . nullNotAllowed ( DESTINATION_ADDRESS ) ) ; <END_BUG> } destination = destinationNode . asString ( ) ; ModelNode portNode = mappingNode . get ( DESTINATION_PORT ) ; port = ( portNode . isDefined ( ) ) ? portNode . asInt ( ) : - 1 ; clientMappings . add ( new ClientMapping ( sourceAddress , mask , destination , port ) ) ; } return clientMappings ; } }

Fix:
throw MESSAGES . nullNotAllowed ( DESTINATION_ADDRESS ) ;
Buggy code:
public class CodeSnippetSingleNameReference extends SingleNameReference implements InvocationSite , ProblemReasons , EvaluationConstants { EvaluationContext evaluationContext ; FieldBinding delegateThis ; public CodeSnippetSingleNameReference ( char [ ] source , long pos , EvaluationContext evaluationContext ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } public TypeBinding checkFieldAccess ( BlockScope scope ) { if ( ( delegateThis ) == null ) return super . checkFieldAccess ( scope ) ; FieldBinding fieldBinding = ( ( FieldBinding ) ( binding ) ) ; bits &= ~ ( ASTNode . RestrictiveFlagMASK ) ; bits |= FIELD ; if ( ! ( fieldBinding . isStatic ( ) ) ) { if ( this . evaluationContext . isStatic ) { scope . problemReporter ( ) . staticFieldAccessToNonStaticVariable ( this , fieldBinding ) ; constant = NotAConstant ; return null ; } } <START_BUG> constant = org . eclipse . jdt . internal . compiler . ast . FieldReference . getConstantFor ( fieldBinding , true , this , 0 ) ; <END_BUG> if ( isFieldUseDeprecated ( fieldBinding , scope ) ) scope . problemReporter ( ) . deprecatedField ( fieldBinding , this ) ; return fieldBinding . type ; } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , MethodBinding writeAccessor , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public void generateReceiver ( CodeStream codeStream ) { } public TypeBinding getReceiverType ( BlockScope currentScope ) { } public TypeBinding reportError ( BlockScope scope ) { } }

Fix:
constant = org . eclipse . jdt . internal . compiler . ast . FieldReference . getConstantFor ( fieldBinding , true , this , scope , 0 ) ;
Buggy code:
public class Suggester extends SolrSpellChecker { private static final Logger LOG = LoggerFactory . getLogger ( Suggester . class ) ; public static final String LOCATION = "sourceLocation" ; public static final String FIELD = "field" ; public static final String LOOKUP_IMPL = "lookupImpl" ; public static final String THRESHOLD_TOKEN_FREQUENCY = "threshold" ; public static final String STORE_DIR = "storeDir" ; protected String sourceLocation ; protected File storeDir ; protected String field ; protected float threshold ; protected Dictionary dictionary ; protected IndexReader reader ; protected Lookup lookup ; protected String lookupImpl ; protected SolrCore core ; @ Override public String init ( NamedList config , SolrCore core ) { } @ Override public void build ( SolrCore core , SolrIndexSearcher searcher ) { } @ Override public void reload ( SolrCore core , SolrIndexSearcher searcher ) throws IOException { Suggester . LOG . info ( "reload()" ) ; if ( ( ( dictionary ) == null ) && ( ( storeDir ) != null ) ) { if ( lookup . load ( storeDir ) ) { return ; } } if ( ( dictionary ) instanceof HighFrequencyDictionary ) { reader = reader . reopen ( ) ; dictionary = new HighFrequencyDictionary ( reader , field , threshold ) ; try { lookup . build ( dictionary ) ; if ( ( storeDir ) != null ) { lookup . store ( storeDir ) ; } } catch ( Exception e ) { <START_BUG> throw new IOException ( e ) ; <END_BUG> } } } public void add ( String query , int numHits ) { } static SpellingResult EMPTY_RESULT = new SpellingResult ( ) ; @ Override public SpellingResult getSuggestions ( Collection < Token > tokens , IndexReader reader , int count , boolean onlyMorePopular , boolean extendedResults ) throws IOException { } @ Override public SpellingResult getSuggestions ( SpellingOptions options ) throws IOException { } }

Fix:
throw new IOException ( e . toString ( ) ) ;
Buggy code:
public class ReplyToAllAction extends FrameAction implements SelectionListener { public ReplyToAllAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> processor . addOp ( new org . columba . mail . gui . composer . command . ReplyToAllCommand ( r ) ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class Room { public enum Direction { north , south , east , west , up , down ; } private Room north ; private Room south ; private Room east ; private Room west ; private Room up ; private Room down ; private ArrayList < Player > _players ; private ArrayList < OnEnterListener > _onEntListeners ; private ArrayList < OnExitListener > _onExitListeners ; private String _description ; public Room ( String desc ) { } public void setRoom ( Room . Direction d , Room r ) { } public Room getRoom ( Room . Direction d ) { } public String getDescription ( ) { } public void enterRoom ( Player p , Room . Direction d ) { for ( Player otherplayer : _players ) { <START_BUG> otherplayer . alert ( ( ( p . getName ( ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>entered<seq2seq4repair_space>the<seq2seq4repair_space>room!" ) ) ; <END_BUG> } _players . add ( p ) ; for ( OnEnterListener l : _onEntListeners ) { l . enteredRoom ( p , this ) ; } p . setCurrentRoom ( this ) ; p . appendToLog ( ( ( "You<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>" + ( _description ) ) + "<seq2seq4repair_space>room.\n" ) ) ; } public void exitRoom ( Player p , Room . Direction d ) { } public void disconnectAllRooms ( ) { } public void placePlayer ( Player p ) { } public ArrayList < Player > getPlayersInRoom ( ) { } }

Fix:
otherplayer . alert ( ( ( ( ( p . getName ( ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>entered<seq2seq4repair_space>the<seq2seq4repair_space>room<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>" ) + d ) + "!" ) ) ;
Buggy code:
@ SuppressWarnings ( { "serial" , "serial" } ) public class AddContactCardAction extends DefaultTreeAction { public AddContactCardAction ( IFrameMediator frameController ) { } public void actionPerformed ( ActionEvent evt ) { AddressbookFrameMediator mediator = ( ( AddressbookFrameMediator ) ( frameMediator ) ) ; AddressbookFolder folder = ( ( AddressbookFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; ContactEditorDialog dialog = new ContactEditorDialog ( mediator . getView ( ) . getFrame ( ) ) ; if ( dialog . getResult ( ) ) { try { folder . add ( dialog . getDestModel ( ) ) ; } catch ( Exception e ) { if ( Logging . DEBUG ) e . printStackTrace ( ) ; <START_BUG> new ErrorDialog ( e . getMessage ( ) , e ) ; <END_BUG> } } } }

Fix:
ErrorDialog . createDialog ( e . getMessage ( ) , e ) ;
Buggy code:
public class LoggerComparator implements Comparator { Operator operator ; String rightSide ; Pattern rightSidePattern ; Perl5Matcher matcher ; public LoggerComparator ( Operator operator , String rightSide ) throws ScanError { } public boolean compare ( LoggingEvent event ) { if ( operator . isRegex ( ) ) { boolean match = matcher . matches ( event . getLoggerName ( ) , rightSidePattern ) ; if ( ( operator . getCode ( ) ) == ( Operator . REGEX_MATCH ) ) { return match ; } else { return ! match ; } } <START_BUG> int compResult = rightSide . compareTo ( event . getLoggerName ( ) ) ; <END_BUG> switch ( operator . getCode ( ) ) { case Operator . EQUAL : return compResult == 0 ; case Operator . NOT_EQUAL : return compResult != 0 ; case Operator . GREATER : return compResult > 0 ; case Operator . GREATER_OR_EQUAL : return compResult >= 0 ; case Operator . LESS : return compResult < 0 ; case Operator . LESS_OR_EQUAL : return compResult <= 0 ; } throw new IllegalStateException ( ( "Unreachable<seq2seq4repair_space>state<seq2seq4repair_space>reached,<seq2seq4repair_space>operator<seq2seq4repair_space>" + ( operator ) ) ) ; } }

Fix:
int compResult = event . getLoggerName ( ) . compareTo ( rightSide ) ;
Buggy code:
@ SubModule ( { AWSCoreModule . class } ) public class AppModule { public static void bind ( ServiceBinder binder ) { } public static void contributeFactoryDefaults ( MappedConfiguration < String , Object > configuration ) { } public static void contributeApplicationDefaults ( MappedConfiguration < String , Object > configuration ) { } public static void contributeSecurityConfiguration ( Configuration < SecurityFilterChain > configuration , SecurityFilterChainFactory factory ) { } public static void contributeWebSecurityManager ( Configuration < Realm > configuration ) { <START_BUG> ExtendedPropertiesRealm realm = new ExtendedPropertiesRealm ( "classpath:shiro-users.properties" ) ; <END_BUG> configuration . add ( realm ) ; } public static void contributeValueEncoderSource ( MappedConfiguration < Class , ValueEncoderFactory > configuration , final BlogDAO blogDAO ) { } }

Fix:
ExtendedPropertiesRealm realm = new ExtendedPropertiesRealm ( ( ( System . getenv ( "HOME" ) ) + "//.shiro//blog.ini" ) ) ;
Buggy code:
public class PerFromSuper extends PerClause { private Kind kind ; public PerFromSuper ( PerClause . Kind kind ) { } <START_BUG> public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { <END_BUG> throw new RuntimeException ( "unimplemented" ) ; } public FuzzyBoolean match ( Shadow shadow ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public PerClause concretize ( ResolvedTypeX inAspect ) { } private PerClause lookupConcretePerClause ( ResolvedTypeX lookupType ) { } public void write ( DataOutputStream s ) throws IOException { } public static PerClause readPerClause ( DataInputStream s , ISourceContext context ) throws IOException { } public String toString ( ) { } public Kind getKind ( ) { } }

Fix:
public FuzzyBoolean fastMatch ( FastMatchInfo type ) {
Buggy code:
@ Service public class NotificationService { @ Autowired NotificationRepository notificationRepository ; @ Autowired UserRepository userRepository ; public void notifyCase ( Case theCase , User sender , String message ) { } public void notifyNewCase ( Case newCase ) { <START_BUG> if ( ( newCase . getStatus ( ) ) == ( CaseStatus . LookingForPhysician ) ) { <END_BUG> for ( Physician physician : userRepository . listPhysicians ( ) ) { Notification notification = new Notification ( ) ; notification . setCaseId ( newCase . getId ( ) ) ; notification . setUserId ( physician . getId ( ) ) ; notification . setText ( ( ( ( ( newCase . getPatient ( ) . getName ( ) ) + "<seq2seq4repair_space>created<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>case:<seq2seq4repair_space>\"" ) + ( newCase . getName ( ) ) ) + "\"" ) ) ; notificationRepository . save ( notification ) ; } } else { if ( ( newCase . getPhysician ( ) ) == null ) { throw new IllegalArgumentException ( "case<seq2seq4repair_space>status<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>LookingForPhysician<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>Physician<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>assigned" ) ; } Notification notification = new Notification ( ) ; notification . setCaseId ( newCase . getId ( ) ) ; notification . setUserId ( newCase . getPhysician ( ) . getId ( ) ) ; notification . setText ( ( ( ( ( ( ( newCase . getPatient ( ) . getName ( ) ) + "<seq2seq4repair_space>created<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>case:<seq2seq4repair_space>\"" ) + ( newCase . getName ( ) ) ) + "\"" ) + "<seq2seq4repair_space>and<seq2seq4repair_space>wants<seq2seq4repair_space>you<seq2seq4repair_space>to<seq2seq4repair_space>treat<seq2seq4repair_space>" ) + ( ( newCase . getPatient ( ) . getGender ( ) ) == ( Gender . Female ) ? "her" : "him" ) ) ) ; notificationRepository . save ( notification ) ; } } }

Fix:
if ( LookingForPhysician . equals ( newCase . getStatus ( ) ) ) {
Buggy code:
public class OSGiFrameworkPropertyWrite extends AbstractWriteAttributeHandler { static final OSGiFrameworkPropertyWrite INSTANCE = new OSGiFrameworkPropertyWrite ( ) ; private OSGiFrameworkPropertyWrite ( ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return ( context . isNormalServer ( ) ) || ( ( context . getProcessType ( ) ) == ( ProcessType . HOST_CONTROLLER ) ) ; <END_BUG> } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode resolvedValue , ModelNode currentValue , HandbackHolder handbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , Object handback ) throws OperationFailedException { } static DescriptionProvider DESCRIPTION = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; }

Fix:
return context . isNormalServer ( ) ;
Buggy code:
public class UColor { public static String getRGB ( float n ) { <START_BUG> return String . format ( "%f" , n ) . replaceAll ( "\\.0*$" , "" ) ; <END_BUG> } public static String RGBToHex ( float n ) { } public static float [ ] RGBToHSB ( float r , float g , float b ) { } public static String getColorMessage ( float rgbRColor , float rgbGColor , float rgbBColor , float rgbOpacity ) { } }

Fix:
return String . format ( "%.0f" , n ) . replaceAll ( "\\.0*$" , "" ) ;
Buggy code:
public class Main implements Runnable { LS9 ls9 ; double [ ] dbl = new double [ 1024 ] ; String recieved ; void initializedB ( ) { } byte [ ] byteConversion ( int startNumber ) { } byte [ ] byte2Conversion ( int startNumber ) { } byte [ ] byte3Conversion ( int startNumber ) { } Main ( LS9 ls92 , DatagramPacket packet ) { } public void run ( ) { } void onOrOff ( double input , double position ) { byte [ ] full ; <START_BUG> byte [ ] header = new byte [ ] { ( ( byte ) ( 240 ) ) , 67 , 16 , 62 , 18 , 1 , 0 , 48 , 0 , 0 } ; <END_BUG> byte [ ] footer = new byte [ ] { ( ( byte ) ( 247 ) ) } ; full = concatByte ( header , byteConversion ( ( ( int ) ( input - 1 ) ) ) ) ; full = concatByte ( full , byte2Conversion ( ( ( int ) ( position ) ) ) ) ; full = concatByte ( full , footer ) ; System . out . println ( bytesToHex ( full ) ) ; try { try { ls9 . send ( full ) ; } catch ( NoLS9Exception e ) { e . printStackTrace ( ) ; } catch ( MidiUnavailableException e ) { e . printStackTrace ( ) ; } } catch ( InvalidMidiDataException e ) { System . out . println ( "Check<seq2seq4repair_space>ALL<seq2seq4repair_space>connections(MIDI<seq2seq4repair_space>software,ethernet).<seq2seq4repair_space>Something<seq2seq4repair_space>is<seq2seq4repair_space>wrong." ) ; } } void changeLevel ( double dB , double input ) { } void changePan ( String direction , double amount , double input ) { } byte [ ] concatByte ( byte [ ] a , byte [ ] b ) { } char [ ] hexArray = "0123456789ABCDEF" . toCharArray ( ) ; String bytesToHex ( byte [ ] bytes ) { } }

Fix:
byte [ ] header = new byte [ ] { ( ( byte ) ( 240 ) ) , 67 , 16 , 62 , 18 , 1 , 0 , 49 , 0 , 0 } ;
Buggy code:
public class StubReturnValueHandler implements HandlerMethodReturnValueHandler { private final Class < ? > supportedReturnType ; private final boolean usesResponse ; private Object unhandledReturnValue ; public StubReturnValueHandler ( Class < ? > supportedReturnType , boolean usesResponse ) { } public Object getUnhandledReturnValue ( ) { } public boolean supportsReturnType ( MethodParameter returnType ) { } public void handleReturnValue ( Object returnValue , MethodParameter returnType , ModelAndViewContainer mavContainer , NativeWebRequest webRequest ) throws Exception { this . unhandledReturnValue = returnValue ; if ( returnValue != null ) { <START_BUG> mavContainer . addModelAttribute ( Conventions . getVariableName ( returnValue ) , returnValue ) ; <END_BUG> } } public boolean usesResponseArgument ( MethodParameter parameter ) { } }

Fix:
mavContainer . addAttribute ( Conventions . getVariableName ( returnValue ) , returnValue ) ;
Buggy code:
public class TextTransfer extends ByteArrayTransfer { private static TextTransfer _instance = new TextTransfer ( ) ; private static final String COMPOUND_TEXT = "COMPOUND_TEXT" ; private static final String STRING = "STRING" ; private static final int COMPOUND_TEXT_ID = registerType ( TextTransfer . COMPOUND_TEXT ) ; private static final int STRING_ID = registerType ( TextTransfer . STRING ) ; private TextTransfer ( ) { } public static TextTransfer getInstance ( ) { } public void javaToNative ( Object object , TransferData transferData ) { transferData . result = 0 ; if ( ( ! ( checkText ( object ) ) ) || ( ! ( isSupportedType ( transferData ) ) ) ) { DND . error ( ERROR_INVALID_DATA ) ; } String string = ( ( String ) ( object ) ) ; byte [ ] buffer = Converter . wcsToMbcs ( null , string , true ) ; if ( ( transferData . type ) == ( TextTransfer . COMPOUND_TEXT_ID ) ) { int [ ] encoding = new int [ 1 ] ; int [ ] format = new int [ 1 ] ; int [ ] ctext = new int [ 1 ] ; int [ ] length = new int [ 1 ] ; boolean result = OS . gdk_utf8_to_compound_text ( buffer , encoding , format , ctext , length ) ; if ( ! result ) return ; transferData . type = encoding [ 0 ] ; transferData . format = format [ 0 ] ; transferData . length = length [ 0 ] ; transferData . pValue = ctext [ 0 ] ; transferData . result = 1 ; } if ( ( transferData . type ) == ( TextTransfer . STRING_ID ) ) { int pValue = OS . g_malloc ( buffer . length ) ; if ( pValue == 0 ) return ; OS . memmove ( pValue , buffer , buffer . length ) ; transferData . type = TextTransfer . STRING_ID ; transferData . format = 8 ; <START_BUG> transferData . length = buffer . length ; <END_BUG> transferData . pValue = pValue ; transferData . result = 1 ; } } public Object nativeToJava ( TransferData transferData ) { } protected int [ ] getTypeIds ( ) { } protected String [ ] getTypeNames ( ) { } boolean checkText ( Object object ) { } protected boolean validate ( Object object ) { } }

Fix:
transferData . length = ( buffer . length ) - 1 ;
Buggy code:
public final class Log4jStackTraceElementDeserializer extends StdScalarDeserializer < StackTraceElement > { private static final long serialVersionUID = 1L ; public Log4jStackTraceElementDeserializer ( ) { } @ Override public StackTraceElement deserialize ( final JsonParser jp , final DeserializationContext ctxt ) throws JsonProcessingException , IOException { JsonToken t = jp . getCurrentToken ( ) ; if ( t == ( JsonToken . START_OBJECT ) ) { String className = null ; String methodName = null ; String fileName = null ; int lineNumber = - 1 ; while ( ( t = jp . nextValue ( ) ) != ( JsonToken . END_OBJECT ) ) { final String propName = jp . getCurrentName ( ) ; if ( "class" . equals ( propName ) ) { className = jp . getText ( ) ; } else if ( "file" . equals ( propName ) ) { fileName = jp . getText ( ) ; } else if ( "line" . equals ( propName ) ) { if ( t . isNumeric ( ) ) { lineNumber = jp . getIntValue ( ) ; } else { try { <START_BUG> lineNumber = Integer . valueOf ( jp . getText ( ) . trim ( ) ) . intValue ( ) ; <END_BUG> } catch ( final NumberFormatException e ) { throw JsonMappingException . from ( jp , ( ( "Non-numeric<seq2seq4repair_space>token<seq2seq4repair_space>(" + t ) + ")<seq2seq4repair_space>for<seq2seq4repair_space>property<seq2seq4repair_space>'line'" ) , e ) ; } } } else if ( "method" . equals ( propName ) ) { methodName = jp . getText ( ) ; } else if ( "nativeMethod" . equals ( propName ) ) { } else { this . handleUnknownProperty ( jp , ctxt , this . _valueClass , propName ) ; } } return new StackTraceElement ( className , methodName , fileName , lineNumber ) ; } throw ctxt . mappingException ( this . _valueClass , t ) ; } No newline ; at end ; of file ; }

Fix:
lineNumber = Integer . parseInt ( jp . getText ( ) . trim ( ) ) ;
Buggy code:
public class KeyEventSender implements WorkHandler < KeyEvent > { public static final String ADDRESS_PREFIX = "//message//responds//" ; @ Resource ( name = "ConnectionManager" ) private ConnectionManager manager ; @ Resource private SimpMessagingTemplate simpMessagingTemplate ; public KeyEventSender ( ConnectionManager manager , SimpMessagingTemplate simpMessagingTemplate ) { } @ Override public void onEvent ( KeyEvent event ) throws Exception { } private void execute ( KeyEvent event , long sequence , boolean endOfBatch ) throws InterruptedException { System . out . println ( ( ( ( ( ( ( ( "Event<seq2seq4repair_space>-><seq2seq4repair_space>" + event ) + "Sequence<seq2seq4repair_space>-><seq2seq4repair_space>" ) + sequence ) + "Batch<seq2seq4repair_space>-><seq2seq4repair_space>" ) + endOfBatch ) + "<seq2seq4repair_space>thread<seq2seq4repair_space>====><seq2seq4repair_space>" ) + ( Thread . currentThread ( ) . getId ( ) ) ) ) ; String sendURL ; try { String IPAddress = event . getIPAddress ( ) ; String userID = event . getUserID ( ) ; <START_BUG> simpMessagingTemplate . convertAndSend ( ( ( KeyEventSender . ADDRESS_PREFIX ) + ( event . getUserID ( ) ) ) , event . getIPAddress ( ) ) ; <END_BUG> } catch ( Exception e ) { simpMessagingTemplate . convertAndSend ( ( ( KeyEventSender . ADDRESS_PREFIX ) + ( event . getUserID ( ) ) ) , e . getMessage ( ) ) ; } } }

Fix:
simpMessagingTemplate . convertAndSend ( ( ( KeyEventSender . ADDRESS_PREFIX ) + ( event . getUserID ( ) ) ) , event ) ;
Buggy code:
public class MutableBoolean implements Serializable , Comparable , Mutable { private static final long serialVersionUID = - 4830728138360036487L ; private boolean value ; public MutableBoolean ( ) { } public MutableBoolean ( boolean value ) { } public MutableBoolean ( Boolean value ) { } public boolean booleanValue ( ) { } public int compareTo ( Object obj ) { } public boolean equals ( Object obj ) { } public Object getValue ( ) { <START_BUG> return new Boolean ( this . value ) ; <END_BUG> } public int hashCode ( ) { } public void setValue ( boolean value ) { } public void setValue ( Object value ) { } public String toString ( ) { } }

Fix:
return Boolean . valueOf ( this . value ) ;
Buggy code:
public class StringUtil { public static String TYPE_REGEX = "regex" ; public static String TYPE_JSON = "json" ; public static String encodeUrlParam ( String url ) { } public static String mergeRequestQueryString ( String queryString1 , String queryString2 ) { } public static String addParamsToUrl ( String url , String paramKey , String paramValue ) { } public static String addParamsToUrl ( String url , String paramKey , String [ ] paramValues ) { } public static String addParamsToUrl ( String url , Map < String , String [ ] > params ) { } private static Map < String , String [ ] > getUrlParams ( String url ) { Map < String , String [ ] > result = new HashMap < String , String [ ] > ( ) ; try { String queryString = url ; if ( url . contains ( "?" ) ) { queryString = url . substring ( ( ( url . indexOf ( "?" ) ) + 1 ) ) ; } if ( ( queryString . length ( ) ) > 1 ) { String [ ] params = queryString . split ( "&" ) ; for ( String a : params ) { if ( ! ( a . isEmpty ( ) ) ) { String [ ] param = a . split ( "=" ) ; <START_BUG> String key = URLDecoder . decode ( param [ 1 ] , "UTF-8" ) ; <END_BUG> String value = URLDecoder . decode ( param [ 1 ] , "UTF-8" ) ; String [ ] values = ( ( String [ ] ) ( result . get ( key ) ) ) ; if ( values != null ) { List temp = Arrays . asList ( values ) ; temp . add ( value ) ; values = ( ( String [ ] ) ( temp . toArray ( new String [ 0 ] ) ) ) ; } else { values = new String [ ] { value } ; } result . put ( key , values ) ; } } } } catch ( Exception e ) { } return result ; } public static String constructUrlQueryString ( Map < String , String [ ] > params ) { } public static String escapeRegex ( String inStr ) { } public static String escapeString ( String inStr , String format , Map < String , String > replaceMap ) { } public class IgnoreCaseComparator implements Comparator < String > { public int compare ( String strA , String strB ) { } } public static String md5 ( String content ) { } public static String md5Base16 ( String content ) { } }

Fix:
String key = URLDecoder . decode ( param [ 0 ] , "UTF-8" ) ;
Buggy code:
public class AddPOP3MessageCommand extends FolderCommand { private MessageFolder inboxFolder ; public AddPOP3MessageCommand ( DefaultCommandReference [ ] references ) { } public void execute ( WorkerStatusController worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; inboxFolder = ( ( MessageFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; ColumbaMessage message = ( ( ColumbaMessage ) ( r [ 0 ] . getMessage ( ) ) ) ; SourceInputStream messageStream = new SourceInputStream ( message . getSource ( ) ) ; <START_BUG> Object uid = inboxFolder . addMessage ( messageStream , message . getHeader ( ) . getAttributes ( ) , message . getFlags ( ) ) ; <END_BUG> messageStream . close ( ) ; inboxFolder . getFlags ( uid ) . set ( RECENT ) ; inboxFolder . getMessageFolderInfo ( ) . incRecent ( ) ; applySpamFilter ( uid , worker ) ; applyFilters ( uid ) ; } private void applySpamFilter ( Object uid , WorkerStatusController worker ) throws Exception { } private void applyFilters ( Object uid ) throws Exception { } public void updateGUI ( ) throws Exception { } }

Fix:
Object uid = inboxFolder . addMessage ( messageStream , message . getHeader ( ) . getAttributes ( ) , message . getHeader ( ) . getFlags ( ) ) ;
Buggy code:
public class ViewDescriptor implements IPluginContribution , IViewDescriptor { private String id ; private ImageDescriptor imageDescriptor ; private IConfigurationElement configElement ; private String [ ] categoryPath ; private float fastViewWidthRatio ; private IPartDescriptor viewInfo = new IPartDescriptor ( ) { public String getId ( ) { } public String getLabel ( ) { } public ImageDescriptor getImage ( ) { } } ; private IHandlerActivation handlerActivation ; public ViewDescriptor ( IConfigurationElement e ) throws CoreException { } public IPartDescriptor getPartDescriptor ( ) { } public IViewPart createView ( ) throws CoreException { } public String [ ] getCategoryPath ( ) { } public IConfigurationElement getConfigurationElement ( ) { } public String getDescription ( ) { } public String getId ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public String getLabel ( ) { } public String getAccelerator ( ) { } public float getFastViewWidthRatio ( ) { } private void loadFromExtension ( ) throws CoreException { } public String toString ( ) { } public String getPluginId ( ) { } public String getLocalId ( ) { } public boolean getAllowMultiple ( ) { <START_BUG> String string = configElement . getAttribute ( ATT_MULTIPLE ) ; <END_BUG> return string == null ? false : Boolean . valueOf ( string ) . booleanValue ( ) ; } public Object getAdapter ( Class adapter ) { } public final void activateHandler ( ) { } public final void deactivateHandler ( ) { } }

Fix:
String string = configElement . getAttribute ( ATT_ALLOW_MULTIPLE ) ;
Buggy code:
public class BitcoindController { private static Logger LOGGER = Logger . getLogger ( BitcoindController . class ) ; private static final Bitcoin BITCOIN = new BitcoinJSONRPCClient ( ) ; private static int keyPoolCounter = 0 ; public BitcoindController ( ) { } public static String sendCoins ( String address , BigDecimal amount ) throws BitcoinException { try { BitcoindController . BITCOIN . unlockWallet ( ENCRYPTION_PASSWORD , 2 ) ; } catch ( Exception e ) { <START_BUG> if ( e . getMessage ( ) . equals ( "{\"result\":null,\"error\":{\"code\":-17,\"message\":\"Error:<seq2seq4repair_space>Wallet<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>unlocked.\"},\"id\":\"1\"}" ) ) { <END_BUG> } else throw e ; } BitcoindController . keyPoolCheck ( ) ; return BitcoindController . BITCOIN . sendFrom ( ACCOUNT , address , amount . doubleValue ( ) ) ; } public static boolean validateAddress ( String address ) throws BitcoinException { } public static String getNewAddress ( ) throws BitcoinException { } public static void listenIncomingTransactions ( ) throws BitcoinException { } public static void listenIncomingBigTransactions ( ) throws BitcoinException { } public static void listenOutgoingTransactions ( ) throws BitcoinException { } public static void backupWallet ( ) { } private static void keyPoolCheck ( ) throws BitcoinException { } No newline ; at end ; of file ; }

Fix:
if ( e . getMessage ( ) . contains ( "Error:<seq2seq4repair_space>Wallet<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>unlocked." ) ) {
Buggy code:
public class ObjectIdValueHandler extends EmbedValueHandler { private Object [ ] _args = null ; public Column [ ] map ( ValueMapping vm , String name , ColumnIO io , boolean adapt ) { } public Column [ ] map ( ValueMapping vm , DBIdentifier name , ColumnIO io , boolean adapt ) { } private void setMapsIdCol ( ValueMapping vm ) { } private void setMapsIdCols ( List cols , ClassMapping cm ) { } private void setMapsIdCols ( List cols , FieldMapping fm ) { } private FieldMapping getReferenceField ( ClassMapping cm , DBIdentifier refColName ) { } private boolean isReferenceField ( FieldMapping fm , DBIdentifier refColName ) { List cols = fm . getValueInfo ( ) . getColumns ( ) ; if ( ( cols . size ( ) ) == 0 ) { <START_BUG> if ( fm . getName ( ) . equals ( refColName ) ) <END_BUG> return true ; } else { if ( ( ( Column ) ( cols . get ( 0 ) ) ) . getIdentifier ( ) . equals ( refColName ) ) return true ; } return false ; } public Object getResultArgument ( ValueMapping vm ) { } public Object toDataStoreValue ( ValueMapping vm , Object val , JDBCStore store ) { } public Object toObjectValue ( ValueMapping vm , Object val ) { } }

Fix:
if ( fm . getName ( ) . equals ( refColName . getName ( ) ) )