nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CustomMapFragment extends Fragment implements OnMapReadyCallback { private final String LOG_TAG = "MAP<seq2seq4repair_space>FRAGMENT<seq2seq4repair_space>LOG<seq2seq4repair_space>TAG" ; private EditText searchCriteria ; private Button searchButton ; private TextView distanceLabel ; private GoogleMap map = null ; private String distance ; private ArrayList < SimpleMarker > markers = new ArrayList < > ( ) ; private SupportMapFragment mapFragment ; private FragmentManager fragmentManager ; public static final String MARKERS_BUNDLE_KEY = "markers_key" ; public static final String DISTANCE_BUNDLE_KEY = "distance_key" ; private OnSearchStartedListener onSearchStartedListener ; public static CustomMapFragment newInstance ( String markersJson , String distance ) { } public CustomMapFragment ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } public void setMarkerList ( ArrayList < SimpleMarker > newMarkers ) { } public void placeMarkers ( ArrayList < SimpleMarker > newMarkers ) { Log . e ( LOG_TAG , "Placing<seq2seq4repair_space>markers!!!!" ) ; Log . e ( LOG_TAG , ( "Markers<seq2seq4repair_space>size<seq2seq4repair_space>=<seq2seq4repair_space>" + ( markers . size ( ) ) ) ) ; <START_BUG> setMarkerList ( markers ) ; <END_BUG> if ( ( map ) != null ) { map . clear ( ) ; LatLngBounds . Builder builder = new LatLngBounds . Builder ( ) ; for ( SimpleMarker marker : newMarkers ) { map . addMarker ( new MarkerOptions ( ) . position ( marker . getPosition ( ) ) . title ( marker . getTitle ( ) ) ) ; builder . include ( marker . getPosition ( ) ) ; } LatLngBounds bounds = builder . build ( ) ; int padding = 50 ; CameraUpdate cu = CameraUpdateFactory . newLatLngBounds ( bounds , padding ) ; map . animateCamera ( cu ) ; } else { Log . e ( LOG_TAG , "Map<seq2seq4repair_space>not<seq2seq4repair_space>available!!!!!" ) ; } } @ Override public void onAttach ( Activity activity ) { } @ Override public void onDetach ( ) { } private void setClickListeners ( ) { } private void startFourSquareSearch ( ) { } public void updateDistance ( String distance ) { } @ Override public void onMapReady ( GoogleMap googleMap ) { } }

Fix:
setMarkerList ( newMarkers ) ;
Buggy code:
@ ParametersAreNonnullByDefault public class TreeDepthTabPresenter extends BasePresenter < TreeDepthTabView > { private final GuiTaskRunner taskRunner ; private final MainWindowView mainView ; private final CsvTraceModel model ; @ VisibleForTesting int startLine = 1 ; @ VisibleForTesting int visibleLines = 25 ; public TreeDepthTabPresenter ( final GuiTaskRunner taskRunner , final MainWindowView mainView , final CsvTraceModel model ) { } @ Override public void load ( ) { } @ Override protected void init ( ) { } public void handleChangeVisibleLines ( final int visibleLines ) { this . visibleLines = visibleLines ; <START_BUG> refreshChart ( ) ; <END_BUG> } public void handleChangeStartLine ( final int startLine ) { } public void handlePreviousLines ( ) { } public void handleNextLines ( ) { } public void handleChartRefresh ( ) { } @ VisibleForTesting void refreshChart ( ) { } @ VisibleForTesting void doRefreshChart ( final int startLine , final int visibleLines ) { } @ VisibleForTesting void handleRefreshChartError ( final Throwable throwable ) { } public void updateToolbar ( final int startLine , final int visibleLines ) { } }

Fix:
handleChangeStartLine ( startLine ) ;
Buggy code:
public class DocumentTypeImpl extends ChildAndParentNode implements DocumentType { static final long serialVersionUID = 7751299192316526485L ; protected String name ; protected NamedNodeMapImpl entities ; protected NamedNodeMapImpl notations ; protected NamedNodeMapImpl elements ; protected String publicID ; protected String systemID ; protected String internalSubset ; public DocumentTypeImpl ( DocumentImpl ownerDocument , String name ) { } public DocumentTypeImpl ( DocumentImpl ownerDocument , String qualifiedName , String publicID , String systemID ) { } public String getPublicId ( ) { } public String getSystemId ( ) { } public void setInternalSubset ( String internalSubset ) { } public String getInternalSubset ( ) { } public short getNodeType ( ) { } public String getNodeName ( ) { } public Node cloneNode ( boolean deep ) { } void setOwnerDocument ( DocumentImpl doc ) { } public String getName ( ) { } public NamedNodeMap getEntities ( ) { } public NamedNodeMap getNotations ( ) { } public void setReadOnly ( boolean readOnly , boolean deep ) { if ( needsSyncChildren ( ) ) { synchronizeChildren ( ) ; } <START_BUG> setReadOnly ( readOnly , deep ) ; <END_BUG> elements . setReadOnly ( readOnly , true ) ; entities . setReadOnly ( readOnly , true ) ; notations . setReadOnly ( readOnly , true ) ; } public NamedNodeMap getElements ( ) { } }

Fix:
super . setReadOnly ( readOnly , deep ) ;
Buggy code:
public class TestDocumentWriter extends LuceneTestCase { private Directory dir ; @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } public void test ( ) { } public void testAddDocument ( ) throws Exception { Document testDoc = new Document ( ) ; DocHelper . setupDoc ( testDoc ) ; IndexWriter writer = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new MockAnalyzer ( random ( ) ) ) ) ; writer . addDocument ( testDoc ) ; writer . commit ( ) ; SegmentInfoPerCommit info = writer . newestSegment ( ) ; writer . close ( ) ; SegmentReader reader = new SegmentReader ( info , DirectoryReader . DEFAULT_TERMS_INDEX_DIVISOR , newIOContext ( random ( ) ) ) ; assertTrue ( ( reader != null ) ) ; StoredDocument doc = reader . document ( 0 ) ; assertTrue ( ( doc != null ) ) ; StorableField [ ] fields = doc . getFields ( "textField2" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_2_TEXT ) ) ; assertTrue ( fields [ 0 ] . fieldType ( ) . storeTermVectors ( ) ) ; fields = doc . getFields ( "textField1" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_1_TEXT ) ) ; assertFalse ( fields [ 0 ] . fieldType ( ) . storeTermVectors ( ) ) ; fields = doc . getFields ( "keyField" ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( KEYWORD_TEXT ) ) ; fields = doc . getFields ( NO_NORMS_KEY ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( NO_NORMS_TEXT ) ) ; fields = doc . getFields ( TEXT_FIELD_3_KEY ) ; assertTrue ( ( ( fields != null ) && ( ( fields . length ) == 1 ) ) ) ; assertTrue ( fields [ 0 ] . stringValue ( ) . equals ( FIELD_3_TEXT ) ) ; for ( FieldInfo fi : reader . getFieldInfos ( ) ) { if ( fi . isIndexed ( ) ) { <START_BUG> assertTrue ( ( ( fi . omitsNorms ( ) ) == ( ( reader . normValues ( fi . name ) ) == null ) ) ) ; <END_BUG> } } reader . close ( ) ; } public void testPositionIncrementGap ( ) throws IOException { } public void testTokenReuse ( ) throws IOException { } public void testPreAnalyzedField ( ) throws IOException { } public void testMixedTermVectorSettingsSameField ( ) throws Exception { } public void testLUCENE_1590 ( ) throws Exception { } }

