nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Snippet251 { public static void main ( String [ ] args ) { Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; Button open = new Button ( shell , SWT . PUSH ) ; open . setText ( "Open<seq2seq4repair_space>Dialog" ) ; open . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { final Shell dialog = new Shell ( shell , SWT . DIALOG_TRIM ) ; dialog . setLayout ( new GridLayout ( 3 , false ) ) ; final DateTime calendar = new DateTime ( dialog , ( ( SWT . CALENDAR ) | ( SWT . BORDER ) ) ) ; final DateTime date = new DateTime ( dialog , ( ( SWT . DATE ) | ( SWT . SHORT ) ) ) ; final DateTime time = new DateTime ( dialog , ( ( SWT . TIME ) | ( SWT . SHORT ) ) ) ; new Label ( dialog , SWT . NONE ) ; new Label ( dialog , SWT . NONE ) ; Button ok = new Button ( dialog , SWT . PUSH ) ; ok . setText ( "OK" ) ; ok . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , false , false ) ) ; ok . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { System . out . println ( ( ( ( ( ( "Calendar<seq2seq4repair_space>date<seq2seq4repair_space>selected<seq2seq4repair_space>(MM//DD//YYYY)<seq2seq4repair_space>=<seq2seq4repair_space>" + ( ( calendar . getMonth ( ) ) + 1 ) ) + "//" ) + ( calendar . getDay ( ) ) ) + "//" ) + ( calendar . getYear ( ) ) ) ) ; System . out . println ( ( ( ( "Date<seq2seq4repair_space>selected<seq2seq4repair_space>(MM//YYYY)<seq2seq4repair_space>=<seq2seq4repair_space>" + ( ( date . getMonth ( ) ) + 1 ) ) + "//" ) + ( date . getYear ( ) ) ) ) ; <START_BUG> System . out . println ( ( ( ( "Time<seq2seq4repair_space>selected<seq2seq4repair_space>(HH:MM)<seq2seq4repair_space>=<seq2seq4repair_space>" + ( time . getHours ( ) ) ) + ":" ) + ( time . getMinutes ( ) ) ) ) ; <END_BUG> dialog . close ( ) ; } } ) ; dialog . setDefaultButton ( ok ) ; dialog . pack ( ) ; dialog . open ( ) ; } } ) ; shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
System . out . println ( ( ( ( ( "Time<seq2seq4repair_space>selected<seq2seq4repair_space>(HH:MM)<seq2seq4repair_space>=<seq2seq4repair_space>" + ( time . getHours ( ) ) ) + ":" ) + ( ( time . getMinutes ( ) ) < 10 ? "0" : "" ) ) + ( time . getMinutes ( ) ) ) ) ;
Buggy code:
public class OSMFilter { private static Logger LOG = LoggerFactory . getLogger ( OSMFilter . class ) ; public static boolean isWayRoutable ( OSMWithTags way ) { } public static boolean isOsmEntityRoutable ( OSMWithTags osmEntity ) { <START_BUG> if ( osmEntity . hasTag ( "highway" ) ) <END_BUG> return true ; if ( ( osmEntity . isTag ( "public_transport" , "platform" ) ) || ( osmEntity . isTag ( "railway" , "platform" ) ) ) { return ! ( "tourism" . equals ( osmEntity . getTag ( "usage" ) ) ) ; } return false ; } public static StreetTraversalPermission getPermissionsForEntity ( OSMWithTags entity , StreetTraversalPermission def ) { } public static StreetTraversalPermission getPermissionsForWay ( OSMWay way , StreetTraversalPermission def , Graph graph ) { } public static P2 < StreetTraversalPermission > getPermissions ( StreetTraversalPermission permissions , OSMWay way ) { } public static int getStreetClasses ( OSMWithTags way ) { } public static int getPlatformClass ( OSMWithTags way ) { } }

Fix:
if ( ( osmEntity . hasTag ( "highway" ) ) || ( osmEntity . hasTag ( "indoor:highway" ) ) )
Buggy code:
public class Gcj extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { } protected Commandline setupGCJCommand ( ) throws TaskException { Commandline cmd = new Commandline ( ) ; Path classpath = new Path ( ) ; if ( ( m_bootclasspath ) != null ) { classpath . append ( m_bootclasspath ) ; } <START_BUG> classpath . addExtdirs ( m_extdirs ) ; <END_BUG> if ( ( ( m_bootclasspath ) == null ) || ( ( m_bootclasspath . size ( ) ) == 0 ) ) { m_includeJavaRuntime = true ; } classpath . append ( getCompileClasspath ( ) ) ; classpath . append ( src ) ; cmd . setExecutable ( "gcj" ) ; if ( ( m_destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( m_destDir ) ; if ( m_destDir . mkdirs ( ) ) { throw new TaskException ( "Can't<seq2seq4repair_space>make<seq2seq4repair_space>output<seq2seq4repair_space>directories.<seq2seq4repair_space>Maybe<seq2seq4repair_space>permission<seq2seq4repair_space>is<seq2seq4repair_space>wrong.<seq2seq4repair_space>" ) ; } } cmd . createArgument ( ) . setValue ( "-classpath" ) ; cmd . createArgument ( ) . setPath ( classpath ) ; if ( ( m_encoding ) != null ) { cmd . createArgument ( ) . setValue ( ( "--encoding=" + ( m_encoding ) ) ) ; } if ( m_debug ) { cmd . createArgument ( ) . setValue ( "-g1" ) ; } if ( m_optimize ) { cmd . createArgument ( ) . setValue ( "-O" ) ; } cmd . createArgument ( ) . setValue ( "-C" ) ; addCurrentCompilerArgs ( cmd ) ; return cmd ; } }

