nus-yam/ex-repair huggingface dataset:
Buggy code:
@ RunWith ( Parameterized . class ) public class SubsystemParsingTestCase extends ClusteringSubsystemTest { String xmlFile = null ; int operations = 0 ; public SubsystemParsingTestCase ( String xmlFile , int operations ) { } @ Parameters public static Collection < Object [ ] > data ( ) { } @ Override protected ValidationConfiguration getModelValidationConfiguration ( ) { } @ Test public void testParseSubsystem ( ) throws Exception { } @ Test public void testInstallIntoController ( ) throws Exception { } private void checkLegacyParserStatisticsTrue ( ModelNode subsystem ) { if ( ( ( ( ( xmlFile . endsWith ( "1_0.xml" ) ) || ( xmlFile . endsWith ( "1_1.xml" ) ) ) || ( xmlFile . endsWith ( "1_2.xml" ) ) ) || ( xmlFile . endsWith ( "1_3.xml" ) ) ) || ( xmlFile . endsWith ( "1_4.xml" ) ) ) { <START_BUG> for ( Property containerProp : subsystem . get ( WILDCARD_PATH . getKey ( ) ) . asPropertyList ( ) ) { <END_BUG> Assert . assertTrue ( ( "cache-container=" + ( containerProp . getName ( ) ) ) , containerProp . getValue ( ) . get ( STATISTICS_ENABLED . getName ( ) ) . asBoolean ( ) ) ; for ( String key : containerProp . getValue ( ) . keys ( ) ) { if ( ( key . endsWith ( "-cache" ) ) && ( ! ( key . equals ( "default-cache" ) ) ) ) { ModelNode caches = containerProp . getValue ( ) . get ( key ) ; if ( caches . isDefined ( ) ) { for ( Property cacheProp : caches . asPropertyList ( ) ) { Assert . assertTrue ( ( ( ( ( ( "cache-container=" + ( containerProp . getName ( ) ) ) + "," ) + key ) + "=" ) + ( cacheProp . getName ( ) ) ) , containerProp . getValue ( ) . get ( CacheResourceDefinition . STATISTICS_ENABLED . getName ( ) ) . asBoolean ( ) ) ; } } } } } } } @ Test public void testParseAndMarshalModel ( ) throws Exception { } @ Test public void testDescribeHandler ( ) throws Exception { } }

