auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void postCollectionAdminGroupCreateAdminGroupUnProcessablePermanent() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setPermanent(true); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); <START> <END> }</code><technical_language>double check group created</technical_language>

Target:
public void postCollectionAdminGroupCreateAdminGroupUnProcessablePermanent() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setPermanent(true); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/adminGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/adminGroup")) .andExpect(status().isNoContent()); }
Source:
<code>public void shouldNotWriteMoreThanOneOnCancelTaskWhenDefined() throws Exception { String xml = "<cruise schemaVersion='30'>\n" + "<server artifactsdir='artifactsDir' >" + "</server>" + "<pipelines>\n" + "<pipeline name='pipeline1' template='abc'>\n" + " <materials>\n" + " <svn url ='svnurl' username='foo' password='password'/>" + " </materials>\n" + "</pipeline>\n" + "</pipelines>\n" + "<templates>\n" + " <pipeline name='abc'>\n" + " <stage name='stage1'>" + " <jobs>" + " <job name='job1'>" + " <tasks>" + " <exec command=\"rake\">\n" + " <arg>all_test</arg>\n" + " <oncancel>\n" + " <ant target='kill' />\n" + " <ant target='kill' />\n" + " </oncancel>\n" + " </exec>" + " </tasks>" + " </job>" + " </jobs>" + " </stage>" + " </pipeline>\n" + "</templates>\n" + "</cruise>"; try { CruiseConfig cruiseConfig = ConfigMigrator.loadWithMigration(IOUtils.toInputStream(xml)).config; xmlWriter.write(cruiseConfig, output, false); fail("Should not allow user to write more than one oncancel task"); } catch (Exception e) { <START> assertThat(e.getMessage(), containsString("Invalid content was found starting with element 'ant'. No child element is expected at this point.")); <END> } }</code><technical_language>improve this error message? @jyotisingh @juhijariwala :)</technical_language>

Target:
public void shouldNotWriteMoreThanOneOnCancelTaskWhenDefined() throws Exception { String xml = "<cruise schemaVersion='76'>\n" + "<server artifactsdir='artifactsDir' >" + "</server>" + "<pipelines>\n" + "<pipeline name='pipeline1' template='abc'>\n" + " <materials>\n" + " <svn url ='svnurl' username='foo' password='password'/>" + " </materials>\n" + "</pipeline>\n" + "</pipelines>\n" + "<templates>\n" + " <pipeline name='abc'>\n" + " <stage name='stage1'>" + " <jobs>" + " <job name='job1'>" + " <tasks>" + " <exec command=\"rake\">\n" + " <arg>all_test</arg>\n" + " <oncancel>\n" + " <ant target='kill' />\n" + " <ant target='kill' />\n" + " </oncancel>\n" + " </exec>" + " </tasks>" + " </job>" + " </jobs>" + " </stage>" + " </pipeline>\n" + "</templates>\n" + "</cruise>"; thrown.expectMessage("Invalid content was found starting with element 'ant'. No child element is expected at this point."); CruiseConfig cruiseConfig = ConfigMigrator.loadWithMigration(IOUtils.toInputStream(xml)).config; xmlWriter.write(cruiseConfig, output, false); }
Source:
<code>public void start(final ServiceProvider<Service> serviceProvider) { this.cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); StatisticsService statisticsService = serviceProvider.getService(StatisticsService.class); TimeSourceService timeSourceService = serviceProvider.getService(TimeSourceService.class); addManagementProvider(new EhcacheActionProvider(getConfiguration())); addManagementProvider(new EhcacheStatisticsProvider(getConfiguration(), statisticsService, timeSourceService.getTimeSource())); addManagementProvider(new EhcacheStatisticCollectorProvider(getConfiguration())); addManagementProvider(new EhcacheSettingsProvider(getConfiguration(), cacheManager)); this.cacheManager.registerListener(this); this.clusteringManagementService = serviceProvider.getService(ClusteringManagementService.class); if (this.clusteringManagementService == null && Clustering.isAvailable(serviceProvider)) { this.clusteringManagementService = Clustering.newClusteringManagementService(new DefaultClusteringManagementServiceConfiguration()); this.clusteringManagementService.start(serviceProvider); <START> this.clusteringManagementServiceManuallyStarted = true; <END> } }</code><technical_language>clusteringManagementServiceAutoStarted instead</technical_language>

Target:
public void start(final ServiceProvider<Service> serviceProvider) { this.cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); StatisticsService statisticsService = serviceProvider.getService(StatisticsService.class); TimeSourceService timeSourceService = serviceProvider.getService(TimeSourceService.class); addManagementProvider(new EhcacheActionProvider(getConfiguration())); addManagementProvider(new EhcacheStatisticsProvider(getConfiguration(), statisticsService, timeSourceService.getTimeSource())); addManagementProvider(new EhcacheStatisticCollectorProvider(getConfiguration())); addManagementProvider(new EhcacheSettingsProvider(getConfiguration(), cacheManager)); this.cacheManager.registerListener(this); this.clusteringManagementService = serviceProvider.getService(ClusteringManagementService.class); if (this.clusteringManagementService == null && Clustering.isAvailable(serviceProvider)) { this.clusteringManagementService = Clustering.newClusteringManagementService(new DefaultClusteringManagementServiceConfiguration()); this.clusteringManagementService.start(serviceProvider); this.clusteringManagementServiceAutoStarted = true; } else { this.clusteringManagementServiceAutoStarted = false; } }
Source:
<code>public double fxRate(Currency baseCurrency, Currency counterCurrency) { if (baseCurrency.equals(counterCurrency)) { return 1; } Optional<FxRate> rate = marketData.findValue(FxRateKey.of(baseCurrency, counterCurrency)); if (rate.isPresent()) { return rate.get().fxRate(baseCurrency, counterCurrency); } Currency triangularCcy = baseCurrency.getTriangulationCurrency(); Optional<FxRate> rate1 = marketData.findValue(FxRateKey.of(baseCurrency, triangularCcy)); Optional<FxRate> rate2 = marketData.findValue(FxRateKey.of(triangularCcy, counterCurrency)); if(rate1.isPresent() && rate2.isPresent()) { return rate1.get().crossRate(rate2.get()).fxRate(baseCurrency, counterCurrency); } <START> throw new IllegalArgumentException("No market data available for pair " + baseCurrency + "/" + counterCurrency); <END> }</code><technical_language>throwing exception try: - counter currency triangulation currency - triangulating if triangulation currencies</technical_language>

