nus-yam/ex-repair huggingface dataset:
Buggy code:
class ChainsawStatusBar extends JPanel { private static final int DELAY_PERIOD = 5000 ; private final String DEFAULT_MSG = "Welcome<seq2seq4repair_space>to<seq2seq4repair_space>Chainsaw<seq2seq4repair_space>v2!" ; private final JLabel statusMsg = new JLabel ( DEFAULT_MSG ) ; private final JLabel pausedLabel = new JLabel ( "" , JLabel . CENTER ) ; private final JLabel lineSelectionLabel = new JLabel ( "" , JLabel . CENTER ) ; private final JLabel eventCountLabel = new JLabel ( "" , JLabel . CENTER ) ; private final JLabel receivedEventLabel = new JLabel ( "0.0" , JLabel . CENTER ) ; private final JLabel receivedConnectionlabel = new JLabel ( "" , JLabel . CENTER ) ; private volatile long lastReceivedEvent = System . currentTimeMillis ( ) ; private volatile long lastReceivedConnection = System . currentTimeMillis ( ) ; private final Thread connectionThread ; private final Icon pausedIcon = new ImageIcon ( ChainsawIcons . PAUSE ) ; private final Icon radioTowerIcon = new ImageIcon ( ChainsawIcons . ANIM_RADIO_TOWER ) ; private final Icon netConnectIcon = new ImageIcon ( ChainsawIcons . ANIM_NET_CONNECT ) ; private final NumberFormat nf = NumberFormat . getNumberInstance ( ) ; private final Border statusBarComponentBorder = BorderFactory . createLineBorder ( statusMsg . getBackground ( ) . darker ( ) ) ; ChainsawStatusBar ( ) { } void setDataRate ( final double dataRate ) { } void remoteConnectionReceived ( String source ) { } void setPaused ( final boolean isPaused ) { } void setSelectedLine ( final int selectedLine , final int lineCount , final int total ) { SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { lineSelectionLabel . setText ( ( selectedLine + "" ) ) ; <START_BUG> eventCountLabel . setText ( ( selectedLine == 0 ? "" : ( lineCount + ":" ) + total ) ) ; <END_BUG> } } ) ; } void setNothingSelected ( ) { } void clear ( ) { } void setMessage ( final String msg ) { } }

Fix:
eventCountLabel . setText ( ( ( lineCount + ":" ) + total ) ) ;
Buggy code:
public class DelayedLoop { static Category cat = Category . getInstance ( DelayedLoop . class ) ; static int loopLength ; public static void main ( String [ ] argv ) { } static void usage ( String msg ) { } static void init ( String configFile ) { } static void test ( ) { int i = 0 ; while ( true ) { DelayedLoop . cat . debug ( ( "MSG<seq2seq4repair_space>" + ( i ++ ) ) ) ; try { <START_BUG> Thread . currentThread ( ) . sleep ( 1000 ) ; <END_BUG> } catch ( Exception e ) { } } } }

