nus-yam/ex-repair huggingface dataset:
Buggy code:
public class POP3Store { public static final int STATE_NONAUTHENTICATE = 0 ; public static final int STATE_AUTHENTICATE = 1 ; private int state = POP3Store . STATE_NONAUTHENTICATE ; private POP3Protocol protocol ; private PopItem popItem ; private POP3PreProcessingFilterPluginHandler handler ; public POP3Store ( PopItem popItem ) { } public int getState ( ) { } public void setState ( int state ) { } public Vector fetchUIDList ( int totalMessageCount , WorkerStatusController worker ) throws Exception { } public Vector fetchMessageSizeList ( WorkerStatusController worker ) throws Exception { } public int fetchMessageCount ( WorkerStatusController worker ) throws Exception { } public void deleteMessage ( int index , WorkerStatusController worker ) throws Exception { } protected String modifyMessage ( String rawString ) { } public Message fetchMessage ( int index , WorkerStatusController worker ) throws Exception { } public void logout ( ) throws Exception { } public void close ( ) throws Exception { } public void login ( WorkerStatusController worker ) throws Exception { PasswordDialog dialog ; boolean login = false ; <START_BUG> String password ; <END_BUG> String user = new String ( "" ) ; String method = new String ( "" ) ; boolean save = false ; while ( ! login ) { boolean b = protocol . openPort ( popItem . get ( "host" ) , popItem . getInteger ( "port" ) ) ; log . debug ( ( "open<seq2seq4repair_space>port:<seq2seq4repair_space>" + b ) ) ; log . debug ( "login==false" ) ; if ( ( ( password = popItem . get ( "password" ) ) . length ( ) ) == 0 ) { dialog = new PasswordDialog ( ) ; dialog . showDialog ( popItem . get ( "host" ) , popItem . get ( "password" ) , popItem . getBoolean ( "save_password" ) ) ; if ( dialog . success ( ) ) { password = new String ( dialog . getPassword ( ) ) ; save = dialog . getSave ( ) ; } else { worker . cancel ( ) ; throw new CommandCancelledException ( ) ; } } else { save = popItem . getBoolean ( "save_password" ) ; } protocol . setLoginMethod ( popItem . get ( "login_method" ) ) ; log . debug ( "try<seq2seq4repair_space>to<seq2seq4repair_space>login" ) ; login = protocol . login ( popItem . get ( "user" ) , password ) ; if ( ! login ) { popItem . set ( "password" , "" ) ; state = POP3Store . STATE_NONAUTHENTICATE ; protocol . logout ( ) ; protocol . close ( ) ; } } popItem . set ( "save_password" , save ) ; state = POP3Store . STATE_AUTHENTICATE ; if ( save ) { popItem . set ( "password" , password ) ; } } public boolean isLogin ( WorkerStatusController worker ) throws Exception { } }

Fix:
String password = null ;
Buggy code:
public class ShareManager implements TypeChoosingFragment . TypeChosenListener { private LoadingFragment loadingFragment ; private AppCompatActivity activity ; private SideLoadInformation sideLoadInformation ; private ShareManager . ShareManagerListener listener ; public ShareManager ( AppCompatActivity activity , SideLoadInformation sideLoadInformation , ShareManager . ShareManagerListener listener ) { } private Context getApplicationContext ( ) { } public void typeWasChosen ( SideLoadType type ) { } private Uri getFileUri ( ) { } private void startShareOtherAction ( ) { } private void startBluetoothShareAction ( ) { } private void openBluetoothSharing ( ) { } private void startNFCShareAction ( ) { } private void startWIFIShareAction ( ) { } private void startStorageShareAction ( ) { } private void saveToFile ( File folder ) { <START_BUG> ShareManager . copyFile ( new File ( sideLoadInformation . getUri ( ) . getPath ( ) ) , folder ) ; <END_BUG> } private void unzipFiles ( File archive , File newFile ) { } private void unzipEntry ( ZipFile zipfile , ZipEntry entry , File outputDir ) throws IOException { } public static void copyFile ( File source , File newFile ) { } public static int copy ( BufferedInputStream in , BufferedOutputStream out ) { } private byte [ ] getFileBytes ( ) { } private void startSDCardShareAction ( ) { } private void showSuccessAlert ( boolean success , String filePath ) { } public void setLoadingFragmentVisibility ( final boolean visible , final String loadingText , final boolean cancelable ) { } public interface ShareManagerListener { void finished ( ) { } } }

Fix:
ShareManager . copyFile ( new File ( sideLoadInformation . getUri ( ) . getPath ( ) ) , new File ( folder , sideLoadInformation . fileName ) ) ;
Buggy code:
public class OutboxFolder extends CachedMHFolder { private SendListManager [ ] sendListManager = new SendListManager [ 2 ] ; private int actSender ; private boolean isSending ; protected OutboxFolder . OutboxHeaderCache cache ; public OutboxFolder ( FolderItem item ) { } public AbstractMessage getMessage ( Object uid , WorkerStatusController worker ) throws Exception { } public String getDefaultChild ( ) { <START_BUG> return "CachedMHFolder" ; <END_BUG> } private void swapListManagers ( ) throws Exception { } public void stoppedSending ( ) { } public void save ( WorkerStatusController worker ) throws Exception { } class OutboxHeaderCache extends LocalHeaderCache { public OutboxHeaderCache ( CachedFolder folder ) { } public HeaderInterface createHeaderInstance ( ) { } protected void loadHeader ( ObjectInputStream p , HeaderInterface h ) throws Exception { } protected void saveHeader ( ObjectOutputStream p , HeaderInterface h ) throws Exception { } } }