Fix:
assertTrue ( ( ( fi . omitsNorms ( ) ) == ( ( reader . getNormValues ( fi . name ) ) == null ) ) ) ;
Buggy code:
public class MySQLMessage implements MessageDao { private String dbUrl ; private String user ; private String password ; private Connection conn ; private Statement statement ; private ResultSet results ; public MySQLMessage ( ) { } @ Override public void open ( ) { } @ Override public void close ( ) { } @ Override public Message getMessage ( int id ) { } @ Override public List < Message > getMessages ( String username ) { } @ Override public void saveMessage ( Message message ) { } @ Override public void deleteMessage ( int id ) { } @ Override public void updateMessage ( Message message ) { open ( ) ; String sql = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "UPDATE<seq2seq4repair_space>message<seq2seq4repair_space>" + ( "SET<seq2seq4repair_space>" + "subject<seq2seq4repair_space>=<seq2seq4repair_space>'" ) ) + ( message . getSubject ( ) ) ) + "',<seq2seq4repair_space>" ) + "body<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + ( message . getBody ( ) ) ) + "',<seq2seq4repair_space>" ) + "sent_date<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + ( message . getSent_date ( ) ) ) + "',<seq2seq4repair_space>" ) + "sent_from<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( message . getSent_from ( ) ) ) + ",<seq2seq4repair_space>" ) + "recieved_by<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( message . getRecieved_by ( ) ) ) + ",<seq2seq4repair_space>" ) + "in_reply_to<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( message . getIn_reply_to ( ) ) ) + ",<seq2seq4repair_space>" ) + "display<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( message . getDisplay ( ) ) ) + "<seq2seq4repair_space>" ) + "WHERE<seq2seq4repair_space>" ) + "id<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( message . getId ( ) ) ; try { <START_BUG> statement . executeQuery ( sql ) ; <END_BUG> } catch ( SQLException ex ) { Logger . getLogger ( MySQLMessage . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } close ( ) ; } @ Override public String printStatement ( Message message ) { } }

Fix:
statement . executeUpdate ( sql ) ;
Buggy code:
public class HistoryHandler extends CommandHandlerWithHelp { private final ArgumentWithoutValue clear ; private final ArgumentWithoutValue disable ; private final ArgumentWithoutValue enable ; public HistoryHandler ( ) { } public HistoryHandler ( String command ) { } @ Override protected void doHandle ( CommandContext ctx ) throws CommandFormatException { ParsedCommandLine args = ctx . getParsedCommandLine ( ) ; if ( ! ( args . hasProperties ( ) ) ) { HistoryHandler . printHistory ( ctx ) ; return ; } if ( clear . isPresent ( args ) ) { ctx . getHistory ( ) . clear ( ) ; } else if ( disable . isPresent ( args ) ) { ctx . getHistory ( ) . setUseHistory ( false ) ; } else if ( enable . isPresent ( args ) ) { ctx . getHistory ( ) . setUseHistory ( true ) ; } else { <START_BUG> ctx . error ( ( ( "Unexpected<seq2seq4repair_space>argument<seq2seq4repair_space>'" + ( ctx . getArgumentsString ( ) ) ) + '\'' ) ) ; <END_BUG> } } private static void printHistory ( CommandContext ctx ) { } }

Fix:
throw new CommandFormatException ( ( ( "Unexpected<seq2seq4repair_space>argument<seq2seq4repair_space>'" + ( ctx . getArgumentsString ( ) ) ) + '\'' ) ) ;
Buggy code:
public class KeepDisposableStatsPropertyTest extends BaseJDBCTestCase { public KeepDisposableStatsPropertyTest ( String name ) { } public void testPropertyFalse ( ) throws SQLException { } public void testPropertyTrue ( ) throws SQLException { } public void testPropertyDefault ( ) throws SQLException { } private void assertOnSCUI ( boolean keepDisposable ) throws SQLException { } public static Test suite ( ) { <START_BUG> String property = "derby.storage.indexStats.debug.forceOldBehavior" ; <END_BUG> TestSuite suite = new TestSuite ( "KeepDisposableStatsPropertyTestSuite" ) ; suite . addTest ( new KeepDisposableStatsPropertyTest ( "testPropertyDefault" ) ) ; Properties propsOn = new Properties ( ) ; propsOn . setProperty ( property , "true" ) ; TestSuite suiteOn = new TestSuite ( "Do<seq2seq4repair_space>KeepDisposableStats" ) ; suiteOn . addTest ( new KeepDisposableStatsPropertyTest ( "testPropertyTrue" ) ) ; suite . addTest ( new org . apache . derbyTesting . junit . SystemPropertyTestSetup ( suiteOn , propsOn , true ) ) ; Properties propsOff = new Properties ( ) ; propsOff . setProperty ( property , "false" ) ; TestSuite suiteOff = new TestSuite ( "Don't<seq2seq4repair_space>KeepDisposableStats" ) ; suiteOff . addTest ( new KeepDisposableStatsPropertyTest ( "testPropertyFalse" ) ) ; suite . addTest ( new org . apache . derbyTesting . junit . SystemPropertyTestSetup ( suiteOff , propsOff , true ) ) ; return suite ; } }

