nus-yam/ex-repair huggingface dataset:
Buggy code:
public final class Compatibility { public static double PI = Math . PI ; static double toRadians = ( Compatibility . PI ) // 180 ; public static int cos ( int angle , int length ) { } public static int sin ( int angle , int length ) { } public static int ceil ( int p , int q ) { } public static int floor ( int p , int q ) { } public static int round ( int p , int q ) { } public static int pow2 ( int n ) { } public static OutputStream newDeflaterOutputStream ( OutputStream stream ) throws IOException { } public static InputStream newFileInputStream ( String filename ) throws IOException { } public static OutputStream newFileOutputStream ( String filename ) throws IOException { } public static InputStream newInflaterInputStream ( InputStream stream ) throws IOException { <START_BUG> return new InflaterInputStream ( stream ) ; <END_BUG> } public static boolean isLetter ( char c ) { } public static boolean isLetterOrDigit ( char c ) { } public static boolean isSpaceChar ( char c ) { } public static boolean isWhitespace ( char c ) { } public static void exec ( String prog ) throws IOException { } public static void exec ( String [ ] progArray ) throws IOException { } private static ResourceBundle msgs = null ; public static String getMessage ( String key ) { } public static String getMessage ( String key , Object [ ] args ) { } public static void interrupt ( ) { } public static boolean equalsIgnoreCase ( String s1 , String s2 ) { } }

Fix:
return new BufferedInputStream ( new InflaterInputStream ( stream ) ) ;
Buggy code:
public class Java15PointcutExpressionTest extends TestCase { public static Test suite ( ) { } private PointcutParser parser ; private Method a ; private Method b ; private Method c ; public void testAtThis ( ) { } public void testAtTarget ( ) { } public void testAtThisWithBinding ( ) { } public void testAtTargetWithBinding ( ) { } public void testAtArgs ( ) { } public void testAtArgsWithBinding ( ) { } public void testAtWithin ( ) { } public void testAtWithinWithBinding ( ) { } public void testAtWithinCode ( ) { } public void testAtWithinCodeWithBinding ( ) { } public void testAtAnnotation ( ) { } public void testAtAnnotationWithBinding ( ) { } public void testReferencePointcutNoParams ( ) { } public void testReferencePointcutParams ( ) { } public void testExecutionWithClassFileRetentionAnnotation ( ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> parser = new PointcutParser ( ) ; <END_BUG> a = Java15PointcutExpressionTest . A . class . getMethod ( "a" ) ; b = Java15PointcutExpressionTest . B . class . getMethod ( "b" ) ; c = Java15PointcutExpressionTest . B . class . getMethod ( "c" , new Class [ ] { Java15PointcutExpressionTest . A . class , Java15PointcutExpressionTest . B . class } ) ; } @ Retention ( RetentionPolicy . RUNTIME ) private @ interface MyAnnotation { } private @ interface MyClassFileRetentionAnnotation { } private static class A { @ Java15PointcutExpressionTest . MyAnnotation public void a ( ) { } } @ Java15PointcutExpressionTest . MyAnnotation private static class B { @ Java15PointcutExpressionTest . MyClassFileRetentionAnnotation public void b ( ) { } public void c ( Java15PointcutExpressionTest . A anA , Java15PointcutExpressionTest . B aB ) { } } private static class C { @ Pointcut ( "execution(*<seq2seq4repair_space>*(..))" ) public void foo ( ) { } @ Pointcut ( value = "execution(*<seq2seq4repair_space>*(..))<seq2seq4repair_space>&&<seq2seq4repair_space>this(x)" , argNames = "x" ) public void goo ( Java15PointcutExpressionTest . A x ) { } } }

Fix:
parser = PointcutParser . getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution ( this . getClass ( ) . getClassLoader ( ) ) ;
Buggy code:
public class ModuleController extends GenericController implements ReplaceableController { private static final String NODE_PATH = "ModuleController.node_path" ; private JMeterTreeNode selectedNode = null ; public ModuleController ( ) { } public Object clone ( ) { } public TestElement getReplacement ( ) { if ( ( selectedNode ) != null ) { <START_BUG> return selectedNode . createTestElement ( ) ; <END_BUG> } else { return this ; } } public void setSelectedNode ( JMeterTreeNode tn ) { } public JMeterTreeNode getSelectedNode ( ) { } private void setNodePath ( ) { } private Vector getNodePath ( ) { } private void restoreSelected ( ) { } private void traverse ( JMeterTreeNode node , Vector nodePath ) { } public void replace ( HashTree tree ) { } private void createSubTree ( HashTree tree , JMeterTreeNode node ) { } private static JMeterTreeNode cloneTreeNode ( JMeterTreeNode node ) { } private static void cloneChildren ( JMeterTreeNode to , JMeterTreeNode from ) { } }

Fix:
return selectedNode . getTestElement ( ) ;
Buggy code:
public class ExpandableEventListAdapter extends BaseExpandableListAdapter { private final SparseArray < EventGroup > eventGroups ; private LayoutInflater inflater ; private class EventHolder { public TextView dateView ; public TextView typeView ; public TextView nameView ; } public ExpandableEventListAdapter ( Activity activity , SparseArray < EventGroup > eventGroups ) { } @ Override public View getChildView ( int groupPosition , int childPosition , boolean isLastChild , View convertView , ViewGroup parent ) { } private boolean isCurrentlyRunning ( Event event ) { } private String formatEventDate ( Calendar date ) { } @ Override public boolean isChildSelectable ( int groupPosition , int childPosition ) { } @ Override public int getGroupCount ( ) { } @ Override public View getGroupView ( int groupPosition , boolean isExpanded , View convertView , ViewGroup parent ) { } private String formatGroupDate ( Calendar date ) { <START_BUG> SimpleDateFormat sdf = new SimpleDateFormat ( "EEE<seq2seq4repair_space>dd.MM.yyyyy" ) ; <END_BUG> return sdf . format ( date . getTime ( ) ) ; } @ Override public long getChildId ( int groupPosition , int childPosition ) { } @ Override public boolean hasStableIds ( ) { } @ Override public Object getChild ( int groupPosition , int childPosition ) { } @ Override public long getGroupId ( int groupPosition ) { } @ Override public Object getGroup ( int groupPosition ) { } @ Override public int getChildrenCount ( int groupPosition ) { } public int findTodayGroup ( ) { } }

Fix:
SimpleDateFormat sdf = new SimpleDateFormat ( "EEE<seq2seq4repair_space>dd.MM.yyyy" ) ;
Buggy code:
public abstract class BasePropertySource implements PropertySource { private static final Logger LOG = Logger . getLogger ( BasePropertySource . class . getName ( ) ) ; private int ordinal = DefaultOrdinal . PROPERTY_SOURCE ; @ Override public int getOrdinal ( ) { } @ Override public String get ( String key ) { } protected void initializeOrdinal ( final int defaultOrdinal ) { this . ordinal = defaultOrdinal ; String ordinal = get ( TAMAYA_ORDINAL ) ; if ( ordinal != null ) { try { <START_BUG> this . ordinal = Integer . valueOf ( ordinal ) ; <END_BUG> } catch ( NumberFormatException e ) { BasePropertySource . LOG . log ( Level . WARNING , "Specified<seq2seq4repair_space>{0}<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>Integer<seq2seq4repair_space>value:<seq2seq4repair_space>{1}<seq2seq4repair_space>-<seq2seq4repair_space>using<seq2seq4repair_space>defaultOrdinal<seq2seq4repair_space>{2}" , new Object [ ] { PropertySource . TAMAYA_ORDINAL , ordinal , defaultOrdinal } ) ; } } } }

Fix:
this . ordinal = Integer . parseInt ( ordinal ) ;
Buggy code:
public class LedBargraphSkin extends SkinBase < LedBargraph , LedBargraphBehavior > { public static final long PEAK_TIMEOUT = 1500000000L ; private LedBargraph control ; private boolean isDirty ; private boolean initialized ; private Group bargraph ; private List < Led > ledList ; private long lastTimerCall ; private DoubleProperty stepSize ; private int peakLedIndex ; private AnimationTimer timer ; public LedBargraphSkin ( final LedBargraph CONTROL ) { } private void init ( ) { } public final void paint ( ) { } @ Override protected void handleControlPropertyChanged ( final String PROPERTY ) { } @ Override public void layoutChildren ( ) { } @ Override public final LedBargraph getSkinnable ( ) { } @ Override public final void dispose ( ) { } @ Override protected double computePrefWidth ( final double PREF_WIDTH ) { } @ Override protected double computePrefHeight ( final double PREF_HEIGHT ) { } private final void setLedColors ( ) { } private final void setLedTypes ( ) { } private final void drawLed ( ) { final double SIZE = ( ( control . getPrefWidth ( ) ) < ( control . getPrefHeight ( ) ) ) ? control . getPrefWidth ( ) : control . getPrefHeight ( ) ; final double WIDTH = SIZE ; final double HEIGHT = SIZE ; bargraph . getChildren ( ) . clear ( ) ; final Shape IBOUNDS = new Rectangle ( 0 , 0 , WIDTH , HEIGHT ) ; IBOUNDS . setOpacity ( 0.0 ) ; bargraph . getChildren ( ) . add ( IBOUNDS ) ; if ( ( control . getOrientation ( ) ) == ( Orientation . VERTICAL ) ) { VBox pane = new VBox ( ) ; pane . setSpacing ( 0 ) ; pane . setPadding ( new Insets ( 0 , 0 , 0 , 0 ) ) ; for ( int i = 0 ; i < ( control . getNoOfLeds ( ) ) ; i ++ ) { <START_BUG> pane . getChildren ( ) . add ( i , ledList . get ( ( 15 - i ) ) ) ; <END_BUG> } bargraph . getChildren ( ) . add ( pane ) ; } else { HBox pane = new HBox ( ) ; pane . setSpacing ( 0 ) ; pane . setPadding ( new Insets ( 0 , 0 , 0 , 0 ) ) ; for ( int i = 0 ; i < ( control . getNoOfLeds ( ) ) ; i ++ ) { pane . getChildren ( ) . add ( i , ledList . get ( i ) ) ; } bargraph . getChildren ( ) . add ( pane ) ; } } }

Fix:
pane . getChildren ( ) . add ( i , ledList . get ( ( ( control . getNoOfLeds ( ) ) - i ) ) ) ;
Buggy code:
public class SongScheduler { private static final Logger log = LogManager . getLogger ( SongScheduler . class ) ; public void init ( ServletContext context ) { try { Scheduler scheduler = StdSchedulerFactory . getDefaultScheduler ( ) ; scheduler . start ( ) ; <START_BUG> String firstSongId = "ZtFUX4Y2U84" ; <END_BUG> Songs songList = Utils . getSongs ( context ) ; Song firstSong = songList . getSong ( firstSongId ) ; Date triggerTime = DateBuilder . futureDate ( firstSong . getDuration ( ) , SECOND ) ; JobDataMap data = new JobDataMap ( ) ; data . put ( "triggerTime" , triggerTime ) ; data . put ( "servletContext" , context ) ; JobDetail job = newJob ( SongChooserJob . class ) . withIdentity ( "SongChooserJob" , "G" ) . usingJobData ( data ) . build ( ) ; Trigger trigger = TriggerBuilder . newTrigger ( ) . withIdentity ( "SongChooserTrigger" , "G" ) . startAt ( triggerTime ) . build ( ) ; scheduler . scheduleJob ( job , trigger ) ; SongScheduler . log . debug ( ( "Scheduled<seq2seq4repair_space>job<seq2seq4repair_space>with<seq2seq4repair_space>init<seq2seq4repair_space>triggerTime:<seq2seq4repair_space>" + triggerTime ) ) ; context . setAttribute ( SCHEDULER , scheduler ) ; } catch ( SchedulerException se ) { se . printStackTrace ( ) ; } } public static void destroyScheduler ( Scheduler scheduler ) { } public static int getElapsedTime ( Scheduler scheduler ) { } }

Fix:
String firstSongId = "vdB-8eLEW8g" ;
Buggy code:
public class RedirectRequestTarget implements IRequestTarget { private final String redirectUrl ; public RedirectRequestTarget ( String redirectUrl ) { } public void detach ( RequestCycle requestCycle ) { } public void respond ( RequestCycle requestCycle ) { Response response = requestCycle . getResponse ( ) ; response . reset ( ) ; if ( redirectUrl . startsWith ( "//" ) ) { RequestContext rc = RequestContext . get ( ) ; String continueTo = null ; if ( ( rc . isPortletRequest ( ) ) && ( ( ( org . apache . wicket . protocol . http . portlet . PortletRequestContext ) ( rc ) ) . isEmbedded ( ) ) ) { response . redirect ( redirectUrl ) ; } else { String location = RequestCycle . get ( ) . getProcessor ( ) . getRequestCodingStrategy ( ) . rewriteStaticRelativeUrl ( redirectUrl . substring ( 1 ) ) ; <START_BUG> if ( location . startsWith ( ".//" ) ) { <END_BUG> location = location . substring ( 2 ) ; } response . redirect ( location ) ; } } else if ( redirectUrl . contains ( ":////" ) ) { response . redirect ( redirectUrl ) ; } else { response . redirect ( ( ( RequestCycle . get ( ) . getRequest ( ) . getRelativePathPrefixToWicketHandler ( ) ) + ( redirectUrl ) ) ) ; } } }

Fix:
if ( ( location . startsWith ( ".//" ) ) && ( ( location . length ( ) ) > 2 ) ) {
Buggy code:
public abstract class MergedObjectiveFunction extends BaseObjectiveFunction { BaseObjectiveFunction [ ] components ; public MergedObjectiveFunction ( InstrumentCalculator calculator , TuningInterface tuning , EvaluatorInterface evaluator ) { } protected void sumDimensions ( ) { nrDimensions = 0 ; for ( BaseObjectiveFunction component : components ) { nrDimensions += component . getNrDimensions ( ) ; } if ( ( ( nrDimensions ) == 1 ) && ( ( optimizerType ) == ( OptimizerType . BOBYQAOptimizer ) ) ) { <START_BUG> optimizerType = OptimizerType . CMAESOptimizer ; <END_BUG> } setConstraints ( ) ; } @ Override public double [ ] getGeometryPoint ( ) { } @ Override public void setGeometryPoint ( double [ ] point ) { } @ Override public void setLowerBounds ( double [ ] lowerBounds ) { } @ Override public void setUpperBounds ( double [ ] upperBounds ) { } protected void setConstraints ( ) { } }

Fix:
optimizerType = OptimizerType . BrentOptimizer ;
Buggy code:
public abstract class Movement { private final Board resultingBoard ; protected final Coord from ; protected final Coord to ; public Movement ( Board resultingBoard , Coord from , Coord to ) { } public Board getResultingBoard ( ) { } public Coord getFrom ( ) { } public Coord getTo ( ) { } @ Override public boolean equals ( Object o ) { if ( ( this ) == o ) return true ; if ( ( o == null ) || ( ( getClass ( ) ) != ( o . getClass ( ) ) ) ) return false ; <START_BUG> Castling m = ( ( Castling ) ( o ) ) ; <END_BUG> return ( ( m . from ) == ( from ) ) && ( ( m . to ) == ( to ) ) ; } @ Override public int hashCode ( ) { } }

Fix:
Movement m = ( ( Movement ) ( o ) ) ;
Buggy code:
public class displayNames { public static void main ( String [ ] names ) { System . out . println ( "\n\t===============================================================" ) ; <START_BUG> System . out . println ( "\tHere<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>ist<seq2seq4repair_space>of<seq2seq4repair_space>players<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>game" ) ; <END_BUG> for ( int i = 0 ; i < ( names . length ) ; i ++ ) { if ( ( names [ i ] ) == null ) { break ; } int namePosition = i + 1 ; System . out . println ( ( ( ( "\t<seq2seq4repair_space>" + namePosition ) + "\t" ) + ( names [ i ] ) ) ) ; } System . out . println ( "\t===============================================================\n" ) ; } }

Fix:
System . out . println ( "\tHere<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>players<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>game" ) ;
Buggy code:
@ Service ( "AnswerServiceImpl" ) public class AnswerServiceImpl implements AnswerService { @ Autowired private AnswerRepository answerRepository ; @ Override public Answer addAnswer ( Answer answer ) { } @ Override public void delete ( Long id ) { } @ Override public Answer getById ( Long id ) { <START_BUG> return answerRepository . getOne ( id ) ; <END_BUG> } @ Override public Answer editAnswer ( Answer answer ) { } @ Override public List < Answer > getAll ( ) { } @ Override public List < Answer > findByIdQuestion ( Long id ) { } }

Fix:
return answerRepository . findOne ( id ) ;
Buggy code:
@ Component ( "HblAdmin" ) @ Scope ( BeanDefinition . SCOPE_PROTOTYPE ) public class HblAdmin { private static final Logger s_log = Logger . getLogger ( HblAdmin . class ) ; public static final String HBL_METRIC_FAMILY_STR = "hbl" ; public static final byte [ ] HBL_METRIC_FAMILY = Bytes . toBytes ( HblAdmin . HBL_METRIC_FAMILY_STR ) ; public static final String HBL_DEFAULT_SYSTEM_TABLE_STR = "HBL_SYSTEM" ; public static final byte [ ] HBL_DEFAULT_SYSTEM_TABLE = Bytes . toBytes ( HblAdmin . HBL_DEFAULT_SYSTEM_TABLE_STR ) ; public static final String HBL_SYSTEM_FAMILY_STR = "hbl_system" ; public static final byte [ ] HBL_SYSTEM_FAMILY = Bytes . toBytes ( HblAdmin . HBL_SYSTEM_FAMILY_STR ) ; public static final String HBL_MODEL_KEY_STR = "MODEL" ; public static final byte [ ] HBL_MODEL_KEY = Bytes . toBytes ( HblAdmin . HBL_MODEL_KEY_STR ) ; private byte [ ] systemTable = HblAdmin . HBL_DEFAULT_SYSTEM_TABLE ; private Resource cubeModel ; private String cubeModelYamlStr ; private Cube cube ; public HblAdmin ( String modelName , Configuration conf ) throws IOException { } public HblAdmin ( Resource cubeModel ) throws IOException { } public HblAdmin ( ) { } public Resource getCubeModel ( ) { } public void setCubeModel ( Resource cubeModel ) { } public String getCubeModelYamlStr ( ) { } public Cube getCube ( ) { } @ PostConstruct public void init ( ) throws IOException { } public void dropCube ( Configuration conf ) throws IOException { } public void deployCube ( Configuration conf ) throws IOException { } public void saveModel ( Configuration conf ) throws IOException { } private void initCuboid ( HBaseAdmin admin , Cuboid c ) throws IOException { } private void saveModel ( HBaseAdmin admin , Configuration conf ) throws IOException { if ( ! ( admin . tableExists ( systemTable ) ) ) { HTableDescriptor htd = new HTableDescriptor ( systemTable ) ; HColumnDescriptor hcd = new HColumnDescriptor ( HblAdmin . HBL_SYSTEM_FAMILY ) ; hcd . setMaxVersions ( 10 ) ; hcd . setInMemory ( true ) ; hcd . setTimeToLive ( Integer . MAX_VALUE ) ; htd . addFamily ( hcd ) ; admin . createTable ( htd ) ; } <START_BUG> HTable stable = new HTable ( systemTable ) ; <END_BUG> Put put = new Put ( HblAdmin . HBL_MODEL_KEY ) . add ( HblAdmin . HBL_SYSTEM_FAMILY , Bytes . toBytes ( cube . getName ( ) ) , Bytes . toBytes ( cubeModelYamlStr ) ) ; stable . put ( put ) ; } private void dropCuboid ( HBaseAdmin admin , Cuboid c ) throws IOException { } public static Resource readModelFromHBase ( Configuration conf , String modelName , byte [ ] systemTable ) throws IOException { } }

Fix:
HTable stable = new HTable ( conf , systemTable ) ;
Buggy code:
public class RenderAsXPath implements ActionListener , ResultRenderer { private static final Logger logger = LoggingManager . getLoggerForClass ( ) ; private static final String XPATH_TESTER_COMMAND = "xpath_tester" ; private JPanel xmlWithXPathPane ; private JTextArea xmlDataField ; private JLabeledTextField xpathExpressionField ; private JTextArea xpathResultField ; private JTabbedPane rightSide ; private SampleResult sampleResult = null ; private JScrollPane xmlDataPane ; private final JCheckBox getFragment = new JCheckBox ( JMeterUtils . getResString ( "xpath_tester_fragment" ) ) ; private final XMLConfPanel xmlConfPanel = new XMLConfPanel ( ) ; @ Override public void clearData ( ) { } @ Override public void init ( ) { } @ Override public void actionPerformed ( ActionEvent e ) { } private void executeAndShowXPathTester ( String textToParse , XPathExtractor extractor ) { } private String process ( String textToParse , XPathExtractor extractor ) { } private Document parseResponse ( String unicodeData , XPathExtractor extractor ) throws IOException , UnsupportedEncodingException , ParserConfigurationException , TidyException , SAXException { } @ Override public void renderResult ( SampleResult sampleResult ) { String response = ViewResultsFullVisualizer . getResponseAsString ( sampleResult ) ; try { <START_BUG> xmlDataField . setText ( ( response == null ? "" : XPathUtil . formatXml ( response ) ) ) ; <END_BUG> xmlDataField . setCaretPosition ( 0 ) ; } catch ( Exception e ) { RenderAsXPath . logger . error ( ( ( ( "Exception<seq2seq4repair_space>converting<seq2seq4repair_space>to<seq2seq4repair_space>XML:" + response ) + ",<seq2seq4repair_space>message:" ) + ( e . getMessage ( ) ) ) , e ) ; xmlDataField . setText ( ( ( ( "Exception<seq2seq4repair_space>converting<seq2seq4repair_space>to<seq2seq4repair_space>XML:" + response ) + ",<seq2seq4repair_space>message:" ) + ( e . getMessage ( ) ) ) ) ; xmlDataField . setCaretPosition ( 0 ) ; } } @ Override public String toString ( ) { } @ Override public void setupTabPane ( ) { } private JPanel createXpathExtractorPanel ( ) { } private JPanel createXpathExtractorTasksPanel ( ) { } @ Override public synchronized void setRightSide ( JTabbedPane side ) { } @ Override public synchronized void setSamplerResult ( Object userObject ) { } @ Override public void setLastSelectedTab ( int index ) { } @ Override public void renderImage ( SampleResult sampleResult ) { } @ Override public void setBackgroundColor ( Color backGround ) { } }

Fix:
xmlDataField . setText ( ( response == null ? "" : response ) ) ;
Buggy code:
public class HypergeometricDistribution extends AbstractIntegerDistribution { private static final long serialVersionUID = - 436928820673516179L ; private final int numberOfSuccesses ; private final int populationSize ; private final int sampleSize ; private double numericalVariance = Double . NaN ; private boolean numericalVarianceIsCalculated = false ; public HypergeometricDistribution ( int populationSize , int numberOfSuccesses , int sampleSize ) throws NotPositiveException , NotStrictlyPositiveException , NumberIsTooLargeException { } public HypergeometricDistribution ( RandomGenerator rng , int populationSize , int numberOfSuccesses , int sampleSize ) throws NotPositiveException , NotStrictlyPositiveException , NumberIsTooLargeException { } public double cumulativeProbability ( int x ) { } private int [ ] getDomain ( int n , int m , int k ) { } private int getLowerDomain ( int n , int m , int k ) { } public int getNumberOfSuccesses ( ) { } public int getPopulationSize ( ) { } public int getSampleSize ( ) { } private int getUpperDomain ( int m , int k ) { } public double probability ( int x ) { } public double upperCumulativeProbability ( int x ) { } private double innerCumulativeProbability ( int x0 , int x1 , int dx ) { } public double getNumericalMean ( ) { <START_BUG> return ( ( double ) ( ( getSampleSize ( ) ) * ( getNumberOfSuccesses ( ) ) ) ) // ( ( double ) ( getPopulationSize ( ) ) ) ; <END_BUG> } public double getNumericalVariance ( ) { } protected double calculateNumericalVariance ( ) { } public int getSupportLowerBound ( ) { } public int getSupportUpperBound ( ) { } public boolean isSupportConnected ( ) { } }

Fix:
return ( getSampleSize ( ) ) * ( ( getNumberOfSuccesses ( ) ) // ( ( double ) ( getPopulationSize ( ) ) ) ) ;
Buggy code:
public class JavascriptConfigService implements Startable { private final Logger log = LoggerFactory . getLogger ( JavascriptConfigService . class ) ; private Collection < String > availableScripts_ ; private Collection < String > availableScriptsPaths_ ; private List < Javascript > availableScriptsKey_ ; private String mergedJavascript = "" ; private HashMap < String , String > extendedJavascripts ; private byte [ ] jsBytes = null ; private long lastModified = Long . MAX_VALUE ; private JavascriptDeployer deployer ; private JavascriptRemoval removal ; private ResourceCompressor compressor ; private Map < String , List < String > > object_view_of_merged_JS ; public JavascriptConfigService ( ExoContainerContext context , ResourceCompressor compressor ) { } public Collection < String > getAvailableScripts ( ) { } public Collection < String > getAvailableScriptsPaths ( ) { } public synchronized void addExtendedJavascript ( String module , String scriptPath , ServletContext scontext , String scriptData ) { } public synchronized void addJavascripts ( List < Javascript > jsKeys ) { } private void addJavascript ( Javascript javascript ) { } public synchronized void remove ( ServletContext context ) { } public synchronized void removeJavascript ( Javascript script ) { } public void refreshMergedJavascript ( ) { } public void writeMergedJavascript ( OutputStream out ) throws IOException { } public byte [ ] getMergedJavascript ( ) { if ( ( jsBytes ) == null ) { StringBuffer allJavascript = new StringBuffer ( ) ; allJavascript . append ( mergedJavascript ) ; for ( String script : extendedJavascripts . values ( ) ) { allJavascript . append ( script ) ; } String s = allJavascript . toString ( ) ; byte [ ] bytes ; try { bytes = s . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new AssertionError ( "No<seq2seq4repair_space>access<seq2seq4repair_space>to<seq2seq4repair_space>UTF-8,<seq2seq4repair_space>e" ) ; } try { Reader input = new StringReader ( s ) ; StringWriter output = new StringWriter ( ) ; compressor . compress ( input , output , JAVASCRIPT ) ; jsBytes = output . toString ( ) . getBytes ( ) ; } catch ( Exception e ) { <START_BUG> log . error ( "Error<seq2seq4repair_space>when<seq2seq4repair_space>generating<seq2seq4repair_space>minified<seq2seq4repair_space>javascript,<seq2seq4repair_space>will<seq2seq4repair_space>use<seq2seq4repair_space>normal<seq2seq4repair_space>javascript<seq2seq4repair_space>instead" , e ) ; <END_BUG> jsBytes = bytes ; } lastModified = ( ( new Date ( ) . getTime ( ) ) // 1000 ) * 1000 ; } return jsBytes ; } public long getLastModified ( ) { } public boolean isModuleLoaded ( CharSequence module ) { } public void removeExtendedJavascript ( String module , String scriptPath , ServletContext scontext ) { } public void start ( ) { } public void stop ( ) { } }

Fix:
log . warn ( "Error<seq2seq4repair_space>when<seq2seq4repair_space>generating<seq2seq4repair_space>minified<seq2seq4repair_space>javascript,<seq2seq4repair_space>will<seq2seq4repair_space>use<seq2seq4repair_space>normal<seq2seq4repair_space>javascript<seq2seq4repair_space>instead" , e ) ;
Buggy code:
public class FormValidator { String pattern = null ; Matcher matcher = null ; Pattern replace = null ; SimpleDateFormat ft = new SimpleDateFormat ( "dd.MM.YYYY<seq2seq4repair_space>HH:mm" ) ; public boolean checkName ( int lenghtName , String name ) { } public boolean checkSurename ( int lenghtSurmame , String surmame ) { } public boolean checkPesel ( int getLenghtPesel , String pesel ) { } public boolean checkPrice ( int lenghtPrice , String price ) { } public boolean checkWeight ( int lengthWeigh , String weight ) { } public boolean checkIMEI ( int IMEI ) { } public boolean checkValue ( int lengthValue , String value , int ... flag ) { int flagValue = 0 ; if ( ( flag . length ) > 0 ) { flagValue = flag [ 0 ] ; } if ( lengthValue > 0 ) { pattern = "[(\\d*)[.]?\\d{1,2}]{1,8}" ; replace = Pattern . compile ( pattern ) ; matcher = replace . matcher ( value ) ; if ( ( matcher . matches ( ) ) == false ) { <START_BUG> JOptionPane . showMessageDialog ( null , "Podana<seq2seq4repair_space>kwota<seq2seq4repair_space>jest<seq2seq4repair_space>za<seq2seq4repair_space>duża." , "Nieprawidłowa<seq2seq4repair_space>warotśc!" , JOptionPane . ERROR_MESSAGE ) ; <END_BUG> } return matcher . matches ( ) ; } else if ( flagValue != 1 ) { JOptionPane . showMessageDialog ( null , ( "Pole<seq2seq4repair_space>wartoś<seq2seq4repair_space>lub<seq2seq4repair_space>łączna<seq2seq4repair_space>wartość<seq2seq4repair_space>posiada<seq2seq4repair_space>nieprawidłowe" + "<seq2seq4repair_space>wartości<seq2seq4repair_space>lub<seq2seq4repair_space>jest<seq2seq4repair_space>puste." ) , "Nieprawidłowa<seq2seq4repair_space>warotśc!" , JOptionPane . ERROR_MESSAGE ) ; } return false ; } public boolean checkJaweryElements ( String Jawery ) { } public boolean checkCreditFinishDate ( Date curretDate , Date selectedDate ) { } public String checkCountryCode ( String number ) { } public boolean checkLenghtnumber ( String number ) { } }

Fix:
JOptionPane . showMessageDialog ( null , "Podana<seq2seq4repair_space>kwota<seq2seq4repair_space>jest<seq2seq4repair_space>niepoprawna." , "Nieprawidłowa<seq2seq4repair_space>warotśc!" , JOptionPane . ERROR_MESSAGE ) ;
Buggy code:
public class UnboundedQueueThreadPoolMetricsHandler extends ThreadPoolMetricsHandler { public static final List < AttributeDefinition > METRICS = Arrays . asList ( ACTIVE_COUNT , COMPLETED_TASK_COUNT , CURRENT_THREAD_COUNT , LARGEST_THREAD_COUNT , REJECTED_COUNT , TASK_COUNT , QUEUE_SIZE ) ; public UnboundedQueueThreadPoolMetricsHandler ( final ServiceName serviceNameBase ) { } @ Override protected void setResult ( OperationContext context , final String attributeName , final Service < ? > service ) throws OperationFailedException { final UnboundedQueueThreadPoolService pool = ( ( UnboundedQueueThreadPoolService ) ( service ) ) ; if ( attributeName . equals ( CommonAttributes . ACTIVE_COUNT ) ) { context . getResult ( ) . set ( pool . getActiveCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . COMPLETED_TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getCompletedTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . CURRENT_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getCurrentThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . LARGEST_THREAD_COUNT ) ) { context . getResult ( ) . set ( pool . getLargestThreadCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . REJECTED_COUNT ) ) { context . getResult ( ) . set ( pool . getRejectedCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . TASK_COUNT ) ) { context . getResult ( ) . set ( pool . getTaskCount ( ) ) ; } else if ( attributeName . equals ( CommonAttributes . QUEUE_SIZE ) ) { context . getResult ( ) . set ( pool . getQueueSize ( ) ) ; } else { <START_BUG> throw MESSAGES . unsupportedUnboundedQueueThreadPoolMetric ( attributeName ) ; <END_BUG> } } }

Fix:
throw ROOT_LOGGER . unsupportedUnboundedQueueThreadPoolMetric ( attributeName ) ;
Buggy code:
public class MethodDeclaration extends AbstractMethodDeclaration { public TypeReference returnType ; public TypeParameter [ ] typeParameters ; public MethodDeclaration ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext initializationContext , FlowInfo flowInfo ) { if ( ignoreFurtherInvestigation ) return ; try { if ( ( binding ) == null ) return ; if ( ( ! ( this . binding . isUsed ( ) ) ) && ( ( this . binding . isPrivate ( ) ) || ( ( ( ( this . binding . modifiers ) & ( ( ExtraCompilerModifiers . AccOverriding ) | ( ExtraCompilerModifiers . AccImplementing ) ) ) == 0 ) && ( this . binding . declaringClass . isLocalType ( ) ) ) ) ) { if ( ! ( classScope . referenceCompilationUnit ( ) . compilationResult . hasSyntaxError ) ) { scope . problemReporter ( ) . unusedPrivateMethod ( this ) ; } } if ( ( binding . declaringClass . isEnum ( ) ) && ( ( ( this . selector ) == ( TypeConstants . VALUES ) ) || ( ( this . selector ) == ( TypeConstants . VALUEOF ) ) ) ) return ; if ( ( binding . isAbstract ( ) ) || ( binding . isNative ( ) ) ) return ; ExceptionHandlingFlowContext methodContext = new ExceptionHandlingFlowContext ( initializationContext , this , binding . thrownExceptions , scope , FlowInfo . DEAD_END ) ; if ( ( this . arguments ) != null ) { for ( int i = 0 , count = this . arguments . length ; i < count ; i ++ ) { flowInfo . markAsDefinitelyAssigned ( this . arguments [ i ] . binding ) ; } } if ( ( statements ) != null ) { boolean didAlreadyComplain = false ; for ( int i = 0 , count = statements . length ; i < count ; i ++ ) { Statement stat = statements [ i ] ; if ( ! ( stat . complainIfUnreachable ( flowInfo , scope , didAlreadyComplain ) ) ) { flowInfo = stat . analyseCode ( scope , methodContext , flowInfo ) ; } else { didAlreadyComplain = true ; } } } TypeBinding returnTypeBinding = binding . returnType ; <START_BUG> if ( ( returnTypeBinding == ( VoidBinding ) ) || ( isAbstract ( ) ) ) { <END_BUG> this . needFreeReturn = flowInfo . isReachable ( ) ; } else { if ( flowInfo != ( FlowInfo . DEAD_END ) ) { scope . problemReporter ( ) . shouldReturn ( returnTypeBinding , this ) ; } } methodContext . complainIfUnusedExceptionHandlers ( this ) ; } catch ( org . eclipse . jdt . internal . compiler . problem . AbortMethod e ) { this . ignoreFurtherInvestigation = true ; } } public boolean isMethod ( ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer printReturnType ( int indent , StringBuffer output ) { } public void resolveStatements ( ) { } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { } public TypeParameter [ ] typeParameters ( ) { } }

Fix:
if ( ( returnTypeBinding == ( TypeBinding . VOID ) ) || ( isAbstract ( ) ) ) {
Buggy code:
public class URLRewritingModifier extends AbstractTestElement implements Serializable , PreProcessor { private Pattern pathExtensionEqualsQuestionmarkRegexp ; private Pattern pathExtensionEqualsNoQuestionmarkRegexp ; private Pattern parameterRegexp ; private Pattern pathExtensionNoEqualsQuestionmarkRegexp ; private Pattern pathExtensionNoEqualsNoQuestionmarkRegexp ; private static final String ARGUMENT_NAME = "argument_name" ; private static final String PATH_EXTENSION = "path_extension" ; private static final String PATH_EXTENSION_NO_EQUALS = "path_extension_no_equals" ; private static final String PATH_EXTENSION_NO_QUESTIONMARK = "path_extension_no_questionmark" ; public void process ( ) { } private void modify ( HTTPSamplerBase sampler , String value ) { if ( isPathExtension ( ) ) { if ( isPathExtensionNoEquals ( ) ) { sampler . setPath ( ( ( ( ( sampler . getPath ( ) ) + ";" ) + ( getArgumentName ( ) ) ) + value ) ) ; } else { sampler . setPath ( ( ( ( ( ( sampler . getPath ( ) ) + ";" ) + ( getArgumentName ( ) ) ) + "=" ) + value ) ) ; } } else { sampler . getArguments ( ) . removeArgument ( getArgumentName ( ) ) ; <START_BUG> sampler . getArguments ( ) . addArgument ( new HTTPArgument ( getArgumentName ( ) , value , true ) ) ; <END_BUG> } } public void setArgumentName ( String argName ) { } private void initRegex ( String argName ) { } public String getArgumentName ( ) { } public void setPathExtension ( boolean pathExt ) { } public void setPathExtensionNoEquals ( boolean pathExtNoEquals ) { } public void setPathExtensionNoQuestionmark ( boolean pathExtNoQuestionmark ) { } public boolean isPathExtension ( ) { } public boolean isPathExtensionNoEquals ( ) { } public boolean isPathExtensionNoQuestionmark ( ) { } }

Fix:
sampler . getArguments ( ) . addArgument ( new HTTPArgument ( getArgumentName ( ) , value , false ) ) ;
Buggy code:
public class Canvas extends Composite { Caret caret ; Canvas ( ) { } public Canvas ( Composite parent , int style ) { } public Caret getCaret ( ) { } int kEventControlDraw ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetFocusPart ( int nextHandler , int theEvent , int userData ) { } void redrawWidget ( int control , boolean children ) { } void redrawWidget ( int control , int x , int y , int width , int height , boolean all ) { } void releaseChildren ( boolean destroy ) { if ( ( caret ) != null ) { <START_BUG> caret . releaseChildren ( false ) ; <END_BUG> caret = null ; } super . releaseChildren ( destroy ) ; } public void scroll ( int destX , int destY , int x , int y , int width , int height , boolean all ) { } public void setCaret ( Caret caret ) { } public void setFont ( Font font ) { } }

Fix:
caret . release ( false ) ;
Buggy code:
public class RaStructureProcessor implements DeploymentUnitProcessor { private static final String RAR_EXTENSION = ".rar" ; private static final String JAR_EXTENSION = ".jar" ; private static final SuffixMatchFilter CHILD_ARCHIVE_FILTER = new SuffixMatchFilter ( RaStructureProcessor . JAR_EXTENSION , VisitorAttributes . RECURSE_LEAVES_ONLY ) ; private static Closeable NO_OP_CLOSEABLE = new Closeable ( ) { public void close ( ) throws IOException { } } ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot resourceRoot = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; if ( resourceRoot == null ) { return ; } final VirtualFile deploymentRoot = resourceRoot . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) { return ; } <START_BUG> final String deploymentRootName = deploymentRoot . getName ( ) . toLowerCase ( ) ; <END_BUG> if ( ! ( deploymentRootName . endsWith ( RaStructureProcessor . RAR_EXTENSION ) ) ) { return ; } ModuleRootMarker . mark ( resourceRoot ) ; try { final List < VirtualFile > childArchives = deploymentRoot . getChildren ( RaStructureProcessor . CHILD_ARCHIVE_FILTER ) ; for ( final VirtualFile child : childArchives ) { final Closeable closable = ( child . isFile ( ) ) ? VFS . mountZip ( child , child , TempFileProviderService . provider ( ) ) : RaStructureProcessor . NO_OP_CLOSEABLE ; final MountHandle mountHandle = new MountHandle ( closable ) ; final ResourceRoot childResource = new ResourceRoot ( child , mountHandle ) ; ModuleRootMarker . mark ( resourceRoot ) ; deploymentUnit . addToAttachmentList ( RESOURCE_ROOTS , childResource ) ; resourceRoot . addToAttachmentList ( INDEX_IGNORE_PATHS , child . getPathNameRelativeTo ( deploymentRoot ) ) ; } } catch ( IOException e ) { throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>RA<seq2seq4repair_space>child<seq2seq4repair_space>archives<seq2seq4repair_space>for<seq2seq4repair_space>[" + deploymentRoot ) + "]" ) , e ) ; } } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final String deploymentRootName = deploymentRoot . getLowerCaseName ( ) ;
Buggy code:
public class KidnummerValidator extends StringNumberValidator { public static final String ERROR_LENGTH = "A<seq2seq4repair_space>Kidnummer<seq2seq4repair_space>is<seq2seq4repair_space>between<seq2seq4repair_space>2<seq2seq4repair_space>and<seq2seq4repair_space>25<seq2seq4repair_space>digits" ; private KidnummerValidator ( ) { } public static boolean isValid ( String kidnummer ) { } public static Kidnummer getKidnummer ( String kidnummer ) throws IllegalArgumentException { } protected static StringNumber getObject ( String kidnummer ) throws IllegalArgumentException { } static void validateSyntax ( String kidnummer ) { } private static void validateLengthInRange ( String kidnummer , int i , int j ) { } public static void validateChecksum ( String kidnummer ) { StringNumber k = new Kidnummer ( kidnummer ) ; int kMod10 = calculateMod10CheckSum ( getMod10Weights ( k ) , k ) ; <START_BUG> int kMod11 = calculateMod11CheckSum ( getMod10Weights ( k ) , k ) ; <END_BUG> if ( ( kMod10 != ( k . getChecksumDigit ( ) ) ) && ( kMod11 != ( k . getChecksumDigit ( ) ) ) ) { throw new IllegalArgumentException ( ( ( ERROR_INVALID_CHECKSUM ) + kidnummer ) ) ; } } }

Fix:
int kMod11 = calculateMod11CheckSum ( getMod11Weights ( k ) , k ) ;
Buggy code:
public class XSComplexTypeDecl implements XSComplexTypeDefinition { String fName = null ; String fTargetNamespace = null ; XSTypeDefinition fBaseType = null ; short fDerivedBy = XSConstants . DERIVATION_RESTRICTION ; short fFinal = XSConstants . DERIVATION_NONE ; short fBlock = XSConstants . DERIVATION_NONE ; short fMiscFlags = 0 ; XSAttributeGroupDecl fAttrGrp = null ; short fContentType = CONTENTTYPE_EMPTY ; XSSimpleType fXSSimpleType = null ; XSParticleDecl fParticle = null ; XSCMValidator fCMValidator = null ; XSObjectListImpl fAnnotations = null ; public XSComplexTypeDecl ( ) { } public void setValues ( String name , String targetNamespace , XSTypeDefinition baseType , short derivedBy , short schemaFinal , short block , short contentType , boolean isAbstract , XSAttributeGroupDecl attrGrp , XSSimpleType simpleType , XSParticleDecl particle , XSObjectListImpl annotations ) { } public void setName ( String name ) { } public short getTypeCategory ( ) { } public String getTypeName ( ) { } public short getFinalSet ( ) { } public String getTargetNamespace ( ) { } private static final short CT_IS_ABSTRACT = 1 ; private static final short CT_HAS_TYPE_ID = 2 ; private static final short CT_IS_ANONYMOUS = 4 ; public boolean containsTypeID ( ) { } public void setIsAbstractType ( ) { } public void setContainsTypeID ( ) { } public void setIsAnonymous ( ) { } public synchronized XSCMValidator getContentModel ( CMBuilder cmBuilder ) { } public XSAttributeGroupDecl getAttrGrp ( ) { } public String toString ( ) { } void appendTypeInfo ( StringBuffer str ) { } public boolean derivedFromType ( XSTypeDefinition ancestor , short derivationMethod ) { } public boolean derivedFrom ( String ancestorNS , String ancestorName , short derivationMethod ) { } public void reset ( ) { fName = null ; fTargetNamespace = null ; fBaseType = null ; fDerivedBy = XSConstants . DERIVATION_RESTRICTION ; fFinal = XSConstants . DERIVATION_NONE ; fBlock = XSConstants . DERIVATION_NONE ; fMiscFlags = 0 ; fAttrGrp . reset ( ) ; fContentType = CONTENTTYPE_EMPTY ; fXSSimpleType = null ; fParticle = null ; fCMValidator = null ; if ( ( fAnnotations ) != null ) { <START_BUG> fAnnotations . reset ( ) ; <END_BUG> } fAnnotations = null ; } public short getType ( ) { } public String getName ( ) { } public boolean getAnonymous ( ) { } public String getNamespace ( ) { } public XSTypeDefinition getBaseType ( ) { } public short getDerivationMethod ( ) { } public boolean isFinal ( short derivation ) { } public short getFinal ( ) { } public boolean getAbstract ( ) { } public XSObjectList getAttributeUses ( ) { } public XSWildcard getAttributeWildcard ( ) { } public short getContentType ( ) { } public XSSimpleTypeDefinition getSimpleType ( ) { } public XSParticle getParticle ( ) { } public boolean isProhibitedSubstitution ( short prohibited ) { } public short getProhibitedSubstitutions ( ) { } public XSObjectList getAnnotations ( ) { } public XSNamespaceItem getNamespaceItem ( ) { } }

Fix:
fAnnotations . clear ( ) ;
Buggy code:
public class CuiBono extends Activity implements Thread . UncaughtExceptionHandler { static String tag = "CuiBono" ; static String url = "http:////kifunator.com//api//ad//" ; private boolean isRecording = false ; private Button recordButton ; private NotificationManager notificationManager ; private native String getCodeGen ( String fname ) { } private class TagAdTask extends AsyncTask < String , String , String > { JSONObject response ; @ Override protected String doInBackground ( String ... urls ) { } protected void onProgressUpdate ( String ... problem ) { } @ Override protected void onPostExecute ( String result ) { if ( result . equals ( "bad" ) ) { return ; } recordButton . setText ( "Start<seq2seq4repair_space>Recording" ) ; Intent adinfo = new Intent ( CuiBono . this , AdInfo . class ) ; <START_BUG> Bundle extras = adinfo . getExtras ( ) ; <END_BUG> try { extras . putString ( "title" , response . getString ( "title" ) ) ; extras . putString ( "funder" , response . getString ( "funder" ) ) ; extras . putString ( "url" , response . getString ( "url" ) ) ; extras . putString ( "transcript" , response . getString ( "transcript" ) ) ; adinfo . putExtras ( extras ) ; startActivity ( adinfo ) ; } catch ( JSONException e ) { Log . e ( CuiBono . tag , ( "JSON<seq2seq4repair_space>problem:" + ( e . getMessage ( ) ) ) ) ; throw new CuiBonoException ( "JSON<seq2seq4repair_space>problem" , e ) ; } } } private OnClickListener record = new OnClickListener ( ) { public void onClick ( View v ) { } } ; @ Override public void onCreate ( Bundle savedInstanceState ) { } public String record ( ) { } public JSONObject getAdArticles ( String id ) { } public void uncaughtException ( Thread thread , Throwable exception ) { } protected void sendNotify ( String msg ) { } }

Fix:
Bundle extras = new Bundle ( ) ;
Buggy code:
public class LANDriver extends UserDriver { private InetAddress m_address ; public LANDriver ( InetAddress address ) { } private void sendSingleFile ( Socket sock , File file , TransferTracker tracker ) throws IOException { } private void sendMultipleFiles ( Socket sock , File [ ] files , TransferTracker tracker ) throws IOException { } @ Override public TransferTracker sendFiles ( final File [ ] files ) { if ( ( getUser ( ) ) == null ) { throw new RuntimeException ( "No<seq2seq4repair_space>user<seq2seq4repair_space>set<seq2seq4repair_space>on<seq2seq4repair_space>driver!" ) ; } <START_BUG> TransferTracker tracker = new TransferTracker ( 0 ) ; <END_BUG> try { final Socket sock = new Socket ( m_address , NetworkConstants . FILE_PORT ) ; Thread t = new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { if ( ( files . length ) == 1 ) { sendSingleFile ( sock , files [ 0 ] , tracker ) ; } else { sendMultipleFiles ( sock , files , tracker ) ; } sock . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } ) ; t . start ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return tracker ; } }

Fix:
final TransferTracker tracker = new TransferTracker ( 0 ) ;
Buggy code:
public class IME extends Widget { Canvas parent ; int caretOffset ; int startOffset ; int commitCount ; String text ; int [ ] ranges ; TextStyle [ ] styles ; static final int UNDERLINE_THICK = 1 << 16 ; IME ( ) { } public IME ( Canvas parent , int style ) { } int attributedSubstringFromRange ( int id , int sel , int rangePtr ) { } int characterIndexForPoint ( int id , int sel , int point ) { } void createWidget ( ) { } NSRect firstRectForCharacterRange ( int id , int sel , int range ) { } public int getCaretOffset ( ) { } public int getCommitCount ( ) { } public int getCompositionOffset ( ) { } public int [ ] getRanges ( ) { } public TextStyle [ ] getStyles ( ) { } TextStyle getStyle ( NSDictionary attribs ) { } public String getText ( ) { } public boolean getWideCaret ( ) { } boolean hasMarkedText ( int id , int sel ) { } boolean insertText ( int id , int sel , int string ) { if ( ( startOffset ) == ( - 1 ) ) return true ; NSString str = new NSString ( string ) ; <START_BUG> if ( str . isKindOfClass ( OS . objc_getClass ( "NSAttributedString" ) ) ) { <END_BUG> str = new NSAttributedString ( string ) . string ( ) ; } int length = ( ( int ) ( str . length ( ) ) ) ; int end = ( startOffset ) + ( text . length ( ) ) ; resetStyles ( ) ; caretOffset = commitCount = length ; Event event = new Event ( ) ; event . detail = SWT . COMPOSITION_CHANGED ; event . start = startOffset ; event . end = end ; event . text = text = str . getString ( ) ; sendEvent ( ImeComposition , event ) ; text = "" ; caretOffset = commitCount = 0 ; startOffset = - 1 ; return event . doit ; } boolean isInlineEnabled ( ) { } NSRange markedRange ( int id , int sel ) { } void resetStyles ( ) { } void releaseParent ( ) { } void releaseWidget ( ) { } NSRange selectedRange ( int id , int sel ) { } public void setCompositionOffset ( int offset ) { } boolean setMarkedText_selectedRange ( int id , int sel , int string , int selRange ) { } int validAttributesForMarkedText ( int id , int sel ) { } }

Fix:
if ( str . isKindOfClass ( class_NSAttributedString ) ) {
Buggy code:
public class DetailActivity extends ActionBarActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_detail ) ; if ( savedInstanceState == null ) { Bundle arguments = new Bundle ( ) ; <START_BUG> arguments . putString ( DETAIL_URL , getIntent ( ) . getExtras ( ) . toString ( ) ) ; <END_BUG> DetailWebViewFragment fragment = new DetailWebViewFragment ( ) ; fragment . setArguments ( arguments ) ; getSupportFragmentManager ( ) . beginTransaction ( ) . add ( feeds_detail_container , fragment ) . commit ( ) ; } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
arguments . putString ( DETAIL_URL , getIntent ( ) . getExtras ( ) . getString ( DETAIL_URL ) ) ;