Fix:
return "MHFolder" ;
Buggy code:
public class DataProcessorServiceHostApplication implements IDistributionConstants , IApplication { private static final String LB_SVCHOST_CONTAINER_TYPE = "ecf.jms.activemq.tcp.manager.lb.svchost" ; public static final String DEFAULT_QUEUE_ID = "tcp:////localhost:61616//exampleQueue" ; private static final String DEFAULT_TOPIC_ID = "tcp:////localhost:61616//exampleTopic" ; private BundleContext bundleContext ; private ServiceTracker containerManagerServiceTracker ; private String containerType = DataProcessorServiceHostApplication . LB_SVCHOST_CONTAINER_TYPE ; private String queueId = DataProcessorServiceHostApplication . DEFAULT_QUEUE_ID ; private String topicId = DataProcessorServiceHostApplication . DEFAULT_TOPIC_ID ; private ServiceRegistration dataProcessorServiceServiceRegistration ; private boolean useECFRemoteServices = false ; private IContainer container ; private IRemoteServiceRegistration dataProcessorServiceHostRegistration ; public Object start ( IApplicationContext appContext ) throws Exception { } private void registerOSGiRemoteService ( ) throws Exception { } private void registerECFRemoteService ( ) throws Exception { } public void stop ( ) { if ( ( dataProcessorServiceServiceRegistration ) != null ) { dataProcessorServiceServiceRegistration . unregister ( ) ; dataProcessorServiceServiceRegistration = null ; } if ( ( dataProcessorServiceHostRegistration ) != null ) { dataProcessorServiceHostRegistration . unregister ( ) ; dataProcessorServiceHostRegistration = null ; } if ( ( container ) != null ) { container . dispose ( ) ; container = null ; getContainerManagerService ( ) . removeAllContainers ( ) ; } if ( ( containerManagerServiceTracker ) != null ) { containerManagerServiceTracker . close ( ) ; containerManagerServiceTracker = null ; } bundleContext = null ; synchronized ( appLock ) { done = true ; <START_BUG> notifyAll ( ) ; <END_BUG> } } private void processArgs ( IApplicationContext appContext ) { } private IContainerManager getContainerManagerService ( ) { } private final Object appLock = new Object ( ) ; private boolean done = false ; private void waitForDone ( ) { } }

Fix:
appLock . notifyAll ( ) ;
Buggy code:
public class DecoupledAjaxUpdatePage extends BasePage { private int counter ; public DecoupledAjaxUpdatePage ( ) { } public class CounterUpdate { private final AjaxRequestTarget target ; public CounterUpdate ( AjaxRequestTarget target ) { } public AjaxRequestTarget getTarget ( ) { } } public class CounterLabel extends Label { public CounterLabel ( String id ) { } @ Override public void onEvent ( IEvent < ? > event ) { super . onEvent ( event ) ; if ( ( event . getPayload ( ) ) instanceof DecoupledAjaxUpdatePage . CounterUpdate ) { DecoupledAjaxUpdatePage . CounterUpdate update = ( ( DecoupledAjaxUpdatePage . CounterUpdate ) ( event . getPayload ( ) ) ) ; <START_BUG> update . getTarget ( ) . addComponent ( this ) ; <END_BUG> } } } }