Fix:
String property = "derby.storage.indexStats.debug.keepDisposableStats" ;
Buggy code:
public class AutoWebApp extends BaseInterceptor { int debug = 0 ; Hashtable hosts = new Hashtable ( ) ; String appsD = "webapps" ; String defaultHost = null ; boolean flat = true ; boolean ignoreDot = true ; char hostSeparator = '@' ; char dotReplacement = '_' ; char slashReplacement = '_' ; public AutoWebApp ( ) { } public void setDir ( String d ) { } public void setHost ( String h ) { } public void setIngoreDot ( boolean b ) { } public void setFlat ( boolean b ) { } public void engineInit ( ContextManager cm ) throws TomcatException { Enumeration loadedCtx = cm . getContexts ( ) ; while ( loadedCtx . hasMoreElements ( ) ) { Context ctx = ( ( Context ) ( loadedCtx . nextElement ( ) ) ) ; String host = ctx . getHost ( ) ; if ( host == null ) host = "DEFAULT" ; Hashtable loaded = ( ( Hashtable ) ( hosts . get ( host ) ) ) ; if ( loaded == null ) { loaded = new Hashtable ( ) ; hosts . put ( host , loaded ) ; } loaded . put ( ctx . getPath ( ) , ctx ) ; } String home = cm . getHome ( ) ; File webappD ; if ( appsD . startsWith ( "//" ) ) webappD = new File ( appsD ) ; else webappD = new File ( ( ( home + "//" ) + ( appsD ) ) ) ; if ( ( ! ( webappD . exists ( ) ) ) || ( ! ( webappD . isDirectory ( ) ) ) ) { log ( ( "No<seq2seq4repair_space>autoconf<seq2seq4repair_space>directory<seq2seq4repair_space>" + webappD ) ) ; return ; } String [ ] list = webappD . list ( ) ; if ( flat ) { for ( int i = 0 ; i < ( list . length ) ; i ++ ) { String name = list [ i ] ; if ( ( ignoreDot ) && ( name . startsWith ( "." ) ) ) continue ; File f = new File ( webappD , name ) ; if ( f . isDirectory ( ) ) { String appHost = defaultHost ; if ( ( defaultHost ) == null ) { int idx = name . indexOf ( hostSeparator ) ; if ( idx > 0 ) { appHost = name . substring ( 0 , idx ) ; name = name . substring ( idx ) ; } } if ( appHost == null ) appHost = "DEFAULT" ; addWebApp ( cm , f , appHost , name ) ; } } } else { for ( int i = 0 ; i < ( list . length ) ; i ++ ) { String name = list [ i ] ; File f = new File ( webappD , name ) ; if ( f . isDirectory ( ) ) { <START_BUG> if ( ( ignoreDot ) && ( name . statsWith ( "." ) ) ) { <END_BUG> continue ; } else addVHost ( cm , webappD , name ) ; } } } } private void addWebApp ( ContextManager cm , File dir , String host , String name ) throws TomcatException { } private void addVHost ( ContextManager cm , File dir , String host ) throws TomcatException { } private String unEscapeHost ( String hostName ) { } private String unEscapePath ( String pathDir ) { } private String unEscapeString ( String s , char esc , char repl ) { } }

