nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class AbstractCvsTask extends Task { public static final int DEFAULT_COMPRESSION_LEVEL = 3 ; private Commandline cmd = new Commandline ( ) ; private Vector vecCommandlines = new Vector ( ) ; private String cvsRoot ; private String cvsRsh ; private String cvsPackage ; private static final String default_command = "checkout" ; private String command = null ; private boolean quiet = false ; private int compression = 0 ; private boolean noexec = false ; private int port = 0 ; private File passFile = null ; private File dest ; private boolean append = false ; private File output ; private File error ; private boolean failOnError = false ; private ExecuteStreamHandler executeStreamHandler ; private OutputStream outputStream ; private OutputStream errorStream ; public AbstractCvsTask ( ) { } public void setExecuteStreamHandler ( ExecuteStreamHandler executeStreamHandler ) { } protected ExecuteStreamHandler getExecuteStreamHandler ( ) { } protected void setOutputStream ( OutputStream outputStream ) { } protected OutputStream getOutputStream ( ) { } protected void setErrorStream ( OutputStream errorStream ) { } protected OutputStream getErrorStream ( ) { } protected void runCommand ( Commandline toExecute ) throws BuildException { } public void execute ( ) throws BuildException { if ( ( ( this . getCommand ( ) ) == null ) && ( ( vecCommandlines . size ( ) ) == 0 ) ) { this . setCommand ( AbstractCvsTask . default_command ) ; } String c = this . getCommand ( ) ; if ( c != null ) { <START_BUG> this . cmd . createArgument ( ) . setLine ( c ) ; <END_BUG> this . addConfiguredCommandline ( this . cmd , true ) ; } for ( int i = 0 ; i < ( vecCommandlines . size ( ) ) ; i ++ ) { this . runCommand ( ( ( Commandline ) ( vecCommandlines . elementAt ( i ) ) ) ) ; } } private String executeToString ( Execute execute ) { } public void setCvsRoot ( String root ) { } public String getCvsRoot ( ) { } public void setCvsRsh ( String rsh ) { } public String getCvsRsh ( ) { } public void setPort ( int port ) { } public int getPort ( ) { } public void setPassfile ( File passFile ) { } public File getPassFile ( ) { } public void setDest ( File dest ) { } public File getDest ( ) { } public void setPackage ( String p ) { } public String getPackage ( ) { } public void setTag ( String p ) { } public void addCommandArgument ( String arg ) { } public void addCommandArgument ( Commandline c , String arg ) { } public void setDate ( String p ) { } public void setCommand ( String c ) { } public String getCommand ( ) { } public void setQuiet ( boolean q ) { } public void setNoexec ( boolean ne ) { } public void setOutput ( File output ) { } public void setError ( File error ) { } public void setAppend ( boolean value ) { } public void setFailOnError ( boolean failOnError ) { } protected void configureCommandline ( Commandline c ) { } public void addConfiguredCommandline ( Commandline c ) { } public void addConfiguredCommandline ( Commandline c , boolean insertAtStart ) { } public void setCompression ( int level ) { } public void setCompression ( boolean usecomp ) { } }

