nus-yam/ex-repair huggingface dataset:
Buggy code:
public class UserListComposer extends GenericForwardComposer { private static final long serialVersionUID = 8763856551822579585L ; private Grid userCaseList ; private Paging userCasePaging ; private static final int pageSize = 10 ; private String userName ; private Boolean isGuest ; private Caption userCaption ; private List < Case > updatePage ( int pageIndex , int pageSize ) { } public void doAfterCompose ( Component comp ) throws Exception { } private void updateUser ( boolean initSEO ) { } private void initUserList ( ) { } private void initEventQueue ( ) { FiddleBrowserStateEventQueue queue = FiddleBrowserStateEventQueue . lookup ( ) ; queue . subscribe ( new org . zkoss . fiddle . composer . eventqueue . FiddleEventListener < URLChangeEvent > ( URLChangeEvent . class , self ) { public void onFiddleEvent ( URLChangeEvent evt ) throws Exception { URLData data = ( ( URLData ) ( evt . getData ( ) ) ) ; if ( data == null ) { throw new IllegalStateException ( "not<seq2seq4repair_space>expected<seq2seq4repair_space>type" ) ; } else <START_BUG> if ( URL_DATA_CASE_VIEW . equals ( data . getType ( ) ) ) { <END_BUG> UserVO user = ( ( UserVO ) ( data . getData ( ) ) ) ; userName = user . getUserName ( ) ; isGuest = user . isGuest ( ) ; updateUser ( false ) ; updateTopNavigation ( ) ; EventQueues . lookup ( Tag ) . publish ( new org . zkoss . zk . ui . event . Event ( FiddleEvents . ON_TAG_UPDATE , null , null ) ) ; EventQueue queue = EventQueues . lookup ( LeftRefresh ) ; queue . publish ( new org . zkoss . zk . ui . event . Event ( FiddleEvents . ON_LEFT_REFRESH , null ) ) ; } } } ) ; } private void updateTopNavigation ( ) { } }