Fix:
addExtdirs ( classpath ) ;
Buggy code:
public class AjCompilerAdapter implements ICompilerAdapter { private Compiler compiler ; private BcelWeaver weaver ; private EclipseFactory eWorld ; private boolean isBatchCompile ; private boolean reportedErrors ; private boolean isXNoWeave ; private IIntermediateResultsRequestor intermediateResultsRequestor ; private IProgressListener progressListener ; private IOutputClassFileNameProvider outputFileNameProvider ; private IBinarySourceProvider binarySourceProvider ; private WeaverMessageHandler weaverMessageHandler ; private Map binarySourceSetForFullWeave = new HashMap ( ) ; private Collection resultSetForFullWeave = Collections . EMPTY_LIST ; List resultsPendingWeave = new ArrayList ( ) ; public AjCompilerAdapter ( Compiler compiler , boolean isBatchCompile , BcelWorld world , BcelWeaver weaver , EclipseFactory eFactory , IIntermediateResultsRequestor intRequestor , IProgressListener progressListener , IOutputClassFileNameProvider outputFileNameProvider , IBinarySourceProvider binarySourceProvider , Map fullBinarySourceEntries , Collection resultSetForFullWeave , boolean isXNoWeave ) { } public void beforeCompiling ( ICompilationUnit [ ] sourceUnits ) { } public void afterCompiling ( ) { } public void beforeProcessing ( CompilationUnitDeclaration unit ) { } public void afterProcessing ( CompilationUnitDeclaration unit , int unitIndex ) { } public void beforeResolving ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { } public void afterResolving ( CompilationUnitDeclaration unit , ICompilationUnit sourceUnit , boolean verifyMethods , boolean analyzeCode , boolean generateCode ) { } public void acceptResult ( CompilationResult result ) { } private List getBinarySourcesFrom ( Map binarySourceEntries ) { List ret = new ArrayList ( ) ; for ( Iterator binIter = binarySourceEntries . keySet ( ) . iterator ( ) ; binIter . hasNext ( ) ; ) { String sourceFileName = ( ( String ) ( binIter . next ( ) ) ) ; List unwovenClassFiles = ( ( List ) ( binarySourceEntries . get ( sourceFileName ) ) ) ; <START_BUG> CompilationResult result = new CompilationResult ( sourceFileName . toCharArray ( ) , 0 , 0 , 20 ) ; <END_BUG> result . noSourceAvailable ( ) ; InterimCompilationResult binarySource = new InterimCompilationResult ( result , unwovenClassFiles ) ; ret . add ( binarySource ) ; } return ret ; } private void notifyRequestor ( ) { } private void weave ( ) throws IOException { } private void addAllKnownClassesToWeaveList ( ) { } }

Fix:
CompilationResult result = new CompilationResult ( sourceFileName . toCharArray ( ) , 0 , 0 , compiler . options . maxProblemsPerUnit ) ;
Buggy code:
public class BrowserVSAction implements DebugAction { private static final String TAG = BrowserVSAction . class . getSimpleName ( ) ; public BrowserVSAction ( ) { } @ Override public void run ( final Context context , final Callback callback ) { final Bundle bundle = new Bundle ( ) ; bundle . putBoolean ( SYNC_EXTRAS_MANUAL , true ) ; new android . os . AsyncTask < Context , Void , Void > ( ) { @ Override protected Void doInBackground ( Context ... contexts ) { LogUtils . LOGD ( BrowserVSAction . TAG , "doInBackground" ) ; Intent intent = new Intent ( AppVS . getInstance ( ) , BrowserVSActivity . class ) ; intent . addFlags ( FLAG_ACTIVITY_NEW_TASK ) ; <START_BUG> intent . putExtra ( URL_KEY , "http:////currency:8080//CurrencyServer//test//testChart.xhtml" ) ; <END_BUG> AppVS . getInstance ( ) . startActivity ( intent ) ; return null ; } } . execute ( context ) ; } @ Override public String getLabel ( ) { } }

Fix:
intent . putExtra ( URL_KEY , "http:////currency:8000//grid//taxes_dashboard.html" ) ;
Buggy code:
public class AttributeValuePeer extends BaseAttributeValuePeer { private static final String keyPrefix = "AttributeValueSubClass" ; private static String getClassCacheKey ( String key ) { } public static Class getOMClass ( Record record , int offset ) throws Exception { <START_BUG> NumberKey attId = new NumberKey ( record . getValue ( ( ( offset - 1 ) + 2 ) ) . asString ( ) ) ; <END_BUG> Attribute attribute = Attribute . getInstance ( attId ) ; String className = attribute . getAttributeType ( ) . getJavaClassName ( ) ; TurbineGlobalCacheService tgcs = ( ( TurbineGlobalCacheService ) ( TurbineServices . getInstance ( ) . getService ( SERVICE_NAME ) ) ) ; String key = AttributeValuePeer . getClassCacheKey ( className ) ; Class c = null ; try { c = ( ( Class ) ( tgcs . getObject ( key ) . getContents ( ) ) ) ; } catch ( ObjectExpiredException oee ) { c = Class . forName ( className ) ; tgcs . addObject ( key , new CachedObject ( c ) ) ; } return c ; } }

Fix:
NumberKey attId = new NumberKey ( record . getValue ( ( ( offset - 1 ) + 3 ) ) . asString ( ) ) ;
Buggy code:
public class FileNamePattern { static Logger logger = Logger . getLogger ( FileNamePattern . class ) ; String pattern ; int patternLength ; TokenConverter headTokenConverter ; public FileNamePattern ( String pattern ) { } public String toString ( ) { } void parse ( ) { int lastIndex = 0 ; TokenConverter tc = null ; MAIN_LOOP : while ( true ) { int i = pattern . indexOf ( '%' , lastIndex ) ; if ( i == ( - 1 ) ) { String remainingStr = pattern . substring ( lastIndex ) ; addTokenConverter ( tc , new IdentityTokenConverter ( remainingStr ) ) ; break ; } else { if ( i == ( ( patternLength ) - 1 ) ) { String remainingStr = pattern . substring ( lastIndex ) ; addTokenConverter ( tc , new IdentityTokenConverter ( remainingStr ) ) ; break ; } tc = addTokenConverter ( tc , new IdentityTokenConverter ( pattern . substring ( lastIndex , i ) ) ) ; char nextChar = pattern . charAt ( ( i + 1 ) ) ; switch ( nextChar ) { case 'i' : tc = addTokenConverter ( tc , new IntegerTokenConverter ( ) ) ; lastIndex = i + 2 ; break ; case 'd' : int optionEnd = getOptionEnd ( ( i + 2 ) ) ; String option ; if ( optionEnd != ( - 1 ) ) { option = pattern . substring ( ( i + 3 ) , optionEnd ) ; lastIndex = optionEnd + 1 ; } else { <START_BUG> FileNamePattern . logger . warn ( "Assuming<seq2seq4repair_space>daily<seq2seq4repair_space>rotation<seq2seq4repair_space>schedule" ) ; <END_BUG> option = "yyyy-MM-dd" ; lastIndex = i + 2 ; } tc = addTokenConverter ( tc , new DateTokenConverter ( option ) ) ; break ; case '%' : tc = addTokenConverter ( tc , new IdentityTokenConverter ( "%" ) ) ; lastIndex = i + 2 ; break ; default : throw new IllegalArgumentException ( ( ( ( "The<seq2seq4repair_space>pattern[" + ( pattern ) ) + "]<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>specifer<seq2seq4repair_space>at<seq2seq4repair_space>position<seq2seq4repair_space>" ) + ( i + 1 ) ) ) ; } } } } protected int getOptionEnd ( int i ) { } TokenConverter addTokenConverter ( TokenConverter tc , TokenConverter newTokenConverter ) { } public DateTokenConverter getDateTokenConverter ( ) { } public String convert ( int i ) { } public String convert ( Date date ) { } public String getPattern ( ) { } }

