nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CreateEventActivity extends AppCompatActivity { @ InjectView ( id . editTextEventName ) EditText eventName ; @ InjectView ( id . buttonSubmitEvent ) Button buttonSubmitEvent ; @ InjectView ( id . datePickerEventDate ) DatePicker datePickerEventDate ; @ InjectView ( id . editTextEventDescription ) EditText eventDescription ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private boolean checkInputs ( ) { } private void saveInputs ( ) { String name = eventName . getText ( ) . toString ( ) ; String description = eventDescription . getText ( ) . toString ( ) ; String author = ParseUser . getCurrentUser ( ) . getString ( "NAME" ) ; int day = datePickerEventDate . getDayOfMonth ( ) ; <START_BUG> int month = datePickerEventDate . getMonth ( ) ; <END_BUG> int year = datePickerEventDate . getYear ( ) ; Event event = Event . construct ( name , description , author , ( ( ( ( day + "//" ) + month ) + "//" ) + year ) , "19:53" ) ; event . saveEventually ( ) ; } }

Fix:
int month = ( datePickerEventDate . getMonth ( ) ) + 1 ;
Buggy code:
public class FixedBoolVarImpl extends FixedIntVarImpl implements BoolVar { private static final long serialVersionUID = 1L ; private BoolVar not ; public FixedBoolVarImpl ( String name , int constant , Solver solver ) { } @ Override public int getTypeAndKind ( ) { } @ Override public ESat getBooleanValue ( ) { } @ Override public boolean setToTrue ( ICause cause ) throws ContradictionException { } @ Override public boolean setToFalse ( ICause cause ) throws ContradictionException { } @ Override public BoolVar not ( ) { } @ Override public void _setNot ( BoolVar not ) { } @ Override public boolean isLit ( ) { } @ Override public boolean hasNot ( ) { } @ Override public boolean isNot ( ) { } @ Override public void setNot ( boolean isNot ) { } @ Override public String toString ( ) { <START_BUG> return name ; <END_BUG> } @ Override public IntVar duplicate ( ) { } @ Override public void duplicate ( Solver solver , THashMap < Object , Object > identitymap ) { } }

Fix:
return ( ( name ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( String . valueOf ( constante ) ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws FileNotFoundException { Scanner in = new Scanner ( new File ( "res//roads" ) ) ; Graph G = new Graph ( ) ; int i ; int j ; int x ; int y ; int w ; while ( in . hasNextInt ( ) ) { i = in . nextInt ( ) ; j = in . nextInt ( ) ; x = in . nextInt ( ) ; y = in . nextInt ( ) ; Vertex u = G . findV ( new Point ( i , j ) ) ; Vertex v = G . findV ( new Point ( x , y ) ) ; if ( u == null ) u = G . addV ( new Point ( i , j ) ) ; if ( v == null ) v = G . addV ( new Point ( x , y ) ) ; w = in . nextInt ( ) ; G . addE ( u , v , w ) ; } in . close ( ) ; in = new Scanner ( new File ( "res//pointofinterests" ) ) ; ArrayList < Vertex > Sources = new ArrayList < Vertex > ( ) ; while ( in . hasNextInt ( ) ) { x = in . nextInt ( ) ; y = in . nextInt ( ) ; Sources . add ( G . findV ( new Point ( x , y ) ) ) ; } in . close ( ) ; ParallelDijisktra dijisktra = new ParallelDijisktra ( ) ; dijisktra . init ( G , Sources ) ; dijisktra . generateVoronoi ( ) ; Log . l ( G ) ; <START_BUG> dijisktra . generateVoronoiCell ( G , Sources ) ; <END_BUG> } }

Fix:
dijisktra . generateVoronoiCell ( G ) ;
Buggy code:
public class XMPPChatManager implements IChatManager { protected Vector messageListeners = new Vector ( ) ; protected XMPPContainerPresenceHelper presenceHelper ; protected IChatMessageSender chatMessageSender = new IChatMessageSender ( ) { public void sendChatMessage ( ID toID , ID threadID , IChatMessage . Type type , String subject , String body , Map properties ) throws ECFException { } public void sendChatMessage ( ID toID , String body ) throws ECFException { } } ; protected ITypingMessageSender typingMessageSender = new ITypingMessageSender ( ) { public void sendTypingMessage ( ID toID , boolean isTyping , String body ) throws ECFException { } } ; public XMPPChatManager ( XMPPContainerPresenceHelper presenceHelper ) { } protected Type createMessageType ( Message . Type type ) { } protected Type createMessageType ( IChatMessage . Type type ) { } public void addMessageListener ( IIMMessageListener listener ) { } public IChatMessageSender getChatMessageSender ( ) { } public void removeMessageListener ( IIMMessageListener listener ) { } private void fireMessageEvent ( IIMMessageEvent event ) { } protected void fireChatMessage ( ID fromID , ID threadID , Type type , String subject , String body , Map properties ) { <START_BUG> fireMessageEvent ( new org . eclipse . ecf . presence . im . ChatMessageEvent ( fromID , new org . eclipse . ecf . presence . im . ChatMessage ( threadID , createMessageType ( type ) , subject , body , properties ) ) ) ; <END_BUG> } protected void fireTypingMessage ( ID fromID , ITypingMessage typingMessage ) { } public ITypingMessageSender getTypingMessageSender ( ) { } protected void fireXHTMLChatMessage ( ID fromID , ID threadID , Type type , String subject , String body , Map properties , List xhtmlbodylist ) { } }

Fix:
fireMessageEvent ( new org . eclipse . ecf . presence . im . ChatMessageEvent ( fromID , new org . eclipse . ecf . presence . im . ChatMessage ( fromID , threadID , createMessageType ( type ) , subject , body , properties ) ) ) ;
Buggy code:
public class NotPointcut extends Pointcut { private Pointcut body ; public NotPointcut ( Pointcut left ) { } public NotPointcut ( Pointcut pointcut , int startPos ) { } public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { } public FuzzyBoolean match ( Shadow shadow ) { } public String toString ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { <START_BUG> return new NotPointcut ( body . concretize1 ( inAspect , bindings ) ) ; <END_BUG> } }

Fix:
return new NotPointcut ( body . concretize ( inAspect , bindings ) ) ;
Buggy code:
public class RaNestedJarInlineProcessor extends NestedJarInlineProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { <START_BUG> final VirtualFile deploymentRoot = phaseContext . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ; <END_BUG> if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) return ; final String deploymentRootName = deploymentRoot . getName ( ) ; if ( ! ( deploymentRootName . endsWith ( ".rar" ) ) ) { return ; } super . deploy ( phaseContext ) ; } }

