nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ClientGUI implements IPlayerObserver , ICardObserver { private JFrame mainFrame ; private final String frameTitle ; private Player player ; private String playerName ; private JTextArea logTextPane ; private JPanel cardsPanel ; private JLabel hintLabel ; private JButton btnNewRound ; private JButton btnRequestWhiteCard ; private ArrayList < WhiteCard > whiteCards ; public static void main ( String [ ] args ) { } public ClientGUI ( ) { } private void initPlayer ( ) { } private void createPlayer ( ) { } private void initialize ( ) { } private String getServerAddr ( ) { <START_BUG> String host = Dialogs . getInput ( mainFrame , "Enter<seq2seq4repair_space>Server" , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>server-PC<seq2seq4repair_space>name<seq2seq4repair_space>or<seq2seq4repair_space>IP" , "cah-server" ) ; <END_BUG> return host ; } private Player connect ( ) { } private void changeName ( ) { } private void log ( String s ) { } private String getHintLabelText ( ) { } private void updateHintLabel ( ) { } private void removeCards ( ) { } private String getPlayerName ( ) { } @ Override public void notifyNewCard ( int cardIndex ) { } @ Override public void notifyNewRound ( ) { } @ Override public void notifyRoundOver ( ) { } @ Override public void notifyPlayerError ( String error ) { } @ Override public void notifyCardPosted ( int cardIndex ) { } @ Override public void post ( int cardIndex ) { } @ Override public void notifyLog ( String msg ) { } @ Override public void notifyLeftGame ( ) { } }

Fix:
String host = Dialogs . getInput ( mainFrame , "Enter<seq2seq4repair_space>Server" , "Please<seq2seq4repair_space>enter<seq2seq4repair_space>server-PC<seq2seq4repair_space>name<seq2seq4repair_space>or<seq2seq4repair_space>IP" , "User-PC" ) ;
Buggy code:
public class DeleteElementsOperation extends MultiOperation { protected Map fChildrenToRemove ; protected DOMFactory fFactory ; public DeleteElementsOperation ( IJavaElement [ ] elementsToDelete , boolean force ) { } protected String getMainTaskName ( ) { } protected void groupElements ( ) throws JavaModelException { } protected void processElement ( IJavaElement element ) throws JavaModelException { ICompilationUnit cu = ( ( ICompilationUnit ) ( element ) ) ; int numberOfImports = cu . getImports ( ) . length ; IBuffer buffer = cu . getBuffer ( ) ; if ( buffer == null ) return ; JavaElementDelta delta = new JavaElementDelta ( cu ) ; IJavaElement [ ] cuElements = ( ( IRegion ) ( fChildrenToRemove . get ( cu ) ) ) . getElements ( ) ; for ( int i = 0 , length = cuElements . length ; i < length ; i ++ ) { IJavaElement e = cuElements [ i ] ; if ( e . exists ( ) ) { char [ ] contents = buffer . getCharacters ( ) ; if ( contents == null ) continue ; IDOMCompilationUnit cuDOM = fFactory . createCompilationUnit ( contents , cu . getElementName ( ) ) ; DOMNode node = ( ( DOMNode ) ( ( ( JavaElement ) ( e ) ) . findNode ( cuDOM ) ) ) ; <START_BUG> Assert . isTrue ( ( node != null ) , Util . bind ( "element.cannotLocate" , e . getElementName ( ) , cuDOM . getName ( ) ) ) ; <END_BUG> int startPosition = node . getStartPosition ( ) ; buffer . replace ( startPosition , ( ( ( node . getEndPosition ( ) ) - startPosition ) + 1 ) , CharOperation . NO_CHAR ) ; delta . removed ( e ) ; if ( ( e . getElementType ( ) ) == ( IJavaElement . IMPORT_DECLARATION ) ) { numberOfImports -- ; if ( numberOfImports == 0 ) { delta . removed ( cu . getImportContainer ( ) ) ; } } } } if ( ( delta . getAffectedChildren ( ) . length ) > 0 ) { cu . save ( getSubProgressMonitor ( 1 ) , fForce ) ; if ( ! ( cu . isWorkingCopy ( ) ) ) { addDelta ( delta ) ; this . setAttribute ( JavaModelOperation . HAS_MODIFIED_RESOURCE_ATTR , JavaModelOperation . TRUE ) ; } } } protected void processElements ( ) throws JavaModelException { } protected void verify ( IJavaElement element ) throws JavaModelException { } }

Fix:
Assert . isTrue ( ( node != null ) , ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>" + ( e . getElementName ( ) ) ) + "<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( cuDOM . getName ( ) ) ) ) ;
Buggy code:
public class Example extends jQueryFactory { public static void main ( String [ ] args ) throws TimeoutException { System . setProperty ( "org.apache.commons.logging.Log" , "org.apache.commons.logging.impl.SimpleLog" ) ; System . setProperty ( "org.apache.commons.logging.simplelog.log.com.gargoylesoftware.htmlunit" , "fatal" ) ; HtmlUnitDriver drv = new HtmlUnitDriver ( BrowserVersion . FIREFOX_3_6 ) ; drv . setJavascriptEnabled ( true ) ; try { Example jq = new Example ( ) ; jq . setJs ( drv ) ; drv . get ( "http:////google.com" ) ; jq . query ( "[name=q]" ) . val ( "SeleniumJQuery" ) . parents ( "form:first" ) . submit ( ) ; String results = jq . queryUntil ( "#resultStats:contains(results)" ) . text ( ) ; System . out . println ( ( ( results . split ( "<seq2seq4repair_space>" ) [ 1 ] ) + "<seq2seq4repair_space>results<seq2seq4repair_space>found!" ) ) ; } finally { <START_BUG> drv . close ( ) ; <END_BUG> } } }

Fix:
drv . quit ( ) ;
Buggy code:
public class MarkersMenu extends EnhancedMenu implements MenuListener { public MarkersMenu ( ) { } public void menuSelected ( MenuEvent evt ) { final View view = GUIUtilities . getView ( this ) ; if ( ( getMenuComponentCount ( ) ) != 0 ) { for ( int i = ( getMenuComponentCount ( ) ) - 1 ; i >= 0 ; i -- ) { Component comp = getMenuComponent ( i ) ; if ( comp instanceof JSeparator ) break ; else remove ( comp ) ; } } Buffer buffer = view . getBuffer ( ) ; Vector markers = buffer . getMarkers ( ) ; if ( ( markers . size ( ) ) == 0 ) { JMenuItem mi = new JMenuItem ( jEdit . getProperty ( "no-markers.label" ) ) ; mi . setEnabled ( false ) ; add ( mi ) ; return ; } int maxItems = jEdit . getIntegerProperty ( "menu.spillover" , 20 ) ; JMenu current = this ; for ( int i = 0 ; i < ( markers . size ( ) ) ; i ++ ) { final Marker marker = ( ( Marker ) ( markers . elementAt ( i ) ) ) ; <START_BUG> int lineNo = buffer . getLineOfOffset ( marker . getPosition ( ) ) ; <END_BUG> if ( ( ( current . getItemCount ( ) ) >= maxItems ) && ( i != ( ( markers . size ( ) ) - 1 ) ) ) { JMenu newCurrent = new JMenu ( jEdit . getProperty ( "common.more" ) ) ; current . add ( newCurrent ) ; current = newCurrent ; } JMenuItem mi = new MarkersMenu . MarkersMenuItem ( buffer , lineNo , marker . getShortcut ( ) ) ; mi . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent evt ) { view . getTextArea ( ) . setCaretPosition ( marker . getPosition ( ) ) ; } } ) ; current . add ( mi ) ; } } public void menuDeselected ( MenuEvent e ) { } public void menuCanceled ( MenuEvent e ) { } static class MarkersMenuItem extends JMenuItem { MarkersMenuItem ( Buffer buffer , int lineNo , char shortcut ) { } public Dimension getPreferredSize ( ) { } public void paint ( Graphics g ) { } private String shortcutProp ; private char shortcut ; private static Font acceleratorFont ; private static Color acceleratorForeground ; private static Color acceleratorSelectionForeground ; private String getShortcut ( ) { } } }