Target:
public double fxRate(Currency baseCurrency, Currency counterCurrency) { if (baseCurrency.equals(counterCurrency)) { return 1; } Optional<FxRate> rate = marketData.findValue(FxRateKey.of(baseCurrency, counterCurrency)); if (rate.isPresent()) { return rate.get().fxRate(baseCurrency, counterCurrency); } Currency triangularBaseCcy = baseCurrency.getTriangulationCurrency(); Optional<FxRate> rateBase1 = marketData.findValue(FxRateKey.of(baseCurrency, triangularBaseCcy)); Optional<FxRate> rateBase2 = marketData.findValue(FxRateKey.of(triangularBaseCcy, counterCurrency)); if (rateBase1.isPresent() && rateBase2.isPresent()) { return rateBase1.get().crossRate(rateBase2.get()).fxRate(baseCurrency, counterCurrency); } Currency triangularCounterCcy = counterCurrency.getTriangulationCurrency(); Optional<FxRate> rateCounter1 = marketData.findValue(FxRateKey.of(baseCurrency, triangularCounterCcy)); Optional<FxRate> rateCounter2 = marketData.findValue(FxRateKey.of(triangularCounterCcy, counterCurrency)); if (rateCounter1.isPresent() && rateCounter2.isPresent()) { return rateCounter1.get().crossRate(rateCounter2.get()).fxRate(baseCurrency, counterCurrency); } if (rateBase1.isPresent() && rateCounter2.isPresent()) { Optional<FxRate> rateTriangular2 = marketData.findValue(FxRateKey.of(triangularBaseCcy, triangularCounterCcy)); if (rateTriangular2.isPresent()) { return rateBase1.get().crossRate(rateTriangular2.get()).crossRate(rateCounter2.get()) .fxRate(baseCurrency, counterCurrency); } } throw new IllegalArgumentException("No market data available for pair " + baseCurrency + "/" + counterCurrency); }
Source:
<code>public void executeAsExample(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) { executeCommand.announceBeforeExample(exampleName, detailRow.getElement(), resultRecorder); if (detailRow.getCells().length != tableSupport.getColumnCount()) { throw new RuntimeException("The <table> 'execute' command only supports rows with an equal number of columns."); } <START> System.err.println(evaluator.evaluate("getCounter()")); <END> tableExecuteCommand.setElement(detailRow.getElement()); tableSupport.copyCommandCallsTo(detailRow); tableExecuteCommand.execute(evaluator, resultRecorder); executeCommand.announceAfterExample(exampleName, detailRow.getElement(), resultRecorder); }</code><technical_language>Is this extraneous debug statement removed</technical_language>

Target:
public void executeAsExample(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) { executeCommand.announceBeforeExample(exampleName, detailRow.getElement(), resultRecorder); if (detailRow.getCells().length != tableSupport.getColumnCount()) { throw new RuntimeException("The <table> 'execute' command only supports rows with an equal number of columns."); } tableExecuteCommand.setElement(detailRow.getElement()); tableSupport.copyCommandCallsTo(detailRow); ExampleCommand.setupCommandForExample(tableExecuteCommand, resultRecorder, exampleName); tableExecuteCommand.execute(evaluator, resultRecorder); executeCommand.announceAfterExample(exampleName, detailRow.getElement(), resultRecorder); }
Source:
<code><START> public void injectDependencies(@ComponentName(KnownComponentNames.PERSISTENCE_MARSHALLER) PersistenceMarshaller persistenceMarshaller, <END> @ComponentName(KnownComponentNames.CACHE_NAME) String cacheName, InternalCacheRegistry icr, GlobalConfiguration gcr, EncoderRegistry encoderRegistry, Configuration configuration) { if (this.encoder != null && this.wrapper != null) { return; } boolean internalCache = icr.isInternalCache(cacheName); boolean embeddedMode = Configurations.isEmbeddedMode(gcr); this.storageMediaType = getStorageMediaType(configuration, embeddedMode, internalCache, persistenceMarshaller); lookupEncoder(encoderRegistry); this.wrapper = encoderRegistry.getWrapper(wrapperClass, wrapperId); this.lookupTranscoder(encoderRegistry); }</code><technical_language>remove methods IMO, if expect applications part of public API. deprecate them, simplify implementation simply delegate EncoderRegistry</technical_language>