Fix:
final VirtualFile deploymentRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) . getRoot ( ) ;
Buggy code:
public class LongProperty extends NumberProperty { private static final long serialVersionUID = 240L ; private long value ; private long savedValue ; public LongProperty ( String name , long value ) { } public LongProperty ( ) { } @ Override public void setRunningVersion ( boolean runningVersion ) { } public void recoverRunningVersion ( TestElement owner ) { } public void setValue ( int value ) { } @ Override protected void setNumberValue ( Number n ) { } @ Override protected void setNumberValue ( String n ) throws NumberFormatException { } public String getStringValue ( ) { } public Object getObjectValue ( ) { <START_BUG> return new Long ( value ) ; <END_BUG> } @ Override public Object clone ( ) { } @ Override public boolean getBooleanValue ( ) { } @ Override public double getDoubleValue ( ) { } @ Override public float getFloatValue ( ) { } @ Override public int getIntValue ( ) { } @ Override public long getLongValue ( ) { } }

Fix:
return Long . valueOf ( value ) ;
Buggy code:
public class LinkDAOTest extends DAOBasedTest { private static final String USER_ID_WITH_POSITIONS = "user_1" ; private static final String USER_ID_WITHOUT_POSITION = "user_2" ; private static final Integer UNIQUE_ID = 25 ; Connection con = null ; @ Override public String [ ] getApplicationContextPath ( ) { } @ Override public String getDataSetPath ( ) { <START_BUG> return "com//silverpeas//mylinks//dao//test-mylinks-dataset.xml" ; <END_BUG> } @ Before public void beforeTest ( ) throws Exception { } @ After public void afterTest ( ) { } @ Test public void getAllUserLinks ( ) throws Exception { } @ Test public void insertUserLinkIntoLinksWithoutPositionSet ( ) throws Exception { } @ Test public void insertUserLinkIntoLinksWithPositionSet ( ) throws Exception { } @ Test public void updateUserLinkThatHadAlreadyPosition ( ) throws Exception { } @ Test public void updateUserLinkThatHadNoPosition ( ) throws Exception { } @ Test public void deleteUserLink ( ) throws Exception { } private List < Integer > extractLinkIds ( List < LinkDetail > links ) { } }

Fix:
return "com//silverpeas//myLinks//dao//test-mylinks-dataset.xml" ;
Buggy code:
public interface IBookingProvidesForGuest extends EObject { int checkIn ( String bookingRef , String roomType , String guestEmail ) { } <START_BUG> int checkOut ( int roomID , String guestEmail ) ; <END_BUG> int payExtra ( String ccNumber , String ccv , int expMonth , int expYear , String firstName , String lastName , List < String > extra , int roomID ) { } int payRoom ( String ccNumber , String ccv , int expMonth , int expYear , String firstName , String lastName , int roomID ) { } }

Fix:
int checkOut ( int roomID ) ;
Buggy code:
public class MusicApp { public static MidiChannel [ ] channels ; public static int columnHeight = 12 ; public static int rowLength = 12 ; public static boolean [ ] [ ] percussionGrid1 ; public static boolean [ ] [ ] percussionGrid2 ; public static boolean [ ] [ ] pianoGrid ; public static boolean [ ] [ ] guitarGrid ; public static void main ( String [ ] args ) throws InvalidMidiDataException , MidiUnavailableException { } public static void printInstruments ( Instrument [ ] inst ) { } public static boolean checkInstruments ( Instrument inst1 , Instrument inst2 , Instrument inst3 ) { } public static String determineMajorKey ( ) { String key = null ; int counter = 0 ; for ( int i = 0 ; i < ( MusicApp . columnHeight ) ; i ++ ) { if ( MusicApp . pianoGrid [ 0 ] [ i ] ) { counter ++ ; } } <START_BUG> if ( ( ( counter == 0 ) || ( counter == 4 ) ) || ( counter == 8 ) ) { <END_BUG> key = "CMajor" ; } else if ( ( ( counter == 1 ) || ( counter == 5 ) ) || ( counter == 9 ) ) { key = "GMajor" ; } else if ( ( ( counter == 2 ) || ( counter == 6 ) ) || ( counter == 10 ) ) { key = "DMajor" ; } else if ( ( ( counter == 3 ) || ( counter == 7 ) ) || ( counter == 11 ) ) { key = "FMajor" ; } return key ; } public static Progression [ ] getProgressions ( String key , int duration ) { } public static String mapCellsToNote ( int cellCount , String key ) { } public static String mapCellsToNoteLength ( int cellCount ) { } public static Progression [ ] getTunedProgressions ( boolean [ ] [ ] grid1 , boolean [ ] [ ] grid2 , String key , int duration ) { } public static Progression getHiHatProgression ( boolean [ ] [ ] grid , int duration ) { } public static String mapCellsToPercussion ( int cellCount ) { } public static Progression getTomProgression ( boolean [ ] [ ] grid , int duration ) { } }