Fix:
if ( ( URL_DATA_CASE_VIEW . equals ( data . getType ( ) ) ) && ( ( data . getData ( ) ) instanceof UserVO ) ) {
Buggy code:
public class StringToMyRole1Converter extends AbstractConverter { public StringToMyRole1Converter ( ) { } <START_BUG> protected Object convert ( Object original , Context context ) throws ConverterException { <END_BUG> return new MyType1 ( ) ; } }

Fix:
protected Object convert ( Object original , Object context ) throws ConverterException {
Buggy code:
public class CorusCli extends CommandConsole { public static final int MIN_WIDTH = 80 ; public static final int DEFAULT_PORT = 33000 ; public static final String HOST_OPT = "h" ; public static final String PORT_OPT = "p" ; public static final String SCRIPT_OPT = "s" ; public static final String COMMAND_OPT = "c" ; public static final String WIDTH_OPT = "w" ; public static final int MAX_ERROR_HISTORY = 20 ; private static ClientFileSystem FILE_SYSTEM = new DefaultClientFileSystem ( ) ; protected CorusConnector corus ; private List < CliError > errors ; private boolean abortOnError ; private StrLookup vars = StrLookup . systemPropertiesLookup ( ) ; private AtomicReference < SortSwitchInfo [ ] > sortSwitches ; public CorusCli ( CorusConnector corus ) throws IOException { } private CorusCli ( CorusConnector corus , ConsoleIO io ) throws IOException { } private static ConsoleIO getConsoleIO ( ConsoleOutput toWrap ) { String osName = System . getProperty ( "os.name" ) . toLowerCase ( ) ; final AtomicReference < ConsoleInput > input = new AtomicReference < ConsoleInput > ( ) ; <START_BUG> boolean useJline = Boolean . parseBoolean ( System . getProperty ( USE_JLINE , "false" ) ) ; <END_BUG> if ( ! useJline ) { input . set ( new CorusCli . CorusConsoleInput ( ConsoleInputFactory . createDefaultConsoleInput ( ) ) ) ; } else if ( ( SystemUtils . IS_OS_WINDOWS ) || ( osName . contains ( "vista" ) ) ) { if ( ( System . console ( ) ) == null ) { input . set ( ConsoleInputFactory . createDefaultConsoleInput ( ) ) ; } else { input . set ( ConsoleInputFactory . createJdk6ConsoleInput ( ) ) ; } } else { try { input . set ( ConsoleInputFactory . createJLineConsoleInput ( ) ) ; } catch ( IOException e ) { if ( ( System . console ( ) ) == null ) { input . set ( ConsoleInputFactory . createDefaultConsoleInput ( ) ) ; } else { input . set ( ConsoleInputFactory . createJdk6ConsoleInput ( ) ) ; } } } final ConsoleOutput output = DefaultCorusConsoleOutput . wrap ( toWrap ) ; return new ConsoleIO ( ) { @ Override public ConsoleInput getInput ( ) { return input . get ( ) ; } @ Override public ConsoleOutput getOutput ( ) { return output ; } } ; } public static void main ( String [ ] args ) { } protected Context newContext ( ) { } private static void help ( ) { } static class CorusConsoleInput implements ConsoleInput { private TerminalFacade terminal = new DefaultTerminalFacade ( ) ; private ConsoleInput delegate ; private CorusConsoleInput ( ConsoleInput delegate ) { } @ Override public TerminalFacade getTerminal ( ) { } @ Override public String readLine ( ) throws IOException { } @ Override public char [ ] readPassword ( ) throws IOException { } } public class CliConsoleListener implements ConsoleListener { public void onAbort ( Console cons ) { } public void onCommandNotFound ( Console cons , String command ) { } public void onStart ( Console cons ) { } void line ( Console cons ) { } void center ( Console cons , String text ) { } } }

Fix:
boolean useJline = Boolean . parseBoolean ( System . getProperty ( USE_JLINE , "true" ) ) ;
Buggy code:
public class HandlerRemove extends AbstractLoggingSubsystemUpdate < Void > { private static final long serialVersionUID = 4158226899360272190L ; private final String name ; public HandlerRemove ( String name ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { try { <START_BUG> final ServiceController < ? > controller = updateContext . getServiceContainer ( ) . getRequiredService ( LogServices . handlerName ( name ) ) ; <END_BUG> controller . setMode ( REMOVE ) ; controller . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } catch ( Throwable t ) { resultHandler . handleFailure ( t , param ) ; return ; } } public AbstractHandlerAdd getCompensatingUpdate ( LoggingSubsystemElement original ) { } protected void applyUpdate ( LoggingSubsystemElement element ) throws UpdateFailedException { } }

Fix:
final ServiceController < ? > controller = updateContext . getServiceRegistry ( ) . getRequiredService ( LogServices . handlerName ( name ) ) ;
Buggy code:
public class DataSourceAdd extends AbstractDataSourceAdd { static final DataSourceAdd INSTANCE = new DataSourceAdd ( ) ; protected void populateModel ( ModelNode operation , ModelNode model ) { } protected AbstractDataSourceService createDataSourceService ( final String jndiName , final ModelNode operation ) throws OperationFailedException { final DataSource dataSource ; try { dataSource = DataSourceModelNodeUtil . from ( operation ) ; } catch ( ValidateException e ) { e . printStackTrace ( ) ; <START_BUG> throw new OperationFailedException ( e , new ModelNode ( ) . set ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>DataSource<seq2seq4repair_space>instance<seq2seq4repair_space>for<seq2seq4repair_space>[" + operation ) + "]" ) ) ) ; <END_BUG> } return new LocalDataSourceService ( jndiName , dataSource ) ; } }

Fix:
throw new OperationFailedException ( e , new ModelNode ( ) . set ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>DataSource<seq2seq4repair_space>instance<seq2seq4repair_space>for<seq2seq4repair_space>[" + operation ) + "]\n<seq2seq4repair_space>reason:" ) + ( e . getLocalizedMessage ( ) ) ) ) ) ;
Buggy code:
public class BigRealTest { @ Test public void testConstructor ( ) { } @ Test public void testCompareTo ( ) { } public void testAdd ( ) { } public void testSubtract ( ) { } public void testDivide ( ) { } public void testMultiply ( ) { } @ Test public void testDoubleValue ( ) { } @ Test public void testBigDecimalValue ( ) { } @ Test public void testEqualsAndHashCode ( ) { } public void testSerial ( ) { <START_BUG> BigReal [ ] Reals = new BigReal [ ] { new BigReal ( 3.0 ) , BigReal . ONE , BigReal . ZERO , new BigReal ( 17 ) , new BigReal ( Math . PI ) , new BigReal ( ( - 2.5 ) ) } ; <END_BUG> for ( BigReal Real : Reals ) { assertEquals ( Real , TestUtils . serializeAndRecover ( Real ) ) ; } } }

Fix:
BigReal [ ] Reals = new BigReal [ ] { new BigReal ( 3.0 ) , BigReal . ONE , BigReal . ZERO , new BigReal ( 17 ) , new BigReal ( FastMath . PI ) , new BigReal ( ( - 2.5 ) ) } ;
Buggy code:
public class XSConstraints { public static boolean checkTypeDerivationOk ( XSTypeDecl derived , XSTypeDecl base , int block ) { } public static boolean checkSimpleDerivationOk ( DatatypeValidator derived , XSTypeDecl base , int block ) { } public static boolean checkComplexDerivationOk ( XSComplexTypeDecl derived , XSTypeDecl base , int block ) { } private static boolean checkSimpleDerivation ( DatatypeValidator derived , DatatypeValidator base , int block ) { } private static boolean checkComplexDerivation ( XSComplexTypeDecl derived , XSTypeDecl base , int block ) { if ( derived == base ) return true ; if ( ( ( derived . fDerivedBy ) & block ) != 0 ) return false ; XSTypeDecl directBase = derived . fBaseType ; if ( directBase == base ) return true ; if ( ( directBase == ( SchemaGrammar . fAnyType ) ) || ( directBase == ( SchemaGrammar . fAnySimpleType ) ) ) { return false ; } if ( ( directBase . getXSType ( ) ) == ( XSTypeDecl . COMPLEX_TYPE ) ) return XSConstraints . checkComplexDerivation ( ( ( XSComplexTypeDecl ) ( directBase ) ) , base , block ) ; if ( ( directBase . getXSType ( ) ) == ( XSTypeDecl . SIMPLE_TYPE ) ) { if ( ( base . getXSType ( ) ) == ( XSTypeDecl . COMPLEX_TYPE ) ) { if ( base == ( SchemaGrammar . fAnyType ) ) base = SchemaGrammar . fAnySimpleType ; else return false ; } <START_BUG> return XSConstraints . checkSimpleDerivation ( ( ( DatatypeValidator ) ( derived ) ) , ( ( DatatypeValidator ) ( base ) ) , block ) ; <END_BUG> } return false ; } public static boolean ElementDefaultValidImmediate ( XSTypeDecl type , String value ) { } }

Fix:
return XSConstraints . checkSimpleDerivation ( ( ( DatatypeValidator ) ( directBase ) ) , ( ( DatatypeValidator ) ( base ) ) , block ) ;
Buggy code:
public class IncomingServerPanel extends DefaultPanel implements ActionListener { private JLabel loginLabel ; private JTextField loginTextField ; private JLabel passwordLabel ; private JTextField passwordTextField ; private JLabel hostLabel ; private JTextField hostTextField ; private JLabel portLabel ; private JTextField portTextField ; private JLabel typeLabel ; private JComboBox typeComboBox ; private JCheckBox storePasswordCheckBox ; private JCheckBox secureCheckBox ; private JLabel authenticationLabel ; private JComboBox authenticationComboBox ; private JLabel typeDescriptionLabel ; private PopAttributPanel popPanel ; private ImapAttributPanel imapPanel ; private DefaultItem serverItem = null ; private AccountItem accountItem ; private JCheckBox defaultAccountCheckBox ; private ReceiveOptionsPanel receiveOptionsPanel ; private JDialog dialog ; public IncomingServerPanel ( JDialog dialog , AccountItem account , ReceiveOptionsPanel receiveOptionsPanel ) { } public String getHost ( ) { } public String getLogin ( ) { } public boolean isPopAccount ( ) { } protected void updateComponents ( boolean b ) { if ( b ) { loginTextField . setText ( serverItem . get ( "user" ) ) ; passwordTextField . setText ( serverItem . get ( "password" ) ) ; hostTextField . setText ( serverItem . get ( "host" ) ) ; portTextField . setText ( serverItem . get ( "port" ) ) ; storePasswordCheckBox . setSelected ( serverItem . getBoolean ( "save_password" ) ) ; defaultAccountCheckBox . setSelected ( serverItem . getBoolean ( "use_default_account" ) ) ; if ( isPopAccount ( ) ) { authenticationComboBox . setSelectedItem ( serverItem . get ( "login_method" ) ) ; } secureCheckBox . setSelected ( serverItem . getBoolean ( "enable_ssl" , true ) ) ; defaultAccountCheckBox . setEnabled ( ( ( MailConfig . getAccountList ( ) . getDefaultAccountUid ( ) ) == ( accountItem . getInteger ( "uid" ) ) ) ) ; if ( ( defaultAccountCheckBox . isEnabled ( ) ) && ( defaultAccountCheckBox . isSelected ( ) ) ) { showDefaultAccountWarning ( ) ; } else { layoutComponents ( ) ; } } else { serverItem . set ( "user" , loginTextField . getText ( ) ) ; serverItem . set ( "host" , hostTextField . getText ( ) ) ; serverItem . set ( "password" , passwordTextField . getText ( ) ) ; serverItem . set ( "port" , portTextField . getText ( ) ) ; serverItem . set ( "save_password" , storePasswordCheckBox . isSelected ( ) ) ; <START_BUG> serverItem . set ( "enable_ssl" , secureCheckBox . isEnabled ( ) ) ; <END_BUG> if ( isPopAccount ( ) ) { serverItem . set ( "login_method" , ( ( String ) ( authenticationComboBox . getSelectedItem ( ) ) ) ) ; } serverItem . set ( "use_default_account" , defaultAccountCheckBox . isSelected ( ) ) ; } } protected void showDefaultAccountWarning ( ) { } protected void layoutComponents ( ) { } protected void initComponents ( ) { } public void actionPerformed ( ActionEvent e ) { } public boolean isFinished ( ) { } }

Fix:
serverItem . set ( "enable_ssl" , secureCheckBox . isSelected ( ) ) ;
Buggy code:
public class SharedResourceReference extends ResourceReference { private static final long serialVersionUID = 1L ; public SharedResourceReference ( Class < ? > scope , String name , Locale locale , String style , String variation ) { } public SharedResourceReference ( Class < ? > scope , String name ) { } public SharedResourceReference ( String name ) { } @ Override public IResource getResource ( ) { <START_BUG> ResourceReference ref = Application . get ( ) . getResourceReferenceRegistry ( ) . getResourceReference ( getScope ( ) , getName ( ) , getLocale ( ) , getStyle ( ) , getVariation ( ) , false ) ; <END_BUG> if ( ref == null ) { return new AbstractResource ( ) { private static final long serialVersionUID = 1L ; @ Override protected ResourceResponse newResourceResponse ( Attributes attributes ) { ResourceResponse res = new ResourceResponse ( ) ; res . setError ( SC_NOT_FOUND ) ; return res ; } } ; } else if ( ref != ( this ) ) { return ref . getResource ( ) ; } else { throw new IllegalStateException ( "SharedResourceReference<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>registered<seq2seq4repair_space>globally." ) ; } } @ Override public boolean canBeRegistered ( ) { } }

Fix:
ResourceReference ref = Application . get ( ) . getResourceReferenceRegistry ( ) . getResourceReference ( getScope ( ) , getName ( ) , getLocale ( ) , getStyle ( ) , getVariation ( ) , false , true ) ;
Buggy code:
public class VstUtils { public static VSTEvents convertToVSTEvents ( List < VSTEvent > events ) { } public static VSTEvent createVstMidiEventFromShortMessage ( ShortMessage s ) { } public static VSTEvents getVstEventsWithNewVstEventInserted ( int index , VSTEvents events , VSTEvent newEvent ) { } public static Object fromString ( String base64string ) throws IOException , ClassNotFoundException { } public static String toString ( Serializable o ) throws IOException { } public static VSTEvents cloneVSTEvents ( VSTEvents events ) { } public static List < VSTEvent > cloneVSTEventsToList ( VSTEvents events ) { } public static void outStackTrace ( Exception e ) { } public static VSTEvents convertMidiChannel ( VSTEvents inputEvents , int inputChannel , int outputChannel ) { } public static void out ( String message ) { <START_BUG> if ( ! true ) { <END_BUG> return ; } try { BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( "c:\\temp\\jwrapper_log.txt" , true ) , "UTF-8" ) ) ; try { writer . write ( ( message + "\n" ) ) ; writer . close ( ) ; } catch ( IOException e ) { try { writer . write ( ( message + "\n" ) ) ; writer . close ( ) ; } catch ( IOException e1 ) { e1 . printStackTrace ( ) ; } e . printStackTrace ( ) ; } } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } } public static void outputVstMidiEventsForDebugPurposes ( VSTEvents ev ) { } }

Fix:
if ( true ) {
Buggy code:
public class ThrowStatement extends Statement { public Expression exception ; public TypeBinding exceptionType ; public ThrowStatement ( Expression exception , int sourceStart , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { this . exceptionType = this . exception . resolveType ( scope ) ; if ( ( ( this . exceptionType ) != null ) && ( this . exceptionType . isValidBinding ( ) ) ) { if ( ( this . exceptionType ) == ( TypeBinding . NULL ) ) { if ( ( scope . compilerOptions ( ) . complianceLevel ) <= ( ClassFileConstants . JDK1_3 ) ) { scope . problemReporter ( ) . cannotThrowNull ( this . exception ) ; } } else <START_BUG> if ( ( exceptionType . findSuperTypeErasingTo ( TypeIds . T_JavaLangThrowable , true ) ) == null ) { <END_BUG> scope . problemReporter ( ) . cannotThrowType ( this . exception , this . exceptionType ) ; } this . exception . computeConversion ( scope , this . exceptionType , this . exceptionType ) ; } } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( exceptionType . findSuperTypeOriginatingFrom ( TypeIds . T_JavaLangThrowable , true ) ) == null ) {
Buggy code:
public class ParameterizedGenericMethodBinding extends ParameterizedMethodBinding implements Substitution { public TypeBinding [ ] typeArguments ; private LookupEnvironment environment ; public boolean inferredReturnType ; public boolean wasInferred ; public boolean isRaw ; public MethodBinding tiebreakMethod ; public boolean isUnchecked ; public static MethodBinding computeCompatibleMethod ( MethodBinding originalMethod , TypeBinding [ ] arguments , Scope scope , InvocationSite invocationSite ) { } private static boolean hasUnresolvedTypeArgument ( TypeBinding [ ] substitutes ) { } private static ParameterizedGenericMethodBinding inferFromArgumentTypes ( Scope scope , MethodBinding originalMethod , TypeBinding [ ] arguments , TypeBinding [ ] parameters , Map collectedSubstitutes , TypeBinding [ ] substitutes ) { } private static TypeBinding [ ] resolveSubstituteConstraints ( Scope scope , TypeVariableBinding [ ] typeVariables , TypeBinding [ ] substitutes , boolean considerEXTENDSConstraints , Map collectedSubstitutes ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , RawTypeBinding rawType , LookupEnvironment environment ) { } public ParameterizedGenericMethodBinding ( MethodBinding originalMethod , TypeBinding [ ] typeArguments , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public LookupEnvironment environment ( ) { } public boolean hasSubstitutedParameters ( ) { } public boolean hasSubstitutedReturnType ( ) { } private ParameterizedGenericMethodBinding inferFromExpectedType ( Scope scope , TypeBinding expectedType , Map collectedSubstitutes , TypeBinding [ ] substitutes ) { } public boolean isRawSubstitution ( ) { } public TypeBinding substitute ( TypeVariableBinding originalVariable ) { } public MethodBinding tiebreakMethod ( ) { if ( ( this . tiebreakMethod ) == null ) { <START_BUG> this . tiebreakMethod = new ParameterizedGenericMethodBinding ( this . originalMethod , ( ( RawTypeBinding ) ( null ) ) , this . environment ) ; <END_BUG> } return this . tiebreakMethod ; } }

Fix:
this . tiebreakMethod = ( this . isRaw ) ? this : new ParameterizedGenericMethodBinding ( this . originalMethod , ( ( RawTypeBinding ) ( null ) ) , this . environment ) ;
Buggy code:
public class ExponentialDistributionTest extends ContinuousDistributionAbstractTest { public ExponentialDistributionTest ( String name ) { } public ContinuousDistribution makeDistribution ( ) { <START_BUG> return DistributionFactory . newInstance ( ) . createExponentialDistribution ( 5.0 ) ; <END_BUG> } public double [ ] makeCumulativeTestPoints ( ) { } public double [ ] makeCumulativeTestValues ( ) { } public void testCumulativeProbabilityExtremes ( ) throws Exception { } public void testInverseCumulativeProbabilityExtremes ( ) throws Exception { } public void testCumulativeProbability2 ( ) throws Exception { } public void testMeanAccessors ( ) { } }

Fix:
return new ExponentialDistributionImpl ( 5.0 ) ;
Buggy code:
public class MSVSSCHECKIN extends MSVSS { private String m_LocalPath = null ; private boolean m_Recursive = false ; private boolean m_Writable = false ; private String m_AutoResponse = null ; private String m_Comment = "-" ; public final void setWritable ( boolean argWritable ) { } public void setAutoresponse ( String response ) { } public void setComment ( String comment ) { } public void setLocalpath ( Path localPath ) { } public void setRecursive ( boolean recursive ) { } public void getAutoresponse ( Commandline cmd ) { } public String getComment ( ) { } public void getLocalpathCommand ( Commandline cmd ) throws TaskException { if ( ( m_LocalPath ) == null ) { return ; } else { File dir = resolveFile ( m_LocalPath ) ; if ( ! ( dir . exists ( ) ) ) { boolean done = dir . mkdirs ( ) ; if ( done == false ) { String msg = ( ( "Directory<seq2seq4repair_space>" + ( m_LocalPath ) ) + "<seq2seq4repair_space>creation<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>" ) + "succesful<seq2seq4repair_space>for<seq2seq4repair_space>an<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ; throw new TaskException ( msg ) ; } <START_BUG> log ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; <END_BUG> } cmd . createArgument ( ) . setValue ( ( ( FLAG_OVERRIDE_WORKING_DIR ) + ( m_LocalPath ) ) ) ; } } public void getRecursiveCommand ( Commandline cmd ) { } public void getWritableCommand ( Commandline cmd ) { } public void execute ( ) throws TaskException { } }

Fix:
getLogger ( ) . info ( ( "Created<seq2seq4repair_space>dir:<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ;
Buggy code:
public class CharacterModel implements Serializable { private HashMap < String , String [ ] > itemConsumableSet ; private HashMap < String , String [ ] > itemEquipmentSet ; private LinkedList < CellProperties > cellGridItems ; private int screenWidth ; private int screenHeight ; public CharacterModel ( int screenWidth , int screenHeight ) { } public LinkedList < CellProperties > getItemList ( ) { } public void removeItemFromMap ( int [ ] playerCoords , String playerArea ) { } private void populateItemSet ( ) { } private void readMapItems ( ) { try { BufferedReader reader = new BufferedReader ( new FileReader ( "itemmap.txt" ) ) ; String line = reader . readLine ( ) ; String [ ] splittedLine ; while ( line != null ) { while ( ( line . charAt ( 0 ) ) == '#' ) line = reader . readLine ( ) ; splittedLine = line . split ( ",<seq2seq4repair_space>|:" ) ; Item item ; Image itemImage ; String itemName = splittedLine [ 5 ] ; if ( itemConsumableSet . containsKey ( itemName ) ) { String filename = itemConsumableSet . get ( itemName ) [ 3 ] ; itemImage = ImageIO . read ( new File ( ( "textures//" + filename ) ) ) ; itemImage = itemImage . getScaledInstance ( ( ( screenWidth ) // 32 ) , ( ( screenHeight ) // 18 ) , Image . SCALE_DEFAULT ) ; item = new ItemConsumable ( itemConsumableSet . get ( itemName ) , itemImage ) ; } else { <START_BUG> String filename = itemConsumableSet . get ( itemName ) [ 4 ] ; <END_BUG> itemImage = ImageIO . read ( new File ( ( "textures//" + filename ) ) ) ; itemImage = itemImage . getScaledInstance ( ( ( screenWidth ) // 32 ) , ( ( screenHeight ) // 18 ) , Image . SCALE_DEFAULT ) ; item = new ItemEquipment ( itemEquipmentSet . get ( itemName ) , itemImage ) ; } cellGridItems . add ( new CellProperties ( splittedLine , item ) ) ; line = reader . readLine ( ) ; } reader . close ( ) ; } catch ( IOException e ) { System . out . println ( e . getLocalizedMessage ( ) ) ; } } }

Fix:
String filename = itemEquipmentSet . get ( itemName ) [ 4 ] ;
Buggy code:
class TestProblem4 extends TestProblemAbstract { private double a ; private double [ ] y ; public TestProblem4 ( ) { } public TestProblem4 ( TestProblem4 problem ) { } public Object clone ( ) { } public SwitchingFunction [ ] getSwitchingFunctions ( ) { } public void doComputeDerivatives ( double t , double [ ] y , double [ ] yDot ) { } public double [ ] computeTheoreticalState ( double t ) { } private static class Bounce implements SwitchingFunction { private int sign ; public Bounce ( ) { } public double g ( double t , double [ ] y ) { } public int eventOccurred ( double t , double [ ] y ) { sign = - ( sign ) ; <START_BUG> return SwitchingFunction . RESET ; <END_BUG> } public void resetState ( double t , double [ ] y ) { } } private static class Stop implements SwitchingFunction { public Stop ( ) { } public double g ( double t , double [ ] y ) { } public int eventOccurred ( double t , double [ ] y ) { return SwitchingFunction . STOP ; } public void resetState ( double t , double [ ] y ) { } } }

Fix:
return SwitchingFunction . RESET_STATE ;
Buggy code:
public class Main { public static double analyzeAlgorithm ( int n ) { } public static void main ( String [ ] args ) { <START_BUG> if ( args [ 0 ] . equals ( "test" ) ) { <END_BUG> int inputSize = Integer . parseInt ( args [ 1 ] ) ; double totalRunTime = 0 ; int runs = 0 ; for ( int i = 0 ; i <= 9 ; i ++ ) { double runtime = ( Main . analyzeAlgorithm ( inputSize ) ) // 1000 ; System . out . println ( ( ( ( ( "N:<seq2seq4repair_space>" + inputSize ) + ",<seq2seq4repair_space>T(N):<seq2seq4repair_space>" ) + runtime ) + "s" ) ) ; totalRunTime += runtime ; runs ++ ; } System . out . println ( ( "Average<seq2seq4repair_space>T(N):<seq2seq4repair_space>" + ( totalRunTime // runs ) ) ) ; } else { MainFrame mainFrame = new MainFrame ( 606 , 660 ) ; SwingUtilities . invokeLater ( mainFrame ) ; } } No newline ; at end ; of file ; }

Fix:
if ( ( ( args . length ) > 0 ) && ( args [ 0 ] . equals ( "test" ) ) ) {
Buggy code:
final class ArrayToArrayConverter implements ConditionalGenericConverter { private final CollectionToArrayConverter helperConverter ; public ArrayToArrayConverter ( ConversionService conversionService ) { } public Set < ConvertiblePair > getConvertibleTypes ( ) { } public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { <START_BUG> return true ; <END_BUG> } public Object convert ( Object source , TypeDescriptor sourceType , TypeDescriptor targetType ) { } }

Fix:
return this . helperConverter . matches ( sourceType , targetType ) ;
Buggy code:
public class DriveRightForX extends Command { public DriveRightForX ( ) { } @ Override protected void initialize ( ) { } @ Override protected void execute ( ) { <START_BUG> chassis . driveRight ( ) ; <END_BUG> } @ Override protected boolean isFinished ( ) { } @ Override protected void end ( ) { } @ Override protected void interrupted ( ) { } }

Fix:
chassis . driveRight ( oi . getChassisJoystick ( ) ) ;
Buggy code:
public final class MdrService implements Service < MetadataRepository > { private final MetadataRepository value ; public MdrService ( ) { } @ Override public MetadataRepository getValue ( ) throws IllegalStateException { } @ Override public void start ( StartContext context ) throws StartException { <START_BUG> ConnectorLogger . MDR_LOGGER . debugf ( "Starting<seq2seq4repair_space>sevice<seq2seq4repair_space>MDR" ) ; <END_BUG> } @ Override public void stop ( StopContext context ) { } }

Fix:
ConnectorLogger . MDR_LOGGER . debugf ( "Starting<seq2seq4repair_space>service<seq2seq4repair_space>MDR" ) ;
Buggy code:
public class DirectoryDialog extends Dialog { String message = "" ; String filterPath = "" ; public DirectoryDialog ( Shell parent ) { } public DirectoryDialog ( Shell parent , int style ) { } public String getFilterPath ( ) { } public String getMessage ( ) { } public String open ( ) { int dialog = OS . gcnew_FolderBrowserDialog ( ) ; if ( dialog == 0 ) error ( ERROR_NO_HANDLES ) ; int messagePtr = parent . createDotNetString ( message , false ) ; OS . FolderBrowserDialog_Description ( dialog , messagePtr ) ; OS . GCHandle_Free ( messagePtr ) ; String result = null ; if ( ( OS . FormsCommonDialog_ShowDialog ( dialog ) ) == ( OS . DialogResult_OK ) ) { int ptr = OS . FolderBrowserDialog_SelectedPath ( dialog ) ; <START_BUG> result = parent . createJavaString ( ptr ) ; <END_BUG> OS . GCHandle_Free ( ptr ) ; } OS . GCHandle_Free ( dialog ) ; return result ; } public void setFilterPath ( String string ) { } public void setMessage ( String string ) { } }

Fix:
result = Widget . createJavaString ( ptr ) ;
Buggy code:
public abstract class ConnectionAdapter < T > extends ICEObject implements IConnectionAdapter < T > { private T connection ; private final Map < String , String > connectionProperties ; private ConnectionState state ; public ConnectionAdapter ( ) { } public boolean connect ( ) { } public boolean connect ( boolean block ) { } protected abstract T openConnection ( ) { } public boolean disconnect ( ) { } public boolean disconnect ( boolean block ) { } protected abstract boolean closeConnection ( T connection ) { } protected Map < String , String > getConnectionProperties ( ) { } protected boolean setConnectionProperty ( String key , String value ) { } private void setState ( ConnectionState state ) { } public T getConnection ( ) { } public String getConnectionProperty ( String key ) { } public String getKey ( ) { } public ConnectionState getState ( ) { } public abstract boolean setConnectionProperties ( List < Entry > properties ) { } public String getHost ( ) { } public int getPort ( ) { } public boolean isRemote ( ) { <START_BUG> return "localhost" . equals ( getHost ( ) ) ; <END_BUG> } public void register ( IUpdateableListener listener ) { } public void setId ( int id ) { } public void setName ( String name ) { } public void setDescription ( String description ) { } }

Fix:
return ! ( "localhost" . equals ( getHost ( ) ) ) ;
Buggy code:
public class QCodecTest { static final int [ ] SWISS_GERMAN_STUFF_UNICODE = new int [ ] { 71 , 114 , 252 , 101 , 122 , 105 , 95 , 122 , 228 , 109 , 228 } ; static final int [ ] RUSSIAN_STUFF_UNICODE = new int [ ] { 1042 , 1089 , 1077 , 1084 , 95 , 1087 , 1088 , 1080 , 1074 , 1077 , 1090 } ; private String constructString ( int [ ] unicodeChars ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> if ( unicodeChars != null ) { for ( int unicodeChar : unicodeChars ) { buffer . append ( ( ( char ) ( unicodeChar ) ) ) ; } } return buffer . toString ( ) ; } @ Test public void testNullInput ( ) throws Exception { } @ Test public void testUTF8RoundTrip ( ) throws Exception { } @ Test public void testBasicEncodeDecode ( ) throws Exception { } @ Test public void testUnsafeEncodeDecode ( ) throws Exception { } @ Test public void testEncodeDecodeNull ( ) throws Exception { } @ Test public void testEncodeStringWithNull ( ) throws Exception { } @ Test public void testDecodeStringWithNull ( ) throws Exception { } @ Test public void testEncodeObjects ( ) throws Exception { } @ Test ( expected = UnsupportedCharsetException . class ) public void testInvalidEncoding ( ) { } @ Test public void testDecodeObjects ( ) throws Exception { } @ Test public void testEncodeDecodeBlanks ( ) throws Exception { } @ Test public void testLetUsMakeCloverHappy ( ) throws Exception { } }

Fix:
StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class Gcj extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { } protected Commandline setupGCJCommand ( ) throws TaskException { Commandline cmd = new Commandline ( ) ; <START_BUG> Path classpath = new Path ( m_project ) ; <END_BUG> if ( ( m_bootclasspath ) != null ) { classpath . append ( m_bootclasspath ) ; } classpath . addExtdirs ( m_extdirs ) ; if ( ( ( m_bootclasspath ) == null ) || ( ( m_bootclasspath . size ( ) ) == 0 ) ) { m_includeJavaRuntime = true ; } classpath . append ( getCompileClasspath ( ) ) ; classpath . append ( src ) ; cmd . setExecutable ( "gcj" ) ; if ( ( m_destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( m_destDir ) ; if ( m_destDir . mkdirs ( ) ) { throw new TaskException ( "Can't<seq2seq4repair_space>make<seq2seq4repair_space>output<seq2seq4repair_space>directories.<seq2seq4repair_space>Maybe<seq2seq4repair_space>permission<seq2seq4repair_space>is<seq2seq4repair_space>wrong.<seq2seq4repair_space>" ) ; } } cmd . createArgument ( ) . setValue ( "-classpath" ) ; cmd . createArgument ( ) . setPath ( classpath ) ; if ( ( m_encoding ) != null ) { cmd . createArgument ( ) . setValue ( ( "--encoding=" + ( m_encoding ) ) ) ; } if ( m_debug ) { cmd . createArgument ( ) . setValue ( "-g1" ) ; } if ( m_optimize ) { cmd . createArgument ( ) . setValue ( "-O" ) ; } cmd . createArgument ( ) . setValue ( "-C" ) ; addCurrentCompilerArgs ( cmd ) ; return cmd ; } }

Fix:
Path classpath = new Path ( ) ;
Buggy code:
public class PageableListViewNavigation extends Loop { private final class StartIndexChange extends Change { private int startIndex ; private StartIndexChange ( int startIndex ) { } public final void undo ( ) { } } protected PageableListView pageableListView ; private int startIndex ; private int margin = - 1 ; private String separator = null ; private int viewSize = 10 ; public PageableListViewNavigation ( final String id , final PageableListView pageableListView ) { } public int getMargin ( ) { } public String getSeparator ( ) { } public int getViewSize ( ) { } public void setViewSize ( final int size ) { } public void setMargin ( final int margin ) { } public void setSeparator ( final String separator ) { } protected void internalOnBeginRequest ( ) { } protected void populateItem ( final Loop . LoopItem loopItem ) { } protected void renderItem ( final Loop . LoopItem loopItem ) { } private void setStartIndex ( ) { int firstListItem = this . startIndex ; <START_BUG> int viewSize = getViewSize ( ) ; <END_BUG> int margin = getMargin ( ) ; int currentPage = pageableListView . getCurrentPage ( ) ; if ( currentPage < ( firstListItem + margin ) ) { firstListItem = currentPage - margin ; } else if ( currentPage >= ( ( firstListItem + viewSize ) - margin ) ) { firstListItem = ( ( currentPage + margin ) + 1 ) - viewSize ; } if ( ( firstListItem + viewSize ) >= ( pageableListView . getPageCount ( ) ) ) { firstListItem = ( pageableListView . getPageCount ( ) ) - viewSize ; } if ( firstListItem < 0 ) { firstListItem = 0 ; } if ( ( viewSize != ( getIterations ( ) ) ) || ( ( this . startIndex ) != firstListItem ) ) { this . modelChanging ( ) ; addStateChange ( new PageableListViewNavigation . StartIndexChange ( this . startIndex ) ) ; this . startIndex = firstListItem ; this . setIterations ( Math . min ( viewSize , pageableListView . getPageCount ( ) ) ) ; this . modelChanged ( ) ; removeAll ( ) ; } } private void setIterations ( int i ) { } }

Fix:
int viewSize = Math . min ( getViewSize ( ) , pageableListView . getPageCount ( ) ) ;
Buggy code:
public class PreferencesExportDialog extends Dialog { CheckboxTreeViewer viewer ; Combo outputLocationCombo ; private static final int MIN_DIALOG_WIDTH = 350 ; private static final int MIN_DIALOG_HEIGHT = 150 ; private static String EXPORT_LOCATION_KEY = "PREFERENCES_EXPORT_LOCATION" ; public PreferencesExportDialog ( Shell parentShell ) { } protected void configureShell ( Shell newShell ) { } protected int getShellStyle ( ) { } protected Control createDialogArea ( Composite parent ) { } private void createOutputSelectionArea ( Composite outerArea ) { } protected Point getInitialSize ( ) { } protected void okPressed ( ) { } private String getOutputFileName ( ) { } private void exportPreferences ( IPath path , IEclipsePreferences [ ] preferences ) { File file = path . toFile ( ) ; if ( file . exists ( ) ) file . delete ( ) ; File parent = file . getParentFile ( ) ; if ( parent != null ) file . getParentFile ( ) . mkdirs ( ) ; IPreferencesService service = Platform . getPreferencesService ( ) ; OutputStream output = null ; try { output = new BufferedOutputStream ( new FileOutputStream ( file ) ) ; for ( int i = 0 ; i < ( preferences . length ) ; i ++ ) { IEclipsePreferences node = preferences [ i ] ; <START_BUG> service . exportPreferences ( node , output , null ) ; <END_BUG> } } catch ( FileNotFoundException exception ) { openErrorDialog ( new Status ( IStatus . ERROR , WorkbenchPlugin . PI_WORKBENCH , IStatus . ERROR , exception . getMessage ( ) , exception ) ) ; } catch ( CoreException exception ) { openErrorDialog ( exception . getStatus ( ) ) ; } finally { if ( output != null ) try { output . close ( ) ; } catch ( IOException e ) { } } } private void openErrorDialog ( IStatus status ) { } protected void createButtonsForButtonBar ( Composite parent ) { } private void enableOKButton ( boolean state ) { } }

Fix:
service . exportPreferences ( node , output , ( ( String [ ] ) ( null ) ) ) ;
Buggy code:
public final class ReminderList { private static final String TAG = "ReminderList" ; private static final String saveName = "SAVEDATA" ; private static final String stringType = "UTF-8" ; private static ReminderList instance = null ; @ SerializedName ( "data" ) private ArrayList < ReminderItem > data = new ArrayList < > ( ) ; private int currentIndex = - 1 ; private ReminderItem currentItem ; private ReminderList ( ) { } public static ReminderList getInstance ( ) { } public final boolean loadDataSync ( ) { } public final void loadData ( boolean forceRefresh ) { } public final boolean saveDataSync ( ) { } public final void saveData ( ) { } public final boolean hasReminders ( ) { } @ NonNull public final ArrayList < ReminderItem > getData ( ) { } public final void setCurrentReminder ( @ NonNull ReminderItem item ) { } public final void clearCurrentReminder ( ) { } public final void deleteCurrentReminder ( ) { } public final void createNewReminder ( ) { } public final void previewCurrent ( ) { } public final void saveCurrentReminder ( ) { } public final boolean hasCurrentReminder ( ) { } @ Nullable public final ReminderItem getCurrentReminder ( ) { } public final void recalculateWakes ( ) { } public final void trimWakesToCurrent ( ) { } private void trimWakeToCurrent ( @ NonNull ReminderItem item ) { } private void trimWakeToCurrent ( @ NonNull ReminderItem item , @ NonNull TimeItem timeNow ) { } @ NonNull public final ArrayList < ReminderItem > getCurrentWakes ( ) { } private int getDayOfWeek ( ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . setTimeInMillis ( System . currentTimeMillis ( ) ) ; <START_BUG> return calendar . get ( Calendar . DAY_OF_WEEK ) ; <END_BUG> } private boolean timeInBounds ( TimeItem start , TimeItem end ) { } @ Nullable public final TimeItem getNextWake ( ) { } private boolean timeBefore ( TimeItem newTime , TimeItem oldTime ) { } private boolean saveToFile ( ) { } private boolean loadFromFile ( ) { } @ Nullable private byte [ ] serializeSave ( ) { } private boolean deserializeSave ( @ NonNull byte [ ] bytes ) { } }

Fix:
return ( calendar . get ( Calendar . DAY_OF_WEEK ) ) - 1 ;
Buggy code:
public class Sash extends Control { Cursor sizeCursor ; int lastX ; int lastY ; private static final int INCREMENT = 1 ; private static final int PAGE_INCREMENT = 9 ; public Sash ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } int callFocusEventHandler ( int nextHandler , int theEvent ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } void drawBackground ( int control , int context ) { <START_BUG> drawBackground ( control , context , background ) ; <END_BUG> } int kEventControlClick ( int nextHandler , int theEvent , int userData ) { } int kEventControlGetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetCursor ( int nextHandler , int theEvent , int userData ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } int kEventUnicodeKeyPressed ( int nextHandler , int theEvent , int userData ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } int traversalCode ( int key , int theEvent ) { } }

Fix:
fillBackground ( control , context , null ) ;
Buggy code:
public class StringAccountRenderer extends JLabel implements TableCellRenderer { private Border unselectedBorder = null ; private Border selectedBorder = null ; private boolean isBordered = true ; private Font plainFont ; private Font boldFont ; private ImageIcon image1 = ImageLoader . getSmallImageIcon ( "localhost.png" ) ; private ImageIcon image2 = ImageLoader . getSmallImageIcon ( "remotehost.png" ) ; private boolean b ; public StringAccountRenderer ( boolean b ) { } public Component getTableCellRendererComponent ( JTable table , Object value , boolean isSelected , boolean hasFocus , int row , int column ) { if ( isBordered ) { if ( isSelected ) { if ( ( selectedBorder ) == null ) { selectedBorder = BorderFactory . createMatteBorder ( 2 , 5 , 2 , 5 , table . getSelectionBackground ( ) ) ; } setBackground ( table . getSelectionBackground ( ) ) ; setForeground ( table . getSelectionForeground ( ) ) ; } else { if ( ( unselectedBorder ) == null ) { unselectedBorder = BorderFactory . createMatteBorder ( 2 , 5 , 2 , 5 , table . getBackground ( ) ) ; } setBackground ( table . getBackground ( ) ) ; setForeground ( table . getForeground ( ) ) ; } } String str = null ; try { str = ( ( String ) ( value ) ) ; } catch ( ClassCastException ex ) { System . out . println ( ( "<seq2seq4repair_space>filter<seq2seq4repair_space>renderer:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) ) ; <START_BUG> str = new String ( ) ; <END_BUG> } if ( ( b ) == true ) { if ( str . equalsIgnoreCase ( "POP3" ) ) { setIcon ( image1 ) ; } else if ( str . equalsIgnoreCase ( "IMAP4" ) ) { setIcon ( image2 ) ; } } setText ( str ) ; return this ; } }

Fix:
str = "" ;
Buggy code:
public interface FileMigrationService { public static final int CURRENT_SCHEMA_VERSION = 2 ; boolean fileContentNeedsMigration ( Content content ) { } <START_BUG> Content migrateFileContent ( Content content ) ; <END_BUG> }

Fix:
void migrateFileContent ( Content content ) ;
Buggy code:
public class AnnotationTypeMemberDeclaration extends BodyDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( AnnotationTypeMemberDeclaration . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( AnnotationTypeMemberDeclaration . class ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( AnnotationTypeMemberDeclaration . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( AnnotationTypeMemberDeclaration . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor DEFAULT_PROPERTY = new ChildPropertyDescriptor ( AnnotationTypeMemberDeclaration . class , "default" , Expression . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private SimpleName memberName = null ; private Type memberType = null ; private Expression optionalDefaultValue = null ; AnnotationTypeMemberDeclaration ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { AnnotationTypeMemberDeclaration result = new AnnotationTypeMemberDeclaration ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setJavadoc ( ( ( Javadoc ) ( ASTNode . copySubtree ( target , getJavadoc ( ) ) ) ) ) ; result . modifiers ( ) . addAll ( ASTNode . copySubtrees ( target , modifiers ( ) ) ) ; result . setType ( ( ( Type ) ( ASTNode . copySubtree ( target , getType ( ) ) ) ) ) ; result . setName ( ( ( SimpleName ) ( getName ( ) . clone ( target ) ) ) ) ; result . setDefault ( ( ( Expression ) ( ASTNode . copySubtree ( target , getDefault ( ) ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SimpleName getName ( ) { } public void setName ( SimpleName memberName ) { } public Type getType ( ) { } public void setType ( Type type ) { } public Expression getDefault ( ) { } public void setDefault ( Expression defaultValue ) { } public IMethodBinding resolveBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
class BinaryMethod extends BinaryMember implements IMethod { class DecodeParametersNames extends SourceElementRequestorAdapter { String [ ] parametersNames ; public void enterMethod ( int declarationStart , int modifiers , char [ ] returnTypeName , char [ ] selector , int nameSourceStart , int nameSourceEnd , char [ ] [ ] paramTypes , char [ ] [ ] paramNames , char [ ] [ ] exceptions ) { } public void enterConstructor ( int declarationStart , int modifiers , char [ ] selector , int nameSourceStart , int nameSourceEnd , char [ ] [ ] paramTypes , char [ ] [ ] paramNames , char [ ] [ ] exceptions ) { } public String [ ] getParametersNames ( ) { } } protected String [ ] parameterTypes ; protected String [ ] parameterNames ; protected static final String [ ] NO_TYPES = new String [ ] { } ; protected String [ ] exceptionTypes ; protected String returnType ; protected BinaryMethod ( JavaElement parent , String name , String [ ] paramTypes ) { } public boolean equals ( Object o ) { } public String [ ] getExceptionTypes ( ) throws JavaModelException { } public int getElementType ( ) { } public int getFlags ( ) throws JavaModelException { } protected void getHandleMemento ( StringBuffer buff ) { ( ( JavaElement ) ( getParent ( ) ) ) . getHandleMemento ( buff ) ; char delimiter = getHandleMementoDelimiter ( ) ; buff . append ( delimiter ) ; escapeMementoName ( buff , getElementName ( ) ) ; for ( int i = 0 ; i < ( this . parameterTypes . length ) ; i ++ ) { buff . append ( delimiter ) ; <START_BUG> buff . append ( this . parameterTypes [ i ] ) ; <END_BUG> } if ( ( this . occurrenceCount ) > 1 ) { buff . append ( JavaElement . JEM_COUNT ) ; buff . append ( this . occurrenceCount ) ; } } protected char getHandleMementoDelimiter ( ) { } public int getNumberOfParameters ( ) { } public String [ ] getParameterNames ( ) throws JavaModelException { } public String [ ] getParameterTypes ( ) { } public ITypeParameter getTypeParameter ( String typeParameterName ) { } public ITypeParameter [ ] getTypeParameters ( ) throws JavaModelException { } public String [ ] getTypeParameterSignatures ( ) throws JavaModelException { } public String getReturnType ( ) throws JavaModelException { } public String getSignature ( ) throws JavaModelException { } public int hashCode ( ) { } public boolean isConstructor ( ) throws JavaModelException { } public boolean isMainMethod ( ) throws JavaModelException { } public boolean isSimilar ( IMethod method ) { } public String readableName ( ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } protected void toStringName ( StringBuffer buffer ) { } }

Fix:
escapeMementoName ( buff , this . parameterTypes [ i ] ) ;