nus-yam/ex-repair huggingface dataset:
Buggy code:
public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer { private final boolean useLU ; @ Deprecated public GaussNewtonOptimizer ( ) { } public GaussNewtonOptimizer ( ConvergenceChecker < PointVectorValuePair > checker ) { } @ Deprecated public GaussNewtonOptimizer ( final boolean useLU ) { } public GaussNewtonOptimizer ( final boolean useLU , ConvergenceChecker < PointVectorValuePair > checker ) { } @ Override public PointVectorValuePair doOptimize ( ) { final ConvergenceChecker < PointVectorValuePair > checker = getConvergenceChecker ( ) ; if ( checker == null ) { throw new NullArgumentException ( ) ; } final double [ ] targetValues = getTarget ( ) ; final int nR = targetValues . length ; final RealMatrix weightMatrix = getWeight ( ) ; final double [ ] residualsWeights = new double [ nR ] ; for ( int i = 0 ; i < nR ; i ++ ) { residualsWeights [ i ] = weightMatrix . getEntry ( i , i ) ; } final double [ ] currentPoint = getStartPoint ( ) ; PointVectorValuePair current = null ; int iter = 0 ; for ( boolean converged = false ; ! converged ; ) { ++ iter ; PointVectorValuePair previous = current ; final double [ ] currentObjective = computeObjectiveValue ( currentPoint ) ; final double [ ] currentResiduals = computeResiduals ( currentObjective ) ; <START_BUG> final RealMatrix weightedJacobian = computeJacobian ( currentPoint ) ; <END_BUG> current = new PointVectorValuePair ( currentPoint , currentObjective ) ; final double [ ] b = new double [ cols ] ; final double [ ] [ ] a = new double [ cols ] [ cols ] ; for ( int i = 0 ; i < ( rows ) ; ++ i ) { final double [ ] grad = weightedJacobian . getRow ( i ) ; final double weight = residualsWeights [ i ] ; final double residual = - ( currentResiduals [ i ] ) ; final double wr = weight * residual ; for ( int j = 0 ; j < ( cols ) ; ++ j ) { b [ j ] += wr * ( grad [ j ] ) ; } for ( int k = 0 ; k < ( cols ) ; ++ k ) { double [ ] ak = a [ k ] ; double wgk = weight * ( grad [ k ] ) ; for ( int l = 0 ; l < ( cols ) ; ++ l ) { ak [ l ] += wgk * ( grad [ l ] ) ; } } } try { RealMatrix mA = new BlockRealMatrix ( a ) ; DecompositionSolver solver = ( useLU ) ? new org . apache . commons . math3 . linear . LUDecomposition ( mA ) . getSolver ( ) : new org . apache . commons . math3 . linear . QRDecomposition ( mA ) . getSolver ( ) ; final double [ ] dX = solver . solve ( new ArrayRealVector ( b , false ) ) . toArray ( ) ; for ( int i = 0 ; i < ( cols ) ; ++ i ) { currentPoint [ i ] += dX [ i ] ; } } catch ( SingularMatrixException e ) { throw new org . apache . commons . math3 . exception . ConvergenceException ( LocalizedFormats . UNABLE_TO_SOLVE_SINGULAR_PROBLEM ) ; } if ( previous != null ) { converged = checker . converged ( iter , previous , current ) ; if ( converged ) { cost = computeCost ( currentResiduals ) ; return current ; } } } throw new MathInternalError ( ) ; } }

Fix:
final RealMatrix weightedJacobian = computeWeightedJacobian ( currentPoint ) ;
Buggy code:
public class Snarl implements Notifer { static boolean initialized = false ; @ Override public boolean laod ( String [ ] notifications ) { } @ Override public void send ( String alert , String title , String description , String iconPath ) { } @ Override public void unload ( ) { } @ Override public void send ( String alert , String title , String description ) { <START_BUG> send ( alert , title , description , null ) ; <END_BUG> } @ Override public NotiferTypes getName ( ) { } }

Fix:
send ( alert , title , description , "" ) ;
Buggy code:
public class ScalingRenderDevice implements RenderDevice { private NiftyRenderEngine renderEngine ; private RenderDevice internal ; public ScalingRenderDevice ( final NiftyRenderEngine renderEngine , final RenderDevice interal ) { } @ Override public RenderImage createImage ( String filename , boolean filterLinear ) { } @ Override public RenderFont createFont ( String filename ) { } @ Override public int getWidth ( ) { } @ Override public int getHeight ( ) { } @ Override public void beginFrame ( ) { } @ Override public void endFrame ( ) { } @ Override public void clear ( ) { } @ Override public void setBlendMode ( BlendMode renderMode ) { } @ Override public void renderQuad ( int x , int y , int width , int height , Color color ) { } @ Override public void renderQuad ( int x , int y , int width , int height , Color topLeft , Color topRight , Color bottomRight , Color bottomLeft ) { } @ Override public void renderImage ( RenderImage image , int x , int y , int width , int height , Color color , float imageScale ) { } @ Override public void renderImage ( RenderImage image , int x , int y , int w , int h , int srcX , int srcY , int srcW , int srcH , Color color , float scale , int centerX , int centerY ) { } @ Override public void renderFont ( RenderFont font , String text , int x , int y , Color fontColor , float sizeX , float sizeY ) { } @ Override public void enableClip ( int x0 , int y0 , int x1 , int y1 ) { <START_BUG> internal . enableClip ( renderEngine . convertToNativeX ( x0 ) , renderEngine . convertToNativeY ( y0 ) , renderEngine . convertToNativeWidth ( x1 ) , renderEngine . convertToNativeHeight ( y1 ) ) ; <END_BUG> } @ Override public void disableClip ( ) { } @ Override public MouseCursor createMouseCursor ( String filename , int hotspotX , int hotspotY ) throws IOException { } @ Override public void enableMouseCursor ( MouseCursor mouseCursor ) { } @ Override public void disableMouseCursor ( ) { } }