Fix:
if ( ( ignoreDot ) && ( name . startsWith ( "." ) ) ) {
Buggy code:
public final class CommonEntity { public static CreatureType getCreatureType ( Entity e ) { } public static Material getVehicleType ( Entity e ) { } public static Material getProjectileType ( Entity e ) { } public static int getCreatureData ( Entity entity ) { switch ( CommonEntity . getCreatureType ( entity ) ) { case CREEPER : return ( ( Creeper ) ( entity ) ) . isPowered ( ) ? 1 : 0 ; case PIG : return ( ( Pig ) ( entity ) ) . hasSaddle ( ) ? 1 : 0 ; case SHEEP : <START_BUG> return ( ( ( Sheep ) ( entity ) ) . getColor ( ) . getData ( ) ) + ( ( ( Sheep ) ( entity ) ) . isSheared ( ) ? 16 : 0 ) ; <END_BUG> case SLIME : return ( ( Slime ) ( entity ) ) . getSize ( ) ; case WOLF : return ( ( Wolf ) ( entity ) ) . isAngry ( ) ? 1 : ( ( Wolf ) ( entity ) ) . isTamed ( ) ? 2 : 0 ; case PIG_ZOMBIE : return ( ( PigZombie ) ( entity ) ) . getAnger ( ) ; default : return 0 ; } } public static Material getExplosiveType ( Entity e ) { } }

Fix:
return ( ( ( Sheep ) ( entity ) ) . getColor ( ) . getData ( ) ) + ( ( ( Sheep ) ( entity ) ) . isSheared ( ) ? 32 : 0 ) ;
Buggy code:
public class Delay extends NestedRoutine { protected final DynamicInteger delay ; protected final List < Routine > routines ; protected static final Pattern delayPattern = Pattern . compile ( "delay\\.(.*)" , Pattern . CASE_INSENSITIVE ) ; public Delay ( String configString , DynamicInteger delayValue , List < Routine > routines ) { } @ Override public void run ( TargetEventInfo eventInfo ) { } public static void register ( ) { } protected static class RoutineBuilder extends NestedRoutine . RoutineBuilder { @ Override public Delay getNew ( Matcher matcher , Object nestedContent ) { if ( ( matcher != null ) && ( nestedContent != null ) ) { if ( matcher . matches ( ) ) { ModDamage . addToLogRecord ( CONSOLE_ONLY , "" ) ; ModDamage . addToLogRecord ( INFO , ( ( "Delay:<seq2seq4repair_space>\"" + ( matcher . group ( ) ) ) + "\"" ) ) ; List < Routine > routines = new ArrayList < Routine > ( ) ; <START_BUG> if ( ! ( RoutineAliaser . parseRoutines ( routines , nestedContent ) ) ) { <END_BUG> DynamicInteger numberMatch = DynamicInteger . getNew ( matcher . group ( 1 ) ) ; if ( numberMatch != null ) { ModDamage . addToLogRecord ( INFO_VERBOSE , ( ( "End<seq2seq4repair_space>Delay<seq2seq4repair_space>\"" + ( matcher . group ( ) ) ) + "\"\n" ) ) ; return new Delay ( matcher . group ( ) , numberMatch , routines ) ; } else ModDamage . addToLogRecord ( FAILURE , ( ( "Invalid<seq2seq4repair_space>Delay<seq2seq4repair_space>\"" + ( matcher . group ( ) ) ) + "\"" ) ) ; } } } return null ; } } private class DelayedRunnable implements Runnable { private final TargetEventInfo eventInfo ; private DelayedRunnable ( TargetEventInfo eventInfo ) { } @ Override public void run ( ) { } } }

Fix:
if ( RoutineAliaser . parseRoutines ( routines , nestedContent ) ) {
Buggy code:
public class MyStories extends JUnitStories { public MyStories ( ) { } @ Override public Configuration configuration ( ) { Class < ? extends Embeddable > embeddableClass = this . getClass ( ) ; ParameterConverters parameterConverters = new ParameterConverters ( ) ; ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory ( new LocalizedKeywords ( ) , new LoadFromClasspath ( embeddableClass ) , parameterConverters ) ; parameterConverters . addConverters ( new DateConverter ( new SimpleDateFormat ( "yyyy-MM-dd" ) ) , new org . jbehave . core . steps . ParameterConverters . ExamplesTableConverter ( examplesTableFactory ) ) ; <START_BUG> return new MostUsefulConfiguration ( ) . useStoryLoader ( new LoadFromClasspath ( embeddableClass ) ) . useStoryParser ( new org . jbehave . core . parsers . RegexStoryParser ( examplesTableFactory ) ) . useViewGenerator ( new FreemarkerViewGenerator ( ) ) . useStoryReporterBuilder ( new StoryReporterBuilder ( ) . withCodeLocation ( CodeLocations . codeLocationFromClass ( embeddableClass ) ) . withDefaultFormats ( ) . withFormats ( CONSOLE , TXT , FORMAT , XML ) ) . useParameterConverters ( parameterConverters ) ; <END_BUG> } @ Override public InjectableStepsFactory stepsFactory ( ) { } @ Override protected List < String > storyPaths ( ) { } No newline ; at end ; of file ; }

Fix:
return new MostUsefulConfiguration ( ) . useStoryLoader ( new LoadFromClasspath ( embeddableClass ) ) . useStoryParser ( new org . jbehave . core . parsers . RegexStoryParser ( examplesTableFactory ) ) . useViewGenerator ( new FreemarkerViewGenerator ( ) ) . useStoryReporterBuilder ( new StoryReporterBuilder ( ) . withCodeLocation ( CodeLocations . codeLocationFromClass ( embeddableClass ) ) . withDefaultFormats ( ) . withFormats ( CONSOLE , TXT , HTML , XML ) ) . useParameterConverters ( parameterConverters ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class ClientCompatibilityUnitTestCase { @ Deployment public static final Archive fakeDeployment ( ) { } private static final String [ ] excludes = new String [ ] { "org.jboss.threads:jboss-threads" , "org.jboss:jboss-dmr" , "org.jboss.logging:jboss-logging" } ; private static final Archive deployment ; @ Test @ Ignore ( "WFLY-1284" ) public void test700Final ( ) throws Exception { } @ Test @ Ignore ( "WFLY-1284" ) public void test701Final ( ) throws Exception { } @ Test public void test710Final ( ) throws Exception { } @ Test public void test711Final ( ) throws Exception { } @ Test public void test720Final ( ) throws Exception { } @ Test public void testCurrent ( ) throws Exception { <START_BUG> test ( Factory . create ( "remote" , "localhost" , 9999 ) ) ; <END_BUG> } protected void test ( final String version ) throws Exception { } protected void test ( final ModelControllerClient client ) throws Exception { } protected static ModelControllerClient createClient ( final String version , final String host , final int port ) throws Exception { } }

Fix:
test ( Factory . create ( "localhost" , 9999 ) ) ;
Buggy code:
public class Uploader extends JApplet { private static final long serialVersionUID = - 935122463834512061L ; private static final String newline = "\r\n" ; private static final String boundary = Long . toHexString ( new Random ( ) . nextLong ( ) ) ; private static final String ENCODING = "UTF-8" ; private ImagePanel canvas ; private JButton attachButton ; protected URLStreamHandler streamHandler ; public static void main ( String [ ] args ) { } public void init ( ) { } private void attachImage ( ) { } private String sendContentToServer ( String url , BufferedImage image ) throws IOException { URL destURL = new URL ( url ) ; HttpURLConnection urlConn = ( ( HttpURLConnection ) ( destURL . openConnection ( ) ) ) ; urlConn . setRequestMethod ( "POST" ) ; urlConn . setDoOutput ( true ) ; urlConn . setDoInput ( true ) ; urlConn . setUseCaches ( false ) ; urlConn . setAllowUserInteraction ( false ) ; urlConn . setRequestProperty ( "Content-type" , ( "multipart//form-data;<seq2seq4repair_space>boundary=" + ( Uploader . boundary ) ) ) ; OutputStream outStream = urlConn . getOutputStream ( ) ; try { outStream . write ( ( ( "--" + ( Uploader . boundary ) ) + "\r\n" ) . getBytes ( "UTF-8" ) ) ; outStream . write ( ( ( "Content-Disposition:<seq2seq4repair_space>form-data;<seq2seq4repair_space>name=\"key\"\r\n\r\n" + ( getParameter ( "rss.key" ) ) ) + "\r\n" ) . getBytes ( "UTF-8" ) ) ; outStream . write ( ( ( "--" + ( Uploader . boundary ) ) + "\r\n" ) . getBytes ( "UTF-8" ) ) ; outStream . write ( "Content-Disposition:<seq2seq4repair_space>file;<seq2seq4repair_space>name=\"attachments\";<seq2seq4repair_space>filename=\"screenshot.png\"\r\nContent-Type:<seq2seq4repair_space>image//png\r\nContent-Transfer-Encoding:<seq2seq4repair_space>binary\r\n\r\n" . getBytes ( "UTF-8" ) ) ; ImageIO . write ( image , "png" , outStream ) ; <START_BUG> outStream . write ( ( ( "\r\n--" + ( Uploader . boundary ) ) + "\r\n" ) . getBytes ( "UTF-8" ) ) ; <END_BUG> } finally { outStream . close ( ) ; } BufferedReader in = new BufferedReader ( new InputStreamReader ( urlConn . getInputStream ( ) ) ) ; try { String str = in . readLine ( ) ; return str ; } finally { in . close ( ) ; } } private void closeApplet ( ) { } private void pasteImageFromClipboard ( ) { } private final String getParameter ( String key , String def ) { } }

Fix:
outStream . write ( ( ( "\r\n--" + ( Uploader . boundary ) ) + "--\r\n" ) . getBytes ( "UTF-8" ) ) ;
Buggy code:
public class SocketForwardingWebsocketClient implements NettyWebsocketClient { static Logger log = LoggerFactory . getLogger ( SocketForwardingWebsocketClient . class ) ; Channel socketChannel ; Channel websocketChannel ; long totalBytesOut ; long totalBytesIn ; long intervalBytesOut ; long intervalBytesIn ; public SocketForwardingWebsocketClient ( Channel socketChannel ) { } public Channel getSocketChannel ( ) { } public Channel getWebsocketChannel ( ) { } public void setWebsocketChannel ( Channel websocketChannel ) { this . websocketChannel = websocketChannel ; <START_BUG> websocketChannel . setAttachment ( socketChannel ) ; <END_BUG> socketChannel . setAttachment ( this ) ; } @ Override public void open ( ) { } @ Override public void close ( ) { } public void reportOutputBytes ( int count ) { } public void reportInputBytes ( int count ) { } @ Override public long getTotalBytesIn ( ) { } @ Override public long getTotalBytesOut ( ) { } @ Override public void frameReceived ( WebSocketFrame msg ) { } }

Fix:
websocketChannel . setAttachment ( this ) ;
Buggy code:
abstract class AbstractPriceImpl implements Price { protected static final float EPSILON = 1.0E-5F ; @ Override public boolean equals ( Object o ) { if ( ( this ) == o ) return true ; <START_BUG> if ( ( o == null ) || ( o instanceof AbstractPriceImpl ) ) <END_BUG> return false ; Price that = ( ( Price ) ( o ) ) ; if ( ! ( getCurrency ( ) . equals ( that . getCurrency ( ) ) ) ) { return false ; } if ( ( Math . abs ( ( ( getPrice ( ) . floatValue ( ) ) - ( that . getPrice ( ) . floatValue ( ) ) ) ) ) > ( AbstractPriceImpl . EPSILON ) ) { return false ; } if ( ! ( getCurrencyFormattedPrice ( ) . equals ( that . getCurrencyFormattedPrice ( ) ) ) ) { return false ; } return true ; } @ Override public int hashCode ( ) { } }

Fix:
if ( ( o == null ) || ( ! ( o instanceof AbstractPriceImpl ) ) )
Buggy code:
public class Image extends WebComponent implements IResourceListener { private final LocalizedImageResource localizedImageResource = new LocalizedImageResource ( this ) ; public Image ( final String id ) { } public Image ( final String id , final SharedResource namedResource ) { } public Image ( final String id , final ImageResource imageResource ) { } public Image ( final String id , final IModel model ) { } public Image ( final String id , final String string ) { } public void onResourceRequested ( ) { } public void setImageResource ( final ImageResource imageResource ) { } public void setImageResource ( final SharedResource sharedResource ) { } protected Resource getImageResource ( ) { } protected IModel initModel ( ) { } protected void onComponentTag ( final ComponentTag tag ) { } protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { } protected void onSessionAttach ( ) { <START_BUG> localizedImageResource . sessionAttach ( ) ; <END_BUG> } }

Fix:
localizedImageResource . bind ( ) ;
Buggy code:
class HazelcastAsyncMultiMap < K , V > implements EntryListener < K , V > , AsyncMultiMap < K , V > { private static final Logger log = LoggerFactory . getLogger ( HazelcastAsyncMultiMap . class ) ; private final Vertx vertx ; private final MultiMap < K , V > map ; private ConcurrentMap < K , ChoosableSet < V > > cache = new ConcurrentHashMap < > ( ) ; public HazelcastAsyncMultiMap ( Vertx vertx , MultiMap < K , V > map ) { } @ Override public void removeAllForValue ( V val , Handler < AsyncResult < Void > > completionHandler ) { } @ Override public void add ( K k , V v , Handler < AsyncResult < Void > > completionHandler ) { } @ Override public void get ( K k , Handler < AsyncResult < ChoosableIterable < V > > > resultHandler ) { } @ Override public void remove ( K k , V v , Handler < AsyncResult < Boolean > > completionHandler ) { <START_BUG> vertx . executeBlocking ( ( fut ) -> fut . complete ( map . remove ( k , v ) ) , completionHandler ) ; <END_BUG> } @ Override public void entryAdded ( EntryEvent < K , V > entry ) { } private void addEntry ( K k , V v ) { } @ Override public void entryRemoved ( EntryEvent < K , V > entry ) { } private void removeEntry ( K k , V v ) { } @ Override public void entryUpdated ( EntryEvent < K , V > entry ) { } @ Override public void entryEvicted ( EntryEvent < K , V > entry ) { } @ Override public void mapEvicted ( MapEvent mapEvent ) { } @ Override public void mapCleared ( MapEvent mapEvent ) { } }

Fix:
vertx . executeBlocking ( ( fut ) -> fut . complete ( map . remove ( k , HazelcastServerID . convertServerID ( v ) ) ) , completionHandler ) ;
Buggy code:
public final class MultiFields extends Fields { private final Fields [ ] subs ; private final ReaderSlice [ ] subSlices ; private final Map < String , Terms > terms = new ConcurrentHashMap < String , Terms > ( ) ; public static Fields getFields ( IndexReader reader ) throws IOException { } public static Bits getLiveDocs ( IndexReader reader ) { } public static Terms getTerms ( IndexReader r , String field ) throws IOException { } public static DocsEnum getTermDocsEnum ( IndexReader r , Bits liveDocs , String field , BytesRef term ) throws IOException { <START_BUG> return MultiFields . getTermDocsEnum ( r , liveDocs , field , term ) ; <END_BUG> } public static DocsEnum getTermDocsEnum ( IndexReader r , Bits liveDocs , String field , BytesRef term , int flags ) throws IOException { } public static DocsAndPositionsEnum getTermPositionsEnum ( IndexReader r , Bits liveDocs , String field , BytesRef term ) throws IOException { } public static DocsAndPositionsEnum getTermPositionsEnum ( IndexReader r , Bits liveDocs , String field , BytesRef term , int flags ) throws IOException { } public MultiFields ( Fields [ ] subs , ReaderSlice [ ] subSlices ) { } @ Override public FieldsEnum iterator ( ) throws IOException { } @ Override public Terms terms ( String field ) throws IOException { } @ Override public int size ( ) { } public static long totalTermFreq ( IndexReader r , String field , BytesRef text ) throws IOException { } public static FieldInfos getMergedFieldInfos ( IndexReader reader ) { } public static Collection < String > getIndexedFields ( IndexReader reader ) { } }

Fix:
return MultiFields . getTermDocsEnum ( r , liveDocs , field , term , FLAG_FREQS ) ;
Buggy code:
public class DeferredResultTests { @ Test public void setResult ( ) { } @ Test public void setResultTwice ( ) { } @ Test public void isSetOrExpired ( ) { } @ Test public void onCompletion ( ) throws Exception { } @ Test public void onTimeout ( ) throws Exception { final StringBuilder sb = new StringBuilder ( ) ; DeferredResultHandler handler = createMock ( DeferredResultHandler . class ) ; handler . handleResult ( "timeout<seq2seq4repair_space>result" ) ; replay ( handler ) ; DeferredResult < String > result = new DeferredResult < String > ( null , "timeout<seq2seq4repair_space>result" ) ; result . setResultHandler ( handler ) ; result . onTimeout ( new Runnable ( ) { public void run ( ) { sb . append ( "timeout<seq2seq4repair_space>event" ) ; } } ) ; <START_BUG> result . getInterceptor ( ) . afterTimeout ( null , null ) ; <END_BUG> assertEquals ( "timeout<seq2seq4repair_space>event" , sb . toString ( ) ) ; assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>able<seq2seq4repair_space>to<seq2seq4repair_space>set<seq2seq4repair_space>result<seq2seq4repair_space>a<seq2seq4repair_space>second<seq2seq4repair_space>time" , result . setResult ( "hello" ) ) ; verify ( handler ) ; } }

Fix:
result . getInterceptor ( ) . handleTimeout ( null , null ) ;
Buggy code:
public class TransferImpl implements Transfer { private String data ; public TransferImpl ( String data ) { } @ Override public String getData ( ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return data ;
Buggy code:
class StubProcessor { private static final Logger logger = Logger . get ( StubProcessor . class ) ; private final StubMap stubMap ; protected StubProcessor ( StubMap stubMap ) { } protected void addStub ( Stub stub ) { } private Stub searchStubForInvocation ( List < Stub > stubs , Invocation invocation ) { StubProcessor . logger . trace ( "searchStubForInvocation" , "stubs=" , stubs , "invocation=" , invocation ) ; for ( int index = ( stubs . size ( ) ) - 1 ; index >= 0 ; index -- ) { Stub stub = stubs . get ( index ) ; <START_BUG> StubProcessor . logger . trace ( "searchStubForInvocation" , "cheking<seq2seq4repair_space>stub" , stub , "against<seq2seq4repair_space>invocation" , invocation ) ; <END_BUG> if ( stub . valueIsCompatibleWith ( invocation ) ) { StubProcessor . logger . trace ( "searchStubForInvocation" , "stub<seq2seq4repair_space>matches" ) ; return stub ; } } return null ; } public InvocationResultProvider invoke ( Invocation invocation ) { } }

Fix:
StubProcessor . logger . trace ( "searchStubForInvocation" , "checking<seq2seq4repair_space>stub" , stub , "against<seq2seq4repair_space>invocation" , invocation ) ;
Buggy code:
public class AjaxTimerBehaviorTest extends WicketTestCase { private static final Logger log = LoggerFactory . getLogger ( AjaxTimerBehaviorTest . class ) ; public void testAddToAjaxUpdate ( ) { } public void testAddToWebPage ( ) { } private void validate ( AjaxTimerBehaviorTest . MyAjaxSelfUpdatingTimerBehavior timer , boolean inBodyOnLoad ) { } private void validateTimerScript ( String document , String updateScript ) { } private static final String quote ( String s ) { int slashEIndex = s . indexOf ( "\\E" ) ; if ( slashEIndex == ( - 1 ) ) { return ( "\\Q" + s ) + "\\E" ; } <START_BUG> StringBuffer sb = new StringBuffer ( ( ( s . length ( ) ) * 2 ) ) ; <END_BUG> sb . append ( "\\Q" ) ; slashEIndex = 0 ; int current = 0 ; while ( ( slashEIndex = s . indexOf ( "\\E" , current ) ) != ( - 1 ) ) { sb . append ( s . substring ( current , slashEIndex ) ) ; current = slashEIndex + 2 ; sb . append ( "\\E\\\\E\\Q" ) ; } sb . append ( s . substring ( current , s . length ( ) ) ) ; sb . append ( "\\E" ) ; return sb . toString ( ) ; } static class MyAjaxSelfUpdatingTimerBehavior extends AjaxSelfUpdatingTimerBehavior { private static final long serialVersionUID = 1L ; private final Duration duration ; String updateScript ; public MyAjaxSelfUpdatingTimerBehavior ( Duration updateInterval ) { } @ Override protected void onComponentRendered ( ) { } public String getUpdateScript ( ) { } } }

Fix:
StringBuilder sb = new StringBuilder ( ( ( s . length ( ) ) * 2 ) ) ;
Buggy code:
public class LoggedInUserDropDownModule extends PageModule { public LoggedInUserDropDownModule ( WebDriver driver ) { } public void signOut ( ) { SignOutLink signOutLink = new SignOutLink ( driver ) ; LoggedInUserSpan loggedInUserDropdown = new LoggedInUserSpan ( driver ) ; try { <START_BUG> for ( int i = 0 ; i < 5 ; i ++ ) { <END_BUG> loggedInUserDropdown . safeClick ( ) ; signOutLink . safeClick ( ) ; if ( ! ( loggedInUserDropdown . isDisplayed ( ) ) ) break ; } } catch ( Exception e ) { } } }

Fix:
for ( int i = 0 ; i < 3 ; i ++ ) {
Buggy code:
public class FileTypeBox extends Box { private String majorBrand ; private int minorVersion ; private Collection < String > compBrands = new LinkedList < String > ( ) ; public static String fourcc ( ) { } public FileTypeBox ( String majorBrand , int minorVersion , Collection < String > compBrands ) { } public FileTypeBox ( ) { } public void parse ( ByteBuffer input ) { majorBrand = NIOUtils . readString ( input , 4 ) ; minorVersion = input . getInt ( ) ; String brand ; <START_BUG> while ( ( brand = NIOUtils . readString ( input , 4 ) ) != null ) { <END_BUG> compBrands . add ( brand ) ; } } public String getMajorBrand ( ) { } public Collection < String > getCompBrands ( ) { } public void doWrite ( ByteBuffer out ) { } No newline ; at end ; of file ; }

Fix:
while ( ( input . hasRemaining ( ) ) && ( ( brand = NIOUtils . readString ( input , 4 ) ) != null ) ) {
Buggy code:
class LanguageToolClient { private final String url ; LanguageToolClient ( String url ) { } List < RuleMatch > checkText ( TextWithMapping text , String langCode ) { } private HttpURLConnection openConnection ( URL languageToolUrl ) throws IOException { } private void writeParameters ( String urlParameters , HttpURLConnection connection ) throws IOException { DataOutputStream wr = new DataOutputStream ( connection . getOutputStream ( ) ) ; try { <START_BUG> wr . writeBytes ( urlParameters ) ; <END_BUG> } finally { wr . flush ( ) ; wr . close ( ) ; } } private static String streamToString ( InputStream is , String charsetName ) throws IOException { } private static String readerToString ( Reader reader ) throws IOException { } private List < RuleMatch > parseXml ( String xml , TextWithMapping text ) throws XPathExpressionException { } private RuleMatch getRuleMatch ( TextWithMapping text , Node errorNode ) { } }

Fix:
wr . write ( urlParameters . getBytes ( "UTF-8" ) ) ;
Buggy code:
public class PersistenceRefProcessor extends AbstractDeploymentDescriptorBindingsProcessor { @ Override protected List < BindingConfiguration > processDescriptorEntries ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , EEModuleDescription moduleDescription , ComponentDescription componentDescription , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex ) throws DeploymentUnitProcessingException { } private List < BindingConfiguration > getPersistenceUnitRefs ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , EEModuleDescription moduleDescription , ComponentDescription componentDescription ) throws DeploymentUnitProcessingException { } private List < BindingConfiguration > getPersistenceContextRefs ( DeploymentUnit deploymentUnit , DeploymentDescriptorEnvironment environment , ClassLoader classLoader , DeploymentReflectionIndex deploymentReflectionIndex , EEModuleDescription moduleDescription , ComponentDescription componentDescription ) throws DeploymentUnitProcessingException { } private InjectionSource getPersistenceUnitBindingSource ( final DeploymentUnit deploymentUnit , final String unitName ) throws DeploymentUnitProcessingException { String scopedPuName = getScopedPuName ( deploymentUnit , unitName ) ; ServiceName puServiceName = getPuServiceName ( scopedPuName ) ; <START_BUG> return new org . jboss . as . jpa . injectors . PersistenceUnitInjectionSource ( puServiceName , deploymentUnit , scopedPuName , EntityManagerFactory . class . getName ( ) ) ; <END_BUG> } private InjectionSource getPersistenceContextBindingSource ( final DeploymentUnit deploymentUnit , final String unitName , PersistenceContextType type , Map properties ) throws DeploymentUnitProcessingException { } private String getScopedPuName ( final DeploymentUnit deploymentUnit , final String puName ) throws DeploymentUnitProcessingException { } private ServiceName getPuServiceName ( String scopedPuName ) throws DeploymentUnitProcessingException { } private boolean isEmpty ( String string ) { } }

Fix:
return new org . jboss . as . jpa . injectors . PersistenceUnitInjectionSource ( puServiceName , deploymentUnit , EntityManagerFactory . class . getName ( ) ) ;
Buggy code:
@ RestController public class CollectionController extends BaseAPIController { @ Resource CollectionManager collectionManager ; @ Resource private PhotographerManager photographerManager ; @ RequestMapping ( value = Endpoints . VIEW_COLLECTION , method = RequestMethod . GET ) @ ResponseBody public CollectionData getCollectionData ( @ PathVariable Long collectionId ) throws AbstractBaseException , IOException { Collection collectionData = null ; try { collectionData = collectionManager . getCollection ( collectionId ) ; } catch ( ManagerException ex ) { String exceptionMsg ; switch ( ex . getCode ( ) ) { case AbstractBaseException . COLLECTION_ID_NOT_VALID : exceptionMsg = messages . getMessage ( "Collection.notValid" ) ; break ; default : throw new RuntimeException ( "Unhandled<seq2seq4repair_space>error" ) ; } throw new BadRequestException ( exceptionMsg ) ; } User authenticatedUser = getAuthenticatedUser ( ) ; <START_BUG> if ( ( authenticatedUser != ( collectionData . getUser ( ) ) ) && ( ! ( collectionData . isPublic ( ) ) ) ) { <END_BUG> throw new BadRequestException ( messages . getMessage ( "Collection.notPublic" ) ) ; } return ResourceUtility . convertToCollectionDataIncludingImages ( collectionData ) ; } @ RequestMapping ( value = Endpoints . COLLECTIONS_ID_IMAGES , method = RequestMethod . GET ) @ ResponseBody public List < ImageData > getCollectionsImages ( @ PathVariable Long collectionId , @ RequestParam ( required = false , defaultValue = "-1" ) int start , @ RequestParam ( required = false , defaultValue = "-1" ) int count ) throws AbstractBaseException , IOException { } @ RequestMapping ( value = Endpoints . VIEW_SHOWCASE , method = RequestMethod . GET ) @ ResponseBody public List < CollectionData > getShowcaseFrom ( @ RequestParam ( required = false , defaultValue = "-1" ) int start , @ RequestParam ( required = false , defaultValue = "-1" ) int count , @ RequestParam ( required = true ) String requestUserId ) throws AbstractBaseException , IOException { } }

Fix:
if ( ( ( authenticatedUser . getId ( ) ) != ( collectionData . getUser ( ) . getId ( ) ) ) && ( ! ( collectionData . isPublic ( ) ) ) ) {
Buggy code:
public class LocalActionSeedProvider extends GotsDBHelper implements GotsActionSeedProvider { private String TAG = "LocalActionSeedProvider" ; public LocalActionSeedProvider ( Context mContext ) { } @ Override public ActionOnSeed insertAction ( GrowingSeed seed , ActionOnSeed action ) { } protected ContentValues getContentValues ( ActionOnSeed action , GrowingSeed seed ) { } private ActionOnSeed cursorToAction ( Cursor cursor ) { } public synchronized ActionOnSeed update ( GrowingSeed seed , ActionOnSeed actionSeed ) { } @ Override public List < ActionOnSeed > getActionsDoneBySeed ( GrowingSeed seed , boolean force ) { } @ Override public List < ActionOnSeed > getActionsToDoBySeed ( GrowingSeed seed , boolean force ) { } protected ActionOnSeed populateState ( ActionOnSeed action , GrowingSeed seed ) { } @ Override public ArrayList < ActionOnSeed > getActionsToDo ( ) { } @ Override public ActionOnSeed doAction ( ActionOnSeed action , GrowingSeed seed ) { ActionOnSeed mAction ; <START_BUG> if ( ( action . getId ( ) ) >= 0 ) <END_BUG> mAction = update ( seed , action ) ; else mAction = insertAction ( seed , action ) ; return mAction ; } @ Override public File uploadPicture ( GrowingSeed seed , File f ) { } @ Override public File downloadHistory ( GrowingSeed mSeed ) throws GotsServerRestrictedException { } public List < File > getPicture ( GrowingSeed mSeed ) throws GotsServerRestrictedException { } }

Fix:
if ( ( action . getActionSeedId ( ) ) >= 0 )
Buggy code:
public class GunSelector implements Listener { Core core ; public Inventory gunSelectorMenu = Bukkit . createInventory ( null , 27 , ChatColor . translateAlternateColorCodes ( '&' , "&1&lLASERTAG!<seq2seq4repair_space>&9Pick<seq2seq4repair_space>a<seq2seq4repair_space>Gun" ) ) ; public GunSelector ( Core core ) { } public void displayGuns ( ) { } @ EventHandler public void onGunStatUpdate ( GunStatUpdate e ) { } @ EventHandler public void onGunClick ( InventoryClickEvent e ) { if ( ( e . getWhoClicked ( ) ) instanceof Player ) { Player player = ( ( Player ) ( e . getWhoClicked ( ) ) ) ; if ( ( Arena . getArena ( core , player ) ) == null ) { ItemStack item = e . getCurrentItem ( ) ; <START_BUG> if ( ( item . getType ( ) ) == ( Material . IRON_BARDING ) ) { <END_BUG> Bukkit . dispatchCommand ( player , ( "lasertag<seq2seq4repair_space>selectGun<seq2seq4repair_space>" + ( ChatColor . stripColor ( item . getItemMeta ( ) . getDisplayName ( ) ) ) ) ) ; e . setCancelled ( true ) ; } } } } @ EventHandler public void onRightClick ( PlayerInteractEntityEvent e ) { } }

Fix:
if ( ( item != null ) && ( ( item . getType ( ) ) == ( Material . IRON_BARDING ) ) ) {
Buggy code:
public abstract class AbstractQueryCacheInstrument extends AbstractInstrument implements QueryCacheInstrument { public static final long NO_STATS = - 1 ; private QueryCache _qc ; private String _configId = null ; private String _configRef = null ; public void setQueryCache ( QueryCache qc ) { } public void setConfigId ( String cid ) { } public void setContextRef ( String cref ) { } public String getConfigId ( ) { } public String getContextRef ( ) { } public void setPreparedQueryCache ( QueryCache qc ) { } private QueryStatistics < QueryKey > getStatistics ( ) { } public long getExecutionCount ( ) { } public long getExecutionCount ( String queryKey ) { } public long getTotalExecutionCount ( ) { } public long getTotalExecutionCount ( String queryKey ) { } public long getHitCount ( ) { } public long getHitCount ( String queryKey ) { } public long getTotalHitCount ( ) { } public long getTotalHitCount ( String queryKey ) { } public void reset ( ) { } public Date sinceDate ( ) { } public Date startDate ( ) { } public long getEvictionCount ( ) { } public long getTotalEvictionCount ( ) { } public Set < String > queryKeys ( ) { } private QueryKey findKey ( String key ) { QueryStatistics < QueryKey > stats = getStatistics ( ) ; for ( QueryKey qk : stats . keys ( ) ) { <START_BUG> if ( qk . toString ( ) . equals ( key . toString ( ) ) ) { <END_BUG> return qk ; } } return null ; } public long count ( ) { } public InstrumentationLevel getLevel ( ) { } }

Fix:
if ( qk . toString ( ) . equals ( key ) ) {
Buggy code:
public class FirstStartStep3Fragment extends Fragment { private static String LOG_TAG = "GDG-FirstStartStep3Fragment" ; @ InjectView ( id . complete ) Button mCompleteButton ; @ InjectView ( id . gcmContainer ) LinearLayout mGcmContainer ; @ InjectView ( id . enable_gcm ) CheckBox mEnableGcm ; @ InjectView ( id . enable_analytics ) CheckBox mEnableAnalytics ; private SharedPreferences mPreferences ; private boolean mIsSignedIn = false ; @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } @ Override public void onResume ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { <START_BUG> View v = inflater . inflate ( fragment_welcome_step3 , null ) ; <END_BUG> ButterKnife . inject ( this , v ) ; return v ; } public boolean isSignedIn ( ) { } public void setSignedIn ( boolean mIsSignedIn ) { } public interface Step3Listener { void onComplete ( boolean enableAnalytics , boolean enableGcm ) { } } }

Fix:
View v = inflater . inflate ( fragment_welcome_step3 , container , false ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class RestEasyIntegrationTestCase { static final String DEPLOYMENT_NAME = "resteasy-osgi-client.war" ; @ ArquillianResource public Deployer deployer ; @ Inject public Bundle bundle ; @ Deployment public static JavaArchive createDeployment ( ) { } @ Deployment ( name = RestEasyIntegrationTestCase . DEPLOYMENT_NAME , managed = false , testable = false ) public static WebArchive endpointWar ( ) { final WebArchive archive = ShrinkWrap . create ( WebArchive . class , RestEasyIntegrationTestCase . DEPLOYMENT_NAME ) ; archive . addClass ( SimpleRestEndpoint . class ) ; archive . setWebXML ( RestEasyIntegrationTestCase . class . getPackage ( ) , "web.xml" ) ; archive . add ( new Asset ( ) { public InputStream openStream ( ) { ManifestBuilder builder = ManifestBuilder . newInstance ( ) ; <START_BUG> builder . addManifestHeader ( "Dependencies" , "org.osgi.core,deployment.jaxrs-osgi-target:0.0.0" ) ; <END_BUG> return builder . openStream ( ) ; } } , JarFile . MANIFEST_NAME ) ; return archive ; } @ Test public void testServiceAccess ( ) throws Exception { } private String getHttpResponse ( String message ) throws IOException , ExecutionException , TimeoutException { } public static String formatPossibleIpv6Address ( String address ) { } }

Fix:
builder . addManifestHeader ( "Dependencies" , "org.osgi.core,deployment.jaxrs-osgi-target" ) ;