nus-yam/ex-repair huggingface dataset:
Buggy code:
public interface ScriptRepository extends PagingAndSortingRepository < Script , Integer > { @ Override Collection < Script > findAll ( ) { } <START_BUG> @ Query ( "SELECT<seq2seq4repair_space>u<seq2seq4repair_space>FROM<seq2seq4repair_space>#{#entityName}<seq2seq4repair_space>u<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>u.scriptDocuments<seq2seq4repair_space>j<seq2seq4repair_space>where<seq2seq4repair_space>j.reviewState<seq2seq4repair_space>in<seq2seq4repair_space>(:states)" ) <END_BUG> List < Script > findByReviewState ( @ Param ( "states" ) ReviewState ... states ) ; }

Fix:
@ Query ( "SELECT<seq2seq4repair_space>DISTINCT<seq2seq4repair_space>u<seq2seq4repair_space>FROM<seq2seq4repair_space>#{#entityName}<seq2seq4repair_space>u<seq2seq4repair_space>INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>u.scriptDocuments<seq2seq4repair_space>j<seq2seq4repair_space>where<seq2seq4repair_space>j.reviewState<seq2seq4repair_space>in<seq2seq4repair_space>(:states)" )
Buggy code:
public class BuildContext { public static final IContentType [ ] NO_CONTENT_TYPES = new IContentType [ 0 ] ; private IFile file ; protected Map < String , Collection < IProblem > > problems ; private IParseState fParseState ; private String fContents ; protected BuildContext ( ) { } public BuildContext ( IFile file ) { } public IProject getProject ( ) { } public IFile getFile ( ) { } public URI getURI ( ) { } public IParseRootNode getAST ( ) throws CoreException { } public synchronized IParseRootNode getAST ( IParseState parseState ) throws CoreException { } public synchronized void resetAST ( ) { } public synchronized String getContents ( ) throws CoreException { } protected String getCharset ( ) throws CoreException { } public String getContentType ( ) throws CoreException { } protected IContentType [ ] getContentTypes ( ) throws CoreException { } public String getName ( ) { } public void removeProblems ( String markerType ) { } public void putProblems ( String markerType , Collection < IProblem > problems ) { } public Map < String , Collection < IProblem > > getProblems ( ) { } public Collection < IParseError > getParseErrors ( ) { } public InputStream openInputStream ( IProgressMonitor monitor ) throws CoreException { IFile file = getFile ( ) ; <START_BUG> if ( file == null ) { <END_BUG> return new ByteArrayInputStream ( new byte [ 0 ] ) ; } return file . getContents ( ) ; } }