Target:
public void injectDependencies(@ComponentName(KnownComponentNames.PERSISTENCE_MARSHALLER) PersistenceMarshaller persistenceMarshaller, @ComponentName(KnownComponentNames.CACHE_NAME) String cacheName, InternalCacheRegistry icr, GlobalConfiguration gcr, EncoderRegistry encoderRegistry, Configuration configuration) { this.encoderRegistry = encoderRegistry; if (this.encoder != null && this.wrapper != null) { return; } boolean internalCache = icr.isInternalCache(cacheName); boolean embeddedMode = Configurations.isEmbeddedMode(gcr); this.storageMediaType = getStorageMediaType(configuration, embeddedMode, internalCache, persistenceMarshaller); lookupEncoder(encoderRegistry); this.lookupWrapper(); this.lookupTranscoder(); }
Source:
<code>private static ParameterizedSABRModelDiscreteVolatilityFunctionProvider getDiscreteVolatilityFunctionProvider( MultiCapFloorPricer pricer, DoublesVectorFunctionProvider[] smileModelParameterProviders) { ArgumentChecker.notNull(pricer, "pricer"); ArgumentChecker.noNulls(smileModelParameterProviders, "smileModelParameterProviders"); ArgumentChecker.isTrue(NUM_MODEL_PARMS == smileModelParameterProviders.length, "Require smileModelParameterProviders", NUM_MODEL_PARMS); ForwardCurve fwdCurve = new ForwardCurve(InterpolatedDoublesCurve.from(pricer.getCapletExpiries(), pricer .getCapletForwardRates(), CombinedInterpolatorExtrapolatorFactory.getInterpolator(Interpolator1DFactory.LINEAR, <START> Interpolator1DFactory.FLAT_EXTRAPOLATOR))); <END> return new ParameterizedSABRModelDiscreteVolatilityFunctionProvider(fwdCurve, smileModelParameterProviders); }</code><technical_language>Is necessary instantiate extrapolator well</technical_language>

Target:
private static ParameterizedSABRModelDiscreteVolatilityFunctionProvider getDiscreteVolatilityFunctionProvider(MultiCapFloorPricer pricer, DoublesVectorFunctionProvider[] smileModelParameterProviders) { ArgumentChecker.notNull(pricer, "pricer"); ArgumentChecker.noNulls(smileModelParameterProviders, "smileModelParameterProviders"); ArgumentChecker.isTrue(NUM_MODEL_PARMS == smileModelParameterProviders.length, "Require smileModelParameterProviders", NUM_MODEL_PARMS); ForwardCurve fwdCurve = new ForwardCurve(InterpolatedDoublesCurve.from(pricer.getCapletExpiries(), pricer.getCapletForwardRates(), CombinedInterpolatorExtrapolatorFactory.getInterpolator(Interpolator1DFactory.LINEAR, Interpolator1DFactory.LINEAR_EXTRAPOLATOR))); return new ParameterizedSABRModelDiscreteVolatilityFunctionProvider(fwdCurve, smileModelParameterProviders); }
Source:
<code><START> public static void changeCurrentNum(boolean increase) { <END> boolean loopedOnce = false; if (increase) { currentNum++; } else { currentNum--; } if (currentNum < 0 && usedNums.size() > 0) { currentNum = Collections.max(usedNums); } while (!usedNums.contains(currentNum) && usedNums.size()>0) { if (increase) { currentNum++; } else { currentNum--; } if (currentNum > maxNum) { if (!loopedOnce) { currentNum = 0; loopedOnce = true; } else { break; } } else if (currentNum < 0) { currentNum = Collections.max(usedNums); loopedOnce = true; } } }</code><technical_language>This method is confusing I re-write simpler</technical_language>

Target:
public static void changeCurrentNum(boolean increase) { boolean loopedOnce = false; boolean adjusted = false; while ((!adjusted || !usedNums.contains(currentNum)) && usedNums.size()>0) { adjusted = true; if (increase) { currentNum++; } else { currentNum--; } if (currentNum > maxNum) { if (!loopedOnce) { currentNum = 0; loopedOnce = true; } else { break; } } else if (currentNum < 0) { currentNum = Collections.max(usedNums); loopedOnce = true; } } }
Source:
<code>private void addChapters(List<Chapter> chapterList) { Collections.sort(chapterList, mLocationComparator); mChapterForCityName.clear(); mChapterForCityName.addAll(chapterList); autoCompleteSpinnerView.setAdapter(mChapterForCityName); if (mSelectedChapter != null) { int pos = mChapterForCityName.getPosition(mSelectedChapter); <START> autoCompleteSpinnerView.setSelection(pos); <END> } else { if (chapterList.size() > 0) { mSelectedChapter = chapterList.get(0); } } if (mSelectedChapter != null) { autoCompleteSpinnerView.setText(mSelectedChapter.toString(), true); } }</code><technical_language>I a crash here. AutoCompleteTextView is a TextView setSelection is position of cursor. do else here. Details: java.lang.IndexOutOfBoundsException: setSpan (296 ... 296) ends length 2 android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1018) android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:611) android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:607) android.text.Selection.setSelection(Selection.java:76) android.text.Selection.setSelection(Selection.java:87) android.widget.EditText.setSelection(EditText.java:99) org.gdg.frisbee.android.onboarding.FirstStartStep1Fragment.addChapters(FirstStartStep1Fragment.java:210)</technical_language>

Target:
private void addChapters(List<Chapter> chapterList) { Collections.sort(chapterList, mLocationComparator); mChapterAdapter.clear(); mChapterAdapter.addAll(chapterList); autoCompleteSpinnerView.setAdapter(mChapterAdapter); if (mSelectedChapter == null) { if (App.getInstance().getLastLocation() != null && chapterList.size() > 0) { mSelectedChapter = chapterList.get(0); } } if (mSelectedChapter != null) { autoCompleteSpinnerView.setText(mSelectedChapter.toString(), true); } else { autoCompleteSpinnerView.showDropDown(); } }
Source:
<code>public void addUserComment(String customComment) { if (CommonUtils.isBlank(customComment)) { return; } if (hasComment()) { comment.append("\n\n"); } if (preserveFormatting) { <START> comment.append(String.format("\n%s\n", customComment)); <END> } else { comment.append(String.format("```\n%s\n```\n\n", customComment)); } }</code><technical_language>I leading new line excessive here. is separate opening ticks</technical_language>