Fix:
internal . enableClip ( renderEngine . convertToNativeX ( x0 ) , renderEngine . convertToNativeY ( y0 ) , renderEngine . convertToNativeX ( x1 ) , renderEngine . convertToNativeY ( y1 ) ) ;
Buggy code:
public abstract class Component implements MouseListener { protected static Font font = FontManager . getFont ( "componentFont" ) ; protected List < ActionListener > listeners ; protected boolean selected = false ; protected boolean visible = true ; protected Vector2f pos ; protected Vector2f dim ; protected Component ( int x , int y , int w , int h ) { } public Vector2f getLocation ( ) { } public boolean isVisible ( ) { } public Vector2f getDim ( ) { } public boolean isSelected ( ) { } public void setSelected ( boolean val ) { } public void setDim ( Vector2f dim ) { } public void setDim ( int x , int y ) { } public int getWidth ( ) { } public int getHeight ( ) { } public boolean contains ( int x , int y ) { <START_BUG> return ( ( ( x >= ( pos . getX ( ) ) ) && ( x <= ( ( pos . getX ( ) ) + ( getWidth ( ) ) ) ) ) && ( y >= ( pos . getY ( ) ) ) ) && ( y <= ( ( pos . getY ( ) ) + ( getHeight ( ) ) ) ) ; <END_BUG> } public void setVisible ( boolean val ) { } public void setLocation ( int x , int y ) { } public synchronized void addActionListener ( ActionListener al ) { } public synchronized void removeActionListener ( ActionListener al ) { } protected synchronized void notifyActionListeners ( ) { } public abstract boolean update ( float deltaTime ) { } public abstract void render ( float deltaTime ) { } }

Fix:
return ( ( ( x >= ( pos . getX ( ) ) ) && ( x < ( ( pos . getX ( ) ) + ( getWidth ( ) ) ) ) ) && ( y >= ( pos . getY ( ) ) ) ) && ( y < ( ( pos . getY ( ) ) + ( getHeight ( ) ) ) ) ;
Buggy code:
public class ViewRisksAttributesTable extends ViewRisks < AnalysisContextRisk > { private DecimalFormat format = new DecimalFormat ( "##0.000" ) ; private Composite root ; private DynamicTable table ; private List < TableItem > items ; private List < TableColumn > columns ; private AnalysisManager manager ; public ViewRisksAttributesTable ( final Composite parent , final Controller controller , final ModelPart target , final ModelPart reset ) { } @ Override public void update ( ModelEvent event ) { } private void createItem ( QuasiIdentifierRisks risks ) { } @ Override protected Control createControl ( Composite parent ) { } @ Override protected AnalysisContextRisk createViewConfig ( AnalysisContext context ) { } @ Override protected void doReset ( ) { } @ Override protected void doUpdate ( final AnalysisContextRisk context ) { if ( ! ( this . isEnabled ( ) ) ) { if ( ( manager ) != null ) { manager . stop ( ) ; } this . setStatusEmpty ( ) ; return ; } Analysis analysis = new Analysis ( ) { RiskEstimateBuilderInterruptible builder = getBuilder ( context , context . context . getModel ( ) . getSelectedQuasiIdentifiers ( ) ) ; private boolean stopped = false ; private RiskModelAttributes risks ; @ Override public int getProgress ( ) { return builder . getProgress ( ) ; } @ Override public void onError ( ) { setStatusEmpty ( ) ; } @ Override public void onFinish ( ) { if ( ( stopped ) || ( ! ( isEnabled ( ) ) ) ) { return ; } for ( final TableItem i : items ) { i . dispose ( ) ; } items . clear ( ) ; for ( QuasiIdentifierRisks item : risks . getAttributeRisks ( ) ) { createItem ( item ) ; } for ( final TableColumn col : columns ) { col . pack ( ) ; } if ( ( risks . getAttributeRisks ( ) . length ) == 0 ) { setStatusEmpty ( ) ; } else { setStatusDone ( ) ; } table . layout ( ) ; table . redraw ( ) ; } @ Override public void onInterrupt ( ) { <START_BUG> if ( ( stopped ) || ( ! ( isEnabled ( ) ) ) ) { <END_BUG> setStatusEmpty ( ) ; } else { setStatusWorking ( ) ; } } @ Override public void run ( ) throws InterruptedException { long time = System . currentTimeMillis ( ) ; risks = builder . getPopulationBasedAttributeRisks ( ) ; while ( ( ( ( System . currentTimeMillis ( ) ) - time ) < ( MINIMAL_WORKING_TIME ) ) && ( ! ( stopped ) ) ) { Thread . sleep ( 10 ) ; } } @ Override public void stop ( ) { builder . interrupt ( ) ; this . stopped = true ; } } ; this . manager . start ( analysis ) ; } @ Override protected ComponentStatusLabelProgressProvider getProgressProvider ( ) { } @ Override protected ViewRisk getViewType ( ) { } protected boolean isRunning ( ) { } }