Fix:
if ( ( ( ( counter == 0 ) || ( counter == 4 ) ) || ( counter == 8 ) ) || ( counter == 12 ) ) {
Buggy code:
public class InMemoryMetricEmitter implements IMetricEmitter { protected static final Logger logger = Logger . getLogger ( InMemoryMetricEmitter . class ) ; Map < String , LinkedList < InMemoryHistoryNode > > historyListMapping ; private static final String INMEMORY_METRIC_REPORTER_WINDOW = "azkaban.metric.inmemory.interval" ; private static final String INMEMORY_METRIC_NUM_INSTANCES = "azkaban.metric.inmemory.maxinstances" ; private static final String INMEMORY_METRIC_DEVIAION_FACTOR = "azkaban.metric.inmemory.statisticalDeviationFactor" ; double statisticalDeviationFactor ; long interval ; long numInstances ; public InMemoryMetricEmitter ( Props azkProps ) { } public synchronized void setReportingInterval ( long val ) { } public void setReportingInstances ( long num ) { } @ Override public void reportMetric ( final IMetric < ? > metric ) throws Exception { } public List < InMemoryHistoryNode > getDrawMetric ( final String metricName , final Date from , final Date to , final Boolean useStats ) { } private void statBasedSelectMetricHistory ( final LinkedList < InMemoryHistoryNode > selectedLists ) { InMemoryMetricEmitter . logger . debug ( "selecting<seq2seq4repair_space>snapshots<seq2seq4repair_space>which<seq2seq4repair_space>are<seq2seq4repair_space>far<seq2seq4repair_space>away<seq2seq4repair_space>from<seq2seq4repair_space>mean<seq2seq4repair_space>value" ) ; Iterator < InMemoryHistoryNode > ite = selectedLists . iterator ( ) ; Double mean = InMemoryHistoryStatistics . mean ( selectedLists ) ; Double std = InMemoryHistoryStatistics . sdev ( selectedLists ) ; while ( ite . hasNext ( ) ) { InMemoryHistoryNode currentNode = ite . next ( ) ; double value = ( ( Number ) ( currentNode . getValue ( ) ) ) . doubleValue ( ) ; <START_BUG> if ( ( value > ( mean + ( ( statisticalDeviationFactor ) * std ) ) ) && ( value < ( mean - ( ( statisticalDeviationFactor ) * std ) ) ) ) { <END_BUG> ite . remove ( ) ; } } } private void generalSelectMetricHistory ( final LinkedList < InMemoryHistoryNode > selectedLists ) { } private void cleanUsingTime ( final String metricName , final Date firstAllowedDate ) { } @ Override public void purgeAllData ( ) throws Exception { } }

Fix:
if ( ( value < ( mean + ( ( statisticalDeviationFactor ) * std ) ) ) && ( value > ( mean - ( ( statisticalDeviationFactor ) * std ) ) ) ) {
Buggy code:
public class News extends Controller { public static ALogger logger = Logger . of ( "application.controller.news" ) ; public static Result index ( ) { } public static Result addPost ( ) { } public static Result multiRmNews ( ) { } public static Result rm ( Long id ) { } public static Result jsonNewsList ( ) { } public static WebSocket < String > newsWS ( ) { return new WebSocket < String > ( ) { public void onReady ( WebSocket . In < String > in , WebSocket . Out < String > out ) { final ActorRef pingActor = Akka . system ( ) . actorOf ( Props . create ( NewsSocket . class , in , out ) ) ; <START_BUG> final Cancellable cancellable = Akka . system ( ) . scheduler ( ) . schedule ( Duration . create ( 1 , TimeUnit . SECONDS ) , Duration . create ( 15 , TimeUnit . SECONDS ) , pingActor , "News" , Akka . system ( ) . dispatcher ( ) , null ) ; <END_BUG> in . onClose ( ( ) -> { cancellable . cancel ( ) ; } ) ; } } ; } No newline ; at end ; of file ; }

Fix:
final Cancellable cancellable = Akka . system ( ) . scheduler ( ) . schedule ( Duration . create ( 1 , TimeUnit . SECONDS ) , Duration . create ( 5 , TimeUnit . SECONDS ) , pingActor , "News" , Akka . system ( ) . dispatcher ( ) , null ) ;
Buggy code:
public class EstimatedHistogram { private static final long [ ] bucketOffsets = new long [ ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 10 , 12 , 15 , 18 , 22 , 26 , 31 , 38 , 46 , 55 , 66 , 79 , 95 , 114 , 137 , 164 , 197 , 237 , 284 , 341 , 410 , 492 , 590 , 708 , 850 , 1020 , 1224 , 1469 , 1763 , 2116 , 2539 , 3047 , 3657 , 4388 , 5266 , 6319 , 7583 , 9100 , 10920 , 13104 , 15725 , 18870 , 22644 , 27173 , 32608 , 39130 , 46956 , 56347 , 67617 , 81140 , 97368 , 116842 , 140210 , 168252 , 201903 , 242283 , 290740 , 348888 , 418666 , 502400 , 602880 , 723456 , 868147 , 1041776 , 1250132 , 1500158 , 1800190 , 2160228 , 2592274 , 3110728 , 3732874 , 4479449 , 5375339 , 6450407 , 7740489 , 9288586 , 11146304 , 13375565 , 16050678 , 19260813 , 23112976 , 27735572 , 33282686 } ; private static final int numBuckets = ( EstimatedHistogram . bucketOffsets . length ) + 1 ; final AtomicLongArray buckets ; public EstimatedHistogram ( ) { } public void add ( long n ) { } <START_BUG> public long [ ] get ( Boolean reset ) { <END_BUG> long [ ] rv = new long [ EstimatedHistogram . numBuckets ] ; for ( int i = 0 ; i < ( EstimatedHistogram . numBuckets ) ; i ++ ) rv [ i ] = buckets . get ( i ) ; if ( reset ) for ( int i = 0 ; i < ( EstimatedHistogram . numBuckets ) ; i ++ ) buckets . set ( i , 0L ) ; return rv ; } }

Fix:
public long [ ] get ( boolean reset ) {
Buggy code:
public class ParallelCountingMapper extends Mapper < LongWritable , Text , Text , LongWritable > { private static final LongWritable ONE = new LongWritable ( 1 ) ; private Pattern splitter ; @ Override protected void map ( LongWritable offset , Text input , 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 ( PFP_PARAMETERS , "" ) ) ; <END_BUG> splitter = Pattern . compile ( params . get ( SPLIT_PATTERN , SPLITTER . toString ( ) ) ) ; } }

Fix:
Parameters params = new Parameters ( context . getConfiguration ( ) . get ( PFP_PARAMETERS , "" ) ) ;
Buggy code:
public class AnnotationTypeMemberDeclaration extends BodyDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( AnnotationTypeMemberDeclaration . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( AnnotationTypeMemberDeclaration . class ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( AnnotationTypeMemberDeclaration . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor ( AnnotationTypeMemberDeclaration . class , "type" , Type . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; public static final ChildPropertyDescriptor DEFAULT_PROPERTY = new ChildPropertyDescriptor ( AnnotationTypeMemberDeclaration . class , "default" , Expression . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private SimpleName memberName = null ; private Type memberType = null ; private Expression optionalDefaultValue = null ; AnnotationTypeMemberDeclaration ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SimpleName getName ( ) { } public void setName ( SimpleName memberName ) { } public Type getType ( ) { } public void setType ( Type type ) { } public Expression getDefault ( ) { } public void setDefault ( Expression defaultValue ) { } <START_BUG> public IVariableBinding resolveBinding ( ) { <END_BUG> return this . ast . getBindingResolver ( ) . resolveMember ( this ) ; } int memSize ( ) { } int treeSize ( ) { } }

Fix:
public IMethodBinding resolveBinding ( ) {
Buggy code:
class Writer extends AbstractOperator { public static final String OP_TYPE = "write" ; private boolean chunked ; private boolean isRandom ; private boolean hashCheck = false ; private ObjectPicker objPicker = new ObjectPicker ( ) ; private SizePicker sizePicker = new SizePicker ( ) ; public Writer ( ) { } @ Override protected void init ( String id , int ratio , String division , Config config ) { } @ Override public String getOpType ( ) { } @ Override protected void operate ( int idx , int all , Session session ) { } public static Sample doWrite ( InputStream in , long length , String conName , String objName , Config config , Session session , Operator op ) { if ( Thread . interrupted ( ) ) throw new AbortedException ( ) ; CountingInputStream cin = new CountingInputStream ( in ) ; long start = System . currentTimeMillis ( ) ; try { session . getApi ( ) . createObject ( conName , objName , cin , length , config ) ; } catch ( StorageInterruptedException sie ) { throw new AbortedException ( ) ; } catch ( Exception e ) { <START_BUG> session . getLogger ( ) . error ( "fail<seq2seq4repair_space>to<seq2seq4repair_space>perform<seq2seq4repair_space>write<seq2seq4repair_space>operation" , e ) ; <END_BUG> return new Sample ( new Date ( ) , op . getId ( ) , op . getOpType ( ) , op . getSampleType ( ) , op . getName ( ) , false ) ; } finally { IOUtils . closeQuietly ( cin ) ; } long end = System . currentTimeMillis ( ) ; Date now = new Date ( end ) ; return new Sample ( now , op . getId ( ) , op . getOpType ( ) , op . getSampleType ( ) , op . getName ( ) , true , ( end - start ) , cin . getByteCount ( ) ) ; } }

Fix:
doLogErr ( session . getLogger ( ) , "fail<seq2seq4repair_space>to<seq2seq4repair_space>perform<seq2seq4repair_space>write<seq2seq4repair_space>operation" , e ) ;
Buggy code:
public class ServerConnectionTest extends TestCase { IConnectionService connection ; Process server ; public ServerConnectionTest ( String name ) { } public static Test suite ( ) { } public void setUp ( ) { connection = Domain . getServerConnection ( ) ; try { <START_BUG> server = Runtime . getRuntime ( ) . exec ( "java<seq2seq4repair_space>-jar<seq2seq4repair_space>..//server//target//server-0.1a-SNAPSHOT.jar" ) ; <END_BUG> } catch ( IOException ex ) { ex . printStackTrace ( ) ; } } public void testConnection_Succeed ( ) { } public void testConnection_PortOutOfBounds ( ) { } public void testConnection_UnknownHostException ( ) { } public void testLogin_Authenticated ( ) { } public void tearDown ( ) { } }

Fix:
server = Runtime . getRuntime ( ) . exec ( "java<seq2seq4repair_space>-jar<seq2seq4repair_space>..//server//target//server-0.1a-SNAPSHOT-jar-with-dependencies.jar" ) ;
Buggy code:
@ Seed ( "AFD1E7E84B35D2B1" ) public class TestPhraseQuery extends LuceneTestCase { public static final float SCORE_COMP_THRESH = 1.0E-6F ; private static IndexSearcher searcher ; private static IndexReader reader ; private PhraseQuery query ; private static Directory directory ; @ BeforeClass public static void beforeClass ( ) throws Exception { } @ Override public void setUp ( ) throws Exception { } @ AfterClass public static void afterClass ( ) throws Exception { } public void testNotCloseEnough ( ) throws Exception { } public void testBarelyCloseEnough ( ) throws Exception { } public void testExact ( ) throws Exception { } public void testSlop1 ( ) throws Exception { } public void testOrderDoesntMatter ( ) throws Exception { } public void testMulipleTerms ( ) throws Exception { } public void testPhraseQueryWithStopAnalyzer ( ) throws Exception { Directory directory = newDirectory ( ) ; Analyzer stopAnalyzer = new MockAnalyzer ( random ( ) , MockTokenizer . SIMPLE , true , MockTokenFilter . ENGLISH_STOPSET ) ; <START_BUG> RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory , newIndexWriterConfig ( LUCENE_40 , stopAnalyzer ) ) ; <END_BUG> Document doc = new Document ( ) ; doc . add ( newTextField ( "field" , "the<seq2seq4repair_space>stop<seq2seq4repair_space>words<seq2seq4repair_space>are<seq2seq4repair_space>here" , YES ) ) ; writer . addDocument ( doc ) ; IndexReader reader = writer . getReader ( ) ; writer . close ( ) ; IndexSearcher searcher = newSearcher ( reader ) ; PhraseQuery query = new PhraseQuery ( ) ; query . add ( new Term ( "field" , "stop" ) ) ; query . add ( new Term ( "field" , "words" ) ) ; ScoreDoc [ ] hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( 1 , hits . length ) ; QueryUtils . check ( random ( ) , query , searcher ) ; reader . close ( ) ; directory . close ( ) ; } public void testPhraseQueryInConjunctionScorer ( ) throws Exception { } public void testSlopScoring ( ) throws IOException { } public void testToString ( ) throws Exception { } public void testWrappedPhrase ( ) throws IOException { } public void testNonExistingPhrase ( ) throws IOException { } public void testPalyndrome2 ( ) throws Exception { } public void testPalyndrome3 ( ) throws Exception { } public void testEmptyPhraseQuery ( ) throws Throwable { } public void testRewrite ( ) throws IOException { } public void testRandomPhrases ( ) throws Exception { } }

Fix:
RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory , newIndexWriterConfig ( TEST_VERSION_CURRENT , stopAnalyzer ) ) ;
Buggy code:
public class MentionsFragment extends TweetsListFragment { @ Override protected void getInitialTweets ( TwitterClient . TweetsListener listener ) { } @ Override protected void getOlderTweets ( TwitterClient . TweetsListener listener ) { Tweet tweet = tweetsAdapter . getLastTweet ( ) ; long lastTweetId = ( tweet != null ) ? tweet . getId ( ) : 1 ; <START_BUG> client . getMentions ( 0 , ( lastTweetId + 1 ) , listener ) ; <END_BUG> } @ Override protected void getNewerTweets ( TwitterClient . TweetsListener listener ) { } }

Fix:
client . getMentions ( 0 , ( lastTweetId - 1 ) , listener ) ;
Buggy code:
public class BetterAudio extends CordovaPlugin { private Context context ; public boolean execute ( String action , JSONArray data , final CallbackContext callbackContext ) throws JSONException { this . context = this . cordova . getActivity ( ) . getBaseContext ( ) ; if ( action . equals ( "play" ) ) { final String uri = data . getString ( 0 ) ; this . cordova . getThreadPool ( ) . execute ( new Runnable ( ) { public void run ( ) { android . util . Log . v ( "BetterAudio" , ( "Uri<seq2seq4repair_space>is<seq2seq4repair_space>" + uri ) ) ; android . media . MediaPlayer mp = new android . media . MediaPlayer ( ) ; mp . setOnPreparedListener ( new android . media . MediaPlayer . OnPreparedListener ( ) { public void onPrepared ( android . media . MediaPlayer m ) { android . media . AudioManager am = ( ( android . media . AudioManager ) ( BetterAudio . this . context . getSystemService ( "audio" ) ) ) ; <START_BUG> am . requestAudioFocus ( null , 5 , 3 ) ; <END_BUG> m . start ( ) ; } } ) ; mp . setOnCompletionListener ( new android . media . MediaPlayer . OnCompletionListener ( ) { public void onCompletion ( android . media . MediaPlayer m ) { android . media . AudioManager a = ( ( android . media . AudioManager ) ( BetterAudio . this . context . getSystemService ( "audio" ) ) ) ; a . abandonAudioFocus ( null ) ; m . release ( ) ; } } ) ; mp . setOnErrorListener ( new android . media . MediaPlayer . OnErrorListener ( ) { public boolean onError ( android . media . MediaPlayer m , int errorCode , int more ) { m . stop ( ) ; android . media . AudioManager a = ( ( android . media . AudioManager ) ( BetterAudio . this . context . getSystemService ( "audio" ) ) ) ; a . abandonAudioFocus ( null ) ; android . util . Log . v ( "BetterAudio" , ( ( ( "Uh<seq2seq4repair_space>oh:<seq2seq4repair_space>" + errorCode ) + "<seq2seq4repair_space>//<seq2seq4repair_space>" ) + more ) ) ; return false ; } } ) ; android . content . res . AssetFileDescriptor fd = null ; try { fd = BetterAudio . this . cordova . getActivity ( ) . getAssets ( ) . openFd ( uri ) ; mp . setDataSource ( fd . getFileDescriptor ( ) , fd . getStartOffset ( ) , fd . getLength ( ) ) ; mp . prepare ( ) ; } catch ( Exception e ) { callbackContext . error ( e . getLocalizedMessage ( ) ) ; } } } ) ; } return true ; } No newline ; at end ; of file ; }

Fix:
am . requestAudioFocus ( null , AudioManager . STREAM_MUSIC , AudioManager . AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK ) ;
Buggy code:
public class Socks5CmdHandler implements Socks5StageHandler { private static final Socks5CmdHandler INSTANCE = new Socks5CmdHandler ( ) ; private static final byte CMD_CONNECT = 1 ; private static final byte CMD_BIND = 2 ; private static final byte CMD_UDP_ASSOC = 3 ; private static final byte ATYP_IPV4 = 1 ; private static final byte ATYP_DOMAINNAME = 3 ; private static final byte ATYP_IPV6 = 4 ; private static final byte [ ] SOCKS5_CONNECT_RESPONSE = new byte [ ] { 5 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 16 , 16 } ; private static final byte [ ] SOCKS5_UNSUPPORTED_RESPONSE = new byte [ ] { 5 , 7 , 0 , 1 , 0 , 0 , 0 , 0 , 16 , 16 } ; private Socks5CmdHandler ( ) { } public static Socks5CmdHandler getInstance ( ) { } @ Override public Socks5HandleResult handle ( ByteBuffer buffer ) { if ( ( buffer . remaining ( ) ) < 3 ) { return new Socks5HandleResult ( Type . UNCOMPLETED ) ; } byte version = buffer . get ( ) ; if ( ! ( Socks5Utils . verifyVersion ( version ) ) ) { Logger . error ( ( "socks5<seq2seq4repair_space>hello<seq2seq4repair_space>stage<seq2seq4repair_space>wrong<seq2seq4repair_space>version:<seq2seq4repair_space>" + version ) ) ; return new Socks5HandleResult ( Type . ERROR ) ; } byte cmd = buffer . get ( ) ; if ( cmd != ( Socks5CmdHandler . CMD_CONNECT ) ) { <START_BUG> Logger . debug ( ( "socks5<seq2seq4repair_space>unsupported<seq2seq4repair_space>cmd:<seq2seq4repair_space>" + cmd ) ) ; <END_BUG> return new Socks5HandleResult ( Type . COMPLETED , Socks5CmdHandler . SOCKS5_UNSUPPORTED_RESPONSE , null ) ; } buffer . get ( ) ; int pos = buffer . position ( ) ; byte addressType = buffer . get ( ) ; SocketAddress address ; try { switch ( addressType ) { case Socks5CmdHandler . ATYP_IPV4 : address = parseIpV4 ( buffer ) ; break ; case Socks5CmdHandler . ATYP_DOMAINNAME : address = parseDomainName ( buffer ) ; break ; case Socks5CmdHandler . ATYP_IPV6 : address = parseIpV6 ( buffer ) ; break ; default : Logger . error ( ( "socks5<seq2seq4repair_space>unexpected<seq2seq4repair_space>address<seq2seq4repair_space>type:<seq2seq4repair_space>" + addressType ) ) ; return new Socks5HandleResult ( Type . ERROR ) ; } } catch ( UnknownHostException e ) { Logger . error ( e ) ; return new Socks5HandleResult ( Type . ERROR ) ; } if ( address == null ) { return new Socks5HandleResult ( Type . UNCOMPLETED ) ; } Logger . info ( ( "connect<seq2seq4repair_space>to<seq2seq4repair_space>" + address ) ) ; buffer . position ( pos ) ; byte [ ] bufferContents = new byte [ buffer . remaining ( ) ] ; buffer . get ( bufferContents ) ; return new Socks5HandleResult ( Type . COMPLETED , Socks5CmdHandler . SOCKS5_CONNECT_RESPONSE , bufferContents ) ; } private SocketAddress parseIpV4 ( ByteBuffer buffer ) throws UnknownHostException { } private SocketAddress parseDomainName ( ByteBuffer buffer ) { } private SocketAddress parseIpV6 ( ByteBuffer buffer ) throws UnknownHostException { } }

Fix:
Logger . info ( ( "socks5<seq2seq4repair_space>unsupported<seq2seq4repair_space>cmd:<seq2seq4repair_space>" + cmd ) ) ;
Buggy code:
public final class NumericTokenStream extends TokenStream { public static final String TOKEN_TYPE_FULL_PREC = "fullPrecNumeric" ; public static final String TOKEN_TYPE_LOWER_PREC = "lowerPrecNumeric" ; public interface NumericTermAttribute extends Attribute { int getShift ( ) { } long getRawValue ( ) { } int getValueSize ( ) { } void init ( long value , int valSize , int precisionStep , int shift ) { } void setShift ( int shift ) { } int incShift ( ) { } } private static final class NumericAttributeFactory extends AttributeFactory { private final AttributeFactory delegate ; NumericAttributeFactory ( AttributeFactory delegate ) { } @ Override public AttributeImpl createAttributeInstance ( Class < ? extends Attribute > attClass ) { } } public static final class NumericTermAttributeImpl extends AttributeImpl implements NumericTokenStream . NumericTermAttribute , TermToBytesRefAttribute { private long value = 0L ; private int valueSize = 0 ; private int shift = 0 ; private int precisionStep = 0 ; private BytesRef bytes = new BytesRef ( ) ; public BytesRef getBytesRef ( ) { } public int fillBytesRef ( ) { } public int getShift ( ) { } public void setShift ( int shift ) { } public int incShift ( ) { } public long getRawValue ( ) { } public int getValueSize ( ) { } public void init ( long value , int valueSize , int precisionStep , int shift ) { } @ Override public void clear ( ) { } @ Override public void reflectWith ( AttributeReflector reflector ) { fillBytesRef ( ) ; <START_BUG> reflector . reflect ( TermToBytesRefAttribute . class , "bytes" , new BytesRef ( bytes ) ) ; <END_BUG> reflector . reflect ( NumericTokenStream . NumericTermAttribute . class , "shift" , shift ) ; reflector . reflect ( NumericTokenStream . NumericTermAttribute . class , "rawValue" , getRawValue ( ) ) ; reflector . reflect ( NumericTokenStream . NumericTermAttribute . class , "valueSize" , valueSize ) ; } @ Override public void copyTo ( AttributeImpl target ) { } } public NumericTokenStream ( ) { } public NumericTokenStream ( final int precisionStep ) { } public NumericTokenStream ( AttributeFactory factory , final int precisionStep ) { } public NumericTokenStream setLongValue ( final long value ) { } public NumericTokenStream setIntValue ( final int value ) { } public NumericTokenStream setDoubleValue ( final double value ) { } public NumericTokenStream setFloatValue ( final float value ) { } @ Override public void reset ( ) { } @ Override public boolean incrementToken ( ) { } public int getPrecisionStep ( ) { } private final NumericTokenStream . NumericTermAttribute numericAtt = addAttribute ( NumericTokenStream . NumericTermAttribute . class ) ; private final TypeAttribute typeAtt = addAttribute ( TypeAttribute . class ) ; private final PositionIncrementAttribute posIncrAtt = addAttribute ( PositionIncrementAttribute . class ) ; private int valSize = 0 ; private final int precisionStep ; }

Fix:
reflector . reflect ( TermToBytesRefAttribute . class , "bytes" , BytesRef . deepCopyOf ( bytes ) ) ;
Buggy code:
public final class TarTestCase extends AbstractTestCase { public void testTarArchiveCreation ( ) throws Exception { } public void testTarArchiveLongNameCreation ( ) throws Exception { } public void testTarUnarchive ( ) throws Exception { } public void testCOMPRESS114 ( ) throws Exception { <START_BUG> final File input = getFile ( "compress-114.tar" ) ; <END_BUG> final InputStream is = new FileInputStream ( input ) ; final ArchiveInputStream in = new ArchiveStreamFactory ( ) . createArchiveInputStream ( "tar" , is ) ; TarArchiveEntry entry = ( ( TarArchiveEntry ) ( in . getNextEntry ( ) ) ) ; assertEquals ( "3±±±F06±W2345±ZB±la±±±±±±±±BLA" , entry . getName ( ) ) ; entry = ( ( TarArchiveEntry ) ( in . getNextEntry ( ) ) ) ; assertEquals ( "0302-0601-3±±±F06±W2345±ZB±la±±±±±±±±BLA" , entry . getName ( ) ) ; in . close ( ) ; } public void testDirectoryEntryFromFile ( ) throws Exception { } public void testExplicitDirectoryEntry ( ) throws Exception { } public void testFileEntryFromFile ( ) throws Exception { } public void testExplicitFileEntry ( ) throws Exception { } }

Fix:
final File input = getFile ( "COMPRESS-114.tar" ) ;
Buggy code:
public class P4Resolve extends P4Base { private String resolvemode = null ; private boolean redoall ; private boolean simulationmode ; private boolean forcetextmode ; private boolean markersforall ; private static final String AUTOMATIC = "automatic" ; private static final String FORCE = "force" ; private static final String SAFE = "safe" ; private static final String THEIRS = "theirs" ; private static final String YOURS = "yours" ; private static final String [ ] RESOLVE_MODES = new String [ ] { P4Resolve . AUTOMATIC , P4Resolve . FORCE , P4Resolve . SAFE , P4Resolve . THEIRS , P4Resolve . YOURS } ; public String getResolvemode ( ) { } public void setResolvemode ( String resolvemode ) { boolean found = false ; for ( int counter = 0 ; counter < ( P4Resolve . RESOLVE_MODES . length ) ; counter ++ ) { if ( resolvemode . equals ( P4Resolve . RESOLVE_MODES [ counter ] ) ) { found = true ; break ; } } <START_BUG> if ( found == false ) { <END_BUG> throw new BuildException ( "Unacceptable<seq2seq4repair_space>value<seq2seq4repair_space>for<seq2seq4repair_space>resolve<seq2seq4repair_space>mode" ) ; } this . resolvemode = resolvemode ; } public boolean isRedoall ( ) { } public void setRedoall ( boolean redoall ) { } public boolean isSimulationmode ( ) { } public void setSimulationmode ( boolean simulationmode ) { } public boolean isForcetextmode ( ) { } public void setForcetextmode ( boolean forcetextmode ) { } public boolean isMarkersforall ( ) { } public void setMarkersforall ( boolean markersforall ) { } public void execute ( ) throws BuildException { } }

Fix:
if ( ! found ) {
Buggy code:
public class StockQuotePage extends WicketExamplePage { public StockQuotePage ( ) { } private final StockQuotePage . Quote quote = new StockQuotePage . Quote ( ) ; public static class Quote implements Serializable { private String symbol ; public String getSymbol ( ) { } <START_BUG> public void setSymbol ( String symbol ) { <END_BUG> this . symbol = symbol ; } } }

Fix:
public void setSymbol ( final String symbol ) {
Buggy code:
class TransactionSubsystem12Parser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { public static final TransactionSubsystem12Parser INSTANCE = new TransactionSubsystem12Parser ( ) ; private TransactionSubsystem12Parser ( ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } private void parseJts ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } private void parseUsehornetqstore ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseObjectStoreEnvironmentElementAndEnrichOperation ( final XMLExtendedStreamReader reader , ModelNode operation ) throws XMLStreamException { } static void parseCoordinatorEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseCoreEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } static void parseProcessIdEnvironmentElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseSocketProcessIdElement ( XMLExtendedStreamReader reader , ModelNode coreEnvironmentAdd ) throws XMLStreamException { } static void parseRecoveryEnvironmentElement ( final XMLExtendedStreamReader reader , final ModelNode operation ) throws XMLStreamException { } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } private void writeProcessId ( final XMLExtendedStreamWriter writer , final ModelNode value ) throws XMLStreamException { writer . writeStartElement ( PROCESS_ID . getLocalName ( ) ) ; <START_BUG> if ( value . get ( PROCESS_ID_UUID . getName ( ) ) . asBoolean ( ) ) { <END_BUG> writer . writeEmptyElement ( UUID . getLocalName ( ) ) ; } else { writer . writeStartElement ( SOCKET . getLocalName ( ) ) ; PROCESS_ID_SOCKET_BINDING . marshallAsAttribute ( value , writer ) ; PROCESS_ID_SOCKET_MAX_PORTS . marshallAsAttribute ( value , writer ) ; writer . writeEndElement ( ) ; } writer . writeEndElement ( ) ; } }

Fix:
if ( value . get ( PROCESS_ID_UUID . getName ( ) ) . asBoolean ( false ) ) {
Buggy code:
public class FavoritesActivity extends ActionBarActivity implements StandDetailFragment . FavoritesListener , StandList . StandListListener { StandListFragment slf = new StandListFragment ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public void onStandSelected ( Company stand ) { } void navTo ( LoadingFragment fragment ) { } @ Override public void onFavoriteListChanged ( ) { <START_BUG> ( ( StandDetailFragment . FavoritesListener ) ( slf ) ) . onFavoriteListChanged ( ) ; <END_BUG> } }

Fix:
slf . onFavoriteListChanged ( ) ;
Buggy code:
abstract class AbstractFileTask extends AbstractPatchingTask < MiscContentItem > { final File target ; final File backup ; protected AbstractFileTask ( PatchingTaskDescription description , File target , File backup ) { } abstract ContentModification createRollbackEntry ( ContentModification original , MiscContentItem item , byte [ ] targetHash ) { } @ Override byte [ ] backup ( PatchingTaskContext context ) throws IOException { } @ Override byte [ ] apply ( PatchingTaskContext context , PatchContentLoader loader ) throws IOException { final MiscContentItem item = contentItem ; if ( item . isDirectory ( ) ) { <START_BUG> if ( ( ! ( target . mkdirs ( ) ) ) && ( ! ( target . isDirectory ( ) ) ) ) { <END_BUG> throw MESSAGES . cannotCreateDirectory ( target . getAbsolutePath ( ) ) ; } return IoUtils . NO_CONTENT ; } else { if ( ! ( target . exists ( ) ) ) { AbstractFileTask . createParentDirectories ( target , item . getPath ( ) , item . getPath ( ) . length , context ) ; } final InputStream is = loader . openContentStream ( item ) ; try { return IoUtils . copy ( is , target ) ; } finally { IoUtils . safeClose ( is ) ; } } } @ Override ContentModification createRollbackEntry ( ContentModification original , byte [ ] targetHash , byte [ ] itemHash ) { } static void createParentDirectories ( final File target , String [ ] path , int depth , final PatchingTaskContext context ) throws IOException { } }

Fix:
if ( ( ! ( target . mkdir ( ) ) ) && ( ! ( target . isDirectory ( ) ) ) ) {
Buggy code:
public class Chests { private static final String CHESTS = "chests" ; private NBTCompound root ; private final ConcurrentMap < Coordinate , Chests . Chest > locations ; public Chests ( ) { } void load ( NBTCompound data ) { } private void loadChests ( NBTList < NBTCompound > node ) { } private void loadOldConfig ( ) { } void save ( ) { } void freeMemory ( ) { } public Chests . Chest get ( Coordinate coordinate ) { } public boolean isLocked ( Coordinate coordinate ) { } public void releaseLock ( Coordinate coordinate ) { } public boolean isChest ( Coordinate coordinate ) { } public Chests . Chest adjacentChest ( Coordinate coordinate ) { } public boolean canOpen ( Player player , Coordinate coordinate ) { } public void unlock ( Coordinate coordinate ) { } public String chestName ( Coordinate coordinate ) { } public void giveLock ( String owner , Coordinate coordinate , String name ) { } public void giveLock ( Player player , Coordinate coordinate , String name ) { <START_BUG> giveLock ( player . getName ( ) , coordinate , name ) ; <END_BUG> } public void addOpenChest ( Coordinate coordinate ) { } public Map < String , Integer > chestList ( Player player ) { } public List < Chests . Chest > getChestsByName ( String name ) { } public static final class Chest { public String owner ; public final Coordinate coordinate ; public String name ; private Chest ( String player , Coordinate coordinate , String name ) { } private Chest ( String player , Coordinate coordinate ) { } private Chest ( Coordinate coordinate ) { } public boolean isOpen ( ) { } public void lock ( Player player ) { } public void unlock ( ) { } public boolean ownedBy ( Player player ) { } } }

Fix:
giveLock ( player . getName ( ) . toLowerCase ( ) , coordinate , name ) ;
Buggy code:
public class ScrollBar extends Widget { Scrollable parent ; int adjustmentHandle ; int detail ; ScrollBar ( ) { } ScrollBar ( Scrollable parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void deregister ( ) { } public boolean getEnabled ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public Scrollable getParent ( ) { } public int getSelection ( ) { } public Point getSize ( ) { } public int getThumb ( ) { } public boolean getVisible ( ) { } int gtk_change_value ( int widget , int scroll , int value1 , int value2 ) { } int gtk_value_changed ( int adjustment ) { Event event = new Event ( ) ; switch ( detail ) { case OS . GTK_SCROLL_NONE : event . detail = SWT . NONE ; break ; case OS . GTK_SCROLL_JUMP : event . detail = SWT . DRAG ; break ; case OS . GTK_SCROLL_START : event . detail = SWT . HOME ; break ; case OS . GTK_SCROLL_END : event . detail = SWT . END ; break ; case OS . GTK_SCROLL_PAGE_DOWN : case OS . GTK_SCROLL_PAGE_RIGHT : case OS . GTK_SCROLL_PAGE_FORWARD : event . detail = SWT . PAGE_DOWN ; break ; case OS . GTK_SCROLL_PAGE_UP : case OS . GTK_SCROLL_PAGE_LEFT : case OS . GTK_SCROLL_PAGE_BACKWARD : event . detail = SWT . PAGE_UP ; break ; case OS . GTK_SCROLL_STEP_DOWN : case OS . GTK_SCROLL_STEP_RIGHT : case OS . GTK_SCROLL_STEP_FORWARD : event . detail = SWT . ARROW_DOWN ; break ; case OS . GTK_SCROLL_STEP_UP : case OS . GTK_SCROLL_STEP_LEFT : case OS . GTK_SCROLL_STEP_BACKWARD : event . detail = SWT . ARROW_UP ; break ; } detail = OS . GTK_SCROLL_NONE ; postEvent ( Selection , event ) ; <START_BUG> parent . setScrollBarValue ( this ) ; <END_BUG> return 0 ; } void hookEvents ( ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void register ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setEnabled ( boolean enabled ) { } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } public void setSelection ( int value ) { } public void setThumb ( int value ) { } public void setValues ( int selection , int minimum , int maximum , int thumb , int increment , int pageIncrement ) { } public void setVisible ( boolean visible ) { } }

Fix:
parent . updateScrollBarValue ( this ) ;
Buggy code:
public class GcmIntentService extends IntentService { public GcmIntentService ( ) { } @ Override protected void onHandleIntent ( Intent intent ) { } protected void showToast ( final String message ) { new android . os . Handler ( android . os . Looper . getMainLooper ( ) ) . post ( new Runnable ( ) { @ Override public void run ( ) { NotificationSQL db = new NotificationSQL ( getApplication ( ) ) ; Log . e ( "ADDNotification" , "okkkk" ) ; String [ ] x = null ; if ( message . contains ( "@" ) ) { x = message . split ( "@" ) ; } else { x = new String [ 2 ] ; x [ 0 ] = message ; <START_BUG> x [ 1 ] = "" ; <END_BUG> } Log . e ( db . getLastNotification ( ) , message ) ; if ( ! ( db . getLastNotification ( ) . equals ( message ) ) ) { if ( ! ( MainActivity . x ) ) { db . addNotification ( x [ 0 ] , x [ 1 ] ) ; db . close ( ) ; GcmIntentService . generateNotification ( getApplicationContext ( ) , x [ 0 ] , x [ 1 ] ) ; } else { db . addNotification ( x [ 0 ] , x [ 1 ] ) ; db . close ( ) ; long [ ] pattern = new long [ ] { 0 , 200 , 100 , 300 , 400 } ; Vibrator vibrator = ( ( Vibrator ) ( getSystemService ( VIBRATOR_SERVICE ) ) ) ; vibrator . vibrate ( pattern , ( - 1 ) ) ; } } } } ) ; } private static void generateNotification ( Context context , String x2 , String message ) { } No newline ; at end ; of file ; }

Fix:
x [ 1 ] = message ;
Buggy code:
class LinkTab extends Tab { Link link1 ; Group linkGroup ; LinkTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "Text" } ; <END_BUG> } String getTabText ( ) { } }

Fix:
return new String [ ] { "Text" , "ToolTipText" } ;