Target:
public void addUserComment(String customComment) { if (CommonUtils.isBlank(customComment)) { return; } if (hasComment()) { comment.append("\n\n"); } if (preserveFormatting) { comment.append(String.format("%s\n", customComment)); } else { comment.append(String.format("```\n%s\n```\n\n", customComment)); } }
Source:
<code>public void run() { final Properties producerConfig = new Properties(); producerConfig.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers()); producerConfig.put(ProducerConfig.ACKS_CONFIG, "all"); producerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); producerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class); try (final KafkaProducer<String, String> producer = new KafkaProducer<>(producerConfig, new StringSerializer(), new StringSerializer())) { while (getCurrIteration() < numIterations && !shutdown) { for (final String value : inputValues) { producer.send(new ProducerRecord<>(topic, value)); } incrementIteration(); } <START> producer.flush(); <END> } }</code><technical_language>producer is create try-with-resource clause thus, producer flushed implicit close() anyway? Thus, I explicit flushing help</technical_language>

Target:
public void run() { final Properties producerConfig = new Properties(); producerConfig.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers()); producerConfig.put(ProducerConfig.ACKS_CONFIG, "all"); producerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); producerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class); try (final KafkaProducer<String, String> producer = new KafkaProducer<>(producerConfig, new StringSerializer(), new StringSerializer())) { while (getCurrIteration() < numIterations && !shutdown) { for (final String value : inputValues) { producer.send(new ProducerRecord<>(topic, value)); } incrementIteration(); } } }
Source:
<code>private SentimentConfidenceScores toSentimentConfidenceScores( AspectConfidenceScoreLabel aspectConfidenceScoreLabel) { <START> return new SentimentConfidenceScores(aspectConfidenceScoreLabel.getNegative(), 0, <END> aspectConfidenceScoreLabel.getPositive()); }</code><technical_language>Instead of 0 put in a variable stands for</technical_language>

Target:
private SentimentConfidenceScores toSentimentConfidenceScores( AspectConfidenceScoreLabel aspectConfidenceScoreLabel) { return new SentimentConfidenceScores(aspectConfidenceScoreLabel.getNegative(), NEUTRAL_SCORE_ZERO, aspectConfidenceScoreLabel.getPositive()); }
Source:
<code>public String getSyncObjType() { if (getSyncObjId() != null) { <START> return BaseAsyncCmd.migrationSyncObject; <END> } return null; }</code><technical_language>need implemente getSyncObjType getSyncObjId? explain this a bit further</technical_language>