Fix:
FileNamePattern . logger . debug ( "Assuming<seq2seq4repair_space>daily<seq2seq4repair_space>rotation<seq2seq4repair_space>schedule" ) ;
Buggy code:
public class ClientActionPacket extends TCP_Packet { private ClientState clientState ; private static final int dimension = 1 ; public ClientActionPacket ( ClientState clientState ) { } public ClientActionPacket ( ByteBuffer buffer ) { } @ Override public void createBuffer ( ) { buffer = ByteBuffer . allocate ( ( ( ClientActionPacket . dimension ) + 1 ) ) ; buffer . clear ( ) ; <START_BUG> buffer . put ( ( ( byte ) ( - 126 ) ) ) ; <END_BUG> buffer . put ( clientState . getState ( ) ) ; buffer . rewind ( ) ; } @ Override protected boolean recognizePacket ( ) { } }

Fix:
buffer . put ( ( ( byte ) ( 2 ) ) ) ;
Buggy code:
public class Checker extends ShadowMunger { private String msg ; private boolean isError ; public Checker ( DeclareErrorOrWarning deow ) { } private Checker ( Pointcut pc , int start , int end , ISourceContext context ) { } public ShadowMunger concretize ( ResolvedType fromType , World world , PerClause clause ) { } public void specializeOn ( Shadow shadow ) { } public void implementOn ( Shadow shadow ) { } public ShadowMunger parameterizeWith ( ResolvedType declaringType , Map typeVariableMap ) { <START_BUG> Checker ret = new Checker ( getPointcut ( ) . parameterizeWith ( typeVariableMap ) , getStart ( ) , getEnd ( ) , this . sourceContext ) ; <END_BUG> ret . msg = this . msg ; ret . isError = this . isError ; return ret ; } public boolean match ( Shadow shadow , World world ) { } public int compareTo ( Object other ) { } public Collection getThrownExceptions ( ) { } public boolean mustCheckExceptions ( ) { } public boolean equals ( Object other ) { } private volatile int hashCode = - 1 ; public int hashCode ( ) { } public boolean isError ( ) { } }

Fix:
Checker ret = new Checker ( getPointcut ( ) . parameterizeWith ( typeVariableMap , declaringType . getWorld ( ) ) , getStart ( ) , getEnd ( ) , this . sourceContext ) ;
Buggy code:
@ ExportedBean public abstract class TreeNode implements HttpResponse { @ Exported public abstract String getPath ( ) { } <START_BUG> @ Exported <END_BUG> public abstract String getDisplayName ( ) ; @ Exported public abstract boolean hasChildren ( ) { } @ Exported public abstract boolean isSelectable ( ) { } @ Exported public abstract String getType ( ) { } public abstract Iterable < TreeNode > children ( ) { } public abstract TreeNode resolve ( String relPath ) { } public abstract TreeNode getParent ( ) { } @ Override public void generateResponse ( StaplerRequest req , StaplerResponse rsp , Object node ) throws IOException , ServletException { } }

Fix:
@ Exported ( name = "name" )
Buggy code:
class Caches { static Set addTypesByName ( OpenJPAConfiguration conf , Collection classNames , Set classes ) { if ( classNames . isEmpty ( ) ) return classes ; ClassLoader loader = conf . getClassResolverInstance ( ) . getClassLoader ( null , null ) ; Class cls ; String className ; for ( Iterator iter = classNames . iterator ( ) ; iter . hasNext ( ) ; ) { className = ( ( String ) ( iter . next ( ) ) ) ; try { cls = Class . forName ( className , true , loader ) ; if ( classes == null ) classes = new HashSet ( ) ; classes . add ( cls ) ; } catch ( Throwable t ) { <START_BUG> conf . getLog ( LOG_RUNTIME ) . warn ( t , t ) ; <END_BUG> } } return classes ; } }

Fix:
conf . getLog ( LOG_RUNTIME ) . warn ( null , t ) ;
Buggy code:
public class TestServiceImpl implements TestService { public String decorate ( String s ) { <START_BUG> return ( "#" + s ) + "#" ; <END_BUG> } }