Fix:
int lineNo = ( buffer . getLineOfOffset ( marker . getPosition ( ) ) ) + 1 ;
Buggy code:
public class JaxrsCdiIntegrationProcessor implements DeploymentUnitProcessor { public static final String CDI_INJECTOR_FACTORY_CLASS = "org.jboss.resteasy.cdi.CdiInjectorFactory" ; @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final Module module = deploymentUnit . getAttachment ( MODULE ) ; if ( ! ( JaxrsDeploymentMarker . isJaxrsDeployment ( deploymentUnit ) ) ) { return ; } if ( ! ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) ) { return ; } final DeploymentUnit parent = ( ( deploymentUnit . getParent ( ) ) == null ) ? deploymentUnit : deploymentUnit . getParent ( ) ; final WarMetaData warMetaData = deploymentUnit . getAttachment ( ATTACHMENT_KEY ) ; final JBossWebMetaData webdata = warMetaData . getMergedJBossWebMetaData ( ) ; try { module . getClassLoader ( ) . loadClass ( JaxrsCdiIntegrationProcessor . CDI_INJECTOR_FACTORY_CLASS ) ; <START_BUG> if ( WeldDeploymentMarker . isPartOfWeldDeployment ( deploymentUnit ) ) { <END_BUG> JaxrsLogger . JAXRS_LOGGER . debug ( "Found<seq2seq4repair_space>CDI,<seq2seq4repair_space>adding<seq2seq4repair_space>injector<seq2seq4repair_space>factory<seq2seq4repair_space>class" ) ; JaxrsCdiIntegrationProcessor . setContextParameter ( webdata , "resteasy.injector.factory" , JaxrsCdiIntegrationProcessor . CDI_INJECTOR_FACTORY_CLASS ) ; } } catch ( ClassNotFoundException ignored ) { } } public static void setContextParameter ( JBossWebMetaData webdata , String name , String value ) { } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
if ( WeldDeploymentMarker . isWeldDeployment ( deploymentUnit ) ) {
Buggy code:
public class CountryCityParser { public static CountryCity parse ( String countryCityString ) { CountryCity countryCity = new CountryCity ( ) ; String [ ] temp = countryCityString . split ( ":" ) ; if ( ( temp . length ) == 2 ) { String country = temp [ 0 ] . trim ( ) ; String city = temp [ 1 ] . trim ( ) ; <START_BUG> if ( ( ! ( CountryCityParser . isValidCountryOrCity ( country ) ) ) || ( CountryCityParser . isValidCountryOrCity ( city ) ) ) { <END_BUG> throw new RuntimeException ( "Invalid<seq2seq4repair_space>Country<seq2seq4repair_space>or<seq2seq4repair_space>City" ) ; } countryCity . setCountry ( country ) ; countryCity . setCity ( city ) ; } else { throw new RuntimeException ( "Invalid<seq2seq4repair_space>Country<seq2seq4repair_space>city<seq2seq4repair_space>String" ) ; } return countryCity ; } public static boolean isValidCountryOrCity ( String input ) { } }

Fix:
if ( ( ! ( CountryCityParser . isValidCountryOrCity ( country ) ) ) || ( ! ( CountryCityParser . isValidCountryOrCity ( city ) ) ) ) {
Buggy code:
public class AttributeGroup extends org . tigris . scarab . om . BaseAttributeGroup implements Persistent { private static final String GET_ATTRIBUTES = "getAttributes" ; private static final String GET_HIGHEST_ORDERED_ATTRIBUTE = "getHighestOrderedAttribute" ; private static final String GET_R_ATTRIBUTE_ATTRGROUP = "getRAttributeAttributeGroup" ; private static final String GET_ATTRIBUTE_GROUPS = "getAttributeGroups" ; public ScarabModule getScarabModule ( ) { } public void setScarabModule ( ScarabModule module ) { } public void setModule ( Module me ) throws TorqueException { } public Module getModule ( ) throws TorqueException { } public List getAttributes ( ) throws Exception { } public int getHighestOrderedAttribute ( ) throws Exception { } public RAttributeAttributeGroup getRAttributeAttributeGroup ( Attribute attribute ) throws Exception { } public RAttributeAttributeGroup addRAttributeAttributeGroup ( Attribute attribute ) throws Exception { } public void delete ( ScarabUser user ) throws Exception { Module module = getModule ( ) ; if ( user . hasPermission ( MODULE__EDIT , module ) ) { Criteria c = new Criteria ( ) . addJoin ( ATTRIBUTE_ID , RAttributeAttributeGroupPeer . ATTRIBUTE_ID ) . add ( GROUP_ID , getAttributeGroupId ( ) ) . add ( MODULE_ID , getModuleId ( ) ) . add ( ISSUE_TYPE_ID , getIssueTypeId ( ) ) ; List results = RModuleAttributePeer . doSelect ( c ) ; for ( int i = 0 ; i < ( results . size ( ) ) ; i ++ ) { RModuleAttribute rma = ( ( RModuleAttribute ) ( results . get ( i ) ) ) ; rma . delete ( user ) ; } c = new Criteria ( ) . add ( GROUP_ID , getAttributeGroupId ( ) ) ; RAttributeAttributeGroupPeer . doDelete ( c ) ; c = new Criteria ( ) . add ( ATTRIBUTE_GROUP_ID , getAttributeGroupId ( ) ) ; AttributeGroupPeer . doDelete ( c ) ; List attrGroups = module . getAttributeGroups ( getIssueType ( ) ) ; attrGroups . remove ( this ) ; <START_BUG> ScarabCache . put ( attrGroups , module , AttributeGroup . GET_ATTRIBUTE_GROUPS , getIssueType ( ) , new Boolean ( false ) ) ; <END_BUG> } else { throw new org . tigris . scarab . util . ScarabException ( ScarabConstants . NO_PERMISSION_MESSAGE ) ; } } public void addAttribute ( Attribute attribute ) throws Exception { } }

Fix:
ScarabCache . put ( attrGroups , module , AttributeGroup . GET_ATTRIBUTE_GROUPS , getIssueType ( ) , Boolean . FALSE ) ;
Buggy code:
public class KeyToSignature extends BindingKeyParser { public static final int SIGNATURE = 0 ; public static final int TYPE_ARGUMENTS = 1 ; public static final int DECLARING_TYPE = 2 ; public static final int THROWN_EXCEPTIONS = 3 ; public StringBuffer signature = new StringBuffer ( ) ; private int kind ; private ArrayList arguments = new ArrayList ( ) ; private ArrayList typeArguments = new ArrayList ( ) ; private ArrayList typeParameters = new ArrayList ( ) ; private ArrayList thrownExceptions = new ArrayList ( ) ; private int mainTypeStart = - 1 ; private int mainTypeEnd ; private int typeSigStart = - 1 ; public KeyToSignature ( BindingKeyParser parser ) { } public KeyToSignature ( String key , int kind ) { } public void consumeArrayDimension ( char [ ] brakets ) { } public void consumeBaseType ( char [ ] baseTypeSig ) { } public void consumeCapture ( int position ) { } public void consumeLocalType ( char [ ] uniqueKey ) { } public void consumeMethod ( char [ ] selector , char [ ] methodSignature ) { } public void consumeMemberType ( char [ ] simpleTypeName ) { } public void consumePackage ( char [ ] pkgName ) { } public void consumeParameterizedGenericMethod ( ) { } private void substitute ( char [ ] parameter , char [ ] [ ] typeParameterSigs , int typeParametersLength ) { } public void consumeParameterizedType ( char [ ] simpleTypeName , boolean isRaw ) { } public void consumeParser ( BindingKeyParser parser ) { } public void consumeField ( char [ ] fieldName ) { } public void consumeException ( ) { } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { } public void consumeSecondaryType ( char [ ] simpleTypeName ) { } public void consumeType ( ) { if ( ( this . mainTypeStart ) != ( - 1 ) ) { this . signature . replace ( this . mainTypeStart , this . mainTypeEnd , "" ) ; } int length = this . typeParameters . size ( ) ; if ( length > 0 ) { StringBuffer typeParametersSig = new StringBuffer ( ) ; typeParametersSig . append ( '<' ) ; for ( int i = 0 ; i < length ; i ++ ) { char [ ] typeParameterSig = Signature . createTypeParameterSignature ( ( ( char [ ] ) ( this . typeParameters . get ( i ) ) ) , new char [ ] [ ] { ConstantPool . ObjectSignature } ) ; typeParametersSig . append ( typeParameterSig ) ; } typeParametersSig . append ( '>' ) ; <START_BUG> this . signature . insert ( this . typeSigStart , typeParametersSig ) ; <END_BUG> this . typeParameters = new ArrayList ( ) ; } this . signature . append ( ';' ) ; } public void consumeTypeParameter ( char [ ] typeParameterName ) { } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { } public void consumeTypeWithCapture ( ) { } public void consumeWildCard ( int wildCardKind ) { } public String [ ] getThrownExceptions ( ) { } public String [ ] getTypeArguments ( ) { } public BindingKeyParser newParser ( ) { } public String toString ( ) { } }

Fix:
this . signature . insert ( this . typeSigStart , typeParametersSig . toString ( ) ) ;
Buggy code:
public class ConnectionListener implements Runnable { ServerSocket providerSocket ; Socket connection = null ; String message ; int port ; boolean run = true ; public ConnectionListener ( int port ) { } public void stop ( ) { } public void run ( ) { try { providerSocket = new ServerSocket ( port , 10 ) ; while ( run ) { ChatController . getInstance ( ) . receiveDebugMessage ( "Waiting<seq2seq4repair_space>for<seq2seq4repair_space>connection" ) ; connection = providerSocket . accept ( ) ; ChatController . getInstance ( ) . receiveDebugMessage ( ( ( ( "Connection<seq2seq4repair_space>received<seq2seq4repair_space>from<seq2seq4repair_space>" + ( connection . getInetAddress ( ) . getHostName ( ) ) ) + ":" ) + ( connection . getPort ( ) ) ) , MESSAGE_CODE_CONNECTION_ACK ) ; Connection connWrapper = new Connection ( connection ) ; <START_BUG> ClientInterface . getInstance ( ) . addConnection ( connWrapper ) ; <END_BUG> } } catch ( IOException ioException ) { ioException . printStackTrace ( ) ; } finally { try { providerSocket . close ( ) ; } catch ( IOException ioException ) { ioException . printStackTrace ( ) ; } } } }

Fix:
ClientInterface . getInstance ( ) . acceptConnection ( connWrapper ) ;
Buggy code:
public class ResolvedSourceField extends SourceField { private String uniqueKey ; public ResolvedSourceField ( JavaElement parent , String name , String uniqueKey ) { } public String getKey ( ) { } public boolean isResolved ( ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info , boolean showResolvedInfo ) { super . toStringInfo ( tab , buffer , info , showResolvedInfo ) ; if ( showResolvedInfo ) { buffer . append ( "<seq2seq4repair_space>{key=" ) ; <START_BUG> buffer . append ( this . uniqueKey ) ; <END_BUG> buffer . append ( "}" ) ; } } public JavaElement unresolved ( ) { } }

Fix:
buffer . append ( this . getKey ( ) ) ;
Buggy code:
public class DefaultClassResolver implements IClassResolver { public Class resolveClass ( String classname ) { try { return DefaultClassResolver . class . getClassLoader ( ) . loadClass ( classname ) ; } catch ( ClassNotFoundException ex ) { <START_BUG> throw new RenderException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>name:<seq2seq4repair_space>" + classname ) ) ; <END_BUG> } } }

Fix:
throw new WicketRuntimeException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>class<seq2seq4repair_space>with<seq2seq4repair_space>name:<seq2seq4repair_space>" + classname ) ) ;
Buggy code:
public class DealerConfig { private static File dealerConfig ; private static FileConfiguration config ; public DealerConfig ( ) throws Exception { } public void set ( NPCDealer dealer ) { } public Button getButton ( ConfigurationSection cs , int slot ) { } public List < NPCDealer > loadDealers ( ) { List < NPCDealer > dealers = Lists . newArrayList ( ) ; for ( String s : DealerConfig . config . getConfigurationSection ( "Villagers" ) . getKeys ( false ) ) { if ( s . equalsIgnoreCase ( "-1" ) ) { continue ; } String name = ChatColor . translateAlternateColorCodes ( '&' , DealerConfig . config . getString ( ( ( "Villagers." + s ) + ".name" ) ) ) ; int invSize = DealerConfig . config . getInt ( ( ( "Villagers." + s ) + ".invSize" ) ) ; String invName = DealerConfig . config . getString ( ( ( "Villagers." + s ) + ".invName" ) ) ; Location l = LocationUtil . parseString ( DealerConfig . config . getString ( ( ( "Villagers." + s ) + ".location" ) ) ) ; ConfigurationSection css = DealerConfig . config . getConfigurationSection ( ( ( "Villagers." + s ) + ".items" ) ) ; Button [ ] butts = new Button [ invSize ] ; for ( String s2 : css . getKeys ( false ) ) { ConfigurationSection csss = css . getConfigurationSection ( s2 ) ; Button b = getButton ( csss , Integer . parseInt ( s2 ) ) ; butts [ Integer . parseInt ( s2 ) ] = b ; } MainMenu mm = new MainMenu ( invName , invSize ) ; mm . setButtons ( butts ) ; mm . set ( true ) ; NPCDealer dealer = ( ( NPCDealer ) ( NPCDEALER . spawn ( l ) ) ) ; dealer . setCustomName ( name ) ; <START_BUG> dealer . setGUI ( mm ) ; <END_BUG> dealers . add ( dealer ) ; } return dealers ; } }

Fix:
dealer . setGUI ( mm , true ) ;
Buggy code:
public class EllipseFigure extends AttributeFigure { private Rectangle fDisplayBox ; private static final long serialVersionUID = - 6856203289355118951L ; private int ellipseFigureSerializedDataVersion = 1 ; public EllipseFigure ( ) { } public EllipseFigure ( Point origin , Point corner ) { } public HandleEnumeration handles ( ) { } public void basicDisplayBox ( Point origin , Point corner ) { } public Rectangle displayBox ( ) { } protected void basicMoveBy ( int x , int y ) { } public void drawBackground ( Graphics g ) { Rectangle r = displayBox ( ) ; <START_BUG> g . fillOval ( r . x , r . y , r . width , r . height ) ; <END_BUG> } public void drawFrame ( Graphics g ) { } public Insets connectionInsets ( ) { } public Connector connectorAt ( int x , int y ) { } public void write ( StorableOutput dw ) { } public void read ( StorableInput dr ) throws IOException { } }

Fix:
g . fillOval ( r . x , r . y , ( ( r . width ) - 1 ) , ( ( r . height ) - 1 ) ) ;
Buggy code:
public class PlayerParty { protected PlayerActor char1 ; protected PlayerActor char2 ; protected PlayerActor char3 ; protected int currency ; List < PlayerActor > party = new ArrayList < > ( ) ; List < Item > inventory ; public PlayerParty ( PlayerActor char1 , PlayerActor char2 , PlayerActor char3 , int currency ) { } public void setParty ( ) { } public List < PlayerActor > getParty ( ) { } public int highestLevel ( ) { } public PlayerActor getPlayer ( int index ) { } public int getPartySize ( ) { } public int getCurrency ( ) { } public void addCurrency ( int i ) { } public void subCurrency ( int i ) { } public List < Item > getInventory ( ) { } public void addItem ( Item i ) { } public boolean removeItem ( Item i ) { } public Item getItem ( String s ) { } public boolean isEveryPlayerDead ( ) { } public boolean canPartyStillAttack ( ) { for ( PlayerActor p : party ) { <START_BUG> if ( ! ( p . playerHasAttacked ( ) ) ) { <END_BUG> return true ; } } return false ; } }

Fix:
if ( ( ! ( p . playerHasAttacked ( ) ) ) && ( ! ( p . is_dead ( ) ) ) ) {
Buggy code:
public class AddEnchantmentRecipes implements IRecipe { private ItemStack output = null ; @ SuppressWarnings ( "unchecked" ) @ Override public boolean matches ( InventoryCrafting inv , World world ) { int toolflag = 0 ; ItemStack tool = null ; int bookflag = 0 ; ItemStack book = null ; boolean flag = false ; Enchantment ench1 ; Enchantment ench2 ; ItemStack craftitem ; for ( int i = 0 ; i < ( inv . getSizeInventory ( ) ) ; i ++ ) { craftitem = inv . getStackInSlot ( i ) ; if ( craftitem != null ) { if ( ( craftitem . getItem ( ) . getItemEnchantability ( ) ) > 0 ) { toolflag ++ ; tool = craftitem . copy ( ) ; } else if ( ( craftitem . getItem ( ) ) instanceof ItemEnchantedBook ) { bookflag ++ ; book = craftitem . copy ( ) ; } else { return false ; } } } if ( ( ( ( toolflag > 0 ) && ( toolflag < 2 ) ) && ( bookflag > 0 ) ) && ( bookflag < 2 ) ) { Map < Integer , Integer > toolenchlist = EnchantmentHelper . getEnchantments ( tool ) ; Map < Integer , Integer > bookenchlist = EnchantmentHelper . getEnchantments ( book ) ; for ( int EnchInt1 : bookenchlist . keySet ( ) ) { <START_BUG> ench1 = Enchantment . enchantmentsList [ EnchInt1 ] ; <END_BUG> int var3 = ( toolenchlist . containsKey ( EnchInt1 ) ) ? toolenchlist . get ( EnchInt1 ) : 0 ; int var4 = bookenchlist . get ( EnchInt1 ) ; int Max ; if ( var3 == var4 ) { Max = var4 ; } else { Max = Math . max ( var4 , var3 ) ; } var4 = Max ; flag = ench1 . canApplyAtEnchantingTable ( tool ) ; for ( int EnchInt2 : toolenchlist . keySet ( ) ) { ench2 = Enchantment . func_180306_c ( EnchInt2 ) ; flag = ench1 . canApplyTogether ( ench2 ) ; } toolenchlist . put ( EnchInt1 , var4 ) ; } this . output = tool ; int var5 = ( ( ( this . output . getItemDamage ( ) ) - ( ( this . output . getMaxDamage ( ) ) // 20 ) ) < 1 ) ? 1 : ( this . output . getItemDamage ( ) ) - ( ( this . output . getMaxDamage ( ) ) // 20 ) ; this . output . setItemDamage ( var5 ) ; EnchantmentHelper . setEnchantments ( toolenchlist , this . output ) ; return flag ; } else return false ; } @ Override public ItemStack getCraftingResult ( InventoryCrafting inventorycrafting ) { } @ Override public int getRecipeSize ( ) { } @ Override public ItemStack getRecipeOutput ( ) { } @ Override public ItemStack [ ] func_179532_b ( InventoryCrafting p_179532_1_ ) { } }

Fix:
ench1 = Enchantment . func_180306_c ( EnchInt1 ) ;
Buggy code:
public class UpdateCoverArtTask extends AsyncTask < Void , Integer , Void > { private Context context ; public UpdateCoverArtTask ( Context context ) { } @ Override protected Void doInBackground ( Void ... params ) { Cursor artistsCursor = ArtistsStore . getInstance ( ) . getArtists ( ) ; if ( artistsCursor . moveToFirst ( ) ) { int current = 0 ; int total = artistsCursor . getCount ( ) ; do { publishProgress ( ( current ++ ) , total ) ; long artistId = artistsCursor . getLong ( 0 ) ; String [ ] projection = new String [ ] { Albums . ALBUM_ART } ; int i = 0 ; Cursor albumsCursor = context . getContentResolver ( ) . query ( EXTERNAL_CONTENT_URI , projection , ( ( Media . ARTIST_ID ) + "=?" ) , new String [ ] { String . valueOf ( artistId ) } , ( ( Albums . ALBUM_KEY ) + "<seq2seq4repair_space>DESC" ) ) ; if ( albumsCursor . moveToFirst ( ) ) { String [ ] albumArt = new String [ 4 ] ; do { if ( ( albumsCursor . getString ( 0 ) ) != null ) albumArt [ ( i ++ ) ] = albumsCursor . getString ( 0 ) ; } while ( ( albumsCursor . moveToNext ( ) ) && ( i < 4 ) ) ; <START_BUG> ArtistsStore . getInstance ( ) . updateArtist ( artistId , albumArt ) ; <END_BUG> } else { ArtistsStore . getInstance ( ) . removeArtist ( artistsCursor . getString ( 1 ) ) ; } albumsCursor . close ( ) ; } while ( artistsCursor . moveToNext ( ) ) ; } artistsCursor . close ( ) ; return null ; } }

Fix:
ArtistsStore . getInstance ( ) . updateArtistAlbumArt ( artistId , albumArt ) ;
Buggy code:
public class MethodDeclaration extends AbstractMethodDeclaration { public TypeReference returnType ; public TypeParameter [ ] typeParameters ; public MethodDeclaration ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext initializationContext , FlowInfo flowInfo ) { } public boolean isMethod ( ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer printReturnType ( int indent , StringBuffer output ) { } public void resolveStatements ( ) { if ( ( ( this . returnType ) != null ) && ( ( this . binding ) != null ) ) { this . returnType . resolvedType = this . binding . returnType ; } if ( CharOperation . equals ( this . scope . enclosingSourceType ( ) . sourceName , selector ) ) { this . scope . problemReporter ( ) . methodWithConstructorName ( this ) ; } if ( ( this . typeParameters ) != null ) { for ( int i = 0 , length = this . typeParameters . length ; i < length ; i ++ ) { this . typeParameters [ i ] . resolve ( this . scope ) ; } } checkOverride : { if ( ( this . binding ) == null ) break checkOverride ; if ( ( this . scope . compilerOptions ( ) . sourceLevel ) < ( ClassFileConstants . JDK1_5 ) ) break checkOverride ; int bindingModifiers = this . binding . modifiers ; boolean hasOverrideAnnotation = ( ( this . binding . tagBits ) & ( TagBits . AnnotationOverride ) ) != 0 ; boolean isInterfaceMethod = this . binding . declaringClass . isInterface ( ) ; if ( hasOverrideAnnotation ) { <START_BUG> if ( ( ( bindingModifiers & ( ExtraCompilerModifiers . AccOverriding ) ) == 0 ) || isInterfaceMethod ) <END_BUG> this . scope . problemReporter ( ) . methodMustOverride ( this ) ; } else if ( ( ! isInterfaceMethod ) && ( ( bindingModifiers & ( ( ClassFileConstants . AccStatic ) | ( ExtraCompilerModifiers . AccOverriding ) ) ) == ( ExtraCompilerModifiers . AccOverriding ) ) ) { this . scope . problemReporter ( ) . missingOverrideAnnotation ( this ) ; } } switch ( TypeDeclaration . kind ( this . scope . referenceType ( ) . modifiers ) ) { case TypeDeclaration . ENUM_DECL : if ( ( this . selector ) == ( TypeConstants . VALUES ) ) break ; if ( ( this . selector ) == ( TypeConstants . VALUEOF ) ) break ; case TypeDeclaration . CLASS_DECL : if ( ( ( this . modifiers ) & ( ExtraCompilerModifiers . AccSemicolonBody ) ) != 0 ) { if ( ( ( this . modifiers ) & ( ClassFileConstants . AccNative ) ) == 0 ) if ( ( ( this . modifiers ) & ( ClassFileConstants . AccAbstract ) ) == 0 ) this . scope . problemReporter ( ) . methodNeedBody ( this ) ; } else { if ( ( ( ( this . modifiers ) & ( ClassFileConstants . AccNative ) ) != 0 ) || ( ( ( this . modifiers ) & ( ClassFileConstants . AccAbstract ) ) != 0 ) ) this . scope . problemReporter ( ) . methodNeedingNoBody ( this ) ; } } super . resolveStatements ( ) ; } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { } public TypeParameter [ ] typeParameters ( ) { } }

Fix:
if ( ( ( ( bindingModifiers & ( ExtraCompilerModifiers . AccOverriding ) ) == 0 ) || isInterfaceMethod ) || ( this . binding . isStatic ( ) ) )
Buggy code:
public class SOContext implements ISharedObjectContext { static Trace debug = Trace . create ( "sharedobjectcontext" ) ; protected SOContainer container = null ; protected ID sharedObjectID ; protected ID homeContainerID ; protected boolean isActive ; protected Map properties ; protected IQueueEnqueue queue ; public SOContext ( ID objID , ID homeID , SOContainer cont , Map props , IQueueEnqueue queue ) { } protected void trace ( String msg ) { } protected void traceDump ( String msg , Throwable e ) { } protected synchronized void makeInactive ( ) { } protected synchronized boolean isInactive ( ) { } public synchronized ID getLocalContainerID ( ) { } public synchronized ISharedObjectManager getSharedObjectManager ( ) { } public synchronized IQueueEnqueue getQueue ( ) { } public synchronized void joinGroup ( ID groupID , IJoinContext joinContext ) throws SharedObjectContainerJoinException { } public synchronized void leaveGroup ( ) { } public synchronized ID getGroupID ( ) { } public synchronized boolean isGroupManager ( ) { } public synchronized boolean isGroupServer ( ) { } public synchronized ID [ ] getGroupMemberIDs ( ) { } public synchronized void sendCreate ( ID toContainerID , SharedObjectDescription sd ) throws IOException { } public void sendCreateResponse ( ID toContainerID , Throwable throwable , long identifier ) throws IOException { } public synchronized void sendDispose ( ID toContainerID ) throws IOException { } public void sendMessage ( ID toContainerID , Object data ) throws IOException { if ( isInactive ( ) ) { trace ( ( ( ( ( "sendMessage(" + toContainerID ) + "," ) + data ) + ")<seq2seq4repair_space>CONTEXT<seq2seq4repair_space>INACTIVE" ) ) ; return ; } else { <START_BUG> trace ( ( ( ( ( "sendMessage(" + toContainerID ) + "," ) + data ) + ")<seq2seq4repair_space>CONTEXT<seq2seq4repair_space>INACTIVE" ) ) ; <END_BUG> container . sendMessage ( toContainerID , sharedObjectID , data ) ; } } public Object getAdapter ( Class clazz ) { } public IOSGIService getServiceAccess ( ) { } }

Fix:
trace ( ( ( ( ( "sendMessage(" + toContainerID ) + "," ) + data ) + ")<seq2seq4repair_space>CONTEXT<seq2seq4repair_space>ACTIVE" ) ) ;
Buggy code:
public class Radio extends WebMarkupContainer { private static final String ATTR_DISABLED = "disabled" ; private static final long serialVersionUID = 1L ; private short uuid = - 1 ; public Radio ( String id ) { } public Radio ( String id , IModel model ) { } public final String getValue ( ) { } protected void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "radio" ) ; final String value = getValue ( ) ; RadioGroup group = ( ( RadioGroup ) ( findParent ( RadioGroup . class ) ) ) ; if ( group == null ) { throw new wicket . WicketRuntimeException ( ( ( "Radio<seq2seq4repair_space>component<seq2seq4repair_space>[" + ( getPath ( ) ) ) + "]<seq2seq4repair_space>cannot<seq2seq4repair_space>find<seq2seq4repair_space>its<seq2seq4repair_space>parent<seq2seq4repair_space>RadioGroup.<seq2seq4repair_space>All<seq2seq4repair_space>Radio<seq2seq4repair_space>components<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>child<seq2seq4repair_space>of<seq2seq4repair_space>or<seq2seq4repair_space>below<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>hierarchy<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>RadioGroup<seq2seq4repair_space>component." ) ) ; } tag . put ( "name" , group . getInputName ( ) ) ; tag . put ( "value" , value ) ; if ( group . hasRawInput ( ) ) { String rawInput = group . getRawInput ( ) ; if ( ( rawInput != null ) && ( rawInput . equals ( value ) ) ) { tag . put ( "checked" , "checked" ) ; } } else if ( Objects . equal ( group . getModelObject ( ) , getModelObject ( ) ) ) { tag . put ( "checked" , "checked" ) ; } if ( group . wantOnSelectionChangedNotifications ( ) ) { final CharSequence url = group . urlFor ( INTERFACE ) ; Form form = ( ( Form ) ( group . findParent ( Form . class ) ) ) ; if ( form != null ) { tag . put ( "onclick" , form . getJsForInterfaceUrl ( url ) ) ; } else { <START_BUG> tag . put ( "onclick" , ( ( ( ( "window.location.href='" + url ) + "&" ) + ( group . getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.value;" ) ) ; <END_BUG> } } if ( ( ( ! ( isActionAuthorized ( ENABLE ) ) ) || ( ! ( isEnabled ( ) ) ) ) || ( ! ( group . isEnabled ( ) ) ) ) { tag . put ( Radio . ATTR_DISABLED , Radio . ATTR_DISABLED ) ; } } }

Fix:
tag . put ( "onclick" , ( ( ( ( "window.location.href='" + url ) + "&amp;" ) + ( group . getInputName ( ) ) ) + "='<seq2seq4repair_space>+<seq2seq4repair_space>this.value;" ) ) ;
Buggy code:
public class ListenerInterfaceRequestTarget extends AbstractListenerInterfaceRequestTarget { public ListenerInterfaceRequestTarget ( Page page , Component component , Method listenerMethod ) { } public ListenerInterfaceRequestTarget ( Page page , Component component , Method listenerMethod , String behaviourId ) { } public final void processEvents ( final RequestCycle requestCycle ) { <START_BUG> requestCycle . setUpdateCluster ( true ) ; <END_BUG> getPage ( ) . getFeedbackMessages ( ) . clear ( ) ; getPage ( ) . startComponentRender ( getComponent ( ) ) ; final Application application = requestCycle . getApplication ( ) ; ApplicationSettings . RenderStrategy strategy = application . getSettings ( ) . getRenderStrategy ( ) ; boolean issueRedirect = ( strategy == ( ApplicationSettings . REDIRECT_TO_RENDER ) ) || ( strategy == ( ApplicationSettings . REDIRECT_TO_BUFFER ) ) ; requestCycle . setRedirect ( issueRedirect ) ; invokeInterface ( getComponent ( ) , getListenerMethod ( ) , getPage ( ) ) ; } }

Fix:
requestCycle . setUpdateSession ( true ) ;
Buggy code:
public class SubjectTest extends AbstractTest { private final GenericDAO DAO = new GenericDAO ( ) ; private List < Subject > list ; @ Test public void mustStartEmptyDB ( ) throws Exception { } @ Test public void mustCreateSubject ( ) throws Exception { } @ Test public void mustAddTopic ( ) throws Exception { Subject subject = new Subject ( "Algoritmos<seq2seq4repair_space>Avançados" ) ; DAO . persist ( subject ) ; Topic topic = new Topic ( "Guloso" , subject ) ; DAO . persist ( topic ) ; subject . addTopic ( topic ) ; <START_BUG> DAO . merge ( topic ) ; <END_BUG> list = DAO . findAllByClass ( Subject . class ) ; assertThat ( list . get ( 0 ) ) . isEqualTo ( subject ) ; assertThat ( list . get ( 0 ) . getTopics ( ) ) . contains ( topic ) ; } }

Fix:
DAO . merge ( subject ) ;
Buggy code:
@ Views . Injectable @ Accessors ( prefix = { "m" , "" } , chain = true ) public class AddPlantActivity extends AppCompatActivity { private static final String TAG_FRAGMENT = "current_fragment" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( fragment_holder ) ; Views . inject ( this ) ; if ( ( getFragmentManager ( ) . findFragmentByTag ( AddPlantActivity . TAG_FRAGMENT ) ) == null ) { <START_BUG> getFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . fragment_holder , PlantDetailsFragment . newInstance ( null ) , AddPlantActivity . TAG_FRAGMENT ) . commit ( ) ; <END_BUG> } } }

Fix:
getFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . fragment_holder , PlantDetailsFragment . newInstance ( ( - 1 ) ) , AddPlantActivity . TAG_FRAGMENT ) . commit ( ) ;
Buggy code:
public interface IChannelContainer { <START_BUG> public IChannel createChannel ( IChannelDescription description ) throws ECFException ; <END_BUG> public IChannel getChannel ( ID channelID ) { } public boolean disposeChannel ( ID channelID ) { } }

Fix:
public IChannel createChannel ( IChannelConfig config ) throws ECFException ;
Buggy code:
public abstract class AbstractXMLDataSourceRuntimeHandler < T > extends AbstractRuntimeOnlyHandler { protected static final String CONNECTION_PROPERTIES = "connection-properties" ; protected static final String XA_DATASOURCE_PROPERTIES = "xa-datasource-properties" ; protected static final String DATA_SOURCE = "data-source" ; protected static final String XA_DATA_SOURCE = "xa-data-source" ; private final Map < PathAddress , T > dataSourceConfigs = Collections . synchronizedMap ( new HashMap < PathAddress , T > ( ) ) ; @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { String opName = operation . require ( OP ) . asString ( ) ; PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final T dataSource = getDataSourceConfig ( address ) ; if ( READ_ATTRIBUTE_OPERATION . equals ( opName ) ) { final String attributeName = operation . require ( NAME ) . asString ( ) ; executeReadAttribute ( attributeName , context , dataSource , address ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } else { throw AbstractXMLDataSourceRuntimeHandler . unknownOperation ( opName ) ; } } public void registerDataSource ( final PathAddress address , final T dataSource ) { } public void unregisterDataSource ( final PathAddress address ) { } protected abstract void executeReadAttribute ( final String attributeName , final OperationContext context , final T dataSource , final PathAddress address ) { } private static IllegalStateException unknownOperation ( String opName ) { } private T getDataSourceConfig ( final PathAddress operationAddress ) throws OperationFailedException { } protected void setLongIfNotNull ( final OperationContext context , final Long value ) { } protected void setIntIfNotNull ( final OperationContext context , final Integer value ) { } protected void setBooleanIfNotNull ( final OperationContext context , final Boolean value ) { } protected void setStringIfNotNull ( final OperationContext context , final String value ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class ZkCoordinator implements PartitionCoordinator { public static Logger LOG = Logger . getLogger ( ZkCoordinator . class ) ; SpoutConfig _config ; int _taskIndex ; int _totalTasks ; TransactionalState _state ; String _topologyInstanceId ; CuratorFramework _curator ; Map < GlobalPartitionId , PartitionManager > _managers = new HashMap ( ) ; List < PartitionManager > _cachedList ; Long _lastRefreshTime = null ; int _refreshFreqMs ; ZkHosts _brokerConf ; DynamicPartitionConnections _connections ; public ZkCoordinator ( DynamicPartitionConnections connections , Map conf , SpoutConfig config , int taskIndex , int totalTasks , TransactionalState state , String topologyInstanceId ) { } @ Override public List < PartitionManager > getMyManagedPartitions ( ) { } void refresh ( ) { } @ Override public PartitionManager getManager ( GlobalPartitionId id ) { } private boolean myOwnership ( GlobalPartitionId id ) { <START_BUG> int val = Math . abs ( ( ( id . host . hashCode ( ) ) + ( 23 * ( id . partition ) ) ) ) ; <END_BUG> return ( val % ( _totalTasks ) ) == ( _taskIndex ) ; } private static HostPort getBrokerHost ( byte [ ] contents ) { } private static int getNumPartitions ( byte [ ] contents ) { } }

Fix:
int val = ( id . host . hashCode ( ) ) + ( 23 * ( id . partition ) ) ;
Buggy code:
public class ClientManager { private ClientMapper mapper ; public ClientManager ( ) { } public ArrayList < Object [ ] > getClients ( ) { } public void updateClients ( String name , String card , String cnp , String addr ) { Client client ; try { client = ( ( Client ) ( mapper . findBy ( name , "name" , "client" ) ) ) ; client . setName ( name ) ; client . setIdCardNumber ( card ) ; client . setCnp ( cnp ) ; client . setAddress ( addr ) ; mapper . update ( client ) ; <START_BUG> } catch ( SQLException e ) { <END_BUG> try { mapper . insert ( new Client ( 0 , name , card , cnp , addr ) ) ; } catch ( SQLException e1 ) { e1 . printStackTrace ( ) ; System . out . println ( "Error<seq2seq4repair_space>inserting<seq2seq4repair_space>client." ) ; } } } }

Fix:
} catch ( Exception e ) {
Buggy code:
public class DAOConcesionari implements IDAOConcesionari { private Connection connection = null ; PreparedStatement PSInsert = null ; PreparedStatement PSSelect = null ; PreparedStatement PSDelete = null ; PreparedStatement PSUpdate = null ; public DAOConcesionari ( ) { } public void insert ( Concesionar concesionar ) throws SQLException { } @ Override public void update ( Concesionar concesionar ) throws SQLException { } @ Override public void delete ( Concesionar concesionar ) throws SQLException { } @ Override public List < Concesionar > getAll ( ) throws SQLException { } @ Override public Concesionar getConcesionarById ( int idConcesionar ) throws SQLException { } public Concesionar getConcesionarFromCNP ( String CNP ) throws SQLException { Concesionar concesionar = null ; try { <START_BUG> String selectTable = "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>concesionari<seq2seq4repair_space>where<seq2seq4repair_space>cnpConcesionar=?<seq2seq4repair_space>" ; <END_BUG> System . out . println ( "bla" ) ; PSSelect = connection . prepareStatement ( selectTable ) ; PSSelect . setString ( 1 , CNP ) ; ResultSet result = PSSelect . executeQuery ( ) ; if ( result . next ( ) ) { concesionar = new Concesionar ( Integer . valueOf ( result . getString ( 1 ) ) , result . getString ( 2 ) , Integer . valueOf ( result . getString ( 3 ) ) , result . getString ( 4 ) ) ; System . out . println ( ( "concesionar" + ( concesionar . getCnpConcesionar ( ) ) ) ) ; } } catch ( SQLException ex ) { throw new SQLException ( ( "Error<seq2seq4repair_space>when<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>retrieve<seq2seq4repair_space>the<seq2seq4repair_space>concesionar:" + ( ex . getMessage ( ) ) ) ) ; } finally { if ( ( PSSelect ) != null ) { PSSelect . close ( ) ; } } return concesionar ; } }

Fix:
String selectTable = "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>Concesionari<seq2seq4repair_space>where<seq2seq4repair_space>cnpConcesionar=?<seq2seq4repair_space>" ;
Buggy code:
public class ConversationPropagator extends AbstractRequestCycleListener { private static final MetaDataKey < String > CID_KEY = new MetaDataKey < String > ( ) { } ; private static final String CID = "cid" ; private final CdiContainer container ; private final ConversationPropagation propagation ; public ConversationPropagator ( CdiContainer container , ConversationPropagation propagation ) { } public void onRequestHandlerResolved ( RequestCycle cycle , IRequestHandler handler ) { } @ Override public void onRequestHandlerExecuted ( RequestCycle cycle , IRequestHandler handler ) { } public void onRequestHandlerScheduled ( RequestCycle cycle , IRequestHandler handler ) { Conversation conversation = container . getCurrentConversation ( cycle ) ; if ( ( conversation == null ) || ( conversation . isTransient ( ) ) ) { return ; } Page page = getPage ( handler ) ; if ( ( page != null ) && ( ! ( conversation . isTransient ( ) ) ) ) { page . setMetaData ( ConversationPropagator . CID_KEY , conversation . getId ( ) ) ; } if ( ( propagation ) == ( ConversationPropagation . ALL ) ) { PageParameters parameters = getPageParameters ( handler ) ; <START_BUG> if ( ( parameters != null ) && ( ( propagation ) == ( ConversationPropagation . ALL ) ) ) { <END_BUG> parameters . add ( ConversationPropagator . CID , conversation . getId ( ) ) ; } } } @ Override public void onUrlMapped ( RequestCycle cycle , IRequestHandler handler , Url url ) { } @ Override public void onEndRequest ( RequestCycle cycle ) { } protected Page getPage ( IRequestHandler handler ) { } protected PageParameters getPageParameters ( IRequestHandler handler ) { } }

Fix:
if ( parameters != null ) {
Buggy code:
public class ExampleSearchProvider implements ISearchProvider { private int count = - 1 ; public ExampleSearchProvider ( ) { } public ISearchCriteria getCriteria ( String searchTerm ) { <START_BUG> return new SearchCriteria ( ( "test:<seq2seq4repair_space>" + searchTerm ) , "test<seq2seq4repair_space>description" ) ; <END_BUG> } public List < ISearchResult > query ( String searchTerm , int startIndex , int resultCount ) { } public String getName ( ) { } public String getNamespace ( ) { } public int getTotalResultCount ( ) { } }

Fix:
return new SearchCriteria ( ( "test:<seq2seq4repair_space>" + searchTerm ) , "test<seq2seq4repair_space>description" , null ) ;
Buggy code:
public class UpdateValidateUtil { public static final String ERROR_PROP_NAME_PREFIX_EVENT = "events." ; public static final String ERROR_PROP_NAME_PREFIX_PUBLICID = "publicIds." ; public static final String ERROR_PROP_NAME_PREFIX_REMARK = "remarks." ; public static final String ERROR_PROP_NAME_PREFIX_LINK = "links." ; public static final String ERROR_PROP_NAME_PREFIX_ENTITY = "entities." ; private static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ; public static final int MAX_LENGTH_LANG = 64 ; public static final int MAX_LENGTH_PORT43 = 4096 ; public static final int MAX_LENGTH_UNICODENAME = 1024 ; public static final int MAX_LENGTH_HANDLE = 100 ; public static final int MAX_LENGTH_STATUS = 20 ; public static final int MAX_LENGTH_LDHNAME = 255 ; public static final int MAX_LENGTH_255 = 255 ; public static final int MAX_LENGTH_2048 = 2048 ; public static final int MIN_VAL_FOR_INT_COLUMN = 0 ; public static final int MAX_VAL_FOR_INT_COLUMN = 2147483647 ; public static final int MIN_VAL_FOR_TINYINT_COLUMN = 0 ; public static final int MAX_VAL_FOR_TINYINT_COLUMN = 127 ; public static Date MIN_VAL_FOR_DATETIME_COLUMN = null ; public static Date MAX_VAL_FOR_DATETIME_COLUMN = null ; public static void checkNotEmpty ( String value , String fieldName , ValidationResult validationResult ) { } public static void checkNotNull ( Object value , String fieldName , ValidationResult validationResult ) { } public static void checkNotEmpty ( List < String > values , String fieldName , ValidationResult validationResult ) { } public static void checkMaxLength ( String value , int maxLength , String fieldName , ValidationResult validationResult ) { } public static void checkMinMaxInt ( Integer value , int minValue , long maxValue , String fieldName , ValidationResult validationResult ) { } public static void checkMinMaxDate ( Date value , Date minValue , Date maxValue , String fieldName , ValidationResult validationResult ) { } public static void checkValidAndMinMaxDate ( String dateString , Date minValue , Date maxValue , String fieldName , ValidationResult validationResult ) { if ( StringUtils . isEmpty ( dateString ) ) { return ; } Date dateValue = DateUtil . parseUTC ( dateString ) ; if ( null == dateValue ) { <START_BUG> validationResult . addError ( UpdateValidationError . build4008Error ( fieldName ) ) ; <END_BUG> return ; } UpdateValidateUtil . checkMinMaxDate ( dateValue , minValue , maxValue , fieldName , validationResult ) ; } public static void checkNotEmptyAndValidMinMaxDate ( String dateString , String fieldName , ValidationResult validationResult ) { } }

Fix:
validationResult . addError ( UpdateValidationError . build4007Error ( fieldName ) ) ;
Buggy code:
public interface RestMessageInterface { @ GET ( "//api//messages" ) void getMessage ( Callback < Response > callback ) { } @ GET ( "//api//messages//sent" ) void getMessageSent ( Callback < Response > callback ) { } @ GET ( "//api//messages//received" ) void getMessageReceived ( Callback < Response > callback ) { } @ GET ( "//api//messages//relations" ) void getMessageRelations ( Callback < Response > callback ) { } @ FormUrlEncoded <START_BUG> @ POST ( "//api//events//create" ) <END_BUG> void createMessage ( @ Field ( "sender_id" ) String senderId , @ Field ( "receiver_id" ) String receiverId , @ Field ( "content" ) String content , Callback < Response > callback ) ; }

Fix:
@ POST ( "//api//messages//new" )