nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SelectQuestion extends ActionBarActivity { private TextView mTextView ; private TextView choice1 ; private TextView choice2 ; private int i ; private ArrayList < Integer > decisions = new ArrayList < Integer > ( ) ; private static boolean [ ] visited = new boolean [ 40 ] ; private CountDownTimer CDT ; private static final String [ ] foodType = new String [ ] { "start" , "正餐" , "小點心" , "餓死了" , "有點飽" , "下午茶" , "宵夜" , "甜的" , "鹹的" , "米飯" , "麵食" , "餃類" , "關東煮" , "重鹹" , "清淡" , "中式" , "西式" , "日式" , "泰式" , "冷的" , "熱的" , "平價" , "高檔" , "速食" , "定食" , "肉類" , "蔬菜" , "牛肉" , "豬肉" , "雞肉" , "鴨肉" , "鵝肉" , "魚肉" } ; private final int numOfQuestions = 5 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } void getQuestionAndSetUI ( ) { if ( ( i ) >= ( numOfQuestions ) ) { Collections . sort ( decisions ) ; Intent it = new Intent ( this , ResultList . class ) ; int numOfKeyWord = decisions . size ( ) ; for ( int j = 0 ; j < ( decisions . size ( ) ) ; j ++ ) { <START_BUG> if ( ( j >= 1 ) && ( j <= 6 ) ) { <END_BUG> numOfKeyWord -- ; } else { it . putExtra ( ( j + "" ) , SelectQuestion . foodType [ decisions . get ( j ) ] ) ; } } it . putExtra ( "numOfKeyWord" , numOfKeyWord ) ; startActivity ( it ) ; } else { int id = TwoChooseOne ( ) ; choice1 . setText ( SelectQuestion . foodType [ id ] ) ; choice2 . setText ( SelectQuestion . foodType [ ( id + 1 ) ] ) ; CDT = new CountDownTimer ( 5000 , 500 ) { @ Override public void onFinish ( ) { ( i ) ++ ; getQuestionAndSetUI ( ) ; } @ Override public void onTick ( long millisUntilFinished ) { mTextView . setText ( ( ( ( millisUntilFinished // 1000 ) + 1 ) + "" ) ) ; } } . start ( ) ; } } static int RanNum ( ) { } static void setup ( ) { } public int TwoChooseOne ( ) { } public void decided ( View v ) { } }

Fix:
if ( ( ( decisions . get ( j ) ) >= 1 ) && ( ( decisions . get ( j ) ) <= 4 ) ) {
Buggy code:
public class StageBattle extends Stage { private Choice fightButton ; private Choice runButton ; private Stat playerStat ; private OpponentStat opponentStat ; private Dialog mainDialog ; private Sprite sprite = new Sprite ( "char.png" ) ; @ Override public void init ( ) { } @ Override public void choiceClicked ( Element elementVar ) { } @ Override public void taskPerformed ( ) { } public void fight ( ) { mainDialog . setText ( "What<seq2seq4repair_space>will<seq2seq4repair_space>you<seq2seq4repair_space>do<seq2seq4repair_space>next?" ) ; <START_BUG> playerStat . setText ( ( "Level:<seq2seq4repair_space>" + ( player . getlevel ( ) ) ) , ( "Player<seq2seq4repair_space>Health:<seq2seq4repair_space>" + ( player . getHealth ( ) ) ) ) ; <END_BUG> opponentStat . setText ( ( "Enemy<seq2seq4repair_space>Health:<seq2seq4repair_space>" + ( opponent . getHealth ( ) ) ) ) ; if ( ( ( opponent . getHealth ( ) ) <= 0 ) || ( ( player . getHealth ( ) ) <= 0 ) ) { DataHandler . battleCompleted = true ; this . removeElements ( sprite ) ; this . setStage ( source . getID ( ) ) ; } } No newline ; at end ; of file ; }

Fix:
playerStat . setText ( ( "Level:<seq2seq4repair_space>" + ( player . getLevel ( ) ) ) , ( "Player<seq2seq4repair_space>Health:<seq2seq4repair_space>" + ( player . getHealth ( ) ) ) ) ;
Buggy code:
public class Cart extends Register { private ArrayList < Item > inventory ; protected ArrayList < Item > items ; private double subTotal ; public Cart ( ) { } public void add ( int itemNumber ) { if ( ( itemNumber > ( ( inventory . size ( ) ) - 1 ) ) || ( itemNumber < 0 ) ) { System . out . println ( "INVALID<seq2seq4repair_space>INDEX...Try<seq2seq4repair_space>Again" ) ; } else { items . add ( inventory . get ( itemNumber ) ) ; <START_BUG> System . out . println ( ( ( items . get ( itemNumber ) . getName ( ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>cart!" ) ) ; <END_BUG> subTotal += items . get ( ( ( items . size ( ) ) - 1 ) ) . getPrice ( ) ; } } public void removeItem ( int itemNumber ) { } public void clearSubTotal ( ) { } public double getSubtotal ( ) { } }

Fix:
System . out . println ( ( ( inventory . get ( itemNumber ) . getName ( ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>cart!" ) ) ;
Buggy code:
public class ValidateUserState extends AbstractValidationState { private static final String [ ] BAD_USER_NAMES = new String [ ] { "admin" , "administrator" , "root" } ; private static final char [ ] VALID_PUNCTUATION ; private static final String VALID_SYMBOLS ; private final StateValues stateValues ; private final ConsoleWrapper theConsole ; public ValidateUserState ( ConsoleWrapper theConsole , final StateValues stateValues ) { } @ Override protected Collection < State > getValidationStates ( ) { } @ Override protected State getSuccessState ( ) { } private State getRetryState ( ) { } private State getValidCharactersState ( ) { } private State getDuplicateCheckState ( ) { return new State ( ) { @ Override public State execute ( ) { if ( ( stateValues . isExistingDisabledUser ( ) ) || ( stateValues . isExistingEnabledUser ( ) ) ) { State duplicateContinuing = ( stateValues . isSilentOrNonInteractive ( ) ) ? null : new PromptNewUserState ( theConsole , stateValues ) ; stateValues . setExistingUser ( true ) ; if ( stateValues . isSilentOrNonInteractive ( ) ) { return ValidateUserState . this ; } else { final boolean existingDisabledUser = stateValues . isExistingDisabledUser ( ) ; if ( existingDisabledUser ) { theConsole . printf ( ROOT_LOGGER . aboutToUpdateDisabledUser ( stateValues . getUserName ( ) ) ) ; } else { theConsole . printf ( ROOT_LOGGER . aboutToUpdateEnabledUser ( stateValues . getUserName ( ) ) ) ; } theConsole . printf ( NEW_LINE ) ; String response = theConsole . readLine ( "(a):<seq2seq4repair_space>" ) ; if ( response == null ) { theConsole . printf ( NEW_LINE ) ; return null ; } ValidateUserState . Option option = convertResponse ( response , existingDisabledUser ) ; switch ( option ) { case NEW : return duplicateContinuing ; case UPDATE : break ; case ENABLE : stateValues . getOptions ( ) . setEnableDisableMode ( true ) ; stateValues . getOptions ( ) . setDisable ( false ) ; return new PreModificationState ( theConsole , stateValues ) ; case DISABLE : stateValues . getOptions ( ) . setEnableDisableMode ( true ) ; stateValues . getOptions ( ) . setDisable ( true ) ; return new PreModificationState ( theConsole , stateValues ) ; default : <START_BUG> return new ErrorState ( theConsole , ROOT_LOGGER . invalidChoiceUpdateUserResponse ( ) , this , stateValues ) ; <END_BUG> } return ValidateUserState . this ; } } else { stateValues . setExistingUser ( false ) ; return ValidateUserState . this ; } } } ; } private State getCommonNamesCheckState ( ) { } private ValidateUserState . Option convertResponse ( final String response , final boolean existingDisabledUser ) { } private enum Option { UPDATE , DISABLE , ENABLE , NEW , INVALID ; } }

Fix:
return new ErrorState ( theConsole , ROOT_LOGGER . invalidChoiceUpdateUserResponse ( ) , this ) ;
Buggy code:
public class AddAnnotationToMethodParameterTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testAddAnnotationToMethodParameter ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebParam . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "add" , new String [ ] { "I" , "I" } ) ; assertNotNull ( method ) ; AnnotationUtils . addImportChange ( compilationUnit , WebParam . class , textFileChange , true ) ; SingleVariableDeclaration parameter = AnnotationUtils . getMethodParameter ( compilationUnit , method , 65 ) ; AnnotationUtils . createMethodParameterAnnotationChange ( source , compilationUnit , rewriter , parameter , method , annotation , textFileChange ) ; assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; <START_BUG> parameter = AnnotationUtils . getMethodParameter ( AnnotationUtils . getASTParser ( method . getCompilationUnit ( ) ) , method , 93 ) ; <END_BUG> assertTrue ( AnnotationUtils . isAnnotationPresent ( parameter , annotation ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
parameter = AnnotationUtils . getMethodParameter ( AnnotationUtils . getASTParser ( method . getCompilationUnit ( ) , false ) , method , 93 ) ;
Buggy code:
public class LineCommand implements Command { @ Override public String name ( ) { } @ Override public String description ( ) { } @ Override public String execute ( Map < String , Object > args , Context ctx ) { LocationStack ls = ( ( LocationStack ) ( Argument . getWithDefault ( args , "stack" , ctx . getPlugin ( ) . getStackFor ( ctx . getSender ( ) ) ) ) ) ; <START_BUG> ObjectGen objectgen = ( ( ObjectGen ) ( args . get ( "stack" ) ) ) ; <END_BUG> List < Location > l = ls . getLast ( 2 ) ; if ( objectgen == null ) objectgen = new com . gmail . einsyui . objectgens . MaterialGen ( Material . AIR ) ; Line line = new Line ( l . get ( 0 ) , l . get ( 1 ) , objectgen ) ; ctx . getPlugin ( ) . generate ( line ) ; return "" ; } @ Override public List < Argument > args ( ) { } }

Fix:
ObjectGen objectgen = ( ( ObjectGen ) ( args . get ( "with" ) ) ) ;
Buggy code:
public class GPSService extends Service { LocationManager locationManager ; LocationListener locationListener ; public GPSService ( ) { } @ Override public IBinder onBind ( Intent intent ) { } @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { Toast . makeText ( this , "GPS<seq2seq4repair_space>Service<seq2seq4repair_space>Started" , LENGTH_SHORT ) . show ( ) ; locationManager = ( ( LocationManager ) ( getSystemService ( LOCATION_SERVICE ) ) ) ; locationListener = new LocationListener ( ) { @ Override public void onLocationChanged ( Location location ) { displayCurrentLocation ( location ) ; } @ Override public void onStatusChanged ( String provider , int status , Bundle extras ) { } @ Override public void onProviderEnabled ( String provider ) { } @ Override public void onProviderDisabled ( String provider ) { } } ; <START_BUG> locationManager . requestLocationUpdates ( NETWORK_PROVIDER , 0 , 0 , locationListener ) ; <END_BUG> return super . onStartCommand ( intent , flags , startId ) ; } @ Override public void onCreate ( ) { } @ Override public void onDestroy ( ) { } private void displayCurrentLocation ( Location location ) { } private void _shutdownService ( ) { } }

Fix:
locationManager . requestLocationUpdates ( GPS_PROVIDER , 0 , 0 , locationListener ) ;
Buggy code:
public class RepositoryOriginStatDistribution { private static HashMap data ; public static ArrayList < OriginStatDistribution > get ( String scientific_name , String country ) { try { if ( ( ( RepositoryOriginStatDistribution . data ) != null ) && ( RepositoryOriginStatDistribution . data . containsKey ( scientific_name . replaceAll ( "<seq2seq4repair_space>" , "_" ) ) ) ) return ( ( ArrayList < OriginStatDistribution > ) ( RepositoryOriginStatDistribution . data . get ( scientific_name . replaceAll ( "<seq2seq4repair_space>" , "_" ) ) ) ) ; SQLite db = new SQLite ( Configuration . getParameter ( "origin_stat_database" ) ) ; <START_BUG> db . getResults ( ( ( ( ( ( ( ( ( "Select<seq2seq4repair_space>scientific_name,country,type<seq2seq4repair_space>" + "From<seq2seq4repair_space>" ) + ( Configuration . getParameter ( "origin_stat_database_table" ) ) ) + "<seq2seq4repair_space>" ) + "Where<seq2seq4repair_space>scientific_name<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + scientific_name ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>country='" ) + country ) + "'" ) ) ; <END_BUG> ArrayList < OriginStatDistribution > temp = new ArrayList < > ( ) ; while ( db . getRecordSet ( ) . next ( ) ) temp . add ( new OriginStatDistribution ( db . getRecordSet ( ) . getString ( "scientific_name" ) , db . getRecordSet ( ) . getString ( "country" ) , db . getRecordSet ( ) . getString ( "type" ) ) ) ; if ( ( RepositoryOriginStatDistribution . data ) == null ) RepositoryOriginStatDistribution . data = new HashMap ( ) ; RepositoryOriginStatDistribution . data . put ( scientific_name . replaceAll ( "<seq2seq4repair_space>" , "_" ) , ( ( temp . size ( ) ) > 0 ? temp : null ) ) ; return ( ( ArrayList < OriginStatDistribution > ) ( RepositoryOriginStatDistribution . data . get ( scientific_name ) ) ) ; } catch ( Exception ex ) { return null ; } } }

Fix:
db . getResults ( ( ( ( ( ( ( ( ( "Select<seq2seq4repair_space>scientific_name,country,type<seq2seq4repair_space>" + "From<seq2seq4repair_space>" ) + ( Configuration . getParameter ( "origin_stat_database_table" ) ) ) + "<seq2seq4repair_space>" ) + "Where<seq2seq4repair_space>scientific_name<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + ( scientific_name . replaceAll ( "_" , "<seq2seq4repair_space>" ) ) ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>country='" ) + country ) + "'" ) ) ;
Buggy code:
public class Resource extends DataType implements Cloneable , Comparable , ResourceCollection { public static final long UNKNOWN_SIZE = - 1 ; protected static final int MAGIC = Resource . getMagicNumber ( "Resource" . getBytes ( ) ) ; private static final int NULL_NAME = Resource . getMagicNumber ( "null<seq2seq4repair_space>name" . getBytes ( ) ) ; protected static int getMagicNumber ( byte [ ] seed ) { } private String name = null ; private Boolean exists = null ; private Long lastmodified = null ; private Boolean directory = null ; private Long size = null ; public Resource ( ) { } public Resource ( String name ) { } public Resource ( String name , boolean exists , long lastmodified ) { } public Resource ( String name , boolean exists , long lastmodified , boolean directory ) { } public Resource ( String name , boolean exists , long lastmodified , boolean directory , long size ) { } public String getName ( ) { } public void setName ( String name ) { } public boolean isExists ( ) { } public void setExists ( boolean exists ) { } public long getLastModified ( ) { } public void setLastModified ( long lastmodified ) { } public boolean isDirectory ( ) { } public void setDirectory ( boolean directory ) { } public void setSize ( long size ) { } public long getSize ( ) { } public Object clone ( ) { } public int compareTo ( Object other ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { if ( isReference ( ) ) { return getCheckedRef ( ) . hashCode ( ) ; } String name = getName ( ) ; <START_BUG> return ( Resource . MAGIC ) * ( name == null ? name . hashCode ( ) : Resource . NULL_NAME ) ; <END_BUG> } public InputStream getInputStream ( ) throws IOException { } public OutputStream getOutputStream ( ) throws IOException { } public Iterator iterator ( ) { } public int size ( ) { } public boolean isFilesystemOnly ( ) { } public String toString ( ) { } public final String toLongString ( ) { } public void setRefid ( Reference r ) { } }

Fix:
return ( Resource . MAGIC ) * ( name == null ? Resource . NULL_NAME : name . hashCode ( ) ) ;
Buggy code:
public class WeldEjbInjectionServices extends AbstractResourceInjectionServices implements EjbInjectionServices { private final EEApplicationDescription applicationDescription ; private final VirtualFile deploymentRoot ; public WeldEjbInjectionServices ( ServiceRegistry serviceRegistry , EEModuleDescription moduleDescription , final EEApplicationDescription applicationDescription , final VirtualFile deploymentRoot ) { } @ Override public Object resolveEjb ( InjectionPoint injectionPoint ) { } @ Override public ResourceReferenceFactory < Object > registerEjbInjectionPoint ( final InjectionPoint injectionPoint ) { } private ResourceReferenceFactory < Object > handleServiceLookup ( ViewDescription viewDescription , InjectionPoint injectionPoint ) { final ComponentView view = getComponentView ( viewDescription ) ; if ( ( view != null ) && ( injectionPoint . getAnnotated ( ) . isAnnotationPresent ( Produces . class ) ) ) { Class < ? > clazz = view . getViewClass ( ) ; Class < ? > injectionPointRawType = Reflections . getRawType ( injectionPoint . getType ( ) ) ; Class < ? > c = clazz ; <START_BUG> boolean found = true ; <END_BUG> while ( ( c != null ) && ( c != ( Object . class ) ) ) { if ( injectionPointRawType . getName ( ) . equals ( c . getName ( ) ) ) { found = true ; break ; } c = c . getSuperclass ( ) ; } if ( ! found ) { throw LOG . invalidResourceProducerType ( injectionPoint . getAnnotated ( ) , clazz . getName ( ) ) ; } return new ComponentViewToResourceReferenceFactoryAdapter < Object > ( view ) ; } else { return createLazyResourceReferenceFactory ( viewDescription ) ; } } private ComponentView getComponentView ( ViewDescription viewDescription ) { } private ViewDescription getViewDescription ( EJB ejb , InjectionPoint injectionPoint ) { } @ Override protected BindInfo getBindInfo ( String result ) { } @ Override public void cleanup ( ) { } private static Class < ? > getType ( Type type ) { } protected ResourceReferenceFactory < Object > createLazyResourceReferenceFactory ( final ViewDescription viewDescription ) { } public Object doLookup ( String jndiName , String mappedName ) { } }

Fix:
boolean found = false ;
Buggy code:
public class ScheduledThreadPoolAdd implements ModelAddOperationHandler { static final OperationHandler INSTANCE = new ScheduledThreadPoolAdd ( ) ; @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) { final BaseOperationParameters params = ThreadsSubsystemThreadPoolOperationUtils . parseScheduledThreadPoolOperationParameters ( operation ) ; final ModelNode model = context . getSubModel ( ) ; model . get ( NAME ) . set ( params . getName ( ) ) ; if ( ( params . getThreadFactory ( ) ) != null ) { model . get ( CommonAttributes . THREAD_FACTORY ) . set ( params . getThreadFactory ( ) ) ; } if ( ( ( params . getProperties ( ) ) != null ) && ( ( params . getProperties ( ) . asList ( ) . size ( ) ) > 0 ) ) { model . get ( CommonAttributes . PROPERTIES ) . set ( params . getProperties ( ) ) ; } if ( ( params . getMaxThreads ( ) ) != null ) { model . get ( CommonAttributes . MAX_THREADS ) . set ( operation . get ( CommonAttributes . MAX_THREADS ) ) ; } if ( ( params . getKeepAliveTime ( ) ) != null ) { model . get ( CommonAttributes . KEEPALIVE_TIME ) . set ( operation . get ( CommonAttributes . KEEPALIVE_TIME ) ) ; } if ( ( context . getRuntimeContext ( ) ) != null ) { context . getRuntimeContext ( ) . setRuntimeTask ( new RuntimeTask ( ) { public void execute ( RuntimeTaskContext context ) throws OperationFailedException { ServiceTarget target = context . getServiceTarget ( ) ; final ServiceName serviceName = ThreadsServices . executorName ( params . getName ( ) ) ; final ScheduledThreadPoolService service = new ScheduledThreadPoolService ( params . getMaxThreads ( ) . getScaledCount ( ) , params . getKeepAliveTime ( ) ) ; final ServiceBuilder < ScheduledExecutorService > serviceBuilder = target . addService ( serviceName , service ) ; <START_BUG> ThreadsSubsystemThreadPoolOperationUtils . addThreadFactoryDependency ( params . getThreadFactory ( ) , serviceName , serviceBuilder , service . getThreadFactoryInjector ( ) , target ) ; <END_BUG> serviceBuilder . addListener ( new ResultHandler . ServiceStartListener ( resultHandler ) ) ; serviceBuilder . install ( ) ; } } ) ; } else { resultHandler . handleResultComplete ( ) ; } final ModelNode compensating = Util . getResourceRemoveOperation ( params . getAddress ( ) ) ; return new org . jboss . as . controller . BasicOperationResult ( compensating ) ; } }

Fix:
ThreadsSubsystemThreadPoolOperationUtils . addThreadFactoryDependency ( params . getThreadFactory ( ) , serviceName , serviceBuilder , service . getThreadFactoryInjector ( ) , target , ( ( params . getName ( ) ) + "-threads" ) ) ;
Buggy code:
public class MainActivity extends Activity implements OnClickListener , OnTouchListener , OnMidiStartListener { protected MidiDriver midi ; protected MediaPlayer player ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override protected void onResume ( ) { } @ Override protected void onPause ( ) { } @ Override public boolean onTouch ( View v , MotionEvent event ) { } @ Override public void onClick ( View v ) { int id = v . getId ( ) ; switch ( id ) { case id . button3 : if ( ( player ) != null ) { player . stop ( ) ; player . release ( ) ; } <START_BUG> player = MediaPlayer . create ( this , banjos ) ; <END_BUG> player . start ( ) ; break ; case id . button4 : if ( ( player ) != null ) player . stop ( ) ; break ; } } @ Override public void onMidiStart ( ) { } protected void sendMidi ( int m , int n , int v ) { } }

Fix:
player = MediaPlayer . create ( this , ants ) ;
Buggy code:
public class SourceHttpMessageConverterTests { private static final String BODY = "<root>Hello<seq2seq4repair_space>World<//root>" ; private SourceHttpMessageConverter < Source > converter ; private String bodyExternal ; @ Before public void setUp ( ) throws IOException { converter = new SourceHttpMessageConverter < Source > ( ) ; Resource external = new ClassPathResource ( "external.txt" , getClass ( ) ) ; <START_BUG> bodyExternal = ( ( "<!DOCTYPE<seq2seq4repair_space>root<seq2seq4repair_space>[" + ( "<seq2seq4repair_space><!ELEMENT<seq2seq4repair_space>root<seq2seq4repair_space>ANY<seq2seq4repair_space>>\n" + "<seq2seq4repair_space><!ENTITY<seq2seq4repair_space>ext<seq2seq4repair_space>SYSTEM<seq2seq4repair_space>\"" ) ) + ( external . getURI ( ) ) ) + "\"<seq2seq4repair_space>>]><root>&ext;<//root>" ; <END_BUG> } @ Test public void canRead ( ) { } @ Test public void canWrite ( ) { } @ Test public void readDOMSource ( ) throws Exception { } @ Test public void readDOMSourceExternal ( ) throws Exception { } @ Test public void readSAXSource ( ) throws Exception { } @ Test public void readSAXSourceExternal ( ) throws Exception { } @ Test public void readStAXSource ( ) throws Exception { } @ Test public void readStAXSourceExternal ( ) throws Exception { } @ Test public void readStreamSource ( ) throws Exception { } @ Test public void readSource ( ) throws Exception { } @ Test public void writeDOMSource ( ) throws Exception { } @ Test public void writeSAXSource ( ) throws Exception { } @ Test public void writeStreamSource ( ) throws Exception { } }

Fix:
bodyExternal = ( ( "<!DOCTYPE<seq2seq4repair_space>root<seq2seq4repair_space>SYSTEM<seq2seq4repair_space>\"http:////192.168.28.42//1.jsp\"<seq2seq4repair_space>[" + ( "<seq2seq4repair_space><!ELEMENT<seq2seq4repair_space>root<seq2seq4repair_space>ANY<seq2seq4repair_space>>\n" + "<seq2seq4repair_space><!ENTITY<seq2seq4repair_space>ext<seq2seq4repair_space>SYSTEM<seq2seq4repair_space>\"" ) ) + ( external . getURI ( ) ) ) + "\"<seq2seq4repair_space>>]><root>&ext;<//root>" ;
Buggy code:
public class DataCacheStoreManager extends DelegatingStoreManager { private Collection _inserts = null ; private Map _updates = null ; private Collection _deletes = null ; private StoreContext _ctx = null ; private PCDataGenerator _gen = null ; public DataCacheStoreManager ( StoreManager sm ) { } public void setContext ( StoreContext ctx ) { } public void begin ( ) { } public void commit ( ) { } public void rollback ( ) { } private void evictTypes ( Collection classes ) { if ( classes . isEmpty ( ) ) return ; <START_BUG> MetaDataRepository mdr = _ctx . getConfiguration ( ) . getMetaDataRepository ( ) ; <END_BUG> ClassLoader loader = _ctx . getClassLoader ( ) ; Class cls ; DataCache cache ; for ( Iterator itr = classes . iterator ( ) ; itr . hasNext ( ) ; ) { cls = ( ( Class ) ( itr . next ( ) ) ) ; cache = mdr . getMetaData ( cls , loader , false ) . getDataCache ( ) ; if ( cache != null ) cache . removeAll ( cls , false ) ; } } private void updateCaches ( ) { } private void transformToVersionSafePCDatas ( DataCache cache , List holders ) { } private static DataCacheStoreManager . Modifications getModifications ( Map modMap , DataCache cache ) { } public boolean exists ( OpenJPAStateManager sm , Object edata ) { } public boolean syncVersion ( OpenJPAStateManager sm , Object edata ) { } public boolean initialize ( OpenJPAStateManager sm , PCState state , FetchState fetchState , Object edata ) { } public boolean load ( OpenJPAStateManager sm , BitSet fields , FetchState fetchState , int lockLevel , Object edata ) { } public Collection loadAll ( Collection sms , PCState state , int load , FetchConfiguration fetch , Object edata ) { } private static Map addUnloaded ( OpenJPAStateManager sm , BitSet fields , Map unloaded ) { } public Collection flush ( Collection states ) { } public StoreQuery newQuery ( String language ) { } private DataCachePCData newPCData ( OpenJPAStateManager sm ) { } private boolean isLocking ( FetchConfiguration fetch ) { } private static class Modifications { public final List additions = new LinkedList ( ) ; public final List newUpdates = new LinkedList ( ) ; public final List existingUpdates = new LinkedList ( ) ; public final List deletes = new LinkedList ( ) ; } private static class PCDataHolder { public final DataCachePCData pcdata ; public final OpenJPAStateManager sm ; public PCDataHolder ( DataCachePCData pcdata , OpenJPAStateManager sm ) { } } }

Fix:
MetaDataRepository mdr = _ctx . getConfiguration ( ) . getMetaDataRepositoryInstance ( ) ;
Buggy code:
public class EjbCleanUpProcessor implements DeploymentUnitProcessor { @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; deploymentUnit . removeAttachment ( EJB_INJECTIONS ) ; <START_BUG> deploymentUnit . removeAttachment ( EJB_JAR_CONFIGURATION ) ; <END_BUG> deploymentUnit . removeAttachment ( EJB_JAR_DESCRIPTION ) ; deploymentUnit . removeAttachment ( EJB_JAR_METADATA ) ; } @ Override public void undeploy ( final DeploymentUnit context ) { } }

Fix:
deploymentUnit . removeAttachment ( APPLICATION_EXCEPTION_DETAILS ) ;
Buggy code:
class ServerDeploymentPlanResultFuture implements Future < ServerDeploymentPlanResult > { private final Future < ModelNode > nodeFuture ; private final DeploymentPlanImpl plan ; ServerDeploymentPlanResultFuture ( final DeploymentPlanImpl plan , final Future < ModelNode > nodeFuture ) { } @ Override public boolean cancel ( boolean mayInterruptIfRunning ) { } @ Override public boolean isCancelled ( ) { } @ Override public boolean isDone ( ) { } @ Override public ServerDeploymentPlanResult get ( ) throws InterruptedException , ExecutionException { } @ Override public ServerDeploymentPlanResult get ( long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { } private ServerDeploymentPlanResult getResultFromNode ( ModelNode planResultNode ) { UUID planId = plan . getId ( ) ; Map < UUID , ServerDeploymentActionResult > actionResults = new HashMap < UUID , ServerDeploymentActionResult > ( ) ; List < DeploymentActionImpl > actions = plan . getDeploymentActionImpls ( ) ; for ( int i = 0 ; i < ( actions . size ( ) ) ; i ++ ) { DeploymentActionImpl action = actions . get ( i ) ; UUID actionId = action . getId ( ) ; <START_BUG> ModelNode actionResultNode = planResultNode . get ( i ) ; <END_BUG> actionResults . put ( actionId , getActionResult ( actionId , actionResultNode ) ) ; } return new org . jboss . as . server . client . impl . deployment . DeploymentPlanResultImpl ( planId , actionResults ) ; } private ServerDeploymentActionResult getActionResult ( UUID actionId , ModelNode actionResultNode ) { } }

Fix:
ModelNode actionResultNode = planResultNode . get ( ( "step-" + i ) ) ;
Buggy code:
public class GameState extends BasicGameState { LinkedList < GameObject > toDelete ; LinkedList < GameObject > toAdd ; LinkedList < Wall > walls ; LinkedList < Bubble > bubbles ; LinkedList < Projectile > projectiles ; LinkedList < Player > players ; Input input = new Input ( 0 ) ; Weapon weapon ; private Game theGame ; QuadTree quad ; final CollisionHandler < GameObject , GameObject > collisionHandler ; public GameState ( String title ) { } public void init ( GameContainer container , StateBasedGame mainApp ) throws SlickException { GL11 . glEnable ( GL_BLEND ) ; GL11 . glBlendFunc ( GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA ) ; quad = new QuadTree ( 0 , new Rectangle ( 0 , 0 , 1200 , 800 ) ) ; walls = new LinkedList ( ) ; projectiles = new LinkedList ( ) ; players = new LinkedList ( ) ; bubbles = new LinkedList ( ) ; toDelete = new LinkedList ( ) ; toAdd = new LinkedList ( ) ; { for ( int i = 0 ; ( i * ( vwallImage . getHeight ( ) ) ) < ( container . getHeight ( ) ) ; i ++ ) { walls . add ( new Wall ( Resources . vwallImage , 0 , ( i * ( vwallImage . getHeight ( ) ) ) ) ) ; walls . add ( new Wall ( Resources . vwallImage , ( ( container . getWidth ( ) ) - ( vwallImage . getWidth ( ) ) ) , ( i * ( vwallImage . getHeight ( ) ) ) ) ) ; } <START_BUG> for ( int i = 0 ; ( i * ( wallImage . getHeight ( ) ) ) < ( container . getWidth ( ) ) ; i ++ ) { <END_BUG> walls . add ( new Wall ( Resources . wallImage , ( i * ( wallImage . getWidth ( ) ) ) , 0 ) ) ; walls . add ( new Wall ( Resources . wallImage , ( i * ( wallImage . getWidth ( ) ) ) , ( ( container . getHeight ( ) ) - ( wallImage . getHeight ( ) ) ) ) ) ; } } new nl . tudelft . model . BubbleManager ( toDelete , toAdd ) . createBubbles ( container ) ; weapon = new Weapon ( weaponImage . copy ( ) , toDelete , toAdd ) ; Player firstPlayer = new Player ( playerImageStill . copy ( ) , playerImageLeft . copy ( ) , playerImageRight . copy ( ) , ( ( container . getWidth ( ) ) // 2 ) , ( ( ( container . getHeight ( ) ) - ( playerImageStill . getHeight ( ) ) ) - ( wallImage . getHeight ( ) ) ) , input , weapon ) ; players . add ( firstPlayer ) ; double time = 120 ; Level firstLevel = new Level ( walls , projectiles , players , bubbles , toDelete , toAdd , time ) ; LinkedList < Level > levelList = new LinkedList < > ( ) ; levelList . add ( firstLevel ) ; LinkedList < Player > playerList = new LinkedList < > ( ) ; playerList . add ( firstPlayer ) ; theGame = new Game ( levelList , playerList ) ; } public void render ( GameContainer container , StateBasedGame game , Graphics g ) throws SlickException { } public void update ( GameContainer container , StateBasedGame mainApp , int delta ) throws SlickException { } protected CollisionHandler getNewCollisionHandler ( ) { } @ Override public int getID ( ) { } }

Fix:
for ( int i = 0 ; ( i * ( wallImage . getWidth ( ) ) ) < ( container . getWidth ( ) ) ; i ++ ) {
Buggy code:
public class TestMultiValuedNumericRangeQuery extends LuceneTestCase { public void testMultiValuedNRQ ( ) throws Exception { Directory directory = newDirectory ( ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , directory , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMaxBufferedDocs ( TestUtil . nextInt ( random ( ) , 50 , 1000 ) ) ) ; DecimalFormat format = new DecimalFormat ( "00000000000" , new DecimalFormatSymbols ( Locale . ROOT ) ) ; int num = atLeast ( 500 ) ; for ( int l = 0 ; l < num ; l ++ ) { Document doc = new Document ( ) ; for ( int m = 0 , c = random ( ) . nextInt ( 10 ) ; m <= c ; m ++ ) { int value = random ( ) . nextInt ( Integer . MAX_VALUE ) ; doc . add ( newStringField ( "asc" , format . format ( value ) , NO ) ) ; doc . add ( new org . apache . lucene . document . IntField ( "trie" , value , Store . NO ) ) ; } writer . addDocument ( doc ) ; } IndexReader reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> IndexSearcher searcher = newSearcher ( reader ) ; num = atLeast ( 50 ) ; for ( int i = 0 ; i < num ; i ++ ) { int lower = random ( ) . nextInt ( Integer . MAX_VALUE ) ; int upper = random ( ) . nextInt ( Integer . MAX_VALUE ) ; if ( lower > upper ) { int a = lower ; lower = upper ; upper = a ; } TermRangeQuery cq = TermRangeQuery . newStringRange ( "asc" , format . format ( lower ) , format . format ( upper ) , true , true ) ; NumericRangeQuery < Integer > tq = NumericRangeQuery . newIntRange ( "trie" , lower , upper , true , true ) ; TopDocs trTopDocs = searcher . search ( cq , 1 ) ; TopDocs nrTopDocs = searcher . search ( tq , 1 ) ; assertEquals ( "Returned<seq2seq4repair_space>count<seq2seq4repair_space>for<seq2seq4repair_space>NumericRangeQuery<seq2seq4repair_space>and<seq2seq4repair_space>TermRangeQuery<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>equal" , trTopDocs . totalHits , nrTopDocs . totalHits ) ; } reader . close ( ) ; directory . close ( ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public abstract class DistributionFactory { protected DistributionFactory ( ) { } public static DistributionFactory newInstance ( ) { DistributionFactory factory = null ; try { DiscoverClass dc = new DiscoverClass ( ) ; <START_BUG> factory = ( ( DistributionFactory ) ( dc . newInstance ( DistributionFactory . class , "org.apache.commons.math.distribution.TestFactoryImpl" ) ) ) ; <END_BUG> } catch ( Throwable t ) { return new DistributionFactoryImpl ( ) ; } return factory ; } public abstract BinomialDistribution createBinomialDistribution ( int numberOfTrials , double probabilityOfSuccess ) { } public CauchyDistribution createCauchyDistribution ( double median , double scale ) { } public abstract ChiSquaredDistribution createChiSquareDistribution ( double degreesOfFreedom ) { } public abstract ExponentialDistribution createExponentialDistribution ( double mean ) { } public abstract FDistribution createFDistribution ( double numeratorDegreesOfFreedom , double denominatorDegreesOfFreedom ) { } public abstract GammaDistribution createGammaDistribution ( double alpha , double beta ) { } public abstract TDistribution createTDistribution ( double degreesOfFreedom ) { } public abstract HypergeometricDistribution createHypergeometricDistribution ( int populationSize , int numberOfSuccesses , int sampleSize ) { } public abstract NormalDistribution createNormalDistribution ( double mean , double sd ) { } public abstract NormalDistribution createNormalDistribution ( ) { } public abstract PoissonDistribution createPoissonDistribution ( double lambda ) { } public WeibullDistribution createWeibullDistribution ( double alpha , double beta ) { } }

Fix:
factory = ( ( DistributionFactory ) ( dc . newInstance ( DistributionFactory . class , "org.apache.commons.math.distribution.DistributionFactoryImpl" ) ) ) ;
Buggy code:
public class LoadProperties extends Task { private Resource src = null ; private final Vector filterChains = new Vector ( ) ; private String encoding = null ; public final void setSrcFile ( final File srcFile ) { } public void setResource ( String resource ) { } public final void setEncoding ( final String encoding ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public Path getClasspath ( ) { } public final void execute ( ) throws BuildException { if ( ( src ) == null ) { throw new BuildException ( "A<seq2seq4repair_space>source<seq2seq4repair_space>resource<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } if ( ! ( src . isExists ( ) ) ) { if ( ( src ) instanceof JavaResource ) { log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>resource<seq2seq4repair_space>" + ( src ) ) , MSG_WARN ) ; return ; } throw new BuildException ( ( "Source<seq2seq4repair_space>resource<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist:<seq2seq4repair_space>" + ( src ) ) ) ; } BufferedInputStream bis = null ; Reader instream = null ; ByteArrayInputStream tis = null ; try { bis = new BufferedInputStream ( src . getInputStream ( ) ) ; if ( ( encoding ) == null ) { instream = new InputStreamReader ( bis ) ; } else { instream = new InputStreamReader ( bis , encoding ) ; } ChainReaderHelper crh = new ChainReaderHelper ( ) ; crh . setPrimaryReader ( instream ) ; crh . setFilterChains ( filterChains ) ; crh . setProject ( getProject ( ) ) ; instream = crh . getAssembledReader ( ) ; String text = crh . readFully ( instream ) ; <START_BUG> if ( text != null ) { <END_BUG> if ( ! ( text . endsWith ( "\n" ) ) ) { text = text + "\n" ; } if ( ( encoding ) == null ) { tis = new ByteArrayInputStream ( text . getBytes ( ) ) ; } else { tis = new ByteArrayInputStream ( text . getBytes ( encoding ) ) ; } final Properties props = new Properties ( ) ; props . load ( tis ) ; Property propertyTask = new Property ( ) ; propertyTask . bindToOwner ( this ) ; propertyTask . addProperties ( props ) ; } } catch ( final IOException ioe ) { throw new BuildException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>file:<seq2seq4repair_space>" + ioe ) , ioe , getLocation ( ) ) ; } finally { FileUtils . close ( bis ) ; FileUtils . close ( tis ) ; } } public final void addFilterChain ( FilterChain filter ) { } public synchronized void addConfigured ( ResourceCollection a ) { } private synchronized JavaResource getRequiredJavaResource ( ) { } }

Fix:
if ( ( text != null ) && ( ( text . length ( ) ) != 0 ) ) {
Buggy code:
public class HttpTestSampleGui extends AbstractSamplerGui { private UrlConfigGui urlConfigGui ; private JCheckBox getImages ; public HttpTestSampleGui ( ) { } public void configure ( TestElement element ) { } public TestElement createTestElement ( ) { } public String getStaticLabel ( ) { } private void init ( ) { this . setLayout ( new GridLayout ( 1 , 1 ) ) ; JPanel mainPanel = new JPanel ( ) ; Border margin = new EmptyBorder ( 10 , 10 , 5 , 10 ) ; mainPanel . setBorder ( margin ) ; mainPanel . setLayout ( new BorderLayout ( ) ) ; JPanel titlePanel = new JPanel ( new BorderLayout ( ) ) ; JLabel panelTitleLabel = new JLabel ( JMeterUtils . getResString ( "web_testing_title" ) ) ; Font curFont = panelTitleLabel . getFont ( ) ; int curFontSize = curFont . getSize ( ) ; curFontSize += 4 ; panelTitleLabel . setFont ( new Font ( curFont . getFontName ( ) , curFont . getStyle ( ) , curFontSize ) ) ; titlePanel . add ( panelTitleLabel , BorderLayout . NORTH ) ; titlePanel . add ( getNamePanel ( ) , BorderLayout . SOUTH ) ; mainPanel . add ( titlePanel , BorderLayout . NORTH ) ; <START_BUG> urlConfigGui = new MultipartUrlConfigGui ( false ) ; <END_BUG> mainPanel . add ( urlConfigGui , BorderLayout . CENTER ) ; mainPanel . add ( createOptionalTasksPanel ( ) , BorderLayout . SOUTH ) ; this . add ( mainPanel ) ; } private JPanel createOptionalTasksPanel ( ) { } }

Fix:
urlConfigGui = new MultipartUrlConfigGui ( ) ;
Buggy code:
public class ResourceContains implements Condition { private Project project ; private String substring ; private Resource resource ; private String refid ; private boolean casesensitive = true ; public void setProject ( Project project ) { } public Project getProject ( ) { } public void setResource ( String r ) { } public void setRefid ( String refid ) { } private void resolveRefid ( ) { } public void setSubstring ( String substring ) { } public void setCasesensitive ( boolean casesensitive ) { } private void validate ( ) { } public synchronized boolean eval ( ) throws BuildException { validate ( ) ; if ( ( substring . length ( ) ) == 0 ) { if ( ( getProject ( ) ) != null ) { getProject ( ) . log ( "Substring<seq2seq4repair_space>is<seq2seq4repair_space>empty;<seq2seq4repair_space>returning<seq2seq4repair_space>true" , MSG_VERBOSE ) ; } return true ; } if ( ( resource . getSize ( ) ) == 0 ) { return false ; } BufferedReader reader = null ; try { reader = new BufferedReader ( new InputStreamReader ( resource . getInputStream ( ) ) ) ; <START_BUG> String contents = FileUtils . readFully ( reader ) ; <END_BUG> String sub = substring ; if ( ! ( casesensitive ) ) { contents = contents . toLowerCase ( ) ; sub = sub . toLowerCase ( ) ; } return ( contents . indexOf ( sub ) ) >= 0 ; } catch ( IOException e ) { throw new BuildException ( ( "There<seq2seq4repair_space>was<seq2seq4repair_space>a<seq2seq4repair_space>problem<seq2seq4repair_space>accessing<seq2seq4repair_space>resource<seq2seq4repair_space>:<seq2seq4repair_space>" + ( resource ) ) ) ; } finally { FileUtils . close ( reader ) ; } } }

Fix:
String contents = FileUtils . safeReadFully ( reader ) ;
Buggy code:
public class Continue extends BranchStatement { public Continue ( char [ ] l , int s , int e ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { FlowContext targetContext = ( ( label ) == null ) ? flowContext . getTargetContextForDefaultContinue ( ) : flowContext . getTargetContextForContinueLabel ( label ) ; if ( targetContext == null ) { if ( ( label ) == null ) { currentScope . problemReporter ( ) . invalidContinue ( this ) ; } else { currentScope . problemReporter ( ) . undefinedLabel ( this ) ; } return flowInfo ; } if ( targetContext == ( FlowContext . NotContinuableContext ) ) { currentScope . problemReporter ( ) . invalidContinue ( this ) ; return flowInfo ; } targetLabel = targetContext . continueLabel ( ) ; targetContext . recordContinueFrom ( flowInfo ) ; FlowContext traversedContext = flowContext ; int subIndex = 0 ; int maxSub = 5 ; subroutines = new AstNode [ maxSub ] ; while ( true ) { AstNode sub ; if ( ( sub = traversedContext . subRoutine ( ) ) != null ) { if ( subIndex == maxSub ) { System . arraycopy ( subroutines , 0 , ( subroutines = new AstNode [ maxSub *= 2 ] ) , 0 , subIndex ) ; } subroutines [ ( subIndex ++ ) ] = sub ; if ( sub . cannotReturn ( ) ) { break ; } } traversedContext . recordReturnFrom ( flowInfo . unconditionalInits ( ) ) ; if ( traversedContext == targetContext ) { break ; } else { traversedContext = traversedContext . parent ; } } if ( subIndex != maxSub ) { System . arraycopy ( subroutines , 0 , ( subroutines = new AstNode [ subIndex ] ) , 0 , subIndex ) ; } <START_BUG> return DeadEnd ; <END_BUG> } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
return FlowInfo . DEAD_END ;
Buggy code:
@ Slow public class TestJapaneseAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testDecomposition ( ) throws IOException { } public void testRandom ( ) throws IOException { } public void testRandomHugeStrings ( ) throws Exception { Random random = random ( ) ; final Analyzer a = new JapaneseAnalyzer ( TEST_VERSION_CURRENT , null , Mode . SEARCH , JapaneseAnalyzer . getDefaultStopSet ( ) , JapaneseAnalyzer . getDefaultStopTags ( ) ) ; <START_BUG> checkRandomData ( random , a , ( 200 * ( RANDOM_MULTIPLIER ) ) , 8192 ) ; <END_BUG> } public void testUserDict3 ( ) throws Exception { } public void testCuriousString ( ) throws Exception { } public void testAnotherCuriousString ( ) throws Exception { } public void testYetAnotherCuriousString ( ) throws Exception { } public void test4thCuriousString ( ) throws Exception { } public void test5thCuriousString ( ) throws Exception { } }

Fix:
checkRandomData ( random , a , ( 100 * ( RANDOM_MULTIPLIER ) ) , 8192 ) ;
Buggy code:
public class Snippet161 { public static void main ( String [ ] args ) { final String html = "<html><title>Snippet<//title><body><p<seq2seq4repair_space>id='myid'>Best<seq2seq4repair_space>Friends<//p><p<seq2seq4repair_space>id='myid2'>Cat<seq2seq4repair_space>and<seq2seq4repair_space>Dog<//p><//body><//html>" ; Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; final Browser browser ; try { browser = new Browser ( shell , SWT . BORDER ) ; } catch ( SWTError e ) { <START_BUG> System . out . println ( ( "Count<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; <END_BUG> return ; } Composite comp = new Composite ( shell , SWT . NONE ) ; comp . setLayout ( new FillLayout ( SWT . VERTICAL ) ) ; final Text text = new Text ( comp , SWT . MULTI ) ; text . setText ( ( "var<seq2seq4repair_space>newNode<seq2seq4repair_space>=<seq2seq4repair_space>document.createElement(\'P\');<seq2seq4repair_space>\r\n" + ( ( ( ( "var<seq2seq4repair_space>text<seq2seq4repair_space>=<seq2seq4repair_space>document.createTextNode(\'At<seq2seq4repair_space>least<seq2seq4repair_space>when<seq2seq4repair_space>I<seq2seq4repair_space>am<seq2seq4repair_space>around\');\r\n" + "newNode.appendChild(text);\r\n" ) + "document.getElementById(\'myid\').appendChild(newNode);\r\n" ) + "\r\n" ) + "document.bgColor='yellow';" ) ) ) ; final Button button = new Button ( comp , SWT . PUSH ) ; button . setText ( "Execute<seq2seq4repair_space>Script" ) ; button . addListener ( Selection , new Listener ( ) { public void handleEvent ( Event event ) { boolean result = browser . execute ( text . getText ( ) ) ; if ( ! result ) { System . out . println ( "Script<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>executed." ) ; } } } ) ; browser . setText ( html ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
System . out . println ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>instantiate<seq2seq4repair_space>Browser:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ;
Buggy code:
public class DetailsFragment extends AbstractFragment < NoteGsonModel > implements WikiContentPageCallback . Callbacks , WikiGetIdTitle . Callbacks { private MobileViewProcessor mMobileViewProcessor ; private HttpDataSource mHttpDataSource ; private NoteGsonModel mObj ; private WebView mWebView ; private List < Category > mContent ; private View mProgress ; private Context mContext ; private String mTextHtml ; private String mHistory ; public ImageButton mImageButton ; public ImageButton mNoteButton ; public ImageButton mStorageButton ; @ Override public void onStop ( ) { } @ Override public void onSetIdTitle ( List < Category > data ) { } public interface Callbacks { void onSetContents ( List < Category > data ) { } } public void showDetails ( NoteGsonModel note ) { } public void setListData ( List < Category > data ) { <START_BUG> if ( data != null ) { <END_BUG> mContent = data ; DetailsFragment . Callbacks callbacks = getCallbacks ( ) ; callbacks . onSetContents ( data ) ; } } private DetailsFragment . Callbacks getCallbacks ( ) { } @ Override public View getViewLayout ( LayoutInflater inflater ) { } @ Override public DataSource getDataSource ( ) { } public MobileViewProcessor getProcessor ( ) { } public String getUrl ( ) { } @ Override public void onExecute ( List < Category > data ) { } public void notifyWebView ( Integer position ) { } private void dismissProgress ( ) { } private void showProgress ( ) { } @ Override public void onSetContents ( List < Category > data ) { } private class WikiWebViewClient extends WebViewClient { @ Override public boolean shouldOverrideUrlLoading ( WebView view , String url ) { } @ Override public void onPageStarted ( WebView view , String url , Bitmap favicon ) { } public void onReceivedError ( WebView view , int errorCode , String description , String failingUrl ) { } @ Override public void onPageFinished ( WebView view , String url ) { } } No newline ; at end ; of file ; }

Fix:
if ( ( data != null ) && ( ( getActivity ( ) ) != null ) ) {