nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CacheContainerMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) { <START_BUG> String containerName = context . getCurrentAddressValue ( ) ; <END_BUG> String name = Operations . getAttributeName ( operation ) ; CacheContainerMetric metric = CacheContainerMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { CacheContainer container = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CACHE_CONTAINER . getServiceName ( containerName ) ) ; if ( container != null ) { ModelNode result = metric . getValue ( container ) ; context . getResult ( ) . set ( ( ( result != null ) && ( result . isDefined ( ) ) ? result : new ModelNode ( "N//A" ) ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
String containerName = Operations . getPathAddress ( operation ) . getLastElement ( ) . getValue ( ) ;
Buggy code:
public class BasicNewProjectResourceWizard extends BasicNewResourceWizard implements IExecutableExtension { private WizardNewProjectCreationPage mainPage ; private WizardNewProjectReferencePage referencePage ; private IProject newProject ; private IConfigurationElement configElement ; private static String PAGE_PROBLEMS_TITLE = ResourceMessages . getString ( "NewProject.errorOpeningPage" ) ; private static String WINDOW_PROBLEMS_TITLE = ResourceMessages . getString ( "NewProject.errorOpeningWindow" ) ; public BasicNewProjectResourceWizard ( ) { } public void addPages ( ) { super . addPages ( ) ; mainPage = new WizardNewProjectCreationPage ( "basicNewProjectPage" ) ; mainPage . setTitle ( ResourceMessages . getString ( "NewProject.title" ) ) ; mainPage . setDescription ( ResourceMessages . getString ( "NewProject.description" ) ) ; this . addPage ( mainPage ) ; if ( ( ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProjects ( ) . length ) > 0 ) { referencePage = new WizardNewProjectReferencePage ( "basicReferenceProjectPage" ) ; <START_BUG> referencePage . setTitle ( ResourceMessages . getString ( "NewProject.refeerenceTitle" ) ) ; <END_BUG> referencePage . setDescription ( ResourceMessages . getString ( "NewProject.referenceDescription" ) ) ; this . addPage ( referencePage ) ; } } private IProject createNewProject ( ) { } private void createProject ( IProjectDescription description , IProject projectHandle , IProgressMonitor monitor ) throws CoreException , OperationCanceledException { } public IProject getNewProject ( ) { } public void init ( IWorkbench workbench , IStructuredSelection currentSelection ) { } protected void initializeDefaultPageImageDescriptor ( ) { } private static void openInNewPage ( IPerspectiveDescriptor desc ) { } private static void openInNewWindow ( IPerspectiveDescriptor desc ) { } public boolean performFinish ( ) { } private static void replaceCurrentPerspective ( IPerspectiveDescriptor persp ) { } public void setInitializationData ( IConfigurationElement cfig , String propertyName , Object data ) { } protected void updatePerspective ( ) { } public static void updatePerspective ( IConfigurationElement configElement ) { } }

Fix:
referencePage . setTitle ( ResourceMessages . getString ( "NewProject.referenceTitle" ) ) ;
Buggy code:
public class BlobLabeling { private static LabeledNeighbor [ ] getNeighbors ( byte [ ] data , int [ ] labels , int height , int width , int height_coord , int width_coord , int offset ) { } private static int getMinMatchingLabel ( LabeledNeighbor [ ] neighbors , byte currentColorValue ) { int minMatchingLabel = Integer . MAX_VALUE ; for ( LabeledNeighbor neighbor : neighbors ) { int label = neighbor . getLabel ( ) ; <START_BUG> if ( ( label > 0 ) && ( label < minMatchingLabel ) ) { <END_BUG> minMatchingLabel = label ; } } if ( minMatchingLabel != ( Integer . MAX_VALUE ) ) { return minMatchingLabel ; } else { return 0 ; } } public static BlobLabelData labelBlobs ( byte [ ] data , int height , int width ) { } public static void main ( String [ ] args ) { } }

Fix:
if ( ( ( label > 0 ) && ( label < minMatchingLabel ) ) && ( currentColorValue == ( neighbor . getColor ( ) ) ) ) {
Buggy code:
public class AddButtonListener implements ActionListener { private JTextField tf ; private Collector c ; private JCheckBox checkBox ; private JRadioButton wishlist ; private JLabel fail ; private JFrame frame ; public AddButtonListener ( JTextField field , JRadioButton wishlist , Collector c , JCheckBox checkBox , JLabel fail , JFrame frame ) { } public void actionPerformed ( ActionEvent e ) { String link = tf . getText ( ) ; boolean inFront = checkBox . isSelected ( ) ; <START_BUG> if ( ( link . contains ( "youtube." ) ) && ( link . contains ( "//watch" ) ) ) { <END_BUG> c . addToList ( link , wishlist . isSelected ( ) , inFront , tf , fail , frame ) ; } else { fail . setText ( "No<seq2seq4repair_space>valid<seq2seq4repair_space>Link" ) ; new ShowLabelThread ( fail , frame ) . start ( ) ; } } }

Fix:
if ( ! ( link . isEmpty ( ) ) ) {
Buggy code:
public class TotalDonationHudEntry implements IHudEntry { int position ; int defaultPosition ; String format = "" ; String configCat = "" ; String defaultFormat = "" ; private double amount = 0 ; private boolean writeToFile = true ; public TotalDonationHudEntry ( String configCat , int defaultPosition , String defaultFormat , double amount ) { } @ Override public int getPosition ( ) { } @ Override public int getAmount ( ) { } @ Override public String getHeader ( ) { } @ Override public String getFormat ( ) { } @ Override public void addToList ( ArrayList < String > list ) { if ( ( position ) != 0 ) { <START_BUG> list . add ( format . replace ( "$amount" , CURRENCY_FORMATTER . format ( amount ) ) ) ; <END_BUG> } } @ Override public void updateConfig ( ) { } @ Override public String getFilename ( ) { } @ Override public boolean writeToFile ( ) { } public void addToDonationamount ( double amount ) { } public void setDonationamount ( double amount ) { } public double getDonated ( ) { } }

Fix:
Helper . addWithEmptyLines ( list , format . replace ( "$amount" , CURRENCY_FORMATTER . format ( amount ) ) ) ;
Buggy code:
public abstract class WeaveTestCase extends TestCase { public boolean regenerate = false ; public boolean runTests = true ; File outDir ; String outDirPath ; public BcelWorld world = new BcelWorld ( ) ; public WeaveTestCase ( String name ) { } public void setUp ( ) { } public void tearDown ( ) throws Exception { } public static InstructionList getAdviceTag ( BcelShadow shadow , String where ) { } public void weaveTest ( String name , String outName , ShadowMunger planner ) throws IOException { } static String classDir = ( ( BcweaverTests . TESTDATA_PATH ) + ( File . separator ) ) + "bin" ; public void weaveTest ( String name , String outName , List planners ) throws IOException { } protected void weaveTestInner ( BcelWeaver weaver , UnwovenClassFile classFile , String name , String outName ) throws IOException { } public String makeClassPath ( String outDir ) { } public static UnwovenClassFile makeUnwovenClassFile ( String classDir , String name , String outDir ) throws IOException { } public void checkClass ( LazyClassGen gen , String outDir , String expectedFile ) throws IOException { } static final File TESTDATA_DIR = new File ( BcweaverTests . TESTDATA_PATH ) ; void genClass ( LazyClassGen gen , String outDir , String expectedFile ) throws IOException { } void realCheckClass ( LazyClassGen gen , String outDir , String expectedFile ) throws IOException { } public ShadowMunger makeConcreteAdvice ( String mungerString ) { } public ShadowMunger makeConcreteAdvice ( String mungerString , int extraArgFlag ) { } protected ShadowMunger makeConcreteAdvice ( String mungerString , int extraArgFlag , PerClause perClause ) { } public ShadowMunger makeAdviceField ( String kind , String extraArgType ) { } public List makeAdviceAll ( String kind , boolean matchOnlyPrintln ) { } public List makeAdviceAll ( final String kind ) { } public Pointcut makePointcutAll ( ) { } public Pointcut makePointcutNoZeroArg ( ) { } public Pointcut makePointcutPrintln ( ) { } public Pointcut makeConcretePointcut ( String s ) { <START_BUG> return makeResolvedPointcut ( s ) . concretize ( null , 0 ) ; <END_BUG> } public Pointcut makeResolvedPointcut ( String s ) { } public String [ ] getStandardTargets ( ) { } public String getTraceJar ( ) { } protected void weaveTest ( String [ ] inClassNames , String outKind , ShadowMunger patternMunger ) throws IOException { } protected void weaveTest ( String [ ] inClassNames , String outKind , List patternMungers ) throws IOException { } protected List addLexicalOrder ( List l ) { } public void checkShadowSet ( List l , String [ ] ss ) { } }

Fix:
return makeResolvedPointcut ( s ) . concretize ( null , null , 0 ) ;
Buggy code:
public class CheckDetailProvider extends ContentProvider { private static HashMap < String , String > sPersonsProjectionMap ; private static final int POINT = 1 ; private static final int POINT_ID = 2 ; private static final UriMatcher sUriMatcher ; private DatabaseHelper mOpenHelper ; @ Override public boolean onCreate ( ) { } @ Override public Cursor query ( Uri uri , String [ ] projection , String selection , String [ ] selectionArgs , String sortOrder ) { } @ Override public String getType ( Uri uri ) { } @ Override public Uri insert ( Uri uri , ContentValues initialValues ) { if ( ( CheckDetailProvider . sUriMatcher . match ( uri ) ) != ( CheckDetailProvider . POINT ) ) { throw new IllegalArgumentException ( ( "Unknown<seq2seq4repair_space>URI<seq2seq4repair_space>" + uri ) ) ; } ContentValues values ; if ( initialValues != null ) { values = new ContentValues ( initialValues ) ; } else { values = new ContentValues ( ) ; } if ( ( values . containsKey ( CHECKDATE ) ) == false ) { values . put ( CHECKDATE , "" ) ; } if ( ( values . containsKey ( CHANDI ) ) == false ) { values . put ( CHANDI , "" ) ; } if ( ( values . containsKey ( SHUIFEN ) ) == false ) { values . put ( SHUIFEN , "" ) ; } if ( ( values . containsKey ( SHULIANG ) ) == false ) { values . put ( SHULIANG , "" ) ; } if ( ( values . containsKey ( LIANGZHONG ) ) == false ) { values . put ( LIANGZHONG , "" ) ; } if ( ( values . containsKey ( CANGHAO ) ) == false ) { values . put ( CANGHAO , "" ) ; } if ( ( values . containsKey ( CHECKTYPE ) ) == false ) { values . put ( CHECKTYPE , "" ) ; } if ( ( values . containsKey ( CHECKDATE ) ) == false ) { values . put ( CHECKDATE , "" ) ; } <START_BUG> if ( values . containsKey ( SAVE_TIME ) ) { <END_BUG> values . put ( SAVE_TIME , "" ) ; } SQLiteDatabase db = mOpenHelper . getWritableDatabase ( ) ; long rowId = db . insert ( TABLE_NAME , CHECKDATE , values ) ; if ( rowId > 0 ) { Uri noteUri = ContentUris . withAppendedId ( CONTENT_URI , rowId ) ; getContext ( ) . getContentResolver ( ) . notifyChange ( noteUri , null ) ; return noteUri ; } throw new android . database . SQLException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>insert<seq2seq4repair_space>row<seq2seq4repair_space>into<seq2seq4repair_space>" + uri ) ) ; } @ Override public int delete ( Uri uri , String selection , String [ ] selectionArgs ) { } @ Override public int update ( Uri uri , ContentValues values , String selection , String [ ] selectionArgs ) { } }

Fix:
if ( ( values . containsKey ( SAVE_TIME ) ) == false ) {
Buggy code:
public class ConfigPropertyAdd extends AbstractBoottimeAddStepHandler implements DescriptionProvider { public static final ConfigPropertyAdd INSTANCE = new ConfigPropertyAdd ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override protected void populateModel ( ModelNode operation , ModelNode modelNode ) throws OperationFailedException { } @ Override protected void performBoottime ( OperationContext context , ModelNode operation , ModelNode recoveryEnvModel , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > serviceControllers ) throws OperationFailedException { <START_BUG> final String configPropertyValue = Constants . CONFIG_PROPERTY_VALUE . validateResolvedOperation ( recoveryEnvModel ) . asString ( ) ; <END_BUG> final ModelNode address = operation . require ( OP_ADDR ) ; PathAddress path = PathAddress . pathAddress ( address ) ; final String archiveName = path . getElement ( ( ( path . size ( ) ) - 2 ) ) . getValue ( ) ; final String configPropertyName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; ServiceName serviceName = ServiceName . of ( RA_SERVICE , archiveName , configPropertyName ) ; ServiceName raServiceName = ServiceName . of ( RA_SERVICE , archiveName ) ; final ServiceTarget serviceTarget = context . getServiceTarget ( ) ; final ConfigPropertiesService service = new ConfigPropertiesService ( configPropertyName , configPropertyValue ) ; ServiceController < ? > controller = serviceTarget . addService ( serviceName , service ) . setInitialMode ( ACTIVE ) . addDependency ( raServiceName , ModifiableResourceAdapter . class , service . getRaInjector ( ) ) . addListener ( verificationHandler ) . install ( ) ; context . addStep ( verificationHandler , VERIFY ) ; } }

Fix:
final String configPropertyValue = Constants . CONFIG_PROPERTY_VALUE . resolveModelAttribute ( context , recoveryEnvModel ) . asString ( ) ;
Buggy code:
public class Snippet78 { public static void main ( String [ ] args ) { <START_BUG> Display display = Display . getDefault ( ) ; <END_BUG> final Shell shell = new Shell ( display ) ; shell . setLayout ( new FillLayout ( ) ) ; final Label label1 = new Label ( shell , SWT . BORDER ) ; label1 . setText ( "TEXT" ) ; final Label label2 = new Label ( shell , SWT . BORDER ) ; Snippet78 . setDragDrop ( label1 ) ; Snippet78 . setDragDrop ( label2 ) ; shell . setSize ( 200 , 200 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } public static void setDragDrop ( final Label label ) { } }

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

Fix:
application . getRequiredPageSettings ( ) . setHomePage ( pageClass ) ;
Buggy code:
public class Test_org_eclipse_swt_browser_LocationAdapter extends SwtTestCase { public Test_org_eclipse_swt_browser_LocationAdapter ( String name ) { } public static void main ( String [ ] args ) { } protected void setUp ( ) { } protected void tearDown ( ) { } public void test_Constructor ( ) { <START_BUG> LocationAdapter adapter = new LocationAdapter ( ) { } ; <END_BUG> } public void test_changedLorg_eclipse_swt_browser_LocationEvent ( ) { } public void test_changingLorg_eclipse_swt_browser_LocationEvent ( ) { } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } }

Fix:
new LocationAdapter ( ) { } ;
Buggy code:
class Emitter { private final HashMap < String , LinkRef > linkRefs = new HashMap < String , LinkRef > ( ) ; private final Configuration config ; public boolean useExtensions = false ; public boolean convertNewline2Br = false ; private Map < String , Plugin > plugins = new HashMap < String , Plugin > ( ) ; public Emitter ( final Configuration config ) { } public void register ( Plugin plugin ) { } public void addLinkRef ( final String key , final LinkRef linkRef ) { } public void emit ( final StringBuilder out , final Block root ) { } private void emitLines ( final StringBuilder out , final Block block ) { } private int findToken ( final String in , int start , MarkToken token ) { } private int checkLink ( final StringBuilder out , final String in , int start , MarkToken token ) { } private int checkHtml ( final StringBuilder out , final String in , int start ) { } private static int checkEntity ( final StringBuilder out , final String in , int start ) { } private int recursiveEmitLine ( final StringBuilder out , final String in , int start , MarkToken token ) { } @ SuppressWarnings ( "deprecation" ) private static char whitespaceToSpace ( char c ) { } private MarkToken getToken ( final String in , final int pos ) { } private void emitMarkedLines ( final StringBuilder out , final Line lines ) { } private void emitRawLines ( final StringBuilder out , final Line lines ) { } private void emitCodeLines ( final StringBuilder out , final Line lines , final String meta , final boolean removeIndent ) { } protected void emitPluginLines ( final StringBuilder out , final Line lines , final String meta ) { } protected Map < String , String > parsePluginParams ( String s ) { Map < String , String > params = new HashMap < String , String > ( ) ; <START_BUG> RegExp regExp = RegExp . compile ( "(\\w+)=\"*((?<=\")[^\"]+(?=\")|([^\\s]+))\"*" ) ; <END_BUG> MatchResult m ; while ( ( m = regExp . exec ( s ) ) != null ) { params . put ( m . getGroup ( 1 ) , m . getGroup ( 2 ) ) ; } return params ; } }

Fix:
RegExp regExp = RegExp . compile ( "(\\w+)=\"*((?=\")[^\"]+(?=\")|([^\\s]+))\"*" , "g" ) ;
Buggy code:
public class ResourceUrlProvider implements ApplicationListener < ContextRefreshedEvent > { protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private UrlPathHelper pathHelper = new UrlPathHelper ( ) ; private PathMatcher pathMatcher = new AntPathMatcher ( ) ; private final Map < String , ResourceHttpRequestHandler > handlerMap = new HashMap < String , ResourceHttpRequestHandler > ( ) ; private boolean autodetect = true ; public void setUrlPathHelper ( UrlPathHelper pathHelper ) { } public UrlPathHelper getPathHelper ( ) { } public void setPathMatcher ( PathMatcher pathMatcher ) { } public PathMatcher getPathMatcher ( ) { } public void setHandlerMap ( Map < String , ResourceHttpRequestHandler > handlerMap ) { } public Map < String , ResourceHttpRequestHandler > getHandlerMap ( ) { } public boolean isAutodetect ( ) { } @ Override public void onApplicationEvent ( ContextRefreshedEvent event ) { } protected void detectResourceHandlers ( ApplicationContext appContext ) { } public final String getForRequestUrl ( HttpServletRequest request , String requestUrl ) { } private int getLookupPathIndex ( HttpServletRequest request ) { } public final String getForLookupPath ( String lookupPath ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( ( "Getting<seq2seq4repair_space>resource<seq2seq4repair_space>URL<seq2seq4repair_space>for<seq2seq4repair_space>lookupPath=" + lookupPath ) ) ; } for ( String pattern : this . handlerMap . keySet ( ) ) { if ( ! ( getPathMatcher ( ) . match ( pattern , lookupPath ) ) ) { continue ; } String pathWithinMapping = getPathMatcher ( ) . extractPathWithinPattern ( pattern , lookupPath ) ; String pathMapping = lookupPath . substring ( 0 , lookupPath . indexOf ( pathWithinMapping ) ) ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( ( ( "Invoking<seq2seq4repair_space>ResourceResolverChain<seq2seq4repair_space>for<seq2seq4repair_space>URL<seq2seq4repair_space>pattern=\"" + pattern ) + "\"" ) ) ; } ResourceHttpRequestHandler handler = this . handlerMap . get ( pattern ) ; ResourceResolverChain chain = new DefaultResourceResolverChain ( handler . getResourceResolvers ( ) ) ; String resolved = chain . resolveUrlPath ( pathWithinMapping , handler . getLocations ( ) ) ; if ( resolved == null ) { <START_BUG> throw new IllegalStateException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>public<seq2seq4repair_space>resource<seq2seq4repair_space>URL<seq2seq4repair_space>path<seq2seq4repair_space>for<seq2seq4repair_space>" + pathWithinMapping ) ) ; <END_BUG> } if ( logger . isTraceEnabled ( ) ) { logger . trace ( ( ( "Resolved<seq2seq4repair_space>public<seq2seq4repair_space>resource<seq2seq4repair_space>URL<seq2seq4repair_space>path=\"" + resolved ) + "\"" ) ) ; } return pathMapping + resolved ; } logger . debug ( "No<seq2seq4repair_space>matching<seq2seq4repair_space>resource<seq2seq4repair_space>mapping" ) ; return null ; } }

Fix:
continue ;
Buggy code:
public class TransformedMultiValuedMap < K , V > extends AbstractMultiValuedMapDecorator < K , V > { private static final long serialVersionUID = - 1254147899086470720L ; private final Transformer < ? super K , ? extends K > keyTransformer ; private final Transformer < ? super V , ? extends V > valueTransformer ; public static < K , V > TransformedMultiValuedMap < K , V > transformingMap ( final MultiValuedMap < K , V > map , final Transformer < ? super K , ? extends K > keyTransformer , final Transformer < ? super V , ? extends V > valueTransformer ) { } public static < K , V > TransformedMultiValuedMap < K , V > transformedMap ( final MultiValuedMap < K , V > map , final Transformer < ? super K , ? extends K > keyTransformer , final Transformer < ? super V , ? extends V > valueTransformer ) { } protected TransformedMultiValuedMap ( MultiValuedMap < K , V > map , Transformer < ? super K , ? extends K > keyTransformer , Transformer < ? super V , ? extends V > valueTransformer ) { } protected K transformKey ( final K object ) { } protected V transformValue ( final V object ) { } @ SuppressWarnings ( "unchecked" ) protected Map < K , V > transformMap ( final Map < ? extends K , ? extends V > map ) { } @ SuppressWarnings ( "unchecked" ) protected MultiValuedMap < K , V > transformMultiValuedMap ( final MultiValuedMap < ? extends K , ? extends V > map ) { } @ Override <START_BUG> public V put ( K key , V value ) { <END_BUG> K transformedKey = transformKey ( key ) ; V transformedValue = transformValue ( value ) ; return TransformedMultiValuedMap . decorated ( ) . put ( transformedKey , transformedValue ) ; } @ Override @ SuppressWarnings ( "unchecked" ) public boolean putAll ( K key , Iterable < ? extends V > values ) { } @ Override public void putAll ( Map < ? extends K , ? extends V > m ) { } @ Override public void putAll ( MultiValuedMap < ? extends K , ? extends V > m ) { } }

Fix:
public boolean put ( K key , V value ) {
Buggy code:
public class Level1Screen extends LevelScreen { int maxTouches = 5 ; int touchesLeft = maxTouches ; int circleRadius = 300 ; public Level1Screen ( Game game ) { } @ Override protected void updateGameRunning ( List < TouchEvent > touchEvents , float deltaTime ) { int len = touchEvents . size ( ) ; for ( int i = 0 ; i < len ; i ++ ) { TouchEvent event = touchEvents . get ( i ) ; if ( ( event . type ) == ( TouchEvent . TOUCH_DOWN ) ) { ( touchesLeft ) -- ; } } <START_BUG> if ( ( touchesLeft ) == 0 ) { <END_BUG> state = GameState . Finished ; } } @ Override float percentDone ( ) { } @ Override int levelsDone ( ) { } void drawRunningUI ( ) { } @ Override protected Screen nextLevel ( ) { } }

Fix:
if ( ( touchesLeft ) <= 0 ) {
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "@version@" ; <END_BUG> } }

Fix:
return "3.8" ;
Buggy code:
public class CreatePanel extends MobileAppGUIPanel { public CreatePanel ( ) { } private int isAcceptableUsername ( ) { if ( this . formUsernameField . getText ( ) . isEmpty ( ) ) { return 1 ; } if ( ( this . formUsernameField . getText ( ) . length ( ) ) < 5 ) { return 2 ; } if ( ( this . formUsernameField . getText ( ) . length ( ) ) > 15 ) { return 3 ; } if ( ! ( this . formUsernameField . getText ( ) . matches ( "^[a-zA-Z0-9]*$" ) ) ) { return 4 ; } for ( Account account : AccountRegistry . getInstance ( ) . getAccountListCopy ( ) ) { <START_BUG> if ( account . getUsername ( ) . equalsIgnoreCase ( this . formUsernameField . getText ( ) ) ) { <END_BUG> return 5 ; } } return 0 ; } private int isAcceptablePassword ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void formCreateButtonActionPerformed ( ActionEvent evt ) { } private JLabel errorLabel ; private JButton formCreateButton ; private JPasswordField formPasswordField ; private JLabel formPasswordLabel ; private JTextField formUsernameField ; private JLabel formUsernameLabel ; }

Fix:
if ( ( ( account . getUsername ( ) ) != null ) && ( account . getUsername ( ) . equalsIgnoreCase ( this . formUsernameField . getText ( ) ) ) ) {
Buggy code:
public class MoveContainerElevatorManually extends Command { public MoveContainerElevatorManually ( ) { } @ Override protected void initialize ( ) { } @ Override protected void execute ( ) { double elevatorSpeed = gamepad . getY ( ) ; containerElevator . setContainerElevatorSpeed ( elevatorSpeed ) ; <START_BUG> if ( ( Math . abs ( getMotorOutput ) ) < 0.05 ) { <END_BUG> new EngageContainerLiftBrake ( ) ; } else { new DisengageContainerLiftBrake ( ) ; } } @ Override protected boolean isFinished ( ) { } @ Override protected void end ( ) { } @ Override protected void interrupted ( ) { } }

Fix:
if ( ( Math . abs ( containerElevator . getMotorOutput ( ) ) ) < 0.05 ) {
Buggy code:
public class ConnectionPool { private static String DRIVER ; private static String URL ; private static String USER ; private static String PASSWORD ; private static int INIT_CONN ; private static int MAX_CONN ; private int free_num ; private int avtive_num ; private LinkedList < Connection > freeConnections ; private static ConnectionPool pool ; private static Object obj = new Object ( ) ; private ConnectionPool ( ) { } protected static ConnectionPool getInstance ( ) { } private Connection newConnection ( ) { } public synchronized Connection getConnection ( ) { Connection conn = null ; if ( ( ( freeConnections ) != null ) && ( ( freeConnections . size ( ) ) > 0 ) ) { conn = freeConnections . remove ( ) ; try { <START_BUG> if ( conn . isClosed ( ) ) { <END_BUG> System . out . println ( "移除了一个不可用的链接" ) ; ( avtive_num ) -- ; conn = getConnection ( ) ; } } catch ( SQLException e ) { System . out . println ( "移除了一个不可用的链接" ) ; ( avtive_num ) -- ; conn = getConnection ( ) ; } ( free_num ) -- ; ( avtive_num ) ++ ; } else if ( ( avtive_num ) < ( ConnectionPool . MAX_CONN ) ) { conn = newConnection ( ) ; ( avtive_num ) ++ ; } else { System . out . println ( "目前已经达到最大连接数，请等待...." ) ; } return conn ; } protected synchronized void freeConnection ( Connection conn ) { } protected int getFree_num ( ) { } protected int getAvtive_num ( ) { } private static void readConfig ( ) { } }

Fix:
if ( ( conn . isClosed ( ) ) || ( ! ( conn . isValid ( 0 ) ) ) ) {
Buggy code:
public final class Assert { private static class AssertionFailedException extends RuntimeException { private static final long serialVersionUID = 3760843476056421681L ; public AssertionFailedException ( ) { } public AssertionFailedException ( String detail ) { } } private Assert ( ) { } public static boolean isLegal ( boolean expression ) { } public static boolean isLegal ( boolean expression , String message ) { } public static void isNotNull ( Object object ) { } public static void isNotNull ( Object object , String message ) { if ( object == null ) <START_BUG> throw new Assert . AssertionFailedException ( ( "null<seq2seq4repair_space>argument;" + message ) ) ; <END_BUG> } public static boolean isTrue ( boolean expression ) { } public static boolean isTrue ( boolean expression , String message ) { } }

Fix:
throw new Assert . AssertionFailedException ( ( "null<seq2seq4repair_space>argument<seq2seq4repair_space>" + message ) ) ;
Buggy code:
public class AddDeckFragment extends DialogFragment implements TextView . OnEditorActionListener { @ Bind ( id . deckNameEditText ) EditText mDeckNameEditText ; @ Bind ( id . deckCategoryEditText ) EditText mDeckCategoryEditText ; public interface AddDeckDialogListener { void onFinishEditDialog ( String nameText , String categoryText ) { } } public static AddDeckFragment newInstance ( String title ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , @ Nullable Bundle savedInstanceState ) { } @ Override public boolean onEditorAction ( TextView v , int actionId , KeyEvent event ) { if ( ( EditorInfo . IME_ACTION_DONE ) == actionId ) { <START_BUG> AddDeckFragment . AddDeckDialogListener listener = ( ( AddDeckFragment . AddDeckDialogListener ) ( getActivity ( ) ) ) ; <END_BUG> listener . onFinishEditDialog ( mDeckNameEditText . getText ( ) . toString ( ) , mDeckCategoryEditText . getText ( ) . toString ( ) ) ; dismiss ( ) ; return true ; } return false ; } }

Fix:
AddDeckFragment . AddDeckDialogListener listener = ( ( AddDeckFragment . AddDeckDialogListener ) ( getActivity ( ) . getSupportFragmentManager ( ) . findFragmentById ( fragmentDisplay ) ) ) ;
Buggy code:
public class TestOmitPositions extends LuceneTestCase { public void testBasic ( ) throws Exception { Directory dir = newDirectory ( ) ; RandomIndexWriter w = new RandomIndexWriter ( random ( ) , dir ) ; Document doc = new Document ( ) ; FieldType ft = new FieldType ( TextField . TYPE_NOT_STORED ) ; ft . setIndexOptions ( DOCS_AND_FREQS ) ; Field f = newField ( "foo" , "this<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>test<seq2seq4repair_space>test" , ft ) ; doc . add ( f ) ; for ( int i = 0 ; i < 100 ; i ++ ) { w . addDocument ( doc ) ; } IndexReader reader = w . getReader ( ) ; w . close ( ) ; assertNull ( MultiFields . getTermPositionsEnum ( reader , null , "foo" , new BytesRef ( "test" ) ) ) ; <START_BUG> DocsEnum de = _TestUtil . docs ( random ( ) , reader , "foo" , new BytesRef ( "test" ) , null , null , FLAG_FREQS ) ; <END_BUG> while ( ( de . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) { assertEquals ( 2 , de . freq ( ) ) ; } reader . close ( ) ; dir . close ( ) ; } public void testPositions ( ) throws Exception { } private void assertNoPrx ( Directory dir ) throws Throwable { } public void testNoPrxFile ( ) throws Throwable { } }

Fix:
DocsEnum de = _TestUtil . docs ( random ( ) , reader , "foo" , new BytesRef ( "test" ) , null , null , true ) ;
Buggy code:
@ Controller @ RequestMapping ( "//statistics" ) public class StatisticsController { @ Autowired private StatisticsService statisticsService ; @ RequestMapping ( value = "//message//detail" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult getProcessMessage ( @ RequestParam ( value = "source" , defaultValue = "0" ) int source , @ RequestParam ( value = "type" , defaultValue = "0" ) int type , @ RequestParam ( value = "status" , defaultValue = "0" ) int status , @ RequestParam ( value = "pageIndex" , defaultValue = "1" ) int pageIndex , @ RequestParam ( value = "pageSize" , defaultValue = "10" ) int pageSize ) { <START_BUG> StatisticsModel statisticsModel = statisticsService . getProcessMessage ( source , type , status , pageSize , ( ( pageSize - 1 ) * pageIndex ) ) ; <END_BUG> ServiceResult result = new ServiceResult ( ) ; result . setCode ( SUCCESS ) ; result . setMsg ( statisticsModel ) ; return result ; } @ RequestMapping ( value = "//message//delete" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult deleteMessage ( @ RequestParam ( value = "id" , defaultValue = "0" ) int id ) { } @ RequestMapping ( value = "//message//retry" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult retryMessage ( @ RequestParam ( value = "id" , defaultValue = "0" ) int id ) { } @ RequestMapping ( value = "//message//retry//all" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult retryAllMessage ( @ RequestParam ( value = "type" , defaultValue = "0" ) int type , @ RequestParam ( value = "source" , defaultValue = "0" ) int source ) { } @ RequestMapping ( value = "//message" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult getMessageStatistics ( @ RequestParam ( value = "type" , defaultValue = "0" ) int type , @ RequestParam ( value = "source" , defaultValue = "0" ) int source ) { } @ RequestMapping ( value = "//message//all" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult getAllMessageStatistics ( ) { } @ RequestMapping ( value = "//message//search" , method = RequestMethod . GET ) @ ResponseBody public ServiceResult getMessageByID ( @ RequestParam ( value = "id" , defaultValue = "0" ) int id ) { } }

Fix:
StatisticsModel statisticsModel = statisticsService . getProcessMessage ( source , type , status , pageSize , ( pageSize * ( pageIndex - 1 ) ) ) ;
Buggy code:
public class Program { protected int programID ; public Program ( ) throws ShaderException { } public int getProgramID ( ) { } public Program attachShader ( Shader shader ) { } public Program link ( ) throws ShaderException { } public void use ( ) { } public void stopUse ( ) { } public boolean setUniform ( String name , int value ) { } public boolean setUniform ( String name , float value ) { } public String getProgramInfoLog ( ) { <START_BUG> return GL20 . glGetShaderInfoLog ( programID , GL20 . glGetProgram ( programID , GL_INFO_LOG_LENGTH ) ) ; <END_BUG> } }

Fix:
return GL20 . glGetProgramInfoLog ( programID , GL20 . glGetProgram ( programID , GL_INFO_LOG_LENGTH ) ) ;
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 ( true ) ; <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 ( ) ;
Buggy code:
@ SuppressWarnings ( "restriction" ) public class XtendXpandBuilder extends IncrementalProjectBuilder { class XtendXpandDeltaVisitor implements IResourceDeltaVisitor , IResourceVisitor { private final IProgressMonitor monitor ; private final Set < String > extensions ; public XtendXpandDeltaVisitor ( final IProgressMonitor monitor ) { } public boolean visit ( final IResourceDelta delta ) throws CoreException { } private boolean isXtendXpandResource ( final IResource resource ) { } public boolean visit ( final IResource resource ) { } } private int incrementalAnalyzerStrategy ; private void updateIncrementalAnalyzerStrategy ( ) { } private boolean analyzeDependentProjectsWhenIncremental ( ) { } private boolean analyseReverseReferencedResources ( ) { } private boolean analyzeWholeProjectWhenIncremental ( ) { } boolean isOnJavaClassPath ( final IResource resource ) { } public static final String getBUILDER_ID ( ) { } private Set < IXtendXpandResource > toAnalyze = null ; @ SuppressWarnings ( "unchecked" ) @ Override protected IProject [ ] build ( final int kind , final Map args , final IProgressMonitor monitor ) throws CoreException { } private void fillToAnalyseWithReverseReferencedResources ( ) { Set < IXtendXpandResource > reverseReferences = new HashSet < IXtendXpandResource > ( ) ; for ( final Object name : toAnalyze ) { final IXtendXpandResource res = ( ( IXtendXpandResource ) ( name ) ) ; final IResource resource = ( ( IResource ) ( res . getUnderlyingStorage ( ) ) ) ; final IProject project = resource . getProject ( ) ; if ( ! ( project . isLinked ( ) ) ) { final IXtendXpandProject xtdxptProject = Activator . getExtXptModelManager ( ) . findProject ( project ) ; IXtendXpandResource [ ] resources = xtdxptProject . getAllRegisteredResources ( ) ; for ( IXtendXpandResource iXtendXpandResource : resources ) { if ( iXtendXpandResource != null ) { for ( String string : iXtendXpandResource . getImportedExtensions ( ) ) { IXtendXpandResource importedResource = xtdxptProject . findExtXptResource ( string , FILE_EXTENSION ) ; <START_BUG> if ( importedResource . equals ( res ) ) { <END_BUG> reverseReferences . add ( iXtendXpandResource ) ; break ; } } } } } } toAnalyze . addAll ( reverseReferences ) ; } private void addProject ( final Map < IXtendXpandProject , ExecutionContext > projects , final IXtendXpandProject xtdxptProject ) { } private Collection < IXtendXpandProject > getDependentProjects ( IXtendXpandProject xtdxptProject ) { } void reloadResource ( final IFile resource ) { } public void handleRemovement ( final IFile resource ) { } protected void fullBuild ( final IProgressMonitor monitor ) throws CoreException { } protected void incrementalBuild ( final IResourceDelta delta , final IProgressMonitor monitor ) throws CoreException { } }

Fix:
if ( ( importedResource != null ) && ( importedResource . equals ( res ) ) ) {
Buggy code:
@ Transactional @ Authenticated ( { LoggedIn . class , HasRole . class } ) public final class ContestSubmissionController extends Controller { private static final long PAGE_SIZE = 20 ; private final ContestService contestService ; private final SubmissionService submissionService ; public ContestSubmissionController ( ContestService contestService , SubmissionService submissionService ) { } public Result viewScreenedSubmissions ( long contestId ) { <START_BUG> return listScreenedSubmissions ( contestId , 0 , "id" , "desc" , "" ) ; <END_BUG> } public Result listScreenedSubmissions ( long contestId , long pageIndex , String orderBy , String orderDir , String problemJid ) { } public Result viewSubmission ( long contestId , long submissionId ) { } public Result viewSubmissions ( long contestId ) { } public Result listSubmissions ( long contestId , long pageIndex , String orderBy , String orderDir , String contestantJid , String problemJid ) { } public Result regradeSubmission ( long contestId , long submissionId , long pageIndex , String orderBy , String orderDir , String contestantJid , String problemJid ) { } public Result regradeSubmissions ( long contestId , long pageIndex , String orderBy , String orderDir , String contestantJid , String problemJid ) { } private void appendSubtabsLayout ( LazyHtml content , Contest contest ) { } private void appendBreadcrumbsLayout ( LazyHtml content , Contest contest , InternalLink ... lastLinks ) { } private boolean isAllowedToSuperviseSubmissions ( Contest contest ) { } private boolean isAllowedToViewSubmission ( Contest contest , Submission submission ) { } }

Fix:
return listScreenedSubmissions ( contestId , 0 , "id" , "desc" , null ) ;
Buggy code:
public class PassphraseService { RandomAdjectiveService adjectiveService ; RandomNounService nounService ; public PassphraseService ( RandomAdjectiveService adjectiveService , RandomNounService nounService ) { } public Observable < String > passphrase ( ) { <START_BUG> return Observable . combineLatest ( adjectiveService . adjectives ( ) , nounService . nouns ( ) , ( adjective , noun ) -> ( adjective + "<seq2seq4repair_space>" ) + noun ) ; <END_BUG> } }

Fix:
return Observable . zip ( adjectiveService . adjectives ( ) . onBackpressureDrop ( ) , nounService . nouns ( ) . onBackpressureDrop ( ) , ( adjective , noun ) -> ( adjective + "<seq2seq4repair_space>" ) + noun ) ;
Buggy code:
public class RemotingConnectorService implements Service < RemotingConnectorServer > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "jmx" , "remoting-connector-ref" ) ; private RemotingConnectorServer server ; private final InjectedValue < MBeanServer > mBeanServer = new InjectedValue < MBeanServer > ( ) ; private final InjectedValue < Endpoint > endpoint = new InjectedValue < Endpoint > ( ) ; @ Override public synchronized void start ( final StartContext context ) throws StartException { <START_BUG> server = new RemotingConnectorServer ( mBeanServer . getValue ( ) , endpoint . getValue ( ) ) ; <END_BUG> try { server . start ( ) ; } catch ( IOException e ) { throw new StartException ( e ) ; } } @ Override public synchronized void stop ( final StopContext context ) { } @ Override public synchronized RemotingConnectorServer getValue ( ) throws IllegalArgumentException , IllegalStateException { } public static ServiceController < ? > addService ( final ServiceTarget target , final ServiceVerificationHandler verificationHandler , final boolean useManagementEndpoint ) { } }

Fix:
server = new RemotingConnectorServer ( mBeanServer . getValue ( ) , endpoint . getValue ( ) , new ServerInterceptorFactory ( ) ) ;
Buggy code:
public class RemoteChannelProxyControllerTestCase extends AbstractProxyControllerTest { static RemoteChannelPairSetup channels ; @ After public void stopChannels ( ) throws Exception { } @ Override protected ProxyController createProxyController ( final ModelController proxiedController , final PathAddress proxyNodeAddress ) { TransactionalModelControllerOperationHandler operationHandler = new TransactionalModelControllerOperationHandler ( proxiedController , Executors . newCachedThreadPool ( ) ) ; try { RemoteChannelProxyControllerTestCase . channels = new RemoteChannelPairSetup ( ) ; RemoteChannelProxyControllerTestCase . channels . setupRemoting ( operationHandler ) ; RemoteChannelProxyControllerTestCase . channels . startChannels ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } final Channel clientChannel = RemoteChannelProxyControllerTestCase . channels . getClientChannel ( ) ; final RemoteProxyController proxyController = RemoteProxyController . create ( RemoteChannelProxyControllerTestCase . channels . getExecutorService ( ) , proxyNodeAddress , SERVER , RemoteChannelProxyControllerTestCase . channels . getClientChannel ( ) ) ; clientChannel . addCloseHandler ( new org . jboss . remoting3 . CloseHandler < Channel > ( ) { @ Override public void handleClose ( Channel closed , IOException exception ) { <START_BUG> proxyController . shutdown ( ) ; <END_BUG> } } ) ; clientChannel . receiveMessage ( ManagementChannelReceiver . createDelegating ( proxyController ) ) ; return proxyController ; } }

Fix:
proxyController . shutdownNow ( ) ;
Buggy code:
public class ConfigurableRetriesFailureHandler implements IMassageFailureHandler { public static final Logger LOG = LoggerFactory . getLogger ( ConfigurableRetriesFailureHandler . class ) ; ConcurrentSkipListMap < Long , Integer > failed ; ConcurrentSkipListMap < Long , Integer > pending ; long numberFailed ; long maxOffsetBehind ; int _retriesNumber ; PartitionManager _pm ; public ConfigurableRetriesFailureHandler ( PartitionManager pm , int retriesNumber ) { } @ Override public long getOffset ( Long expectedOffset ) { <START_BUG> return ! ( failed . isEmpty ( ) ) ? failed . entrySet ( ) . iterator ( ) . next ( ) . getKey ( ) : - 1 ; <END_BUG> } @ Override public boolean isOffsetFailed ( long offset ) { } @ Override public void startMessageProcessing ( MessageAndOffset enrichedMessage ) { } @ Override public void fail ( Long offset ) throws RuntimeException { } @ Override public void ack ( Long offset ) { } }

Fix:
return ! ( failed . isEmpty ( ) ) ? failed . entrySet ( ) . iterator ( ) . next ( ) . getKey ( ) : expectedOffset ;
Buggy code:
public class MainActivity extends Activity { PurchaseHistory purchaseHistory = new PurchaseHistory ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; final TextView dollarTextView = ( ( TextView ) ( findViewById ( dollarTextView ) ) ) ; final EditText amountText = ( ( EditText ) ( findViewById ( amountEditText ) ) ) ; Button undoButton = ( ( Button ) ( findViewById ( undobutton ) ) ) ; final IOManager io = new IOManager ( getApplicationContext ( ) ) ; purchaseHistory = io . load ( ) ; dollarTextView . setText ( String . format ( "$%.2f" , purchaseHistory . getCurrentSum ( ) . getAmount ( ) ) ) ; amountText . setOnEditorActionListener ( new OnEditorActionListener ( ) { @ Override public boolean onEditorAction ( TextView v , int actionId , KeyEvent event ) { try { String amount = amountText . getText ( ) . toString ( ) ; float floatAmount = Float . parseFloat ( amount ) ; purchaseHistory . add ( floatAmount ) ; <START_BUG> dollarTextView . setText ( String . format ( "%.2f" , purchaseHistory . getCurrentSum ( ) . getAmount ( ) ) ) ; <END_BUG> amountText . setText ( "" ) ; io . save ( purchaseHistory ) ; } catch ( NumberFormatException e ) { Toast . makeText ( getBaseContext ( ) , "Invalid<seq2seq4repair_space>Entry" , LENGTH_SHORT ) . show ( ) ; amountText . setText ( "" ) ; } return false ; } } ) ; undoButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( ! ( purchaseHistory . undo ( ) ) ) { Toast . makeText ( getBaseContext ( ) , "Nothing<seq2seq4repair_space>to<seq2seq4repair_space>undo" , LENGTH_SHORT ) . show ( ) ; } else { dollarTextView . setText ( String . format ( "%.2f" , purchaseHistory . getCurrentSum ( ) . getAmount ( ) ) ) ; io . save ( purchaseHistory ) ; } } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
dollarTextView . setText ( String . format ( "$%.2f" , purchaseHistory . getCurrentSum ( ) . getAmount ( ) ) ) ;
Buggy code:
class ConstructorSignatureImpl extends CodeSignatureImpl implements ConstructorSignature { ConstructorSignatureImpl ( int modifiers , Class declaringType , Class [ ] parameterTypes , String [ ] parameterNames , Class [ ] exceptionTypes ) { } ConstructorSignatureImpl ( String stringRep ) { } public String getName ( ) { } String toString ( StringMaker sm ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( sm . makeModifiersString ( getModifiers ( ) ) ) ; <START_BUG> buf . append ( sm . makePrimaryTypeName ( getDeclaringType ( ) ) ) ; <END_BUG> sm . addSignature ( buf , getParameterTypes ( ) ) ; sm . addThrows ( buf , getExceptionTypes ( ) ) ; return buf . toString ( ) ; } }

Fix:
buf . append ( sm . makePrimaryTypeName ( getDeclaringType ( ) , getDeclaringTypeName ( ) ) ) ;