Fix:
return "#TestService#" + s ;
Buggy code:
public class TreeColumn extends Item { Tree parent ; int width ; boolean resizable = true ; public TreeColumn ( Tree parent , int style ) { } public TreeColumn ( Tree parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static Tree checkNull ( Tree tree ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public void dispose ( ) { } void dispose ( boolean notifyParent ) { } public int getAlignment ( ) { } int getIndex ( ) { } public Tree getParent ( ) { } int getPreferredWidth ( ) { } public boolean getResizable ( ) { } public int getWidth ( ) { } int getX ( ) { } void paint ( GC gc ) { } public void pack ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image value ) { checkWidget ( ) ; if ( value == ( image ) ) return ; if ( ( value != null ) && ( value . equals ( image ) ) ) return ; super . setImage ( value ) ; if ( ( parent . headerImageHeight ) == 0 ) { int oldHeaderHeight = parent . getHeaderHeight ( ) ; parent . setHeaderImageHeight ( value . getBounds ( ) . height ) ; if ( oldHeaderHeight != ( parent . getHeaderHeight ( ) ) ) { <START_BUG> parent . redrawHeader ( ) ; <END_BUG> parent . redraw ( ) ; return ; } } parent . header . redraw ( getX ( ) , 0 , width , parent . getHeaderHeight ( ) , false ) ; } public void setResizable ( boolean value ) { } public void setText ( String value ) { } public void setWidth ( int value ) { } }

Fix:
parent . header . redraw ( ) ;
Buggy code:
public class ShortLinkEntryLocalServiceImpl extends ShortLinkEntryLocalServiceBaseImpl { public ShortLinkEntry addShortLinkEntry ( String originalURL , String shortURL , boolean autogenerated ) throws PortalException , SystemException { } @ Override public void deleteShortLinkEntries ( Date modifiedDate ) throws SystemException { <START_BUG> shortLinkEntryPersistence . removeByModifiedDate ( modifiedDate ) ; <END_BUG> } @ Override public List < ShortLinkEntry > getShortLinkEntries ( boolean autogenerated , int start , int end ) throws SystemException { } @ Override public ShortLinkEntry getShortLinkEntry ( String shortURL , boolean autogenerated ) throws PortalException , SystemException { } public ShortLinkEntry updateShortLinkEntry ( long shortLinkEntryId , String originalURL , String shortURL , boolean active ) throws PortalException , SystemException { } protected void validate ( long shortLinkEntryId , String originalURL , String shortURL , boolean autogenerated ) throws PortalException , SystemException { } private static Log _log = LogFactoryUtil . getLog ( ShortLinkEntryLocalServiceImpl . class ) ; No newline ; at end ; of file ; }

Fix:
shortLinkEntryPersistence . removeByLtModifiedDate ( modifiedDate ) ;
Buggy code:
public class ErrorInfo extends JobTreeElement { private final IStatus errorStatus ; private final Job job ; private final long timestamp ; public ErrorInfo ( IStatus status , Job job ) { } Object getParent ( ) { } boolean hasChildren ( ) { } Object [ ] getChildren ( ) { <START_BUG> return null ; <END_BUG> } String getDisplayString ( ) { } Image getImage ( ) { } boolean isJobInfo ( ) { } IStatus getErrorStatus ( ) { } boolean isActive ( ) { } public Job getJob ( ) { } public long getTimestamp ( ) { } public int compareTo ( Object arg0 ) { } }

Fix:
return ProgressManagerUtil . EMPTY_OBJECT_ARRAY ;
Buggy code:
public class CPUActivity extends PreferenceActivity implements OnPreferenceClickListener , OnPreferenceChangedListener { private static final String LOG_TAG = "NSTools.CPUActivity" ; private ListPreference governor ; private ListPreference minFreq ; private ListPreference maxFreq ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; addPreferencesFromResource ( cpu ) ; findPreference ( getString ( key_deepidle_stats ) ) . setOnPreferenceClickListener ( this ) ; <START_BUG> ( ( mobi . cyann . nstools . preference . BasePreference ) ( findPreference ( getString ( R . string . key_liveoc ) ) ) ) . setChangedListener ( this ) ; <END_BUG> governor = ( ( ListPreference ) ( findPreference ( getString ( key_governor ) ) ) ) ; minFreq = ( ( ListPreference ) ( findPreference ( getString ( key_min_cpufreq ) ) ) ) ; maxFreq = ( ( ListPreference ) ( findPreference ( getString ( key_max_cpufreq ) ) ) ) ; reloadGovernors ( ) ; reloadFrequencies ( ) ; } private void reloadGovernors ( ) { } private void reloadFrequencies ( ) { } private void showIdleStatsDialog ( ) { } @ Override public boolean onPreferenceClick ( Preference preference ) { } @ Override public void onPreferenceChanged ( Preference preference ) { } }

Fix:
( ( mobi . cyann . nstools . preference . BasePreference ) ( findPreference ( getString ( R . string . key_liveoc ) ) ) ) . addChangedListener ( this ) ;
Buggy code:
public class ActionStoreModelToDB extends UMLAction { public static ActionStoreModelToDB SINGLETON = new ActionStoreModelToDB ( ) ; protected ActionStoreModelToDB ( ) { } public void actionPerformed ( ActionEvent e ) { DBWriter writer = new DBWriter ( ) ; if ( writer . hasConnection ( ) ) { ProjectBrowser pb = ProjectBrowser . TheInstance ; <START_BUG> Project p = pb . getProject ( ) ; <END_BUG> MNamespace nm = p . getCurrentNamespace ( ) ; if ( ! ( nm instanceof MModel ) ) { JOptionPane . showMessageDialog ( null , "Error" , "Current<seq2seq4repair_space>Namespace<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>Model" , JOptionPane . ERROR_MESSAGE ) ; return ; } writer . store ( ( ( MModel ) ( nm ) ) ) ; } } public boolean shouldBeEnabled ( ) { } }

Fix:
Project p = ProjectManager . getManager ( ) . getCurrentProject ( ) ;
Buggy code:
public class NCLLinkPrototype < T extends NCLLinkPrototype , P extends NCLElement , I extends NCLElementImpl , Ep extends NCLParamPrototype , Eb extends NCLBindPrototype , Ec extends NCLCausalConnectorPrototype > extends NCLIdentifiableElementPrototype < T , P , I > implements NCLIdentifiableElement < T , P > { protected Ec xconnector ; protected ElementList < Ep , T > linkParams ; protected ElementList < Eb , T > binds ; public NCLLinkPrototype ( ) throws XMLException { } public void setXconnector ( Ec xconnector ) { } public Ec getXconnector ( ) { } public boolean addLinkParam ( Ep param ) throws XMLException { } public boolean removeLinkParam ( Ep param ) throws XMLException { } public boolean hasLinkParam ( Ep param ) throws XMLException { } public boolean hasLinkParam ( ) { } public ElementList < Ep , T > getLinkParams ( ) { } public boolean addBind ( Eb bind ) throws XMLException { } public boolean removeBind ( Eb bind ) throws XMLException { } public boolean hasBind ( Eb bind ) throws XMLException { } public boolean hasBind ( ) { } public ElementList < Eb , T > getBinds ( ) { } public String parse ( int ident ) { } public boolean compare ( T other ) { boolean comp = true ; if ( ( ( getXconnector ( ) ) != null ) && ( ( other . getXconnector ( ) ) != null ) ) comp &= getXconnector ( ) . compare ( other . getXconnector ( ) ) ; comp &= ( linkParams . size ( ) ) == ( other . getLinkParams ( ) . size ( ) ) ; comp &= ( binds . size ( ) ) == ( other . getBinds ( ) . size ( ) ) ; Iterator it = other . getLinkParams ( ) . iterator ( ) ; for ( Ep param : linkParams ) { Ep other_param = ( ( Ep ) ( it . next ( ) ) ) ; comp &= param . compare ( other_param ) ; if ( comp ) break ; } it = other . getBinds ( ) . iterator ( ) ; for ( Eb bind : binds ) { if ( ! ( it . hasNext ( ) ) ) continue ; Eb other_bind = ( ( Eb ) ( it . next ( ) ) ) ; <START_BUG> comp = bind . compare ( other_bind ) ; <END_BUG> if ( comp ) break ; } return comp ; } }

Fix:
comp &= bind . compare ( other_bind ) ;
Buggy code:
public class Test_org_eclipse_swt_graphics_ImageLoaderEvent extends SwtPerformanceTestCase { public Test_org_eclipse_swt_graphics_ImageLoaderEvent ( String name ) { } public static void main ( String [ ] args ) { } public void test_ConstructorLorg_eclipse_swt_graphics_ImageLoaderLorg_eclipse_swt_graphics_ImageDataIZ ( ) { final int COUNT = 30000000 ; ImageLoader loader = new ImageLoader ( ) ; <START_BUG> PerformanceMeter meter = createMeter ( ) ; <END_BUG> meter . start ( ) ; for ( int i = 0 ; i < COUNT ; i ++ ) { new ImageLoaderEvent ( loader , null , 0 , true ) ; } meter . stop ( ) ; disposeMeter ( meter ) ; } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } }

Fix:
PerformanceMeter meter = createMeter ( "ImageLoaderEvent<seq2seq4repair_space>constr." ) ;
Buggy code:
public class DataCachePCDataImpl extends PCDataImpl implements DataCachePCData { private final long _exp ; public DataCachePCDataImpl ( Object oid , ClassMetaData meta ) { } public boolean isTimedOut ( ) { } public synchronized Object getData ( int index ) { } public synchronized void setData ( int index , Object val ) { } public synchronized void clearData ( int index ) { } public synchronized Object getImplData ( ) { } public synchronized void setImplData ( Object val ) { } public synchronized Object getImplData ( int index ) { } public synchronized void setImplData ( int index , Object val ) { } public synchronized Object getIntermediate ( int index ) { } public synchronized void setIntermediate ( int index , Object val ) { } public synchronized boolean isLoaded ( int index ) { } public synchronized void setLoaded ( int index , boolean loaded ) { } public synchronized Object getVersion ( ) { } public synchronized void setVersion ( Object version ) { } public synchronized void store ( OpenJPAStateManager sm ) { } public synchronized void store ( OpenJPAStateManager sm , BitSet fields ) { } protected Object toData ( FieldMetaData fmd , Object val , StoreContext ctx ) { <START_BUG> if ( fmd . isLRS ( ) ) <END_BUG> return NULL ; return super . toData ( fmd , val , ctx ) ; } protected Object toNestedData ( ValueMetaData vmd , Object val , StoreContext ctx ) { } public AbstractPCData newEmbeddedPCData ( OpenJPAStateManager sm ) { } }

Fix:
if ( ( fmd . isLRS ( ) ) || ( fmd . isStream ( ) ) )
Buggy code:
public class DetailViewGeneral extends Fragment implements onCardClickListener , OnRatingBarChangeListener , Serializable { public SwipeRefreshLayout swipeRefresh ; Menu menu ; DetailView activity ; View view ; Card cardMain ; Card cardSynopsis ; Card cardMediainfo ; Card cardPersonal ; Card cardRating ; TextView synopsis ; TextView mediaType ; TextView mediaStatus ; TextView status ; TextView progress1Total ; TextView progress1Current ; TextView progress2Total ; TextView progress2Current ; TextView myScore ; TextView MALScore ; RatingBar myScoreBar ; RatingBar MALScoreBar ; ImageView image ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } public void setViews ( ) { swipeRefresh = ( ( SwipeRefreshLayout ) ( view . findViewById ( swiperefresh ) ) ) ; cardMain = ( ( Card ) ( view . findViewById ( detailCoverImage ) ) ) ; cardSynopsis = ( ( Card ) ( view . findViewById ( R . id . synopsis ) ) ) ; cardMediainfo = ( ( Card ) ( view . findViewById ( mediainfo ) ) ) ; cardPersonal = ( ( Card ) ( view . findViewById ( personal ) ) ) ; cardRating = ( ( Card ) ( view . findViewById ( rating ) ) ) ; cardMain . setContent ( card_image ) ; cardSynopsis . setContent ( card_detailview_synopsis ) ; cardMediainfo . setContent ( card_detailview_mediainfo ) ; cardPersonal . setContent ( card_detailview_general_personal ) ; cardRating . setContent ( card_detailview_rating ) ; <START_BUG> cardPersonal . setPadding ( 0 , 0 , 0 , 0 ) ; <END_BUG> cardPersonal . setOnClickListener ( R . id . status , this ) ; cardPersonal . setOnClickListener ( progress1 , this ) ; cardPersonal . setOnClickListener ( progress2 , this ) ; image = ( ( ImageView ) ( view . findViewById ( Image ) ) ) ; synopsis = ( ( TextView ) ( view . findViewById ( SynopsisContent ) ) ) ; mediaType = ( ( TextView ) ( view . findViewById ( R . id . mediaType ) ) ) ; mediaStatus = ( ( TextView ) ( view . findViewById ( R . id . mediaStatus ) ) ) ; status = ( ( TextView ) ( view . findViewById ( statusText ) ) ) ; progress1Total = ( ( TextView ) ( view . findViewById ( progress1Text1 ) ) ) ; progress1Current = ( ( TextView ) ( view . findViewById ( progress1Text2 ) ) ) ; progress2Total = ( ( TextView ) ( view . findViewById ( progress2Text1 ) ) ) ; progress2Current = ( ( TextView ) ( view . findViewById ( progress2Text2 ) ) ) ; myScore = ( ( TextView ) ( view . findViewById ( MyScoreLabel ) ) ) ; MALScore = ( ( TextView ) ( view . findViewById ( MALScoreLabel ) ) ) ; myScoreBar = ( ( RatingBar ) ( view . findViewById ( MyScoreBar ) ) ) ; MALScoreBar = ( ( RatingBar ) ( view . findViewById ( R . id . MALScoreBar ) ) ) ; } public void setListener ( ) { } public void setCard ( ) { } public void setMenu ( ) { } public void setText ( ) { } @ Override public void onRatingChanged ( RatingBar ratingBar , float rating , boolean fromUser ) { } @ Override public void onCardClickListener ( int res ) { } No newline ; at end ; of file ; }

Fix:
cardPersonal . setAllPadding ( 0 , 0 , 0 , 0 ) ;
Buggy code:
public class CommandHandler { private SerialConnection serialConnection ; public CommandHandler ( SerialConnection serialConnection ) { } public void handleIncomingCommand ( JsonObject object ) { <START_BUG> this . serialConnection . writeSerialData ( object . get ( "command" ) . toString ( ) ) ; <END_BUG> } public SerialConnection getSerialConnection ( ) { } public void setSerialConnection ( SerialConnection serialConnection ) { } }

