nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ReplaceRegExp extends AbstractTask { private boolean byline ; private File file ; private ArrayList filesets ; private String flags ; private RegularExpression regex ; private Substitution subs ; public ReplaceRegExp ( ) { } public void setByLine ( String byline ) { } public void setFile ( File file ) { } public void setFlags ( String flags ) { } public void setMatch ( String match ) throws TaskException { } public void setReplace ( String replace ) throws TaskException { } public void addFileset ( FileSet set ) { } public RegularExpression createRegularExpression ( ) throws TaskException { } public Substitution createSubstitution ( ) throws TaskException { } public void execute ( ) throws TaskException { } protected String doReplace ( RegularExpression r , Substitution s , String input , int options ) throws TaskException { } protected void doReplace ( File f , int options ) throws IOException , TaskException { File parentDir = new File ( new File ( f . getAbsolutePath ( ) ) . getParent ( ) ) ; File temp = File . createTempFile ( "replace" , ".txt" , parentDir ) ; FileReader r = null ; FileWriter w = null ; try { r = new FileReader ( f ) ; w = new FileWriter ( temp ) ; BufferedReader br = new BufferedReader ( r ) ; BufferedWriter bw = new BufferedWriter ( w ) ; PrintWriter pw = new PrintWriter ( bw ) ; boolean changes = false ; final String message = ( ( ( ( ( ( ( ( "Replacing<seq2seq4repair_space>pattern<seq2seq4repair_space>'" + ( regex . getPattern ( ) ) ) + "'<seq2seq4repair_space>with<seq2seq4repair_space>'" ) + ( subs . getExpression ( ) ) ) + "'<seq2seq4repair_space>in<seq2seq4repair_space>'" ) + ( f . getPath ( ) ) ) + "'" ) + ( byline ? "<seq2seq4repair_space>by<seq2seq4repair_space>line" : "" ) ) + ( ( flags . length ( ) ) > 0 ? ( "<seq2seq4repair_space>with<seq2seq4repair_space>flags:<seq2seq4repair_space>'" + ( flags ) ) + "'" : "" ) ) + "." ; <START_BUG> getContext ( ) . warn ( message ) ; <END_BUG> if ( byline ) { LineNumberReader lnr = new LineNumberReader ( br ) ; String line = null ; while ( ( line = lnr . readLine ( ) ) != null ) { String res = doReplace ( regex , subs , line , options ) ; if ( ! ( res . equals ( line ) ) ) { changes = true ; } pw . println ( res ) ; } pw . flush ( ) ; } else { int flen = ( ( int ) ( f . length ( ) ) ) ; char [ ] tmpBuf = new char [ flen ] ; int numread = 0 ; int totread = 0 ; while ( ( numread != ( - 1 ) ) && ( totread < flen ) ) { numread = br . read ( tmpBuf , totread , flen ) ; totread += numread ; } String buf = new String ( tmpBuf ) ; String res = doReplace ( regex , subs , buf , options ) ; if ( ! ( res . equals ( buf ) ) ) { changes = true ; } pw . println ( res ) ; pw . flush ( ) ; } r . close ( ) ; r = null ; w . close ( ) ; w = null ; if ( changes ) { f . delete ( ) ; temp . renameTo ( f ) ; } else { temp . delete ( ) ; } } finally { try { if ( r != null ) { r . close ( ) ; } } catch ( Exception e ) { } try { if ( w != null ) { r . close ( ) ; } } catch ( Exception e ) { } } } }

Fix:
getContext ( ) . info ( message ) ;
Buggy code:
public final class ClassConstants extends BaseFilterReader implements ChainableReader { private String queuedData = null ; private static final String JAVA_CLASS_HELPER = "org.apache.tools.ant.filters.util.JavaClassHelper" ; public ClassConstants ( ) { } public ClassConstants ( final Reader in ) { } public int read ( ) throws IOException { int ch = - 1 ; if ( ( ( queuedData ) != null ) && ( ( queuedData . length ( ) ) == 0 ) ) { queuedData = null ; } if ( ( queuedData ) != null ) { ch = queuedData . charAt ( 0 ) ; queuedData = queuedData . substring ( 1 ) ; if ( ( queuedData . length ( ) ) == 0 ) { queuedData = null ; } } else { final String clazz = readFully ( ) ; <START_BUG> if ( ( clazz == null ) && ( ( clazz . length ( ) ) != 0 ) ) { <END_BUG> ch = - 1 ; } else { final byte [ ] bytes = clazz . getBytes ( "ISO-8859-1" ) ; try { final Class javaClassHelper = Class . forName ( ClassConstants . JAVA_CLASS_HELPER ) ; if ( javaClassHelper != null ) { final Class [ ] params = new Class [ ] { byte [ ] . class } ; final Method getConstants = javaClassHelper . getMethod ( "getConstants" , params ) ; final Object [ ] args = new Object [ ] { bytes } ; final StringBuffer sb = ( ( StringBuffer ) ( getConstants . invoke ( null , args ) ) ) ; if ( ( sb . length ( ) ) > 0 ) { queuedData = sb . toString ( ) ; return read ( ) ; } } } catch ( NoClassDefFoundError ex ) { throw ex ; } catch ( RuntimeException ex ) { throw ex ; } catch ( InvocationTargetException ex ) { Throwable t = ex . getTargetException ( ) ; if ( t instanceof NoClassDefFoundError ) { throw ( ( NoClassDefFoundError ) ( t ) ) ; } if ( t instanceof RuntimeException ) { throw ( ( RuntimeException ) ( t ) ) ; } throw new BuildException ( t ) ; } catch ( Exception ex ) { throw new BuildException ( ex ) ; } } } return ch ; } public Reader chain ( final Reader rdr ) { } }