Fix:
update . getTarget ( ) . add ( this ) ;
Buggy code:
public class LogWriterJavaStandaloneSync implements LogWriter { @ Override public Response write ( LogMessageContainer logMessageContainer ) { Response response = new Response ( ) ; response . setReturn ( false ) ; try { Transactions transactions = new ProxyObjectMapperImpl ( ) . logToSOAPTransactions ( logMessageContainer ) ; QName QName = new QName ( "urn:generic.com:Global:TransactionLogger" , "TransactionLogSynchronousService" ) ; URL wsdlLocation = new URL ( LoggerPropertyUtil . getProperty ( LOGMESSAGESERVICE_WSDL_LOCATION_SYNC ) ) ; TransactionLogSynchronousService service = new TransactionLogSynchronousService ( wsdlLocation , QName ) ; response = service . getTransactionLogSynchronousInPort ( ) . persist ( transactions ) ; } catch ( MalformedURLException ex ) { String msgText = getMalformedURLExceptionText ( LOGMESSAGESERVICE_WSDL_LOCATION_SYNC ) . toString ( ) ; <START_BUG> Logger . getLogger ( LogWriterGlassFishAsync . class . getName ( ) ) . log ( Level . SEVERE , msgText ) ; <END_BUG> Logger . getLogger ( LogWriterJavaStandaloneSync . class . getName ( ) ) . log ( Level . SEVERE , ex . getMessage ( ) ) ; } catch ( ServiceFault ex ) { Logger . getLogger ( LogWriterJavaStandaloneSync . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } return response ; } private StringBuilder getMalformedURLExceptionText ( String wsdl_location ) { } }

Fix:
Logger . getLogger ( LogWriterJavaStandaloneSync . class . getName ( ) ) . log ( Level . SEVERE , msgText ) ;
Buggy code:
public class BoardComposite extends Composite { Board board ; Grid grid ; private HashMap < Integer , Integer > scoreBoard = new HashMap < Integer , Integer > ( ) ; private NumberLabel < Integer > blacksCountLabel ; private NumberLabel < Integer > whitesCountLabel ; private NumberLabel < Integer > clicksCountLabel ; private NumberLabel < Integer > pointsLabel ; private NumberLabel < Integer > levelLabel ; private Button previousLevelButton ; private Button nextLevelButton ; public BoardComposite ( int side ) { } public void generateGrid ( int width , int height ) { } public void click ( int x , int y ) { } private void onVictory ( ) { } private int estimateRating ( int width , int height , int clicks ) { } private static int estimatePoints ( int level , int width , int height , int clicks ) { } private static int getMinClicks ( int width , int height ) { } protected void gotoLevel ( int level ) { levelLabel . setValue ( new Integer ( level ) ) ; if ( level == 1 ) { generateGrid ( 3 , 3 ) ; board . flip ( 0 , 0 ) ; board . flip ( 0 , 2 ) ; board . flip ( 2 , 0 ) ; board . flip ( 2 , 2 ) ; grid . setHTML ( 1 , 1 , "Click<seq2seq4repair_space>me<seq2seq4repair_space>!" ) ; for ( int y = 0 ; y < ( grid . getRowCount ( ) ) ; y ++ ) { for ( int x = 0 ; x < ( grid . getColumnCount ( ) ) ; x ++ ) { grid . setHTML ( y , x , "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ) ; } } updateAllCells ( ) ; updateCounters ( ) ; } else { int width = ( ( level + 2 ) // 2 ) + ( level % 2 ) ; int height = ( level + 2 ) // 2 ; generateGrid ( width , height ) ; } if ( level <= 1 ) previousLevelButton . setEnabled ( false ) ; else previousLevelButton . setEnabled ( true ) ; <START_BUG> if ( level < ( getHighestLevelCompleted ( ) ) ) <END_BUG> nextLevelButton . setEnabled ( true ) ; else nextLevelButton . setEnabled ( false ) ; } public void updateCell ( int x , int y ) { } public void updateAllCells ( ) { } public void updateCounters ( ) { } public void incrementClicks ( ) { } public void resetClicks ( ) { } public void setScoreIfBetter ( int level , int clicks ) { } public int getScoreForLevel ( int level ) { } public void setScoreForLevel ( int level , int clicks ) { } public int getHighestLevelCompleted ( ) { } }

Fix:
if ( level <= ( getHighestLevelCompleted ( ) ) )
Buggy code:
public abstract class AbstractEEAnnotationProcessor implements DeploymentUnitProcessor { public final void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( EE_MODULE_DESCRIPTION ) ; final CompositeIndex index = deploymentUnit . getAttachment ( COMPOSITE_ANNOTATION_INDEX ) ; <START_BUG> final Boolean replacement = deploymentUnit . getAttachment ( EJB_ANNOTATION_PROPERTY_REPLACEMENT ) ; <END_BUG> if ( ( index == null ) || ( eeModuleDescription == null ) ) { return ; } final List < ClassAnnotationInformationFactory > factories = annotationInformationFactories ( ) ; for ( final ClassAnnotationInformationFactory factory : factories ) { final Map < String , ClassAnnotationInformation < ? , ? > > data = factory . createAnnotationInformation ( index , replacement ) ; for ( Map . Entry < String , ClassAnnotationInformation < ? , ? > > entry : data . entrySet ( ) ) { EEModuleClassDescription clazz = eeModuleDescription . addOrGetLocalClassDescription ( entry . getKey ( ) ) ; clazz . addAnnotationInformation ( entry . getValue ( ) ) ; } } afterAnnotationsProcessed ( phaseContext , deploymentUnit ) ; } protected void afterAnnotationsProcessed ( final DeploymentPhaseContext phaseContext , final DeploymentUnit deploymentUnit ) { } protected abstract List < ClassAnnotationInformationFactory > annotationInformationFactories ( ) { } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
final Boolean replacement = deploymentUnit . getAttachment ( ANNOTATION_PROPERTY_REPLACEMENT ) ;
Buggy code:
public abstract class WorkbenchWizardNode implements IWizardNode , IPluginContribution { protected WorkbenchWizardSelectionPage parentWizardPage ; protected IWizard wizard ; protected IWizardDescriptor wizardElement ; public WorkbenchWizardNode ( WorkbenchWizardSelectionPage aWizardPage , IWizardDescriptor element ) { } public abstract IWorkbenchWizard createWizard ( ) throws CoreException { } public void dispose ( ) { } protected IStructuredSelection getCurrentResourceSelection ( ) { } public Point getExtent ( ) { } public String getLocalId ( ) { } public String getPluginId ( ) { IPluginContribution contribution = ( ( IPluginContribution ) ( Util . getAdapter ( wizardElement , IPluginContribution . class ) ) ) ; if ( contribution != null ) { <START_BUG> return contribution . getLocalId ( ) ; <END_BUG> } return null ; } public IWizard getWizard ( ) { } public IWizardDescriptor getWizardElement ( ) { } protected IWorkbench getWorkbench ( ) { } public boolean isContentCreated ( ) { } }

Fix:
return contribution . getPluginId ( ) ;
Buggy code:
public class Tries { public class TrieNode { Character c ; boolean isWord ; Tries . TrieNode [ ] children ; public TrieNode ( ) { } public TrieNode ( char c ) { } } Tries . TrieNode root ; public Tries ( ) { } public void insert ( String word ) { if ( ( word == null ) || ( ( word . length ( ) ) == 0 ) ) { throw new IllegalArgumentException ( "Input<seq2seq4repair_space>string<seq2seq4repair_space>is<seq2seq4repair_space>null<seq2seq4repair_space>or<seq2seq4repair_space>empty" ) ; } Tries . TrieNode temp = root ; for ( int i = 0 ; i < ( word . length ( ) ) ; i ++ ) { <START_BUG> int index = ( word . charAt ( 0 ) ) - 'a' ; <END_BUG> if ( ( temp . children [ index ] ) == null ) { temp . children [ index ] = new Tries . TrieNode ( word . charAt ( i ) ) ; } temp = temp . children [ index ] ; } temp . isWord = true ; } public boolean search ( String word ) { } public List < String > getAllWords ( ) { } public List < String > getAllWords ( String s , Tries . TrieNode root ) { } }

Fix:
int index = ( word . charAt ( i ) ) - 'a' ;
Buggy code:
public class ExplicitConstructorCall extends Statement implements InvocationSite { public Expression [ ] arguments ; public Expression qualification ; public MethodBinding binding ; MethodBinding syntheticAccessor ; public int accessMode ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public static final int ImplicitSuper = 1 ; public static final int Super = 2 ; public static final int This = 3 ; public VariableBinding [ ] [ ] implicitArguments ; public int typeArgumentsSourceStart ; public ExplicitConstructorCall ( int accessMode ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { try { ( ( MethodScope ) ( currentScope ) ) . isConstructorCall = true ; if ( ( this . qualification ) != null ) { flowInfo = this . qualification . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } if ( ( this . arguments ) != null ) { for ( int i = 0 , max = this . arguments . length ; i < max ; i ++ ) { flowInfo = this . arguments [ i ] . analyseCode ( currentScope , flowContext , flowInfo ) . unconditionalInits ( ) ; } } ReferenceBinding [ ] thrownExceptions ; if ( ( thrownExceptions = this . binding . thrownExceptions ) != ( Binding . NO_EXCEPTIONS ) ) { <START_BUG> if ( ( ( this . bits ) & ( ASTNode . Unchecked ) ) != 0 ) { <END_BUG> thrownExceptions = currentScope . environment ( ) . convertToRawTypes ( this . binding . original ( ) . thrownExceptions , true , true ) ; } flowContext . checkExceptionHandlers ( thrownExceptions , ( ( this . accessMode ) == ( ExplicitConstructorCall . ImplicitSuper ) ? ( ( ASTNode ) ( currentScope . methodScope ( ) . referenceContext ) ) : ( ( ASTNode ) ( this ) ) ) , flowInfo , currentScope ) ; } manageEnclosingInstanceAccessIfNecessary ( currentScope , flowInfo ) ; manageSyntheticAccessIfNecessary ( currentScope , flowInfo ) ; return flowInfo ; } finally { ( ( MethodScope ) ( currentScope ) ) . isConstructorCall = false ; } } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isImplicitSuper ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public void setUnchecked ( boolean isUnchecked ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ( ( ( this . bits ) & ( ASTNode . Unchecked ) ) != 0 ) && ( ( this . genericTypeArguments ) == null ) ) {
Buggy code:
final class BcelMethod extends ResolvedMember { private Method method ; private boolean isAjSynthetic ; private ShadowMunger associatedShadowMunger ; private ResolvedTypeX [ ] annotationTypes = null ; private AnnotationX [ ] annotations = null ; private EffectiveSignatureAttribute effectiveSignature ; private MethodDeclarationLineNumberAttribute declarationLineNumber ; private ResolvedTypeX [ ] resolvedAnnotations ; private World world ; BcelMethod ( BcelObjectType declaringType , Method method ) { } private void unpackJavaAttributes ( ) { } private void unpackAjAttributes ( World world ) { } public boolean isAjSynthetic ( ) { } public ShadowMunger getAssociatedShadowMunger ( ) { } public EffectiveSignatureAttribute getEffectiveSignature ( ) { } public boolean hasDeclarationLineNumberInfo ( ) { } public int getDeclarationLineNumber ( ) { } public ISourceLocation getSourceLocation ( ) { } public Kind getKind ( ) { } public boolean hasAnnotation ( TypeX ofType ) { } public AnnotationX [ ] getAnnotations ( ) { } public ResolvedTypeX [ ] getAnnotationTypes ( ) { } public void addAnnotation ( AnnotationX annotation ) { } private void ensureAnnotationTypesRetrieved ( ) { <START_BUG> if ( ( annotationTypes ) == null ) { <END_BUG> Annotation [ ] annos = method . getAnnotations ( ) ; annotationTypes = new ResolvedTypeX [ annos . length ] ; annotations = new AnnotationX [ annos . length ] ; for ( int i = 0 ; i < ( annos . length ) ; i ++ ) { Annotation annotation = annos [ i ] ; ResolvedTypeX rtx = world . resolve ( TypeX . forName ( annotation . getTypeName ( ) ) ) ; annotationTypes [ i ] = rtx ; annotations [ i ] = new AnnotationX ( annotation , world ) ; } } } }

Fix:
if ( ( ( annotationTypes ) == null ) || ( ( method . getAnnotations ( ) . length ) != ( annotations . length ) ) ) {
Buggy code:
class SessionOpenRequestHandler extends EJBIdentifierBasedMessageHandler { private static final byte HEADER_SESSION_OPEN_RESPONSE = 2 ; private static final byte HEADER_EJB_NOT_STATEFUL = 13 ; private final ExecutorService executorService ; private final MarshallerFactory marshallerFactory ; SessionOpenRequestHandler ( final DeploymentRepository deploymentRepository , final MarshallerFactory marshallerFactory , final ExecutorService executorService ) { } @ Override public void processMessage ( ChannelAssociation channelAssociation , InputStream inputStream ) throws IOException { } private void writeSessionId ( final ChannelAssociation channelAssociation , final short invocationId , final SessionID sessionID , final Affinity hardAffinity ) throws IOException { } private class SessionIDGeneratorTask implements Runnable { private final StatefulSessionComponent statefulSessionComponent ; private final ChannelAssociation channelAssociation ; private final short invocationId ; SessionIDGeneratorTask ( final StatefulSessionComponent statefulSessionComponent , final ChannelAssociation channelAssociation , final short invocationId ) { } @ Override public void run ( ) { final SessionID sessionID ; try { try { <START_BUG> sessionID = statefulSessionComponent . createSession ( ) ; <END_BUG> } catch ( Throwable t ) { ROOT_LOGGER . exceptionGeneratingSessionId ( t , statefulSessionComponent . getComponentName ( ) , invocationId , channelAssociation . getChannel ( ) ) ; SessionOpenRequestHandler . this . writeException ( channelAssociation , SessionOpenRequestHandler . this . marshallerFactory , invocationId , t , null ) ; return ; } final Affinity hardAffinity = statefulSessionComponent . getCache ( ) . getStrictAffinity ( ) ; SessionOpenRequestHandler . this . writeSessionId ( channelAssociation , invocationId , sessionID , hardAffinity ) ; } catch ( IOException ioe ) { ROOT_LOGGER . exceptionGeneratingSessionId ( ioe , statefulSessionComponent . getComponentName ( ) , invocationId , channelAssociation . getChannel ( ) ) ; IoUtils . safeClose ( this . channelAssociation . getChannel ( ) ) ; return ; } } } }

Fix:
sessionID = statefulSessionComponent . createSessionRemote ( ) ;
Buggy code:
public class NodeCmd { private static final String HOST_OPT_LONG = "host" ; private static final String HOST_OPT_SHORT = "h" ; private static final String PORT_OPT_LONG = "port" ; private static final String PORT_OPT_SHORT = "p" ; private static final int defaultPort = 8080 ; private static Options options = null ; private NodeProbe probe ; public NodeCmd ( NodeProbe probe ) { } private static void printUsage ( ) { } public void printRing ( PrintStream outs ) { <START_BUG> Map < Range , List < String > > rangeMap = probe . getRangeToEndPointMap ( null ) ; <END_BUG> List < Range > ranges = new ArrayList < Range > ( rangeMap . keySet ( ) ) ; Collections . sort ( ranges ) ; Set < String > liveNodes = probe . getLiveNodes ( ) ; Set < String > deadNodes = probe . getUnreachableNodes ( ) ; Map < String , String > loadMap = probe . getLoadMap ( ) ; int counter = 0 ; outs . print ( String . format ( "%-14s" , "Address" ) ) ; outs . print ( String . format ( "%-11s" , "Status" ) ) ; outs . print ( String . format ( "%-14s" , "Load" ) ) ; outs . print ( String . format ( "%-43s" , "Range" ) ) ; outs . println ( "Ring" ) ; if ( ( ranges . size ( ) ) > 1 ) { outs . println ( String . format ( "%-14s%-11s%-14s%-43s" , "" , "" , "" , ranges . get ( 0 ) . left ) ) ; } for ( Range range : ranges ) { List < String > endpoints = rangeMap . get ( range ) ; String primaryEndpoint = endpoints . get ( 0 ) ; outs . print ( String . format ( "%-14s" , primaryEndpoint ) ) ; String status = ( liveNodes . contains ( primaryEndpoint ) ) ? "Up" : deadNodes . contains ( primaryEndpoint ) ? "Down" : "?" ; outs . print ( String . format ( "%-11s" , status ) ) ; String load = ( loadMap . containsKey ( primaryEndpoint ) ) ? loadMap . get ( primaryEndpoint ) : "?" ; outs . print ( String . format ( "%-14s" , load ) ) ; outs . print ( String . format ( "%-43s" , range . right ) ) ; String asciiRingArt ; if ( counter == 0 ) { asciiRingArt = "|<--|" ; } else if ( counter == ( ( rangeMap . size ( ) ) - 1 ) ) { asciiRingArt = "|-->|" ; } else { if ( ( ( rangeMap . size ( ) ) > 4 ) && ( ( counter % 2 ) == 0 ) ) asciiRingArt = "v<seq2seq4repair_space>|" ; else if ( ( ( rangeMap . size ( ) ) > 4 ) && ( ( counter % 2 ) != 0 ) ) asciiRingArt = "|<seq2seq4repair_space>^" ; else asciiRingArt = "|<seq2seq4repair_space>|" ; } outs . println ( asciiRingArt ) ; counter ++ ; } } public void printThreadPoolStats ( PrintStream outs ) { } public void printInfo ( PrintStream outs ) { } public void printStreamInfo ( final InetAddress addr , PrintStream outs ) { } public void printColumnFamilyStats ( PrintStream outs ) { } public static void main ( String [ ] args ) throws IOException , InterruptedException , ParseException { } }

Fix:
Map < Range , List < String > > rangeMap = probe . getRangeToEndpointMap ( null ) ;
Buggy code:
@ SuppressWarnings ( "deprecation" ) public class SlideActivity extends Activity { private DrawerLayout mDrawerLayout ; private ListView mDrawerList ; private ActionBarDrawerToggle mDrawerToggle ; private CharSequence mDrawerTitle ; private TypedArray navMenuIcons ; private CharSequence mTitle ; private static Vector < NavDrawerItem > navDrawerItems ; private NavDrawerListAdapter adapter ; @ SuppressLint ( "Recycle" ) @ Override protected void onCreate ( Bundle savedInstanceState ) { } private class SlideMenuClickListener implements ListView . OnItemClickListener { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } private void displayView ( int position ) { } @ Override public void setTitle ( CharSequence title ) { } @ Override protected void onPostCreate ( Bundle savedInstanceState ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } @ SuppressWarnings ( "static-access" ) @ Override protected void onPause ( ) { super . onPause ( ) ; SharedPreHelper helper = new SharedPreHelper ( this ) ; <START_BUG> helper . savaListNews ( FAVORITE , helper . KEY_FAVORITE ) ; <END_BUG> } @ Override protected void onResume ( ) { } }

Fix:
helper . saveListNews ( FAVORITE , helper . KEY_FAVORITE ) ;
Buggy code:
public class CreateEncryption { private File xmlFile = null ; private File detachedFile = null ; private Document detachedDoc = null ; private boolean content ; private String encryptionType = null ; private Keystore keyStore = null ; private String encrypt = null ; private String expression = null ; private String encryptionId = null ; private String encryptionAlgorithm = null ; private String keyCipherAlgorithm = null ; private String keyName = "" ; public Document encrypt ( Encryption encryption , String selection , IProgressMonitor monitor ) throws Exception { Document doc = null ; if ( monitor == null ) { monitor = new NullProgressMonitor ( ) ; } monitor . worked ( 1 ) ; loadSettings ( encryption , selection ) ; keyStore . load ( ) ; <START_BUG> Key secretKey = keyStore . getSecretKey ( encryption . getKeyName ( ) , encryption . getKeyPassword ( ) ) ; <END_BUG> monitor . worked ( 1 ) ; if ( encryptionType . equalsIgnoreCase ( "enveloping" ) ) { doc = envelopingEncryption ( xmlFile , selection , secretKey ) ; } else if ( encryptionType . equalsIgnoreCase ( "detached" ) ) { doc = detachedEncryption ( xmlFile , secretKey ) ; } monitor . worked ( 1 ) ; return doc ; } private void loadSettings ( Encryption encryption , String selection ) throws Exception { } private Document envelopingEncryption ( File file , String selection , Key secretKey ) throws Exception { } private Document detachedEncryption ( File file , Key secretKey ) throws Exception { } }

Fix:
Key secretKey = keyStore . getPrivateKey ( encryption . getKeyName ( ) , encryption . getKeyPassword ( ) ) ;
Buggy code:
public class TestSwedishAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testBasics ( ) throws IOException { } public void testExclude ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new SwedishAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new SwedishAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
final class CommitTracker implements Runnable { protected static final Logger log = LoggerFactory . getLogger ( CommitTracker . class ) ; public final int DOC_COMMIT_DELAY_MS = 250 ; int docsUpperBound ; long timeUpperBound ; private final ScheduledExecutorService scheduler = Executors . newScheduledThreadPool ( 1 ) ; private ScheduledFuture pending ; long docsSinceCommit ; int autoCommitCount = 0 ; long lastAddedTime = - 1 ; private SolrCore core ; private boolean softCommit ; private boolean waitSearcher ; private String name ; public CommitTracker ( String name , SolrCore core , int docsUpperBound , int timeUpperBound , boolean waitSearcher , boolean softCommit ) { } public void close ( ) { if ( ( pending ) != null ) { pending . cancel ( true ) ; pending = null ; } <START_BUG> scheduler . shutdown ( ) ; <END_BUG> } public synchronized void scheduleCommitWithin ( long commitMaxTime ) { } private void _scheduleCommitWithin ( long commitMaxTime ) { } public boolean addedDocument ( int commitWithin ) { } public void didCommit ( ) { } public void didRollback ( ) { } public synchronized void run ( ) { } public synchronized int getCommitCount ( ) { } @ Override public String toString ( ) { } }

Fix:
scheduler . shutdownNow ( ) ;
Buggy code:
public class WorkspaceActivity extends ActionBarActivity implements View . OnClickListener { public static WorkspaceActivity that ; public static final File ROOT_DIRECTORY = new File ( Environment . getExternalStorageDirectory ( ) , "MDT" ) ; public static final File PROJECTS_DIRECTORY = new File ( WorkspaceActivity . ROOT_DIRECTORY , "projects" ) ; public static final File EXPORT_DIRECTORY = new File ( WorkspaceActivity . ROOT_DIRECTORY , "export" ) ; public static Typeface inconsolata ; public static Typeface inconsolataBold ; public static String [ ] samples ; public static String [ ] exportTypes ; public static ArrayList < Project > projects ; private WorkspaceAdapter adapter ; public static PEAnalyzer analyzer ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override protected void onPause ( ) { } @ Override public void onClick ( View v ) { } public void initResources ( ) { WorkspaceActivity . inconsolata = Typeface . createFromAsset ( getAssets ( ) , "Inconsolata//Inconsolata-Regular.ttf" ) ; WorkspaceActivity . inconsolataBold = Typeface . createFromAsset ( getAssets ( ) , "Inconsolata//Inconsolata-Bold.ttf" ) ; WorkspaceActivity . samples = getResources ( ) . getStringArray ( R . array . samples ) ; WorkspaceActivity . exportTypes = getResources ( ) . getStringArray ( export_types ) ; try { <START_BUG> WorkspaceActivity . analyzer = new PEAnalyzer ( new File ( this . getCacheDir ( ) , "PEAnalyzer" ) ) ; <END_BUG> } catch ( IOException e ) { e . printStackTrace ( ) ; } } public void initDirectories ( ) { } public void sortProjects ( ) { } public void saveProjects ( ) { } public static void toast ( final int resId , final int length ) { } No newline ; at end ; of file ; }

Fix:
WorkspaceActivity . analyzer = new PEAnalyzer ( new File ( this . getCacheDir ( ) , getText ( default_cacheDirectory ) . toString ( ) ) ) ;
Buggy code:
public class Game { private static final ConsoleIO console = new ConsoleIO ( "Invalid<seq2seq4repair_space>input." , 0 , 80 , 0 ) ; protected String [ ] takenNames = new String [ 5 ] ; ArrayList < Player > players = new ArrayList < Player > ( ) ; Deck deck = new Deck ( ) ; Pile pile = new Pile ( ) ; int humanCount ; int cpuCount ; int numPlayers ; public Game ( ) { } private int getPlayerCount ( boolean isHuman ) { } private String getPlayerName ( int i ) { } private int goesFirst ( ArrayList < Player > players ) { Player goesFirst = players . get ( 0 ) ; Card lowCard = goesFirst . hand . get ( 0 ) ; Card c ; ArrayList < String > suits = new ArrayList < String > ( ) ; suits . addAll ( Arrays . asList ( "Clubs" , "Diamonds" , "Spades" , "Hearts" ) ) ; <START_BUG> for ( Player p : players . subList ( 1 , ( ( players . size ( ) ) - 1 ) ) ) { <END_BUG> c = p . hand . get ( 0 ) ; if ( ( c . value ) < ( lowCard . value ) ) { lowCard = c ; goesFirst = p ; } else if ( ( ( c . value ) == ( lowCard . value ) ) && ( ( suits . indexOf ( c . suit ) ) < ( suits . indexOf ( lowCard . suit ) ) ) ) { lowCard = c ; goesFirst = p ; } } return players . indexOf ( goesFirst ) ; } private void winGame ( Player player ) { } public void play ( ) { } public static void main ( String [ ] args ) { } }

Fix:
for ( Player p : players . subList ( 1 , players . size ( ) ) ) {
Buggy code:
@ Security . Authenticated ( Secured . class ) public class PersonController extends Controller { public static final Form < PersonController . SendGift > sendGiftForm = Form . form ( PersonController . SendGift . class ) ; public static final Form < Search > searchForm = Form . form ( Search . class ) ; public static final Form < User > personForm = Form . form ( User . class ) ; public static Result person ( User user ) { } public static Result deleteBookmark ( int idUserAppreciation ) { } public static Result changePicture ( User user ) { } public static Result changePicturePage ( User user ) { } public static Result modifyPerson ( User user ) { } public static Result savePerson ( User user ) { } public static class SendGift { public String userName ; public String idGift ; public int amount ; } public static Result postCode ( String str ) { } public static Result sendGift ( User user ) { } public static boolean offerGift ( User user , User friend , Gift gift , int amount ) { } public static Result changePassword ( User user ) { DynamicForm form = Form . form ( ) . bindFromRequest ( ) ; String actualPass = form . get ( "actualPass" ) ; String newPass = form . get ( "newPass" ) ; String confirmPass = form . get ( "confirmPass" ) ; String passFromDB = user . password ; if ( ! ( actualPass . equals ( passFromDB ) ) ) { flash ( "error" , String . format ( "Mot<seq2seq4repair_space>de<seq2seq4repair_space>passe<seq2seq4repair_space>incorrect" ) ) ; return ok ( infoPerson . render ( user , PersonController . sendGiftForm , PersonController . searchForm ) ) ; } else { if ( ( newPass . length ( ) ) < 6 ) { flash ( "error" , String . format ( "Mot<seq2seq4repair_space>de<seq2seq4repair_space>passe<seq2seq4repair_space>doit<seq2seq4repair_space>contenir<seq2seq4repair_space>plus<seq2seq4repair_space>de<seq2seq4repair_space>6<seq2seq4repair_space>charactères" ) ) ; return ok ( infoPerson . render ( user , PersonController . sendGiftForm , PersonController . searchForm ) ) ; } else { if ( ! ( newPass . equals ( confirmPass ) ) ) { flash ( "error" , String . format ( "Ces<seq2seq4repair_space>deux<seq2seq4repair_space>cases<seq2seq4repair_space>doivent<seq2seq4repair_space>être<seq2seq4repair_space>identiques" ) ) ; return ok ( infoPerson . render ( user , PersonController . sendGiftForm , PersonController . searchForm ) ) ; } else { user . password = newPass ; user . update ( ) ; <START_BUG> flash ( "success" , String . format ( "Changement<seq2seq4repair_space>du<seq2seq4repair_space>mot<seq2seq4repair_space>de<seq2seq4repair_space>passe" ) ) ; <END_BUG> return ok ( infoPerson . render ( user , PersonController . sendGiftForm , PersonController . searchForm ) ) ; } } } } public static Result confirmContact ( String idContact ) { } @ BodyParser . Of ( Json . class ) public static Result sendRequest ( ) { } }

Fix:
flash ( "success" , String . format ( "Votre<seq2seq4repair_space>mot<seq2seq4repair_space>de<seq2seq4repair_space>passe<seq2seq4repair_space>a<seq2seq4repair_space>bien<seq2seq4repair_space>été<seq2seq4repair_space>changé" ) ) ;
Buggy code:
public class SwingInstall extends JFrame { public SwingInstall ( ) { } Install installer ; String appName ; String appVersion ; JLabel caption ; SwingInstall . ChooseDirectory chooseDirectory ; SwingInstall . SelectComponents selectComponents ; SwingInstall . SwingProgress progress ; JButton cancelButton ; JButton prevButton ; JButton nextButton ; Component [ ] pages ; int currentPage ; private static final int PADDING = 12 ; void install ( ) { Vector components = new Vector ( ) ; int size = 0 ; JPanel comp = selectComponents . comp ; <START_BUG> Vector ids = selectedComponents . filesets ; <END_BUG> for ( int i = 0 ; i < ( comp . getComponentCount ( ) ) ; i ++ ) { if ( ( ( JCheckBox ) ( comp . getComponent ( i ) ) ) . getModel ( ) . isSelected ( ) ) { size += installer . getIntProperty ( ( ( "comp." + ( ids . elementAt ( i ) ) ) + ".real-size" ) ) ; components . addElement ( installer . getProperty ( ( ( "comp." + ( ids . elementAt ( i ) ) ) + ".fileset" ) ) ) ; } } JTextField binDir = chooseDirectory . binDir ; String installDir = chooseDirectory . installDir . getText ( ) ; InstallThread thread = new InstallThread ( installer , progress , ( installDir == null ? null : installDir ) , ( binDir == null ? null : binDir . getText ( ) ) , size , components ) ; progress . setThread ( thread ) ; thread . start ( ) ; } private void pageChanged ( ) { } class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } class WindowHandler extends WindowAdapter { public void windowClosing ( WindowEvent evt ) { } } class WizardLayout implements LayoutManager { public void addLayoutComponent ( String name , Component comp ) { } public void removeLayoutComponent ( Component comp ) { } public Dimension preferredLayoutSize ( Container parent ) { } public Dimension minimumLayoutSize ( Container parent ) { } public void layoutContainer ( Container parent ) { } } class TextPanel extends JPanel { TextPanel ( String prop ) { } } class ChooseDirectory extends JPanel implements ActionListener { JTextField installDir ; JButton chooseInstall ; JTextField binDir ; JButton chooseBin ; ChooseDirectory ( ) { } public void actionPerformed ( ActionEvent evt ) { } } class SelectComponents extends JPanel implements ActionListener { JPanel comp ; JLabel sizeLabel ; Vector filesets ; SelectComponents ( ) { } public void actionPerformed ( ActionEvent evt ) { } private JPanel createCompPanel ( ) { } private void updateSize ( ) { } } class SwingProgress extends JPanel implements Progress { JProgressBar progress ; InstallThread thread ; SwingProgress ( ) { } public void setMaximum ( final int max ) { } public void advance ( final int value ) { } public void done ( ) { } public void error ( final String message ) { } public void setThread ( InstallThread thread ) { } } class Complete extends JPanel { Complete ( ) { } } }

Fix:
Vector ids = selectComponents . filesets ;
Buggy code:
public class TestEJBQueryInterface extends BaseQueryTest { public TestEJBQueryInterface ( String name ) { } public void setUp ( ) { } public void testResultList ( ) { } public void testGetSingleList ( ) { } public void testExecuteUpdate ( ) { } public void testSetMaxResults ( ) { } public void testSetFirstResults ( ) { EntityManager em = currentEntityManager ( ) ; <START_BUG> List l = em . createQuery ( "Select<seq2seq4repair_space>object(o)<seq2seq4repair_space>from<seq2seq4repair_space>Entity1<seq2seq4repair_space>o" ) . setFirstResult ( 3 ) . getResultList ( ) ; <END_BUG> Entity1 ent = ( ( Entity1 ) ( l . get ( 0 ) ) ) ; assertNotNull ( ent ) ; assertEquals ( "string3" , ent . getStringField ( ) ) ; assertEquals ( 5 , ent . getIntField ( ) ) ; endEm ( em ) ; } public void testSetParameter1 ( ) { } }

Fix:
List l = em . createQuery ( "Select<seq2seq4repair_space>object(o)<seq2seq4repair_space>from<seq2seq4repair_space>Entity1<seq2seq4repair_space>o<seq2seq4repair_space>order<seq2seq4repair_space>by<seq2seq4repair_space>o.pk" ) . setFirstResult ( 3 ) . getResultList ( ) ;
Buggy code:
public class TurnToCamera extends Command { private boolean flag = true ; private boolean done = false ; private double target = 0 ; private static final double TOLERANCE = 15.0 ; private static final double SPD = 0.5 ; private static final double NIL = 0.0 ; public TurnToCamera ( ) { } protected void initialize ( ) { } protected void execute ( ) { if ( flag ) { sensors . getGyro ( ) . reset ( ) ; target = ( ( cameraMount . getXPos ( ) ) * 180 ) - 90 ; flag = false ; } double curr = sensors . getGyro ( ) . getAngle ( ) ; if ( ( Math . abs ( ( ( target ) - curr ) ) ) < ( TurnToCamera . TOLERANCE ) ) { System . out . println ( "Rotation<seq2seq4repair_space>Completed" ) ; cameraMount . center ( ) ; done = true ; flag = true ; return ; } System . out . println ( ( "Current<seq2seq4repair_space>Error:<seq2seq4repair_space>" + ( ( target ) - curr ) ) ) ; <START_BUG> double dir = ( ( ( target ) - curr ) < 0 ) ? TurnToCamera . SPD : - ( TurnToCamera . SPD ) ; <END_BUG> drive . moveMechanum ( TurnToCamera . NIL , TurnToCamera . NIL , dir ) ; } public boolean isFinished ( ) { } protected void end ( ) { } protected void interrupted ( ) { } public void exec ( ) { } }

Fix:
double dir = ( ( ( target ) - curr ) < 0 ) ? - ( TurnToCamera . SPD ) : TurnToCamera . SPD ;
Buggy code:
public class WebsiteHtmlJsoupCollector extends WebsiteHtmlCollector < Element > implements WebsiteHtmlCollectorStrategy { Element collectedBody ; Elements collectedLinks ; @ Override public Map < ? extends CollectorKey , CollectorValue > extractFromHtml ( ) { } private Element collectBody ( ) { } private Elements collectHyperlinks ( ) { } @ Override public List < Hyperlink > getHyperlinks ( ) { if ( ( this . collectedLinks ) == null ) collectHyperlinks ( ) ; List < Hyperlink > hyperlinks = new ArrayList < > ( ) ; Iterator < Element > it = this . collectedLinks . iterator ( ) ; while ( it . hasNext ( ) ) { Element linkElement = it . next ( ) ; Hyperlink h = new Hyperlink ( ) ; h . text = linkElement . text ( ) ; <START_BUG> h . target = linkElement . attr ( "href" ) ; <END_BUG> hyperlinks . add ( h ) ; } return hyperlinks ; } }

Fix:
h . href = linkElement . attr ( "href" ) ;
Buggy code:
public class RegionBasedTypeHierarchy extends TypeHierarchy { protected IRegion fRegion ; protected IJavaProject fProject ; public RegionBasedTypeHierarchy ( IRegion region , IJavaProject project , IType type , boolean computeSubtypes ) throws JavaModelException { } protected void activate ( ) { } protected void compute ( ) throws CoreException , JavaModelException { } protected void destroy ( ) { } protected boolean isAffectedByOpenable ( IJavaElementDelta delta , IJavaElement element ) { if ( ( element instanceof CompilationUnit ) && ( ( ( CompilationUnit ) ( element ) ) . isWorkingCopy ( ) ) ) { return false ; } <START_BUG> if ( ( fType ) == null ) { <END_BUG> return fRegion . contains ( element ) ; } else { return super . isAffectedByOpenable ( delta , element ) ; } } public IJavaProject javaProject ( ) { } }

Fix:
if ( ( this . type ) == null ) {
Buggy code:
@ SuppressWarnings ( "serial" ) public class OriginalDataView extends NavigationView { public OriginalDataView ( ) { } public void buildView ( ) { if ( ( this . getData ( ) ) == null ) return ; setCaption ( ( ( String ) ( this . getData ( ) ) ) ) ; HadoopData hd = HadoopData . getInstance ( ) ; HashMap < String , String > des = hd . getOriginalDes ( ( ( String ) ( this . getData ( ) ) ) ) ; final VerticalComponentGroup content = new VerticalComponentGroup ( ) ; final Button submitButton = new Button ( "Cluster" ) ; submitButton . setData ( this . getData ( ) ) ; submitButton . addClickListener ( new ClickListener ( ) { @ Override public void buttonClick ( ClickEvent event ) { ShellExec shell = new ShellExec ( ) ; Button nb = ( ( Button ) ( event . getComponent ( ) ) ) ; ArrayList < String > tmp = new ArrayList < String > ( ) ; tmp . add ( ( ( String ) ( nb . getData ( ) ) ) ) ; shell . setParas ( tmp ) ; shell . execCluster ( ) ; } } ) ; if ( des != null ) { TextField field = new TextField ( "Name" ) ; field . setEnabled ( false ) ; field . setInputPrompt ( des . get ( "name" ) ) ; content . addComponent ( field ) ; field = new TextField ( "Description" ) ; field . setEnabled ( false ) ; field . setInputPrompt ( des . get ( "des" ) ) ; content . addComponent ( field ) ; field = new TextField ( "Number" ) ; field . setEnabled ( false ) ; field . setInputPrompt ( des . get ( "num" ) ) ; content . addComponent ( field ) ; final Button showButton = new Button ( "Show<seq2seq4repair_space>in<seq2seq4repair_space>Map" ) ; showButton . setData ( this . getData ( ) ) ; showButton . addClickListener ( new ClickListener ( ) { @ Override public void buttonClick ( ClickEvent event ) { ClinicalTrialsTouchKitUI app = ClinicalTrialsTouchKitUI . getApp ( ) ; Button btn = ( ( Button ) ( event . getComponent ( ) ) ) ; app . showOriginalDataSet ( ( ( String ) ( btn . getData ( ) ) ) ) ; } } ) ; setContent ( new com . vaadin . ui . CssLayout ( content , showButton , submitButton ) ) ; } else { ShellExec shell = new ShellExec ( ) ; ArrayList < String > tmp = new ArrayList < String > ( ) ; <START_BUG> tmp . add ( ( ( "\"" + ( ( String ) ( this . getData ( ) ) ) ) + "\"" ) ) ; <END_BUG> shell . setParas ( tmp ) ; shell . execOriginal ( ) ; setContent ( new com . vaadin . ui . CssLayout ( content , submitButton ) ) ; } } }

Fix:
tmp . add ( ( ( String ) ( this . getData ( ) ) ) ) ;
Buggy code:
public class BookActivity extends Activity implements OnUpdateFinishedListener { public static final int REQUEST_CODE = 1437 ; public static final String ISBN = "isbn" ; public static final String CHECK_DUPLICATE = "duplicate" ; protected ActionBar actionbar ; private DBHelper db ; private BookEntry entry ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } @ Override public void OnUpdateFinished ( ) { } @ Override public void OnUpdateFailed ( ) { } private void updateView ( ) { if ( ( BookEntry . get ( db . getReadableDatabase ( ) , entry . isbn ) ) == null ) { <START_BUG> ( ( ActionBar ) ( findViewById ( R . id . actionbar ) ) ) . addAction ( new AbstractAction ( drawable . star ) { <END_BUG> @ Override public void performAction ( View view ) { entry . insert ( db . getWritableDatabase ( ) ) ; Intent data = new Intent ( ) ; data . putExtra ( BookActivity . ISBN , entry . isbn ) ; setResult ( RESULT_OK , data ) ; finish ( ) ; } } ) ; } if ( ( entry . cover ) != null ) ( ( ImageView ) ( findViewById ( image ) ) ) . setImageBitmap ( entry . cover ) ; else ( ( ImageView ) ( findViewById ( image ) ) ) . setImageResource ( book ) ; ( ( TextView ) ( findViewById ( title ) ) ) . setText ( entry . title ) ; ( ( TextView ) ( findViewById ( author ) ) ) . setText ( entry . author ) ; ( ( RatingBar ) ( findViewById ( rating ) ) ) . setRating ( entry . info . rating ) ; ( ( TextView ) ( findViewById ( description ) ) ) . setText ( entry . info . description ) ; ( ( TextView ) ( findViewById ( description ) ) ) . setMovementMethod ( new ScrollingMovementMethod ( ) ) ; } private void showError ( ) { } }

Fix:
( ( ActionBar ) ( findViewById ( R . id . actionbar ) ) ) . addAction ( new AbstractAction ( drawable . ic_camera ) {