Target:
public String getSyncObjType() { return (getSyncObjId() != null) ? BaseAsyncCmd.migrationSyncObject : null; }
Source:
<code>public void review(PendingCertifiedProductDTO listing) { boolean foundSedCriteria = false; boolean attestsToSed = false; for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria().booleanValue()) { if (cert.getSed() != null && cert.getSed().booleanValue()) { foundSedCriteria = true; } if (cert.getNumber().equalsIgnoreCase(G3_2014)) { attestsToSed = true; } } } if (foundSedCriteria && !attestsToSed) { listing.getErrorMessages().add( msgUtil.getMessage("listing.criteria.foundSedCriteriaWithoutAttestingSed")); } if (!foundSedCriteria && attestsToSed <START> && listing.getIcs() == Boolean.FALSE) { <END> listing.getErrorMessages().add( msgUtil.getMessage("listing.criteria.foundNoSedCriteriaButAttestingSed")); } }</code><technical_language>I findbugs trigger this line a spurious equality; I wants suggestion && !listing.getIcs()) { rationale is testing equality Boolean.SOMETHING people Boolean</technical_language>

Target:
public void review(PendingCertifiedProductDTO listing) { boolean foundSedCriteria = false; boolean attestsToSed = false; for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria().booleanValue()) { if (cert.getSed() != null && cert.getSed().booleanValue()) { foundSedCriteria = true; } if (cert.getNumber().equalsIgnoreCase(G3_2014)) { attestsToSed = true; } } } if (foundSedCriteria && !attestsToSed) { listing.getErrorMessages().add( msgUtil.getMessage("listing.criteria.foundSedCriteriaWithoutAttestingSed")); } if (!foundSedCriteria && attestsToSed && !listing.getIcs()) { listing.getErrorMessages().add( msgUtil.getMessage("listing.criteria.foundNoSedCriteriaButAttestingSed")); } }
Source:
<code>public static void main(String[] args) throws InterruptedException { System.out.println(); System.out.println(">>> Logistic regression model over partitioned dataset usage example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteCache<Integer, double[]> dataCache = new TestCache(ignite).fillCacheWith(data); System.out.println(">>> Create new logistic regression trainer object."); LogisticRegressionSGDTrainer<?> trainer = new LogisticRegressionSGDTrainer<>() .withUpdatesStgy(new UpdatesStrategy<>( new SimpleGDUpdateCalculator(0.2), SimpleGDParameterUpdate::sumLocal, SimpleGDParameterUpdate::avg )) .withMaxIterations(100000) .withLocIterations(100) .withBatchSize(10) .withSeed(123L); System.out.println(">>> Perform the training to get the model."); <START> DatasetTrainer< ModelsComposition, Double> baggedTrainer = <END> TrainerTransformers.makeBagged( trainer, 10, 0.6, 4, 3, new OnMajorityPredictionsAggregator()); double[] score = new CrossValidation<ModelsComposition, Double, Integer, double[]>().score( baggedTrainer, new Accuracy<>(), ignite, dataCache, (k, v) -> VectorUtils.of(Arrays.copyOfRange(v, 1, v.length)), (k, v) -> v[0], 3 ); System.out.println(">>> ---------------------------------"); Arrays.stream(score).forEach(sc -> { System.out.println("\n>>> Accuracy " + sc); }); System.out.println(">>> Begged logistic regression model over partitioned dataset usage example completed."); } }</code><technical_language>Format this line</technical_language>

Target:
public static void main(String[] args) throws FileNotFoundException { System.out.println(); System.out.println(">>> Logistic regression model over partitioned dataset usage example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteCache<Integer, Vector> dataCache = new SandboxMLCache(ignite) .fillCacheWith(MLSandboxDatasets.TWO_CLASSED_IRIS); System.out.println(">>> Create new logistic regression trainer object."); LogisticRegressionSGDTrainer<?> trainer = new LogisticRegressionSGDTrainer<>() .withUpdatesStgy(new UpdatesStrategy<>( new SimpleGDUpdateCalculator(0.2), SimpleGDParameterUpdate::sumLocal, SimpleGDParameterUpdate::avg )) .withMaxIterations(100000) .withLocIterations(100) .withBatchSize(10) .withSeed(123L); System.out.println(">>> Perform the training to get the model."); DatasetTrainer< ModelsComposition, Double> baggedTrainer = TrainerTransformers.makeBagged( trainer, 10, 0.6, 4, 3, new OnMajorityPredictionsAggregator(), 123L); System.out.println(">>> Perform evaluation of the model."); double[] score = new CrossValidation<ModelsComposition, Double, Integer, Vector>().score( baggedTrainer, new Accuracy<>(), ignite, dataCache, (k, v) -> v.copyOfRange(1, v.size()), (k, v) -> v.get(0), 3 ); System.out.println(">>> ---------------------------------"); Arrays.stream(score).forEach(sc -> { System.out.println("\n>>> Accuracy " + sc); }); System.out.println(">>> Bagged logistic regression model over partitioned dataset usage example completed."); } }
Source:
<code>private void postBulkUpdate(String index, List<Entry> entries) { try (RestClient restClient = RestClient.builder(new HttpHost(hostname, port, "http")).build()) { String newlineDJSON = getNDJSON(entries); String endpoint = "/" + index + "/_doc/_bulk"; HttpEntity bulkEntity = new NStringEntity(newlineDJSON, ContentType.APPLICATION_JSON); Response post = restClient.performRequest("POST", endpoint, Collections.emptyMap(), bulkEntity); if (post.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { <START> throw new CustomWebApplicationException("Could not submit tools index to elastic search", HttpStatus.SC_INTERNAL_SERVER_ERROR); <END> } } catch (IOException e) { LOGGER.error("Could not submit " + index + " index to elastic search. " + e.getMessage(), e); } }</code><technical_language>index variable for message, do line 186</technical_language>

Target:
private void postBulkUpdate(String index, List<Entry> entries) { try (RestClient restClient = RestClient.builder(new HttpHost(hostname, port, "http")).build()) { String newlineDJSON = getNDJSON(entries); String endpoint = "/" + index + "/_doc/_bulk"; HttpEntity bulkEntity = new NStringEntity(newlineDJSON, ContentType.APPLICATION_JSON); Response post = restClient.performRequest("POST", endpoint, Collections.emptyMap(), bulkEntity); if (post.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new CustomWebApplicationException("Could not submit " + index + " index to elastic search", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } catch (IOException e) { LOGGER.error("Could not submit " + index + " index to elastic search. " + e.getMessage(), e); } }
Source:
<code>static void checkK(final int k) { <START> if ((k < MIN_K) || (k > MAX_K) || !isPowerOf2(k)) { <END> throw new SketchesArgumentException( "K must be >= " + MIN_K + " and <= " + MAX_K + " and a power of 2: " + k); } }</code><technical_language>restricted power of 2</technical_language>

Target:
static void checkK(final int k) { if ((k < MIN_K) || (k > MAX_K)) { throw new SketchesArgumentException( "K must be >= " + MIN_K + " and <= " + MAX_K + ": " + k); } }
Source:
<code>public String toString() { final String TEST_SUCCEEDED = "Test Succeeded, "; <START> final String TEST_FAILED = "Test Failed: "; <END> return getIsSucceeded() ? TEST_SUCCEEDED + getStatus() : TEST_FAILED + getMessage(); }</code><technical_language>want consistency - ":" "," FAILED SUCCEEDED messages</technical_language>

Target:
public String toString() { final String TEST_SUCCEEDED = "Test Succeeded, "; final String TEST_FAILED = "Test Failed, "; return getIsSucceeded() ? TEST_SUCCEEDED + getStatus() : TEST_FAILED + getMessage(); }
Source:
<code>public void run() { JsonRpcRequest request = null; try { request = JsonRpcRequest.fromByteArray(message); ContextHolder.init(); if (client.getRetryPolicy().getIdentifier() != null){ ContextHolder.setServerName(client.getRetryPolicy().getIdentifier()); log.debug("client policy identifier {}", client.getRetryPolicy().getIdentifier()); }else{ ContextHolder.setServerName(Integer.toString(client.hashCode())); log.error("client identifier were not found, using hash"); } <START> setReactorClient(client); <END> ResponseBuilder builder = new ResponseBuilder(request.getId()); String methodName = request.getMethod(); builder = CommandFactory.createCommand(methodName).run(request.getParams(), builder); send(builder.build(), request.getMethod()); } catch (Throwable e) { log.error("Failure in processing request", e); Map<String, Object> error = new HashMap<>(); error.put("code", 100); error.put("message", e.getMessage()); if (request != null) { send(new ResponseBuilder(request.getId()).withError(error).build(), request.getMethod()); } } }</code><technical_language>set variable here</technical_language>

Target:
public void run() { JsonRpcRequest request = null; try { request = JsonRpcRequest.fromByteArray(message); ContextHolder.init(); if (client.getRetryPolicy().getIdentifier() != null){ ContextHolder.setServerName(client.getRetryPolicy().getIdentifier()); log.debug("client policy identifier {}", client.getRetryPolicy().getIdentifier()); }else{ ContextHolder.setServerName(Integer.toString(client.hashCode())); log.error("client identifier were not found, using hash"); } reactorClient = client; ResponseBuilder builder = new ResponseBuilder(request.getId()); String methodName = request.getMethod(); builder = CommandFactory.createCommand(methodName).run(request.getParams(), builder); send(builder.build(), request.getMethod()); } catch (Throwable e) { log.error("Failure in processing request", e); Map<String, Object> error = new HashMap<>(); error.put("code", 100); error.put("message", e.getMessage()); if (request != null) { send(new ResponseBuilder(request.getId()).withError(error).build(), request.getMethod()); } } }
Source:
<code>public Response updateSenseBlackList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @Valid final Set<String> updatedSenseBlackList) { Jedis jedis = jedisPool.getResource(); final Pipeline pipe = jedis.pipelined(); pipe.multi(); try { <START> pipe.rename(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY, "old_sense_black_list"); <END> for (final String senseId : updatedSenseBlackList){ pipe.sadd(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY, senseId); } pipe.exec(); } catch (Exception e) { jedisPool.returnBrokenResource(jedis); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to update sense black list because %s", e.getMessage()))).build()); } finally { jedisPool.returnResource(jedis); } return Response.noContent().build(); }</code><technical_language>need rename</technical_language>

Target:
public Response updateSenseBlackList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @Valid final Set<String> updatedSenseBlackList) { Jedis jedis = null; try { jedis = jedisPool.getResource(); final Pipeline pipe = jedis.pipelined(); pipe.multi(); pipe.del(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY); for (final String senseId : updatedSenseBlackList){ pipe.sadd(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY, senseId); } pipe.exec(); } catch (JedisDataException e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to get data from redis - %s", e.getMessage()))).build()); } catch (Exception e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to update sense black list because %s", e.getMessage()))).build()); } finally { if (jedis != null) { jedisPool.returnResource(jedis); } } return Response.noContent().build(); }
Source:
<code><START> private int getNumberOfTaskStarted(Policy currentPolicy, Map<JobId, JobDescriptor> jobMap, <END> Set<String> freeResources, LinkedList<EligibleTaskDescriptor> fullListOfTaskRetrievedFromPolicy) { int numberOfTaskStarted = selectAndStartTasks(currentPolicy, jobMap, freeResources, fullListOfTaskRetrievedFromPolicy); if (freeResources.isEmpty()) { return numberOfTaskStarted; } if (activeObjectCreationRetryTimeNumber == 0) { return numberOfTaskStarted; } return numberOfTaskStarted; }</code><technical_language>![BLOCKER](<LINK_0> 'Severity: BLOCKER') Refactor this method return value. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
private int getNumberOfTaskStarted(Policy currentPolicy, Map<JobId, JobDescriptor> jobMap, Set<String> freeResources, LinkedList<EligibleTaskDescriptor> fullListOfTaskRetrievedFromPolicy) { return selectAndStartTasks(currentPolicy, jobMap, freeResources, fullListOfTaskRetrievedFromPolicy); }
Source:
<code>public void testSamReaderFromMalformedSeekableStream() throws IOException { final File samFile = new File(TEST_DATA_DIR, "cram_with_bai_index.cram.bai"); final SamReaderFactory factory = SamReaderFactory.makeDefault() .validationStringency(ValidationStringency.SILENT); final SamReader reader = factory.open( SamInputResource.of(new SeekableFileStream(samFile))); <START> Assert.assertEquals(countRecords(reader), 10); <END> }</code><technical_language>assert out, this throws get</technical_language>

Target:
public void testSamReaderFromMalformedSeekableStream() throws IOException { final File samFile = new File(TEST_DATA_DIR, "cram_with_bai_index.cram.bai"); final SamReaderFactory factory = SamReaderFactory.makeDefault() .validationStringency(ValidationStringency.SILENT); final SamReader reader = factory.open( SamInputResource.of(new SeekableFileStream(samFile))); countRecords(reader); }
Source:
<code>public Collection<CommandNode<CommandSource>> getUnsortedChildren() { <START> return this.childNodes; <END> }</code><technical_language>This is returning a mutable collection SpongeRootCommandNode is returning immutable one. Is intended</technical_language>

Target:
public Collection<CommandNode<CommandSource>> getUnsortedChildren() { return this.nodeHolder.getChildren(); }
Source:
<code>public boolean <START> isLeafVolType(Guid <END> storagePoolId, Guid storageDomainId, Guid imageGroupId, Guid imageId) { DiskImage dbImage = getSnapshotLeaf(imageGroupId); DiskImage vdsmImage = getVolumeInfoFromVdsm(storagePoolId, storageDomainId, imageGroupId, imageId); return dbImage.getId().equals(vdsmImage.getId()) ? VolType.LEAF == vdsmImage.getVolType() : true; }</code><technical_language>of isLeafVolType, a of "!", inverted. Consider changing isNotLeafVolType remove ! occurences</technical_language>

Target:
public boolean isLeafVolType(Guid storagePoolId, Guid storageDomainId, Guid imageGroupId, Guid imageId) { DiskImage dbImage = getSnapshotLeaf(imageGroupId); DiskImage vdsmImage = getVolumeInfoFromVdsm(storagePoolId, storageDomainId, imageGroupId, imageId); return !dbImage.getId().equals(vdsmImage.getId()) || VolType.LEAF == vdsmImage.getVolType(); }
Source:
<code>public Response prepareData(final List<PerfEnforceTableEncoding> tableList) throws PerfEnforceException, DbException, Exception { server.getPerfEnforceDriver().preparePSLA(tableList); <START> return Response.noContent().build(); <END> }</code><technical_language>I this maps HTTP return code 204. if 201 is more appropriate, if this POST creates resource 201 sounds better</technical_language>

Target:
public Response prepareData(final List<PerfEnforceTableEncoding> tableList) throws PerfEnforceException, DbException, Exception { server.getPerfEnforceDriver().preparePSLA(tableList); return Response.status(201).build(); }
Source:
<code>public void processAction(GameUserActionCode action, UserBean user, String gameId, Map<String, String> params) throws PlayException, GameException { log.debug("{} tries to perform action at game with id and additional params {}", user, action, gameId, params); validateUserNotEmpty(user); GameBean game = gameUtil.getGameById(gameId, ERROR_CODE_ERROR); GameUserBean gameUser = gameUtil.getGameUserJoinedToGame(user, game); validateGameStatusIsPlaying(game); validateActionIsAllowedForUser(gameUser, action); doAction(action, user, game, params); <START> playUtil.takeResources(game.getStage(), gameUser.getResources(), action); <END> playUtil.updateVictoryPoints(gameUser); playUtil.finishGameIfTargetVictoryPointsReached(gameUser, game); playUtil.updateAvailableActionsForAllUsers(game); gameDao.updateGame(game); log.debug("User successfully performed action {}", user.getUsername(), action); }</code><technical_language>put call of this method place in method requires</technical_language>

Target:
public Map<String, String> processAction(GameUserActionCode action, UserBean user, String gameId, Map<String, String> params) throws PlayException, GameException { log.debug("{} tries to perform action at game with id and additional params {}", user, action, gameId, params); Map<String, String> returnedParams = new HashMap<String, String>(); validateUserNotEmpty(user); GameBean game = gameUtil.getGameById(gameId, ERROR_CODE_ERROR); GameUserBean gameUser = gameUtil.getGameUserJoinedToGame(user, game); validateGameStatusIsPlaying(game); validateActionIsAllowedForUser(gameUser, action); doAction(action, user, gameUser, game, params, returnedParams); playUtil.updateVictoryPoints(gameUser); playUtil.finishGameIfTargetVictoryPointsReached(gameUser, game); playUtil.updateAvailableActionsForAllUsers(game); gameDao.updateGame(game); log.debug("User successfully performed action {}", user.getUsername(), action); return returnedParams; }
Source:
<code>public void shouldRemoveConceptDescriptionIfEmptyStringFromUI() throws Exception { ConceptService cs = Context.getConceptService(); Concept concept = cs.getConcept(3); assertNotNull(concept); assertNotNull(concept.getDescription()); ConceptFormController conceptFormController = (ConceptFormController) applicationContext.getBean("conceptForm"); MockHttpServletRequest mockRequest = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); mockRequest.setMethod("POST"); mockRequest.setParameter("action", ""); mockRequest.setParameter("conceptId", concept.getConceptId().toString()); mockRequest.setParameter("descriptionsByLocale[en].description", " "); ModelAndView mav = conceptFormController.handleRequest(mockRequest, response); assertNotNull(mav); assertTrue(mav.getModel().isEmpty()); <START> updateSearchIndex(); <END> Concept actualConcept = cs.getConcept(3); assertNotNull(actualConcept); assertNull(concept.getDescription()); }</code><technical_language>here, need this call</technical_language>

Target:
public void shouldRemoveConceptDescriptionIfEmptyStringFromUI() throws Exception { ConceptService cs = Context.getConceptService(); Concept concept = cs.getConcept(3); assertNotNull(concept); assertNotNull(concept.getDescription()); ConceptFormController conceptFormController = (ConceptFormController) applicationContext.getBean("conceptForm"); MockHttpServletRequest mockRequest = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); mockRequest.setMethod("POST"); mockRequest.setParameter("action", ""); mockRequest.setParameter("conceptId", concept.getConceptId().toString()); mockRequest.setParameter("descriptionsByLocale[en].description", " "); ModelAndView mav = conceptFormController.handleRequest(mockRequest, response); assertNotNull(mav); assertTrue(mav.getModel().isEmpty()); Concept actualConcept = cs.getConcept(3); assertNotNull(actualConcept); assertNull(concept.getDescription()); }
Source:
<code>private ReadRowsRequest handleScanTimeout(ScanTimeoutException rte) throws IOException { logger.info("The client could not get a response in %d ms. Retrying the scan.", retryOptions.getReadPartialRowTimeoutMillis()); <START> currentErrorBackoff = null; <END> if (timeoutRetryCount == null) { timeoutRetryCount = new AtomicInteger(); } if (retryOptions.enableRetries() && timeoutRetryCount.incrementAndGet() <= retryOptions.getMaxScanTimeoutRetries()) { return requestManager.getUpdatedRequest(); } else { rpcMetrics.markRetriesExhasted(); throw new BigtableRetriesExhaustedException( "Exhausted streaming retries after too many timeouts", rte); } }</code><technical_language>similar timeoutRetryCount, error prone construct & reset necessary</technical_language>

Target:
private ReadRowsRequest handleScanTimeout(ScanTimeoutException rte) throws IOException { logger.info("The client could not get a response in %d ms. Retrying the scan.", retryOptions.getReadPartialRowTimeoutMillis()); currentErrorBackoff = null; if (retryOptions.enableRetries() && ++timeoutRetryCount <= retryOptions.getMaxScanTimeoutRetries()) { return requestManager.buildUpdatedRequest(); } else { rpcMetrics.markRetriesExhasted(); throw new BigtableRetriesExhaustedException( "Exhausted streaming retries after too many timeouts", rte); } }
Source:
<code>public void start() { if (MySql.ID.equals(database.getDialect().getId())) { <START> throw new IllegalStateException("When cluster is activater, the MySQL database is not supported"); <END> } }</code><technical_language>"activer" => "activated" error message "MySQL is supported database run SonarQube DataCenter Edition" Please check PMs (@ganncamp ?)</technical_language>

Target:
public void start() { if (MySql.ID.equals(database.getDialect().getId())) { throw new IllegalStateException("MySQL is not supported for Data Center Edition. Please connect to a supported database: Oracle, PostgreSQL, Microsoft SQL Server."); } }
Source:
<code>public Ec2EurekaArchaius2InstanceConfig(Config config, AmazonInfoConfig amazonInfoConfig, String namespace) { super(config, namespace); this.amazonInfoConfig = amazonInfoConfig; try { this.amazonInfo = AmazonInfo.Builder .newBuilder() .withAmazonInfoConfig(amazonInfoConfig) .autoBuild(namespace); LOG.info("Datacenter is: " + Name.Amazon); } catch (Exception e) { LOG.error("Cannot initialize amazon info :", e); throw new RuntimeException(e); } if (amazonInfo.get(MetaDataKey.instanceId) == null) { if (config.getBoolean(namespace + ".validateInstanceId", true)) { throw new RuntimeException( "Your datacenter is defined as cloud but we are not able to get the amazon metadata to " + "register. \nSet the property 'eureka.validateInstanceId' to false to ignore the" + "metadata call"); } else { Map<String, String> metadataMap = new HashMap<>(); metadataMap.put(MetaDataKey.instanceId.getName(), super.getIpAddress()); metadataMap.put(MetaDataKey.publicHostname.getName(), super.getHostName(false)); amazonInfo.setMetadata(metadataMap); } } else if ((amazonInfo.get(MetaDataKey.publicHostname) == null) && (amazonInfo.get(MetaDataKey.localIpv4) != null)) { amazonInfo.getMetadata().put(MetaDataKey.publicHostname.getName(), (amazonInfo.get(MetaDataKey.localIpv4))); } <START> DiscoveryManager.getInstance().setEurekaInstanceConfig(this); <END> }</code><technical_language>replacement for this</technical_language>

Target:
public Ec2EurekaArchaius2InstanceConfig(Config config, AmazonInfoConfig amazonInfoConfig, String namespace) { super(config, namespace); this.amazonInfoConfig = amazonInfoConfig; try { this.amazonInfo = AmazonInfo.Builder .newBuilder() .withAmazonInfoConfig(amazonInfoConfig) .autoBuild(namespace); LOG.info("Datacenter is: " + Name.Amazon); } catch (Exception e) { LOG.error("Cannot initialize amazon info :", e); throw new RuntimeException(e); } if (amazonInfo.get(MetaDataKey.instanceId) == null) { if (config.getBoolean(namespace + ".validateInstanceId", true)) { throw new RuntimeException( "Your datacenter is defined as cloud but we are not able to get the amazon metadata to " + "register. \nSet the property 'eureka.validateInstanceId' to false to ignore the" + "metadata call"); } else { Map<String, String> metadataMap = new HashMap<>(); metadataMap.put(MetaDataKey.instanceId.getName(), super.getIpAddress()); metadataMap.put(MetaDataKey.publicHostname.getName(), super.getHostName(false)); amazonInfo.setMetadata(metadataMap); } } else if ((amazonInfo.get(MetaDataKey.publicHostname) == null) && (amazonInfo.get(MetaDataKey.localIpv4) != null)) { amazonInfo.getMetadata().put(MetaDataKey.publicHostname.getName(), (amazonInfo.get(MetaDataKey.localIpv4))); } }
Source:
<code>public void doShouldBeThreadsafe() { int threads = 50; ExecutorService service = Executors.newFixedThreadPool(threads); List<Callable<Boolean>> callables = new ArrayList<>(); for (int thread = 0; thread < threads; ++thread) { final int counter = thread; Callable<Boolean> booleanSupplier = () -> { String expectedName = "party like it's 199" + counter%12; String foundName = partyRepository.findByName(expectedName).get(0).getName(); <START> System.out.println("expected = " + expectedName + " found = " + foundName); <END> return expectedName.equals(foundName); }; callables.add(booleanSupplier); } try { List<Future<Boolean>> futures = service.invokeAll(callables); service.shutdown(); service.awaitTermination(5, TimeUnit.SECONDS); for (Future<Boolean> future: futures) { assertThat(future.get()).isTrue(); } } catch (InterruptedException | ExecutionException e) { fail("Threads failed to run " + e.getMessage()); } }</code><technical_language>a real assertEquals println fails test if needed spam logs</technical_language>

Target:
public void doShouldBeThreadsafe() { int threads = 50; ExecutorService service = Executors.newFixedThreadPool(threads); List<Callable<Boolean>> callables = new ArrayList<>(); for (int thread = 0; thread < threads; ++thread) { final int counter = thread; Callable<Boolean> booleanSupplier = () -> { String expectedName = "party like it's 199" + counter%12; String foundName = partyRepository.findByName(expectedName).get(0).getName(); return expectedName.equals(foundName); }; callables.add(booleanSupplier); } try { List<Future<Boolean>> futures = service.invokeAll(callables); service.shutdown(); service.awaitTermination(5, TimeUnit.SECONDS); for (Future<Boolean> future: futures) { assertThat(future.get()).isTrue(); } } catch (InterruptedException | ExecutionException e) { fail("Threads failed to run " + e.getMessage()); } }
Source:
<code>public static void postAndWait(Handler handler, final Runnable r) { if (checkAccess(handler)) { try { r.run(); return; <START> } catch (Exception e) { <END> throw new RuntimeException(e); } } WaitableRunnable wrapper = new WaitableRunnable(r); if (!handler.post(wrapper)) { throw new RuntimeException("Handler.post() returned false"); } wrapper.join(); }</code><technical_language>Runnable's checked exceptions need this statement</technical_language>

Target:
public static void postAndWait(Handler handler, final Runnable r) { if (checkThreadAccess(handler)) { try { r.run(); return; } catch (RuntimeException e) { throw new RuntimeException(e); } } WaitableRunnable<Void> wrapper = new WaitableRunnable<Void>() { @Override protected Void onRun() { r.run(); return null; } }; wrapper.invoke(handler); }