Fix:
if ( ( clazz == null ) || ( ( clazz . length ( ) ) == 0 ) ) {
Buggy code:
public class AjaxRequestTargetTest extends WicketTestCase { public AjaxRequestTargetTest ( ) { } public void testHeaderContribution1 ( ) throws IOException { } public void testHeaderContribution2 ( ) throws IOException { } public void testHeaderContribution3 ( ) throws IOException { } private void executeHeaderTest ( final Class < ? extends Component > componentClass ) throws IOException { } private void executeHeaderTest ( final Class < ? extends Component > componentClass , String expectedFile ) throws IOException { final MockPageWithLinkAndComponent page = new MockPageWithLinkAndComponent ( ) ; new wicket . markup . html . WebComponent ( page , MockPageWithLinkAndComponent . COMPONENT_ID ) . setOutputMarkupId ( true ) ; new AjaxLink ( page , MockPageWithLinkAndComponent . LINK_ID ) { private static final long serialVersionUID = 1L ; @ Override public void onClick ( AjaxRequestTarget target ) { try { Constructor < ? extends Component > con = componentClass . getConstructor ( new Class [ ] { MarkupContainer . class , String . class } ) ; Component comp = con . newInstance ( new Object [ ] { page , MockPageWithLinkAndComponent . COMPONENT_ID } ) ; comp . setOutputMarkupId ( true ) ; target . addComponent ( comp ) ; } catch ( Exception e ) { throw new WicketRuntimeException ( e ) ; } } } ; tester . startPage ( new ITestPageSource ( ) { private static final long serialVersionUID = 1L ; public Page getTestPage ( ) { return page ; } } ) ; tester . clickLink ( LINK_ID ) ; String document = tester . getServletResponse ( ) . getDocument ( ) ; assertTrue ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>execution<seq2seq4repair_space>ajax<seq2seq4repair_space>request" , Pattern . compile ( "<//ajax-response>" ) . matcher ( document ) . find ( ) ) ; Pattern pat = Pattern . compile ( ".*<header-contribution>(.*?)<//header-contribution>.*" , Pattern . DOTALL ) ; Matcher mat = pat . matcher ( document ) ; String headerContribution = null ; if ( mat . matches ( ) ) { headerContribution = mat . group ( 1 ) ; } if ( expectedFile == null ) { assertNull ( ( ( "There<seq2seq4repair_space>was<seq2seq4repair_space>a<seq2seq4repair_space>header<seq2seq4repair_space>contribution<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>response:<seq2seq4repair_space><" + headerContribution ) + ">" ) , headerContribution ) ; } else { assertNotNull ( "Probably<seq2seq4repair_space>an<seq2seq4repair_space>exception<seq2seq4repair_space>happened" , headerContribution ) ; <START_BUG> assertTrue ( DiffUtil . validatePage ( headerContribution , this . getClass ( ) , expectedFile ) ) ; <END_BUG> } } }

Fix:
DiffUtil . validatePage ( headerContribution , this . getClass ( ) , expectedFile , true ) ;
Buggy code:
public class TestThreadedOptimize extends LuceneTestCase { private static final Analyzer ANALYZER = new SimpleAnalyzer ( ) ; private static final int NUM_THREADS = 3 ; private static final int NUM_ITER = 2 ; private static final int NUM_ITER2 = 2 ; private boolean failed ; private void setFailed ( ) { } public void runTest ( Directory directory , boolean autoCommit , MergeScheduler merger ) throws Exception { } public void testThreadedOptimize ( ) throws Exception { Directory directory = new MockRAMDirectory ( ) ; runTest ( directory , false , null ) ; runTest ( directory , true , null ) ; runTest ( directory , false , new ConcurrentMergeScheduler ( ) ) ; runTest ( directory , true , new ConcurrentMergeScheduler ( ) ) ; directory . close ( ) ; String tempDir = System . getProperty ( "tempDir" ) ; if ( tempDir == null ) throw new IOException ( "tempDir<seq2seq4repair_space>undefined,<seq2seq4repair_space>cannot<seq2seq4repair_space>run<seq2seq4repair_space>test" ) ; String dirName = tempDir + "//luceneTestThreadedOptimize" ; <START_BUG> directory = FSDirectory . getDirectory ( dirName ) ; <END_BUG> runTest ( directory , false , null ) ; runTest ( directory , true , null ) ; runTest ( directory , false , new ConcurrentMergeScheduler ( ) ) ; runTest ( directory , true , new ConcurrentMergeScheduler ( ) ) ; directory . close ( ) ; _TestUtil . rmDir ( dirName ) ; } }

Fix:
directory = FSDirectory . getDirectory ( dirName , null , false ) ;
Buggy code:
public class Menu extends Widget { int x ; int y ; boolean hasLocation ; Decorations parent ; MenuItem cascade ; MenuItem defaultItem ; public Menu ( Control parent ) { } public Menu ( Decorations parent , int style ) { } public Menu ( Menu parentMenu ) { } public Menu ( MenuItem parentItem ) { } static Control checkNull ( Control control ) { } static Menu checkNull ( Menu menu ) { } static MenuItem checkNull ( MenuItem item ) { } static int checkStyle ( int style ) { } public void addHelpListener ( HelpListener listener ) { } public void addMenuListener ( MenuListener listener ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } public MenuItem getDefaultItem ( ) { } public boolean getEnabled ( ) { } public int getItemCount ( ) { } public MenuItem getItem ( int index ) { } public MenuItem [ ] getItems ( ) { } String getNameText ( ) { } public Decorations getParent ( ) { } public MenuItem getParentItem ( ) { } public Menu getParentMenu ( ) { } public Shell getShell ( ) { } Point getSize ( ) { } public boolean getVisible ( ) { } void hookEvents ( ) { } public int indexOf ( MenuItem item ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } int Pt_CB_REALIZED ( int widget , int info ) { } int Pt_CB_UNREALIZED ( int widget , int info ) { } void releaseChildren ( boolean destroy ) { MenuItem [ ] items = getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { MenuItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } super . releaseChildren ( destroy ) ; } void releaseParent ( ) { } void releaseWidget ( ) { } public void removeHelpListener ( HelpListener listener ) { } public void removeMenuListener ( MenuListener listener ) { } public void setDefaultItem ( MenuItem item ) { } public void setEnabled ( boolean enabled ) { } public void setLocation ( int x , int y ) { } public void setLocation ( Point location ) { } public void setVisible ( boolean visible ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public class Graph < T extends Node , E extends Edge < T > > implements IGraph < T , E > { private String label ; private GraphType gType ; private Set < T > nodes ; private List < E > edges ; private List < IGraph > subgraphs ; private Attributes attributes ; public Graph ( String label ) { } public Graph ( String label , GraphType gtype ) { } public Graph ( String l , Set < T > nodes , List < E > edges , List < IGraph > subgraphs , Attributes attrs , GraphType graphType ) { } @ Override public String getLabel ( ) { } @ Override public void addNode ( T node ) { } @ Override public void addNodes ( Iterable < T > nodesList ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void addEdge ( E edge ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void addEdge ( T source , T target ) { } @ Override public E getEdge ( T source , T target ) { } @ Override public Iterable < T > getAllNodes ( ) { } @ Override public Iterable < E > getAllEdges ( ) { } @ Override public Iterable < IGraph > getAllSubGraphs ( ) { } @ Override public Attributes getAttributes ( ) { } @ Override public void setAttributes ( Attributes attrs ) { } @ Override public boolean containsNode ( T node ) { } @ Override public boolean containsNode ( String nodeLabel ) { } @ Override public boolean containsEdge ( E edge ) { } @ Override public boolean containsEdge ( String nodeSourceLabel , String nodeTargetLabel ) { } @ Override public boolean containsEdge ( T source , T target ) { } @ Override public boolean removeNode ( T node ) { } @ Override public boolean removeEdge ( E edge ) { } @ Override public boolean removeEdge ( T source , T target ) { } @ Override public void removeAllEdges ( ) { } @ Override public void removeAllNodes ( ) { } @ Override public boolean removeEdges ( Collection < E > edges ) { } @ Override public boolean removeNodes ( Collection < T > nodes ) { } @ Override public String getDot ( ) { } @ Override public GraphType getType ( ) { } @ Override public String toString ( ) { StringBuffer sb = new StringBuffer ( ) ; <START_BUG> sb . append ( ( ( this . gType ) == ( GraphType . DIGRAPH ) ? "digraph" : "graph" + ( this . label ) ) ) ; <END_BUG> sb . append ( "<seq2seq4repair_space>{<seq2seq4repair_space>" ) ; this . nodes . forEach ( ( n ) -> sb . append ( n . toString ( ) ) ) ; this . edges . forEach ( ( e ) -> sb . append ( e . toString ( ) ) ) ; sb . append ( this . attributes . toString ( ) ) ; sb . append ( "<seq2seq4repair_space>}<seq2seq4repair_space>" ) ; return sb . toString ( ) ; } @ Override public boolean equals ( Object obj ) { } }

Fix:
sb . append ( ( ( ( this . gType ) == ( GraphType . DIGRAPH ) ? "digraph<seq2seq4repair_space>" : "graph<seq2seq4repair_space>" ) + ( this . label ) ) ) ;
Buggy code:
public class MarkAsSpamAction extends FrameAction implements SelectionListener { public MarkAsSpamAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> r [ 0 ] . setMarkVariant ( MARK_AS_SPAM ) ; MarkMessageCommand c = new MarkMessageCommand ( r ) ; processor . addOp ( c ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class POITable extends Table { private static final String TAG = ( "Test<seq2seq4repair_space>" + ( POITable . class . getSimpleName ( ) ) ) + ")" ; private static final String NAME = "poi_table" ; private static final String COLUMN_LOCATION_NAME = "location_name" ; private static final String COLUMN_CATEGORY = "category" ; private static final String COLUMN_CATEGORY_COLOR = "category_color" ; private static final String COLUMN_ADDRESS = "address" ; private static final String COLUMN_CITY = "city" ; private static final String COLUMN_STATE = "state" ; private static final String COLUMN_LATITUDE = "latitude" ; private static final String COLUMN_LONGITUDE = "longitude" ; private static final String COLUMN_DESCRIPTION = "description" ; private static final String COLUMN_HAS_VISITED = "has_visited" ; @ Override public String getName ( ) { } @ Override public String getCreateStatement ( ) { } public static class Builder implements Table . Builder { ContentValues values = new ContentValues ( ) ; public POITable . Builder setLocationName ( String name ) { } public POITable . Builder setCategory ( String category ) { } public POITable . Builder setCategoryColor ( int categoryColor ) { <START_BUG> values . put ( POITable . COLUMN_CATEGORY , categoryColor ) ; <END_BUG> return this ; } public POITable . Builder setAddress ( String address ) { } public POITable . Builder setCity ( String city ) { } public POITable . Builder setState ( String state ) { } public POITable . Builder setLatitude ( double latitude ) { } public POITable . Builder setLongitude ( double longitude ) { } public POITable . Builder setDescription ( String description ) { } public POITable . Builder setHasVisited ( int hasVisited ) { } @ Override public long insert ( SQLiteDatabase writableDB ) { } } public static String getLocationName ( Cursor cursor ) { } public static String getCategory ( Cursor cursor ) { } public static int getCategoryColor ( Cursor cursor ) { } public static String getAddress ( Cursor cursor ) { } public static String getCity ( Cursor cursor ) { } public static String getState ( Cursor cursor ) { } public static double getLatitude ( Cursor cursor ) { } public static double getLongtitude ( Cursor cursor ) { } public static String getColumnDescription ( Cursor cursor ) { } public static int getColumnHasVisited ( Cursor cursor ) { } }

Fix:
values . put ( POITable . COLUMN_CATEGORY_COLOR , categoryColor ) ;
Buggy code:
public class Reader { final int numberOfQuestions = 31 ; String [ ] coordList = new String [ numberOfQuestions ] ; int [ ] coordListSize = new int [ numberOfQuestions ] ; public void Reader ( ) { } public void readData ( ) { } public double [ ] [ ] getData ( int number ) { double [ ] [ ] points = new double [ coordListSize [ number ] ] [ 2 ] ; int counter = 0 ; int counterTwo = 0 ; for ( String pair : coordList [ number ] . split ( "\\(|\\,|\\)" ) ) { <START_BUG> if ( ( pair . matches ( "\\-?\\d+|\\d+\\.\\d+" ) ) == true ) { <END_BUG> double coord = Double . parseDouble ( pair ) ; points [ counter ] [ counterTwo ] = coord ; counterTwo ++ ; if ( counterTwo == 2 ) { counter ++ ; counterTwo = 0 ; } } } return points ; } No newline ; at end ; of file ; }

Fix:
if ( ( pair . matches ( "\\-?(\\d+|\\d+\\.\\d+)" ) ) == true ) {
Buggy code:
class MethodResolver { private static Map < String , String > primitiveTypesSignature = new HashMap < String , String > ( ) ; private static class Tuple < X , Y > { public final X x ; public final Y y ; public Tuple ( X x , Y y ) { } } private static class DistanceComparator implements Comparator < MethodResolver . Tuple < ? , Integer > > { @ Override public int compare ( MethodResolver . Tuple < ? , Integer > left , MethodResolver . Tuple < ? , Integer > right ) { } } private static MethodResolver . DistanceComparator distanceComparator = new MethodResolver . DistanceComparator ( ) ; private static Map < Constructor < ? > , Class < ? > [ ] > constructorParamTypeCache = new HashMap < Constructor < ? > , Class < ? > [ ] > ( ) ; public static String getMethodSignature ( Class < ? > retType , Class < ? > [ ] params ) { } public static String getTypeSignature ( Class < ? > type ) { if ( type == null ) { return "V" ; } Class < ? > t = type ; String array = "" ; while ( t . isArray ( ) ) { array += "[" ; <START_BUG> t = type . getComponentType ( ) ; <END_BUG> } String signature = MethodResolver . primitiveTypesSignature . get ( t . getName ( ) ) ; if ( signature == null ) { signature = ( "L" + ( t . getName ( ) . replace ( '.' , '//' ) ) ) + ";" ; } return array + signature ; } static String resolveMethodOverload ( HashMap < String , Class < ? > > classCache , String className , String methodName , Object [ ] args ) throws ClassNotFoundException { } static void tryFindMatches ( String methodName , ArrayList < MethodResolver . Tuple < Method , Integer > > candidates , Object [ ] args , int argLength , Method [ ] methods ) { } static Constructor < ? > resolveConstructor ( Class < ? > clazz , Object [ ] args ) throws IOException , ClassNotFoundException { } private static MethodResolver . Tuple < Boolean , Integer > isAssignableFrom ( Class < ? > assignTo , Class < ? > assignFrom ) { } public static boolean convertConstructorArgs ( Constructor < ? > ctor , Object [ ] args ) { } private static boolean convertPrimitiveArg ( Class < ? > primitiveType , Object [ ] args , int argIndex ) { } }

Fix:
t = t . getComponentType ( ) ;
Buggy code:
public class ViewHeaderListCommand extends Command { private HeaderList headerList ; private MessageFolder folder ; public ViewHeaderListCommand ( FrameMediator frame , DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( WorkerStatusController worker ) throws Exception { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ; folder = ( ( MessageFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; ( ( StatusObservableImpl ) ( folder . getObservable ( ) ) ) . setWorker ( worker ) ; headerList = folder . getHeaderList ( ) ; <START_BUG> FolderItem folderItem = folder . getFolderItem ( ) ; <END_BUG> if ( folderItem . get ( "type" ) . equals ( "IMAPFolder" ) ) { IMAPRootFolder rootFolder = ( ( IMAPRootFolder ) ( folder . getRootFolder ( ) ) ) ; AccountItem accountItem = rootFolder . getAccountItem ( ) ; ImapItem item = accountItem . getImapItem ( ) ; boolean applyFilter = item . getBoolean ( "automatically_apply_filter" , false ) ; if ( applyFilter == true ) { processor . addOp ( new org . columba . mail . folder . command . ApplyFilterCommand ( r ) ) ; } } } }

Fix:
FolderItem folderItem = folder . getConfiguration ( ) ;
Buggy code:
public class Javah extends Task { private static final String FAIL_MSG = "Compile<seq2seq4repair_space>failed,<seq2seq4repair_space>messages<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>provided." ; private Vector classes = new Vector ( 2 ) ; private String cls ; private File destDir ; private Path classpath = null ; private File outputFile = null ; private boolean verbose = false ; private boolean force = false ; private boolean old = false ; private boolean stubs = false ; private Path bootclasspath ; private static String lSep = System . getProperty ( "line.separator" ) ; public void setClass ( String cls ) { } public Javah . ClassArgument createClass ( ) { } public class ClassArgument { private String name ; public ClassArgument ( ) { } public void setName ( String name ) { } public String getName ( ) { } } public void setDestdir ( File destDir ) { } public void setClasspath ( Path src ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public void setBootclasspath ( Path src ) { } public Path createBootclasspath ( ) { } public void setBootClasspathRef ( Reference r ) { } public void setOutputFile ( File outputFile ) { } public void setForce ( boolean force ) { } public void setOld ( boolean old ) { } public void setStubs ( boolean stubs ) { } public void setVerbose ( boolean verbose ) { } public void execute ( ) throws BuildException { } private void doClassicCompile ( ) throws BuildException { Commandline cmd = setupJavahCommand ( ) ; try { Main main = new Main ( cmd . getArguments ( ) ) ; main . run ( ) ; } catch ( Exception ex ) { if ( ex instanceof BuildException ) { throw ( ( BuildException ) ( ex ) ) ; } else { <START_BUG> throw new BuildException ( "Error<seq2seq4repair_space>starting<seq2seq4repair_space>javah:<seq2seq4repair_space>" , ex , location ) ; <END_BUG> } } } private Commandline setupJavahCommand ( ) { } protected void logAndAddFilesToCompile ( Commandline cmd ) { } }

Fix:
throw new BuildException ( ( "Error<seq2seq4repair_space>starting<seq2seq4repair_space>javah:<seq2seq4repair_space>" + ex ) , ex , location ) ;
Buggy code:
public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { } public int kind ( ) { } public String debugName ( ) { } public char [ ] genericTypeSignature ( ) { } public boolean isEquivalentTo ( TypeBinding otherType ) { <START_BUG> if ( ( ( this ) == otherType ) || ( ( erasure ( ) ) == otherType ) ) <END_BUG> return true ; if ( otherType == null ) return false ; switch ( otherType . kind ( ) ) { case Binding . WILDCARD_TYPE : case Binding . INTERSECTION_TYPE : return ( ( WildcardBinding ) ( otherType ) ) . boundCheck ( this ) ; case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return ( erasure ( ) ) == ( otherType . erasure ( ) ) ; } return false ; } public boolean isProvablyDistinct ( TypeBinding otherType ) { } protected void initializeArguments ( ) { } public char [ ] readableName ( ) { } public char [ ] shortReadableName ( ) { } }

Fix:
if ( ( this ) == otherType )
Buggy code:
public final class MathUtils { private static final byte NB = ( ( byte ) ( - 1 ) ) ; private static final short NS = ( ( short ) ( - 1 ) ) ; private static final byte PB = ( ( byte ) ( 1 ) ) ; private static final short PS = ( ( short ) ( 1 ) ) ; private static final byte ZB = ( ( byte ) ( 0 ) ) ; private static final short ZS = ( ( short ) ( 0 ) ) ; private MathUtils ( ) { } public static int addAndCheck ( int x , int y ) { } public static long binomialCoefficient ( final int n , final int k ) { } public static double binomialCoefficientDouble ( final int n , final int k ) { } public static double binomialCoefficientLog ( final int n , final int k ) { } public static double cosh ( double x ) { } public static boolean equals ( double x , double y ) { } public static long factorial ( final int n ) { } public static double factorialDouble ( final int n ) { } public static double factorialLog ( final int n ) { } public static int gcd ( int u , int v ) { } public static int hash ( double value ) { } public static byte indicator ( final byte x ) { } public static double indicator ( final double x ) { } public static float indicator ( final float x ) { } public static int indicator ( final int x ) { } public static long indicator ( final long x ) { } public static short indicator ( final short x ) { } public static int lcm ( int a , int b ) { } public static int mulAndCheck ( int x , int y ) { } public static double round ( double x , int scale ) { } public static double round ( double x , int scale , int roundingMethod ) { } public static float round ( float x , int scale ) { } public static float round ( float x , int scale , int roundingMethod ) { } private static double roundUnscaled ( double unscaled , double sign , int roundingMethod ) { } public static byte sign ( final byte x ) { } public static double sign ( final double x ) { } public static float sign ( final float x ) { } public static int sign ( final int x ) { } public static long sign ( final long x ) { } public static short sign ( final short x ) { } public static double sinh ( double x ) { } public static int subAndCheck ( int x , int y ) { long s = ( ( long ) ( x ) ) - ( ( long ) ( y ) ) ; if ( ( s < ( Integer . MIN_VALUE ) ) || ( s > ( Integer . MAX_VALUE ) ) ) { <START_BUG> throw new ArithmeticException ( "overflow:<seq2seq4repair_space>add" ) ; <END_BUG> } return ( ( int ) ( s ) ) ; } }

Fix:
throw new ArithmeticException ( "overflow:<seq2seq4repair_space>subtract" ) ;
Buggy code:
public class geoip extends JFrame { String url ; String response ; URL obj ; HttpURLConnection con ; int responseCode ; BufferedReader in ; public geoip ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void executeActionPerformed ( ActionEvent evt ) { try { url = "http:////freegeoip.net//json//" + ( site . getText ( ) ) ; obj = new URL ( url ) ; con = ( ( HttpURLConnection ) ( obj . openConnection ( ) ) ) ; con . setRequestProperty ( "User-Agent" , "Anagha" ) ; responseCode = con . getResponseCode ( ) ; if ( ( responseCode ) != 200 ) { status . setText ( "Cannot<seq2seq4repair_space>Process" ) ; } else { in = new BufferedReader ( new InputStreamReader ( con . getInputStream ( ) ) ) ; response = in . readLine ( ) ; String IP = JsonPath . read ( response , "$.ip" ) ; String countryCode = JsonPath . read ( response , "$.country_code" ) ; String countryName = JsonPath . read ( response , "$.country_name" ) ; String region = JsonPath . read ( response , "$.region_name" ) ; String city = JsonPath . read ( response , "$.city" ) ; value . append ( ( ( "\n" + "IP:<seq2seq4repair_space>" ) + IP ) ) ; value . append ( ( ( "\n" + "countryCode:<seq2seq4repair_space>" ) + countryCode ) ) ; value . append ( ( ( "\n" + "countryName:<seq2seq4repair_space>" ) + countryName ) ) ; value . append ( ( ( "\n" + "region:" ) + region ) ) ; value . append ( ( ( "\n" + "city:<seq2seq4repair_space>" ) + city ) ) ; in . close ( ) ; status . setText ( "Finished" ) ; } } catch ( IOException ex ) { <START_BUG> Logger . getLogger ( sitevalue . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; <END_BUG> } } private void backActionPerformed ( ActionEvent evt ) { } private void addActionPerformed ( ActionEvent evt ) { } private void siteMouseClicked ( MouseEvent evt ) { } private void siteKeyPressed ( KeyEvent evt ) { } public static void main ( String [ ] args ) { } private JButton add ; private JButton back ; private JButton execute ; private JScrollPane jScrollPane2 ; private JTextField site ; private JLabel status ; private JTextArea value ; }

Fix:
Logger . getLogger ( geoip . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ;
Buggy code:
public class Property2 extends AbstractFunction implements Serializable { private static final List desc = new LinkedList ( ) ; private static final String KEY = "__P" ; private static final int MIN_PARAMETER_COUNT = 1 ; private static final int MAX_PARAMETER_COUNT = 2 ; private Object [ ] values ; public Property2 ( ) { } public Object clone ( ) { <START_BUG> return new Property ( ) ; <END_BUG> } public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { } public void setParameters ( Collection parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } }

Fix:
return new Property2 ( ) ;
Buggy code:
@ Component @ Path ( "//user" ) public class UserRestResource { @ GET @ Produces ( "text//html" ) public Response getIt ( ) { } @ POST @ Produces ( "text//html" ) public Response doLogin ( @ FormParam ( "username" ) String userName , @ FormParam ( "password" ) String password ) { UserProfile user = validationService . login ( userName , password ) ; if ( user != null ) { NewCookie cookie = new NewCookie ( "id" , user . getId ( ) ) ; return Response . ok ( ) . cookie ( cookie ) . build ( ) ; } else { <START_BUG> return Response . status ( BAD_REQUEST ) . build ( ) ; <END_BUG> } } @ Path ( "register//{userName}" ) @ Produces ( "text//html" ) @ GET public Response isUserNameAvailable ( @ PathParam ( "userName" ) String userName ) { } @ Path ( "register//" ) @ Produces ( "text//html" ) @ POST public Response register ( @ FormParam ( "username" ) String userName , @ FormParam ( "password" ) String password , @ FormParam ( "phone" ) String phoneNumber ) { } @ Autowired private ValidationAndRegistrationService validationService ; }

Fix:
return Response . status ( UNAUTHORIZED ) . entity ( "wrong<seq2seq4repair_space>credentials" ) . build ( ) ;
Buggy code:
public class ActivitySettings extends ActionBarActivity { private static final String TAG = "ActivitySettings" ; public SettingsProfile settingsProfile ; private ActivitySettings . FragmentSettings fragmentSettings ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public void onBackPressed ( ) { } public class FragmentSettings extends PreferenceFragment { public FragmentSettings ( ) { } public void saveSettings ( ) { Preference pref = findPreference ( "checkbox_units" ) ; CheckBoxPreference check = ( ( CheckBoxPreference ) ( pref ) ) ; if ( check . isChecked ( ) ) settingsProfile . setUnits ( UNIT_IMPERIAL ) ; else settingsProfile . setUnits ( UNIT_METRIC ) ; pref = findPreference ( "checkbox_date_format" ) ; check = ( ( CheckBoxPreference ) ( pref ) ) ; if ( check . isChecked ( ) ) settingsProfile . setDateFormat ( DATE_FORMAT_MM_DD ) ; else settingsProfile . setDateFormat ( DATE_FORMAT_DD_MM ) ; <START_BUG> pref = findPreference ( "checkbox_date_format" ) ; <END_BUG> check = ( ( CheckBoxPreference ) ( pref ) ) ; if ( check . isChecked ( ) ) settingsProfile . setHourFormat ( HOUR_FORMAT_12 ) ; else settingsProfile . setHourFormat ( HOUR_FORMAT_24 ) ; Log . d ( ActivitySettings . TAG , ( "saving<seq2seq4repair_space>profile<seq2seq4repair_space>" + ( settingsProfile ) ) ) ; FilesHandler . getInstance ( ) . setSettingProfile ( getActivity ( ) , settingsProfile ) ; } @ Override public void onCreate ( Bundle savedInstanceState ) { } } }

Fix:
pref = findPreference ( "checkbox_hour_format" ) ;
Buggy code:
public class TestException extends SingleEMFTestCase { public void setUp ( ) { <START_BUG> super . setUp ( PObject . class ) ; <END_BUG> } public void testThrowsJPADefinedOptimisticException ( ) { } boolean isExpectedException ( Throwable t , Class expectedType ) { } void print ( Throwable t ) { } void print ( Throwable t , int tab ) { } }

Fix:
super . setUp ( PObject . class , CLEAR_TABLES ) ;
Buggy code:
public class BenchmarkSetup { public static final Type TERMINATION_TYPE = Type . TIME ; public static Integer [ ] TERMINATION_LIMITS = new Integer [ ] { 2000 , 5000 , 10000 , 20000 } ; public static final boolean INCLUDE_FLASH = true ; public static enum AlgorithmType { FLASH ( ) { @ Override public String toString ( ) { } } , HEURAKLES ( ) { @ Override public String toString ( ) { } } , INFORMATION_LOSS_BOUNDS ( ) { @ Override public String toString ( ) { } } ; } public static class Algorithm { private BenchmarkSetup . AlgorithmType type ; private TerminationConfiguration terminationConfig ; public Algorithm ( BenchmarkSetup . AlgorithmType type , TerminationConfiguration terminationConfig ) { } @ Override public String toString ( ) { } public TerminationConfiguration getTerminationConfig ( ) { <START_BUG> return ( terminationConfig ) != null ? terminationConfig . clone ( ) : null ; <END_BUG> } public BenchmarkSetup . AlgorithmType getType ( ) { } public String getStatusSuffix ( ) { } } public static enum BenchmarkCriterion { K_ANONYMITY ( ) { @ Override public String toString ( ) { } } , L_DIVERSITY ( ) { @ Override public String toString ( ) { } } , T_CLOSENESS ( ) { @ Override public String toString ( ) { } } , D_PRESENCE ( ) { @ Override public String toString ( ) { } } ; } public static enum BenchmarkDataset { ADULT ( ) { @ Override public String toString ( ) { } } , CUP ( ) { @ Override public String toString ( ) { } } , FARS ( ) { @ Override public String toString ( ) { } } , ATUS ( ) { @ Override public String toString ( ) { } } , IHIS ( ) { @ Override public String toString ( ) { } } ; } public static List < BenchmarkSetup . Algorithm > getAlgorithms ( ) { } public static ARXConfiguration getConfiguration ( BenchmarkSetup . BenchmarkDataset dataset , Metric < ? > metric , double suppression , BenchmarkSetup . BenchmarkCriterion ... criteria ) throws IOException { } public static double [ ] getSuppression ( ) { } @ SuppressWarnings ( "rawtypes" ) public static Metric [ ] getMetrics ( ) { } public static BenchmarkSetup . BenchmarkCriterion [ ] [ ] getCriteria ( ) { } public static Data getData ( BenchmarkSetup . BenchmarkDataset dataset ) throws IOException { } @ SuppressWarnings ( "incomplete-switch" ) public static Data getData ( BenchmarkSetup . BenchmarkDataset dataset , BenchmarkSetup . BenchmarkCriterion [ ] criteria ) throws IOException { } public static BenchmarkSetup . BenchmarkDataset [ ] getDatasets ( ) { } public static Hierarchy getHierarchy ( BenchmarkSetup . BenchmarkDataset dataset , String attribute ) throws IOException { } public static String [ ] getQuasiIdentifyingAttributes ( BenchmarkSetup . BenchmarkDataset dataset ) { } public static DataSubset getResearchSubset ( BenchmarkSetup . BenchmarkDataset dataset ) throws IOException { } public static String getSensitiveAttribute ( BenchmarkSetup . BenchmarkDataset dataset ) { } }

Fix:
return terminationConfig ;
Buggy code:
public final class EditBook extends AuthenticatedWebPage { static final Book otherBook = new Book ( "Frisbee<seq2seq4repair_space>Techniques" , "Marty<seq2seq4repair_space>van<seq2seq4repair_space>Hoff" , Book . FICTION ) ; public EditBook ( final Book book ) { } public static PageLink link ( final String name , final long id ) { } public static final class EditBookForm extends Form { public EditBookForm ( final String componentName , final Book book , final FeedbackPanel feedback ) { } public final void onSubmit ( ) { final RequestCycle cycle = getRequestCycle ( ) ; PageParameters parameters = new PageParameters ( ) ; final Book book = ( ( Book ) ( getRootModelObject ( ) ) ) ; parameters . put ( "id" , new Long ( book . getId ( ) ) ) ; <START_BUG> cycle . setPage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ; <END_BUG> cycle . setRedirect ( true ) ; } } }

Fix:
cycle . setResponsePage ( getPageFactory ( ) . newPage ( BookDetails . class , parameters ) ) ;
Buggy code:
public class ExcludeResourceAction implements IObjectActionDelegate { private ISelection selection ; private IWorkbenchPart targetPart ; public ExcludeResourceAction ( ) { } private void exclude ( IResource resource ) { try { <START_BUG> URI nullURI = new URI ( EFS . SCHEME_NULL , null , resource . getFullPath ( ) . toString ( ) , null , null ) ; <END_BUG> if ( ( resource . getType ( ) ) == ( IResource . FILE ) ) { IFile link = ( ( IFile ) ( resource ) ) ; link . createLink ( nullURI , ( ( IResource . REPLACE ) | ( IResource . ALLOW_MISSING_LOCAL ) ) , null ) ; } else { IFolder link = ( ( IFolder ) ( resource ) ) ; link . createLink ( nullURI , ( ( IResource . REPLACE ) | ( IResource . ALLOW_MISSING_LOCAL ) ) , null ) ; } } catch ( Exception e ) { MessageDialog . openError ( getShell ( ) , "Error" , "Error<seq2seq4repair_space>excluding<seq2seq4repair_space>resource" ) ; e . printStackTrace ( ) ; } } private Shell getShell ( ) { } public void run ( IAction action ) { } public void selectionChanged ( IAction action , ISelection selection ) { } public void setActivePart ( IAction action , IWorkbenchPart targetPart ) { } }

Fix:
URI nullURI = new URI ( EFS . SCHEME_NULL , null , "//" , null , null ) ;
Buggy code:
public class JPLEphemeridesLoaderTest { @ Test public void testConstantsJPL ( ) throws OrekitException { } @ Test public void testConstantsInpop ( ) throws OrekitException { } @ Test public void testGMJPL ( ) throws OrekitException { } @ Test public void testGMInpop ( ) throws OrekitException { Utils . setDataRoot ( "inpop" ) ; <START_BUG> JPLEphemeridesLoader loader = new JPLEphemeridesLoader ( JPLEphemeridesLoader . DEFAULT_INPOP_SUPPORTED_NAMES , EphemerisType . SUN ) ; <END_BUG> Assert . assertEquals ( 2.2032081E13 , loader . getLoadedGravitationalCoefficient ( MERCURY ) , 1000000.0 ) ; Assert . assertEquals ( 3.24858597E14 , loader . getLoadedGravitationalCoefficient ( VENUS ) , 1000000.0 ) ; Assert . assertEquals ( 4.2828376E13 , loader . getLoadedGravitationalCoefficient ( MARS ) , 1000000.0 ) ; Assert . assertEquals ( 1.26712764535E17 , loader . getLoadedGravitationalCoefficient ( JUPITER ) , 6.0E7 ) ; Assert . assertEquals ( 3.7940585443E16 , loader . getLoadedGravitationalCoefficient ( SATURN ) , 2000000.0 ) ; Assert . assertEquals ( 5.794549099E15 , loader . getLoadedGravitationalCoefficient ( URANUS ) , 1000000.0 ) ; Assert . assertEquals ( 6.836527128E15 , loader . getLoadedGravitationalCoefficient ( NEPTUNE ) , 1000000.0 ) ; Assert . assertEquals ( 9.71114E11 , loader . getLoadedGravitationalCoefficient ( PLUTO ) , 1000000.0 ) ; Assert . assertEquals ( 1.32712442110032E20 , loader . getLoadedGravitationalCoefficient ( SUN ) , 1000000.0 ) ; Assert . assertEquals ( 4.9028E12 , loader . getLoadedGravitationalCoefficient ( MOON ) , 1000000.0 ) ; Assert . assertEquals ( 4.0350325E14 , loader . getLoadedGravitationalCoefficient ( EARTH_MOON ) , 1000000.0 ) ; } @ Test public void testDerivative405 ( ) throws ParseException , OrekitException { } @ Test public void testDerivative406 ( ) throws ParseException , OrekitException { } @ Test @ Ignore public void testDerivative414 ( ) throws ParseException , OrekitException { } @ Test public void testDummyEarth ( ) throws ParseException , OrekitException { } @ Test public void testEndianness ( ) throws ParseException , OrekitException { } @ Test public void testInpopvsJPL ( ) throws ParseException , OrekitException { } @ Test public void testOverlappingEphemeridesData ( ) throws IOException , ParseException , OrekitException { } private void checkDerivative ( String supportedNames , AbsoluteDate date ) throws ParseException , OrekitException { } @ Before public void setUp ( ) { } }

Fix:
JPLEphemeridesLoader loader = new JPLEphemeridesLoader ( "^inpop.*TCB.*littleendian.*\\.dat$" , EphemerisType . SUN ) ;
Buggy code:
public abstract class AbstractActionService implements IActionService { private List actionServiceListeners ; public AbstractActionService ( ) { } public void addActionServiceListener ( IActionServiceListener actionServiceListener ) { <START_BUG> if ( ( actionServiceListeners ) != null ) <END_BUG> actionServiceListeners = new ArrayList ( ) ; if ( ! ( actionServiceListeners . contains ( actionServiceListener ) ) ) actionServiceListeners . add ( actionServiceListener ) ; } public void removeActionServiceListener ( IActionServiceListener actionServiceListener ) { } protected void fireActionServiceChanged ( ) { } }

Fix:
if ( ( actionServiceListeners ) == null )
Buggy code:
public class IndexParamWithStatelessIFrameTest extends WicketTestCase { public void testIndexedUrlMountedPageWithComponentThatUsesUrlForResourceListener1 ( ) throws Exception { } public void testIndexedUrlMountedPageWithComponentThatUsesUrlForResourceListener2 ( ) throws Exception { } public void execTest ( boolean stateless ) throws Exception { tester . getApplication ( ) . mount ( new IndexedParamUrlCodingStrategy ( "//test" , TestPageWithIFrame . class ) ) ; TestPageWithIFrame test = new TestPageWithIFrame ( new PageParameters ( "0=foo,1=bar" ) ) ; test . setStatelessHint ( stateless ) ; tester . startPage ( test ) ; tester . assertRenderedPage ( TestPageWithIFrame . class ) ; tester . assertNoErrorMessage ( ) ; String doc = tester . getServletResponse ( ) . getDocument ( ) ; if ( stateless == true ) { <START_BUG> tester . assertContains ( "src=\"test//wicket:interface//:0:frame::IResourceListener::\"" ) ; <END_BUG> } else { tester . assertContains ( "src=\"\\?wicket:interface=:0:frame::IResourceListener::\"" ) ; } if ( stateless == false ) { WebRequestCycle cycle = tester . setupRequestAndResponse ( ) ; tester . getServletRequest ( ) . setURL ( "test//wicket:interface//:0:frame::IResourceListener::" ) ; tester . processRequestCycle ( cycle ) ; assertEquals ( test . resourceContent , resourceText ) ; } } }

Fix:
tester . assertContains ( "src=\"test//wicket:interface//default:0:frame::IResourceListener::\"" ) ;
Buggy code:
public class SqliteDatabase extends CachedDatabase { private static final String FILENAME = "world.db" ; private final String PATH_TO_DB_FILE ; public SqliteDatabase ( BlockOwn plugin ) throws ClassNotFoundException , SQLException { } private Connection connect ( ) throws SQLException { } private void createTables ( ) throws SQLException { } @ Override protected String generateCreateBlockTableQuery ( ) { } @ Override protected String generateCreateEntityTableQuery ( ) { } @ Override protected String generateGetOwnerQuery ( OwnedBlock block ) { } @ Override protected String generateGetOwnerQuery ( OwnedEntity entity ) { } @ Override protected String generateSetBlockOwnerQuery ( DatabaseAction databaseAction ) { } @ Override protected String generateSetEntityOwnerQuery ( DatabaseAction databaseAction ) { } @ Override protected String generateDeleteOwnerQuery ( OwnedEntity entity ) { String worldName = entity . getWorld ( ) . getName ( ) ; StringBuilder query = new StringBuilder ( 200 ) ; <START_BUG> query . append ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) . append ( ENTITY_TABLE ) . append ( "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) . append ( WORLD_COLUMN ) . append ( "='" ) . append ( worldName ) . append ( "'<seq2seq4repair_space>AND<seq2seq4repair_space>" ) . append ( "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) . append ( ENTITY_ID_COLUMN ) . append ( "='" ) . append ( entity . getUniqueId ( ) . toString ( ) ) . append ( "';" ) ; <END_BUG> return query . toString ( ) ; } @ Override protected String generateDeleteOwnerQuery ( OwnedBlock block ) { } @ Override protected String generateDropUserBlocksQuery ( User user ) { } @ Override protected String generateDropUserEntitiesQuery ( User user ) { } }

Fix:
query . append ( "DELETE<seq2seq4repair_space>FROM<seq2seq4repair_space>" ) . append ( ENTITY_TABLE ) . append ( "<seq2seq4repair_space>WHERE<seq2seq4repair_space>" ) . append ( WORLD_COLUMN ) . append ( "='" ) . append ( worldName ) . append ( "'<seq2seq4repair_space>AND<seq2seq4repair_space>" ) . append ( ENTITY_ID_COLUMN ) . append ( "='" ) . append ( entity . getUniqueId ( ) . toString ( ) ) . append ( "';" ) ;
Buggy code:
public class WechatpayUtil { private static final String SIGN = "sign" ; public static String createNoncestr ( int length ) { } public static String sign ( Map < String , String > params , int clientType ) { List < String > kvs = new ArrayList < String > ( ) ; for ( Map . Entry < String , String > entry : params . entrySet ( ) ) { String key = entry . getKey ( ) ; String value = entry . getValue ( ) ; if ( ( key . equalsIgnoreCase ( WechatpayUtil . SIGN ) ) || ( StringUtils . isBlank ( value ) ) ) continue ; kvs . add ( ( ( key + "=" ) + value ) ) ; } Collections . sort ( kvs ) ; <START_BUG> kvs . add ( ( "key=" + ( ClientType . isFromApp ( clientType ) ? Configuration . getString ( "Payment.Wechat.App" ) : Configuration . getString ( "Payment.Wechat.JsApi" ) ) ) ) ; <END_BUG> String s = StringUtils . join ( kvs , "&" ) ; return DigestUtils . md5Hex ( s ) . toUpperCase ( ) ; } public static boolean validateSign ( Map < String , String > params , int clientType ) { } }

Fix:
kvs . add ( ( "key=" + ( ClientType . isFromApp ( clientType ) ? Configuration . getString ( "Payment.Wechat.AppKey" ) : Configuration . getString ( "Payment.Wechat.JsApiKey" ) ) ) ) ;
Buggy code:
public class MainActivity extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { <START_BUG> getMenuInflater ( ) . inflate ( layout_main , menu ) ; <END_BUG> return true ; } public void onClickButton1 ( View view ) { } public void onClickButton2 ( View view ) { } public void onClickButton3 ( View view ) { } No newline ; at end ; of file ; }

Fix:
getMenuInflater ( ) . inflate ( menu_main , menu ) ;
Buggy code:
public class InverseWishart implements CondProbDistrib { @ Override public void setParams ( Object [ ] params ) { } public void setParams ( MatrixLib scale , Integer freeDeg ) { } private void initializeConstants ( ) { } private static double multivariategamma ( int p , double x ) { } private static double lgmultivariategamma ( int p , double x ) { } private void checkHasParams ( ) { } @ Override public double getProb ( Object value ) { } public double getProb ( MatrixLib x ) { } @ Override public double getLogProb ( Object value ) { } public double getLogProb ( MatrixLib x ) { } public Object sampleVal ( ) { } public MatrixLib sample_value ( ) { checkHasParams ( ) ; MatrixLib temp = MatrixFactory . zeros ( d , d ) ; MultivarGaussian tmp = new MultivarGaussian ( ) ; <START_BUG> tmp . setParams ( MatrixFactory . zeros ( d , 1 ) , scale ) ; <END_BUG> for ( int i = 0 ; i < ( freeDeg ) ; i ++ ) { MatrixLib tmpmat = tmp . sample_value ( ) ; temp = temp . plus ( tmpmat . timesMat ( tmpmat . transpose ( ) ) ) ; } return temp . inverse ( ) ; } @ Override public Object [ ] getFiniteSupport ( ) { } private MatrixLib scale ; private boolean hasScale ; private int freeDeg ; private boolean hasFreeDeg ; private int d ; private double dimFactor ; private double logDimFactor ; private double normConst ; private double logNormConst ; }

Fix:
tmp . setParams ( MatrixFactory . zeros ( d , 1 ) , scale . inverse ( ) ) ;