Fix:
if ( ! ( isEnabled ( ) ) ) {
Buggy code:
public class RandomAccessSparseVector extends AbstractVector { private static final int INITIAL_SIZE = 11 ; protected OpenIntDoubleHashMap values ; public RandomAccessSparseVector ( ) { } public RandomAccessSparseVector ( int cardinality ) { } public RandomAccessSparseVector ( int cardinality , int size ) { } public RandomAccessSparseVector ( String name , int cardinality ) { } public RandomAccessSparseVector ( String name , int cardinality , int size ) { } public RandomAccessSparseVector ( Vector other ) { } public RandomAccessSparseVector ( RandomAccessSparseVector other , boolean shallowCopy ) { } @ Override protected Matrix matrixLike ( int rows , int columns ) { } @ Override public RandomAccessSparseVector clone ( ) { } @ Override public Vector assign ( Vector other ) { } public double getQuick ( int index ) { } public void setQuick ( int index , double value ) { } public int getNumNondefaultElements ( ) { } public RandomAccessSparseVector like ( ) { } public Vector like ( int newCardinality ) { } public Iterator < Vector . Element > iterateNonZero ( ) { } public Iterator < Vector . Element > iterateAll ( ) { } @ Override public boolean equals ( Object o ) { } private class AllIterator implements Iterator < Vector . Element > { private int offset = 0 ; private final RandomAccessSparseVector . Element element = new RandomAccessSparseVector . Element ( 0 ) ; public boolean hasNext ( ) { } public Vector . Element next ( ) { } public void remove ( ) { } } private class NonZeroIterator implements Iterator < Vector . Element > { private int offset = 0 ; private final RandomAccessSparseVector . Element element = new RandomAccessSparseVector . Element ( 0 ) ; private final IntArrayList intArrList = values . keys ( ) ; private NonZeroIterator ( boolean sorted ) { } public boolean hasNext ( ) { } public RandomAccessSparseVector . Element next ( ) { } public void remove ( ) { } } public Vector . Element getElement ( int index ) { } public class Element implements Vector . Element { private int ind ; public Element ( int ind ) { } public double get ( ) { } public int index ( ) { } public void set ( double value ) { } } private static class AddToVector implements IntDoubleProcedure { private final Vector v ; private AddToVector ( Vector v ) { } public boolean apply ( int key , double value ) { } } @ Override public void addTo ( Vector v ) { if ( ( v . size ( ) ) != ( size ( ) ) ) { <START_BUG> throw new CardinalityException ( ) ; <END_BUG> } values . forEachPair ( new RandomAccessSparseVector . AddToVector ( v ) ) ; } @ Override public double dot ( Vector x ) { } }

Fix:
throw new CardinalityException ( size ( ) , v . size ( ) ) ;
Buggy code:
public class GeneralOptionsDialog extends JDialog implements ActionListener { private static final String RESOURCE_PATH = "org.columba.mail.i18n.dialog" ; JButton okButton ; JButton cancelButton ; JButton helpButton ; JLabel lfLabel ; JComboBox lfComboBox ; JButton lfButton ; private String theme = null ; private ThemePluginHandler handler ; JCheckBox overwriteCheckBox ; JLabel mainFontLabel ; JLabel textFontLabel ; JButton mainFontButton ; JButton textFontButton ; private Font mainFont ; private Font textFont ; JLabel toolbarLabel ; JComboBox toolbarComboBox ; JLabel languageLabel ; JComboBox languageComboBox ; JFrame frame ; ConfigPluginHandler configHandler ; String configID ; public GeneralOptionsDialog ( JFrame frame ) { } public void updateComponents ( boolean b ) { } protected void layoutComponents ( ) { JPanel contentPane = new JPanel ( new BorderLayout ( ) ) ; setContentPane ( contentPane ) ; FormLayout layout = new FormLayout ( "12dlu,<seq2seq4repair_space>pref,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>max(40dlu;pref),<seq2seq4repair_space>3dlu,<seq2seq4repair_space>pref" , "" ) ; DefaultFormBuilder builder = new DefaultFormBuilder ( layout ) ; builder . setDefaultDialogBorder ( ) ; builder . setLeadingColumnOffset ( 1 ) ; builder . appendSeparator ( "General" ) ; builder . nextLine ( ) ; builder . append ( languageLabel ) ; builder . append ( languageComboBox , 3 ) ; builder . nextLine ( ) ; builder . append ( toolbarLabel ) ; builder . append ( toolbarComboBox , 3 ) ; builder . nextLine ( ) ; builder . appendSeparator ( "Look<seq2seq4repair_space>And<seq2seq4repair_space>Feel" ) ; builder . nextLine ( ) ; builder . append ( lfLabel , lfComboBox , lfButton ) ; builder . nextLine ( ) ; builder . appendSeparator ( "Fonts" ) ; builder . nextLine ( ) ; builder . append ( overwriteCheckBox , 5 ) ; builder . nextLine ( ) ; builder . append ( mainFontLabel ) ; builder . append ( mainFontButton , 3 ) ; builder . nextLine ( ) ; builder . append ( textFontLabel ) ; builder . append ( textFontButton , 3 ) ; builder . nextLine ( ) ; contentPane . add ( builder . getPanel ( ) , BorderLayout . CENTER ) ; JPanel bottomPanel = new JPanel ( new BorderLayout ( 0 , 0 ) ) ; bottomPanel . setBorder ( new SingleSideEtchedBorder ( SwingConstants . TOP ) ) ; JPanel buttonPanel = new JPanel ( new GridLayout ( 1 , 2 , 5 , 0 ) ) ; <START_BUG> buttonPanel . setBorder ( BorderFactory . createEmptyBorder ( 12 , 17 , 11 , 11 ) ) ; <END_BUG> buttonPanel . add ( okButton ) ; buttonPanel . add ( cancelButton ) ; bottomPanel . add ( buttonPanel , BorderLayout . EAST ) ; contentPane . add ( bottomPanel , BorderLayout . SOUTH ) ; getRootPane ( ) . setDefaultButton ( okButton ) ; getRootPane ( ) . registerKeyboardAction ( this , "CANCEL" , KeyStroke . getKeyStroke ( KeyEvent . VK_ESCAPE , 0 ) , JComponent . WHEN_IN_FOCUSED_WINDOW ) ; } protected void initComponents ( ) { } public void actionPerformed ( ActionEvent event ) { } public Font getMainFont ( ) { } public Font getTextFont ( ) { } }

Fix:
buttonPanel . setBorder ( BorderFactory . createEmptyBorder ( 17 , 12 , 11 , 11 ) ) ;
Buggy code:
public class JarLibraryLoader implements LibraryLoader { private final CodeSource codeSource ; private final String libraryPath ; public JarLibraryLoader ( ) { } public JarLibraryLoader ( CodeSource codeSource , String libraryPath ) { } public boolean load ( String name , boolean verify ) { boolean loaded = false ; try { Platform platform = Platform . detect ( ) ; <START_BUG> JarFile jar = new JarFile ( codeSource . getLocation ( ) . getPath ( ) , verify ) ; <END_BUG> try { for ( String path : libCandidates ( platform , name ) ) { JarEntry entry = jar . getJarEntry ( path ) ; if ( entry == null ) continue ; String ext = ( path . contains ( "." ) ) ? path . substring ( path . lastIndexOf ( "." ) ) : "lib" ; File lib = JarLibraryLoader . extract ( name , ext , jar . getInputStream ( entry ) ) ; System . load ( lib . getAbsolutePath ( ) ) ; lib . delete ( ) ; loaded = true ; break ; } } finally { jar . close ( ) ; } } catch ( Throwable e ) { loaded = false ; } return loaded ; } private static File extract ( String name , String ext , InputStream is ) throws IOException { } private List < String > libCandidates ( Platform platform , String name ) { } }

Fix:
JarFile jar = new JarFile ( new File ( codeSource . getLocation ( ) . toURI ( ) ) , verify ) ;
Buggy code:
final class HttpServletRequestFacade implements HttpServletRequest { private static StringManager sm = StringManager . getManager ( "org.apache.tomcat.core" ) ; private Request request ; HttpSessionFacade sessionFacade ; private boolean usingStream = false ; private boolean usingReader = false ; HttpServletRequestFacade ( Request request ) { } void recycle ( ) { } Request getRealRequest ( ) { } public Object getAttribute ( String name ) { } public Enumeration getAttributeNames ( ) { } public void setAttribute ( String name , Object value ) { } public void removeAttribute ( String name ) { } public String getCharacterEncoding ( ) { } public int getContentLength ( ) { } public String getContentType ( ) { } public Cookie [ ] getCookies ( ) { } public long getDateHeader ( String name ) { } public String getHeader ( String name ) { } public Enumeration getHeaders ( String name ) { } public Enumeration getHeaderNames ( ) { } public ServletInputStream getInputStream ( ) throws IOException { } public int getIntHeader ( String name ) throws NumberFormatException { } public String getMethod ( ) { } public String getParameter ( String name ) { } public String [ ] getParameterValues ( String name ) { } public Enumeration getParameterNames ( ) { } public String getPathInfo ( ) { } public String getPathTranslated ( ) { } public String getProtocol ( ) { } public String getQueryString ( ) { } public String getRemoteUser ( ) { } public String getScheme ( ) { } public String getServerName ( ) { } public int getServerPort ( ) { } public BufferedReader getReader ( ) throws IOException { } public String getRemoteAddr ( ) { } public String getRemoteHost ( ) { } public String getRequestURI ( ) { } public RequestDispatcher getRequestDispatcher ( String path ) { if ( path == null ) return null ; if ( ! ( path . startsWith ( "//" ) ) ) { String pI = request . getPathInfo ( ) ; if ( pI == null ) path = FileUtil . catPath ( request . getServletPath ( ) , path ) ; else path = FileUtil . catPath ( ( ( request . getServletPath ( ) ) + pI ) , path ) ; if ( path == null ) return null ; } <START_BUG> return request . getContext ( ) . getRequestDispatcher ( path ) ; <END_BUG> } public Locale getLocale ( ) { } public Enumeration getLocales ( ) { } public String getContextPath ( ) { } public String getServletPath ( ) { } public String getRealPath ( String name ) { } public String getAuthType ( ) { } public boolean isSecure ( ) { } public boolean isUserInRole ( String role ) { } public Principal getUserPrincipal ( ) { } public HttpSession getSession ( ) { } public HttpSession getSession ( boolean create ) { } public String getRequestedSessionId ( ) { } public boolean isRequestedSessionIdValid ( ) { } public boolean isRequestedSessionIdFromCookie ( ) { } public boolean isRequestedSessionIdFromUrl ( ) { } public boolean isRequestedSessionIdFromURL ( ) { } }

Fix:
return request . getContext ( ) . getFacade ( ) . getRequestDispatcher ( path ) ;
Buggy code:
public class DoubleConverter extends AbstractDecimalConverter < Double > { private static final long serialVersionUID = 1L ; public static final IConverter < Double > INSTANCE = new DoubleConverter ( ) ; <START_BUG> public Double convertToObject ( final String value , Locale locale ) { <END_BUG> final Number number = parse ( value , ( - ( Double . MAX_VALUE ) ) , Double . MAX_VALUE , locale ) ; if ( number == null ) { return null ; } return number . doubleValue ( ) ; } @ Override protected Class < Double > getTargetType ( ) { } }

Fix:
public Double convertToObject ( final String value , final Locale locale ) {
Buggy code:
public abstract class AbstractMetamataTask extends Task { protected Path classPath = null ; protected Path sourcePath = null ; protected File metamataHome = null ; protected CommandlineJava cmdl = new CommandlineJava ( ) ; protected Vector fileSets = new Vector ( ) ; protected File optionsFile = null ; protected Hashtable includedFiles = null ; public AbstractMetamataTask ( ) { } protected AbstractMetamataTask ( String className ) { } public void setHome ( final File value ) { } public void setMetamatahome ( final File value ) { } public Path createClasspath ( ) { } public Path createSourcepath ( ) { } public Argument createJvmarg ( ) { } public void setMaxmemory ( String max ) { } public void addFileSet ( FileSet fs ) { } public void execute ( ) throws BuildException { } protected void setUp ( ) throws BuildException { } protected abstract ExecuteStreamHandler createStreamHandler ( ) { } protected void execute0 ( ExecuteStreamHandler handler ) throws BuildException { final Execute process = new Execute ( handler ) ; log ( cmdl . describeCommand ( ) , MSG_VERBOSE ) ; process . setCommandline ( cmdl . getCommandline ( ) ) ; try { <START_BUG> if ( Execute . isFailure ( process . execute ( ) ) ) { <END_BUG> throw new BuildException ( "Metamata<seq2seq4repair_space>task<seq2seq4repair_space>failed." ) ; } } catch ( IOException e ) { throw new BuildException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>launch<seq2seq4repair_space>Metamata<seq2seq4repair_space>task" , e ) ; } } protected void cleanUp ( ) { } protected final File getMetamataJar ( File home ) { } protected void checkOptions ( ) throws BuildException { } protected abstract Vector getOptions ( ) { } protected void generateOptionsFile ( File tofile , Vector options ) throws BuildException { } protected Hashtable getFileMapping ( ) { } protected static final void addAllVector ( Vector dest , Enumeration files ) { } protected final File createTmpFile ( ) { } protected Hashtable scanSources ( Hashtable map ) { } protected Hashtable scanSources ( final Hashtable mapping , final String [ ] entries ) { } }

Fix:
if ( ( process . execute ( ) ) != 0 ) {
Buggy code:
public class PackageBinding extends Binding implements TypeConstants { public long tagBits = 0 ; public char [ ] [ ] compoundName ; PackageBinding parent ; public LookupEnvironment environment ; HashtableOfType knownTypes ; HashtableOfPackage knownPackages ; protected PackageBinding ( ) { } public PackageBinding ( char [ ] [ ] compoundName , PackageBinding parent , LookupEnvironment environment ) { } public PackageBinding ( char [ ] topLevelPackageName , LookupEnvironment environment ) { } public PackageBinding ( LookupEnvironment environment ) { } private void addNotFoundPackage ( char [ ] simpleName ) { } private void addNotFoundType ( char [ ] simpleName ) { } void addPackage ( PackageBinding element ) { } void addType ( ReferenceBinding element ) { } public final int kind ( ) { } <START_BUG> public char [ ] computeUniqueKey ( boolean withAccessFlags ) { <END_BUG> return CharOperation . concatWith ( compoundName , '//' ) ; } private PackageBinding findPackage ( char [ ] name ) { } PackageBinding getPackage ( char [ ] name ) { } PackageBinding getPackage0 ( char [ ] name ) { } ReferenceBinding getType ( char [ ] name ) { } ReferenceBinding getType0 ( char [ ] name ) { } public Binding getTypeOrPackage ( char [ ] name ) { } public char [ ] readableName ( ) { } public String toString ( ) { } }

Fix:
public char [ ] computeUniqueKey ( boolean isLeaf ) {
Buggy code:
public class ReleateKeywordIndexImpl implements IndexMaker { private static final Log log = LogFactory . getLog ( ReleateKeywordIndexImpl . class ) ; private String indexdir ; private IndexWriter writer ; private Analyzer analyzer ; private String filename ; public ReleateKeywordIndexImpl ( String indexdir , Analyzer analyzer , String filename ) { } @ Override public void indexBuild ( boolean op ) { ReleateKeywordIndexImpl . log . info ( "build<seq2seq4repair_space>index..." ) ; try { ReleateKeywordIndexImpl . log . debug ( ( "write<seq2seq4repair_space>index<seq2seq4repair_space>on<seq2seq4repair_space>" + ( indexdir ) ) ) ; System . out . println ( ( "write<seq2seq4repair_space>index<seq2seq4repair_space>on<seq2seq4repair_space>" + ( indexdir ) ) ) ; Directory dir = FSDirectory . open ( new File ( indexdir ) ) ; IndexWriterConfig iwc = new IndexWriterConfig ( Version . LUCENE_35 , analyzer ) ; <START_BUG> iwc . setOpenMode ( CREATE_OR_APPEND ) ; <END_BUG> iwc . setRAMBufferSizeMB ( 512.0 ) ; writer = new IndexWriter ( dir , iwc ) ; RandomAccessFile rf = new RandomAccessFile ( filename , "r" ) ; String str = null ; int i = 0 ; while ( ( str = rf . readLine ( ) ) != null ) { str = new String ( str . trim ( ) . getBytes ( "iso8859-1" ) , "GBK" ) ; ReleatedKeyword rk = new ReleatedKeyword ( str ) ; writer . addDocument ( DocumentParser . parse ( rk ) ) ; ReleateKeywordIndexImpl . log . info ( ( "add:" + str ) ) ; i ++ ; } ReleateKeywordIndexImpl . log . info ( ( ( "add<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>records" ) ) ; if ( op ) { ReleateKeywordIndexImpl . log . info ( "optimize<seq2seq4repair_space>index..." ) ; writer . forceMerge ( 1 ) ; } writer . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } }

Fix:
iwc . setOpenMode ( CREATE ) ;
Buggy code:
public class SecurityExtension implements Extension { public static final ServiceName JBOSS_SECURITY = JBOSS . append ( "security" ) ; public static final String SUBSYSTEM_NAME = "security" ; private static final String RESOURCE_NAME = ( SecurityExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; private static final SecuritySubsystemParser PARSER = SecuritySubsystemParser . getInstance ( ) ; static ResourceDescriptionResolver getResourceDescriptionResolver ( final String keyPrefix ) { } @ Override public void initialize ( ExtensionContext context ) { final boolean registerRuntimeOnly = context . isRuntimeOnlyRegistrationValid ( ) ; <START_BUG> final SubsystemRegistration subsystem = context . registerSubsystem ( SecurityExtension . SUBSYSTEM_NAME , 1 , 0 ) ; <END_BUG> final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( INSTANCE ) ; registration . registerOperationHandler ( DESCRIBE , GenericSubsystemDescribeHandler . INSTANCE , GenericSubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; final ManagementResourceRegistration securityDomain = registration . registerSubModel ( new SecurityDomainResourceDefinition ( registerRuntimeOnly ) ) ; final ManagementResourceRegistration jaspi = securityDomain . registerSubModel ( JASPIAuthenticationResourceDefinition . INSTANCE ) ; jaspi . registerSubModel ( LoginModuleStackResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( ClassicAuthenticationResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( AuthorizationResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( MappingResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( ACLResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( AuditResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( IdentityTrustResourceDefinition . INSTANCE ) ; securityDomain . registerSubModel ( JSSEResourceDefinition . INSTANCE ) ; registration . registerSubModel ( VaultResourceDefinition . INSTANCE ) ; subsystem . registerXMLElementWriter ( SecurityExtension . PARSER ) ; } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } }

Fix:
final SubsystemRegistration subsystem = context . registerSubsystem ( SecurityExtension . SUBSYSTEM_NAME , 1 , 1 ) ;
Buggy code:
public class VisibilityDecoderTest { @ Test public void testVisibilityStatuteMiles ( ) throws DecoderException { } @ Test public void testVisibilityMeter ( ) throws DecoderException { } @ Test public void testVisibilityCavok ( ) throws DecoderException { } @ Test public void testVisibilityFractionStatuteMiles ( ) throws DecoderException { } @ Test public void testVisibilityMetersWithNDV ( ) throws DecoderException { } @ Test public void testVisibilityMetersWithDirection ( ) throws DecoderException { MetarDecoderResult mdResult = MetarDecoder . decodeMetar ( METAR_EXAMPLE_6 ) ; assertEquals ( UNIT_OF_MEASURE_METER , mdResult . getMetar ( ) . getVisibility ( ) . get ( 0 ) . getVisibilityUnitOfMeasure ( ) ) ; <START_BUG> assertEquals ( BigDecimal . TEN , mdResult . getMetar ( ) . getVisibility ( ) . get ( 0 ) . getVisibility ( ) ) ; <END_BUG> assertTrue ( mdResult . getMetar ( ) . getVisibility ( ) . get ( 0 ) . isGreaterThan ( ) ) ; assertEquals ( UNIT_OF_MEASURE_METER , mdResult . getMetar ( ) . getVisibility ( ) . get ( 1 ) . getVisibilityUnitOfMeasure ( ) ) ; assertEquals ( new BigDecimal ( "4000" ) , mdResult . getMetar ( ) . getVisibility ( ) . get ( 1 ) . getVisibility ( ) ) ; assertEquals ( "N" , mdResult . getMetar ( ) . getVisibility ( ) . get ( 1 ) . getDirection ( ) ) ; } @ Test public void testVisibilityMetersTwoValues ( ) throws DecoderException { } @ Test public void testVisibilityMetersShortMessage ( ) throws DecoderException { } }

Fix:
assertEquals ( new BigDecimal ( "10000" ) , mdResult . getMetar ( ) . getVisibility ( ) . get ( 0 ) . getVisibility ( ) ) ;
Buggy code:
public class Menu extends Widget { public int handle ; int x ; int y ; int hwndCB ; int id0 ; int id1 ; boolean hasLocation ; MenuItem cascade ; Decorations parent ; ImageList imageList ; static final int ID_PPC = 100 ; static final int ID_SPMM = 102 ; static final int ID_SPBM = 103 ; static final int ID_SPMB = 104 ; static final int ID_SPBB = 105 ; static final int ID_SPSOFTKEY0 = 106 ; static final int ID_SPSOFTKEY1 = 107 ; public Menu ( Control parent ) { } public Menu ( Decorations parent , int style ) { } public Menu ( Menu parentMenu ) { } public Menu ( MenuItem parentItem ) { } Menu ( Decorations parent , int style , int handle ) { } void _setVisible ( boolean visible ) { } public void addHelpListener ( HelpListener listener ) { } public void addMenuListener ( MenuListener listener ) { } static Control checkNull ( Control control ) { } static Menu checkNull ( Menu menu ) { } static MenuItem checkNull ( MenuItem item ) { } static int checkStyle ( int style ) { } void createHandle ( ) { } void createItem ( MenuItem item , int index ) { } void createWidget ( ) { } int defaultBackground ( ) { } int defaultForeground ( ) { } void destroyAccelerators ( ) { } void destroyItem ( MenuItem item ) { } void destroyWidget ( ) { } void fixMenus ( Decorations newParent ) { } Rectangle getBounds ( ) { } public MenuItem getDefaultItem ( ) { } public boolean getEnabled ( ) { } public MenuItem getItem ( int index ) { } public int getItemCount ( ) { } public MenuItem [ ] getItems ( ) { } int GetMenuItemCount ( int handle ) { } String getNameText ( ) { } public Decorations getParent ( ) { } public MenuItem getParentItem ( ) { } public Menu getParentMenu ( ) { } public Shell getShell ( ) { } public boolean getVisible ( ) { } int imageIndex ( Image image ) { } public int indexOf ( MenuItem item ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void redraw ( ) { } void releaseHandle ( ) { } void releaseChildren ( boolean destroy ) { MenuItem [ ] items = getItems ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { MenuItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { if ( ( OS . IsPPC ) && ( ( hwndCB ) != 0 ) ) { item . dispose ( ) ; } else { <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 ) { } void update ( ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public abstract class LanguageIdentifierUpdateProcessor extends UpdateRequestProcessor implements LangIdParams { protected static final Logger log = LoggerFactory . getLogger ( LanguageIdentifierUpdateProcessor . class ) ; protected boolean enabled ; protected String [ ] inputFields = new String [ ] { } ; protected String [ ] mapFields = new String [ ] { } ; protected Pattern mapPattern ; protected String mapReplaceStr ; protected String langField ; protected String langsField ; protected String docIdField ; protected String fallbackValue ; protected String [ ] fallbackFields = new String [ ] { } ; protected boolean enableMapping ; protected boolean mapKeepOrig ; protected boolean overwrite ; protected boolean mapOverwrite ; protected boolean mapIndividual ; protected boolean enforceSchema ; protected double threshold ; protected HashSet < String > langWhitelist ; protected HashSet < String > mapIndividualFieldsSet ; protected HashSet < String > allMapFieldsSet ; protected HashMap < String , String > lcMap ; protected HashMap < String , String > mapLcMap ; protected IndexSchema schema ; protected final Pattern tikaSimilarityPattern = Pattern . compile ( ".*\\((.*?)\\)" ) ; protected final Pattern langPattern = Pattern . compile ( "\\{lang\\}" ) ; public LanguageIdentifierUpdateProcessor ( SolrQueryRequest req , SolrQueryResponse rsp , UpdateRequestProcessor next ) { } private void initParams ( SolrParams params ) { } @ Override public void processAdd ( AddUpdateCommand cmd ) throws IOException { } protected SolrInputDocument process ( SolrInputDocument doc ) { } private String getFallbackLang ( SolrInputDocument doc , String [ ] fallbackFields , String fallbackValue ) { } protected String concatFields ( SolrInputDocument doc , String [ ] fields ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> for ( String fieldName : inputFields ) { LanguageIdentifierUpdateProcessor . log . debug ( ( "Appending<seq2seq4repair_space>field<seq2seq4repair_space>" + fieldName ) ) ; if ( doc . containsKey ( fieldName ) ) { Object content = doc . getFieldValue ( fieldName ) ; if ( content instanceof String ) { sb . append ( ( ( String ) ( doc . getFieldValue ( fieldName ) ) ) ) ; sb . append ( "<seq2seq4repair_space>" ) ; } else { LanguageIdentifierUpdateProcessor . log . warn ( ( ( "Field<seq2seq4repair_space>" + fieldName ) + "<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>String<seq2seq4repair_space>value,<seq2seq4repair_space>not<seq2seq4repair_space>including<seq2seq4repair_space>in<seq2seq4repair_space>detection" ) ) ; } } } return sb . toString ( ) ; } protected abstract List < DetectedLanguage > detectLanguage ( String content ) { } protected String resolveLanguage ( String language , String fallbackLang ) { } protected String resolveLanguage ( List < DetectedLanguage > languages , String fallbackLang ) { } protected String normalizeLangCode ( String langCode ) { } protected String getMappedField ( String currentField , String language ) { } public boolean isEnabled ( ) { } public void setEnabled ( boolean enabled ) { } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class ZMTPIncomingMessageDecoder2 implements ZMTPMessageDecoder2 { private final boolean enveloped ; private final long limit ; private boolean delimited ; private boolean truncated ; private long messageSize ; private int frameLength ; private List < ZMTPFrame > head ; private List < ZMTPFrame > tail ; private List < ZMTPFrame > part ; public ZMTPIncomingMessageDecoder2 ( final boolean enveloped , final long limit ) { } private void reset ( ) { } @ Override public void frame ( final int length , final boolean more ) { } @ Override public void content ( final ByteBuf data ) { if ( ( data . readableBytes ( ) ) < ( frameLength ) ) { return ; } if ( ( frameLength ) > 0 ) { final ByteBuf frame = data . readSlice ( frameLength ) ; frame . retain ( ) ; <START_BUG> part . add ( new ZMTPFrame ( data ) ) ; <END_BUG> } else if ( ( part ) == ( tail ) ) { part . add ( ZMTPFrame . EMPTY_FRAME ) ; } else { delimited = true ; part = tail ; } } @ Override public ZMTPIncomingMessage finish ( ) { } }

Fix:
part . add ( new ZMTPFrame ( frame ) ) ;
Buggy code:
public class Facility extends AbstractContainerTask implements Configurable { private static final Resources REZ = ResourceManager . getPackageResources ( Facility . class ) ; private String m_namespace ; private AspectHandler m_aspectHandler ; public void configure ( final Configuration configuration ) throws ConfigurationException { final String [ ] attributes = configuration . getAttributeNames ( ) ; for ( int i = 0 ; i < ( attributes . length ) ; i ++ ) { final String name = attributes [ i ] ; final String value = configuration . getAttribute ( name ) ; configureAttribute ( this , name , value ) ; } final Configuration [ ] children = configuration . getChildren ( ) ; if ( 1 == ( children . length ) ) { final String typeName = children [ 0 ] . getName ( ) ; try { <START_BUG> m_aspectHandler = ( ( AspectHandler ) ( newInstance ( AspectHandler . class , typeName ) ) ) ; <END_BUG> } catch ( final Exception e ) { final String message = Facility . REZ . getString ( "facility.no-create.error" , typeName ) ; throw new ConfigurationException ( message , e ) ; } configureElement ( m_aspectHandler , children [ 0 ] ) ; } else { final String message = Facility . REZ . getString ( "facility.multi-element.error" ) ; throw new ConfigurationException ( message ) ; } } public void setNamespace ( final String namespace ) { } public void execute ( ) throws TaskException { } }

Fix:
m_aspectHandler = ( ( AspectHandler ) ( newInstance ( ROLE , typeName ) ) ) ;
Buggy code:
public class CodeSnippetCodeStream extends CodeStream { public CodeSnippetCodeStream ( ClassFile classFile ) { } protected void checkcast ( int baseId ) { } public void generateEmulatedAccessForMethod ( Scope scope , MethodBinding methodBinding ) { } public void generateEmulatedReadAccessForField ( FieldBinding fieldBinding ) { CodeSnippetCodeStream localCodeStream = ( ( CodeSnippetCodeStream ) ( this ) ) ; localCodeStream . generateEmulationForField ( fieldBinding ) ; this . swap ( ) ; localCodeStream . invokeJavaLangReflectFieldGetter ( fieldBinding . type . id ) ; <START_BUG> if ( fieldBinding . type . isArrayType ( ) ) { <END_BUG> this . checkcast ( fieldBinding . type ) ; } } public void generateEmulatedWriteAccessForField ( FieldBinding fieldBinding ) { } public void generateEmulationForConstructor ( Scope scope , MethodBinding methodBinding ) { } public void generateEmulationForField ( FieldBinding fieldBinding ) { } public void generateEmulationForMethod ( Scope scope , MethodBinding methodBinding ) { } public void getBaseTypeValue ( int baseTypeID ) { } protected void invokeAccessibleObjectSetAccessible ( ) { } protected void invokeArrayNewInstance ( ) { } protected void invokeClassGetDeclaredConstructor ( ) { } protected void invokeClassGetDeclaredField ( ) { } protected void invokeClassGetDeclaredMethod ( ) { } protected void invokeJavaLangReflectConstructorNewInstance ( ) { } protected void invokeJavaLangReflectFieldGetter ( int typeID ) { } protected void invokeJavaLangReflectFieldSetter ( int typeID ) { } protected void invokeJavaLangReflectMethodInvoke ( ) { } protected void invokeObjectGetClass ( ) { } }

Fix:
if ( ! ( fieldBinding . type . isBaseType ( ) ) ) {
Buggy code:
public class TableColumn extends Item { Table parent ; boolean resizable ; boolean moveable ; String toolTipText ; int id ; public TableColumn ( Table parent , int style ) { } public TableColumn ( Table parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } void destroyWidget ( ) { } public int getAlignment ( ) { } String getNameText ( ) { } public Table getParent ( ) { } public boolean getMoveable ( ) { } public boolean getResizable ( ) { } public String getToolTipText ( ) { } public int getWidth ( ) { } public void pack ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { checkWidget ( ) ; if ( ( alignment & ( ( ( SWT . LEFT ) | ( SWT . RIGHT ) ) | ( SWT . CENTER ) ) ) == 0 ) return ; int index = parent . indexOf ( this ) ; if ( ( index == ( - 1 ) ) || ( index == 0 ) ) return ; style &= ~ ( ( ( SWT . LEFT ) | ( SWT . RIGHT ) ) | ( SWT . CENTER ) ) ; style |= alignment & ( ( ( SWT . LEFT ) | ( SWT . RIGHT ) ) | ( SWT . CENTER ) ) ; int hwnd = parent . handle ; LVCOLUMN lvColumn = new LVCOLUMN ( ) ; <START_BUG> lvColumn . mask = ( OS . LVCF_FMT ) | ( OS . LVCF_IMAGE ) ; <END_BUG> OS . SendMessage ( hwnd , LVM_GETCOLUMN , index , lvColumn ) ; lvColumn . fmt &= ~ ( OS . LVCFMT_JUSTIFYMASK ) ; int fmt = 0 ; if ( ( ( style ) & ( SWT . LEFT ) ) == ( SWT . LEFT ) ) fmt = OS . LVCFMT_LEFT ; if ( ( ( style ) & ( SWT . CENTER ) ) == ( SWT . CENTER ) ) fmt = OS . LVCFMT_CENTER ; if ( ( ( style ) & ( SWT . RIGHT ) ) == ( SWT . RIGHT ) ) fmt = OS . LVCFMT_RIGHT ; lvColumn . fmt |= fmt ; OS . SendMessage ( hwnd , LVM_SETCOLUMN , index , lvColumn ) ; if ( index != 0 ) { parent . forceResize ( ) ; RECT rect = new RECT ( ) ; RECT headerRect = new RECT ( ) ; OS . GetClientRect ( hwnd , rect ) ; int hwndHeader = OS . SendMessage ( hwnd , LVM_GETHEADER , 0 , 0 ) ; OS . SendMessage ( hwndHeader , HDM_GETITEMRECT , index , headerRect ) ; OS . MapWindowPoints ( hwndHeader , hwnd , headerRect , 2 ) ; rect . left = headerRect . left ; rect . right = headerRect . right ; OS . InvalidateRect ( hwnd , rect , true ) ; } } public void setImage ( Image image ) { } void setImage ( Image image , boolean sort , boolean right ) { } public void setMoveable ( boolean moveable ) { } public void setResizable ( boolean resizable ) { } void setSortDirection ( int direction ) { } public void setText ( String string ) { } public void setToolTipText ( String string ) { } public void setWidth ( int width ) { } void updateToolTip ( int index ) { } }

Fix:
lvColumn . mask = OS . LVCF_FMT ;
Buggy code:
class DocCommentParser extends AbstractCommentParser { public static final String STR_TAG_DEPRECATED = "@deprecated" ; public static final String STR_TAG_PARAM = "@param" ; public static final String STR_TAG_RETURN = "@return" ; public static final String STR_TAG_THROWS = "@throws" ; public static final String STR_TAG_EXCEPTION = "@exception" ; public static final String STR_TAG_SEE = "@see" ; public static final String STR_TAG_LINK = "@link" ; public static final String STR_TAG_LINKPLAIN = "@linkplain" ; public static final String STR_TAG_INHERITDOC = "@inheritDoc" ; private Javadoc docComment ; private AST ast ; DocCommentParser ( AST ast , Scanner scanner ) { } public Javadoc parse ( int [ ] positions ) { } public Javadoc parse ( int start , int length ) { } private void setComment ( int start , int length ) { } public String toString ( ) { } protected Object createArgumentReference ( char [ ] name , int dim , Object typeRef , long dimPos , long argNamePos ) throws InvalidInputException { } protected Object createFieldReference ( Object receiver ) throws InvalidInputException { } protected Object createMethodReference ( Object receiver , List arguments ) throws InvalidInputException { try { MethodRef methodRef = this . ast . newMethodRef ( ) ; SimpleName methodName = this . ast . newSimpleName ( new String ( this . identifierStack [ 0 ] ) ) ; methodRef . setName ( methodName ) ; int start = ( ( int ) ( ( this . identifierPositionStack [ 0 ] ) > > > 32 ) ) ; int length = ( ( ( int ) ( this . identifierPositionStack [ 0 ] ) ) - start ) + 1 ; methodName . setSourceRange ( start , length ) ; int end = ( ( methodName . getStartPosition ( ) ) + ( methodName . getLength ( ) ) ) - 1 ; if ( receiver == null ) { methodRef . setSourceRange ( start , length ) ; } else { Name typeRef = ( ( Name ) ( receiver ) ) ; methodRef . setQualifier ( typeRef ) ; <START_BUG> methodRef . setSourceRange ( typeRef . getStartPosition ( ) , ( ( end - ( typeRef . getStartPosition ( ) ) ) + 1 ) ) ; <END_BUG> } if ( arguments != null ) { Iterator parameters = arguments . listIterator ( ) ; while ( parameters . hasNext ( ) ) { MethodRefParameter param = ( ( MethodRefParameter ) ( parameters . next ( ) ) ) ; methodRef . parameters ( ) . add ( param ) ; end = ( ( param . getStartPosition ( ) ) + ( param . getLength ( ) ) ) - 1 ; } } methodRef . setSourceRange ( start , ( ( end - start ) + 1 ) ) ; return methodRef ; } catch ( ClassCastException ex ) { throw new InvalidInputException ( ) ; } } protected Object createTypeReference ( int primitiveToken ) { } protected boolean parseReturn ( ) { } protected boolean parseTag ( ) { } protected boolean pushParamName ( ) { } protected boolean pushSeeRef ( Object statement , boolean plain ) { } protected void pushText ( int start , int end ) { } protected boolean pushThrowName ( Object typeRef , boolean real ) { } protected void updateDocComment ( ) { } }

Fix:
start = typeRef . getStartPosition ( ) ;
Buggy code:
@ Controller public class CommonUserController { @ Autowired private CommonUserService userService ; @ RequestMapping ( value = "//admin//CommonUsers" , method = RequestMethod . GET ) @ ResponseBody public Page < CommonUserJson > findAllDesc ( Model uiModel , @ RequestParam ( value = "page" , defaultValue = "1" ) int page , @ RequestParam ( value = "size" , defaultValue = "15" ) int size ) { } @ RequestMapping ( value = "//admin//CommonUsers//{id}" , method = RequestMethod . GET ) @ ResponseBody public CommonUserDetailJson findOne ( Model uiModel , @ PathVariable ( "id" ) Long id ) { } @ RequestMapping ( value = "//admin//CommonUsers//{id}//score" , method = RequestMethod . POST ) @ ResponseBody public String updateScore ( HttpServletRequest request , @ PathVariable ( "id" ) Long id ) { int score = Integer . parseInt ( request . getParameter ( "score" ) ) ; userService . updateScore ( id , score ) ; <START_BUG> return "success" ; <END_BUG> } }

Fix:
return "\"success\"" ;
Buggy code:
public class Admittance implements Comparable < Admittance > { private final Year year ; private final Admittance . Period readingPeriod ; public Admittance ( Year year , Admittance . Period readingPeriod ) { } public Admittance ( Admittance admittance ) { } public Year getYear ( ) { } public Admittance . Period getReadingPeriod ( ) { } @ Override public int compareTo ( Admittance other ) { } @ Override public boolean equals ( Object o ) { if ( ( this ) == o ) <START_BUG> return false ; <END_BUG> if ( ( o == null ) || ( ( this . getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; Admittance bd = ( ( Admittance ) ( o ) ) ; if ( ! ( this . year . equals ( bd . getYear ( ) ) ) ) return false ; if ( ! ( ( this . readingPeriod ) == ( bd . getReadingPeriod ( ) ) ) ) return false ; return true ; } public enum Period { ONE , TWO , THREE , FOUR ; } }

Fix:
return true ;
Buggy code:
public class FreeSubscription extends RegularUser { public FreeSubscription ( HttpServletRequest request ) { } public FreeSubscription ( ResultSet rs ) throws SQLException , ParseException { } public FreeSubscription ( String username , String password , String firstName , String lastName , String emailAddress , Date lastLogin ) { } public FreeSubscription ( JSONObject json ) { } public String asXml ( ) { } public String asSql ( ) { } public String asSqlUpdate ( ) { } public JSONObject asJSON ( ) { JSONObject obj = new JSONObject ( ) ; obj . put ( "username" , username ) ; obj . put ( "password" , password ) ; obj . put ( "firstName" , firstName ) ; obj . put ( "lastName" , lastName ) ; obj . put ( "emailAddress" , emailAddress ) ; <START_BUG> obj . put ( "lastLogin" , lastLogin ) ; <END_BUG> obj . put ( "type" , "freeSubscription" ) ; return obj ; } }

Fix:
obj . put ( "lastLogin" , lastLogin . toString ( ) ) ;