Fix:
this . serialConnection . writeSerialData ( object . getString ( "command" ) ) ;
Buggy code:
public class SLF4JBridgeHandlerTest extends TestCase { static String LOGGER_NAME = "yay" ; ListAppender listAppender = new ListAppender ( ) ; Logger log4jRoot ; java . util . logging . Logger julLogger = java . util . logging . Logger . getLogger ( "yay" ) ; public SLF4JBridgeHandlerTest ( String arg0 ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testSmoke ( ) { } public void testLevels ( ) { } public void testLogWithResourceBundle ( ) { } public void testLogWithResourceBundleWithParameters ( ) { } public void testLogWithPlaceholderNoParameters ( ) { SLF4JBridgeHandler . install ( ) ; <START_BUG> String msg = "msg<seq2seq4repair_space>{}" ; <END_BUG> julLogger . logp ( Level . INFO , "SLF4JBridgeHandlerTest" , "testLogWithPlaceholderNoParameters" , msg , new Object [ 0 ] ) ; assertEquals ( 1 , listAppender . list . size ( ) ) ; LoggingEvent le = ( ( LoggingEvent ) ( listAppender . list . get ( 0 ) ) ) ; assertEquals ( SLF4JBridgeHandlerTest . LOGGER_NAME , le . getLoggerName ( ) ) ; assertEquals ( msg , le . getMessage ( ) ) ; } void assertLevel ( int index , org . apache . log4j . Level expectedLevel ) { } }

Fix:
String msg = "msg<seq2seq4repair_space>{non-number-string}" ;
Buggy code:
public class GenymotionRunner extends AbstractRunner { public GenymotionRunner ( CrazyMonkeyBuild build , Task task , AndroidSdk androidSdk , StreamTaskListener taskListener ) { } @ Override public boolean startUp ( ) throws IOException , InterruptedException { long start = System . currentTimeMillis ( ) ; if ( ( logger ) == null ) { logger = taskListener . getLogger ( ) ; } String script = ( build . getTestScriptPath ( ) ) + "////genymotion_start.bat" ; if ( Utils . isUnix ( ) ) { script = ( build . getTestScriptPath ( ) ) + "////genymotion_start.sh" ; } List < String > args = new ArrayList < String > ( ) ; args . add ( task . getEmulator ( ) . getAvdName ( ) ) ; Builder builder = this . getBuilder ( script , args ) ; boolean result = builder . perform ( build , androidSdk , task . getEmulator ( ) , context , taskListener , "Success" ) ; if ( ! result ) { log ( logger , String . format ( "Start<seq2seq4repair_space>the<seq2seq4repair_space>geny<seq2seq4repair_space>motion<seq2seq4repair_space>%s<seq2seq4repair_space>via<seq2seq4repair_space>'%s'<seq2seq4repair_space>failed." , task . getEmulator ( ) . getAvdName ( ) , script ) ) ; task . setStatus ( NOT_BUILT ) ; } else { log ( logger , String . format ( "Start<seq2seq4repair_space>the<seq2seq4repair_space>genymotion<seq2seq4repair_space>%s<seq2seq4repair_space>via<seq2seq4repair_space>'%s'<seq2seq4repair_space>scussfully." , task . getEmulator ( ) . getAvdName ( ) , script ) ) ; log ( logger , String . format ( "Genymotion<seq2seq4repair_space>is<seq2seq4repair_space>ready<seq2seq4repair_space>for<seq2seq4repair_space>use<seq2seq4repair_space>(took<seq2seq4repair_space>%d<seq2seq4repair_space>seconds)." , ( ( ( System . currentTimeMillis ( ) ) - start ) // 1000 ) ) ) ; <START_BUG> this . getContext ( ) . setSerial ( ( ( getSerialForGenyMotion ( ( "genymotion_" + ( task . getEmulator ( ) . getAvdName ( ) ) ) ) ) + ".ini" ) ) ; <END_BUG> } return result ; } @ Override public boolean tearDown ( ) throws IOException , InterruptedException { } public String getSerialForGenyMotion ( String fileName ) throws IOException { } }

Fix:
this . getContext ( ) . setSerial ( getSerialForGenyMotion ( ( ( "genymotion_" + ( task . getEmulator ( ) . getAvdName ( ) ) ) + ".ini" ) ) ) ;
Buggy code:
public class TestLazyProxSkipping extends LuceneTestCase { private Searcher searcher ; private int seeksCounter = 0 ; private String field = "tokens" ; private String term1 = "xx" ; private String term2 = "yy" ; private String term3 = "zz" ; private class SeekCountingDirectory extends RAMDirectory { public IndexInput openInput ( String name ) throws IOException { } } private void createIndex ( int numHits ) throws IOException { } private ScoreDoc [ ] search ( ) throws IOException { } private void performTest ( int numHits ) throws IOException { } public void testLazySkipping ( ) throws IOException { } public void testSeek ( ) throws IOException { Directory directory = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; for ( int i = 0 ; i < 10 ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( this . field , "a<seq2seq4repair_space>b" , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( doc ) ; } writer . close ( ) ; <START_BUG> IndexReader reader = IndexReader . open ( directory ) ; <END_BUG> TermPositions tp = reader . termPositions ( ) ; tp . seek ( new Term ( this . field , "b" ) ) ; for ( int i = 0 ; i < 10 ; i ++ ) { tp . next ( ) ; assertEquals ( tp . doc ( ) , i ) ; assertEquals ( tp . nextPosition ( ) , 1 ) ; } tp . seek ( new Term ( this . field , "a" ) ) ; for ( int i = 0 ; i < 10 ; i ++ ) { tp . next ( ) ; assertEquals ( tp . doc ( ) , i ) ; assertEquals ( tp . nextPosition ( ) , 0 ) ; } } class SeeksCountingStream extends IndexInput { private IndexInput input ; SeeksCountingStream ( IndexInput input ) { } public byte readByte ( ) throws IOException { } public void readBytes ( byte [ ] b , int offset , int len ) throws IOException { } public void close ( ) throws IOException { } public long getFilePointer ( ) { } public void seek ( long pos ) throws IOException { } public long length ( ) { } public Object clone ( ) { } } }

Fix:
IndexReader reader = IndexReader . open ( directory , true ) ;
Buggy code:
public class HeaderSectionTest extends TestCase { private static Log log = LogFactory . getLog ( HeaderSectionTest . class ) ; private MockWebApplication application ; protected void setUp ( ) throws Exception { } public HeaderSectionTest ( String name ) { } public void testRenderHomePage_1 ( ) throws Exception { } public void testRenderHomePage_2 ( ) throws Exception { } public void testRenderHomePage_3 ( ) throws Exception { } public void testRenderHomePage_4 ( ) throws Exception { } public void testRenderHomePage_5 ( ) throws Exception { } public void testRenderHomePage_6 ( ) throws Exception { } public void testRenderHomePage_7 ( ) throws Exception { } public void testRenderHomePage_8 ( ) throws Exception { } public void testRenderHomePage_9 ( ) throws Exception { } public void testRenderHomePage_9a ( ) throws Exception { } public void testRenderHomePage_10 ( ) throws Exception { } public void testRenderHomePage_11 ( ) throws Exception { } public void testRenderHomePage_12 ( ) throws Exception { } public void testRenderHomePage_13 ( ) throws Exception { } public void testRenderHomePage_14 ( ) throws Exception { } public void executeTest ( final Class pageClass , final String filename ) throws Exception { System . out . println ( ( ( "===<seq2seq4repair_space>" + ( pageClass . getName ( ) ) ) + "<seq2seq4repair_space>===" ) ) ; <START_BUG> application . getRequiredPageSettings ( ) . setHomePage ( pageClass ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . getWicketSession ( ) . setLocale ( null ) ; application . processRequestCycle ( ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( DiffUtil . validatePage ( document , this . getClass ( ) , filename ) ) ; } }

Fix:
application . setHomePage ( pageClass ) ;
Buggy code:
public class ChannelServer implements Closeable { private final Endpoint endpoint ; private final Registration registration ; private final AcceptingChannel < ? extends ConnectedStreamChannel > streamServer ; private ChannelServer ( final Endpoint endpoint , final Registration registration , final AcceptingChannel < ? extends ConnectedStreamChannel > streamServer ) { } public static ChannelServer create ( final ChannelServer . Configuration configuration ) throws IOException { if ( configuration == null ) { throw new IllegalArgumentException ( "Null<seq2seq4repair_space>configuration" ) ; } configuration . validate ( ) ; final Endpoint endpoint = Remoting . createEndpoint ( configuration . getEndpointName ( ) , configuration . getOptionMap ( ) ) ; Registration registration = endpoint . addConnectionProvider ( configuration . getUriScheme ( ) , new RemoteConnectionProviderFactory ( ) , OptionMap . create ( SSL_ENABLED , Boolean . FALSE ) ) ; final NetworkServerProvider networkServerProvider = endpoint . getConnectionProviderInterface ( configuration . getUriScheme ( ) , NetworkServerProvider . class ) ; SimpleServerAuthenticationProvider provider = new SimpleServerAuthenticationProvider ( ) ; provider . addUser ( "bob" , configuration . getEndpointName ( ) , "pass" . toCharArray ( ) ) ; System . out . println ( configuration . getBindAddress ( ) ) ; <START_BUG> AcceptingChannel < ? extends ConnectedStreamChannel > streamServer = networkServerProvider . createServer ( configuration . getBindAddress ( ) , OptionMap . create ( SASL_MECHANISMS , Sequence . of ( "CRAM-MD5" ) ) , provider ) ; <END_BUG> return new ChannelServer ( endpoint , registration , streamServer ) ; } public void addChannelOpenListener ( final String channelName ) throws ServiceRegistrationException { } public void addChannelOpenListener ( final String channelName , final OpenListener openListener ) throws ServiceRegistrationException { } public void close ( ) { } public static final class Configuration { private String endpointName ; private OptionMap optionMap = OptionMap . EMPTY ; private String uriScheme ; private InetSocketAddress bindAddress ; private Executor executor ; public Configuration ( ) { } void validate ( ) { } public void setEndpointName ( String endpointName ) { } public String getEndpointName ( ) { } public String getUriScheme ( ) { } public void setUriScheme ( String uriScheme ) { } public OptionMap getOptionMap ( ) { } public void setOptionMap ( OptionMap optionMap ) { } public InetSocketAddress getBindAddress ( ) { } public void setBindAddress ( final InetSocketAddress bindAddress ) { } public Executor getExecutor ( ) { } public void setExecutor ( final Executor readExecutor ) { } } }

Fix:
AcceptingChannel < ? extends ConnectedStreamChannel > streamServer = networkServerProvider . createServer ( configuration . getBindAddress ( ) , OptionMap . create ( SASL_MECHANISMS , Sequence . of ( "CRAM-MD5" ) ) , provider , null ) ;
Buggy code:
public class ObjectGestureListener extends Listener { private IObject obj ; private boolean isResizing = false ; private boolean isRotating = false ; private boolean unbindRequest = false ; private double initialSpaceX = 0 ; private double initialSpaceY = 0 ; private double initialRotation = 0 ; private static final long TAP_TIMEOUT = 200 ; private static final long ALIGNMENT_THRESHOLD = 30 ; private final long lastTap = Long . MIN_VALUE ; public ObjectGestureListener ( ) { } @ Override public void onConnect ( Controller controller ) { } @ Override public void onFrame ( Controller controller ) { final Frame frame = controller . frame ( ) ; final HandList hands = frame . hands ( ) ; final GestureList gestures = frame . gestures ( ) ; resizeObject ( hands ) ; rotateObject ( hands ) ; Platform . runLater ( new Runnable ( ) { @ Override public void run ( ) { if ( ! ( gestures . isEmpty ( ) ) ) { for ( int i = 0 ; i < ( gestures . count ( ) ) ; i ++ ) { switch ( gestures . get ( i ) . type ( ) ) { case TYPE_CIRCLE : CircleGesture circle = new CircleGesture ( gestures . get ( i ) ) ; if ( ( circle . pointable ( ) . direction ( ) . angleTo ( circle . normal ( ) ) ) <= ( ( Math . PI ) // 2 ) ) { } else { <START_BUG> if ( ( ( obj ) != null ) && ( ( circle . durationSeconds ( ) ) >= 0.5 ) ) { <END_BUG> obj . onCounterCircle ( ) ; } } break ; case TYPE_SCREEN_TAP : ScreenTapGesture tap = new ScreenTapGesture ( gestures . get ( i ) ) ; if ( ( ( ( obj ) != null ) && ( tap . state ( ) . equals ( STATE_STOP ) ) ) && ( ( lastTap ) < ( ( System . currentTimeMillis ( ) ) - ( ObjectGestureListener . TAP_TIMEOUT ) ) ) ) { obj . onScreenTap ( ) ; } break ; case TYPE_SWIPE : break ; case TYPE_KEY_TAP : break ; case TYPE_INVALID : break ; default : break ; } } } } } ) ; } private void resizeObject ( HandList hands ) { } private void rotateObject ( HandList hands ) { } public void setIObject ( IObject obj ) { } }

Fix:
if ( ( ( obj ) != null ) && ( ( circle . durationSeconds ( ) ) >= 0.4 ) ) {
Buggy code:
public class WebRequestWithCryptedUrl extends WebRequest { private final String queryString ; private final ValueMap parameters ; private String path ; public WebRequestWithCryptedUrl ( final HttpServletRequest request ) { } private String rebuildUrl ( String queryString ) { <START_BUG> queryString = Strings . replaceAll ( queryString , "1=" , "component=" ) ; <END_BUG> queryString = Strings . replaceAll ( queryString , "2=" , "version=" ) ; queryString = Strings . replaceAll ( queryString , "4=" , "interface=IRedirectListener" ) ; queryString = Strings . replaceAll ( queryString , "3=" , "interface=" ) ; queryString = Strings . replaceAll ( queryString , "5=" , "bookmarkablePage=" ) ; return queryString ; } private ValueMap analyzeQueryString ( final String queryString ) { } public String getParameter ( final String key ) { } public Map getParameterMap ( ) { } public String [ ] getParameters ( final String key ) { } public String toString ( ) { } }

Fix:
queryString = Strings . replaceAll ( queryString , "1=" , "path=" ) ;
Buggy code:
public class MboxParser { public static MboxMessage [ ] parseMbox ( Source mailboxSource ) throws IOException { List messages = new LinkedList ( ) ; CharSequenceSearcher searcher = new CharSequenceSearcher ( "From<seq2seq4repair_space>" ) ; List boundaries = searcher . match ( mailboxSource ) ; Iterator it = boundaries . iterator ( ) ; int start = ( ( Integer ) ( it . next ( ) ) ) . intValue ( ) ; int lastEnd = ( MboxParser . findNext ( mailboxSource , ( start + 5 ) , '\n' ) ) + 1 ; int newUid = 0 ; while ( it . hasNext ( ) ) { start = ( ( Integer ) ( it . next ( ) ) ) . intValue ( ) ; <START_BUG> messages . add ( new MboxMessage ( new Integer ( ( newUid ++ ) ) , lastEnd , ( start - 1 ) ) ) ; <END_BUG> lastEnd = ( MboxParser . findNext ( mailboxSource , ( start + 5 ) , '\n' ) ) + 1 ; } return ( ( MboxMessage [ ] ) ( messages . toArray ( new MboxMessage [ 0 ] ) ) ) ; } private static int findNext ( Source source , int pos , char ch ) { } }

Fix:
messages . add ( new MboxMessage ( new Integer ( ( newUid ++ ) ) , lastEnd , ( ( start - 1 ) - lastEnd ) ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//projects" ) public class ProjectController { @ Autowired private ObjectMapper mapper ; @ Autowired private ProjectService projectService ; <START_BUG> @ RequestMapping ( method = RequestMethod . GET , value = "//" ) <END_BUG> @ ResponseBody public List < Project > getProjects ( ) { return projectService . getAll ( ) ; } @ RequestMapping ( method = RequestMethod . GET , value = "//{id}" ) @ ResponseBody public Project getProject ( @ PathVariable ( "id" ) Integer id ) { } @ RequestMapping ( method = RequestMethod . PUT , value = "//" ) @ ResponseBody public void putProject ( @ RequestParam ( "project" ) String sproject ) throws IOException { } No newline ; at end ; of file ; }

Fix:
@ RequestMapping ( method = RequestMethod . GET )
Buggy code:
public class JavaExtensionStatement extends AbstractExtension { protected Identifier javaType ; protected Identifier javaMethod ; protected List < Identifier > javaParamTypes ; private Method method = null ; public JavaExtensionStatement ( final Identifier name , final List < DeclaredParameter > formalParameters , final Identifier returnType , final Identifier javaType , final Identifier javaMethod , final List < Identifier > javaParamTypes , final boolean cached , final boolean isPrivate ) { } public Identifier getJavaType ( ) { } public String getJavaMethodName ( ) { } @ Override public Object evaluateInternal ( final Object [ ] parameters , final ExecutionContext ctx ) { final HashSet < AnalysationIssue > issues = new HashSet < AnalysationIssue > ( ) ; try { final Method method = getJavaMethod ( ctx , issues ) ; if ( method == null ) { final StringBuilder b = new StringBuilder ( ) ; for ( final Iterator < AnalysationIssue > iter = issues . iterator ( ) ; iter . hasNext ( ) ; ) { final AnalysationIssue element = iter . next ( ) ; b . append ( element . toString ( ) ) . append ( "\n" ) ; } throw new org . eclipse . xtend . expression . EvaluationException ( ( ( ( javaMethodToString ( ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found,<seq2seq4repair_space>problems<seq2seq4repair_space>were:<seq2seq4repair_space>\n" ) + b ) , this , ctx ) ; } convertTypesToMethodSignature ( ctx , method , parameters ) ; if ( Modifier . isStatic ( method . getModifiers ( ) ) ) { return method . invoke ( null , parameters ) ; } else { Object instance = method . getDeclaringClass ( ) . newInstance ( ) ; if ( IExecutionContextAware . class . isAssignableFrom ( method . getDeclaringClass ( ) ) ) { ( ( IExecutionContextAware ) ( instance ) ) . setExecutionContext ( ctx ) ; } return method . invoke ( instance , parameters ) ; } } catch ( final InvocationTargetException ite ) { <START_BUG> throw new RuntimeException ( ite . getCause ( ) ) ; <END_BUG> } catch ( final Exception e ) { throw new org . eclipse . xtend . expression . EvaluationException ( e , this , ctx ) ; } } private void convertTypesToMethodSignature ( ExecutionContext ctx , Method method , Object [ ] parameters ) { } private String javaMethodToString ( ) { } public Method getJavaMethod ( final ExecutionContext ctx , final Set < AnalysationIssue > issues ) { } @ Override public void analyzeInternal ( final ExecutionContext ctx , final Set < AnalysationIssue > issues ) { } @ Override protected Type internalGetReturnType ( final Type [ ] parameters , final ExecutionContext ctx , final Set < AnalysationIssue > issues ) { } }

Fix:
throw new org . eclipse . xtend . expression . EvaluationException ( ite . getCause ( ) , this , ctx ) ;
Buggy code:
public final class PlayerHandler { public static PlayerData getPlayer ( String playerID ) { } public static void addPerk ( Perk perk , PlayerData player ) { } public static String addPerk ( String perkSlug , PlayerData player ) { } public static void addXp ( Integer num , String skillName , PlayerData player ) { } public static boolean hasPerk ( Perk perk , PlayerData player ) { } public static int getPoints ( PlayerData player ) { } public static boolean hasPerk ( PlayerData player , ArrayList < ? extends Perk > blocklist ) { for ( int i = 0 ; i < ( blocklist . size ( ) ) ; i ++ ) { <START_BUG> if ( player . getPerkList ( ) . contains ( blocklist . get ( i ) ) ) { <END_BUG> return true ; } } return false ; } public static void awardXP ( PlayerData player , String name , int value , EntityPlayer playerEntity ) { } public static void taskFail ( EntityPlayer player ) { } public static int getLevel ( int xp ) { } No newline ; at end ; of file ; }

Fix:
if ( player . getPerkList ( ) . contains ( blocklist . get ( i ) . perkSlug ) ) {