nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Rpm extends Task { private String command = "-bb" ; private boolean cleanBuildDir = false ; private boolean removeSpec = false ; private boolean removeSource = false ; private File error ; private File output ; private String specFile ; private File topDir ; public void setCleanBuildDir ( boolean cbd ) { } public void setCommand ( String c ) { } public void setError ( File error ) { } public void setOutput ( File output ) { } public void setRemoveSource ( boolean rs ) { } public void setRemoveSpec ( boolean rs ) { } public void setSpecFile ( String sf ) throws TaskException { } public void setTopDir ( File td ) { } public void execute ( ) throws TaskException { Commandline toExecute = new Commandline ( ) ; toExecute . setExecutable ( "rpm" ) ; if ( ( topDir ) != null ) { toExecute . createArgument ( ) . setValue ( "--define" ) ; toExecute . createArgument ( ) . setValue ( ( "_topdir" + ( topDir ) ) ) ; } toExecute . createArgument ( ) . setLine ( command ) ; if ( cleanBuildDir ) { toExecute . createArgument ( ) . setValue ( "--clean" ) ; } if ( removeSpec ) { toExecute . createArgument ( ) . setValue ( "--rmspec" ) ; } if ( removeSource ) { toExecute . createArgument ( ) . setValue ( "--rmsource" ) ; } toExecute . createArgument ( ) . setValue ( ( "SPECS//" + ( specFile ) ) ) ; ExecuteStreamHandler streamhandler = null ; OutputStream outputstream = null ; OutputStream errorstream = null ; if ( ( ( error ) == null ) && ( ( output ) == null ) ) { streamhandler = new org . apache . tools . ant . taskdefs . exec . LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ; } else { if ( ( output ) != null ) { try { outputstream = new PrintStream ( new BufferedOutputStream ( new FileOutputStream ( output ) ) ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } } else { outputstream = new org . apache . tools . ant . taskdefs . exec . LogOutputStream ( this , Project . MSG_INFO ) ; } if ( ( error ) != null ) { try { errorstream = new PrintStream ( new BufferedOutputStream ( new FileOutputStream ( error ) ) ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } } else { errorstream = new org . apache . tools . ant . taskdefs . exec . LogOutputStream ( this , Project . MSG_WARN ) ; } streamhandler = new PumpStreamHandler ( outputstream , errorstream ) ; } <START_BUG> Execute exe = new Execute ( streamhandler , null ) ; <END_BUG> if ( ( topDir ) == null ) topDir = getBaseDirectory ( ) ; exe . setWorkingDirectory ( topDir ) ; exe . setCommandline ( toExecute . getCommandline ( ) ) ; try { exe . execute ( ) ; getLogger ( ) . info ( ( ( "Building<seq2seq4repair_space>the<seq2seq4repair_space>RPM<seq2seq4repair_space>based<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>" + ( specFile ) ) + "<seq2seq4repair_space>file" ) ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } finally { if ( ( output ) != null ) { try { outputstream . close ( ) ; } catch ( IOException e ) { } } if ( ( error ) != null ) { try { errorstream . close ( ) ; } catch ( IOException e ) { } } } } }

Fix:
Execute exe = new Execute ( streamhandler ) ;
Buggy code:
public class JavaWorkspaceScope extends JavaSearchScope { protected boolean needsInitialize ; public JavaWorkspaceScope ( ) { } public boolean encloses ( IJavaElement element ) { } public boolean encloses ( String resourcePathString ) { } public IPath [ ] enclosingProjectsAndJars ( ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public void initialize ( ) { super . initialize ( ) ; try { IJavaProject [ ] projects = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) . getJavaProjects ( ) ; for ( int i = 0 , length = projects . length ; i < length ; i ++ ) { int includeMask = ( ( IJavaSearchScope . SOURCES ) | ( IJavaSearchScope . APPLICATION_LIBRARIES ) ) | ( IJavaSearchScope . SYSTEM_LIBRARIES ) ; <START_BUG> this . add ( ( ( JavaProject ) ( projects [ i ] ) ) , includeMask , new HashSet ( 2 ) ) ; <END_BUG> } } catch ( JavaModelException ignored ) { } this . needsInitialize = false ; } public void processDelta ( IJavaElementDelta delta ) { } public String toString ( ) { } }

Fix:
add ( ( ( JavaProject ) ( projects [ i ] ) ) , null , includeMask , new HashSet ( ( length * 2 ) , 1 ) , null ) ;
Buggy code:
public class ProgressView extends ViewPart implements IViewPart { ProgressTreeViewer viewer ; Action cancelAction ; Action deleteAction ; Action showErrorAction ; Action clearErrorsAction ; public void createPartControl ( Composite parent ) { } public void setFocus ( ) { } protected void initContentProvider ( ) { } protected void initLabelProvider ( ) { } private void initContextMenu ( ) { } private void initPulldownMenu ( ) { IMenuManager menuMgr = ( ( org . eclipse . ui . internal . ViewSite ) ( getSite ( ) ) ) . getActionBars ( ) . getMenuManager ( ) ; menuMgr . add ( new Action ( ProgressMessages . getString ( "ProgressView.VerboseAction" ) , IAction . AS_CHECK_BOX ) { public void run ( ) { <START_BUG> JobProgressManager provider = JobProgressManager . getInstance ( ) ; <END_BUG> provider . debug = ! ( provider . debug ) ; setChecked ( provider . debug ) ; provider . refreshAll ( ) ; } } ) ; } private IStructuredSelection getSelection ( ) { } JobInfo getSelectedInfo ( ) { } private ViewerSorter getViewerSorter ( ) { } private void createCancelAction ( ) { } private void createDeleteAction ( ) { } private void createClearErrorsAction ( ) { } private void createShowErrorAction ( ) { } }

Fix:
ProgressContentProvider provider = ( ( ProgressContentProvider ) ( viewer . getContentProvider ( ) ) ) ;
Buggy code:
public class AccountDb { public static final Integer DEFAULT_HOTP_COUNTER = 0 ; private static final String ID_COLUMN = "_id" ; private static final String EMAIL_COLUMN = "email" ; private static final String SECRET_COLUMN = "secret" ; private static final String COUNTER_COLUMN = "counter" ; private static final String TYPE_COLUMN = "type" ; static final String PROVIDER_COLUMN = "provider" ; static final String TABLE_NAME = "accounts" ; static final String PATH = "databases" ; private static final String TABLE_INFO_COLUMN_NAME_COLUMN = "name" ; private static final int PROVIDER_UNKNOWN = 0 ; private static final int PROVIDER_GOOGLE = 1 ; SQLiteDatabase mDatabase ; private static final String LOCAL_TAG = "GoogleAuthenticator.AccountDb" ; public enum OtpType { TOTP ( 0 ) , HOTP ( 1 ) ; public final Integer value ; OtpType ( Integer value ) { } public static AccountDb . OtpType getEnum ( Integer i ) { } } public AccountDb ( Context context ) { } private SQLiteDatabase openDatabase ( Context context ) { } private String getAccountDbOpenFailedErrorString ( Context context ) { } public void close ( ) { } public static Collection < String > listTableColumnNamesLowerCase ( SQLiteDatabase database , String tableName ) { } private Collection < String > listTableColumnNamesLowerCase ( ) { } public boolean deleteAllData ( ) { } public String getSecret ( Integer id ) { } public String getEmail ( Integer id ) { } public static Signer getSigningOracle ( String secret ) { } private static byte [ ] decodeKey ( String secret ) throws DecodingException { } public Integer getCounter ( Integer email ) { } public void incrementCounter ( Integer id ) { ContentValues values = new ContentValues ( ) ; <START_BUG> values . put ( AccountDb . EMAIL_COLUMN , id ) ; <END_BUG> Integer counter = getCounter ( id ) ; values . put ( AccountDb . COUNTER_COLUMN , ( counter + 1 ) ) ; mDatabase . update ( AccountDb . TABLE_NAME , values , AccountDb . whereClause ( id ) , null ) ; } public AccountDb . OtpType getType ( Integer id ) { } public void setType ( Integer id , AccountDb . OtpType type ) { } public boolean isGoogleAccount ( Integer id ) { } private static String whereClause ( Integer id ) { } public void delete ( Integer id ) { } public void update ( Integer id , String email , String secret , AccountDb . OtpType type , Integer counter ) { } public void update ( Integer id , String email , String secret , AccountDb . OtpType type , Integer counter , Boolean googleAccount ) { } private Cursor getIds ( ) { } private Cursor getAccount ( Integer id ) { } private static boolean cursorIsEmpty ( Cursor c ) { } private static void tryCloseCursor ( Cursor c ) { } public int getIds ( Collection < Integer > result ) { } private static class AccountDbOpenException extends RuntimeException { private static final long serialVersionUID = - 4561104600253698948L ; public AccountDbOpenException ( String message , Exception e ) { } } }

Fix:
values . put ( AccountDb . ID_COLUMN , id ) ;
Buggy code:
public abstract class AbstractPageAuthorizationStrategy implements IAuthorizationStrategy { public final boolean authorizeAction ( Component component , Action action ) { } public final boolean authorizeInstantiation ( Class componentClass ) { <START_BUG> if ( componentClass . isAssignableFrom ( Page . class ) ) { <END_BUG> if ( ! ( isAuthorized ( componentClass ) ) ) { throw new RestartResponseAtSignInPageException ( ) ; } } return true ; } protected boolean isAuthorized ( Class componentClass ) { } }

Fix:
if ( Page . class . isAssignableFrom ( componentClass ) ) {
Buggy code:
@ XmlRootElement @ XmlType ( propOrder = { "location" , "color" , "glueN" , "glueE" , "glueS" , "glueW" , "label" } ) public class Tile { public static Point NORTH = new Point ( 0 , 1 ) ; public static Point EAST = new Point ( 1 , 0 ) ; public static Point SOUTH = new Point ( 0 , ( - 1 ) ) ; public static Point WEST = new Point ( ( - 1 ) , 0 ) ; private Point tileLocation ; private String glueN ; private String glueE ; private String glueS ; private String glueW ; private String label = new String ( ) ; private PolyTile polyTile ; public Tile ( ) { } public Tile ( int x , int y , PolyTile parent ) { } public Tile ( int x , int y , String [ ] gl , PolyTile parent ) { } public String getLabel ( ) { <START_BUG> if ( label . isEmpty ( ) ) <END_BUG> return polyTile . getPolyName ( ) ; else return label ; } public void setLabel ( String Label ) { } @ XmlTransient public PolyTile getParent ( ) { } public void setParent ( PolyTile p ) { } @ XmlElement ( name = "Color" ) public String getColor ( ) { } public boolean samePolyTile ( PolyTile p ) { } public void changeTileGlue ( String [ ] gl ) { } public void setTileLocation ( int x , int y ) { } @ XmlElement ( name = "Location" ) @ XmlJavaTypeAdapter ( PointXmlAdapter . class ) public Point getLocation ( ) { } public void setLocation ( Point p ) { } public String [ ] getGlueLabels ( ) { } @ XmlElement ( name = "NorthGlue" ) public String getGlueN ( ) { } public void setGlueN ( String g ) { } @ XmlElement ( name = "EastGlue" ) public String getGlueE ( ) { } public void setGlueE ( String g ) { } @ XmlElement ( name = "SouthGlue" ) public String getGlueS ( ) { } public void setGlueS ( String g ) { } @ XmlElement ( name = "WestGlue" ) public String getGlueW ( ) { } public void setGlueW ( String g ) { } public boolean equals ( Tile toCompare ) { } public void afterUnmarshal ( Unmarshaller u , Object parent ) { } No newline ; at end ; of file ; }

Fix:
if ( ( label . isEmpty ( ) ) && ( ( polyTile ) != null ) )
Buggy code:
@ FixMethodOrder ( MethodSorters . NAME_ASCENDING ) public class ContactManagerFlushTests { @ Before public void deleteFile ( ) { } @ Test public void firstFlushTest ( ) { } @ Test public void secondFlushTest ( ) { } @ Test public void thirdFlushTest ( ) { ContactManager testCM1 = new ContactManagerImpl ( ) ; testCM1 . addNewContact ( "Mr<seq2seq4repair_space>Man" , "He's<seq2seq4repair_space>the<seq2seq4repair_space>man" ) ; testCM1 . addNewContact ( "Miss<seq2seq4repair_space>SomeOne" , "She's<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>man" ) ; testCM1 . addNewContact ( "Mr<seq2seq4repair_space>Testy" , "Testing" ) ; testCM1 . addNewPastMeeting ( testCM1 . getContacts ( 1 , 2 , 3 ) , new GregorianCalendar ( 2015 , 2 , 15 ) , "some<seq2seq4repair_space>notes" ) ; testCM1 . addFutureMeeting ( testCM1 . getContacts ( 1 , 2 , 3 ) , new GregorianCalendar ( 2015 , 8 , 15 ) ) ; testCM1 . flush ( ) ; ContactManager testCM2 = new ContactManagerImpl ( ) ; testCM2 . addNewContact ( "Mr<seq2seq4repair_space>Man" , "He's<seq2seq4repair_space>the<seq2seq4repair_space>man" ) ; testCM2 . flush ( ) ; ContactManager testCM3 = new ContactManagerImpl ( ) ; <START_BUG> PastMeeting testMeet = testCM3 . getPastMeeting ( 2 ) ; <END_BUG> String output = testMeet . getNotes ( ) ; String expected = "some<seq2seq4repair_space>notes" ; assertEquals ( expected , output ) ; } }

Fix:
PastMeeting testMeet = testCM3 . getPastMeeting ( 1 ) ;
Buggy code:
public class JavaTypeQuickfixes implements ILinkingIssueQuickfixProvider { @ Inject private IScopeProvider scopeProvider ; @ Inject private IImportsConfiguration importsConfiguration ; @ Inject private IQualifiedNameConverter qualifiedNameConverter ; @ Inject private ISimilarityMatcher similarityMatcher ; @ Inject private IJavaProjectProvider projectProvider ; @ Inject private CommonTypeComputationServices services ; @ Inject private JdtTypeRelevance jdtTypeRelevance ; @ Inject private Factory appendableFactory ; @ Inject private TypeNameGuesser typeNameGuesser ; @ Inject private DocumentRewriter . Factory rewriterFactory ; @ Inject private ReplaceConverter replaceConverter ; @ Override public void addQuickfixes ( Issue issue , IssueResolutionAcceptor issueResolutionAcceptor , IXtextDocument xtextDocument , XtextResource resource , EObject referenceOwner , EReference unresolvedReference ) throws Exception { } protected boolean isUseJavaSearch ( EReference unresolvedReference , Issue issue ) { } protected boolean isTypeReference ( EReference unresolvedReference ) { } protected boolean isConstructorReference ( EReference unresolvedReference ) { } protected void createResolution ( Issue issue , IssueResolutionAcceptor issueResolutionAcceptor , String issueString , IEObjectDescription solution ) { } protected IJavaSearchScope getJavaSearchScope ( EObject model ) { } protected IScope getImportedTypesScope ( EObject model , final String misspelled , final IScope actualScope , IJavaSearchScope scope ) { } protected void parseImportSection ( XImportSection importSection , IAcceptor < String > visiblePackages , IAcceptor < String > importedTypes ) { } protected boolean isSimilarTypeName ( String s0 , String s1 ) { } protected String getQualifiedTypeName ( char [ ] packageName , char [ ] [ ] enclosingTypeNames , char [ ] simpleTypeName ) { StringBuilder fqName = new StringBuilder ( ( ( ( packageName . length ) + ( simpleTypeName . length ) ) + 1 ) ) ; if ( ( packageName . length ) != 0 ) { fqName . append ( packageName ) ; fqName . append ( '.' ) ; } for ( char [ ] enclosingType : enclosingTypeNames ) { fqName . append ( enclosingType ) ; <START_BUG> fqName . append ( '.' ) ; <END_BUG> } fqName . append ( simpleTypeName ) ; String fqNameAsString = fqName . toString ( ) ; return fqNameAsString ; } @ SuppressWarnings ( "restriction" ) protected void createImportProposals ( final JvmDeclaredType contextType , final Issue issue , String typeName , IJavaSearchScope searchScope , final IssueResolutionAcceptor acceptor ) throws JavaModelException { } protected ContextualVisibilityHelper getVisibilityHelper ( final JvmDeclaredType contextType ) { } @ SuppressWarnings ( "restriction" ) protected boolean createConstructorProposals ( final JvmDeclaredType contextType , final Issue issue , String typeName , IJavaSearchScope searchScope , final IssueResolutionAcceptor acceptor ) throws JavaModelException { } }

Fix:
fqName . append ( '$' ) ;
Buggy code:
class OutboundSocketBindingWriteHandler extends WriteAttributeHandlers . WriteAttributeOperationHandler { private final ParameterValidator resolvedValueValidator ; private final boolean remoteDestination ; OutboundSocketBindingWriteHandler ( ParameterValidator valueValidator , ParameterValidator resolvedValueValidator , final boolean remoteDestination ) { } protected boolean requiresRestart ( ) { } @ Override protected void modelChanged ( final OperationContext context , final ModelNode operation , final String attributeName , final ModelNode newValue , final ModelNode currentValue ) throws OperationFailedException { final boolean restartRequired = requiresRestart ( ) ; boolean setReload = false ; <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> if ( restartRequired ) { context . reloadRequired ( ) ; setReload = true ; } else { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode resolvedValue = ( newValue . isDefined ( ) ) ? newValue . resolve ( ) : newValue ; if ( ( resolvedValueValidator ) != null ) { resolvedValueValidator . validateResolvedParameter ( VALUE , resolvedValue ) ; } final PathAddress address = PathAddress . pathAddress ( operation . get ( OP_ADDR ) ) ; final PathElement element = address . getLastElement ( ) ; final String bindingName = element . getValue ( ) ; final ModelNode bindingModel = context . readResource ( EMPTY_ADDRESS ) . getModel ( ) ; final ServiceController < ? > controller = context . getServiceRegistry ( true ) . getRequiredService ( OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME . append ( bindingName ) ) ; final OutboundSocketBinding binding = ( ( controller . getState ( ) ) == ( State . UP ) ) ? OutboundSocketBinding . class . cast ( controller . getValue ( ) ) : null ; final boolean bound = ( binding != null ) && ( binding . isConnected ( ) ) ; if ( binding == null ) { handleBindingReinstall ( context , bindingName , bindingModel ) ; } else { context . reloadRequired ( ) ; } if ( ( context . completeStep ( ) ) != ( ResultAction . KEEP ) ) { if ( binding == null ) { revertBindingReinstall ( context , bindingName , bindingModel , attributeName , currentValue ) ; } else { context . revertReloadRequired ( ) ; } } } } , RUNTIME ) ; } } if ( ( ( context . completeStep ( ) ) != ( ResultAction . KEEP ) ) && setReload ) { context . revertReloadRequired ( ) ; } } private void handleBindingReinstall ( OperationContext context , String bindingName , ModelNode bindingModel ) throws OperationFailedException { } private void revertBindingReinstall ( OperationContext context , String bindingName , ModelNode bindingModel , String attributeName , ModelNode previousValue ) { } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class Logs { private static PrintWriter logFile = null ; private static PrintWriter ddlFile = null ; private static String stmtEnd ; private static boolean verbose ; private static boolean atLeastOneDebug ; public static boolean initLogs ( String logFileName , String ddlFileName , boolean appendLogs , boolean doVerbose , String endOfStmt ) { } public static void report ( String msg ) { } public static void reportString ( String str ) { } public static void reportMessage ( String key ) { } public static void reportMessage ( String key , String value ) { } public static void reportMessage ( String key , String [ ] values ) { } public static void debug ( Exception e ) { } public static void debug ( String key , String value ) { } public static void debug ( String key , String [ ] values ) { } public static String unRollExceptions ( SQLException sqlE ) { } public static void writeToNewDDL ( String sql ) { } public static void writeStmtEndToNewDDL ( ) { } public static void writeNewlineToNewDDL ( ) { } public static boolean cleanup ( ) { try { if ( Logs . atLeastOneDebug ) <START_BUG> dblook . writeVerboseOutput ( "CSLOOK_AtLeastOneDebug" , null ) ; <END_BUG> Logs . logFile . close ( ) ; if ( ( Logs . ddlFile ) != null ) Logs . ddlFile . close ( ) ; } catch ( Exception e ) { System . out . println ( ( "Error<seq2seq4repair_space>releasing<seq2seq4repair_space>resources:<seq2seq4repair_space>" + e ) ) ; return false ; } return true ; } }

Fix:
dblook . writeVerboseOutput ( "DBLOOK_AtLeastOneDebug" , null ) ;
Buggy code:
public final class ByteId extends OpenJPAId { private final byte key ; public ByteId ( Class cls , Byte key ) { } public ByteId ( Class cls , String key ) { } public ByteId ( Class cls , byte key ) { } public ByteId ( Class cls , byte key , boolean subs ) { } public byte getId ( ) { } public Object getIdObject ( ) { <START_BUG> return new Byte ( key ) ; <END_BUG> } public String toString ( ) { } protected int idHash ( ) { } protected boolean idEquals ( OpenJPAId o ) { } }

Fix:
return Byte . valueOf ( key ) ;
Buggy code:
public abstract class AjaxFormSubmitBehavior extends AjaxEventBehavior { private static final long serialVersionUID = 1L ; private Form < ? > __form ; public AjaxFormSubmitBehavior ( String event ) { } public AjaxFormSubmitBehavior ( Form < ? > form , String event ) { } public final Form < ? > getForm ( ) { } @ Override protected CharSequence getEventHandler ( ) { final String formId = getForm ( ) . getMarkupId ( ) ; <START_BUG> final CharSequence url = getCallbackUrl ( ) ; <END_BUG> AppendingStringBuffer call = new AppendingStringBuffer ( "wicketSubmitFormById('" ) . append ( formId ) . append ( "',<seq2seq4repair_space>'" ) . append ( url ) . append ( "',<seq2seq4repair_space>" ) ; if ( ( getComponent ( ) ) instanceof IFormSubmittingComponent ) { call . append ( "'" ) . append ( ( ( IFormSubmittingComponent ) ( getComponent ( ) ) ) . getInputName ( ) ) . append ( "'<seq2seq4repair_space>" ) ; } else { call . append ( "null" ) ; } return ( generateCallbackScript ( call ) ) + ";" ; } @ Override protected void onEvent ( AjaxRequestTarget target ) { } protected abstract void onSubmit ( AjaxRequestTarget target ) { } protected abstract void onError ( AjaxRequestTarget target ) { } @ Override protected CharSequence getPreconditionScript ( ) { } }

Fix:
final CharSequence url = getCallbackUrl ( true ) ;
Buggy code:
public class VelocityController extends SimplePID implements SpeedController { protected final SpeedController speedController ; protected float maxRotationalRate = 0 ; protected float target = 0 ; protected final float maxIntegralError ; protected final float deadband ; public VelocityController ( final SpeedController speedController , final Encoder encoder , final float maxRotationalRate , final float kP , final float kI , final float kD , final float maxIntegralError , final float deadband ) { } public VelocityController ( final SpeedController speedController , final EncoderPidSrc encoderPidSrc , final float maxRotationalRate , final float kP , final float kI , final float kD , final float maxIntegralError , final float deadband ) { } @ Override public double get ( ) { } @ Override public void set ( final double v , final byte b ) { } public double getRate ( ) { } @ Override public void set ( final double v ) { } @ Override public void disable ( ) { } @ Override public void pidWrite ( final double v ) { } public SpeedController getSpeedController ( ) { } @ Override public float pid ( final float target ) { float kErr ; float pOut ; float iOut ; float dOut ; float output ; <START_BUG> kErr = target - ( source . getValue ( ) ) ; <END_BUG> deltaError = ( prevError ) - kErr ; prevError = kErr ; integralError += kErr ; if ( ( integralError ) > ( maxIntegralError ) ) { integralError = maxIntegralError ; } if ( ( Math . abs ( target ) ) <= ( deadband ) ) { integralError = 0 ; } pOut = kErr * ( kP ) ; iOut = ( integralError ) * ( kI ) ; dOut = ( deltaError ) * ( kD ) ; if ( iOut > 1.0F ) { iOut = 1.0F ; } if ( atTarget ( ) ) { return 0.0F ; } output = ( pOut + iOut ) + dOut ; if ( output > 1.0F ) { return 1.0F ; } if ( output < ( - 1.0F ) ) { return - 1.0F ; } return output ; } }

Fix:
kErr = target - ( ( ( EncoderPidSrc ) ( source ) ) . getRate ( ) ) ;
Buggy code:
public class XKeysymTransformer implements ClassFileTransformer { public static final String XNET_PROTOCOL = "sun//awt//X11//XKeysym" ; public static final String PATCH_KEY_MAPPING_PROPERTIES = "patch.key.mapping.properties" ; public static final String PRINT = "print" ; private String agentArgument ; public XKeysymTransformer ( String agentArgument ) { } @ Override public byte [ ] transform ( ClassLoader loader , String className , Class < ? > classBeingRedefined , ProtectionDomain protectionDomain , byte [ ] classfileBuffer ) throws IllegalClassFormatException { try { <START_BUG> return className . equals ( XKeysymTransformer . XNET_PROTOCOL ) ? doClass ( className , classBeingRedefined , classfileBuffer ) : classfileBuffer ; <END_BUG> } catch ( Throwable err ) { err . printStackTrace ( ) ; return classfileBuffer ; } } private byte [ ] doClass ( String name , Class clazz , byte [ ] b ) { } }

Fix:
return ( className != null ) && ( className . equals ( XKeysymTransformer . XNET_PROTOCOL ) ) ? doClass ( className , classBeingRedefined , classfileBuffer ) : classfileBuffer ;
Buggy code:
public abstract class DistanceReader { public short getDistance ( int globalRow , int globalCol ) { } public static DistanceReader readRowRange ( String fname , int startRow , int numRows , int globalColCount , ByteOrder endianness , boolean mmap ) throws IOException { if ( mmap ) { try ( FileChannel fc = ( ( FileChannel ) ( Files . newByteChannel ( Paths . get ( fname ) , StandardOpenOption . READ ) ) ) ) { long pos = ( ( ( long ) ( startRow ) ) * globalColCount ) * 2 ; <START_BUG> MappedByteBuffer mappedBytes = fc . map ( FileChannel . MapMode . READ_ONLY , pos , ( ( numRows * globalColCount ) * 2 ) ) ; <END_BUG> mappedBytes . order ( endianness ) ; return new DistanceReader ( ) { @ Override public short getDistance ( int globalRow , int globalCol ) { int pos = ( ( globalRow - startRow ) * globalColCount ) + globalCol ; return mappedBytes . getShort ( ( pos * 2 ) ) ; } } ; } } else { try ( FileInputStream fis = new FileInputStream ( fname ) ) { DataInput di = ( endianness == ( ByteOrder . BIG_ENDIAN ) ) ? new DataInputStream ( fis ) : new LittleEndianDataInputStream ( fis ) ; int numBytesToSkip = ( startRow * globalColCount ) * ( Short . BYTES ) ; int skippedBytes = di . skipBytes ( numBytesToSkip ) ; if ( skippedBytes != numBytesToSkip ) throw new IOException ( Constants . errWrongNumOfBytesSkipped ( numBytesToSkip , skippedBytes ) ) ; short [ ] [ ] buffer = new short [ numRows ] [ ] ; for ( int i = 0 ; i < numRows ; ++ i ) { buffer [ i ] = new short [ globalColCount ] ; for ( int j = 0 ; j < globalColCount ; ++ j ) { buffer [ i ] [ j ] = di . readShort ( ) ; } } return new DistanceReader ( ) { @ Override public short getDistance ( int globalRow , int globalCol ) { int localRow = globalRow - startRow ; return buffer [ localRow ] [ globalCol ] ; } } ; } } } }

Fix:
MappedByteBuffer mappedBytes = fc . map ( FileChannel . MapMode . READ_ONLY , pos , ( ( numRows * globalColCount ) * 2L ) ) ;
Buggy code:
public class PageProviderTest extends WicketTestCase { public void testStalePageException ( ) { } public void testStalePageExceptionOnAjaxRequest ( ) throws IOException , ParseException , ResourceStreamNotFoundException { } private void executeAjaxUrlWithLastBaseUrl ( Url url ) throws IOException , ParseException , ResourceStreamNotFoundException { tester . getRequest ( ) . setUrl ( url ) ; <START_BUG> tester . getRequest ( ) . addHeader ( "Wicket-Ajax-BaseURL" , tester . getWicketAjaxBaseUrlFromLastRequest ( ) ) ; <END_BUG> tester . getRequest ( ) . addHeader ( "Wicket-Ajax" , "true" ) ; tester . processRequest ( ) ; } public void test ( ) { } public static class TestPage extends WebPage implements IMarkupResourceStreamProvider { private static final long serialVersionUID = 1L ; Link < Void > link ; AjaxLink < Void > ajaxLink ; public TestPage ( ) { } public IResourceStream getMarkupResourceStream ( MarkupContainer container , Class < ? > containerClass ) { } } public static class StatelessPageTest extends WebPage implements IMarkupResourceStreamProvider { private static final long serialVersionUID = 1L ; public IResourceStream getMarkupResourceStream ( MarkupContainer container , Class < ? > containerClass ) { } } }

Fix:
tester . getRequest ( ) . addHeader ( "Wicket-Ajax-BaseURL" , tester . getWicketAjaxBaseUrlEncodedInLastResponse ( ) ) ;
Buggy code:
public class curve25519xsalsa20poly1305 { public static final int crypto_secretbox_PUBLICKEYBYTES = 32 ; public static final int crypto_secretbox_SECRETKEYBYTES = 32 ; public static final int crypto_secretbox_BEFORENMBYTES = 32 ; public static final int crypto_secretbox_NONCEBYTES = 24 ; public static final int crypto_secretbox_ZEROBYTES = 32 ; public static final int crypto_secretbox_BOXZEROBYTES = 16 ; public static int crypto_box_getpublickey ( byte [ ] pk , byte [ ] sk ) { } public static int crypto_box_keypair ( byte [ ] pk , byte [ ] sk ) { SecureRandom rng = new SecureRandom ( ) ; <START_BUG> rng . nextBytes ( pk ) ; <END_BUG> return curve25519 . crypto_scalarmult_base ( pk , sk ) ; } public static int crypto_box_afternm ( byte [ ] c , byte [ ] m , long mlen , byte [ ] n , byte [ ] k ) { } public static int crypto_box_beforenm ( byte [ ] k , byte [ ] pk , byte [ ] sk ) { } public static int crypto_box ( byte [ ] c , byte [ ] m , long mlen , byte [ ] n , byte [ ] pk , byte [ ] sk ) { } public static int crypto_box_open ( byte [ ] m , byte [ ] c , long clen , byte [ ] n , byte [ ] pk , byte [ ] sk ) { } public static int crypto_box_open_afternm ( byte [ ] m , byte [ ] c , long clen , byte [ ] n , byte [ ] k ) { } public static int crypto_box_afternm ( byte [ ] c , byte [ ] m , byte [ ] n , byte [ ] k ) { } public static int crypto_box_open_afternm ( byte [ ] m , byte [ ] c , byte [ ] n , byte [ ] k ) { } public static int crypto_box ( byte [ ] c , byte [ ] m , byte [ ] n , byte [ ] pk , byte [ ] sk ) { } public static int crypto_box_open ( byte [ ] m , byte [ ] c , byte [ ] n , byte [ ] pk , byte [ ] sk ) { } }

Fix:
rng . nextBytes ( sk ) ;
Buggy code:
public class IssueTemplateInfoPeer extends org . tigris . scarab . om . BaseIssueTemplateInfoPeer { private static final String GET_ALL_TEMPLATES = "getAllTemplates" ; public static List getAllTemplates ( Module me , IssueType issueType , ScarabUser user , String sortColumn , String sortPolarity ) throws Exception { List templates = null ; Object obj = ScarabCache . get ( "IssueTemplateInfoPeer" , IssueTemplateInfoPeer . GET_ALL_TEMPLATES , user , issueType ) ; if ( obj == null ) { Criteria crit = new Criteria ( ) . add ( MODULE_ID , me . getModuleId ( ) ) . add ( DELETED , 0 ) . addJoin ( TRANSACTION_ID , ActivityPeer . TRANSACTION_ID ) . addJoin ( ISSUE_ID , ActivityPeer . ISSUE_ID ) . add ( TYPE_ID , issueType . getTemplateId ( ) ) . addJoin ( ISSUE_ID , ISSUE_ID ) ; crit . setDistinct ( ) ; Criteria . Criterion cPriv1 = crit . getNewCriterion ( SCOPE_ID , PERSONAL__PK , EQUAL ) ; cPriv1 . and ( crit . getNewCriterion ( CREATED_BY , user . getUserId ( ) , EQUAL ) ) ; <START_BUG> Criteria . Criterion cGlob = crit . getNewCriterion ( SCOPE_ID , GLOBAL__PK , EQUAL ) ; <END_BUG> cGlob . or ( cPriv1 ) ; crit . add ( cGlob ) ; if ( sortColumn . equals ( "desc" ) ) { IssueTemplateInfoPeer . addSortOrder ( crit , DESCRIPTION , sortPolarity ) ; } else if ( sortColumn . equals ( "avail" ) ) { crit . addJoin ( SCOPE_ID , SCOPE_ID ) ; IssueTemplateInfoPeer . addSortOrder ( crit , SCOPE_NAME , sortPolarity ) ; } else if ( ! ( sortColumn . equals ( "user" ) ) ) { IssueTemplateInfoPeer . addSortOrder ( crit , NAME , sortPolarity ) ; } templates = IssuePeer . doSelect ( crit ) ; ScarabCache . put ( templates , "IssueTemplateInfoPeer" , IssueTemplateInfoPeer . GET_ALL_TEMPLATES , user , issueType ) ; } else { templates = ( ( List ) ( obj ) ) ; } if ( sortColumn . equals ( "user" ) ) { templates = IssueTemplateInfoPeer . sortByCreatingUser ( templates , sortPolarity ) ; } return templates ; } private static Criteria addSortOrder ( Criteria crit , String sortColumn , String sortPolarity ) { } private static List sortByCreatingUser ( List result , String sortPolarity ) throws Exception { } }

Fix:
Criteria . Criterion cGlob = crit . getNewCriterion ( SCOPE_ID , MODULE__PK , EQUAL ) ;
Buggy code:
public class TypeCheckerTest { @ Test public void testCheckTypes_referencedQuestionDoesNotExistInQLIsInvalid ( ) { String questionLabel = "thisQuestionDoesNotExistInQL" ; Questionnaire questionnaire = aQuestionnaire ( ) . build ( ) ; List < Page > pages = new ArrayList < > ( ) ; List < Section > sections = new ArrayList < > ( ) ; List < String > questionNames = Arrays . asList ( questionLabel ) ; sections . add ( SectionBuilder . aSection ( ) . withQuestions ( questionNames ) . build ( ) ) ; pages . add ( PageBuilder . aPage ( ) . withSections ( sections ) . build ( ) ) ; Stylesheet stylesheet = aStylesheet ( ) . withPages ( pages ) . build ( ) ; TypeChecker typeChecker = new TypeChecker ( stylesheet , questionnaire ) ; List < TypeValidation > validations = typeChecker . checkTypes ( ) ; assertThat ( validations . toString ( ) , validations . size ( ) , is ( 1 ) ) ; ValidationMessage validationMessage = validations . get ( 0 ) ; <START_BUG> assertThat ( validationMessage . getValidationMessage ( ) , is ( "Question<seq2seq4repair_space>'Section<seq2seq4repair_space>with<seq2seq4repair_space>all<seq2seq4repair_space>kinds<seq2seq4repair_space>of<seq2seq4repair_space>Crap'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>in<seq2seq4repair_space>questionnaire" ) ) ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
assertThat ( validationMessage . getValidationMessage ( ) , is ( "Question<seq2seq4repair_space>'thisQuestionDoesNotExistInQL'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist<seq2seq4repair_space>in<seq2seq4repair_space>questionnaire" ) ) ;
Buggy code:
public class Trace { private static final String TRACENAME = "org.eclipse.ecf.example.collab.Trace" ; public static final String tracePrefix = "(trace)" ; public static boolean ON = false ; protected static boolean isEclipse = false ; protected static String pluginName = "" ; protected static String debugPrefix = "//debug//" ; protected static PrintStream getPrintStream ( String outputFileName ) { } protected static PrintStream printStream = null ; public static Trace create ( String key ) { if ( Trace . isEclipse ) { String res = Platform . getDebugOption ( ( ( ( Trace . pluginName ) + ( Trace . debugPrefix ) ) + key ) ) ; if ( res != null ) { <START_BUG> if ( Boolean . getBoolean ( res ) ) <END_BUG> return new Trace ( ( ( ( ( Trace . pluginName ) + "(" ) + key ) + ")" ) ) ; else return null ; } else { return null ; } } else return new Trace ( key ) ; } String name ; public void dumpStack ( Throwable e , String msg ) { } public void msg ( String msg ) { } protected static String getTimeString ( ) { } protected Trace ( String str ) { } public static String convertStringAToString ( String [ ] strings ) { } public static String convertObjectAToString ( Object [ ] objs ) { } public static void setThreadDebugGroup ( Object obj ) { } }

Fix:
if ( Boolean . valueOf ( res ) . booleanValue ( ) )
Buggy code:
public class Vector3 implements Comparable < Vector3 > { public static Vector3 ZERO = new Vector3 ( 0 , 0 , 0 ) ; public static Vector3 UNIT_X = new Vector3 ( 1 , 0 , 0 ) ; public static Vector3 Forward = Vector3 . UNIT_X ; public static Vector3 UNIT_Y = new Vector3 ( 0 , 1 , 0 ) ; public static Vector3 Up = Vector3 . UNIT_Y ; public static Vector3 UNIT_Z = new Vector3 ( 0 , 0 , 1 ) ; public static Vector3 Right = Vector3 . UNIT_Z ; public static Vector3 ONE = new Vector3 ( 1 , 1 , 1 ) ; protected float x ; protected float y ; protected float z ; public Vector3 ( float x , float y , float z ) { } public Vector3 ( ) { } public Vector3 ( Vector3 clone ) { } public Vector3 ( Vector2 vector , float z ) { } public Vector3 ( Vector2 vector ) { } public float getX ( ) { } public float getY ( ) { } public float getZ ( ) { } public Vector3 add ( Vector3 that ) { } public Vector3 subtract ( Vector3 that ) { } public Vector3 scale ( float scale ) { } public float dot ( Vector3 that ) { } public Vector3 cross ( Vector3 that ) { } public float lengthSquared ( ) { } public float length ( ) { } public float fastLength ( ) { } public Vector3 normalize ( ) { } public float [ ] toArray ( ) { } public Vector3 transform ( Matrix transformation ) { } public Vector3 transform ( Quaternion transformation ) { } public int compareTo ( Vector3 o ) { } public boolean equals ( Object o ) { } public String toString ( ) { <START_BUG> return String . format ( "{<seq2seq4repair_space>%f,<seq2seq4repair_space>%f,<seq2seq4repair_space>%f" , x , y , z ) ; <END_BUG> } public static float length ( Vector3 a ) { } public static float fastLength ( Vector3 a ) { } public static float lengthSquared ( Vector3 a ) { } public static Vector3 normalize ( Vector3 a ) { } public static Vector3 subtract ( Vector3 a , Vector3 b ) { } public static Vector3 add ( Vector3 a , Vector3 b ) { } public static Vector3 scale ( Vector3 a , float b ) { } public static float dot ( Vector3 a , Vector3 b ) { } public static Vector3 cross ( Vector3 a , Vector3 b ) { } public static float [ ] toArray ( Vector3 a ) { } public static Vector3 transform ( Vector3 vector , Matrix transformation ) { } public static Vector3 transform ( Vector3 vector , Quaternion rot ) { } public static int compareTo ( Vector3 a , Vector3 b ) { } public static boolean equals ( Object a , Object b ) { } }

Fix:
return String . format ( "{<seq2seq4repair_space>%f,<seq2seq4repair_space>%f,<seq2seq4repair_space>%f<seq2seq4repair_space>}" , x , y , z ) ;
Buggy code:
public class BeanMap extends AbstractMap { private Object bean ; private HashMap readMethods = new HashMap ( ) ; private HashMap writeMethods = new HashMap ( ) ; private HashMap types = new HashMap ( ) ; public static final Object [ ] NULL_ARGUMENTS = new Object [ ] { } ; public static HashMap defaultTransformers = new HashMap ( ) ; public BeanMap ( ) { } public BeanMap ( Object bean ) { } public Object clone ( ) { } public void clear ( ) { } <START_BUG> public boolean containsKey ( String name ) { <END_BUG> Method method = getReadMethod ( name ) ; return method != null ; } public boolean containsValue ( Object value ) { } public Object get ( Object name ) { } public Object put ( Object name , Object value ) throws ClassCastException , IllegalArgumentException { } public int size ( ) { } public Set keySet ( ) { } public Set entrySet ( ) { } public Collection values ( ) { } public Class getType ( String name ) { } public Iterator keyIterator ( ) { } public Iterator valueIterator ( ) { } public Iterator entryIterator ( ) { } public Object getBean ( ) { } public void setBean ( Object newBean ) { } protected Method getReadMethod ( Object name ) { } protected Method getWriteMethod ( Object name ) { } protected void reinitialise ( ) { } private void initialise ( ) { } protected void firePropertyChange ( Object key , Object oldValue , Object newValue ) { } protected static class MyMapEntry extends DefaultMapEntry { private BeanMap owner ; protected MyMapEntry ( BeanMap owner , Object key , Object value ) { } public Object setValue ( Object value ) { } } protected Object [ ] createWriteMethodArguments ( Method method , Object value ) throws ClassCastException , IllegalAccessException { } protected Object convertType ( Class newType , Object value ) throws IllegalAccessException , IllegalArgumentException , InstantiationException , InvocationTargetException { } protected Transformer getTypeTransformer ( Class aType ) { } protected void logInfo ( Exception e ) { } protected void logWarn ( Exception e ) { } }

Fix:
public boolean containsKey ( Object name ) {
Buggy code:
public class OfferFavoriteFragment extends OfferListFragment { private static final String ARG_SECTION_NUMBER = "section_number" ; private int mSectionNumber ; public OfferFavoriteFragment ( ) { } public static OfferFavoriteFragment newInstance ( int sectionNumber ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void initializeOfferList ( ) { List < FavoriteOffers > resultSet = new Select ( ) . from ( FavoriteOffers . class ) . orderBy ( "offer_id<seq2seq4repair_space>ASC" ) . execute ( ) ; if ( ( resultSet . size ( ) ) == 0 ) { offerList = new ArrayList ( ) ; } else { String list = "(" ; if ( ( resultSet . size ( ) ) == 1 ) list = ( "(" + ( resultSet . get ( 0 ) . getOfferId ( ) ) ) + ")" ; else { for ( int i = 0 ; i < ( resultSet . size ( ) ) ; i ++ ) { <START_BUG> if ( i == ( ( resultSet . size ( ) ) - 1 ) ) <END_BUG> list += ( resultSet . get ( i ) . getOfferId ( ) ) + ",<seq2seq4repair_space>" ; else list += resultSet . get ( i ) . getOfferId ( ) ; } list += ")" ; } offerList = new Select ( ) . from ( Offer . class ) . where ( ( "offer_id<seq2seq4repair_space>IN<seq2seq4repair_space>" + list ) ) . execute ( ) ; } } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public void onResume ( ) { } }

Fix:
if ( i != ( ( resultSet . size ( ) ) - 1 ) )
Buggy code:
@ Ceylon @ Method public final class min { private min ( ) { } @ TypeParameters ( @ TypeParameter ( value = "Value" , satisfies = "ceylon.language.Comparable<Value>" ) ) @ TypeInfo ( "Value" ) public static < Value extends Comparable < ? super Value > > Value min ( @ Name ( "values" ) @ TypeInfo ( "ceylon.language.Sequence<Value>" ) final Sequence < ? extends Value > values ) { Value min = values . getFirst ( ) ; for ( Iterator < ? extends Value > $val$iter$0 = values . getRest ( ) . getIterator ( ) ; $val$iter$0 != null ; $val$iter$0 = $val$iter$0 . getTail ( ) ) { final Value val = $val$iter$0 . getHead ( ) ; <START_BUG> if ( val . compare ( min ) . smaller ( ) ) { <END_BUG> min = val ; } } return min ; } }

Fix:
if ( val . compare ( min ) . smallerThan ( ) ) {
Buggy code:
public class RangeCommand { private static RangeCommandSerializer serializer = new RangeCommandSerializer ( ) ; public final String table ; public final String startWith ; public final String stopAt ; public final int maxResults ; public RangeCommand ( String table , String startWith , String stopAt , int maxResults ) { } public Message getMessage ( ) throws IOException { } public static RangeCommand read ( Message message ) throws IOException { <START_BUG> byte [ ] bytes = ( ( byte [ ] ) ( message . getMessageBody ( ) [ 0 ] ) ) ; <END_BUG> DataInputBuffer dib = new DataInputBuffer ( ) ; dib . reset ( bytes , bytes . length ) ; return RangeCommand . serializer . deserialize ( new DataInputStream ( dib ) ) ; } }

Fix:
byte [ ] bytes = message . getMessageBody ( ) ;
Buggy code:
public class SprintBacklogMapperTest { private SprintBacklogMapper mSprintBacklogMapper ; private Configuration mConfiguration = null ; private CreateProject mCP ; private CreateSprint mCS ; private AddStoryToSprint mASTS ; private AddTaskToStory mATTS ; private static long PROJECT_ID = 1 ; @ Before public void setUp ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } @ Test public void testGetTasksMap ( ) { Map < Long , ArrayList < TaskObject > > tasksMap = mSprintBacklogMapper . getTasksMap ( ) ; assertEquals ( 3 , tasksMap . size ( ) ) ; <START_BUG> List < IIssue > stories = mASTS . getIssueList ( ) ; <END_BUG> ArrayList < TaskObject > tasksInStory1 = tasksMap . get ( 0 ) ; ArrayList < TaskObject > tasksInStory2 = tasksMap . get ( 1 ) ; ArrayList < TaskObject > tasksInStory3 = tasksMap . get ( 2 ) ; } @ Test public void testGetAllTasks ( ) { } @ Test public void testGetDropedTasksMap ( ) { } @ Test public void testGetAllStories ( ) { } @ Test public void testGetStoriesBySprintId ( ) { } @ Test public void testGetTasksByStoryId ( ) { } @ Test public void testGetDroppedStories ( ) { } @ Test public void testGetStory ( ) { } @ Test public void testGetTask ( ) { } @ Test public void testUpdateTask ( ) { } @ Test public void testAddTask ( ) { } @ Test public void testAddExistingTask ( ) { } @ Test public void testGetTasksWithNoParent ( ) { } @ Test public void testDeleteExistingTask ( ) { } @ Test public void testDropTask ( ) { } @ Test public void testCloseStory ( ) { } @ Test public void testReopenStory ( ) { } @ Test public void testCloseTask ( ) { } @ Test public void testResetTask ( ) { } @ Test public void testReopenTask ( ) { } @ Test public void testCheckOutTask ( ) { } @ Test public void testDeleteTask ( ) { } private TaskInfo createTaskInfo ( int id ) { } }

Fix:
List < IIssue > stories = mASTS . getStories ( ) ;
Buggy code:
public class DiagonalMatrix extends AbstractRealMatrix implements Serializable { private static final long serialVersionUID = 20121229L ; private final double [ ] data ; public DiagonalMatrix ( final int dimension ) throws NotStrictlyPositiveException { } public DiagonalMatrix ( final double [ ] d ) { } public DiagonalMatrix ( final double [ ] d , final boolean copyArray ) throws NullArgumentException { } @ Override public RealMatrix createMatrix ( final int rowDimension , final int columnDimension ) throws DimensionMismatchException , NotStrictlyPositiveException { } @ Override public RealMatrix copy ( ) { } public DiagonalMatrix add ( final DiagonalMatrix m ) throws MatrixDimensionMismatchException { } public DiagonalMatrix subtract ( final DiagonalMatrix m ) throws MatrixDimensionMismatchException { } public DiagonalMatrix multiply ( final DiagonalMatrix m ) throws DimensionMismatchException { } @ Override public RealMatrix multiply ( final RealMatrix m ) throws DimensionMismatchException { } @ Override public double [ ] [ ] getData ( ) { } public double [ ] getDataRef ( ) { } @ Override public double getEntry ( final int row , final int column ) throws OutOfRangeException { } @ Override public void setEntry ( final int row , final int column , final double value ) throws NumberIsTooLargeException , OutOfRangeException { } @ Override public void addToEntry ( final int row , final int column , final double increment ) throws NumberIsTooLargeException , OutOfRangeException { } @ Override public void multiplyEntry ( final int row , final int column , final double factor ) throws OutOfRangeException { } @ Override public int getRowDimension ( ) { } @ Override public int getColumnDimension ( ) { } @ Override public double [ ] operate ( final double [ ] v ) throws DimensionMismatchException { } @ Override public double [ ] preMultiply ( final double [ ] v ) throws DimensionMismatchException { } @ Override public RealVector preMultiply ( final RealVector v ) throws DimensionMismatchException { <START_BUG> double [ ] vectorData = null ; <END_BUG> if ( v instanceof ArrayRealVector ) { vectorData = ( ( ArrayRealVector ) ( v ) ) . getDataRef ( ) ; } else { vectorData = v . toArray ( ) ; } return MatrixUtils . createRealVector ( preMultiply ( vectorData ) ) ; } private void ensureZero ( final double value ) throws NumberIsTooLargeException { } }

Fix:
final double [ ] vectorData ;
Buggy code:
public class Write { public List < String > lineList ; public Write ( List < String > lineList ) { } public void writeFile ( String writePath ) throws IOException { PrintWriter pw = null ; try { FileOutputStream fout = new FileOutputStream ( writePath ) ; Writer w = new OutputStreamWriter ( fout , "UTF-8" ) ; pw = new PrintWriter ( w ) ; for ( int i = ( lineList . size ( ) ) - 1 ; i >= 0 ; i -- ) { pw . println ( lineList . get ( i ) ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; throw e ; } finally { if ( pw != null ) try { pw . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; <START_BUG> throw e ; <END_BUG> } } } }

Fix:
throw new IOException ( e ) ;