nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AccessInterceptor extends BaseInterceptor { int debug = 0 ; ContextManager cm ; int secMapNote ; int reqRolesNote ; public AccessInterceptor ( ) { } public void setDebug ( int level ) { } void log ( String msg ) { } public void setContextManager ( ContextManager cm ) { } public void addContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void removeContext ( ContextManager cm , Context ctx ) throws TomcatException { } public void removeContainer ( Container ct ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { } public int authorize ( Request req , Response response ) { Context ctx = req . getContext ( ) ; SecurityConstraints ctxSec = ( ( SecurityConstraints ) ( ctx . getContainer ( ) . getNote ( secMapNote ) ) ) ; if ( ( ctxSec . patterns ) == 0 ) return 0 ; String reqURI = req . getRequestURI ( ) ; String ctxPath = ctx . getPath ( ) ; String path = reqURI . substring ( ctxPath . length ( ) ) ; String method = req . getMethod ( ) ; if ( ( ctx . getDebug ( ) ) > 0 ) log ( ( "ACCESS:<seq2seq4repair_space>checking<seq2seq4repair_space>" + path ) ) ; for ( int i = 0 ; i < ( ctxSec . patterns ) ; i ++ ) { Container ct = ctxSec . securityPatterns [ i ] ; if ( match ( ct , path , method ) ) { log ( ( ( ( ( ( ( ( "ACCESS:<seq2seq4repair_space>matched<seq2seq4repair_space>" + ( ct . getPath ( ) ) ) + "<seq2seq4repair_space>" ) + ( ct . getMethods ( ) ) ) + "<seq2seq4repair_space>" ) + ( ct . getTransport ( ) ) ) + "<seq2seq4repair_space>" ) + ( ct . getRoles ( ) ) ) ) ; String [ ] roles = ct . getRoles ( ) ; String transport = ct . getTransport ( ) ; <START_BUG> if ( ( transport != null ) && ( ( "INTEGRAL" . equals ( transport ) ) || ( "CONFIDENTAIL" . equals ( transport ) ) ) ) { <END_BUG> log ( ( "ACCESS:<seq2seq4repair_space>SSL<seq2seq4repair_space>required<seq2seq4repair_space>" + req ) ) ; } req . setNote ( reqRolesNote , roles ) ; } } return 0 ; } boolean match ( Container ct , String path , String method ) { } }

Fix:
if ( ( transport != null ) && ( ( "INTEGRAL" . equals ( transport ) ) || ( "CONFIDENTIAL" . equals ( transport ) ) ) ) {
Buggy code:
@ Repository public class TVSeriesService { @ Autowired private MongoTemplate mongoTemplate ; @ Autowired private SeasonService seasonService ; public List < TVSeriesModel > all ( ) { } public TVSeriesModel create ( String title , String description , String original , String producer , String countries , String genres ) { TVSeriesModel model = new TVSeriesModel ( ) ; model . setTitle ( title ) ; model . setDescription ( description ) ; model . setOriginalTitle ( original ) ; model . setProducer ( producer ) ; for ( String country : countries . split ( ",<seq2seq4repair_space>" ) ) { model . getCountries ( ) . add ( country ) ; } for ( String genre : genres . split ( ",<seq2seq4repair_space>" ) ) { <START_BUG> model . getCountries ( ) . add ( genre ) ; <END_BUG> } mongoTemplate . save ( model ) ; return model ; } public void update ( ObjectId id , String title , String description , String original , String producer , String countries , String genres ) { } public void remove ( ObjectId id ) { } public TVSeriesModel findById ( ObjectId id ) { } }

Fix:
model . getGenres ( ) . add ( genre ) ;
Buggy code:
@ WebServlet ( name = "PhotosServlet" , urlPatterns = { "//photos" } ) public class PhotosServlet extends HttpServlet { protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ParseException , ServletException { } public String addImagesToAlbumGallery ( List < Photo > imageList ) { } public String addMonthGalleries ( List < Photo > imageList ) { String html = "<div<seq2seq4repair_space>id=\"accordion\">" ; Calendar preIns = null ; Calendar compDate = Calendar . getInstance ( ) ; boolean fst = true ; for ( Photo image : imageList ) { compDate . setTime ( image . getUploadDate ( ) ) ; if ( preIns == null ) { preIns = Calendar . getInstance ( ) ; } <START_BUG> if ( ( ( preIns . get ( Calendar . YEAR ) ) != ( compDate . get ( Calendar . YEAR ) ) ) || ( ( preIns . get ( Calendar . MONTH ) ) != ( compDate . get ( Calendar . MONTH ) ) ) ) { <END_BUG> if ( ! fst ) html += "<//div>" ; fst = false ; html += ( "<h3<seq2seq4repair_space>style=\"font-family:arial;<seq2seq4repair_space>font-weight:bold;<seq2seq4repair_space>font-size:30px;\">" + ( new SimpleDateFormat ( "yyyy<seq2seq4repair_space>MMM" ) . format ( image . getUploadDate ( ) ) . toUpperCase ( ) ) ) + "<//h3>" ; html += "<div<seq2seq4repair_space>style=\"height:auto;\">" ; } preIns . setTime ( image . getUploadDate ( ) ) ; } html += "<//div><//div>" ; return html ; } public String addImagesToGallery ( List < Photo > imageList ) { } private String getBase64Image ( Photo image ) { } @ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } @ Override public String getServletInfo ( ) { } }

Fix:
if ( ( ( ( preIns . get ( Calendar . YEAR ) ) != ( compDate . get ( Calendar . YEAR ) ) ) || ( ( preIns . get ( Calendar . MONTH ) ) != ( compDate . get ( Calendar . MONTH ) ) ) ) || fst ) {
Buggy code:
public class PacketUtils { public static boolean debugPackets ( Player player ) { } @ SuppressWarnings ( "unchecked" ) public static < T extends Packet > boolean registerInListener ( final Class < T > type , Player player , Predicate < T > listener ) { PlayerConnection connection = ( ( org . bukkit . craftbukkit . v1_8_R2 . entity . CraftPlayer ) ( player ) ) . getHandle ( ) . playerConnection ; PacketListener old = connection . networkManager . getPacketListener ( ) ; <START_BUG> if ( ! ( ( old instanceof PacketListenerPlayIn ) && ( old instanceof PacketListenerPlayOut ) ) ) <END_BUG> return false ; connection . networkManager . a ( new CustomPacketListener ( type , listener , old ) ) ; return true ; } @ SuppressWarnings ( "unchecked" ) public static < T extends Packet > void replacePacket ( Class < T > original , Class < ? extends T > custom , PacketUtils . ProtocolDirection direction ) { } @ SuppressWarnings ( "unchecked" ) public static < T extends Packet > void registerOutListener ( final Class < T > type , Player player , Predicate < T > listener ) { } public static NetworkManagerWrapper wrapNetworkManager ( Player player ) { } public enum ProtocolDirection { OUT ( EnumProtocolDirection . CLIENTBOUND ) , IN ( EnumProtocolDirection . SERVERBOUND ) ; private EnumProtocolDirection nms ; ProtocolDirection ( EnumProtocolDirection nms ) { } public EnumProtocolDirection getNMS ( ) { } } }

Fix:
if ( ! ( old instanceof PacketListenerPlayIn ) )
Buggy code:
@ RunWith ( Arquillian . class ) @ ServerSetup ( StandardUsersSetup . class ) public class ApplicationTypeTestCase extends AbstractRbacTestCase { @ Deployment ( testable = false ) public static Archive < ? > getDeployment ( ) { } @ Test public void testMonitor ( ) throws Exception { } @ Test public void testOperator ( ) throws Exception { } @ Test public void testMaintainer ( ) throws Exception { } @ Test public void testDeployer ( ) throws Exception { } @ Test public void testAdministrator ( ) throws Exception { } @ Test public void testAuditor ( ) throws Exception { } @ Test public void testSuperUser ( ) throws Exception { } private void test ( boolean canWriteWhenApplicationSet , boolean canWriteWhenApplicationNotSet , ModelControllerClient client ) throws IOException { } private void testDataSource ( boolean canWrite , ModelControllerClient client ) throws IOException { } private void testMailSession ( boolean canWrite , ModelControllerClient client ) throws IOException { <START_BUG> ModelNode operation = Util . createOperation ( WRITE_ATTRIBUTE_OPERATION , pathAddress ( pathElement ( SUBSYSTEM , "mail" ) , pathElement ( "mail-session" , "java:jboss//mail//Default" ) ) ) ; <END_BUG> operation . get ( NAME ) . set ( "jndi-name" ) ; operation . get ( VALUE ) . set ( "java:jboss//mail//Default_XXX" ) ; try { RbacUtil . executeOperation ( client , operation , ( canWrite ? Outcome . SUCCESS : Outcome . UNAUTHORIZED ) ) ; } finally { operation . get ( VALUE ) . set ( "java:jboss//mail//Default" ) ; RbacUtil . executeOperation ( getManagementClient ( ) . getControllerClient ( ) , operation , SUCCESS ) ; } } private static void setDataSourceAsApplicationType ( Boolean isApplication , ModelControllerClient client ) throws IOException { } private static void setMailSessionAsApplicationType ( Boolean isApplication , ModelControllerClient client ) throws IOException { } private static void setApplicationType ( String type , String classification , Boolean isApplication , ModelControllerClient client ) throws IOException { } }

Fix:
ModelNode operation = Util . createOperation ( WRITE_ATTRIBUTE_OPERATION , pathAddress ( pathElement ( SUBSYSTEM , "mail" ) , pathElement ( "mail-session" , "default" ) ) ) ;
Buggy code:
public class Grid extends JPanel { private int numRows ; private int numColumns ; private Vector < Sound > soundList ; private JPanel [ ] [ ] cells ; private int currentRow = 0 ; private int currentColumn = - 1 ; public Grid ( ) throws SQLException { } public void buildButtons ( ) { } public void add ( Sound newSound ) { } private void addNewButton ( Sound s ) { ( currentColumn ) ++ ; <START_BUG> if ( ( currentColumn ) > ( numColumns ) ) { <END_BUG> currentColumn = 0 ; ( currentRow ) ++ ; } SoundPanel p = new SoundPanel ( s ) ; cells [ currentRow ] [ currentColumn ] . add ( p ) ; } }

Fix:
if ( ( currentColumn ) >= ( numColumns ) ) {
Buggy code:
@ RemoteServiceRelativePath ( "iabakoServices//clientService" ) public interface ClientService extends RemoteService , BusinessEntityService , CRUDService , SearchService , SuggestService { Client save ( Client client ) throws IabakoActionForbiddenException { } List < Payment > getPayments ( Client client ) { } List < Installment > getInstallments ( Client client ) { } Client calculateStatus ( Client client ) { } List < CustomFieldValue > getCustomFieldsValue ( Client client ) { } Client save ( Client client , List < CustomFieldValue > customFieldValues ) throws IabakoException { } Client getClientByEmail ( Enterprise enterprise , String email ) { } boolean hasInstallments ( Client client ) { } <START_BUG> void saveInvoiceRecipient ( Client client , InvoiceRecipient invoiceRecipient ) ; <END_BUG> }

Fix:
InvoiceRecipient saveInvoiceRecipient ( Client client , InvoiceRecipient invoiceRecipient ) ;
Buggy code:
public final class TweetProviderTask implements Runnable { private final Context mContext ; private final Geocode mGeocode ; private final String mQuery ; private final TweetProviderTask . ITweetReceiver mCallback ; public TweetProviderTask ( @ NonNull final Context mContext , @ Nullable final Geocode mGeocode , @ NonNull final String mQuery , @ NonNull final TweetProviderTask . ITweetReceiver mCallback ) { } private static void getTweets ( @ NonNull final Context context , @ Nullable final Geocode geocode , final String query , @ NonNull final TweetProviderTask . ITweetReceiver callback ) { final Integer count = context . getResources ( ) . getInteger ( max_tweets_per_batch_pre_filter ) ; Long sinceId ; try { sinceId = Long . parseLong ( PreferenceAssistant . readSharedString ( context , context . getString ( pref_key_max_tweet_id ) , context . getString ( default_max_tweet_id ) ) ) ; } catch ( NumberFormatException ex ) { sinceId = Long . parseLong ( context . getString ( default_max_tweet_id ) ) ; } sinceId ++ ; final Long finalSinceId = sinceId ; <START_BUG> TwitterTrendServiceExtensionApiClient . getInstance ( ) . getSearchService ( ) . tweets ( query , geocode , null , null , context . getString ( tweet_search_result_type_popular ) , count , null , sinceId , null , null , new com . twitter . sdk . android . core . Callback < Search > ( ) { <END_BUG> @ Override public void success ( final Result < Search > result ) { final List < Tweet > tweetList = result . data . tweets ; List < String > idList = new ArrayList < > ( ) ; for ( final Tweet x : tweetList ) idList . add ( x . idStr ) ; final Integer l = context . getResources ( ) . getInteger ( max_tweets_per_batch_post_filter ) ; if ( ( idList . size ( ) ) > l ) idList = idList . subList ( 0 , l ) ; PreferenceAssistant . writeSharedString ( context , context . getString ( pref_key_max_tweet_id ) , String . valueOf ( Math . max ( finalSinceId , Long . parseLong ( TweetProviderTask . getMaxTweetId ( context , idList ) ) ) ) ) ; callback . onTweetsProvided ( idList , query ) ; } @ Override public void failure ( final TwitterException e ) { callback . onFailedToProvideTweets ( e ) ; } } ) ; } private static String getMaxTweetId ( final Context context , final List < String > idList ) { } @ Override public void run ( ) { } public interface ITweetReceiver { void onTweetsProvided ( final List < String > tweetIds , final String initialQuery ) { } void onFailedToProvideTweets ( final TwitterException e ) { } } }

Fix:
TwitterTrendServiceExtensionApiClient . getInstance ( ) . getSearchService ( ) . tweets ( query , geocode , null , null , context . getString ( tweet_search_result_type_mixed ) , count , null , sinceId , null , null , new com . twitter . sdk . android . core . Callback < Search > ( ) {
Buggy code:
public class FileReader { public String getFileContent ( String filename ) throws IOException { InputStream input = getClass ( ) . getResourceAsStream ( filename ) ; BufferedInputStream bufferedInputStream = new BufferedInputStream ( input ) ; StringBuilder stringBuilder = new StringBuilder ( ) ; DataInputStream dataInputStream = new DataInputStream ( bufferedInputStream ) ; try { while ( ( dataInputStream . available ( ) ) > 0 ) { <START_BUG> stringBuilder . append ( dataInputStream . readLine ( ) ) ; <END_BUG> } } finally { dataInputStream . close ( ) ; } return stringBuilder . toString ( ) ; } }

Fix:
stringBuilder . append ( ( ( dataInputStream . readLine ( ) ) + "\n" ) ) ;
Buggy code:
public class Ilasm extends MatchingTask { protected static final String exe_name = "ilasm" ; protected static final String file_ext = "il" ; protected static final String file_pattern = "**//*." + ( Ilasm . file_ext ) ; protected static final String exe_title = "ilasm" ; private File srcDir ; protected String targetType ; protected boolean verbose ; protected boolean listing ; protected File outputFile ; protected File resourceFile ; protected boolean failOnError ; protected boolean debug ; private File keyfile ; protected String extraOptions ; public Ilasm ( ) { } public void Clear ( ) { } public void setSrcDir ( File srcDirName ) { } public void setTargetType ( String targetType ) throws BuildException { <START_BUG> targetType = targetType . toLowerCase ( ) ; <END_BUG> if ( ( targetType . equals ( "exe" ) ) || ( targetType . equals ( "library" ) ) ) { targetType = targetType ; } else { throw new BuildException ( ( ( "targetType<seq2seq4repair_space>" + targetType ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>type" ) ) ; } } public String getTargetType ( ) { } protected String getTargetTypeParameter ( ) { } public void setOwner ( String s ) { } protected boolean notEmpty ( String s ) { } public void setVerbose ( boolean b ) { } protected String getVerboseParameter ( ) { } public void setListing ( boolean b ) { } protected String getListingParameter ( ) { } public void setOutputFile ( File params ) { } protected String getOutputFileParameter ( ) { } public void setResourceFile ( File fileName ) { } protected String getResourceFileParameter ( ) { } public void setFailOnError ( boolean b ) { } public boolean getFailFailOnError ( ) { } public void setDebug ( boolean f ) { } public boolean getDebug ( ) { } protected String getDebugParameter ( ) { } public void setKeyfile ( File keyfile ) { } protected String getKeyfileParameter ( ) { } public void setExtraOptions ( String extraOptions ) { } public String getExtraOptions ( ) { } protected String getExtraOptionsParameter ( ) { } public void execute ( ) throws BuildException { } public void executeOneFile ( String targetFile ) throws BuildException { } }

Fix:
this . targetType = targetType . toLowerCase ( ) ;
Buggy code:
public class SWT_AWT { public static String embeddedFrameClass ; static boolean loaded ; static boolean swingInitialized ; static native final int getAWTHandle ( Canvas canvas ) { } static synchronized void loadLibrary ( ) { } static synchronized void initializeSwing ( ) { } public static Frame new_Frame ( final Composite parent ) { if ( parent == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; if ( ( ( parent . getStyle ( ) ) & ( SWT . EMBEDDED ) ) == 0 ) { SWT . error ( ERROR_INVALID_ARGUMENT ) ; } int handle = parent . embeddedHandle ; Class clazz = null ; try { String className = ( ( SWT_AWT . embeddedFrameClass ) != null ) ? SWT_AWT . embeddedFrameClass : "sun.awt.X11.XEmbeddedFrame" ; clazz = Class . forName ( className ) ; } catch ( Throwable e ) { <START_BUG> SWT . error ( ERROR_NOT_IMPLEMENTED , e ) ; <END_BUG> } SWT_AWT . initializeSwing ( ) ; Object value = null ; Constructor constructor = null ; try { constructor = clazz . getConstructor ( new Class [ ] { int . class } ) ; value = constructor . newInstance ( new Object [ ] { new Integer ( ( ( int ) ( handle ) ) ) } ) ; } catch ( Throwable e1 ) { try { constructor = clazz . getConstructor ( new Class [ ] { long . class } ) ; value = constructor . newInstance ( new Object [ ] { new Long ( handle ) } ) ; } catch ( Throwable e2 ) { SWT . error ( ERROR_NOT_IMPLEMENTED , e2 ) ; } } final Frame frame = ( ( Frame ) ( value ) ) ; try { Method method = clazz . getMethod ( "registerListeners" , null ) ; if ( method != null ) method . invoke ( value , null ) ; } catch ( Throwable e ) { } parent . addListener ( Dispose , new Listener ( ) { public void handleEvent ( Event event ) { parent . setVisible ( false ) ; EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { frame . dispose ( ) ; } } ) ; } } ) ; parent . getDisplay ( ) . asyncExec ( new Runnable ( ) { public void run ( ) { if ( parent . isDisposed ( ) ) return ; final Rectangle clientArea = parent . getClientArea ( ) ; EventQueue . invokeLater ( new Runnable ( ) { public void run ( ) { frame . setSize ( clientArea . width , clientArea . height ) ; frame . validate ( ) ; } } ) ; } } ) ; return frame ; } public static Shell new_Shell ( final Display display , final Canvas parent ) { } }

Fix:
SWT . error ( ERROR_NOT_IMPLEMENTED , e , "<seq2seq4repair_space>[need<seq2seq4repair_space>JDK<seq2seq4repair_space>1.5<seq2seq4repair_space>or<seq2seq4repair_space>greater]" ) ;
Buggy code:
public class FileHandler extends SafeHttpHandler { private static MimetypesFileTypeMap mimes = new MimetypesFileTypeMap ( ) ; public FileHandler ( String path ) { } private String path ; private boolean isDirectory ; public FileHandler ( String path , boolean isDirectory ) { } protected void wrappedHandle ( HttpExchange t , String [ ] requestPath , HashMap < String , String > query ) throws IOException { String filePath = Utils . join ( requestPath , "//" ) ; String resource ; if ( isDirectory ) { resource = ( ( ( "//serverPlugins" + "//" ) + ( path ) ) + "//" ) + filePath ; <START_BUG> if ( ( filePath . isEmpty ( ) ) || ( filePath . endsWith ( "//" ) ) ) { <END_BUG> filePath += "index.html" ; resource += "index.html" ; } else { boolean isDir = ( getClass ( ) . getResource ( ( resource + "//index.html" ) ) ) != null ; if ( isDir ) { sendTrailingSlashRedirect ( t ) ; return ; } } } else { resource = ( "//serverPlugins" + "//" ) + ( path ) ; } InputStream is = getClass ( ) . getResourceAsStream ( resource ) ; if ( is == null ) { send404 ( t , filePath ) ; return ; } ByteArrayOutputStream bytes = new ByteArrayOutputStream ( ) ; Utils . fullyReadInputStream ( is , bytes ) ; String contentType = FileHandler . mimes . getContentType ( resource ) ; sendBytes ( t , bytes , contentType ) ; } }

Fix:
if ( t . getRequestURI ( ) . getPath ( ) . endsWith ( "//" ) ) {
Buggy code:
public class JMSSink { public static void main ( String [ ] args ) { if ( ( args . length ) != 3 ) { JMSSink . usage ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>arguments." ) ; } String tcfBindingName = args [ 0 ] ; String topicBindingName = args [ 1 ] ; PropertyConfigurator . configure ( args [ 2 ] ) ; LoggerRepository rep = LogManager . getLoggerRepository ( ) ; if ( rep instanceof RendererSupport ) { ( ( RendererSupport ) ( rep ) ) . setRenderer ( Message . class , new MessageRenderer ( ) ) ; } try { Context ctx = new InitialContext ( ) ; TopicConnectionFactory topicConnectionFactory ; topicConnectionFactory = ( ( TopicConnectionFactory ) ( JMSSink . lookup ( ctx , tcfBindingName ) ) ) ; TopicConnection topicConnection = topicConnectionFactory . createTopicConnection ( ) ; topicConnection . start ( ) ; TopicSession topicSession = topicConnection . createTopicSession ( false , AUTO_ACKNOWLEDGE ) ; Topic topic = ( ( Topic ) ( ctx . lookup ( topicBindingName ) ) ) ; TopicSubscriber topicSubscriber = topicSession . createDurableSubscriber ( topic , "x" ) ; LoggingEvent event ; Category remoteCategory ; while ( true ) { ObjectMessage msg = ( ( ObjectMessage ) ( topicSubscriber . receive ( ) ) ) ; event = ( ( LoggingEvent ) ( msg . getObject ( ) ) ) ; <START_BUG> remoteCategory = Category . getInstance ( event . loggerName ) ; <END_BUG> remoteCategory . callAppenders ( event ) ; } } catch ( Exception e ) { LogLog . error ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>read<seq2seq4repair_space>JMS<seq2seq4repair_space>message." , e ) ; } } protected static Object lookup ( Context ctx , String name ) throws NamingException { } static void usage ( String msg ) { } }

Fix:
remoteCategory = Category . getInstance ( event . categoryName ) ;
Buggy code:
public abstract class AbstractSubsystemBaseTest extends AbstractSubsystemTest { public AbstractSubsystemBaseTest ( final String mainSubsystemName , final Extension mainExtension ) { } protected abstract String getSubsystemXml ( ) throws IOException { } protected String getSubsystemXml ( String configId ) throws IOException { } protected void validateXml ( final String original , final String marshalled ) throws Exception { } @ Test public void testSubsystem ( ) throws Exception { } protected void standardSubsystemTest ( final String configId ) throws Exception { final AdditionalInitialization additionalInit = createAdditionalInitialization ( ) ; final String subsystemXml = ( configId == null ) ? getSubsystemXml ( ) : getSubsystemXml ( configId ) ; final KernelServices servicesA = super . installInController ( additionalInit , subsystemXml ) ; Assert . assertNotNull ( servicesA ) ; final ModelNode modelA = servicesA . readWholeModel ( ) ; Assert . assertNotNull ( modelA ) ; final String marshalled = servicesA . getPersistedSubsystemXml ( ) ; servicesA . shutdown ( ) ; String normalizedSubsystem = normalizeXML ( subsystemXml ) ; validateXml ( normalizedSubsystem , normalizeXML ( marshalled ) ) ; final KernelServices servicesB = super . installInController ( additionalInit , marshalled ) ; final ModelNode modelB = servicesB . readWholeModel ( ) ; super . compare ( modelA , modelB ) ; final ModelNode operation = createDescribeOperation ( ) ; final ModelNode result = servicesB . executeOperation ( operation ) ; <START_BUG> Assert . assertTrue ( "the<seq2seq4repair_space>subsystem<seq2seq4repair_space>describe<seq2seq4repair_space>operation<seq2seq4repair_space>has<seq2seq4repair_space>to<seq2seq4repair_space>generate<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>operations<seq2seq4repair_space>to<seq2seq4repair_space>recreate<seq2seq4repair_space>the<seq2seq4repair_space>subsystem" , result . hasDefined ( RESULT ) ) ; <END_BUG> final List < ModelNode > operations = result . get ( RESULT ) . asList ( ) ; servicesB . shutdown ( ) ; final KernelServices servicesC = super . installInController ( additionalInit , operations ) ; final ModelNode modelC = servicesC . readWholeModel ( ) ; super . compare ( modelA , modelC ) ; } protected ModelNode createDescribeOperation ( ) { } protected AdditionalInitialization createAdditionalInitialization ( ) { } }

Fix:
Assert . assertTrue ( "the<seq2seq4repair_space>subsystem<seq2seq4repair_space>describe<seq2seq4repair_space>operation<seq2seq4repair_space>has<seq2seq4repair_space>to<seq2seq4repair_space>generate<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>operations<seq2seq4repair_space>to<seq2seq4repair_space>recreate<seq2seq4repair_space>the<seq2seq4repair_space>subsystem" , ( ! ( result . hasDefined ( FAILURE_DESCRIPTION ) ) ) ) ;
Buggy code:
public class InfinispanSubsystemTestCase extends ClusteringSubsystemTest { public InfinispanSubsystemTestCase ( ) { } @ Override protected ValidationConfiguration getModelValidationConfiguration ( ) { } @ Test public void testParseSubsystem ( ) throws Exception { List < ModelNode > operations = super . parse ( getSubsystemXml ( ) ) ; <START_BUG> Assert . assertEquals ( 28 , operations . size ( ) ) ; <END_BUG> ModelNode addSubsystem = operations . get ( 0 ) ; Assert . assertEquals ( ADD , addSubsystem . get ( OP ) . asString ( ) ) ; PathAddress addr = PathAddress . pathAddress ( addSubsystem . get ( OP_ADDR ) ) ; Assert . assertEquals ( 1 , addr . size ( ) ) ; PathElement element = addr . getElement ( 0 ) ; Assert . assertEquals ( SUBSYSTEM , element . getKey ( ) ) ; Assert . assertEquals ( getMainSubsystemName ( ) , element . getValue ( ) ) ; } @ Test public void testInstallIntoController ( ) throws Exception { } @ Test public void testParseAndMarshalModel ( ) throws Exception { } @ Test public void testDescribeHandler ( ) throws Exception { } }

Fix:
Assert . assertEquals ( 27 , operations . size ( ) ) ;
Buggy code:
public class FormInput extends WicketExamplePage { private static final List ALL_LOCALES = Arrays . asList ( Locale . getAvailableLocales ( ) ) ; public FormInput ( ) { } public void setLocale ( Locale locale ) { } private static class InputForm extends Form { public InputForm ( String name , IFeedback feedback ) { } public void onSubmit ( ) { <START_BUG> info ( ( "Saved<seq2seq4repair_space>model<seq2seq4repair_space>" + ( getRootModel ( ) ) ) ) ; <END_BUG> } } }

Fix:
info ( ( "Saved<seq2seq4repair_space>model<seq2seq4repair_space>" + ( getRootModelObject ( ) ) ) ) ;
Buggy code:
public class AjpListenerResourceDefinition extends ListenerResourceDefinition { protected static final AjpListenerResourceDefinition INSTANCE = new AjpListenerResourceDefinition ( ) ; protected static final SimpleAttributeDefinition SCHEME = new org . jboss . as . controller . SimpleAttributeDefinitionBuilder ( Constants . SCHEME , org . jboss . dmr . ModelType . STRING ) . setAllowNull ( true ) . setFlags ( RESTART_ALL_SERVICES ) . setAllowExpression ( true ) . build ( ) ; private AjpListenerResourceDefinition ( ) { } @ Override protected ListenerAdd getAddHandler ( ) { } public Collection < AttributeDefinition > getAttributes ( ) { List < AttributeDefinition > attrs = new java . util . ArrayList ( super . getAttributes ( ) ) ; attrs . add ( AjpListenerResourceDefinition . SCHEME ) ; <START_BUG> attrs . add ( REDIRECT_PORT ) ; <END_BUG> return attrs ; } }

Fix:
attrs . add ( REDIRECT_SOCKET ) ;
Buggy code:
public class Jar extends Zip { private File manifest ; private boolean manifestAdded ; public Jar ( ) { } public void setJarfile ( File jarFile ) { } public void setManifest ( File manifestFile ) { manifest = manifestFile ; if ( ! ( manifest . exists ( ) ) ) throw new BuildException ( ( ( "Manifest<seq2seq4repair_space>file:<seq2seq4repair_space>" + ( manifest ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ) ; PrefixedFileSet fs = new PrefixedFileSet ( ) ; fs . setDir ( new File ( manifest . getParent ( ) ) ) ; fs . setIncludes ( manifest . getName ( ) ) ; fs . setFullpath ( "META-INF//MANIFEST.MF" ) ; <START_BUG> super . addFileset ( fs ) ; <END_BUG> } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } protected void cleanUp ( ) { } }

Fix:
super . addPrefixedfileset ( fs ) ;
Buggy code:
public class ZipResource extends ArchiveResource { private String encoding ; private ZipExtraField [ ] extras ; private int method ; public ZipResource ( ) { } public ZipResource ( File z , String enc , ZipEntry e ) { } public void setZipfile ( File z ) { } public File getZipfile ( ) { } public void addConfigured ( ResourceCollection a ) { } public void setEncoding ( String enc ) { } public String getEncoding ( ) { } public void setRefid ( Reference r ) { } public InputStream getInputStream ( ) throws IOException { } public OutputStream getOutputStream ( ) throws IOException { } public ZipExtraField [ ] getExtraFields ( ) { } public int getMethod ( ) { } protected void fetchEntry ( ) { } private void setEntry ( ZipEntry e ) { if ( e == null ) { setExists ( false ) ; return ; } setName ( e . getName ( ) ) ; setExists ( true ) ; setLastModified ( e . getTime ( ) ) ; setDirectory ( e . isDirectory ( ) ) ; setSize ( e . getSize ( ) ) ; setMode ( e . getUnixMode ( ) ) ; <START_BUG> extras = e . getExtraFields ( ) ; <END_BUG> method = e . getMethod ( ) ; } }

Fix:
extras = e . getExtraFields ( true ) ;
Buggy code:
public class CalendarIntent extends CordovaPlugin { public static final String ACTION_CREATE_EVENT = "createEvent" ; private Calendar _calendar ; @ Override public void initialize ( CordovaInterface cordova , CordovaWebView webView ) { } @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { if ( action . equals ( CalendarIntent . ACTION_CREATE_EVENT ) ) { if ( ( args . length ( ) ) != 1 ) { callbackContext . sendPluginResult ( new org . apache . cordova . PluginResult ( Status . INVALID_ACTION ) ) ; return false ; } JSONObject options = args . optJSONObject ( 0 ) ; String title = options . optString ( "title" ) ; String description = options . optString ( "description" ) ; long beginTime = options . optLong ( "beginTime" , this . _calendar . getTimeInMillis ( ) ) ; long endTime = options . optLong ( "endTime" , this . _calendar . getTimeInMillis ( ) ) ; Intent intent = new Intent ( Intent . ACTION_EDIT ) ; intent . setType ( "vnd.android.cursor.item//event" ) ; intent . putExtra ( "title" , title ) ; intent . putExtra ( "description" , description ) ; intent . putExtra ( "beginTime" , beginTime ) ; <START_BUG> intent . putExtra ( "endTime" , beginTime ) ; <END_BUG> ( ( CordovaActivity ) ( this . cordova . getActivity ( ) ) ) . startActivity ( intent ) ; callbackContext . success ( action ) ; } return true ; } No newline ; at end ; of file ; }

Fix:
intent . putExtra ( "endTime" , endTime ) ;
Buggy code:
public final class DoubleRangeTest extends AbstractRangeTest { public DoubleRangeTest ( String name ) { } public static Test suite ( ) { } @ Override public void setUp ( ) { } @ Override protected Range createRange ( Integer integer1 , Integer integer2 ) { } @ Override protected Range createRange ( Integer integer ) { } public void testConstructor1a ( ) { } public void testConstructor1b ( ) { DoubleRange nr = new DoubleRange ( double8 ) ; assertSame ( double8 , nr . getMinimumNumber ( ) ) ; assertSame ( double8 , nr . getMaximumNumber ( ) ) ; <START_BUG> Range r = new DoubleRange ( nonComparableNumber ) ; <END_BUG> try { new DoubleRange ( null ) ; fail ( ) ; } catch ( IllegalArgumentException ex ) { } try { new DoubleRange ( new Double ( Double . NaN ) ) ; fail ( ) ; } catch ( IllegalArgumentException ex ) { } } public void testConstructor2a ( ) { } public void testConstructor2b ( ) { } public void testContainsNumber ( ) { } @ Override public void testToString ( ) { } }

Fix:
new DoubleRange ( nonComparableNumber ) ;
Buggy code:
public class ThreadsSubsystemTestCase extends AbstractSubsystemBaseTest { public ThreadsSubsystemTestCase ( ) { } @ Override protected String getSubsystemXml ( ) throws IOException { } @ Test public void testExpressions ( ) throws Exception { } @ Test public void testTransformerAS712 ( ) throws Exception { } @ Test public void testTransformerAS713 ( ) throws Exception { } private void testTransformer_1_0 ( ModelTestControllerVersion controllerVersion ) throws Exception { String subsystemXml = "threads-transform-1_0.xml" ; ModelVersion modelVersion = ModelVersion . create ( 1 , 0 , 0 ) ; KernelServicesBuilder builder = createKernelServicesBuilder ( MANAGEMENT ) . setSubsystemXmlResource ( subsystemXml ) ; <START_BUG> final PathAddress subsystemAddress = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , getMainSubsystemName ( ) ) ) ; <END_BUG> builder . createLegacyKernelServicesBuilder ( null , controllerVersion , modelVersion ) . addOperationValidationResolve ( "add" , subsystemAddress . append ( PathElement . pathElement ( "thread-factory" ) ) ) . addMavenResourceURL ( ( "org.jboss.as:jboss-as-threads:" + ( controllerVersion . getMavenGavVersion ( ) ) ) ) . excludeFromParent ( SingleClassFilter . createFilter ( ThreadsLogger . class ) ) ; KernelServices mainServices = builder . build ( ) ; KernelServices legacyServices = mainServices . getLegacyServices ( modelVersion ) ; Assert . assertNotNull ( legacyServices ) ; checkSubsystemModelTransformation ( mainServices , modelVersion ) ; } @ Test public void testRejectExpressionsAS712 ( ) throws Exception { } @ Test public void testRejectExpressionsAS713 ( ) throws Exception { } private void testRejectExpressions_1_0_0 ( ModelTestControllerVersion controllerVersion ) throws Exception { } private FailedOperationTransformationConfig getConfig ( ) { } }

Fix:
final PathAddress subsystemAddress = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , mainSubsystemName ) ) ;
Buggy code:
public class Depend extends MatchingTask { private static final int TIME_TOLERANCE = 100 ; private static class ClassFileInfo { private File absoluteFile ; private String relativeName ; private String className ; } private Path srcPath ; private Path destPath ; private File cache ; private Hashtable affectedClassMap ; private Hashtable classFileInfoMap ; private Hashtable classpathDependencies ; private Hashtable outOfDateClasses ; private boolean closure = false ; private boolean dump = false ; private Path dependClasspath ; private static final String CACHE_FILE_NAME = "dependencies.txt" ; private static final String CLASSNAME_PREPEND = "||:" ; public void setClasspath ( Path classpath ) { } public Path getClasspath ( ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } private Hashtable readCachedDependencies ( ) throws IOException { } private void writeCachedDependencies ( Hashtable dependencyMap ) throws IOException { } private void determineDependencies ( ) throws IOException { } private int deleteAllAffectedFiles ( ) { } private int deleteAffectedFiles ( String className ) { } public void execute ( ) throws BuildException { } protected void scanDir ( File srcDir , String [ ] files ) { long now = System . currentTimeMillis ( ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { File srcFile = new File ( srcDir , files [ i ] ) ; if ( files [ i ] . endsWith ( ".java" ) ) { String filePath = srcFile . getPath ( ) ; String className = filePath . substring ( ( ( srcDir . getPath ( ) . length ( ) ) + 1 ) , ( ( filePath . length ( ) ) - ( ".java" . length ( ) ) ) ) ; className = ClassFileUtils . convertSlashName ( className ) ; Depend . ClassFileInfo info = ( ( Depend . ClassFileInfo ) ( classFileInfoMap . get ( className ) ) ) ; if ( info == null ) { outOfDateClasses . put ( className , className ) ; } else { <START_BUG> if ( ( srcFile . lastModified ( ) ) > ( ( info . absoluteFile . lastModified ( ) ) + ( Depend . TIME_TOLERANCE ) ) ) { <END_BUG> outOfDateClasses . put ( className , className ) ; } } } } } private Vector getClassFiles ( Path classLocations ) { } private void addClassFiles ( Vector classFileList , File dir , File root ) { } public void setSrcdir ( Path srcPath ) { } public void setDestDir ( Path destPath ) { } public void setCache ( File cache ) { } public void setClosure ( boolean closure ) { } public void setDump ( boolean dump ) { } }

Fix:
if ( ( srcFile . lastModified ( ) ) > ( info . absoluteFile . lastModified ( ) ) ) {
Buggy code:
public final class ActionRouter implements ActionListener { private Map commands = new HashMap ( ) ; private static ActionRouter router ; private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; private Map preActionListeners = new HashMap ( ) ; private Map postActionListeners = new HashMap ( ) ; private ActionRouter ( ) { } public void actionPerformed ( final ActionEvent e ) { } private void performAction ( final ActionEvent e ) { try { GuiPackage . getInstance ( ) . updateCurrentNode ( ) ; Set commandObjects = ( ( Set ) ( commands . get ( e . getActionCommand ( ) ) ) ) ; Iterator iter = commandObjects . iterator ( ) ; while ( iter . hasNext ( ) ) { try { Command c = ( ( Command ) ( iter . next ( ) ) ) ; preActionPerformed ( c . getClass ( ) , e ) ; c . doAction ( e ) ; postActionPerformed ( c . getClass ( ) , e ) ; } catch ( IllegalUserActionException err ) { JMeterUtils . reportErrorToUser ( err . toString ( ) ) ; } catch ( Exception err ) { ActionRouter . log . error ( "" , err ) ; } } } catch ( NullPointerException er ) { <START_BUG> ActionRouter . log . error ( "" , er ) ; <END_BUG> JMeterUtils . reportErrorToUser ( ( ( "Sorry,<seq2seq4repair_space>this<seq2seq4repair_space>feature<seq2seq4repair_space>(" + ( e . getActionCommand ( ) ) ) + ")<seq2seq4repair_space>not<seq2seq4repair_space>yet<seq2seq4repair_space>implemented" ) ) ; } } public void doActionNow ( ActionEvent e ) { } public Set getAction ( String actionName ) { } public Command getAction ( String actionName , Class actionClass ) { } public Command getAction ( String actionName , String className ) { } public void addPreActionListener ( Class action , ActionListener listener ) { } public void removePreActionListener ( Class action , ActionListener listener ) { } public void addPostActionListener ( Class action , ActionListener listener ) { } public void removePostActionListener ( Class action , ActionListener listener ) { } protected void preActionPerformed ( Class action , ActionEvent e ) { } protected void postActionPerformed ( Class action , ActionEvent e ) { } private void populateCommandMap ( ) { } public static ActionRouter getInstance ( ) { } }

Fix:
ActionRouter . log . error ( ( ( ( ( "performAction(" + ( e . getActionCommand ( ) ) ) + ")<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) + "<seq2seq4repair_space>caused" ) , er ) ;
Buggy code:
@ Service public class IdeaServiceImpl implements IdeaService { @ Autowired private IdeaCrudRepository ideaRepo ; @ Autowired private UserCrudRepository userRepo ; @ Autowired private IdeaValidator ideaValidator ; @ Override public List < Idea > getIdeasByActicityId ( long id ) { } @ Override public List < Idea > getIdeasByUserId ( long id ) { } private List < Idea > assembleIdeas ( Iterable < Idea > ideas ) { } @ Override public Idea updateIdea ( Idea idea ) { Idea origin = ideaRepo . findOne ( idea . getId ( ) ) ; if ( null == origin ) { return null ; } <START_BUG> if ( ( ( idea . isAdopted ( ) ) && ( ! ( origin . getRewards ( ) . contains ( MID_REWARD ) ) ) ) && ( ! ( mRwdLmtReached ( idea ) ) ) ) { <END_BUG> idea . setRewards ( ( ( origin . getRewards ( ) ) + "2" ) ) ; } else { idea . setRewards ( origin . getRewards ( ) . replaceAll ( "2" , "" ) ) ; } BeanUtil . copyNotNullProperties ( idea , origin ) ; if ( ideaValidator . validate ( origin ) ) { ideaRepo . save ( origin ) ; return origin ; } return null ; } @ Override public Idea addIdea ( Idea idea ) { } @ Override public Idea deleteIdea ( long id ) { } @ Override public Idea getIdea ( long id ) { } private boolean mRwdLmtReached ( Idea idea ) { } private boolean tRwdLmtReached ( Idea idea ) { } }

Fix:
if ( ( ( idea . getAdoptedFalg ( ) ) && ( ! ( origin . getRewards ( ) . contains ( MID_REWARD ) ) ) ) && ( ! ( mRwdLmtReached ( idea ) ) ) ) {
Buggy code:
public class MutableLong extends Number implements Comparable < MutableLong > , Mutable < Number > { private static final long serialVersionUID = 62986528375L ; private long value ; public MutableLong ( ) { } public MutableLong ( final long value ) { } public MutableLong ( final Number value ) { } public MutableLong ( final String value ) throws NumberFormatException { } @ Override public Long getValue ( ) { } public void setValue ( final long value ) { } @ Override public void setValue ( final Number value ) { } public void increment ( ) { } public void decrement ( ) { } public void add ( final long operand ) { } public void add ( final Number operand ) { } public void subtract ( final long operand ) { } public void subtract ( final Number operand ) { } @ Override public int intValue ( ) { } @ Override public long longValue ( ) { } @ Override public float floatValue ( ) { } @ Override public double doubleValue ( ) { } public Long toLong ( ) { } @ Override public boolean equals ( final Object obj ) { } @ Override public int hashCode ( ) { } @ Override public int compareTo ( final MutableLong other ) { <START_BUG> long anotherVal = other . value ; <END_BUG> return ( value ) < anotherVal ? - 1 : ( value ) == anotherVal ? 0 : 1 ; } @ Override public String toString ( ) { } }

Fix:
final long anotherVal = other . value ;
Buggy code:
public class StringToBooleanConverter extends AbstractConverter { private static final Resources REZ = ResourceManager . getPackageResources ( StringToBooleanConverter . class ) ; public StringToBooleanConverter ( ) { } <START_BUG> public Object convert ( final Object object , final Context context ) throws ConverterException { <END_BUG> final String string = ( ( String ) ( object ) ) ; if ( string . equals ( "true" ) ) { return Boolean . TRUE ; } else if ( string . equals ( "false" ) ) { return Boolean . FALSE ; } else { final String message = StringToBooleanConverter . REZ . getString ( "convert.bad-boolean.error" , object ) ; throw new ConverterException ( message ) ; } } }

Fix:
public Object convert ( final Object object , final Object context ) throws ConverterException {
Buggy code:
public class Agent implements Comparable < Agent > { public BigInteger moneyEarned ; public String name ; public Integer movieInvolvements ; public Integer rank ; public Agent ( String name ) { } public Agent ( String name , BigInteger earned ) { } public Agent ( String name , int appearances ) { } @ Override public String toString ( ) { <START_BUG> return ( ( this . name ) + "<seq2seq4repair_space>earned<seq2seq4repair_space>" ) + ( this . moneyEarned ) ; <END_BUG> } @ Override public int compareTo ( Agent o ) { } static final Comparator < Agent > RANK = new Comparator < Agent > ( ) { public int compare ( Agent e1 , Agent e2 ) { } } ; static final Comparator < Agent > MONEY_EARNED = new Comparator < Agent > ( ) { public int compare ( Agent e1 , Agent e2 ) { } } ; static final Comparator < Agent > MOVIE_INVOLEMENTS = new Comparator < Agent > ( ) { public int compare ( Agent e1 , Agent e2 ) { } } ; }

Fix:
return this . name ;
Buggy code:
public class ClassLiteralAccess extends Expression { public TypeReference type ; public TypeBinding targetType ; FieldBinding syntheticField ; public ClassLiteralAccess ( int sourceEnd , TypeReference t ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ( targetType = type . resolveType ( scope , true ) ) == null ) return null ; if ( ( targetType . isArrayType ( ) ) && ( ( ( ( ArrayBinding ) ( targetType ) ) . leafComponentType ) == ( VoidBinding ) ) ) { scope . problemReporter ( ) . cannotAllocateVoidArray ( this ) ; return null ; } else if ( targetType . isTypeVariable ( ) ) { scope . problemReporter ( ) . illegalClassLiteralForTypeVariable ( ( ( TypeVariableBinding ) ( targetType ) ) , this ) ; } ReferenceBinding classType = scope . getJavaLangClass ( ) ; if ( classType . isGenericType ( ) ) { TypeBinding boxedType = null ; if ( ( targetType . id ) == ( TypeIds . T_void ) ) { boxedType = scope . environment ( ) . getType ( TypeConstants . JAVA_LANG_VOID ) ; if ( boxedType == null ) { boxedType = new ProblemReferenceBinding ( TypeConstants . JAVA_LANG_VOID , ProblemReasons . NotFound ) ; } } else { boxedType = scope . boxing ( targetType ) ; } <START_BUG> this . resolvedType = scope . createParameterizedType ( classType , new TypeBinding [ ] { boxedType } , null ) ; <END_BUG> } else { this . resolvedType = classType ; } return this . resolvedType ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
this . resolvedType = scope . environment ( ) . createParameterizedType ( classType , new TypeBinding [ ] { boxedType } , null ) ;
Buggy code:
public class FastViewBarContextMenuContribution extends ContributionItem { private MenuItem orientationItem ; private MenuItem restoreItem ; private MenuItem closeItem ; private FastViewBar bar ; private RadioMenu radioButtons ; private IViewReference selectedView ; private IntModel currentOrientation = new IntModel ( SWT . VERTICAL ) ; private IChangeListener orientationChangeListener = new IChangeListener ( ) { public void update ( boolean changed ) { } } ; public FastViewBarContextMenuContribution ( FastViewBar bar ) { } public void fill ( Menu menu , int index ) { super . fill ( menu , index ) ; orientationItem = new MenuItem ( menu , SWT . CASCADE , ( index ++ ) ) ; { orientationItem . setText ( FastViewBar_view_orientation ) ; Menu orientationSwtMenu = new Menu ( orientationItem ) ; RadioMenu orientationMenu = new RadioMenu ( orientationSwtMenu , currentOrientation ) ; orientationMenu . addMenuItem ( FastViewBar_horizontal , new Integer ( SWT . HORIZONTAL ) ) ; orientationMenu . addMenuItem ( FastViewBar_vertical , new Integer ( SWT . VERTICAL ) ) ; orientationItem . setMenu ( orientationSwtMenu ) ; } restoreItem = new MenuItem ( menu , SWT . CHECK , ( index ++ ) ) ; restoreItem . setText ( ViewPane_fastView ) ; restoreItem . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { <START_BUG> bar . restoreView ( selectedView ) ; <END_BUG> } } ) ; closeItem = new MenuItem ( menu , SWT . NONE , ( index ++ ) ) ; closeItem . setText ( WorkbenchWindow_close ) ; closeItem . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { if ( ( selectedView ) != null ) { WorkbenchPage page = bar . getWindow ( ) . getActiveWorkbenchPage ( ) ; if ( page != null ) { page . hideView ( selectedView ) ; } } } } ) ; WorkbenchPage page = bar . getWindow ( ) . getActiveWorkbenchPage ( ) ; if ( ( selectedView ) != null ) { restoreItem . setEnabled ( ( ( page != null ) && ( page . isMoveable ( selectedView ) ) ) ) ; } else { restoreItem . setEnabled ( false ) ; } restoreItem . setSelection ( true ) ; if ( ( selectedView ) != null ) { closeItem . setEnabled ( ( ( page != null ) && ( page . isCloseable ( selectedView ) ) ) ) ; } else { closeItem . setEnabled ( false ) ; } orientationItem . setEnabled ( ( ( selectedView ) != null ) ) ; if ( ( selectedView ) != null ) { currentOrientation . set ( bar . getOrientation ( selectedView ) , orientationChangeListener ) ; } } public void setTarget ( IViewReference selectedView ) { } public boolean isDynamic ( ) { } public void dispose ( ) { } }

Fix:
bar . restoreView ( selectedView , true , true ) ;