Fix:
this . cmd . createArgument ( true ) . setLine ( c ) ;
Buggy code:
class TabFolderTab extends Tab { TabFolder tabFolder1 ; Group tabFolderGroup ; Button topButton ; Button bottomButton ; static String [ ] TabItems1 = new String [ ] { ControlExample . getResourceString ( "TabItem1_0" ) , ControlExample . getResourceString ( "TabItem1_1" ) , ControlExample . getResourceString ( "TabItem1_2" ) } ; TabFolderTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Item [ ] getExampleWidgetItems ( ) { } Widget [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String setMethodName ( String methodRoot ) { } Object [ ] parameterForType ( String typeName , String value , Widget widget ) { if ( value . equals ( "" ) ) return new Object [ ] { new TabItem [ 0 ] } ; if ( typeName . equals ( "org.eclipse.swt.widgets.TabItem" ) ) { TabItem item = findItem ( value , ( ( TabFolder ) ( widget ) ) . getItems ( ) ) ; if ( item != null ) return new Object [ ] { item } ; } if ( typeName . equals ( "[Lorg.eclipse.swt.widgets.TabItem;" ) ) { <START_BUG> String [ ] values = value . split ( "," ) ; <END_BUG> TabItem [ ] items = new TabItem [ values . length ] ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { items [ i ] = findItem ( values [ i ] , ( ( TabFolder ) ( widget ) ) . getItems ( ) ) ; } return new Object [ ] { items } ; } return super . parameterForType ( typeName , value , widget ) ; } TabItem findItem ( String value , TabItem [ ] items ) { } public String getShortTabText ( ) { } String getTabText ( ) { } void setExampleWidgetState ( ) { } }

Fix:
String [ ] values = split ( value , ',' ) ;
Buggy code:
public class SarModuleDependencyProcessor implements DeploymentUnitProcessor { private static ModuleIdentifier JBOSS_MODULES_ID = ModuleIdentifier . create ( "org.jboss.modules" ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final JBossServiceXmlDescriptor serviceXmlDescriptor = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; if ( serviceXmlDescriptor == null ) { return ; } <START_BUG> moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( Module . getBootModuleLoader ( ) , SarModuleDependencyProcessor . JBOSS_MODULES_ID , false , false , false ) ) ; <END_BUG> } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( Module . getBootModuleLoader ( ) , SarModuleDependencyProcessor . JBOSS_MODULES_ID , false , false , false , false ) ) ;
Buggy code:
public class CheckBox extends FormComponent implements IOnChangeListener { public CheckBox ( final String id ) { } public CheckBox ( final String id , IModel model ) { } public final void setModelValue ( String value ) { } public void onSelectionChanged ( ) { } protected void onSelectionChanged ( Object newSelection ) { } protected boolean wantOnSelectionChangedNotifications ( ) { } protected final void onComponentTag ( final ComponentTag tag ) { checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "checkbox" ) ; final String value = getValue ( ) ; if ( value != null ) { try { if ( Strings . isTrue ( value ) ) { tag . put ( "checked" , "checked" ) ; } else { tag . remove ( "checked" ) ; } } catch ( StringValueConversionException e ) { throw new wicket . WicketRuntimeException ( ( ( "Invalid<seq2seq4repair_space>boolean<seq2seq4repair_space>value<seq2seq4repair_space>\"" + value ) + "\"" ) , e ) ; } } if ( wantOnSelectionChangedNotifications ( ) ) { final String url = urlFor ( IOnChangeListener . class ) ; <START_BUG> tag . put ( "onclick" , ( ( ( ( "location.href='" + url ) + "&" ) + ( getPath ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.checked;" ) ) ; <END_BUG> } super . onComponentTag ( tag ) ; } protected final boolean supportsPersistence ( ) { } public void updateModel ( ) { } }

Fix:
tag . put ( "onclick" , ( ( ( ( "location.href='" + url ) + "&" ) + ( getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.checked;" ) ) ;
Buggy code:
public abstract class AbstractAnnotationTests { protected ApplicationContext ctx ; protected CacheableService cs ; protected CacheableService ccs ; protected CacheManager cm ; protected abstract String getConfig ( ) { } @ Before public void setup ( ) { } public void testCacheable ( CacheableService service ) throws Exception { } public void testInvalidate ( CacheableService service ) throws Exception { } public void testInvalidateWKey ( CacheableService service ) throws Exception { Object o1 = new Object ( ) ; Object o2 = new Object ( ) ; Object r1 = service . cache ( o1 ) ; Object r2 = service . cache ( o1 ) ; assertSame ( r1 , r2 ) ; <START_BUG> service . invalidate ( o1 , null ) ; <END_BUG> Object r3 = service . cache ( o1 ) ; Object r4 = service . cache ( o1 ) ; assertNotSame ( r1 , r3 ) ; assertSame ( r3 , r4 ) ; } public void testConditionalExpression ( CacheableService service ) throws Exception { } public void testKeyExpression ( CacheableService service ) throws Exception { } public void testNullValue ( CacheableService service ) throws Exception { } public void testMethodName ( CacheableService service , String keyName ) throws Exception { } public void testRootVars ( CacheableService service ) { } public void testNullArg ( CacheableService service ) { } @ Test public void testCacheable ( ) throws Exception { } @ Test public void testInvalidate ( ) throws Exception { } @ Test public void testInvalidateWithKey ( ) throws Exception { } @ Test public void testConditionalExpression ( ) throws Exception { } @ Test public void testKeyExpression ( ) throws Exception { } @ Test public void testClassCacheCacheable ( ) throws Exception { } @ Test public void testClassCacheInvalidate ( ) throws Exception { } @ Test public void testClassCacheInvalidateWKey ( ) throws Exception { } @ Test public void testNullValue ( ) throws Exception { } @ Test public void testClassNullValue ( ) throws Exception { } @ Test public void testMethodName ( ) throws Exception { } @ Test public void testClassMethodName ( ) throws Exception { } @ Test public void testRootVars ( ) throws Exception { } @ Test public void testClassRootVars ( ) throws Exception { } @ Test public void testNullArg ( ) throws Exception { } @ Test public void testClassNullArg ( ) throws Exception { } }

Fix:
service . evict ( o1 , null ) ;
Buggy code:
public class ZCompressorInputStream extends CompressorInputStream { private static final int MAGIC_1 = 31 ; private static final int MAGIC_2 = 157 ; private static final int BLOCK_MODE_MASK = 128 ; private static final int MAX_CODE_SIZE_MASK = 31 ; private final InputStream in ; private final boolean blockMode ; private final int clearCode ; private final int maxCodeSize ; private int codeSize = 9 ; private int bitsCached = 0 ; private int bitsCachedSize = 0 ; private long totalCodesRead = 0 ; private int previousCode = - 1 ; private int tableSize = 0 ; private final int [ ] prefixes ; private final byte [ ] characters ; private final byte [ ] outputStack ; private int outputStackLocation ; public ZCompressorInputStream ( InputStream inputStream ) throws IOException { } public void close ( ) throws IOException { } private void clearEntries ( ) { } private int readNextCode ( ) throws IOException { } private void reAlignReading ( ) throws IOException { } private void addEntry ( int previousCode , byte character ) throws IOException { } private int decompressNextSymbol ( ) throws IOException { final int code = readNextCode ( ) ; if ( code < 0 ) { return - 1 ; } else if ( ( blockMode ) && ( code == ( clearCode ) ) ) { clearEntries ( ) ; reAlignReading ( ) ; codeSize = 9 ; previousCode = - 1 ; return 0 ; } else { boolean addedUnfinishedEntry = false ; if ( code == ( tableSize ) ) { if ( ( previousCode ) == ( - 1 ) ) { <START_BUG> throw new IOException ( "The<seq2seq4repair_space>first<seq2seq4repair_space>code<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>reference<seq2seq4repair_space>to<seq2seq4repair_space>code<seq2seq4repair_space>before<seq2seq4repair_space>itself" ) ; <END_BUG> } byte firstCharacter = 0 ; for ( int last = previousCode ; last >= 0 ; last = prefixes [ last ] ) { firstCharacter = characters [ last ] ; } addEntry ( previousCode , firstCharacter ) ; addedUnfinishedEntry = true ; } else if ( code > ( tableSize ) ) { throw new IOException ( String . format ( "Invalid<seq2seq4repair_space>%d<seq2seq4repair_space>bit<seq2seq4repair_space>code<seq2seq4repair_space>0x%x" , codeSize , code ) ) ; } for ( int entry = code ; entry >= 0 ; entry = prefixes [ entry ] ) { outputStack [ ( -- ( outputStackLocation ) ) ] = characters [ entry ] ; } if ( ( ( previousCode ) != ( - 1 ) ) && ( ! addedUnfinishedEntry ) ) { addEntry ( previousCode , outputStack [ outputStackLocation ] ) ; } previousCode = code ; return outputStackLocation ; } } public int read ( ) throws IOException { } public int read ( byte [ ] b , int off , int len ) throws IOException { } }

Fix:
throw new IOException ( "The<seq2seq4repair_space>first<seq2seq4repair_space>code<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>reference<seq2seq4repair_space>to<seq2seq4repair_space>its<seq2seq4repair_space>preceding<seq2seq4repair_space>code" ) ;
Buggy code:
public interface IVEXDocumentFragment { public static final String MIME_TYPE = "application//x-vex-document-fragment" ; public IContent getContent ( ) { } public int getLength ( ) { } public List < IVEXElement > getElements ( ) { } <START_BUG> public String [ ] getNodeNames ( ) ; <END_BUG> public IVEXNode [ ] getNodes ( ) { } }

Fix:
public List < String > getNodeNames ( ) ;
Buggy code:
public class SuperReference extends ThisReference { public SuperReference ( int sourceStart , int sourceEnd ) { } public static ExplicitConstructorCall implicitSuperConstructorCall ( ) { } public boolean isImplicitThis ( ) { } public boolean isSuper ( ) { } public boolean isThis ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; if ( ! ( checkAccess ( scope . methodScope ( ) ) ) ) return null ; SourceTypeBinding enclosingTb = scope . enclosingSourceType ( ) ; <START_BUG> if ( scope . isJavaLangObject ( enclosingTb ) ) { <END_BUG> scope . problemReporter ( ) . cannotUseSuperInJavaLangObject ( this ) ; return null ; } return this . resolvedType = enclosingTb . superclass ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( enclosingTb . id ) == ( T_Object ) ) {
Buggy code:
@ Component public class TokenService { private static final Logger log = Logger . getLogger ( TokenService . class ) ; @ Autowired public TokenDao tokenDao ; @ Autowired public UserDao userDao ; public String createToken ( User user ) { Long userId = user . getUserId ( ) ; TokenService . log . info ( ( "use<seq2seq4repair_space>when<seq2seq4repair_space>create<seq2seq4repair_space>token<seq2seq4repair_space>:<seq2seq4repair_space>" + user ) ) ; Token token = new Token ( ) ; <START_BUG> token . setUserId ( userId ) ; <END_BUG> token . setToken ( UUID . randomUUID ( ) . toString ( ) ) ; tokenDao . createToken ( token ) ; return token . getToken ( ) ; } public User getUserByToken ( String token ) { } public String getTokenById ( Long userId ) { } }

Fix:
token . setUserId ( 17L ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws Exception { } private static ServletContextHandler getServletContextHandler ( ) throws IOException { WebApplicationContext context = Main . getContext ( ) ; ServletContextHandler contextHandler = new ServletContextHandler ( ) ; contextHandler . setContextPath ( "//" ) ; contextHandler . addServlet ( new ServletHolder ( new org . springframework . web . servlet . DispatcherServlet ( context ) ) , "//*" ) ; contextHandler . addEventListener ( new org . springframework . web . context . ContextLoaderListener ( context ) ) ; <START_BUG> contextHandler . setInitParameter ( "contextInitializerClasses" , "nl.focalor.utobot.spring.UtobotContextInitializer" ) ; <END_BUG> return contextHandler ; } private static WebApplicationContext getContext ( ) { } }

Fix:
contextHandler . setInitParameter ( "contextInitializerClasses" , "nl.focalor.utobot.spring.UtobotPropertiesContextInitializer" ) ;
Buggy code:
public class TestQuery extends AbstractTestCase { @ Override public String getDialect ( ) { } private Map getFinder ( ) { } public void testSelect ( ) throws Exception { exec ( new ExecHandler ( ) { public void execute ( ) throws Exception { Map map = new HashMap ( ) ; map . put ( "addr2" , "%capitol%" ) ; em . select ( "today,fullname,address.barangay.name,address_barangay_city:{'cebu<seq2seq4repair_space>city'},<seq2seq4repair_space>name:{<seq2seq4repair_space>CONCAT(lastname,<seq2seq4repair_space>',',<seq2seq4repair_space>firstname)<seq2seq4repair_space>},<seq2seq4repair_space>today:<seq2seq4repair_space>{NOW()}" ) ; <START_BUG> List list = em . where ( "address2<seq2seq4repair_space>like<seq2seq4repair_space>:addr2<seq2seq4repair_space>and<seq2seq4repair_space>1=1" , map ) . limit ( 2 ) . list ( ) ; <END_BUG> printList ( list ) ; } } ) ; } }

Fix:
List list = em . where ( "address2<seq2seq4repair_space>like<seq2seq4repair_space>:addr2<seq2seq4repair_space>and<seq2seq4repair_space>1=1" , map ) . orderBy ( "address.barangay.name" ) . limit ( 2 ) . list ( ) ;
Buggy code:
public class RefModule extends NamedReference { public final ArrayView < IToken > packageList ; public final BaseLexElement moduleToken ; public final ArrayView < String > packages ; public final String module ; public RefModule ( ArrayView < IToken > packageList , BaseLexElement moduleToken ) { } public static String [ ] tokenArrayToStringArray ( ArrayView < IToken > tokenArray ) { } public String getModuleSimpleName ( ) { } @ Override public ASTNodeTypes getNodeType ( ) { } @ Override public void visitChildren ( IASTVisitor visitor ) { } @ Override protected CommonASTNode doCloneTree ( ) { } @ Override public void toStringAsCode ( ASTCodePrinter cp ) { } @ Override public String getCoreReferenceName ( ) { } @ Override public boolean isMissingCoreReference ( ) { } public String getRefModuleFullyQualifiedName ( ) { } private String [ ] getPackageNames ( ) { } public INamedElement createNamespaceFragment ( ISemanticContext context ) { if ( ( getPackageNames ( ) . length ) == 0 ) { return resolveTargetElement ( context ) ; } if ( isMissingCoreReference ( ) ) { return null ; } else { INamedElement moduleElem = new dtool . engine . analysis . ModuleProxy ( getRefModuleFullyQualifiedName ( ) , context , false , this ) ; <START_BUG> return PackageNamespace . createNamespaceElement ( getPackageNames ( ) , moduleElem , this ) ; <END_BUG> } } @ Override public void performNameLookup ( CommonScopeLookup search ) { } No newline ; at end ; of file ; }

Fix:
return PackageNamespace . createNamespaceElement ( getPackageNames ( ) , moduleElem ) ;
Buggy code:
public final class ContextManager implements IContextManager { private static ContextManager instance ; public static ContextManager getInstance ( ) { } private SortedSet activeContextIds = new TreeSet ( ) ; private IContextManagerEvent contextManagerEvent ; private List contextManagerListeners ; private SortedMap contextHandlesById = new TreeMap ( ) ; private SortedMap contextsById = new TreeMap ( ) ; private IRegistry pluginRegistry ; private IMutableRegistry preferenceRegistry ; private ContextManager ( ) { } public void addContextManagerListener ( IContextManagerListener contextManagerListener ) { } public SortedSet getActiveContextIds ( ) { } public IContextHandle getContextHandle ( String contextId ) { } public SortedMap getContextsById ( ) { } public void removeContextManagerListener ( IContextManagerListener contextManagerListener ) { } public void setActiveContextIds ( SortedSet activeContextIds ) { activeContextIds = Util . safeCopy ( activeContextIds , String . class ) ; <START_BUG> if ( activeContextIds . equals ( this . activeContextIds ) ) { <END_BUG> this . activeContextIds = activeContextIds ; fireContextManagerChanged ( ) ; } } private void fireContextManagerChanged ( ) { } private void loadPluginRegistry ( ) { } private void loadPreferenceRegistry ( ) { } private void updateFromRegistries ( ) { } }

Fix:
if ( ! ( activeContextIds . equals ( this . activeContextIds ) ) ) {
Buggy code:
public class Command { private final Chat group ; private final String input ; private final String [ ] inputArray ; private final ChatMessage received ; private final String sender ; private String foundCommand ; private static final String [ ] commandList = new String [ ] { "!lewd" , "!commands" , "!roll" , "!cointoss" , "!google" } ; public Command ( ChatMessage received , Chat group ) throws SkypeException { } public void handleCommands ( ) throws SkypeException { if ( inString ( ) ) { if ( foundCommand . equals ( "!lewd" ) ) { group . send ( "SkypeBot:<seq2seq4repair_space>http:////i2.kym-cdn.com//entries//icons//original//000//017//225//zAp2LzJ.jpg" ) ; } else if ( foundCommand . equals ( "!commands" ) ) { for ( String command : Command . commandList ) { <START_BUG> group . send ( command ) ; <END_BUG> } } else if ( foundCommand . equals ( "!roll" ) ) { Random rand = new Random ( ) ; int randInt = rand . nextInt ( 99 ) ; group . send ( ( ( "SkypeBot:<seq2seq4repair_space>Rolled<seq2seq4repair_space>" + randInt ) + ".<seq2seq4repair_space>(0-99)" ) ) ; } else if ( foundCommand . equals ( "!cointoss" ) ) { Random rand = new Random ( ) ; int randInt = rand . nextInt ( 99 ) ; if ( randInt < 50 ) { group . send ( "SkypeBot:<seq2seq4repair_space>Coin<seq2seq4repair_space>toss<seq2seq4repair_space>came<seq2seq4repair_space>up<seq2seq4repair_space>HEADS." ) ; } else { group . send ( "SkypeBot:<seq2seq4repair_space>Coin<seq2seq4repair_space>toss<seq2seq4repair_space>came<seq2seq4repair_space>up<seq2seq4repair_space>TAILS." ) ; } } else if ( foundCommand . equals ( "!google" ) ) { String search ; search = input . substring ( 7 ) ; Google google = new Google ( ) ; if ( foundCommand . equals ( inputArray [ 0 ] ) ) try { google . search ( search , group ) ; } catch ( UnsupportedEncodingException e ) { } catch ( IOException e ) { } } } } private boolean inString ( ) { } }

Fix:
group . send ( ( ( "-" + command ) + "-" ) ) ;
Buggy code:
public class ClientVerticle extends AbstractVerticle implements Handler < AsyncResult < Message < JsonObject > > > { @ Override public void start ( ) { JsonObject requestMsg = new JsonObject ( ) ; requestMsg . put ( "body" , "rajith" ) ; System . out . println ( ( "Client<seq2seq4repair_space>verticle<seq2seq4repair_space>sent<seq2seq4repair_space>request<seq2seq4repair_space>:<seq2seq4repair_space>" + ( requestMsg . encodePrettily ( ) ) ) ) ; <START_BUG> vertx . eventBus ( ) . send ( "hello-service" , requestMsg , this ) ; <END_BUG> } @ Override public void handle ( AsyncResult < Message < JsonObject > > result ) { } No newline ; at end ; of file ; }

Fix:
vertx . eventBus ( ) . send ( "hello-service-amqp" , requestMsg , this ) ;
Buggy code:
public class CalloutDeployMessage { private static ICompactSerializer < CalloutDeployMessage > serializer_ ; public static ICompactSerializer < CalloutDeployMessage > serializer ( ) { } public static Message getCalloutDeployMessage ( CalloutDeployMessage cdMessage ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; CalloutDeployMessage . serializer_ . serialize ( cdMessage , dos ) ; <START_BUG> Message message = new Message ( StorageService . getLocalStorageEndPoint ( ) , "" , StorageService . calloutDeployVerbHandler_ , new Object [ ] { bos . toByteArray ( ) } ) ; <END_BUG> return message ; } private String callout_ ; private String script_ ; public CalloutDeployMessage ( String callout , String script ) { } String getCallout ( ) { } String getScript ( ) { } }

Fix:
Message message = new Message ( StorageService . getLocalStorageEndPoint ( ) , "" , StorageService . calloutDeployVerbHandler_ , bos . toByteArray ( ) ) ;
Buggy code:
public class Helper { public static final String KEY_ROWID = "_id" ; public static final String KEY_TEST = "TestText" ; public static final String KEY_A_answer = "A_answer" ; public static final String KEY_B_answer = "B_answer" ; public static final String KEY_C_answer = "C_answer" ; public static final String KEY_D_answer = "D_answer" ; public static final String KEY_E_answer = "E_answer" ; public static final String KEY_CORRECT = "CorrectAnswer" ; public static final String KEY_IFEEXISTS = "IfEExists" ; private static final String DATABASE_NAME = "ukrm.sqlite" ; private static final String DATABASE_TABLE = "Ukrm1" ; private static final int DATABASE_VERSION = 1 ; private Helper . DbHelper ourHelper ; private final Context ourContext ; private SQLiteDatabase ourDatabase ; private static class DbHelper extends SQLiteOpenHelper { public DbHelper ( Context context ) { } @ Override public void onCreate ( SQLiteDatabase db ) { } @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } } public Helper ( Context c ) { } public Helper open ( ) throws SQLException { } public void close ( ) { } public long getSize ( ) { } public String getKEY_TEST ( long l ) throws SQLException { } public String getKEY_A_answer ( long l ) throws SQLException { } public String getKEY_B_answer ( long l ) throws SQLException { } public String getKEY_C_answer ( long l ) throws SQLException { String [ ] columns = new String [ ] { Helper . KEY_ROWID , Helper . KEY_TEST , Helper . KEY_A_answer , Helper . KEY_B_answer , Helper . KEY_C_answer , Helper . KEY_D_answer , Helper . KEY_E_answer , Helper . KEY_CORRECT , Helper . KEY_IFEEXISTS } ; Cursor c = ourDatabase . query ( Helper . DATABASE_TABLE , columns , ( ( ( Helper . KEY_ROWID ) + "=" ) + l ) , null , null , null , null ) ; if ( c != null ) { c . moveToFirst ( ) ; <START_BUG> String data = c . getString ( 3 ) ; <END_BUG> return data ; } return null ; } public String getKEY_D_answer ( long l ) throws SQLException { } public int getKEY_CORRECT ( long l ) throws SQLException { } public boolean getKEY_IFEEXISTS ( long l ) throws SQLException { } public String getKEY_E_answer ( long l ) throws SQLException { } }

Fix:
String data = c . getString ( 4 ) ;
Buggy code:
public class CompoundAssignment extends Assignment implements OperatorIds { public int operator ; public int assignmentImplicitConversion ; public CompoundAssignment ( Expression lhs , Expression expression , int operator , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public String operatorToString ( ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; TypeBinding lhsType = lhs . resolveType ( scope ) ; TypeBinding expressionType = expression . resolveType ( scope ) ; if ( ( lhsType == null ) || ( expressionType == null ) ) return null ; int lhsId = lhsType . id ; int expressionId = expressionType . id ; if ( ( restrainUsageToNumericTypes ( ) ) && ( ! ( lhsType . isNumericType ( ) ) ) ) { scope . problemReporter ( ) . operatorOnlyValidOnNumericType ( this , lhsType , expressionType ) ; return null ; } if ( ( lhsId > 15 ) || ( expressionId > 15 ) ) { if ( lhsId != ( T_String ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } expressionId = T_Object ; } int result = ResolveTypeTables [ operator ] [ ( ( lhsId << 4 ) + expressionId ) ] ; if ( result == ( TypeIds . T_undefined ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } if ( ( operator ) == ( OperatorIds . PLUS ) ) { if ( scope . isJavaLangObject ( lhsType ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } else if ( ( ( lhsType . isNumericType ( ) ) || ( lhsId == ( TypeIds . T_boolean ) ) ) && ( ! ( expressionType . isNumericType ( ) ) ) ) { scope . problemReporter ( ) . invalidOperator ( this , lhsType , expressionType ) ; return null ; } } lhs . implicitConversion = result > > > 12 ; expression . implicitConversion = ( result > > > 4 ) & 255 ; assignmentImplicitConversion = ( lhsId << 4 ) + ( result & 15 ) ; <START_BUG> return this . expressionType = lhsType ; <END_BUG> } public boolean restrainUsageToNumericTypes ( ) { } public String toStringExpressionNoParenthesis ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
return this . resolvedType = lhsType ;
Buggy code:
public class ItemSelectionReaction < T > extends Reaction { private final T item ; public ItemSelectionReaction ( String source , @ Nullable T item ) { } public T getItem ( ) { } @ Override public String toString ( ) { <START_BUG> return ( ( "ItemSelectionReaction{" + "item=" ) + ( item ) ) + '}' ; <END_BUG> } }

Fix:
return ( ( ( "ItemSelectionReaction{" + "item=" ) + ( item ) ) + "}<seq2seq4repair_space>" ) + ( super . toString ( ) ) ;
Buggy code:
public class InsideSubRoutineFlowContext extends FlowContext { public UnconditionalFlowInfo initsOnReturn ; public InsideSubRoutineFlowContext ( FlowContext parent , AstNode associatedNode ) { } public String individualToString ( ) { } public UnconditionalFlowInfo initsOnReturn ( ) { } public boolean isNonReturningContext ( ) { } public SubRoutineStatement subRoutine ( ) { } public void recordReturnFrom ( FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; if ( ( initsOnReturn ) == ( FlowInfo . DEAD_END ) ) { initsOnReturn = flowInfo . copy ( ) . unconditionalInits ( ) ; } else { <START_BUG> initsOnReturn = initsOnReturn . mergedWith ( flowInfo . unconditionalInits ( ) ) ; <END_BUG> } } }

Fix:
initsOnReturn = initsOnReturn . mergedWith ( flowInfo . copy ( ) . unconditionalInits ( ) ) ;
Buggy code:
public abstract class Border extends HtmlContainer { private ComponentTag openTag ; public Border ( final String componentName ) { } protected final void handleBody ( final RequestCycle cycle , final MarkupStream markupStream , final ComponentTag openTag ) { } public final ComponentTag getOpenTag ( ) { } protected boolean resolveComponent ( final RequestCycle cycle , final MarkupStream markupStream , final ComponentTag tag ) { <START_BUG> if ( ( ! ( tag . getComponentName ( ) . equals ( "[body]" ) ) ) && ( ! ( ( markupStream . atOpenTag ( "region" ) ) && ( "body" . equalsIgnoreCase ( ( ( wicket . markup . ComponentWicketTag ) ( tag ) ) . getNameAttribute ( ) ) ) ) ) ) { <END_BUG> return false ; } if ( ! ( markupStream . atOpenCloseTag ( ) ) ) { markupStream . throwMarkupException ( "A<seq2seq4repair_space><wicket:region<seq2seq4repair_space>name=body><seq2seq4repair_space>tag<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>open-close<seq2seq4repair_space>tag." ) ; } renderTag ( cycle , tag ) ; markupStream . next ( ) ; Border border = ( ( Border ) ( ( ( this ) instanceof Border ) ? this : findParent ( Border . class ) ) ) ; if ( ( border . getMarkupStream ( ) ) == null ) { Container borderParent = border . getParent ( ) ; border = ( ( Border ) ( ( borderParent instanceof Border ) ? borderParent : borderParent . findParent ( Border . class ) ) ) ; } final MarkupStream borderMarkup = border . findMarkupStream ( ) ; border . setMarkupStream ( null ) ; border . renderBody ( cycle , border . findMarkupStream ( ) , border . getOpenTag ( ) ) ; border . setMarkupStream ( borderMarkup ) ; return true ; } }

Fix:
if ( ( ! ( tag . getComponentName ( ) . equals ( "[body]" ) ) ) && ( ! ( ( markupStream . atOpenCloseTag ( "region" ) ) && ( "body" . equalsIgnoreCase ( ( ( wicket . markup . ComponentWicketTag ) ( tag ) ) . getNameAttribute ( ) ) ) ) ) ) {
Buggy code:
public class RootIndex { Root [ ] [ ] index = new Root [ 5 ] [ ] ; public void setRoot ( Root r ) { } public Root getRoot ( Skalar exponent , Skalar radicand ) { int exp = exponent . intValue ( ) ; int rad = radicand . intValue ( ) ; <START_BUG> if ( ( ( ( exp >= ( index . length ) ) || ( exp <= 0 ) ) || ( rad >= ( index [ exp ] . length ) ) ) || ( rad < 0 ) ) { <END_BUG> return null ; } else { return index [ exp ] [ rad ] ; } } public Root [ ] getRoots ( Skalar exponent ) { } public Root [ ] getRoots ( ) { } public Root [ ] [ ] getIndex ( ) { } public Root [ ] getIndex ( Skalar exponent ) { } public void addRoot ( Root r ) { } }

Fix:
if ( ( ( ( exp >= ( index . length ) ) || ( exp <= 0 ) ) || ( ( ( index [ exp ] ) == null ) | ( rad >= ( index [ exp ] . length ) ) ) ) || ( rad < 0 ) ) {
Buggy code:
public class Tools { public static Channel getChannel ( String channel ) { } public static String getBotUsername ( ) { <START_BUG> return UnacceptableBot . getBot ( ) . getNick ( ) ; <END_BUG> } public static String capitaliseFirstLetter ( String input ) { } public static String compareDate ( long milliseconds1 , long milliseconds2 ) { } }

Fix:
return UnacceptableBot . getBot ( ) . isConnected ( ) ? UnacceptableBot . getBot ( ) . getNick ( ) : "NOTCONNECTED" ;
Buggy code:
@ Configuration public class LoadTimeWeavingConfiguration implements BeanClassLoaderAware , ImportAware { private Map < String , Object > enableLTW ; @ Autowired ( required = false ) private LoadTimeWeavingConfigurer ltwConfigurer ; private ClassLoader beanClassLoader ; public void setImportMetadata ( AnnotationMetadata importMetadata ) { } public void setBeanClassLoader ( ClassLoader beanClassLoader ) { } @ Bean ( name = ConfigurableApplicationContext . LOAD_TIME_WEAVER_BEAN_NAME ) @ Role ( BeanDefinition . ROLE_INFRASTRUCTURE ) public LoadTimeWeaver loadTimeWeaver ( ) { LoadTimeWeaver loadTimeWeaver = null ; if ( ( ltwConfigurer ) != null ) { loadTimeWeaver = ltwConfigurer . getLoadTimeWeaver ( ) ; } if ( loadTimeWeaver == null ) { loadTimeWeaver = new DefaultContextLoadTimeWeaver ( this . beanClassLoader ) ; } switch ( ( ( AspectJWeaving ) ( this . enableLTW . get ( "aspectjWeaving" ) ) ) ) { case DISABLED : break ; case AUTODETECT : <START_BUG> if ( ( this . beanClassLoader . getResource ( ASPECTJ_AOP_XML_RESOURCE ) ) != null ) { <END_BUG> break ; } case ENABLED : AspectJWeavingEnabler . enableAspectJWeaving ( loadTimeWeaver , this . beanClassLoader ) ; } return loadTimeWeaver ; } }

Fix:
if ( ( this . beanClassLoader . getResource ( ASPECTJ_AOP_XML_RESOURCE ) ) == null ) {
Buggy code:
public class FrgOpenOrder extends CommonFragment implements SwipeRefreshLayout . OnRefreshListener , OrderListListener { private RecyclerView recyclerView ; private OpenOrderAdapter adapter ; private ArrayList < Order > orderList ; private SwipeRefreshLayout swipeRefreshLayout ; private ProgressDialog pDialog ; @ Override public void onCreate ( @ Nullable Bundle savedInstanceState ) { } @ Nullable @ Override public View onCreateView ( final LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View rootView = inflater . inflate ( frg_open_order , container , false ) ; Log . d ( "wtf" , "frgOpen" ) ; showFab ( ) ; if ( orderList . isEmpty ( ) ) { new uzap . com . ua . twohourdelivery . task . TestTask ( getActivity ( ) , this , orderList ) . execute ( ) ; } recyclerView = ( ( RecyclerView ) ( rootView . findViewById ( rvOpenOrder ) ) ) ; LinearLayoutManager manager = new LinearLayoutManager ( getActivity ( ) ) ; recyclerView . setLayoutManager ( manager ) ; adapter = new OpenOrderAdapter ( getActivity ( ) , orderList ) ; recyclerView . setAdapter ( adapter ) ; recyclerView . addOnItemTouchListener ( new RecyclerItemClickListener ( getActivity ( ) , new RecyclerItemClickListener . OnItemClickListener ( ) { @ Override public void onItemClick ( View view , int position ) { UserProfile userProfile = AppContext . getWritableDatabase ( ) . getProfile ( ) ; if ( ( userProfile == null ) || ( ( userProfile . getPhone ( ) ) == null ) ) { DialogPhone myDialogFragment = new DialogPhone ( ) ; myDialogFragment . show ( fm , "dialog_phone" ) ; } else { Intent intent = new Intent ( getActivity ( ) , DetailOrderActivity . class ) ; <START_BUG> intent . putExtra ( "isCurrent" , false ) ; <END_BUG> startActivity ( intent ) ; } } } ) ) ; swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( rootView . findViewById ( swipeRefresh ) ) ) ; swipeRefreshLayout . setColorSchemeColors ( getResources ( ) . getIntArray ( swipeRefreshColors ) ) ; swipeRefreshLayout . setOnRefreshListener ( this ) ; ( ( MainActivity ) ( getActivity ( ) ) ) . clickFabButton ( this , orderList ) ; return rootView ; } @ Override public void onResume ( ) { } @ Override public String getTitle ( ) { } @ Override public void onRefresh ( ) { } @ Override public void orderListener ( ArrayList < Order > list ) { } }

Fix:
intent . putExtra ( ( "Заява<seq2seq4repair_space>№" + position ) , "order" ) ;
Buggy code:
public class FeedHandlerTest extends InstrumentationTestCase { private static final String FEEDS_DIR = "testfeeds" ; File file = null ; OutputStream outputStream = null ; protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } private Feed runFeedTest ( Feed feed , FeedGenerator g , String encoding , long flags ) throws UnsupportedFeedtypeException , IOException , ParserConfigurationException , SAXException { } private void feedValid ( Feed feed , Feed parsedFeed , String feedType ) { } public void testRSS2Basic ( ) throws UnsupportedFeedtypeException , IOException , ParserConfigurationException , SAXException { } public void testAtomBasic ( ) throws UnsupportedFeedtypeException , IOException , ParserConfigurationException , SAXException { } private Feed createTestFeed ( int numItems , boolean withImage , boolean withFeedMedia , boolean withChapters ) { FeedImage image = null ; if ( withImage ) { image = new FeedImage ( 0 , "image" , null , "http:////example.com//picture" , false ) ; } Feed feed = new Feed ( 0 , new Date ( ) , "title" , "http:////example.com" , "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>description" , "http:////example.com//payment" , "Daniel" , "en" , null , "http:////example.com//feed" , image , file . getAbsolutePath ( ) , "http:////example.com//feed" , true ) ; feed . setItems ( new ArrayList < FeedItem > ( ) ) ; for ( int i = 0 ; i < numItems ; i ++ ) { FeedItem item = new FeedItem ( 0 , ( "item-" + i ) , ( "http:////example.com//item-" + i ) , ( "http:////example.com//items//" + i ) , new Date ( ( i * 60000 ) ) , FeedItem . UNPLAYED , feed ) ; feed . getItems ( ) . add ( item ) ; if ( withFeedMedia ) { <START_BUG> item . setMedia ( new de . danoeh . antennapod . core . feed . FeedMedia ( 0 , item , 4711 , 0 , 100 , "audio//mp3" , null , ( "http:////example.com//media-" + i ) , false , null , 0 ) ) ; <END_BUG> } } return feed ; } }

Fix:
item . setMedia ( new de . danoeh . antennapod . core . feed . FeedMedia ( 0 , item , 4711 , 0 , ( 1024 * 1024 ) , "audio//mp3" , null , ( "http:////example.com//media-" + i ) , false , null , 0 ) ) ;
Buggy code:
public class RefereeSiteClientProxy extends Thread { private static int nProxy ; private final ServerComm sconi ; private final RefereeSiteSideInterface refSiteInterface ; public RefereeSiteClientProxy ( ServerComm sconi , RefereeSiteSideInterface refSiteInterface ) { } @ Override public void run ( ) { } private static int getProxyId ( ) { Class < RefereeSiteClientProxy > cl = null ; int proxyId ; try { <START_BUG> cl = ( ( Class < RefereeSiteClientProxy > ) ( Class . forName ( "pt.ua.sd.RopeGame.shared_mem.RefereeSiteSide.PlaygroundClientProxy" ) ) ) ; <END_BUG> } catch ( ClassNotFoundException e ) { System . out . println ( "The<seq2seq4repair_space>data<seq2seq4repair_space>type<seq2seq4repair_space>PlaygroundClientProxy<seq2seq4repair_space>wasn't<seq2seq4repair_space>found!" ) ; e . printStackTrace ( ) ; System . exit ( 1 ) ; } synchronized ( cl ) { proxyId = RefereeSiteClientProxy . nProxy ; RefereeSiteClientProxy . nProxy += 1 ; } return proxyId ; } }

Fix:
cl = ( ( Class < RefereeSiteClientProxy > ) ( Class . forName ( "pt.ua.sd.RopeGame.shared_mem.RefereeSiteSide.RefereeSiteClientProxy" ) ) ) ;
Buggy code:
public class SplashScreen extends Canvas { public SplashScreen ( ) { } public void dispose ( ) { } public synchronized void advance ( ) { } public void update ( Graphics g ) { } public synchronized void paint ( Graphics g ) { Dimension size = getSize ( ) ; if ( ( offscreenImg ) == null ) { offscreenImg = createImage ( size . width , size . height ) ; offscreenGfx = offscreenImg . getGraphics ( ) ; offscreenGfx . setFont ( getFont ( ) ) ; } offscreenGfx . setColor ( Color . gray ) ; offscreenGfx . drawRect ( 0 , 0 , ( ( size . width ) - 1 ) , ( ( size . height ) - 1 ) ) ; offscreenGfx . drawImage ( image , 1 , 1 , this ) ; offscreenGfx . setColor ( new Color ( 168 , 173 , 189 ) ) ; <START_BUG> offscreenGfx . fillRect ( 1 , ( ( image . getHeight ( this ) ) + 1 ) , ( ( ( ( win . getWidth ( ) ) - 2 ) * ( progress ) ) // 6 ) , SplashScreen . PROGRESS_HEIGHT ) ; <END_BUG> offscreenGfx . setColor ( Color . gray ) ; String str = "Version<seq2seq4repair_space>" + ( jEdit . getVersion ( ) ) ; offscreenGfx . drawString ( str , ( ( ( getWidth ( ) ) - ( fm . stringWidth ( str ) ) ) // 2 ) , ( ( ( ( image . getHeight ( this ) ) + 1 ) - ( fm . getDescent ( ) ) ) - 10 ) ) ; g . drawImage ( offscreenImg , 0 , 0 , this ) ; notify ( ) ; } private FontMetrics fm ; private Window win ; private Image image ; private Image offscreenImg ; private Graphics offscreenGfx ; private int progress ; private static final int PROGRESS_HEIGHT = 20 ; }

Fix:
offscreenGfx . fillRect ( 1 , ( ( image . getHeight ( this ) ) + 1 ) , ( ( ( ( win . getWidth ( ) ) - 2 ) * ( progress ) ) // 5 ) , SplashScreen . PROGRESS_HEIGHT ) ;
Buggy code:
@ Cacheable ( "default" ) public class AnnotatedClassCacheableService implements CacheableService < Object > { private final AtomicLong counter = new AtomicLong ( ) ; public static final AtomicLong nullInvocations = new AtomicLong ( ) ; public Object cache ( Object arg1 ) { } public Object conditional ( int field ) { } @ CacheEvict ( "default" ) public void invalidate ( Object arg1 ) { } @ CacheEvict ( "default" ) public void evictWithException ( Object arg1 ) { } @ CacheEvict ( value = "default" , allEntries = true ) public void evictAll ( Object arg1 ) { } @ CacheEvict ( value = "default" , afterInvocation = false ) public void evictEarly ( Object arg1 ) { } @ CacheEvict ( value = "default" , key = "#p0" ) public void evict ( Object arg1 , Object arg2 ) { } @ CacheEvict ( value = "default" , key = "#p0" , afterInvocation = false ) public void invalidateEarly ( Object arg1 , Object arg2 ) { } @ Cacheable ( value = "default" , key = "#p0" ) public Object key ( Object arg1 , Object arg2 ) { } @ Cacheable ( value = "default" , key = "#root.methodName<seq2seq4repair_space>+<seq2seq4repair_space>#root.caches[0].name" ) public Object name ( Object arg1 ) { } @ Cacheable ( value = "default" , key = "#root.methodName<seq2seq4repair_space>+<seq2seq4repair_space>#root.method.name<seq2seq4repair_space>+<seq2seq4repair_space>#root.targetClass<seq2seq4repair_space>+<seq2seq4repair_space>#root.target" ) public Object rootVars ( Object arg1 ) { } @ CachePut ( "default" ) public Object update ( Object arg1 ) { } @ CachePut ( value = "default" , condition = "#arg.equals(3)" ) public Object conditionalUpdate ( Object arg ) { } public Object nullValue ( Object arg1 ) { } public Number nullInvocations ( ) { } public Long throwChecked ( Object arg1 ) throws Exception { } public Long throwUnchecked ( Object arg1 ) { } @ Caching ( cacheable = { @ Cacheable ( "primary" ) , @ Cacheable ( "secondary" ) } ) public Object multiCache ( Object arg1 ) { } <START_BUG> @ Caching ( evict = { @ CacheEvict ( "primary" ) , @ CacheEvict ( value = "secondary" , key = "#p0" ) } ) <END_BUG> public Object multiEvict ( Object arg1 ) { return counter . getAndIncrement ( ) ; } @ Caching ( cacheable = { @ Cacheable ( value = "primary" , key = "#root.methodName" ) } , evict = { @ CacheEvict ( "secondary" ) } ) public Object multiCacheAndEvict ( Object arg1 ) { } @ Caching ( cacheable = { @ Cacheable ( value = "primary" , condition = "#p0<seq2seq4repair_space>==<seq2seq4repair_space>3" ) } , evict = { @ CacheEvict ( "secondary" ) } ) public Object multiConditionalCacheAndEvict ( Object arg1 ) { } @ Caching ( put = { @ CachePut ( "primary" ) , @ CachePut ( "secondary" ) } ) public Object multiUpdate ( Object arg1 ) { } }

Fix:
@ Caching ( evict = { @ CacheEvict ( "primary" ) , @ CacheEvict ( value = "secondary" , key = "#p0" ) , @ CacheEvict ( value = "primary" , key = "#p0<seq2seq4repair_space>+<seq2seq4repair_space>'A'" ) } )
Buggy code:
public final class EditBook extends AuthenticatedWebPage { static final Book otherBook = new Book ( "Frisbee<seq2seq4repair_space>Techniques" , "Marty<seq2seq4repair_space>van<seq2seq4repair_space>Hoff" , Book . FICTION ) ; public EditBook ( final Book book ) { } public static PageLink link ( final String name , final long id ) { } public static final class EditBookForm extends Form { public EditBookForm ( final String componentName , final Book book , final FeedbackPanel feedback ) { } public final void onSubmit ( ) { final RequestCycle cycle = getRequestCycle ( ) ; PageParameters parameters = new PageParameters ( ) ; <START_BUG> final Book book = ( ( Book ) ( getModel ( ) . getObject ( ) ) ) ; <END_BUG> parameters . put ( "id" , new Long ( book . getId ( ) ) ) ; cycle . setPage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ; cycle . setRedirect ( true ) ; } } }

Fix:
final Book book = ( ( Book ) ( getModelObject ( ) ) ) ;
Buggy code:
public class EntityBeanRemoteViewInstanceFactory implements ViewInstanceFactory { private final String applicationName ; private final String moduleName ; private final String distinctName ; private final String beanName ; public EntityBeanRemoteViewInstanceFactory ( final String applicationName , final String moduleName , final String distinctName , final String beanName ) { } public ManagedReference createViewInstance ( final ComponentView componentView , final Map < Object , Object > contextData ) throws Exception { } private Object invokeCreate ( final Component component , final Map < Object , Object > contextData ) throws Exception { final Method ejbCreate = ( ( Method ) ( contextData . get ( EJB_CREATE_METHOD_KEY ) ) ) ; if ( ejbCreate == null ) { throw EjbMessages . MESSAGES . entityCannotBeCreatedDueToMissingCreateMethod ( this . beanName ) ; } final Method ejbPostCreate = ( ( Method ) ( contextData . get ( EJB_POST_CREATE_METHOD_KEY ) ) ) ; final Object [ ] params = ( ( Object [ ] ) ( contextData . get ( PARAMETERS_KEY ) ) ) ; if ( ! ( component instanceof EntityBeanComponent ) ) { throw EjbMessages . MESSAGES . notAnEntityBean ( component ) ; } final EntityBeanComponent entityBeanComponent = ( ( EntityBeanComponent ) ( component ) ) ; final EntityBeanComponentInstance instance = entityBeanComponent . acquireUnAssociatedInstance ( ) ; final Object primaryKey ; primaryKey = invokeEjbCreate ( contextData , ejbCreate , instance , params ) ; <START_BUG> instance . associate ( primaryKey ) ; <END_BUG> entityBeanComponent . getCache ( ) . create ( instance ) ; boolean synchronizationRegistered = false ; boolean exception = false ; try { invokeEjbPostCreate ( contextData , ejbPostCreate , instance , params ) ; final TransactionSynchronizationRegistry transactionSynchronizationRegistry = entityBeanComponent . getTransactionSynchronizationRegistry ( ) ; if ( ( transactionSynchronizationRegistry . getTransactionKey ( ) ) != null ) { transactionSynchronizationRegistry . registerInterposedSynchronization ( new Synchronization ( ) { @ Override public void beforeCompletion ( ) { } @ Override public void afterCompletion ( final int status ) { entityBeanComponent . getCache ( ) . release ( instance , ( status == ( Status . STATUS_COMMITTED ) ) ) ; } } ) ; synchronizationRegistered = true ; } } catch ( Exception e ) { entityBeanComponent . getCache ( ) . release ( instance , false ) ; exception = true ; throw e ; } finally { if ( ( ! synchronizationRegistered ) && ( ! exception ) ) { entityBeanComponent . getCache ( ) . release ( instance , true ) ; } } return primaryKey ; } protected void invokeEjbPostCreate ( final Map < Object , Object > contextData , final Method ejbPostCreate , final EntityBeanComponentInstance instance , final Object [ ] params ) throws Exception { } protected Object invokeEjbCreate ( final Map < Object , Object > contextData , final Method ejbCreate , final EntityBeanComponentInstance instance , final Object [ ] params ) throws Exception { } }

Fix:
instance . activate ( primaryKey ) ;