Fix:
Thread . sleep ( 1000 ) ;
Buggy code:
@ DeclareRoles ( { PropagateIdentityServlet . ALLOWED_ROLE } ) @ ServletSecurity ( @ HttpConstraint ( rolesAllowed = { PropagateIdentityServlet . ALLOWED_ROLE } ) ) @ WebServlet ( PropagateIdentityServlet . SERVLET_PATH ) public class PropagateIdentityServlet extends HttpServlet { private static final long serialVersionUID = 1L ; private static Logger LOGGER = Logger . getLogger ( PropagateIdentityServlet . class ) ; public static final String SERVLET_PATH = "//PropagateIdentityServlet" ; public static final String ALLOWED_ROLE = "JBossAdmin" ; @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { <START_BUG> PropagateIdentityServlet . LOGGER . debug ( "New<seq2seq4repair_space>request<seq2seq4repair_space>coming." ) ; <END_BUG> final GSSCredential credential = DelegationCredentialContext . getDelegCredential ( ) ; if ( credential == null ) { resp . sendError ( SC_UNAUTHORIZED , "GSSCredential<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } else { resp . setContentType ( "text//plain" ) ; final PrintWriter writer = resp . getWriter ( ) ; final GSSTestClient client = new GSSTestClient ( StringUtils . strip ( req . getServerName ( ) , "[]" ) , GSSTestConstants . PORT , GSSTestConstants . PRINCIPAL ) ; PropagateIdentityServlet . LOGGER . info ( ( "Client<seq2seq4repair_space>for<seq2seq4repair_space>identity<seq2seq4repair_space>propagation<seq2seq4repair_space>created:<seq2seq4repair_space>" + client ) ) ; try { writer . print ( client . getName ( credential ) ) ; } catch ( GSSException e ) { throw new ServletException ( "Propagation<seq2seq4repair_space>failed." , e ) ; } } } }

Fix:
PropagateIdentityServlet . LOGGER . debug ( "New<seq2seq4repair_space>request<seq2seq4repair_space>comming." ) ;
Buggy code:
public class BenchmarkSetup { static String RESULTS_DIR = "results" ; static String RESULTS_FILE_STEM = "results" ; static String RESULTS_FILE = ( ( ( BenchmarkSetup . RESULTS_DIR ) + "//" ) + ( BenchmarkSetup . RESULTS_FILE_STEM ) ) + ".csv" ; static String SUMMARY_FILE_STEM = "results_summary" ; static double NO_SOULUTION_FOUND_DOUBLE_VAL = - 1.0 ; static String NO_SOULUTION_FOUND_STRING_VAL = "n.s.f." ; public static BenchmarkSetup . BenchmarkMetric [ ] getMetrics ( ) { <START_BUG> return new BenchmarkSetup . BenchmarkMetric [ ] { BenchmarkSetup . BenchmarkMetric . LOSS , BenchmarkSetup . BenchmarkMetric . ENTROPY , BenchmarkSetup . BenchmarkMetric . AECS , BenchmarkSetup . BenchmarkMetric . DISCERNABILITY , BenchmarkSetup . BenchmarkMetric . PRECISION , BenchmarkSetup . BenchmarkMetric . HEIGHT } ; <END_BUG> } public static double [ ] getSuppressionFactors ( ) { } public static BenchmarkDataset [ ] getDatasets ( ) { } public static BenchmarkSetup . BenchmarkCriterion [ ] [ ] getCriteria ( ) { } public static enum VARIABLES { UTLITY_METRIC ( ) { @ Override public String toString ( ) { } } , DATASET ( ) { @ Override public String toString ( ) { } } , CRITERIA ( ) { @ Override public String toString ( ) { } } , UTILITY_VALUE ( ) { @ Override public String toString ( ) { } } , SUPPRESSION_FACTOR ( ) { @ Override public String toString ( ) { } } ; } public static enum BenchmarkAlgorithm { BFS ( ) { @ Override public String toString ( ) { } } , DFS ( ) { @ Override public String toString ( ) { } } , FLASH ( ) { @ Override public String toString ( ) { } } , OLA ( ) { @ Override public String toString ( ) { } } , INCOGNITO ( ) { @ Override public String toString ( ) { } } , INFORMATION_LOSS_BOUNDS ( ) { @ Override public String toString ( ) { } } ; } public static enum BenchmarkCriterion { K_ANONYMITY ( ) { @ Override public String toString ( ) { } } , L_DIVERSITY ( ) { @ Override public String toString ( ) { } } , T_CLOSENESS ( ) { @ Override public String toString ( ) { } } , D_PRESENCE ( ) { @ Override public String toString ( ) { } } , INCLUSION ( ) { @ Override public String toString ( ) { } } ; } static enum BenchmarkMetric { LOSS ( ) { @ Override public String toString ( ) { } } , ENTROPY ( ) { @ Override public String toString ( ) { } } , DISCERNABILITY ( ) { @ Override public String toString ( ) { } } , AECS ( ) { @ Override public String toString ( ) { } } , PRECISION ( ) { @ Override public String toString ( ) { } } , HEIGHT ( ) { @ Override public String toString ( ) { } } ; } public static ARXConfiguration getConfiguration ( BenchmarkDataset dataset , double suppFactor , BenchmarkSetup . BenchmarkMetric metric , BenchmarkSetup . BenchmarkCriterion ... criteria ) throws IOException { } }

Fix:
return new BenchmarkSetup . BenchmarkMetric [ ] { BenchmarkSetup . BenchmarkMetric . ENTROPY , BenchmarkSetup . BenchmarkMetric . AECS , BenchmarkSetup . BenchmarkMetric . DISCERNABILITY , BenchmarkSetup . BenchmarkMetric . PRECISION , BenchmarkSetup . BenchmarkMetric . HEIGHT } ;
Buggy code:
public class WhileStatement extends Statement { public Expression condition ; public Statement action ; private Label breakLabel ; private Label continueLabel ; int preCondInitStateIndex = - 1 ; int condIfTrueInitStateIndex = - 1 ; int mergedInitStateIndex = - 1 ; public WhileStatement ( Expression condition , Statement action , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { <START_BUG> TypeBinding type = condition . resolveTypeExpecting ( scope , BooleanBinding ) ; <END_BUG> condition . computeConversion ( scope , type , type ) ; if ( ( action ) != null ) action . resolve ( scope ) ; } public StringBuffer printStatement ( int tab , StringBuffer output ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
TypeBinding type = condition . resolveTypeExpecting ( scope , TypeBinding . BOOLEAN ) ;
Buggy code:
public class ApplicationIds { private static final Localizer _loc = Localizer . forPackage ( ApplicationIds . class ) ; private static final Localizer _loc2 = Localizer . forPackage ( StateManagerImpl . class ) ; public static Object [ ] toPKValues ( Object oid , ClassMetaData meta ) { } public static Object fromPKValues ( Object [ ] pks , ClassMetaData meta ) { } public static Object copy ( Object oid , ClassMetaData meta ) { } private static boolean hasPCPrimaryKeyFields ( ClassMetaData meta ) { } private static Object copy ( Object oid , ClassMetaData meta , FieldMetaData [ ] fmds ) { } public static Object get ( Object oid , FieldMetaData fmd ) { } public static Object create ( PersistenceCapable pc , ClassMetaData meta ) { } public static boolean assign ( OpenJPAStateManager sm , StoreManager store , boolean preFlush ) { } private static boolean assign ( OpenJPAStateManager sm , StoreManager store , FieldMetaData [ ] pks , boolean preFlush ) { for ( int i = 0 ; i < ( pks . length ) ; i ++ ) if ( ( pks [ i ] . getValueStrategy ( ) ) != ( ValueStrategies . NONE ) ) { if ( ! ( sm . isDefaultValue ( pks [ i ] . getIndex ( ) ) ) ) throw new InvalidStateException ( ApplicationIds . _loc2 . get ( "existing-value-override-excep" , pks [ i ] . getFullName ( false ) ) ) ; if ( store . assignField ( sm , pks [ i ] . getIndex ( ) , preFlush ) ) <START_BUG> pks [ i ] . set_generated ( true ) ; <END_BUG> else return false ; } return true ; } private static class PrimaryKeyFieldManager implements FieldManager { private Object [ ] _store = null ; private int _index = 0 ; private ClassMetaData _meta = null ; public void setMetaData ( ClassMetaData meta ) { } public Object [ ] getStore ( ) { } public void setStore ( Object [ ] store ) { } public void storeBooleanField ( int field , boolean val ) { } public void storeByteField ( int field , byte val ) { } public void storeCharField ( int field , char val ) { } public void storeShortField ( int field , short val ) { } public void storeIntField ( int field , int val ) { } public void storeLongField ( int field , long val ) { } public void storeFloatField ( int field , float val ) { } public void storeDoubleField ( int field , double val ) { } public void storeStringField ( int field , String val ) { } public void storeObjectField ( int field , Object val ) { } public boolean fetchBooleanField ( int field ) { } public char fetchCharField ( int field ) { } public byte fetchByteField ( int field ) { } public short fetchShortField ( int field ) { } public int fetchIntField ( int field ) { } public long fetchLongField ( int field ) { } public float fetchFloatField ( int field ) { } public double fetchDoubleField ( int field ) { } public String fetchStringField ( int field ) { } public Object fetchObjectField ( int field ) { } private void store ( Object val ) { } private Object retrieve ( int field ) { } } }

Fix:
pks [ i ] . setValueGenerated ( true ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws IOException { String destDir = null ; String srcDir = null ; boolean showPrivate = false ; boolean omitSource = false ; for ( int i = 0 ; i < ( args . length ) ; i ++ ) { String arg = args [ i ] ; if ( "-d" . equals ( arg ) ) { System . err . println ( "-d:<seq2seq4repair_space>option<seq2seq4repair_space>not<seq2seq4repair_space>yet<seq2seq4repair_space>supported<seq2seq4repair_space>(though<seq2seq4repair_space>perhaps<seq2seq4repair_space>you<seq2seq4repair_space>meant<seq2seq4repair_space>-out?)" ) ; System . exit ( 1 ) ; } else if ( "-out" . equals ( arg ) ) { destDir = args [ ( ++ i ) ] ; } else if ( "-src" . equals ( arg ) ) { srcDir = args [ ( ++ i ) ] ; } else if ( "-rep" . equals ( arg ) ) { System . err . println ( "-rep:<seq2seq4repair_space>option<seq2seq4repair_space>not<seq2seq4repair_space>yet<seq2seq4repair_space>supported" ) ; System . exit ( 1 ) ; } else if ( "-private" . equals ( arg ) ) { showPrivate = true ; } else if ( "-omit-source" . equals ( arg ) ) { omitSource = true ; } else { System . err . println ( "Processing<seq2seq4repair_space>modules<seq2seq4repair_space>by<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>yet" ) ; } } if ( destDir == null ) { <START_BUG> System . err . println ( "-dest-dir<seq2seq4repair_space><dest-dir>:<seq2seq4repair_space>option<seq2seq4repair_space>required" ) ; <END_BUG> System . exit ( 1 ) ; } if ( srcDir == null ) { System . err . println ( "-src<seq2seq4repair_space><src-dir>:<seq2seq4repair_space>option<seq2seq4repair_space>required" ) ; System . exit ( 1 ) ; } File file = new File ( srcDir ) ; if ( ( file . exists ( ) ) == false ) { System . err . println ( ( srcDir + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>file<seq2seq4repair_space>or<seq2seq4repair_space>directory" ) ) ; System . exit ( 1 ) ; } CeylonDocTool ceylonDocTool = new CeylonDocTool ( file ) ; ceylonDocTool . setShowPrivate ( showPrivate ) ; ceylonDocTool . setDestDir ( destDir ) ; ceylonDocTool . setSrcDir ( srcDir ) ; ceylonDocTool . setOmitSource ( omitSource ) ; ceylonDocTool . makeDoc ( ) ; } }

Fix:
System . err . println ( "-out<seq2seq4repair_space><dest-dir>:<seq2seq4repair_space>option<seq2seq4repair_space>required" ) ;
Buggy code:
public class TestSimilarityProvider extends LuceneTestCase { private Directory directory ; private DirectoryReader reader ; private IndexSearcher searcher ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; directory = newDirectory ( ) ; PerFieldSimilarityWrapper sim = new TestSimilarityProvider . ExampleSimilarityProvider ( ) ; IndexWriterConfig iwc = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setSimilarity ( sim ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , directory , iwc ) ; Document doc = new Document ( ) ; Field field = newTextField ( "foo" , "" , NO ) ; doc . add ( field ) ; Field field2 = newTextField ( "bar" , "" , NO ) ; doc . add ( field2 ) ; field . setStringValue ( "quick<seq2seq4repair_space>brown<seq2seq4repair_space>fox" ) ; field2 . setStringValue ( "quick<seq2seq4repair_space>brown<seq2seq4repair_space>fox" ) ; iw . addDocument ( doc ) ; field . setStringValue ( "jumps<seq2seq4repair_space>over<seq2seq4repair_space>lazy<seq2seq4repair_space>brown<seq2seq4repair_space>dog" ) ; field2 . setStringValue ( "jumps<seq2seq4repair_space>over<seq2seq4repair_space>lazy<seq2seq4repair_space>brown<seq2seq4repair_space>dog" ) ; iw . addDocument ( doc ) ; reader = iw . getReader ( ) ; <START_BUG> iw . close ( ) ; <END_BUG> searcher = newSearcher ( reader ) ; searcher . setSimilarity ( sim ) ; } @ Override public void tearDown ( ) throws Exception { } public void testBasics ( ) throws Exception { } private class ExampleSimilarityProvider extends PerFieldSimilarityWrapper { private Similarity sim1 = new TestSimilarityProvider . Sim1 ( ) ; private Similarity sim2 = new TestSimilarityProvider . Sim2 ( ) ; @ Override public Similarity get ( String field ) { } } private class Sim1 extends TFIDFSimilarity { @ Override public long encodeNormValue ( float f ) { } @ Override public float decodeNormValue ( long norm ) { } @ Override public float coord ( int overlap , int maxOverlap ) { } @ Override public float queryNorm ( float sumOfSquaredWeights ) { } @ Override public float lengthNorm ( FieldInvertState state ) { } @ Override public float sloppyFreq ( int distance ) { } @ Override public float tf ( float freq ) { } @ Override public float idf ( long docFreq , long numDocs ) { } @ Override public float scorePayload ( int doc , int start , int end , BytesRef payload ) { } } private class Sim2 extends TFIDFSimilarity { @ Override public long encodeNormValue ( float f ) { } @ Override public float decodeNormValue ( long norm ) { } @ Override public float coord ( int overlap , int maxOverlap ) { } @ Override public float queryNorm ( float sumOfSquaredWeights ) { } @ Override public float lengthNorm ( FieldInvertState state ) { } @ Override public float sloppyFreq ( int distance ) { } @ Override public float tf ( float freq ) { } @ Override public float idf ( long docFreq , long numDocs ) { } @ Override public float scorePayload ( int doc , int start , int end , BytesRef payload ) { } } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class InventoryListener implements Listener { private Coinz plugin = Coinz . instance ; private SpoutPlayer player ; private short recipe ; public InventoryListener ( ) { } @ EventHandler ( priority = EventPriority . NORMAL ) public void onMyRecipeCraft ( InventoryCraftEvent event ) { player = ( ( SpoutPlayer ) ( event . getPlayer ( ) ) ) ; recipe = event . getResult ( ) . getDurability ( ) ; <START_BUG> if ( ( ! ( plugin . perm . playerHas ( player , "coinz..craft.teller" ) ) ) && ( ( recipe ) == ( plugin . tellerRec . getResult ( ) . getDurability ( ) ) ) ) { <END_BUG> player . sendNotification ( "So<seq2seq4repair_space>sorry!" , "Cant<seq2seq4repair_space>craft<seq2seq4repair_space>that" , plugin . TellerBlock , 2500 ) ; event . setCancelled ( true ) ; } if ( ( ! ( plugin . perm . playerHas ( player , "coinz.craft.vault" ) ) ) && ( ( recipe ) == ( plugin . vaultRec . getResult ( ) . getDurability ( ) ) ) ) { player . sendNotification ( "So<seq2seq4repair_space>sorry!" , "Cant<seq2seq4repair_space>craft<seq2seq4repair_space>that" , plugin . VaultBlock , 2500 ) ; event . setCancelled ( true ) ; } if ( ( ! ( plugin . perm . playerHas ( player , "coinz.craft.goldcoin" ) ) ) && ( ( recipe ) == ( plugin . MakeGC2 . getResult ( ) . getDurability ( ) ) ) ) { player . sendNotification ( "So<seq2seq4repair_space>sorry!" , "Cant<seq2seq4repair_space>craft<seq2seq4repair_space>that" , plugin . GoldCoin , 2500 ) ; event . setCancelled ( true ) ; } } }

Fix:
if ( ( ! ( plugin . perm . playerHas ( player , "coinz.craft.teller" ) ) ) && ( ( recipe ) == ( plugin . tellerRec . getResult ( ) . getDurability ( ) ) ) ) {
Buggy code:
public abstract class BaseResourceCollectionContainer extends DataType implements Cloneable , ResourceCollection { private List rc = new ArrayList ( ) ; private Collection coll = null ; private boolean cache = true ; public synchronized void setCache ( boolean b ) { } public synchronized boolean isCache ( ) { } public synchronized void clear ( ) throws BuildException { } public synchronized void add ( ResourceCollection c ) throws BuildException { } public synchronized void addAll ( Collection c ) throws BuildException { } public final synchronized Iterator iterator ( ) { } public synchronized int size ( ) { } public synchronized boolean isFilesystemOnly ( ) { if ( isReference ( ) ) { return ( ( BaseResourceCollectionContainer ) ( getCheckedRef ( ) ) ) . isFilesystemOnly ( ) ; } dieOnCircularReference ( ) ; boolean goEarly = true ; for ( Iterator i = rc . iterator ( ) ; goEarly && ( i . hasNext ( ) ) ; ) { <START_BUG> goEarly &= ( ( ResourceCollection ) ( i . next ( ) ) ) . isFilesystemOnly ( ) ; <END_BUG> } if ( goEarly ) { return true ; } for ( Iterator i = cacheCollection ( ) . iterator ( ) ; i . hasNext ( ) ; ) { if ( ! ( ( i . next ( ) ) instanceof FileResource ) ) { return false ; } } return true ; } protected synchronized void dieOnCircularReference ( Stack stk , Project p ) throws BuildException { } protected final synchronized List getResourceCollections ( ) { } protected abstract Collection getCollection ( ) { } public Object clone ( ) { } public synchronized String toString ( ) { } private synchronized Collection cacheCollection ( ) { } }

Fix:
goEarly = ( ( ResourceCollection ) ( i . next ( ) ) ) . isFilesystemOnly ( ) ;
Buggy code:
public class KeyBasedStringTupleMapper extends Mapper < LongWritable , Text , Text , StringTuple > { private static final Logger log = LoggerFactory . getLogger ( KeyBasedStringTupleMapper . class ) ; private Pattern splitter ; private int [ ] selectedFields ; private int [ ] groupingFields ; @ Override protected void map ( LongWritable key , Text value , Context context ) throws IOException , InterruptedException { } @ Override protected void setup ( Context context ) throws IOException , InterruptedException { super . setup ( context ) ; <START_BUG> Parameters params = Parameters . fromString ( context . getConfiguration ( ) . get ( "job.parameters" , "" ) ) ; <END_BUG> splitter = Pattern . compile ( params . get ( "splitPattern" , "[<seq2seq4repair_space>\t]*\t[<seq2seq4repair_space>\t]*" ) ) ; int selectedFieldCount = Integer . valueOf ( params . get ( "selectedFieldCount" , "0" ) ) ; selectedFields = new int [ selectedFieldCount ] ; for ( int i = 0 ; i < selectedFieldCount ; i ++ ) { selectedFields [ i ] = Integer . valueOf ( params . get ( ( "field" + i ) , "0" ) ) ; } int groupingFieldCount = Integer . valueOf ( params . get ( "groupingFieldCount" , "0" ) ) ; groupingFields = new int [ groupingFieldCount ] ; for ( int i = 0 ; i < groupingFieldCount ; i ++ ) { groupingFields [ i ] = Integer . valueOf ( params . get ( ( "gfield" + i ) , "0" ) ) ; } } }

Fix:
Parameters params = new Parameters ( context . getConfiguration ( ) . get ( "job.parameters" , "" ) ) ;
Buggy code:
public abstract class TCPClientDecorator extends AbstractTCPClient { protected final TCPClient tcpClient ; public TCPClientDecorator ( TCPClient tcpClient ) { } public static byte [ ] intToByteArray ( int value , int len ) { if ( ( len == 2 ) || ( len == 4 ) ) { if ( ( len == 2 ) && ( ( value < ( Short . MIN_VALUE ) ) || ( value > ( Short . MAX_VALUE ) ) ) ) { throw new IllegalArgumentException ( "Value<seq2seq4repair_space>outside<seq2seq4repair_space>range<seq2seq4repair_space>for<seq2seq4repair_space>signed<seq2seq4repair_space>short<seq2seq4repair_space>int." ) ; } else { byte [ ] b = new byte [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { int offset = ( ( ( b . length ) - 1 ) - i ) * 8 ; <START_BUG> b [ i ] = ( ( byte ) ( value > > > offset ) ) ; <END_BUG> } return b ; } } else { throw new IllegalArgumentException ( "Length<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>specified<seq2seq4repair_space>as<seq2seq4repair_space>either<seq2seq4repair_space>2<seq2seq4repair_space>or<seq2seq4repair_space>4." ) ; } } public static int byteArrayToInt ( byte [ ] b ) { } }

Fix:
b [ i ] = ( ( byte ) ( ( value > > > offset ) & 255 ) ) ;
Buggy code:
public class CowGraphVersion extends ObservableBean { public static final String PROP_NAME = "name" ; public static final String PROP_DATE = "date" ; public static enum Property { ELEMENTS_ADDED , ELEMENTS_REMOVED ; } private String name ; private Date date ; private List < GraphElement > elements ; public CowGraphVersion ( ) { } public Date getDate ( ) { } public void setDate ( Date date ) { } public String getName ( ) { } public void setName ( String name ) { } public List < GraphElement > getElements ( ) { } public GraphElement remove ( int index ) { GraphElement elem = elements . remove ( index ) ; <START_BUG> firePropertyElementAdded ( CowGraphVersion . Property . ELEMENTS_REMOVED . name ( ) , elem ) ; <END_BUG> return elem ; } public boolean add ( GraphElement elem ) { } protected final void firePropertyElementAdded ( String propertyName , final Object elementAdded ) { } protected final void firePropertyElementRemoved ( String propertyName , final Object elementRemoved ) { } }

Fix:
firePropertyElementRemoved ( CowGraphVersion . Property . ELEMENTS_REMOVED . name ( ) , elem ) ;
Buggy code:
public class TwitterClient extends OAuthBaseClient { public static final Class < ? extends Api > REST_API_CLASS = TwitterApi . class ; public static final String REST_URL = "https:////api.twitter.com//1.1" ; public static final String REST_CONSUMER_KEY = "NsjxrOl7YciuS3EPs6j7MAqqR" ; public static final String REST_CONSUMER_SECRET = "GNyz9uPYXItD32502Ugq6Esos8uLPJtfcP9b5BMuMSSqkIY8u8" ; public static final String REST_CALLBACK_URL = "oauth:////cpsimpletweets" ; public TwitterClient ( Context context ) { } public void getUserProfile ( AsyncHttpResponseHandler handler ) { } public void getHomeTimeline ( AsyncHttpResponseHandler handler ) { String apiUrl = getApiUrl ( "statuses//home_timeline.json" ) ; RequestParams params = new RequestParams ( ) ; <START_BUG> params . put ( "count" , 25 ) ; <END_BUG> if ( ( Tweet . lastLowestId ) != ( Long . MAX_VALUE ) ) { params . put ( "max_id" , lastLowestId ) ; } client . get ( apiUrl , params , handler ) ; } public void tweet ( String body , AsyncHttpResponseHandler handler ) { } No newline ; at end ; of file ; }

Fix:
params . put ( "count" , 10 ) ;
Buggy code:
public class ExpressionHelper implements ValueEvaluator , ApplicationContextAware { public static final HighlightRobotLogger LOG = HighlightRobotLogger . getLogger ( ExpressionHelper . class ) ; private static final Pattern EXPRESSION_PATTERN = Pattern . compile ( "\\$\\[(.*)\\]" , Pattern . CASE_INSENSITIVE ) ; private static final Pattern PREFIX_EXPRESSION_PATTERN = Pattern . compile ( "([a-z0-9]+)\\:(.*)" , Pattern . CASE_INSENSITIVE ) ; private static final Field nodeField ; private ExpressionFactory factory ; private SupportedFunctionsManager functionManager ; private ExpressionHandlerManager expressionManager ; private VariableProviderManager variableManager ; private ExpressionHelper . ELExpressionHandler defaultHandler = new ExpressionHelper . ELExpressionHandler ( ) ; public ExpressionHelper ( ExpressionFactory factory ) { } @ Override public void setApplicationContext ( ApplicationContext context ) throws BeansException { } public void evaluationShouldBe ( String expression , Object expected ) throws Exception { ExpressionHelper . LOG . keywordAppender ( ) . appendArgument ( "Expected<seq2seq4repair_space>Result" , expected ) ; <START_BUG> Object value = evaluate ( expression ) ; <END_BUG> if ( ( expected == null ) && ( value == null ) ) { return ; } if ( ( ( expected == null ) || ( value == null ) ) || ( ! ( silentEvaluate ( expected ) . equals ( value ) ) ) ) { throw new IllegalArgumentException ( String . format ( "Evaluation<seq2seq4repair_space>'%s'<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>expected." , expression ) ) ; } } public void evaluationShouldBeNull ( String expression ) throws Exception { } public void evaluationShouldNotBeNull ( String expression ) throws Exception { } public void evaluationShouldBeTrue ( String expression ) throws Exception { } public void evaluationShouldBeFalse ( String expression ) throws Exception { } public Object silentEvaluate ( Object param ) throws Exception { } private void initVariables ( List < Object > variables ) throws Exception { } public Object variableScope ( List < Object > variables , Callable < Object > callable ) throws Exception { } public void variableScope ( List < Object > variables , Runnable runnable ) throws Exception { } public Object evaluate ( String expression ) throws Exception { } public boolean isSupported ( String expression ) { } private Map < String , Object > getVariables ( ) { } public Object getValue ( Object result ) { } public class ELExpressionHandler implements ExpressionHandler { @ Override public String getPrefix ( ) { } @ Override public Object evaluate ( String expression ) throws Exception { } } }

Fix:
Object value = silentEvaluate ( expression ) ;
Buggy code:
public abstract class AbstractProperty implements JMeterProperty { protected static Logger log = LoggingManager . getLoggerForClass ( ) ; private String name ; private boolean runningVersion = false ; private Map ownerMap ; public AbstractProperty ( String name ) { } public AbstractProperty ( ) { } protected boolean isEqualType ( JMeterProperty prop ) { } public boolean isRunningVersion ( ) { } public String getName ( ) { } public void setName ( String name ) { } public void setRunningVersion ( boolean runningVersion ) { } public boolean isTemporary ( TestElement owner ) { } public void mergeIn ( JMeterProperty prop ) { } public void setTemporary ( boolean temporary , TestElement owner ) { } public void clearTemporary ( TestElement owner ) { } public Object clone ( ) { } public int getIntValue ( ) { } public long getLongValue ( ) { } public double getDoubleValue ( ) { } public void recoverRunningVersion ( TestElement owner ) { } public float getFloatValue ( ) { } public boolean getBooleanValue ( ) { } public boolean equals ( Object o ) { } public int compareTo ( Object arg0 ) { } protected Class getPropertyType ( ) { } protected JMeterProperty getBlankProperty ( ) { } protected Collection normalizeList ( Collection coll ) { } protected Map normalizeMap ( Map coll ) { Iterator iter = coll . keySet ( ) . iterator ( ) ; Map newColl = null ; while ( iter . hasNext ( ) ) { Object item = iter . next ( ) ; Object prop = coll . get ( item ) ; if ( newColl == null ) { try { newColl = ( ( Map ) ( coll . getClass ( ) . newInstance ( ) ) ) ; } catch ( Exception e ) { AbstractProperty . log . error ( "Bad<seq2seq4repair_space>collection" , e ) ; } } <START_BUG> newColl . put ( item , convertObject ( item ) ) ; <END_BUG> } if ( newColl != null ) { return newColl ; } else { return coll ; } } protected JMeterProperty convertObject ( Object item ) { } public String toString ( ) { } }

Fix:
newColl . put ( item , convertObject ( prop ) ) ;
Buggy code:
public class IterationCounter extends AbstractFunction implements Serializable { private static final long serialVersionUID = 232L ; private static final List desc = new LinkedList ( ) ; private static final String KEY = "__counter" ; private transient ThreadLocal perThreadInt ; private void init ( ) { } private transient Object [ ] variables ; private transient int globalCounter ; public IterationCounter ( ) { } private Object readResolve ( ) { } public Object clone ( ) throws CloneNotSupportedException { } public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { new Integer ( 1 ) ; ( globalCounter ) ++ ; JMeterVariables vars = getVariables ( ) ; boolean perThread = Boolean . valueOf ( ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( variables [ 0 ] ) ) . execute ( ) ) . booleanValue ( ) ; String varName = "" ; if ( ( variables . length ) >= 2 ) { <START_BUG> varName = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( variables [ 1 ] ) ) . execute ( ) ; <END_BUG> } String counterString = "" ; if ( perThread ) { int threadCounter ; threadCounter = ( ( ( Integer ) ( perThreadInt . get ( ) ) ) . intValue ( ) ) + 1 ; perThreadInt . set ( new Integer ( threadCounter ) ) ; counterString = String . valueOf ( threadCounter ) ; } else { counterString = String . valueOf ( globalCounter ) ; } if ( ( varName . length ( ) ) > 0 ) { vars . put ( varName , counterString ) ; } return counterString ; } public synchronized void setParameters ( Collection parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } }

Fix:
varName = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( variables [ 1 ] ) ) . execute ( ) . trim ( ) ;
Buggy code:
public abstract class ParentNode extends ChildNode { static final long serialVersionUID = 2815829867152120872L ; protected CoreDocumentImpl ownerDocument ; protected ChildNode firstChild = null ; protected transient NodeListCache fNodeListCache = null ; protected ParentNode ( CoreDocumentImpl ownerDocument ) { } public ParentNode ( ) { } public Node cloneNode ( boolean deep ) { } public Document getOwnerDocument ( ) { } CoreDocumentImpl ownerDocument ( ) { } protected void setOwnerDocument ( CoreDocumentImpl doc ) { } public boolean hasChildNodes ( ) { } public NodeList getChildNodes ( ) { } public Node getFirstChild ( ) { } public Node getLastChild ( ) { } final ChildNode lastChild ( ) { } final void lastChild ( ChildNode node ) { } public Node insertBefore ( Node newChild , Node refChild ) throws DOMException { } Node internalInsertBefore ( Node newChild , Node refChild , boolean replace ) throws DOMException { } public Node removeChild ( Node oldChild ) throws DOMException { } Node internalRemoveChild ( Node oldChild , boolean replace ) throws DOMException { } public Node replaceChild ( Node newChild , Node oldChild ) throws DOMException { } public String getTextContent ( ) throws DOMException { } void getTextContent ( StringBuffer buf ) throws DOMException { } final boolean hasTextContent ( Node child ) { } public void setTextContent ( String textContent ) throws DOMException { } private int nodeListGetLength ( ) { } public int getLength ( ) { } private Node nodeListItem ( int index ) { } public Node item ( int index ) { } protected final NodeList getChildNodesUnoptimized ( ) { } public void normalize ( ) { } public boolean isEqualNode ( Node arg ) { if ( ! ( super . isEqualNode ( arg ) ) ) { return false ; } Node child1 = getFirstChild ( ) ; Node child2 = arg . getFirstChild ( ) ; while ( ( child1 != null ) && ( child2 != null ) ) { <START_BUG> if ( ! ( ( ( NodeImpl ) ( child1 ) ) . isEqualNode ( child2 ) ) ) { <END_BUG> return false ; } child1 = child1 . getNextSibling ( ) ; child2 = child2 . getNextSibling ( ) ; } if ( child1 != child2 ) { return false ; } return true ; } public void setReadOnly ( boolean readOnly , boolean deep ) { } protected void synchronizeChildren ( ) { } void checkNormalizationAfterInsert ( ChildNode insertedChild ) { } void checkNormalizationAfterRemove ( ChildNode previousSibling ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } private void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } class UserDataRecord implements Serializable { private static final long serialVersionUID = 3258126977134310455L ; Object fData ; UserDataHandler fHandler ; UserDataRecord ( Object data , UserDataHandler handler ) { } } }

Fix:
if ( ! ( child1 . isEqualNode ( child2 ) ) ) {
Buggy code:
public class Name { private static final int LABEL_NORMAL = 0 ; private static final int LABEL_COMPRESSION = 192 ; private static final int LABEL_EXTENDED = 64 ; private static final int LABEL_MASK = 192 ; private static final int EXT_LABEL_BITSTRING = 1 ; private Object [ ] name ; private byte labels ; private boolean qualified ; public static final Name root = new Name ( "." ) ; static final int MAXLABELS = 128 ; private static final int STARTLABELS = 4 ; private static DecimalFormat byteFormat = new DecimalFormat ( ) ; private Name ( ) { } private final void grow ( int n ) { } private final void grow ( ) { } public Name ( String s , Name origin ) { } public Name ( String s ) { } public Name ( DataByteInputStream in , Compression c ) throws IOException { } public Name ( Name d , int n ) { } public Name wild ( int n ) { } public Name fromDNAME ( DNAMERecord dname ) { } public boolean isWild ( ) { } public boolean isQualified ( ) { } public void append ( Name d ) { } public short length ( ) { } public byte labels ( ) { } public boolean subdomain ( Name domain ) { } private String byteString ( byte [ ] array ) { } public String toString ( ) { } public String getLabelString ( int n ) { } public void toWire ( DataByteOutputStream out , Compression c ) throws IOException { } public void toWireCanonical ( DataByteOutputStream out ) throws IOException { } private static final byte toLower ( byte b ) { } public boolean equals ( Object arg ) { } public int hashCode ( ) { int code = labels ; for ( int i = 0 ; i < ( labels ) ; i ++ ) { if ( ( name [ i ] ) instanceof BitString ) { BitString b = ( ( BitString ) ( name [ i ] ) ) ; for ( int j = 0 ; j < ( b . bytes ( ) ) ; j ++ ) <START_BUG> code += ( code << 3 ) + ( b . data [ i ] ) ; <END_BUG> } else { byte [ ] b = ( ( byte [ ] ) ( name [ i ] ) ) ; for ( int j = 0 ; j < ( b . length ) ; j ++ ) code += ( code << 3 ) + ( Name . toLower ( b [ j ] ) ) ; } } return code ; } public int compareTo ( Object o ) { } }

Fix:
code += ( code << 3 ) + ( b . data [ j ] ) ;
Buggy code:
public class DisplayFormFragment extends Fragment { WebView webView ; ProgressBar progressBar ; private String formInputErrorMessage = "Form<seq2seq4repair_space>contains<seq2seq4repair_space>errors<seq2seq4repair_space>please<seq2seq4repair_space>try<seq2seq4repair_space>again" ; private static final String headerTemplate = "web//forms//header" ; private static final String footerTemplate = "web//forms//footer" ; private static final String scriptFile = "web//forms//js_include.js" ; private String formName ; public String getFormName ( ) { } public void setFormName ( String formName ) { } private String recordId ; private boolean javascriptLoaded = false ; private JSONObject fieldOverides = new JSONObject ( ) ; public JSONObject getFieldOverides ( ) { } public void setFieldOverides ( String overrides ) { } public String getRecordId ( ) { } public void setRecordId ( String recordId ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void initWebViewSettings ( ) { } public void loadHtml ( ) { } public String readFileAssets ( String fileName ) { } private void showProgressDialog ( ) { } String formData ; public void setFormData ( String data ) { } public void nullifyFormData ( ) { } public void loadFormData ( ) { new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { while ( ! ( javascriptLoaded ) ) { <START_BUG> Thread . sleep ( 1000 ) ; <END_BUG> } formData = ( ( ( formData ) != null ) && ( ! ( formData . isEmpty ( ) ) ) ) ? formData . replaceAll ( "\"" , "\\\"" ) : "" ; webView . post ( new Runnable ( ) { @ Override public void run ( ) { webView . loadUrl ( ( ( "javascript:loadDraft('" + ( formData ) ) + "')" ) ) ; Log . e ( "posting<seq2seq4repair_space>data" , formData ) ; } } ) ; } catch ( Exception doNothing ) { } } } ) . start ( ) ; } public static final String TAG = "DisplayFormFragment" ; private void dismissProgressDialog ( ) { } public JSONObject getFormFieldsOverrides ( ) { } public class AppWebViewClient extends WebViewClient { private View progressBar ; public AppWebViewClient ( ProgressBar progressBar ) { } @ Override public boolean shouldOverrideUrlLoading ( WebView view , String url ) { } @ Override public void onPageFinished ( WebView view , String url ) { } } public class MyJavaScriptInterface { Context mContext ; MyJavaScriptInterface ( Context c ) { } @ JavascriptInterface public void showFormErrorToast ( ) { } @ JavascriptInterface public void processFormSubmission ( String formSubmission ) { } @ JavascriptInterface public void javascriptLoaded ( ) { } } }

Fix:
Thread . sleep ( 100 ) ;
Buggy code:
public class AssertStatement extends Statement { public Expression assertExpression ; public Expression exceptionArgument ; int preAssertInitStateIndex = - 1 ; private FieldBinding assertionSyntheticFieldBinding ; public AssertStatement ( Expression exceptionArgument , Expression assertExpression , int startPosition ) { } public AssertStatement ( Expression assertExpression , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { this . preAssertInitStateIndex = currentScope . methodScope ( ) . recordInitializationStates ( flowInfo ) ; Constant cst = this . assertExpression . optimizedBooleanConstant ( ) ; if ( ( ( this . assertExpression . implicitConversion ) & ( TypeIds . UNBOXING ) ) != 0 ) { this . assertExpression . checkNPE ( currentScope , flowContext , flowInfo ) ; } boolean isOptimizedTrueAssertion = ( cst != ( Constant . NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == true ) ; boolean isOptimizedFalseAssertion = ( cst != ( Constant . NotAConstant ) ) && ( ( cst . booleanValue ( ) ) == false ) ; flowContext . tagBits |= FlowContext . HIDE_NULL_COMPARISON_WARNING ; FlowInfo conditionFlowInfo = this . assertExpression . analyseCode ( currentScope , flowContext , flowInfo . copy ( ) ) ; flowContext . tagBits &= ~ ( FlowContext . HIDE_NULL_COMPARISON_WARNING ) ; UnconditionalFlowInfo assertWhenTrueInfo = conditionFlowInfo . initsWhenTrue ( ) . unconditionalInits ( ) ; FlowInfo assertInfo = conditionFlowInfo . initsWhenFalse ( ) ; if ( isOptimizedTrueAssertion ) { assertInfo . setReachMode ( FlowInfo . UNREACHABLE ) ; } if ( ( this . exceptionArgument ) != null ) { FlowInfo exceptionInfo = this . exceptionArgument . analyseCode ( currentScope , flowContext , assertInfo . copy ( ) ) ; if ( isOptimizedTrueAssertion ) { currentScope . problemReporter ( ) . fakeReachable ( this . exceptionArgument ) ; } else { flowContext . checkExceptionHandlers ( currentScope . getJavaLangAssertionError ( ) , this , exceptionInfo , currentScope ) ; } } if ( ! isOptimizedTrueAssertion ) { manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; } if ( isOptimizedFalseAssertion ) { return flowInfo ; } else { CompilerOptions compilerOptions = currentScope . compilerOptions ( ) ; if ( ! ( compilerOptions . includeNullInfoFromAsserts ) ) { <START_BUG> return flowInfo . addInitializationsFrom ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) ; <END_BUG> } return flowInfo . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) . addInitializationsFrom ( assertWhenTrueInfo . discardInitializationInfo ( ) ) ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public void resolve ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int tab , StringBuffer output ) { } }

Fix:
return flowInfo . mergedWith ( assertInfo . nullInfoLessUnconditionalCopy ( ) ) ;
Buggy code:
public class HelloAction extends Action { static final Logger logger = Logger . getLogger ( HelloAction . class ) ; Layout layout ; public HelloAction ( ) { } public void begin ( ExecutionContext ec , String name , Attributes attributes ) { <START_BUG> String str = ( "Hello<seq2seq4repair_space>" + name ) + "." ; <END_BUG> ec . getObjectMap ( ) . put ( "hello" , str ) ; } public void end ( ExecutionContext ec , String name ) { } }

Fix:
String str = ( "Hello<seq2seq4repair_space>" + ( attributes . getValue ( "name" ) ) ) + "." ;
Buggy code:
public class TarArchiveOutputStreamTest extends AbstractTestCase { public void testCount ( ) throws Exception { } public void testMaxFileSizeError ( ) throws Exception { } public void testBigNumberStarMode ( ) throws Exception { } public void testBigNumberPosixMode ( ) throws Exception { } public void testWriteSimplePaxHeaders ( ) throws Exception { } public void testPaxHeadersWithLength99 ( ) throws Exception { } public void testPaxHeadersWithLength101 ( ) throws Exception { } private byte [ ] writePaxHeader ( Map < String , String > m ) throws Exception { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; TarArchiveOutputStream tos = new TarArchiveOutputStream ( bos , "ASCII" ) ; <START_BUG> tos . writePaxHeaders ( "foo" , m ) ; <END_BUG> TarArchiveEntry t = new TarArchiveEntry ( "foo" ) ; t . setSize ( ( 10 * 1024 ) ) ; tos . putArchiveEntry ( t ) ; tos . write ( new byte [ 10 * 1024 ] ) ; tos . closeArchiveEntry ( ) ; tos . close ( ) ; return bos . toByteArray ( ) ; } public void testWriteLongFileNamePosixMode ( ) throws Exception { } public void testOldEntryStarMode ( ) throws Exception { } public void testOldEntryPosixMode ( ) throws Exception { } public void testOldEntryError ( ) throws Exception { } public void testWriteNonAsciiPathNamePaxHeader ( ) throws Exception { } public void testWriteNonAsciiLinkPathNamePaxHeader ( ) throws Exception { } public void testRoundtripWith67CharFileNameGnu ( ) throws Exception { } public void testRoundtripWith67CharFileNamePosix ( ) throws Exception { } private void testRoundtripWith67CharFileName ( int mode ) throws Exception { } public void testWriteLongDirectoryNameErrorMode ( ) throws Exception { } public void testWriteLongDirectoryNameTruncateMode ( ) throws Exception { } public void testWriteLongDirectoryNameGnuMode ( ) throws Exception { } public void testWriteLongDirectoryNamePosixMode ( ) throws Exception { } private void testWriteLongDirectoryName ( int mode ) throws Exception { } public void testWriteNonAsciiDirectoryNamePosixMode ( ) throws Exception { } public void testWriteNonAsciiNameWithUnfortunateNamePosixMode ( ) throws Exception { } public void testWriteLongLinkNameErrorMode ( ) throws Exception { } public void testWriteLongLinkNameTruncateMode ( ) throws Exception { } public void testWriteLongLinkNameGnuMode ( ) throws Exception { } public void testWriteLongLinkNamePosixMode ( ) throws Exception { } public void testWriteLongLinkName ( int mode ) throws Exception { } public void testPadsOutputToFullBlockLength ( ) throws Exception { } public void testLongNameMd5Hash ( ) throws Exception { } private static byte [ ] createTarArchiveContainingOneDirectory ( String fname , Date modificationDate ) throws IOException { } }

Fix:
tos . writePaxHeaders ( new TarArchiveEntry ( "x" ) , "foo" , m ) ;
Buggy code:
public abstract class AbstractMonitoringInterceptor extends AbstractTraceInterceptor { private String prefix = "" ; private String suffix = "" ; private boolean logTargetClassInvocation = false ; public void setPrefix ( String prefix ) { } protected String getPrefix ( ) { } public void setSuffix ( String suffix ) { } protected String getSuffix ( ) { } public void setLogTargetClassInvocation ( boolean logTargetClassInvocation ) { } protected String createInvocationTraceName ( MethodInvocation invocation ) { <START_BUG> StringBuffer sb = new StringBuffer ( getPrefix ( ) ) ; <END_BUG> Method method = invocation . getMethod ( ) ; Class clazz = method . getDeclaringClass ( ) ; if ( ( this . logTargetClassInvocation ) && ( clazz . isInstance ( invocation . getThis ( ) ) ) ) { clazz = invocation . getThis ( ) . getClass ( ) ; } sb . append ( clazz . getName ( ) ) ; sb . append ( '.' ) . append ( method . getName ( ) ) ; sb . append ( getSuffix ( ) ) ; return sb . toString ( ) ; } }

Fix:
StringBuilder sb = new StringBuilder ( getPrefix ( ) ) ;
Buggy code:
public class Localizer { private ApplicationSettings settings ; public Localizer ( final ApplicationSettings settings ) { } public String getString ( final String key , final Component component , final IModel model , final Locale locale , final String style , final String defaultValue ) throws MissingResourceException { String string = null ; for ( Iterator it = settings . getStringResourceLoaders ( ) . iterator ( ) ; it . hasNext ( ) ; ) { IStringResourceLoader loader = ( ( IStringResourceLoader ) ( it . next ( ) ) ) ; <START_BUG> string = loader . get ( component , key , locale , style ) ; <END_BUG> if ( string != null ) { return substituteOgnl ( string , model ) ; } } if ( ( settings . getUseDefaultOnMissingResource ( ) ) && ( defaultValue != null ) ) { return defaultValue ; } if ( settings . getExceptionOnMissingResource ( ) ) { throw new MissingResourceException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>resource:<seq2seq4repair_space>" + key ) , getClass ( ) . getName ( ) , key ) ; } else { return ( "??" + key ) + "??" ; } } public String getString ( final String key , final Component component , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key , final Component component ) throws MissingResourceException { } public String getString ( final String key , final Component component , final IModel model , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key , final Component component , final IModel model ) throws MissingResourceException { } public String getString ( final String key , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key ) throws MissingResourceException { } public String getString ( final String key , final IModel model , final String defaultValue ) throws MissingResourceException { } public String getString ( final String key , final IModel model ) throws MissingResourceException { } private String substituteOgnl ( String string , final IModel model ) { } }

Fix:
string = loader . loadStringResource ( component , key , locale , style ) ;