Fix:
for ( Property containerProp : subsystem . get ( CONTAINER_PATH . getKey ( ) ) . asPropertyList ( ) ) {
Buggy code:
public abstract class Entity { protected int x ; protected int y ; protected int width ; protected int height ; protected Image image ; protected Rectangle bounds ; public Entity ( Image image , int x , int y ) { } public Entity ( Image image , int x , int y , int width , int height ) { } public abstract void initialize ( ) { } public abstract void update ( ) { } public abstract void draw ( Graphics g , Canvas canvas ) { } public boolean isIntersecting ( Entity entity ) { <START_BUG> bounds = new Rectangle ( x , y , image . getWidth ( null ) , image . getHeight ( null ) ) ; <END_BUG> return bounds . intersects ( entity . bounds ) ; } public Image getImage ( ) { } public void setImage ( Image image ) { } public int getX ( ) { } public void setX ( int x ) { } public int getY ( ) { } public void setY ( int y ) { } }

Fix:
bounds = new Rectangle ( x , y , width , height ) ;
Buggy code:
public class TreeUtils { public static void rotateNodeByComparator ( Node node , Comparator < Node > comparator ) { } public static Comparator < Node > createNodeDensityComparator ( ) { } public static Comparator < Node > createNodeDensityMinNodeHeightComparator ( ) { } public static Comparator < Node > createReverseNodeDensityMinNodeHeightComparator ( ) { } public static double getMinNodeHeight ( Node node ) { } public static double getDoubleMetaData ( Node node , String metaDataName ) { } public static Node getCommonAncestorNode ( Tree tree , Set < String > leafNodes ) { } private static int getCommonAncestorNode ( Tree tree , Node node , Set < String > leafNodes , int cardinality , Node [ ] mrca ) { } public static double getTreeLength ( Tree tree , Node node ) { } public static double getExternalLength ( Tree tree ) { } public static double getInternalLength ( Tree tree ) { double length = 0.0 ; <START_BUG> for ( Node node : tree . getExternalNodes ( ) ) { <END_BUG> length += node . getLength ( ) ; } return length ; } public static double [ ] getIntervals ( Tree tree ) { } public static Set < String > getDescendantLeaves ( Tree tree , Node node ) { } private static void getDescendantLeaves ( Tree tree , Node node , Set < String > set ) { } public static boolean isUltrametric ( Tree tree , double threshold ) { } public static boolean isUltrametric ( Tree tree ) { } public static boolean isBinary ( Tree tree ) { } public static String sortedNewickTopology ( Node node , boolean isTaxaLabel ) { } public static void preOrderTraversalList ( Tree tree , int [ ] postOrderList ) { } public static int preOrderTraversalList ( Tree tree , int idx , int [ ] postOrderList ) { } }

Fix:
for ( Node node : tree . getInternalNodes ( ) ) {
Buggy code:
public class UsersDao extends AbstractDao { private static UsersDao usersDao = null ; private UsersDao ( ) { } public static UsersDao getUsersDao ( ) { } public User findUserById ( int id ) { } public User findUserByLogin ( String login ) { } public User findUserByCredentials ( String login , String password ) { } @ SuppressWarnings ( "unchecked" ) public List < User > getAllUsers ( ) { } @ SuppressWarnings ( "unchecked" ) public List < User > findUsersByRole ( Role role ) { } public void assignRole ( User user , Role role ) { } public void removeRoles ( User user ) { <START_BUG> execute ( ( ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>users_roles<seq2seq4repair_space>WHERE<seq2seq4repair_space>user_id<seq2seq4repair_space>=<seq2seq4repair_space>" + ( user . getId ( ) ) ) + ")" ) ) ; <END_BUG> } public int createUser ( User user ) { } public void updateUser ( User user ) { } public void deleteUser ( User user ) { } }

Fix:
execute ( ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>users_roles<seq2seq4repair_space>WHERE<seq2seq4repair_space>user_id<seq2seq4repair_space>=<seq2seq4repair_space>" + ( user . getId ( ) ) ) ) ;
Buggy code:
public class S_Expression { private final String op ; private final S_Expression [ ] subexpressions ; public S_Expression ( String op , S_Expression ... subexpressions ) { } @ Override public String toString ( ) { <START_BUG> StringBuilder output = new StringBuilder ( ( '(' + ( op ) ) ) ; <END_BUG> for ( S_Expression subexpression : subexpressions ) { output . append ( '<seq2seq4repair_space>' ) . append ( subexpression . toString ( ) ) ; } output . append ( ')' ) ; return output . toString ( ) ; } public S_Expression deepCopy ( ) { } public void replace ( VarDef varDef , S_Expression newValue ) { } public LinkedList < VarDef > getUndefinedVars ( ) { } public void addVars ( LinkedList < VarDef > varList ) { } }

Fix:
StringBuilder output = new StringBuilder ( ) . append ( '(' ) . append ( op ) ;
Buggy code:
public class App2Test1 { private static final Log log = LogFactory . getLog ( App2Test1 . class ) ; public static void main ( String [ ] args ) throws Exception { <START_BUG> List < String > gets = Arrays . asList ( new String [ ] { "//app2?org.apache.wicket:bookmarkablePage=one:org.apache.wicket.threadtest.apps.app2.Home" } ) ; <END_BUG> SimpleGetCommand getCmd = new SimpleGetCommand ( gets , 5 ) ; Tester tester = new Tester ( getCmd , 50 , false ) ; tester . run ( ) ; } }

Fix:
List < String > gets = Arrays . asList ( new String [ ] { "//app2?wicket:bookmarkablePage=one:org.apache.wicket.threadtest.apps.app2.Home" } ) ;
Buggy code:
public class GuiUtil { public static final String EMPTY_STRING = "" ; public static final String SPACER_STRING = "<seq2seq4repair_space>|<seq2seq4repair_space>" ; public static final String PREFIX_WARNING = "Warning" ; public static final String PREFIX_ERROR = "Error" ; public static final String KEY_UP = "UP" ; public static final String KEY_DOWN = "DOWN" ; public static final Color COLOUR_TABLE_HEADERS = Color . rgb ( 26 , 188 , 156 ) ; public static final Color COLOUR_TEXT_WARNING = Color . ORANGE ; public static final Color COLOUR_TEXT_ERROR = Color . RED ; public static final Color COLOUR_TEXT_NORMAL = Color . WHITE ; public static final String COLOUR_BACKGROUND = "-fx-background-color:<seq2seq4repair_space>#2b3339;<seq2seq4repair_space>" ; public static final String COLOUR_WHITE = "-fx-fill:<seq2seq4repair_space>white;<seq2seq4repair_space>" ; public static final String COLOUR_GREEN = "-fx-fill:<seq2seq4repair_space>#1abc9c;<seq2seq4repair_space>" ; public static final String SIZE = "-fx-font-size:<seq2seq4repair_space>12.5px;<seq2seq4repair_space>" ; public static final String FONT = "-fx-font-family:<seq2seq4repair_space>'Open<seq2seq4repair_space>Sans',<seq2seq4repair_space>sans-serif;<seq2seq4repair_space>" ; public static SimpleDateFormat timeFormat = new SimpleDateFormat ( "HH:mm" ) ; public static SimpleDateFormat dateFormat = new SimpleDateFormat ( "EEE,<seq2seq4repair_space>dd<seq2seq4repair_space>MMM<seq2seq4repair_space>yyyy" ) ; public static SimpleDateFormat DateTimeFormat = new SimpleDateFormat ( "dd//MM<seq2seq4repair_space>HH:mm" ) ; public static boolean isHeader ( String str ) { } public static boolean isValidDate ( String dateString ) { } public static boolean isImportant ( String title , ObservableList < Task > data ) { } private static Task lookUpTask ( String title , ObservableList < Task > data ) { } private static int extractIndex ( String title ) throws NumberFormatException { } public static boolean isUnconfirmed ( Task task ) { <START_BUG> return ( task . getGroupId ( ) ) > 0 ; <END_BUG> } public static boolean isWarning ( String receivedString ) { } public static boolean isError ( String receivedString ) { } public static String getEnd ( Task task ) { } public static String guiTimeFormat ( GregorianCalendar calendar ) { } public static String guiDateFormat ( GregorianCalendar calendar ) { } public static String guiDateTimeFormat ( GregorianCalendar calendar ) { } public static String concatListToString ( List < String > suggestedList ) { } private static boolean isLastIndex ( List < String > suggestedList , int i ) { } private static String addWord ( String suggestedWords , String word ) { } private static String trimSuggestions ( String suggestedWords ) { } }

Fix:
return ( ( task . getGroupId ( ) ) != null ) && ( ( task . getGroupId ( ) ) > 0 ) ;
Buggy code:
public class JaxrSubsystemTestCase extends AbstractSubsystemBaseTest { public JaxrSubsystemTestCase ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { <START_BUG> return "<subsystem<seq2seq4repair_space>xmlns=\"urn:jboss:domain:jaxr:1.0\">" + ( ( "<connection-factory<seq2seq4repair_space>jndi-name=\"java:jboss//jaxr//ConnectionFactory\"//>" + "<juddi-server<seq2seq4repair_space>publish-url=\"http:////localhost:8080//juddi//publish\"<seq2seq4repair_space>query-url=\"http:////localhost:8080//juddi//query\"//>" ) + "<//subsystem>" ) ; <END_BUG> } }

Fix:
return "<subsystem<seq2seq4repair_space>xmlns=\"urn:jboss:domain:jaxr:1.0\">" + ( ( "<connection-factory<seq2seq4repair_space>jndi-name=\"java:jboss//jaxr//ConnectionFactory\"//>" + "<properties//>" ) + "<//subsystem>" ) ;
Buggy code:
public class MainActivity extends ControllerActivity < BabyData > { private CameraController cameraController ; private MainActivity . SectionsPagerAdapter pageAdapter ; private ViewPager pager ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public CameraController getCamera ( ) { } @ Override protected void onPause ( ) { } public void nextPage ( View view ) { } public void openURL ( View view ) { } public void share ( View view ) { Intent intent = new Intent ( Intent . ACTION_SEND ) ; intent . setType ( "text//plain" ) ; intent . addFlags ( FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET ) ; <START_BUG> intent . putExtra ( EXTRA_TEXT , "We’ve<seq2seq4repair_space>just<seq2seq4repair_space>helped<seq2seq4repair_space>the<seq2seq4repair_space>University<seq2seq4repair_space>of<seq2seq4repair_space>Nottingham<seq2seq4repair_space>in<seq2seq4repair_space>their<seq2seq4repair_space>research<seq2seq4repair_space>to<seq2seq4repair_space>automatically<seq2seq4repair_space>calculate<seq2seq4repair_space>the<seq2seq4repair_space>gestational<seq2seq4repair_space>age<seq2seq4repair_space>of<seq2seq4repair_space>premature<seq2seq4repair_space>babies.<seq2seq4repair_space>You<seq2seq4repair_space>can<seq2seq4repair_space>help,<seq2seq4repair_space>too!<seq2seq4repair_space>http:////cvl.cs.nott.ac.uk//resources//babyface//pages//app.html" ) ; <END_BUG> startActivity ( Intent . createChooser ( intent , "Share" ) ) ; } public void prevPage ( View view ) { } public class SectionsPagerAdapter extends FragmentPagerAdapter { private final List < PageFragment > fragments = new ArrayList < > ( ) ; private int pages = 4 ; public SectionsPagerAdapter ( FragmentManager fm ) { } @ Override public Fragment getItem ( int position ) { } @ Override public int getCount ( ) { } @ Override public CharSequence getPageTitle ( int position ) { } } }

Fix:
intent . putExtra ( EXTRA_TEXT , "We’ve<seq2seq4repair_space>just<seq2seq4repair_space>helped<seq2seq4repair_space>@GestStudy<seq2seq4repair_space>in<seq2seq4repair_space>their<seq2seq4repair_space>research<seq2seq4repair_space>to<seq2seq4repair_space>automatically<seq2seq4repair_space>calculate<seq2seq4repair_space>the<seq2seq4repair_space>gestational<seq2seq4repair_space>age<seq2seq4repair_space>of<seq2seq4repair_space>premature<seq2seq4repair_space>babies.<seq2seq4repair_space>You<seq2seq4repair_space>can<seq2seq4repair_space>help,<seq2seq4repair_space>too!<seq2seq4repair_space>http:////tinyurl.com//gestationalage-estimation" ) ;
Buggy code:
public class Factorization { private final FastByIDMap < Integer > userIDMapping ; private final FastByIDMap < Integer > itemIDMapping ; private final double [ ] [ ] userFeatures ; private final double [ ] [ ] itemFeatures ; public Factorization ( FastByIDMap < Integer > userIDMapping , FastByIDMap < Integer > itemIDMapping , double [ ] [ ] userFeatures , double [ ] [ ] itemFeatures ) { } public double [ ] getUserFeatures ( long userID ) throws NoSuchUserException { } public double [ ] getItemFeatures ( long itemID ) throws NoSuchItemException { } public Iterable < Map . Entry < Long , Integer > > getUserIDMappings ( ) { } public Iterable < Map . Entry < Long , Integer > > getItemIDMappings ( ) { } public int numFeatures ( ) { <START_BUG> return userFeatures [ 0 ] . length ; <END_BUG> } public int numUsers ( ) { } public int numItems ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
return ( userFeatures . length ) > 0 ? userFeatures [ 0 ] . length : 0 ;
Buggy code:
public class RestTest extends AbstractTest { String serverURL = Config . jcomparserServerUrl ; private static final String DEVELOPMENT_SQL_SEED_FILE = "src//main//resources//JEngineV2.sql" ; @ AfterClass public static void resetDatabase ( ) throws IOException , SQLException { clearDatabase ( ) ; ScriptRunner runner = new ScriptRunner ( Connection . getInstance ( ) . connect ( ) , false , false ) ; <START_BUG> runner . runScript ( new FileReader ( TEST_SQL_SEED_FILE ) ) ; <END_BUG> } @ Override protected Application configure ( ) { } @ Test public void testGetScenarioImage ( ) { } @ Test public void testGetScenarios ( ) { } @ Test public void testPostLaunchImport ( ) { } No newline ; at end ; of file ; }

Fix:
runner . runScript ( new FileReader ( RestTest . DEVELOPMENT_SQL_SEED_FILE ) ) ;
Buggy code:
public class SerialParser { private HttpUtils utils ; protected SerialParser ( ) { } protected void close ( ) { } protected String parse ( String [ ] urls , int urlIndex , List < NameValuePair > params , List < ExtendedLandmark > landmarks , GMSAsyncTask < ? , ? , ? > task , boolean close , String socialService , boolean removeIfExists ) { String errorMessage = null ; LandmarkManager landmarkManager = ConfigurationManager . getInstance ( ) . getLandmarkManager ( ) ; try { URI uri = new URI ( urls [ urlIndex ] ) ; if ( ! ( task . isCancelled ( ) ) ) { <START_BUG> List < ExtendedLandmark > received = utils . loadLandmarkList ( uri , params , true , "deflate" ) ; <END_BUG> if ( ! ( received . isEmpty ( ) ) ) { if ( landmarks . isEmpty ( ) ) { if ( landmarkManager != null ) { landmarkManager . addLandmarkListToDynamicLayer ( received ) ; } landmarks . addAll ( received ) ; } else { synchronized ( landmarks ) { Collection < ExtendedLandmark > filtered = Collections2 . filter ( received , new SerialParser . ExistsPredicate ( landmarks , removeIfExists , landmarkManager ) ) ; if ( landmarkManager != null ) { landmarkManager . addLandmarkListToDynamicLayer ( filtered ) ; } landmarks . addAll ( filtered ) ; } } } } } catch ( Exception ex ) { LoggerUtils . error ( "SerialParser.parse()<seq2seq4repair_space>exception:<seq2seq4repair_space>" , ex ) ; } finally { int responseCode = utils . getResponseCode ( ) ; if ( ( responseCode == ( HttpStatus . SC_UNAUTHORIZED ) ) && ( socialService != null ) ) { ISocialUtils service = OAuthServiceFactory . getSocialUtils ( socialService ) ; if ( service != null ) { service . logout ( ) ; } } else if ( ( responseCode >= 400 ) && ( ( urlIndex + 1 ) < ( urls . length ) ) ) { return parse ( urls , ( urlIndex + 1 ) , params , landmarks , task , close , socialService , removeIfExists ) ; } errorMessage = utils . getResponseCodeErrorMessage ( ) ; if ( close ) { close ( ) ; } } return errorMessage ; } private class ExistsPredicate implements Predicate < ExtendedLandmark > { private List < ExtendedLandmark > source ; private boolean removeIfExists = false ; private LandmarkManager landmarkManager ; public ExistsPredicate ( List < ExtendedLandmark > source , boolean removeIfExists , LandmarkManager landmarkManager ) { } public boolean apply ( ExtendedLandmark landmark ) { } } No newline ; at end ; of file ; }

Fix:
List < ExtendedLandmark > received = utils . loadLandmarkList ( uri , params , true , new String [ ] { "deflate" , "application//x-java-serialized-object" } ) ;
Buggy code:
public class DefaultRequestTargetResolverStrategy implements IRequestTargetResolverStrategy { private static Log log = LogFactory . getLog ( DefaultRequestTargetResolverStrategy . class ) ; public DefaultRequestTargetResolverStrategy ( ) { } public final IRequestTarget resolve ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveSharedResource ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveRenderedPage ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveListenerInterfaceTarget ( final RequestCycle requestCycle , final Page page , final String componentPath , final String interfaceName , final RequestParameters requestParameters ) { } protected IRequestTarget resolveBookmarkablePage ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { } protected IRequestTarget resolveHomePageTarget ( final RequestCycle requestCycle , final RequestParameters requestParameters ) { Session session = requestCycle . getSession ( ) ; Application application = session . getApplication ( ) ; try { Class homePageClass = application . getHomePage ( ) ; PageParameters parameters = new PageParameters ( requestParameters . getParameters ( ) ) ; BookmarkablePageRequestTarget homepageTarget = new BookmarkablePageRequestTarget ( homePageClass , parameters ) ; IRequestCodingStrategy requestCodingStrategy = requestCycle . getProcessor ( ) . getRequestCodingStrategy ( ) ; <START_BUG> String path = requestCodingStrategy . pathForTarget ( homepageTarget ) ; <END_BUG> if ( path != null ) { requestCycle . setRedirect ( true ) ; } return homepageTarget ; } catch ( MarkupException e ) { throw e ; } catch ( WicketRuntimeException e ) { throw new WicketRuntimeException ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>home<seq2seq4repair_space>page" , e ) ; } } protected IRequestTarget resolveExternalResource ( RequestCycle requestCycle ) { } }

Fix:
CharSequence path = requestCodingStrategy . pathForTarget ( homepageTarget ) ;
Buggy code:
public class AliasUtil { @ SuppressWarnings ( "rawtypes" ) public static Class < ? extends Enum > getEnum ( final String name ) { <START_BUG> return FrameworkServiceImpl . getEntityService ( ) . requestEnum ( name ) ; <END_BUG> } public static String getNamstorageEntry ( final String name , final int entry ) { } }

Fix:
return FrameworkServiceImpl . getEntityService ( ) . requestEnumForName ( name ) ;
Buggy code:
public class CheckBoxMultipleChoice extends ListMultipleChoice { private static final long serialVersionUID = 1L ; private class SuffixChange extends Change { private static final long serialVersionUID = 1L ; final String prevSuffix ; SuffixChange ( String prevSuffix ) { } public void undo ( ) { } } private class PrefixChange extends Change { private static final long serialVersionUID = 1L ; final String prevPrefix ; PrefixChange ( String prevSuffix ) { } public void undo ( ) { } } private String prefix = "" ; private String suffix = "<br<seq2seq4repair_space>//>\n" ; public CheckBoxMultipleChoice ( final String id ) { } public CheckBoxMultipleChoice ( final String id , final List choices ) { } public CheckBoxMultipleChoice ( final String id , final List choices , final IChoiceRenderer renderer ) { } public CheckBoxMultipleChoice ( final String id , IModel model , final List choices ) { } public CheckBoxMultipleChoice ( final String id , IModel model , final List choices , final IChoiceRenderer renderer ) { } public CheckBoxMultipleChoice ( String id , IModel choices ) { } public CheckBoxMultipleChoice ( String id , IModel model , IModel choices ) { } public CheckBoxMultipleChoice ( String id , IModel choices , IChoiceRenderer renderer ) { } public CheckBoxMultipleChoice ( String id , IModel model , IModel choices , IChoiceRenderer renderer ) { } public String getPrefix ( ) { } public final CheckBoxMultipleChoice setPrefix ( final String prefix ) { } public String getSuffix ( ) { } public final CheckBoxMultipleChoice setSuffix ( final String suffix ) { } protected final void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { final StringBuffer buffer = new StringBuffer ( ) ; final List choices = getChoices ( ) ; for ( int index = 0 ; index < ( choices . size ( ) ) ; index ++ ) { final Object choice = choices . get ( index ) ; final String label = getChoiceRenderer ( ) . getDisplayValue ( choice ) ; if ( label != null ) { buffer . append ( getPrefix ( ) ) ; String id = getChoiceRenderer ( ) . getIdValue ( choice , index ) ; <START_BUG> buffer . append ( ( ( ( ( ( ( ( "<input<seq2seq4repair_space>name=\"" + ( getInputName ( ) ) ) + "\"" ) + "<seq2seq4repair_space>type=\"checkbox\"" ) + ( isSelected ( choice , index ) ? "<seq2seq4repair_space>checked" : "" ) ) + "<seq2seq4repair_space>value=\"" ) + id ) + "\">" ) ) ; <END_BUG> String display = getLocalizer ( ) . getString ( ( ( ( getId ( ) ) + "." ) + label ) , this , label ) ; String escaped = Strings . escapeMarkup ( display , false , true ) ; buffer . append ( escaped ) ; buffer . append ( getSuffix ( ) ) ; } } replaceComponentTagBody ( markupStream , openTag , buffer . toString ( ) ) ; } }

Fix:
buffer . append ( ( ( ( ( ( ( ( "<input<seq2seq4repair_space>name=\"" + ( getInputName ( ) ) ) + "\"" ) + "<seq2seq4repair_space>type=\"checkbox\"" ) + ( isSelected ( choice , index ) ? "<seq2seq4repair_space>checked=\"checked\"" : "" ) ) + "<seq2seq4repair_space>value=\"" ) + id ) + "\">" ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//auth" ) public class AuthController { @ Autowired private GebruikerService service ; @ RequestMapping ( value = "login" , method = RequestMethod . POST ) public LoginResponse login ( @ RequestBody Gebruiker credentials ) throws GebruikerNotFound , InvalidCredentials { Gebruiker gebruiker = service . findByLogin ( credentials ) ; <START_BUG> return new LoginResponse ( gebruiker . getId ( ) , gebruiker . getGebruikersnaam ( ) , Jwts . builder ( ) . setSubject ( String . valueOf ( gebruiker . getId ( ) ) ) . claim ( "roles" , gebruiker . getRollen ( ) . stream ( ) . map ( Rol :: getNaam ) . collect ( Collectors . toList ( ) ) ) . setIssuedAt ( new Date ( ) ) . signWith ( HS256 , "kandoe" ) . compact ( ) ) ; <END_BUG> } @ RequestMapping ( value = "register" , method = RequestMethod . POST ) public void register ( @ RequestBody Gebruiker credentials ) { } }

Fix:
return new LoginResponse ( gebruiker . getId ( ) , gebruiker . getGebruikersnaam ( ) , Jwts . builder ( ) . setSubject ( String . valueOf ( gebruiker . getId ( ) ) ) . claim ( "rollen" , gebruiker . getRollen ( ) . stream ( ) . map ( Rol :: getNaam ) . collect ( Collectors . toList ( ) ) ) . setIssuedAt ( new Date ( ) ) . signWith ( HS256 , "kandoe" ) . compact ( ) ) ;
Buggy code:
public class WithDataPointMethod { @ RunWith ( Theories . class ) public static class HasDataPointMethod { @ DataPoint public int oneHundred ( ) { } @ Theory public void allIntsOk ( int x ) { } } @ RunWith ( Theories . class ) public static class HasUglyDataPointMethod { @ DataPoint public int oneHundred ( ) { } @ DataPoint public int oneUglyHundred ( ) { } @ Theory public void allIntsOk ( int x ) { } } @ Test public void pickUpDataPointMethods ( ) { } @ Test public void ignoreExceptionsFromDataPointMethods ( ) { } @ RunWith ( Theories . class ) public static class DataPointMethodReturnsMutableObject { @ DataPoint public List < Object > empty ( ) { } public static int ONE = 1 ; public static int TWO = 2 ; @ Theory public void everythingsEmpty ( List < Object > first , int number ) { } } @ Test public void mutableObjectsAreCreatedAfresh ( ) { } @ RunWith ( Theories . class ) public static class HasDateMethod { @ DataPoint public int oneHundred ( ) { } public Date notADataPoint ( ) { } @ Theory public void allIntsOk ( int x ) { } @ Theory public void onlyStringsOk ( String s ) { } @ Theory public void onlyDatesOk ( Date d ) { } } @ Test public void ignoreDataPointMethodsWithWrongTypes ( ) throws Exception { } @ Test public void ignoreDataPointMethodsWithoutAnnotation ( ) throws Throwable { } private List < PotentialAssignment > potentialValues ( Method method ) throws Exception { <START_BUG> return new org . junit . experimental . theories . internal . AssignmentRequest ( new WithDataPointMethod . HasDateMethod ( ) , org . junit . experimental . theories . ParameterSignature . signatures ( method ) . get ( 0 ) ) . getPotentialAssignments ( ) ; <END_BUG> } private List < Failure > failures ( Class < ? > type ) { } private Matcher < Iterable < Failure > > empty ( ) { } }

Fix:
return new org . junit . experimental . theories . internal . AssignmentRequest ( WithDataPointMethod . HasDateMethod . class , org . junit . experimental . theories . ParameterSignature . signatures ( method ) . get ( 0 ) ) . getPotentialAssignments ( ) ;
Buggy code:
public class OSGiPlatformAbstraction implements PlatformAbstraction , ServiceListener { private final BundleContext context ; private LogService log = new OSGiPlatformAbstraction . NullPatternLogService ( ) ; OSGiPlatformAbstraction ( BundleContext context ) throws InvalidSyntaxException { } public Filter createFilter ( String filterString ) { } public void logDebug ( String message ) { } public void logDebug ( String message , Throwable exception ) { } public void logError ( String message ) { } public void logError ( String message , Throwable exception ) { } public void logTraceMessage ( String message ) { } public void logTraceDrop ( String message ) { } public void logTraceReg ( String message ) { } public void logWarning ( String message ) { } public void logWarning ( String message , Throwable exception ) { } public void serviceChanged ( final ServiceEvent event ) { } private class NullPatternLogService implements LogService { public void log ( int level , String message ) { } public void log ( int level , String message , Throwable exception ) { <START_BUG> log ( level , ( message + ( exception . getMessage ( ) ) ) ) ; <END_BUG> } public void log ( ServiceReference sr , int level , String message ) { } public void log ( ServiceReference sr , int level , String message , Throwable t ) { } } }

Fix:
log ( level , ( ( message + "<seq2seq4repair_space>" ) + ( exception . toString ( ) ) ) ) ;
Buggy code:
public class Snippet325 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new GridLayout ( ) ) ; shell . setText ( "StyledText:<seq2seq4repair_space>Variable<seq2seq4repair_space>tab<seq2seq4repair_space>stops" ) ; Snippet325 . Ruler ruler = new Snippet325 . Ruler ( shell , SWT . NONE ) ; GridData data = new GridData ( ) ; data . heightHint = 10 ; data . horizontalAlignment = SWT . FILL ; ruler . setLayoutData ( data ) ; ruler . setBackground ( display . getSystemColor ( COLOR_INFO_BACKGROUND ) ) ; StyledText styledText = new StyledText ( shell , ( ( ( ( SWT . FULL_SELECTION ) | ( SWT . BORDER ) ) | ( SWT . H_SCROLL ) ) | ( SWT . V_SCROLL ) ) ) ; <START_BUG> styledText . setText ( "0\t1\t2\t3\t4\nDrag\tthe\ttab\tmarks\ton\ttop\tto\tchange\tthe\tpositoin\tof\tthe\ttab\tstops" ) ; <END_BUG> styledText . setTabStops ( new int [ ] { 30 , 70 , 90 , 140 } ) ; styledText . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; ruler . setEditor ( styledText ) ; shell . setSize ( 800 , 400 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } public static class Ruler extends Canvas { StyledText styledText ; int hover = - 1 ; public Ruler ( Composite parent , int style ) { } public void setEditor ( StyledText editor ) { } void handleMouseMove ( Event e ) { } void handleDragMark ( Event e ) { } void handlePaint ( Event e ) { } } }

Fix:
styledText . setText ( "0\t1\t2\t3\t4\nDrag\tthe\ttab\tmarks\ton\ttop\tto\tchange\tthe\tposition\tof\tthe\ttab\tstops" ) ;
Buggy code:
public class EditorMain extends Application { @ FXML private BorderPane root ; @ FXML private ScrollPane mapPanel ; private EventBus eventBus = new EventBus ( ) ; @ Override public void start ( Stage primaryStage ) throws Exception { } @ FXML private void initialize ( ) { new TileSet ( Paths . get ( "Sample<seq2seq4repair_space>Data" ) . resolve ( "tileset" ) . resolve ( "tile_config.json" ) ) ; eventBus . register ( this ) ; eventBus . register ( new MapLoader ( eventBus ) ) ; FXMLLoader statusBarLoader = new FXMLLoader ( getClass ( ) . getResource ( "//fxml//statusBar.fxml" ) ) ; try { statusBarLoader . load ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } eventBus . register ( statusBarLoader . < MapDisplay > getController ( ) ) ; statusBarLoader . < StatusBar > getController ( ) . setEventBus ( eventBus ) ; root . setBottom ( statusBarLoader . < AnchorPane > getRoot ( ) ) ; FXMLLoader loader = new FXMLLoader ( getClass ( ) . getResource ( "//fxml//mapCanvasses.fxml" ) ) ; try { loader . load ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } eventBus . register ( loader . < MapDisplay > getController ( ) ) ; loader . < MapDisplay > getController ( ) . setEventBus ( eventBus ) ; mapPanel . setContent ( loader . < ScrollPane > getRoot ( ) ) ; <START_BUG> eventBus . post ( new LoadMapEvent ( Paths . get ( "Sample<seq2seq4repair_space>Data" ) . resolve ( "house05.json" ) ) ) ; <END_BUG> } }

Fix:
eventBus . post ( new LoadMapEvent ( Paths . get ( "Sample<seq2seq4repair_space>Data" ) . resolve ( "fortified_house01.json" ) ) ) ;
Buggy code:
public class ChatActivity extends FragmentActivity { private CircleTitleBar titleBar ; private String type ; private String title ; private String targetId ; private void getParams ( Intent intent ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; getParams ( getIntent ( ) ) ; getIntent ( ) . setData ( Uri . parse ( "rong:////io.rong.imkit.demo" ) . buildUpon ( ) . appendPath ( "conversation" ) . appendPath ( type . toLowerCase ( ) ) . appendQueryParameter ( "targetId" , targetId ) . appendQueryParameter ( "title" , title ) . build ( ) ) ; setContentView ( activity_circle_chatactivity ) ; MainApplication . refreshRong ( ) ; this . titleBar = ( ( CircleTitleBar ) ( this . findViewById ( activity_circle_chatactivity_titlebar ) ) ) ; titleBar . setText ( title ) ; if ( ! ( this . type . equals ( CHATROOM . toString ( ) ) ) ) { titleBar . showRight ( ) ; titleBar . setRightButton ( "" , icon_circle_chat , new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( ChatActivity . this , ChatConfigActivity . class ) ; intent . putExtra ( "type" , type ) ; intent . putExtra ( "targetId" , targetId ) ; startActivity ( intent ) ; } } ) ; } else { titleBar . hideRight ( ) ; } RongIM . setConversationBehaviorListener ( new RongIM . ConversationBehaviorListener ( ) { @ Override public boolean onClickUserPortrait ( Context context , RongIMClient . ConversationType conversationType , RongIMClient . UserInfo userInfo ) { String json = SharedPreferencesUtil . getInstanse ( UIContext ) . getStringByKey ( ( ( SharedPreferencesUtil . CONTACTS ) + ( userInfo . getUserId ( ) ) ) ) ; List < CUserModel > userModels = new Gson ( ) . fromJson ( json , new TypeToken < List < CUserModel > > ( ) { } . getType ( ) ) ; String userId = "" ; if ( userInfo . getUserId ( ) . equals ( userInfo . getRongCloudId ( ) ) ) { userId = String . valueOf ( userInfo . getUserId ( ) ) ; } else { for ( int i = 0 ; i < ( userModels . size ( ) ) ; i ++ ) { if ( userModels . get ( i ) . getUserName ( ) . equals ( userInfo . getName ( ) ) ) { userId = String . valueOf ( userModels . get ( i ) . userId ) ; break ; } } } ActivityUtils . startNameCardActivity ( context , Long . parseLong ( userId ) ) ; return true ; } @ Override public boolean onClickMessage ( Context context , RongIMClient . Message message ) { return false ; } } ) ; <START_BUG> titleBar . setLeftButton ( "返回" , 0 , new View . OnClickListener ( ) { <END_BUG> @ Override public void onClick ( View v ) { finish ( ) ; } } ) ; } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override protected void onNewIntent ( Intent intent ) { } }

Fix:
titleBar . setLeftButton ( "" , bg_btn_arrow_left , new View . OnClickListener ( ) {
Buggy code:
public class CompletionUnitStructureRequestor extends CompilationUnitStructureRequestor { private ASTNode assistNode ; private Map bindingCache ; private Map elementCache ; private Map elementWithProblemCache ; public CompletionUnitStructureRequestor ( ICompilationUnit unit , CompilationUnitElementInfo unitInfo , Parser parser , ASTNode assistNode , Map bindingCache , Map elementCache , Map elementWithProblemCache , Map newElements ) { } protected Annotation createAnnotation ( JavaElement parent , String name ) { } protected SourceField createField ( JavaElement parent , ISourceElementRequestor . FieldInfo fieldInfo ) { } protected ImportContainer createImportContainer ( ICompilationUnit parent ) { } protected ImportDeclaration createImportDeclaration ( ImportContainer parent , String name , boolean onDemand ) { } protected Initializer createInitializer ( JavaElement parent ) { } protected SourceMethod createMethod ( JavaElement parent , ISourceElementRequestor . MethodInfo methodInfo ) { } protected PackageDeclaration createPackageDeclaration ( JavaElement parent , String name ) { } protected SourceType createType ( JavaElement parent , ISourceElementRequestor . TypeInfo typeInfo ) { } protected TypeParameter createTypeParameter ( JavaElement parent , String name ) { } protected IAnnotation enterAnnotation ( org . eclipse . jdt . internal . compiler . ast . Annotation annotation , AnnotatableInfo parentInfo , JavaElement parentHandle ) { if ( annotation instanceof CompletionOnMarkerAnnotationName ) { <START_BUG> if ( CompletionUnitStructureRequestor . hasEmptyName ( annotation . type , assistNode ) ) { <END_BUG> super . enterAnnotation ( annotation , null , parentHandle ) ; return null ; } } return super . enterAnnotation ( annotation , parentInfo , parentHandle ) ; } protected Object getMemberValue ( MemberValuePair memberValuePair , Expression expression ) { } protected IMemberValuePair [ ] getMemberValuePairs ( org . eclipse . jdt . internal . compiler . ast . MemberValuePair [ ] memberValuePairs ) { } protected static boolean hasEmptyName ( TypeReference reference , ASTNode assistNode ) { } }

Fix:
if ( CompletionUnitStructureRequestor . hasEmptyName ( annotation . type , this . assistNode ) ) {
Buggy code:
public class JMSSubsystemParser implements XMLStreamConstants , XMLElementReader < ParseResult < ExtensionContext . SubsystemConfiguration < JMSSubsystemElement > > > { private static final JMSSubsystemParser INSTANCE = new JMSSubsystemParser ( ) ; static JMSSubsystemParser getInstance ( ) { } private JMSSubsystemParser ( ) { } public void readElement ( XMLExtendedStreamReader reader , ParseResult < SubsystemConfiguration < JMSSubsystemElement > > result ) throws XMLStreamException { } static void processConnectionFactory ( final XMLExtendedStreamReader reader , List < AbstractSubsystemUpdate < JMSSubsystemElement , ? > > updates ) throws XMLStreamException { } static void processJMSQueue ( final XMLExtendedStreamReader reader , List < AbstractSubsystemUpdate < JMSSubsystemElement , ? > > updates ) throws XMLStreamException { } static void processJMSTopic ( final XMLExtendedStreamReader reader , List < AbstractSubsystemUpdate < JMSSubsystemElement , ? > > updates ) throws XMLStreamException { } static List < ConnectionFactoryConnectorRef > processConnectors ( final XMLExtendedStreamReader reader ) throws XMLStreamException { final List < ConnectionFactoryConnectorRef > connectors = new ArrayList < ConnectionFactoryConnectorRef > ( ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { String connector = null ; String backup = null ; int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { final String value = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case CONNECTOR_NAME : { connector = value . trim ( ) ; break ; } case CONNECTOR_BACKUP_NAME : { backup = value . trim ( ) ; break ; } default : { throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } } <START_BUG> if ( connector != null ) { <END_BUG> throw ParseUtils . missingRequired ( reader , Collections . singleton ( CONNECTOR_NAME ) ) ; } final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( element != ( Element . CONNECTOR_REF ) ) { throw ParseUtils . unexpectedElement ( reader ) ; } ParseUtils . requireNoContent ( reader ) ; final ConnectionFactoryConnectorRef ref = new ConnectionFactoryConnectorRef ( ) ; ref . setConnectorName ( connector ) ; if ( backup != null ) { ref . setBackupName ( backup ) ; } connectors . add ( ref ) ; } return connectors ; } static Boolean textAsBoolean ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } static Integer textAsInt ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } static Long textAsLong ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } static String elementText ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } }

Fix:
if ( connector == null ) {
Buggy code:
public class URLMetaDataIterator implements MetaDataIterator { private final URL _url ; private boolean _iterated = false ; public URLMetaDataIterator ( URL url ) { } public boolean hasNext ( ) { } <START_BUG> public Object next ( ) throws IOException { <END_BUG> if ( ! ( hasNext ( ) ) ) throw new IllegalStateException ( ) ; _iterated = true ; return _url ; } public InputStream getInputStream ( ) throws IOException { } public File getFile ( ) { } public void close ( ) { } }

Fix:
public URL next ( ) throws IOException {
Buggy code:
public class Receiver implements Runnable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private volatile boolean active ; private final Session session ; private final MessageConsumer consumer ; private final Connection conn ; private final boolean useResMsgIdAsCorrelId ; private Receiver ( ConnectionFactory factory , Destination receiveQueue , String principal , String credentials , boolean useResMsgIdAsCorrelId ) throws JMSException { } public static Receiver createReceiver ( ConnectionFactory factory , Destination receiveQueue , String principal , String credentials , boolean useResMsgIdAsCorrelId ) throws JMSException { Receiver receiver = new Receiver ( factory , receiveQueue , principal , credentials , useResMsgIdAsCorrelId ) ; <START_BUG> Thread thread = new Thread ( receiver ) ; <END_BUG> thread . start ( ) ; return receiver ; } public void run ( ) { } public void deactivate ( ) { } }

Fix:
Thread thread = new Thread ( receiver , "JMS<seq2seq4repair_space>Receiever" ) ;
Buggy code:
public class Parser { private static Pattern POSSESSIVE_QUANTIFIERS = Pattern . compile ( "^(.*)(\\*|\\*\\?|\\+|\\+\\?|\\?)$" ) ; private static Pattern RANGE_QUANTIFIERS = Pattern . compile ( "^(.*)\\{(\\d+)\\,(\\d+)\\}$" ) ; private static Pattern NUMBER_QUANTIFIER = Pattern . compile ( "^(.*)\\{(\\d+)\\}$" ) ; private static Pattern BALANCED_UNION = Pattern . compile ( "^\\((.*)\\)\\((.*)\\)$" ) ; private static Pattern BALANCED_INTERSECTION = Pattern . compile ( "^(\\(.*\\))\\|(\\(.*\\))$" ) ; private static Pattern IMPLIED_INTERSECTION = Pattern . compile ( "^(.*)\\|(.*)$" ) ; private static Pattern UNBALANCED_INTERSECTION = Pattern . compile ( "^(.*)\\|\\((\\(.*\\))\\)$" ) ; private static Pattern UNBALANCED_UNION = Pattern . compile ( "^(.+)(\\(.*\\))$" ) ; private static Pattern EXPLICIT_GROUP = Pattern . compile ( "^\\((.*)\\)$" ) ; private static Pattern IMPLIED_GROUP = Pattern . compile ( "^([^()]*)(\\(.*\\))$" ) ; private static Pattern CHARACTER_CLASS = Pattern . compile ( "^(.*)\\[(.*)\\]$" ) ; private static Pattern CUSTOM_RANDOM = Pattern . compile ( "^(.*)\\[\\:(.*)\\:\\]$" ) ; private static Pattern RESERVED_RANDOM = Pattern . compile ( "^(.*)\\\\([wsdc])$" ) ; private static Pattern LITERAL_PATTERN = Pattern . compile ( "^(.*)\\\\(.)$" ) ; private static Pattern SPACE = Pattern . compile ( "(.*)(.|\\s)$" ) ; public static Sexp parse ( String pattern ) { } private static Sexp parseQuantified ( String source , Quantifier quantifier ) { } private static Sexp quantifyRhs ( Sexp sexp , Quantifier quantifier ) { } private static Sexp quantify ( Sexp sexp , Quantifier quantifier ) { } private static Sexp union ( Sexp lhs , Sexp ... rhs ) { } private static Sexp intersection ( Sexp lhs , Sexp rhs ) { } private static Sexp parseCharacterClass ( String source ) { } private static Sexp parseCharacterClass ( String pattern , Sexp sexp ) { Matcher matcher = Pattern . compile ( "(.*)(.\\-.)(.*)" ) . matcher ( pattern ) ; if ( matcher . matches ( ) ) { String [ ] range = matcher . group ( 2 ) . split ( "-" ) ; Parser . parseCharacterClass ( matcher . group ( 1 ) , sexp ) ; sexp . add ( new Sexp ( Exp . RANGE ) . add ( Parser . literal ( range [ 0 ] ) ) . add ( Parser . literal ( range [ 1 ] ) ) ) ; Parser . parseCharacterClass ( matcher . group ( 3 ) , sexp ) ; } else if ( ! ( pattern . isEmpty ( ) ) ) { <START_BUG> for ( String token : pattern . split ( "" ) ) { <END_BUG> sexp . add ( Parser . literal ( token ) ) ; } } return sexp ; } private static Sexp literal ( String word ) { } private static Sexp random ( String value ) { } }

Fix:
for ( String token : pattern . split ( "(?!^)" ) ) {
Buggy code:
public class Main { public static void main ( String [ ] args ) { <START_BUG> System . out . println ( "HI<seq2seq4repair_space>DAVID<seq2seq4repair_space>:D:DDDDDDDDDDDDD" ) ; <END_BUG> } }

Fix:
System . out . println ( "PENIS" ) ;
Buggy code:
class bunny { private int age ; private String gender ; private Boolean rabbies ; bunny ( int age , String gender ) { } private Boolean give_rabbies ( ) { Random rand_gen = new Random ( ) ; int rand_num = rand_gen . nextInt ( 9999999 ) ; <START_BUG> if ( ( ( age ) > ( 3 :: age ) ) < 7 ) { <END_BUG> if ( ( rand_num % 7 ) == 3 ) { return true ; } } else if ( ( age ) <= 3 ) { if ( ( rand_num % 29 ) == 3 ) { return true ; } } else if ( ( age ) > 7 ) { if ( ( rand_num % 2 ) == 0 ) { return true ; } } return false ; } }

Fix:
if ( ( ( age ) > 3 ) && ( ( age ) < 7 ) ) {
Buggy code:
public class LoginConfigGui extends AbstractConfigGui { JTextField username = new JTextField ( 15 ) ; JTextField password = new JPasswordField ( 15 ) ; private boolean displayName = true ; public LoginConfigGui ( ) { } public LoginConfigGui ( boolean displayName ) { } public String getStaticLabel ( ) { } public void configure ( TestElement element ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement element ) { } private void init ( ) { this . setLayout ( new VerticalLayout ( 1 , VerticalLayout . LEFT ) ) ; if ( displayName ) { <START_BUG> this . add ( getNamePanel ( ) ) ; <END_BUG> } this . add ( createUsernamePanel ( ) ) ; this . add ( createPasswordPanel ( ) ) ; } private JPanel createUsernamePanel ( ) { } private JPanel createPasswordPanel ( ) { } }

Fix:
this . add ( makeTitlePanel ( ) ) ;
Buggy code:
public class PasswordEditor extends PropertyEditorSupport implements ActionListener , FocusListener { private JPasswordField textField ; private String initialValue = "" ; protected PasswordEditor ( ) { } public String getAsText ( ) { <START_BUG> return textField . getPassword ( ) . toString ( ) ; <END_BUG> } public void setAsText ( String value ) { } public Object getValue ( ) { } public void setValue ( Object value ) { } public Component getCustomEditor ( ) { } public boolean supportsCustomEditor ( ) { } public void firePropertyChange ( ) { } public void actionPerformed ( ActionEvent e ) { } public void focusGained ( FocusEvent e ) { } public void focusLost ( FocusEvent e ) { } }

Fix:
return new String ( textField . getPassword ( ) ) ;
Buggy code:
public class Snippet291 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; final Tree tree = new Tree ( shell , SWT . BORDER ) ; for ( int i = 0 ; i < 5 ; i ++ ) { <START_BUG> TreeItem treeItem = new TreeItem ( tree , SWT . NULL ) ; <END_BUG> treeItem . setText ( ( "item" + i ) ) ; for ( int j = 0 ; j < 3 ; j ++ ) { TreeItem subItem = new TreeItem ( treeItem , SWT . NONE ) ; subItem . setText ( ( ( "item" + i ) + j ) ) ; } } tree . getAccessible ( ) . addAccessibleListener ( new AccessibleAdapter ( ) { public void getName ( AccessibleEvent e ) { if ( ( e . childID ) == ( ACC . CHILDID_SELF ) ) { e . result = "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>Accessible<seq2seq4repair_space>Name<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>Tree" ; } else { TreeItem item = ( ( TreeItem ) ( display . findWidget ( tree , e . childID ) ) ) ; if ( item != null ) { e . result = "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>Accessible<seq2seq4repair_space>Name<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>TreeItem:<seq2seq4repair_space>" + ( item . getText ( ) ) ; } } } } ) ; shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
TreeItem treeItem = new TreeItem ( tree , SWT . NONE ) ;