Fix:
if ( ( file == null ) || ( ! ( file . exists ( ) ) ) ) {
Buggy code:
public class NSControl extends NSView { public NSControl ( ) { } public NSControl ( int id ) { } public NSControl ( id id ) { } public int action ( ) { } public NSCell cell ( ) { } public NSText currentEditor ( ) { } public double doubleValue ( ) { } public NSFont font ( ) { } public boolean sendAction ( int theAction , id theTarget ) { <START_BUG> return ( OS . objc_msgSend ( this . id , sel_sendAction_to_ , theAction , ( theTarget != null ? theTarget . id : 0 ) ) ) != 0 ; <END_BUG> } public void setAction ( int aSelector ) { } public void setAlignment ( int mode ) { } public void setDoubleValue ( double aDouble ) { } public void setEnabled ( boolean flag ) { } public void setFont ( NSFont fontObj ) { } public void setTarget ( id anObject ) { } public void sizeToFit ( ) { } public id target ( ) { } }

Fix:
return OS . objc_msgSend_bool ( this . id , sel_sendAction_to_ , theAction , ( theTarget != null ? theTarget . id : 0 ) ) ;
Buggy code:
public class CpioArchiveInputStream extends ArchiveInputStream implements CpioConstants { private boolean closed = false ; private CpioArchiveEntry entry ; private long entryBytesRead = 0 ; private boolean entryEOF = false ; private final byte [ ] singleByteBuf = new byte [ 1 ] ; private final byte [ ] tmpbuf = new byte [ 4096 ] ; private long crc = 0 ; private final InputStream in ; public CpioArchiveInputStream ( final InputStream in ) { } public int available ( ) throws IOException { } public void close ( ) throws IOException { } public void closeEntry ( ) throws IOException { } private void ensureOpen ( ) throws IOException { } public CpioArchiveEntry getNextCPIOEntry ( ) throws IOException { ensureOpen ( ) ; if ( ( this . entry ) != null ) { closeEntry ( ) ; } byte [ ] magic = new byte [ 2 ] ; readFully ( magic , 0 , magic . length ) ; if ( ( CpioUtil . byteArray2long ( magic , false ) ) == ( MAGIC_OLD_BINARY ) ) { this . entry = readOldBinaryEntry ( false ) ; } else if ( ( CpioUtil . byteArray2long ( magic , true ) ) == ( MAGIC_OLD_BINARY ) ) { this . entry = readOldBinaryEntry ( true ) ; } else { byte [ ] more_magic = new byte [ 4 ] ; readFully ( more_magic , 0 , more_magic . length ) ; byte [ ] tmp = new byte [ 6 ] ; System . arraycopy ( magic , 0 , tmp , 0 , magic . length ) ; System . arraycopy ( more_magic , 0 , tmp , magic . length , more_magic . length ) ; String magicString = new String ( tmp ) ; if ( magicString . equals ( MAGIC_NEW ) ) { this . entry = readNewEntry ( false ) ; } else if ( magicString . equals ( MAGIC_NEW_CRC ) ) { this . entry = readNewEntry ( true ) ; } else if ( magicString . equals ( MAGIC_OLD_ASCII ) ) { this . entry = readOldAsciiEntry ( ) ; } else { throw new IOException ( ( ( "Unknown<seq2seq4repair_space>magic<seq2seq4repair_space>[" + magicString ) + "]" ) ) ; } } this . entryBytesRead = 0 ; this . entryEOF = false ; this . crc = 0 ; <START_BUG> if ( this . entry . getName ( ) . equals ( "TRAILER!!!" ) ) { <END_BUG> this . entryEOF = true ; return null ; } return this . entry ; } private long pad ( final long count , final int border ) throws IOException { } public int read ( ) throws IOException { } public int read ( final byte [ ] b , final int off , final int len ) throws IOException { } private final int readFully ( final byte [ ] b , final int off , final int len ) throws IOException { } private long readBinaryLong ( final int length , final boolean swapHalfWord ) throws IOException { } private long readAsciiLong ( final int length , final int radix ) throws IOException { } private CpioArchiveEntry readNewEntry ( final boolean hasCrc ) throws IOException { } private CpioArchiveEntry readOldAsciiEntry ( ) throws IOException { } private CpioArchiveEntry readOldBinaryEntry ( final boolean swapHalfWord ) throws IOException { } private String readCString ( final int length ) throws IOException { } public long skip ( final long n ) throws IOException { } public ArchiveEntry getNextEntry ( ) throws IOException { } public static boolean matches ( byte [ ] signature , int length ) { } }

Fix:
if ( this . entry . getName ( ) . equals ( CPIO_TRAILER ) ) {
Buggy code:
class DRDAProtocolException extends Exception { protected static final int NO_ASSOC_ERRCD = 0 ; protected static final int NO_CODPNT_ARG = 0 ; private DRDAConnThread agent ; private int correlationID ; private byte [ ] crrtkn ; private int codpntArg ; private DRDAProtocolExceptionInfo exceptionInfo ; private int errorCodePoint ; private int svrcod ; private int errcd ; private String messageid ; private String rdbnam ; private String srvdgn ; private Object [ ] messageArgs ; private String msg ; private static Hashtable errorInfoTable ; protected static String DRDA_Proto_CMDCHKRM = "DRDA_Proto_CMDCHKRM" ; protected static String DRDA_Proto_CMDNSPRM = "DRDA_Proto_CMDNSPRM" ; protected static String DRDA_Proto_DTAMCHRM = "DRDA_Proto_DTAMCHRM" ; protected static String DRDA_Proto_OBJNSPRM = "DRDA_Proto_OBJNSPRM" ; protected static String DRDA_Proto_PKGBNARM = "DRDA_Proto_PKGBNARM" ; protected static String DRDA_Proto_PRCCNVRM = "DRDA_Proto_PRCCNVRM" ; protected static String DRDA_Proto_PRMNSRM = "DRDA_Proto_PRMNSPRM" ; protected static String DRDA_Proto_SYNTAXRM = "DRDA_Proto_SYNTAXRM" ; protected static String DRDA_Proto_VALNSPRM = "DRDA_Proto_VALNSPRM" ; protected static String DRDA_Proto_MGRLVLRM = "DRDA_Proto_MGRLVLRM" ; protected static String DRDA_Proto_RDBNFNRM = "DRDA_Proto_RDBNFNRM" ; protected static String DRDA_Disconnect = "DRDA_Disconnect" ; protected static String DRDA_AgentError = "DRDA_AgentError" ; DRDAProtocolException ( String msgid , DRDAConnThread agent , int cpArg , int errCdArg , Object [ ] args ) { } DRDAProtocolException ( String msgid , DRDAConnThread agent , int cpArg , int errCdArg ) { } protected static DRDAProtocolException newDisconnectException ( DRDAConnThread agent , Object [ ] args ) { } protected static DRDAProtocolException newAgentError ( DRDAConnThread agent , int svrcod , String rdbnam , String srvdgn ) { if ( SanityManager . DEBUG ) <START_BUG> System . out . println ( ( "agentError<seq2seq4repair_space>in<seq2seq4repair_space>" + agent ) ) ; <END_BUG> Object [ ] oa = new Object [ ] { new Integer ( svrcod ) , rdbnam , srvdgn } ; return new DRDAProtocolException ( DRDAProtocolException . DRDA_AgentError , agent , DRDAProtocolException . NO_CODPNT_ARG , DRDAProtocolException . NO_ASSOC_ERRCD , oa ) ; } protected final boolean isDisconnectException ( ) { } protected void write ( DDMWriter writer ) { } public String getMessage ( ) { } }

Fix:
agent . trace ( ( "agentError<seq2seq4repair_space>in<seq2seq4repair_space>" + agent ) ) ;
Buggy code:
public class HostModelRegistrationHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "register-host-model" ; private final HostControllerEnvironment hostControllerEnvironment ; private final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry ; private final HostModelRegistrar hostModelRegistrar ; public HostModelRegistrationHandler ( final HostControllerEnvironment hostControllerEnvironment , final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry , final HostModelUtil . HostModelRegistrar hostModelRegistrar ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } public void execute ( OperationContext context , ModelNode operation ) { if ( ! ( context . isBooting ( ) ) ) { throw HostControllerMessages . MESSAGES . invocationNotAllowedAfterBoot ( HostModelRegistrationHandler . OPERATION_NAME ) ; } final String hostName = operation . require ( NAME ) . asString ( ) ; ManagementResourceRegistration rootRegistration = context . getResourceRegistrationForUpdate ( ) ; hostModelRegistrar . registerHostModel ( hostName , rootRegistration ) ; final PathAddress hostAddress = PathAddress . pathAddress ( PathElement . pathElement ( HOST , hostName ) ) ; final Resource rootResource = context . createResource ( hostAddress ) ; final ModelNode model = rootResource . getModel ( ) ; HostModelRegistrationHandler . initCoreModel ( model , hostControllerEnvironment ) ; context . createResource ( hostAddress . append ( PathElement . pathElement ( CORE_SERVICE , MANAGEMENT ) ) ) ; context . createResource ( hostAddress . append ( PathElement . pathElement ( CORE_SERVICE , HOST_ENVIRONMENT ) ) ) ; rootResource . registerChild ( ROOT_PATH , new RootPlatformMBeanResource ( ) ) ; Resource . ResourceEntry ignoredRoot = ignoredDomainResourceRegistry . getRootResource ( ) ; rootResource . registerChild ( ignoredRoot . getPathElement ( ) , ignoredRoot ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } private static void initCoreModel ( final ModelNode root , HostControllerEnvironment environment ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class PluginManagerTest extends TestCase { private File file ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void test ( ) { <START_BUG> PluginManager manager = new PluginManager ( ) ; <END_BUG> manager . initPlugins ( ) ; } }

Fix:
PluginManager manager = PluginManager . getInstance ( ) ;
Buggy code:
@ Singleton public class GameComposerController { private static final String GAME_DIRECTORY_PREF_KEY = "GameDirectory" ; private static final String GAME_EXPORTDIRECTORY_HTML_PREF_KEY = "GameExportDirectoryHTML" ; private static final String GAME_EXPORTDIRECTORY_ANDROID_PREF_KEY = "GameExportDirectoryAndroid" ; @ Inject @ ObjectInspector Controller objectInspector ; @ Inject @ ContentArea Controller contentArea ; @ Inject @ ProjectStructure Controller projectStructure ; @ Inject Event < Object > eventGateway ; @ FXML BorderPane borderPane ; @ FXML Menu exportMenu ; @ FXML Label statusBar ; @ Inject Event < StatusEvent > statusEvent ; private Preferences directoryPreferences ; private Stage stage ; public void initialize ( Stage aStage ) { stage = aStage ; directoryPreferences = Preferences . userNodeForPackage ( GameComposerController . class ) ; exportMenu . setDisable ( true ) ; SplitPane theSplitPane = new SplitPane ( ) ; theSplitPane . setOrientation ( Orientation . HORIZONTAL ) ; theSplitPane . getItems ( ) . addAll ( objectInspector . getView ( ) , contentArea . getView ( ) , projectStructure . getView ( ) ) ; <START_BUG> theSplitPane . setDividerPositions ( 0.3 , 0.3 ) ; <END_BUG> borderPane . setCenter ( theSplitPane ) ; eventGateway . fire ( new ApplicationStartedEvent ( ) ) ; } @ FXML public void onClose ( ) { } @ FXML public void onNew ( ) { } @ FXML public void onSave ( ) { } @ FXML public void onOpen ( ) { } @ FXML public void onSaveAndExportHTML5GWT ( ) { } @ FXML public void onSaveAndExportHTML5Dragome ( ) { } @ FXML public void onSaveAndExportHTML5TeaVM ( ) { } @ FXML public void onSaveAndExportAndroid ( ) { } public void handleStatus ( @ Observes final StatusEvent aStatusEvent ) { } No newline ; at end ; of file ; }

Fix:
theSplitPane . setDividerPositions ( 0.1 , 0.1 ) ;
Buggy code:
public class FatAlbert implements Callable { private final VendingMachine vendingMachine ; private final Timer timer ; private final CountDownLatch start ; public FatAlbert ( final VendingMachine vendingMachine , Timer timer , CountDownLatch start ) { } public Object call ( ) throws Exception { int day = timer . getDay ( ) ; start . countDown ( ) ; start . await ( ) ; while ( day < ( Main . DAYS_TO_RUN ) ) { new akka . stm . Atomic < Boolean > ( ) { public Boolean atomically ( ) { final boolean candy = vendingMachine . dispenseCandy ( 1 , this . getClass ( ) ) ; <START_BUG> final boolean cookie = vendingMachine . dispenseCandy ( 1 , this . getClass ( ) ) ; <END_BUG> if ( candy && cookie ) System . out . println ( "<seq2seq4repair_space>Hey,<seq2seq4repair_space>hey<seq2seq4repair_space>hey!" ) ; else if ( candy ) System . out . println ( "<seq2seq4repair_space>At<seq2seq4repair_space>least<seq2seq4repair_space>I<seq2seq4repair_space>got<seq2seq4repair_space>a<seq2seq4repair_space>Candy" ) ; else if ( cookie ) System . out . println ( "<seq2seq4repair_space>At<seq2seq4repair_space>least<seq2seq4repair_space>I<seq2seq4repair_space>got<seq2seq4repair_space>a<seq2seq4repair_space>Cookie" ) ; else System . out . println ( "<seq2seq4repair_space>No<seq2seq4repair_space>food<seq2seq4repair_space>for<seq2seq4repair_space>me<seq2seq4repair_space>today" ) ; return candy && cookie ; } } . execute ( ) ; Thread . sleep ( getNextWaitTime ( ) ) ; day = timer . getDay ( ) ; } return null ; } private long getNextWaitTime ( ) { } }

Fix:
final boolean cookie = vendingMachine . dispenseCookie ( 1 , this . getClass ( ) ) ;
Buggy code:
class AddFolderToIndex extends IndexRequest { IPath folderPath ; IProject project ; char [ ] [ ] exclusionPattern ; public AddFolderToIndex ( IPath folderPath , IProject project , char [ ] [ ] exclusionPattern , IndexManager manager ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( this . isCancelled ) || ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) ) return true ; if ( ! ( project . isAccessible ( ) ) ) return true ; IResource folder = this . project . getParent ( ) . findMember ( this . folderPath ) ; if ( ( folder == null ) || ( ( folder . getType ( ) ) == ( IResource . FILE ) ) ) return true ; Index index = manager . getIndex ( this . containerPath , true , true ) ; if ( index == null ) return true ; <START_BUG> ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; <END_BUG> if ( monitor == null ) return true ; try { monitor . enterRead ( ) ; final IPath container = this . containerPath ; final IndexManager indexManager = this . manager ; final char [ ] [ ] pattern = exclusionPattern ; folder . accept ( new IResourceProxyVisitor ( ) { public boolean visit ( IResourceProxy proxy ) { switch ( proxy . getType ( ) ) { case IResource . FILE : if ( Util . isJavaFileName ( proxy . getName ( ) ) ) { IResource resource = proxy . requestResource ( ) ; if ( ( pattern == null ) || ( ! ( org . eclipse . jdt . internal . core . util . Util . isExcluded ( resource , pattern ) ) ) ) indexManager . addSource ( ( ( IFile ) ( resource ) ) , container ) ; } return false ; case IResource . FOLDER : if ( ( pattern != null ) && ( org . eclipse . jdt . internal . core . util . Util . isExcluded ( proxy . requestResource ( ) , pattern ) ) ) return false ; } return true ; } } , IResource . NONE ) ; } catch ( CoreException e ) { if ( JobManager . VERBOSE ) { JobManager . verbose ( ( ( "-><seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>" + ( this . folderPath ) ) + "<seq2seq4repair_space>to<seq2seq4repair_space>index<seq2seq4repair_space>because<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>following<seq2seq4repair_space>exception:" ) ) ; e . printStackTrace ( ) ; } return false ; } finally { monitor . exitRead ( ) ; } return true ; } public String toString ( ) { } }

Fix:
ReadWriteMonitor monitor = index . monitor ;
Buggy code:
public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory { private Hashtable attributes ; public DocumentBuilderFactoryImpl ( ) { } public DocumentBuilder newDocumentBuilder ( ) throws ParserConfigurationException { } public void setAttribute ( String name , Object value ) throws IllegalArgumentException { } public Object getAttribute ( String name ) throws IllegalArgumentException { DOMParser domParser = null ; try { domParser = new DocumentBuilderImpl ( this , attributes ) . getDOMParser ( ) ; return domParser . getProperty ( name ) ; } catch ( SAXException se1 ) { try { boolean result = domParser . getFeature ( name ) ; <START_BUG> return new Boolean ( result ) ; <END_BUG> } catch ( SAXException se2 ) { throw new IllegalArgumentException ( se1 . getMessage ( ) ) ; } } } }

Fix:
return result ? Boolean . TRUE : Boolean . FALSE ;
Buggy code:
public class SecurityServiceImpl extends ConfigurableServiceBase implements SecurityService { private static final Logger logger = LoggerFactory . getLogger ( SecurityServiceImpl . class ) ; @ Override public String authenticate ( String username , String password ) { } @ Override public String getCurrentUser ( ) { <START_BUG> return "NOT<seq2seq4repair_space>IMPLEMENTED" ; <END_BUG> } @ Override public Set < String > getUserPermissions ( String site , String path , String user , List < String > groups ) { } protected String getPermissionsKey ( String site , String filename ) { } protected void addUserRoles ( Set < String > roles , String site , String user ) { } @ Override public Set < String > getUserRoles ( String site , String user ) { } protected void addGroupRoles ( Set < String > roles , String site , List < String > groups , PermissionsConfigTO rolesConfig ) { } protected Set < String > populateUserPermissions ( String site , String path , Set < String > roles , PermissionsConfigTO permissionsConfig ) { } @ Override protected void loadConfiguration ( String key ) { } @ SuppressWarnings ( "unchecked" ) protected void loadRoles ( Element root , PermissionsConfigTO config ) { } @ SuppressWarnings ( "unchecked" ) protected Map < String , List < String > > getRoles ( List < Node > nodes , Map < String , List < String > > rolesMap ) { } @ SuppressWarnings ( "unchecked" ) protected void loadPermissions ( Element root , PermissionsConfigTO config ) { } protected String getSiteFromKey ( String key ) { } protected String getFilenameFromKey ( String key ) { } @ Override protected TimeStamped getConfiguration ( String key ) { } @ Override protected void removeConfiguration ( String key ) { } @ Override protected void checkForUpdate ( String site ) { } @ Override public void register ( ) { } public String getRoleMappingsFileName ( ) { } public void setRoleMappingsFileName ( String roleMappingsFileName ) { } public String getPermissionsFileName ( ) { } public void setPermissionsFileName ( String permissionsFileName ) { } public SecurityProvider getSecurityProvider ( ) { } public void setSecurityProvider ( SecurityProvider securityProvider ) { } public ContentTypeService getContentTypeService ( ) { } public void setContentTypeService ( ContentTypeService contentTypeService ) { } public ContentService getContentService ( ) { } public void setContentService ( ContentService contentService ) { } protected Map < String , PermissionsConfigTO > permissionsConfigMap = new HashMap < String , PermissionsConfigTO > ( ) ; protected String roleMappingsFileName ; protected String permissionsFileName ; protected SecurityProvider securityProvider ; protected ContentTypeService contentTypeService ; protected ContentService contentService ; }

Fix:
return securityProvider . getCurrentUser ( ) ;
Buggy code:
public final class StringsTest extends TestCase { public void test ( ) { } public void testBeforeFirst ( ) { } public void testAfterFirst ( ) { } public void testAfterLast ( ) { } public void testBeforeLastPathComponent ( ) { } public void testCapitalize ( ) { } public void testEscapeMarkup ( ) { } public void testEscapeMarkupWhiteSpace ( ) { } public void testEscapeMarkupUnicode ( ) throws UnsupportedEncodingException { } public void testReplaceHtmlEscapeNumber ( ) throws UnsupportedEncodingException { } private String convertNonASCIIString ( String str ) throws UnsupportedEncodingException { } public void testFirstPathComponent ( ) { } public void testIsEmpty ( ) { } public void testIsTrue ( ) throws StringValueConversionException { } public void testReplaceAll ( ) { } public void testSplit ( ) { } public void testStripEnding ( ) { } public void testToBoolean ( ) throws StringValueConversionException { } public void testToChar ( ) throws StringValueConversionException { } public void testToMultilineMarkup ( ) { } public void testToString ( ) { } public void testToStringThrowable ( ) { NullPointerException np = new NullPointerException ( "null<seq2seq4repair_space>test" ) ; WicketRuntimeException wre = new WicketRuntimeException ( "null<seq2seq4repair_space>test" , np ) ; String exceptionString = Strings . toString ( wre ) ; assertTrue ( ( ( exceptionString . length ( ) ) > 1 ) ) ; <START_BUG> assertTrue ( ( ( exceptionString . indexOf ( "WicketRuntimeException" ) ) != ( - 1 ) ) ) ; <END_BUG> } private void assertEquals ( String [ ] expected , String [ ] actual ) { } private String stringValue ( String [ ] arrayOfStrings ) { } }

Fix:
assertTrue ( exceptionString . contains ( "WicketRuntimeException" ) ) ;
Buggy code:
public class TestASTProvider { public static Program getRootASTNode ( String parseText ) { } public static Expression getTestFormula ( ) { } public static Expression getNegatedTestFormula ( ) { } public static Expression parseFormulaString ( String formulaString ) { <START_BUG> ASTNode n = TestASTProvider . getRootASTNode ( ( ( ( "{\nBoolean<seq2seq4repair_space>x<seq2seq4repair_space>:=<seq2seq4repair_space>" + formulaString ) + "\n" ) + "}" ) ) ; <END_BUG> List < Statement > statements = ( ( edu . kit . iti . formal . pse . worthwhile . model . ast . Block ) ( ( ( Program ) ( n ) ) . getMainBlock ( ) . getStatements ( ) . get ( 0 ) ) ) . getStatements ( ) ; return ( ( edu . kit . iti . formal . pse . worthwhile . model . ast . VariableDeclaration ) ( statements . get ( 0 ) ) ) . getInitialValue ( ) ; } }

Fix:
ASTNode n = TestASTProvider . getRootASTNode ( ( ( ( "{\nBoolean<seq2seq4repair_space>x<seq2seq4repair_space>:=<seq2seq4repair_space>" + formulaString ) + "\n" ) + "}\n" ) ) ;
Buggy code:
public class CookieValuePersister implements IValuePersister { private static final long serialVersionUID = 1L ; private static final Log log = LogFactory . getLog ( CookieValuePersister . class ) ; public void clear ( final FormComponent component ) { } public void load ( final FormComponent component ) { } public void save ( final FormComponent component ) { final String name = component . getPageRelativePath ( ) ; final String value = component . getValue ( ) ; Cookie cookie = getCookie ( component ) ; if ( cookie == null ) { cookie = new Cookie ( name , ( value == null ? "" : value ) ) ; } else { <START_BUG> cookie . setValue ( value ) ; <END_BUG> } cookie . setSecure ( false ) ; cookie . setMaxAge ( getSettings ( ) . getMaxAge ( ) ) ; save ( cookie ) ; } private void clear ( final Cookie cookie ) { } private String cookieToDebugString ( final Cookie cookie ) { } private Cookie getCookie ( final FormComponent component ) { } private Cookie [ ] getCookies ( ) { } private CookieValuePersisterSettings getSettings ( ) { } private WebRequest getWebRequest ( ) { } private WebResponse getWebResponse ( ) { } private Cookie save ( final Cookie cookie ) { } }

Fix:
cookie . setValue ( ( value == null ? "" : value ) ) ;
Buggy code:
public class RowMutation { private static ICompactSerializer < RowMutation > serializer_ ; public static final String HINT = "HINT" ; public static ICompactSerializer < RowMutation > serializer ( ) { } private String table_ ; private byte [ ] key_ ; protected Map < String , ColumnFamily > modifications_ = new HashMap < String , ColumnFamily > ( ) ; public RowMutation ( String table , byte [ ] key ) { } public RowMutation ( String table , Row row ) { } protected RowMutation ( String table , byte [ ] key , Map < String , ColumnFamily > modifications ) { } public String getTable ( ) { } public byte [ ] key ( ) { } public Set < String > columnFamilyNames ( ) { } public Collection < ColumnFamily > getColumnFamilies ( ) { } void addHints ( byte [ ] key , byte [ ] host ) throws IOException { } public void add ( ColumnFamily columnFamily ) { } public void removeColumnFamily ( String cfName ) { } public boolean isEmpty ( ) { } public void add ( QueryPath path , byte [ ] value , long timestamp , int timeToLive ) { } public void add ( QueryPath path , byte [ ] value , long timestamp ) { } public void delete ( QueryPath path , long timestamp ) { } public void apply ( ) throws IOException { } void applyBinary ( ) throws IOException , InterruptedException , ExecutionException { } public Message makeRowMutationMessage ( ) throws IOException { } public Message makeRowMutationMessage ( StorageService . Verb verb ) throws IOException { } public static RowMutation getRowMutationFromMutations ( String keyspace , byte [ ] key , Map < String , List < Mutation > > cfmap ) { } public static RowMutation getRowMutation ( String table , byte [ ] key , Map < String , List < ColumnOrSuperColumn > > cfmap ) { } public DataOutputBuffer getSerializedBuffer ( ) throws IOException { } public String toString ( ) { } private static void addColumnOrSuperColumnToRowMutation ( RowMutation rm , String cfName , ColumnOrSuperColumn cosc ) { } private static void deleteColumnOrSuperColumnToRowMutation ( RowMutation rm , String cfName , Deletion del ) { if ( ( ( del . predicate ) != null ) && ( ( del . predicate . column_names ) != null ) ) { for ( byte [ ] c : del . predicate . column_names ) { <START_BUG> if ( ( ( del . super_column ) == null ) && ( DatabaseDescriptor . getColumnFamilyType ( rm . table_ , cfName ) . equals ( "Super" ) ) ) <END_BUG> rm . delete ( new QueryPath ( cfName , c ) , del . timestamp ) ; else rm . delete ( new QueryPath ( cfName , del . super_column , c ) , del . timestamp ) ; } } else { rm . delete ( new QueryPath ( cfName , del . super_column ) , del . timestamp ) ; } } }

Fix:
if ( ( ( del . super_column ) == null ) && ( ( DatabaseDescriptor . getColumnFamilyType ( rm . table_ , cfName ) ) == ( ColumnFamilyType . Super ) ) )
Buggy code:
public class GenericCollectionTypeResolverTests extends AbstractGenericsTests { protected void setUp ( ) throws Exception { this . targetClass = GenericCollectionTypeResolverTests . Foo . class ; this . methods = new String [ ] { "a" , "b" , "b2" , "b3" , "c" , "d" , "d2" , "d3" , "e" , "e2" , "e3" } ; <START_BUG> this . expectedResults = new Class [ ] { Integer . class , null , null , Set . class , null , Integer . class , Integer . class , Integer . class , Integer . class , Integer . class , Integer . class } ; <END_BUG> } protected Type getType ( Method method ) { } public void testA ( ) throws Exception { } public void testB ( ) throws Exception { } public void testB2 ( ) throws Exception { } public void testB3 ( ) throws Exception { } public void testC ( ) throws Exception { } public void testD ( ) throws Exception { } public void testD2 ( ) throws Exception { } public void testD3 ( ) throws Exception { } public void testE ( ) throws Exception { } public void testE2 ( ) throws Exception { } public void testE3 ( ) throws Exception { } public void testProgrammaticListIntrospection ( ) throws Exception { } public void testClassResolution ( ) { } private abstract class CustomSet < T > extends AbstractSet < String > { } private abstract class CustomMap < T > extends AbstractMap < String , Integer > { } private abstract class OtherCustomMap < T > implements Map < String , Integer > { } private interface Foo { Map < String , Integer > a ( ) { } Map < ? , ? > b ( ) { } Map < ? , ? extends Set > b2 ( ) { } Map < ? , ? super Set > b3 ( ) { } Map c ( ) { } GenericCollectionTypeResolverTests . CustomMap < Date > d ( ) { } GenericCollectionTypeResolverTests . CustomMap < ? > d2 ( ) { } GenericCollectionTypeResolverTests . CustomMap d3 ( ) { } GenericCollectionTypeResolverTests . OtherCustomMap < Date > e ( ) { } GenericCollectionTypeResolverTests . OtherCustomMap < ? > e2 ( ) { } GenericCollectionTypeResolverTests . OtherCustomMap e3 ( ) { } } }

Fix:
this . expectedResults = new Class [ ] { Integer . class , null , Set . class , Set . class , null , Integer . class , Integer . class , Integer . class , Integer . class , Integer . class , Integer . class } ;
Buggy code:
public class TempFolder extends Folder { protected HeaderList headerList ; protected Hashtable messageList ; protected int nextUid ; protected AbstractMessage aktMessage ; protected DataStorageInterface dataStorage ; protected LocalSearchEngine searchEngine ; public TempFolder ( String name ) { } public void clear ( ) { } public void expungeFolder ( Object [ ] uids , WorkerStatusController worker ) throws Exception { } public boolean exists ( Object uid , WorkerStatusController worker ) throws Exception { } protected Object generateNextUid ( ) { } public void setNextUid ( int next ) { } public void expungeFolder ( WorkerStatusController worker ) throws Exception { } public Object addMessage ( AbstractMessage message , WorkerStatusController worker ) throws Exception { } public Object addMessage ( String source , WorkerStatusController worker ) throws Exception { } public boolean exists ( Object uid ) throws Exception { } public HeaderList getHeaderList ( WorkerStatusController worker ) throws Exception { } public void markMessage ( Object [ ] uids , int variant , WorkerStatusController worker ) throws Exception { } public void removeMessage ( Object uid , WorkerStatusController worker ) throws Exception { } public MimePart getMimePart ( Object uid , Integer [ ] address , WorkerStatusController worker ) throws Exception { } public String getMessageSource ( Object uid , WorkerStatusController worker ) throws Exception { } public MimePartTree getMimePartTree ( Object uid , WorkerStatusController worker ) throws Exception { } public ColumbaHeader getMessageHeader ( Object uid , WorkerStatusController worker ) throws Exception { } public AbstractMessage getMessage ( Object uid , WorkerStatusController worker ) throws Exception { } public SearchEngineInterface getSearchEngineInstance ( ) { } public Object [ ] searchMessages ( Filter filter , Object [ ] uids , WorkerStatusController worker ) throws Exception { } public Object [ ] searchMessages ( Filter filter , WorkerStatusController worker ) throws Exception { } <START_BUG> public Class getDefaultChild ( ) { <END_BUG> return null ; } public String getName ( ) { } public String toString ( ) { } }

Fix:
public String getDefaultChild ( ) {
Buggy code:
public class Select < T > extends FormComponent < T > { private static final long serialVersionUID = 1L ; public Select ( final String id ) { } public Select ( final String id , final IModel < T > model ) { } @ Override protected void convertInput ( ) { } @ Override public void updateModel ( ) { <START_BUG> Object object = Select . getDefaultModelObject ( ) ; <END_BUG> boolean supportsMultiple = object instanceof Collection ; Object converted = Select . getConvertedInput ( ) ; if ( supportsMultiple ) { Collection < ? > modelCollection = ( ( Collection < ? > ) ( object ) ) ; Select . modelChanging ( ) ; modelCollection . clear ( ) ; if ( converted != null ) { modelCollection . addAll ( ( ( Collection ) ( converted ) ) ) ; } Select . modelChanged ( ) ; Select . setDefaultModelObject ( modelCollection ) ; } else { Select . setDefaultModelObject ( converted ) ; } } boolean isSelected ( final SelectOption < ? > option ) { } private boolean compareModels ( final Object selected , final Object value ) { } }

Fix:
T object = Select . getModelObject ( ) ;
Buggy code:
public class PerSingleton extends PerClause { public PerSingleton ( ) { } <START_BUG> public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { <END_BUG> return FuzzyBoolean . YES ; } public FuzzyBoolean match ( Shadow shadow ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public PerClause concretize ( ResolvedTypeX inAspect ) { } public void write ( DataOutputStream s ) throws IOException { } public static PerClause readPerClause ( DataInputStream s , ISourceContext context ) throws IOException { } public Kind getKind ( ) { } public String toString ( ) { } }

Fix:
public FuzzyBoolean fastMatch ( FastMatchInfo type ) {
Buggy code:
public class WizardProvider extends AbstractProvider { private AbstractElement [ ] cachedElements ; private Map idToElement = new HashMap ( ) ; public AbstractElement getElementForId ( String id ) { } public AbstractElement [ ] getElements ( ) { if ( ( cachedElements ) == null ) { IWizardCategory rootCategory = WorkbenchPlugin . getDefault ( ) . getNewWizardRegistry ( ) . getRootCategory ( ) ; List result = new ArrayList ( ) ; collectWizards ( rootCategory , result ) ; IWizardDescriptor [ ] wizards = ( ( IWizardDescriptor [ ] ) ( result . toArray ( new IWizardDescriptor [ result . size ( ) ] ) ) ) ; cachedElements = new AbstractElement [ wizards . length ] ; for ( int i = 0 ; i < ( wizards . length ) ; i ++ ) { <START_BUG> WizardElement wizardElement = new WizardElement ( wizards [ i ] ) ; <END_BUG> cachedElements [ i ] = wizardElement ; idToElement . put ( wizardElement . getId ( ) , wizardElement ) ; } } return cachedElements ; } private void collectWizards ( IWizardCategory category , List result ) { } public String getId ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public String getName ( ) { } }

Fix:
WizardElement wizardElement = new WizardElement ( wizards [ i ] , this ) ;
Buggy code:
public class ConstructorLocator extends PatternLocator { protected ConstructorPattern pattern ; public ConstructorLocator ( ConstructorPattern pattern ) { } public int match ( ASTNode node , MatchingNodeSet nodeSet ) { } public int match ( ConstructorDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( Expression node , MatchingNodeSet nodeSet ) { } public int match ( TypeDeclaration node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected int matchLevelForReferences ( ConstructorDeclaration constructor ) { } protected int matchLevelForDeclarations ( ConstructorDeclaration constructor ) { } public int resolveLevel ( ASTNode node ) { } protected int referenceType ( ) { } protected int resolveLevel ( AllocationExpression allocation ) { } public int resolveLevel ( Binding binding ) { if ( binding == null ) return PatternLocator . INACCURATE_MATCH ; if ( ! ( binding instanceof MethodBinding ) ) return PatternLocator . IMPOSSIBLE_MATCH ; <START_BUG> MethodBinding method = ( ( MethodBinding ) ( binding ) ) ; <END_BUG> if ( ! ( method . isConstructor ( ) ) ) return PatternLocator . IMPOSSIBLE_MATCH ; int level = resolveLevelForType ( this . pattern . declaringSimpleName , this . pattern . declaringQualification , method . declaringClass ) ; if ( level == ( PatternLocator . IMPOSSIBLE_MATCH ) ) return PatternLocator . IMPOSSIBLE_MATCH ; int parameterCount = ( ( this . pattern . parameterSimpleNames ) == null ) ? - 1 : this . pattern . parameterSimpleNames . length ; if ( parameterCount > ( - 1 ) ) { if ( ( method . parameters ) == null ) return PatternLocator . INACCURATE_MATCH ; if ( parameterCount != ( method . parameters . length ) ) return PatternLocator . IMPOSSIBLE_MATCH ; for ( int i = 0 ; i < parameterCount ; i ++ ) { int newLevel = resolveLevelForType ( this . pattern . parameterSimpleNames [ i ] , this . pattern . parameterQualifications [ i ] , method . parameters [ i ] ) ; if ( level > newLevel ) { if ( newLevel == ( PatternLocator . IMPOSSIBLE_MATCH ) ) return PatternLocator . IMPOSSIBLE_MATCH ; level = newLevel ; } } } return level ; } protected int resolveLevel ( ConstructorDeclaration constructor , boolean checkDeclarations ) { } protected int resolveLevel ( TypeDeclaration type ) { } public String toString ( ) { } }

Fix:
MethodBinding method = ( ( MethodBinding ) ( binding ) ) . original ( ) ;
Buggy code:
public final class LocalizedImageResource implements Serializable , IResourceListener { private Component component ; private boolean isFactoryResource ; private Locale locale ; private Resource resource ; private String style ; private static final class ImageValueParser extends MetaPatternParser { private static final Group factoryName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group imageName = new Group ( MetaPattern . VARIABLE_NAME ) ; private static final Group specification = new Group ( MetaPattern . ANYTHING_NON_EMPTY ) ; private static final MetaPattern pattern = new MetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . factoryName , MetaPattern . COLON , new wicket . util . parse . metapattern . OptionalMetaPattern ( new MetaPattern [ ] { LocalizedImageResource . ImageValueParser . imageName } ) , MetaPattern . COLON , LocalizedImageResource . ImageValueParser . specification } ) ; private ImageValueParser ( final CharSequence input ) { } private String getFactoryName ( ) { } private String getImageName ( ) { } private String getSpecification ( ) { } } public LocalizedImageResource ( final Component component ) { } public final void bind ( ) { } public final void onResourceRequested ( ) { } public final void setResource ( final Resource resource ) { } public final void setSrcAttribute ( final ComponentTag tag ) { if ( ( ( ( locale ) != null ) && ( ( locale ) != ( component . getLocale ( ) ) ) ) || ( ( ( style ) != null ) && ( style . equals ( component . getStyle ( ) ) ) ) ) { if ( ( resource ) instanceof SharedResource ) { if ( isFactoryResource ) { this . resource = null ; } else { final SharedResource namedResource = ( ( SharedResource ) ( resource ) ) ; namedResource . setLocale ( locale ) ; namedResource . setStyle ( style ) ; } } else { this . resource = null ; } } if ( ( resource ) == null ) { final String src = tag . getString ( "src" ) ; if ( src != null ) { this . resource = loadStaticImage ( src ) ; } else { final String value = tag . getString ( "value" ) ; if ( value != null ) { this . resource = newImage ( value ) ; this . isFactoryResource = true ; } else { this . resource = loadStaticImage ( component . getModelObjectAsString ( ) ) ; } } } this . locale = component . getLocale ( ) ; this . style = component . getStyle ( ) ; final String url ; if ( ( this . resource ) instanceof SharedResource ) { <START_BUG> url = component . getPage ( ) . urlFor ( ( "shared//" + ( ( ( SharedResource ) ( resource ) ) . getPath ( ) ) ) ) ; <END_BUG> } else { url = component . urlFor ( IResourceListener . class ) ; } tag . put ( "src" , component . getResponse ( ) . encodeURL ( url ) . replaceAll ( "&" , "&amp;" ) ) ; } private ImageResource loadStaticImage ( final String path ) { } private Resource newImage ( final String value ) { } }

Fix:
url = component . getPage ( ) . urlFor ( ( ( SharedResource ) ( resource ) ) . getPath ( ) ) ;
Buggy code:
public class Conjunction extends BinaryOperation { public Conjunction ( Formula left , Formula right ) { } public Conjunction ( Formula left , Formula right , LogicalValue value ) { } @ Override public Sequence [ ] expand ( Sequence sigma ) { } @ Override public Conjunction clone ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "(" + ( right ) ) + ")<seq2seq4repair_space>&&<seq2seq4repair_space>(" ) + ( left ) ) + ")" ; <END_BUG> } }

Fix:
return ( ( ( "(" + ( left ) ) + ")<seq2seq4repair_space>&&<seq2seq4repair_space>(" ) + ( right ) ) + ")" ;
Buggy code:
public class EventStateTest { @ Test public void closeEvents ( ) throws ConvergenceException , DerivativeException , EventException { final double r1 = 90.0 ; final double r2 = 135.0 ; final double gap = r2 - r1 ; EventHandler closeEventsGenerator = new EventHandler ( ) { public void resetState ( double t , double [ ] y ) { } public double g ( double t , double [ ] y ) { return ( t - r1 ) * ( r2 - t ) ; } public int eventOccurred ( double t , double [ ] y , boolean increasing ) { return CONTINUE ; } } ; final double tolerance = 0.1 ; EventState es = new EventState ( closeEventsGenerator , ( 1.5 * gap ) , tolerance , 10 ) ; double t0 = r1 - ( 0.5 * gap ) ; es . reinitializeBegin ( t0 , new double [ 0 ] ) ; <START_BUG> AbstractStepInterpolator interpolator = new DummyStepInterpolator ( new double [ 0 ] , true ) ; <END_BUG> interpolator . storeTime ( t0 ) ; interpolator . shift ( ) ; interpolator . storeTime ( ( 0.5 * ( r1 + r2 ) ) ) ; Assert . assertTrue ( es . evaluateStep ( interpolator ) ) ; Assert . assertEquals ( r1 , es . getEventTime ( ) , tolerance ) ; es . stepAccepted ( es . getEventTime ( ) , new double [ 0 ] ) ; interpolator . shift ( ) ; interpolator . storeTime ( ( r2 + ( 0.4 * gap ) ) ) ; Assert . assertTrue ( es . evaluateStep ( interpolator ) ) ; Assert . assertEquals ( r2 , es . getEventTime ( ) , tolerance ) ; } }

Fix:
AbstractStepInterpolator interpolator = new DummyStepInterpolator ( new double [ 0 ] , new double [ 0 ] , true ) ;
Buggy code:
public class ImportContainer extends SourceRefElement implements IImportContainer { protected ImportContainer ( ICompilationUnit parent ) { } public String getHandleMemento ( ) { } protected char getHandleMementoDelimiter ( ) { } public IImportDeclaration getImport ( String name ) { } public ISourceRange getSourceRange ( ) throws JavaModelException { } public boolean hasChildren ( ) throws JavaModelException { } public String readableName ( ) { } protected void toString ( int tab , StringBuffer buffer ) { <START_BUG> Object info = fgJavaModelManager . getInfo ( this ) ; <END_BUG> if ( ( info == null ) || ( ! ( info instanceof JavaElementInfo ) ) ) return ; IJavaElement [ ] children = ( ( JavaElementInfo ) ( info ) ) . getChildren ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { if ( i > 0 ) buffer . append ( "\n" ) ; ( ( JavaElement ) ( children [ i ] ) ) . toString ( tab , buffer ) ; } } }

Fix:
Object info = fgJavaModelManager . peekAtInfo ( this ) ;
Buggy code:
public class ParameterTemplate { private static final String SEP = J2DoPrivHelper . getLineSeparator ( ) ; private final StringBuffer _buf = new StringBuffer ( ) ; private final Map _params = new HashMap ( ) ; public ParameterTemplate append ( String value ) { } public ParameterTemplate append ( boolean value ) { } public ParameterTemplate append ( char value ) { } public ParameterTemplate append ( double value ) { } public ParameterTemplate append ( float value ) { } public ParameterTemplate append ( int value ) { } public ParameterTemplate append ( long value ) { } public ParameterTemplate append ( short value ) { } public ParameterTemplate append ( Object value ) { } public ParameterTemplate append ( InputStream in ) throws IOException { } public ParameterTemplate append ( Reader reader ) throws IOException { } public ParameterTemplate append ( File file ) throws IOException { } public boolean hasParameter ( String name ) { } public Object getParameter ( String name ) { } public Object setParameter ( String name , Object val ) { } public void setParameters ( Map params ) { } public void clearParameters ( ) { } public String toString ( ) { if ( ( ( _buf . length ( ) ) == 0 ) || ( _params . isEmpty ( ) ) ) return _buf . toString ( ) ; StringBuffer copy = new StringBuffer ( ) ; StringBuffer param = null ; char ch ; char last = 0 ; for ( int i = 0 ; i < ( _buf . length ( ) ) ; i ++ ) { ch = _buf . charAt ( i ) ; if ( ( last == '$' ) && ( ch == '{' ) ) { copy . deleteCharAt ( ( ( copy . length ( ) ) - 1 ) ) ; param = new StringBuffer ( ) ; } else if ( ( ch == '}' ) && ( param != null ) ) { if ( _params . containsKey ( param . toString ( ) ) ) copy . append ( _params . get ( param . toString ( ) ) ) ; else <START_BUG> copy . append ( ( ( String ) ( AccessController . doPrivileged ( J2DoPrivHelper . getPropertyAction ( param . toString ( ) ) ) ) ) ) ; <END_BUG> param = null ; } else if ( param != null ) param . append ( ch ) ; else copy . append ( ch ) ; last = ch ; } return copy . toString ( ) ; } public void write ( OutputStream out ) throws IOException { } public void write ( Writer writer ) throws IOException { } public void write ( File file ) throws IOException { } }

Fix:
copy . append ( AccessController . doPrivileged ( J2DoPrivHelper . getPropertyAction ( param . toString ( ) ) ) ) ;
Buggy code:
public class WebPage extends Page { private static final long serialVersionUID = 1L ; private BodyContainer bodyContainer ; protected WebPage ( ) { } protected WebPage ( final IModel model ) { } protected WebPage ( final PageMap pageMap ) { } protected WebPage ( final PageMap pageMap , final IModel model ) { } protected WebPage ( final PageParameters parameters ) { } public BodyContainer getBodyContainer ( ) { } public String getMarkupType ( ) { } protected void configureResponse ( ) { } protected final WebRequestCycle getWebRequestCycle ( ) { } protected final BookmarkablePageLink homePageLink ( final String id ) { } private void commonInit ( ) { <START_BUG> MarkupStream markupStream = getApplication ( ) . getMarkupCache ( ) . getMarkupStream ( this , false ) ; <END_BUG> if ( markupStream != null ) { while ( markupStream . hasMore ( ) ) { final MarkupElement element = markupStream . next ( ) ; if ( element instanceof ComponentTag ) { final ComponentTag tag = ( ( ComponentTag ) ( element ) ) ; if ( ( ( tag . isOpen ( ) ) && ( "body" . equals ( tag . getName ( ) ) ) ) && ( ( tag . getNamespace ( ) ) == null ) ) { if ( BODY_ID . equals ( tag . getId ( ) ) ) { add ( new HtmlBodyContainer ( ) ) ; } bodyContainer = new BodyContainer ( this , tag . getId ( ) ) ; break ; } } } } } }

Fix:
MarkupStream markupStream = getAssociatedMarkupStream ( false ) ;