auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Channel acquireUploadChannel() throws InterruptedException { Promise<Channel> channelReady = eventLoop.next().newPromise(); channelPool .acquire() .addListener( (Future<Channel> channelAcquired) -> { if (!channelAcquired.isSuccess()) { channelReady.setFailure(channelAcquired.cause()); return; } try { Channel ch = channelAcquired.getNow(); ChannelPipeline p = ch.pipeline(); if (!isChannelPipelineEmpty(p)) { channelReady.setFailure( new IllegalStateException("Channel pipeline is not empty.")); return; } p.addLast(new HttpResponseDecoder()); p.addLast(new HttpObjectAggregator(10 * 1024)); p.addLast(new HttpRequestEncoder()); p.addLast(new ChunkedWriteHandler()); p.addFirst("read-timeout-handler", new ReadTimeoutHandler(timeoutSeconds)); p.addFirst("write-timeout-handler", new WriteTimeoutHandler(timeoutSeconds)); synchronized (credentialsLock) { p.addLast(new HttpUploadHandler(creds)); } if (!ch.eventLoop().inEventLoop()) { ch.eventLoop().execute(() -> channelReady.setSuccess(ch)); } else { channelReady.setSuccess(ch); } } catch (Throwable t) { channelReady.setFailure(t); } }); try { return channelReady.get(); } catch (ExecutionException e) { PlatformDependent.throwException(e.getCause()); return null; } }

Target:
private Channel acquireUploadChannel() throws InterruptedException { Promise<Channel> channelReady = eventLoop.next().newPromise(); channelPool .acquire() .addListener( (Future<Channel> channelAcquired) -> { if (!channelAcquired.isSuccess()) { channelReady.setFailure(channelAcquired.cause()); return; } try { Channel ch = channelAcquired.getNow(); ChannelPipeline p = ch.pipeline(); if (!isChannelPipelineEmpty(p)) { channelReady.setFailure( new IllegalStateException("Channel pipeline is not empty.")); return; } p.addFirst( "timeout-handler", new IdleTimeoutHandler(timeoutSeconds, WriteTimeoutException.INSTANCE)); p.addLast(new HttpResponseDecoder()); p.addLast(new HttpObjectAggregator(10 * 1024)); p.addLast(new HttpRequestEncoder()); p.addLast(new ChunkedWriteHandler()); synchronized (credentialsLock) { p.addLast(new HttpUploadHandler(creds)); } if (!ch.eventLoop().inEventLoop()) { ch.eventLoop().execute(() -> channelReady.setSuccess(ch)); } else { channelReady.setSuccess(ch); } } catch (Throwable t) { channelReady.setFailure(t); } }); try { return channelReady.get(); } catch (ExecutionException e) { PlatformDependent.throwException(e.getCause()); return null; } }
Source:
public void close() { directReader.close(); dictionaryReader.close(); }

Target:
public void close() { try (Closer closer = Closer.create()) { closer.register(() -> directReader.close()); closer.register(() -> dictionaryReader.close()); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public void verifyGettingLatencyRecordsIsCheapWhenDisabled() throws Exception { final double maxLatencyWhenDisabledMs = 1; final double minLatencyWhenDisabledMs = 0; final long numTasks = 1000; long aggregateLatency = 0; AbfsPerfTracker abfsPerfTracker = new AbfsPerfTracker(accountName, filesystemName, false); List<Callable<Long>> tasks = new ArrayList<>(); for (int i=0; i < numTasks; i++) { tasks.add(() -> { Instant startGet = Instant.now(); abfsPerfTracker.getClientLatency(); long latencyGet = Duration.between(startGet, Instant.now()).toMillis(); LOG.debug("Spent ms in retrieving latency record.", latencyGet); return latencyGet; }); } for (Future<Long> fr: executorService.invokeAll(tasks)) { aggregateLatency += fr.get(); } double averageRecordLatency = aggregateLatency/numTasks; assertThat(averageRecordLatency).describedAs("Average time for getting latency records should be bounded") .isBetween(minLatencyWhenDisabledMs, maxLatencyWhenDisabledMs); }

Target:
public void verifyGettingLatencyRecordsIsCheapWhenDisabled() throws Exception { final double maxLatencyWhenDisabledMs = 1000; final double minLatencyWhenDisabledMs = 0; final long numTasks = 1000; long aggregateLatency = 0; AbfsPerfTracker abfsPerfTracker = new AbfsPerfTracker(accountName, filesystemName, false); List<Callable<Long>> tasks = new ArrayList<>(); for (int i = 0; i < numTasks; i++) { tasks.add(() -> { Instant startGet = Instant.now(); abfsPerfTracker.getClientLatency(); long latencyGet = Duration.between(startGet, Instant.now()).toMillis(); LOG.debug("Spent ms in retrieving latency record.", latencyGet); return latencyGet; }); } for (Future<Long> fr: executorService.invokeAll(tasks)) { aggregateLatency += fr.get(); } double averageRecordLatency = aggregateLatency / numTasks; assertThat(averageRecordLatency).describedAs("Average time for getting latency records should be bounded") .isBetween(minLatencyWhenDisabledMs, maxLatencyWhenDisabledMs); }
Source:
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { ItemStack stack = playerIn.getHeldItem(handIn); if(worldIn.isRemote) { boolean canEdit = playerIn.getHeldItem(handIn == Hand.MAIN_HAND ? Hand.OFF_HAND : Hand.MAIN_HAND).isItemEqual(new ItemStack(MSItems.CARVING_TOOL)); String text = hasText(stack) ? stack.getTag().getString("text") : ""; Minecraft.getInstance().displayGuiScreen(new StoneTabletScreen(playerIn, handIn, text, canEdit)); } return new ActionResult<>(ActionResultType.SUCCESS, stack); }

Target:
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { ItemStack stack = playerIn.getHeldItem(handIn); if(worldIn.isRemote) { boolean canEdit = playerIn.getHeldItem(handIn == Hand.MAIN_HAND ? Hand.OFF_HAND : Hand.MAIN_HAND).isItemEqual(new ItemStack(MSItems.CARVING_TOOL)); String text = hasText(stack) ? stack.getTag().getString("text") : ""; MSScreenFactories.displayStoneTabletScreen(playerIn, handIn, text, canEdit); } return new ActionResult<>(ActionResultType.SUCCESS, stack); }
Source:
public static BigtableTableUtilsFactory from(HBaseImportOptions options) throws IOException { BigtableConnection connection = new BigtableConnection( new CloudBigtableConfiguration.Builder() .withProjectId(options.getBigtableProjectId()) .withClusterId(options.getBigtableClusterId()) .withZoneId(options.getBigtableZoneId()) .withConfiguration( "hbase.client.connection.impl", "com.google.cloud.bigtable.hbase1_0.BigtableConnection") .build() .toHBaseConfig()); return new BigtableTableUtilsFactory(connection); }

Target:
public static BigtableTableUtilsFactory from(HBaseImportOptions options) throws IOException { return new BigtableTableUtilsFactory(BigtableConfiguration.connect( options.getBigtableProjectId(), options.getBigtableZoneId(), options.getBigtableClusterId())); }
Source:
private void createNewBloomFilter() { bloomFilter = BloomFilter.create(Funnels.stringFunnel(), BLOOM_FILTER_CAPACITY, BLOOM_FILTER_ERROR_RATE); this.lastBloomFilterCreated = DateTime.now(); }

Target:
private void createNewBloomFilter() { this.bloomFilter = BloomFilter.create(Funnels.stringFunnel(), BLOOM_FILTER_CAPACITY, BLOOM_FILTER_ERROR_RATE); this.lastBloomFilterCreated = DateTime.now(DateTimeZone.UTC); }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; BlockTree block = methodTree.block(); if (block != null) { CloseableVisitor closeableVisitor = new CloseableVisitor(methodTree.parameters()); block.accept(closeableVisitor); for (Tree ref : closeableVisitor.executionState.getUnclosedClosables()) { insertIssue(ref); } } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; BlockTree block = methodTree.block(); if (block != null) { CloseableVisitor visitor = new CloseableVisitor(methodTree.parameters(), this); block.accept(visitor); visitor.executionState.insertIssues(); } }
Source:
void canExecuteAsyncJavascript() { long value = (Long) Selenide.executeAsyncJavaScript( "var callback = arguments[0]; setTimeout(function() { callback(10); }, 50);" ); assertThat(value).isEqualTo(10); }

Target:
void canExecuteAsyncJavascript() { long value = (Long) Selenide.executeAsyncJavaScript( "var callback = arguments[arguments.length - 1]; setTimeout(function() { callback(10); }, 50);" ); assertThat(value).isEqualTo(10); }
Source:
public List<?> predict(int tenantId, String userName, long modelId, List<String[]> data) throws MLModelHandlerException { if (!isValidModelId(tenantId, userName, modelId)) { String msg = String.format("Failed to build the model. Invalid model id: %s for tenant: %s and user: %s", modelId, tenantId, userName); throw new MLModelHandlerException(msg); } MLModel builtModel = retrieveModel(modelId); if (builtModel.getFeatures().size() != data.get(0).length) { String msg = String.format("Failed to predict from model. ML model with model id: %s has %s features " + "but predict dataset has %s features. Incompatible number of features.", modelId, builtModel.getFeatures().size(), data.get(0).length); throw new MLModelHandlerException(msg); } Predictor predictor = new Predictor(modelId, builtModel, data); List<?> predictions = predictor.predict(); log.info(String.format("Prediction from model [id] %s was successful.", modelId)); return predictions; }

Target:
public List<?> predict(int tenantId, String userName, long modelId, List<String[]> data) throws MLModelHandlerException { if (!isValidModelId(tenantId, userName, modelId)) { String msg = String.format("Failed to build the model. Invalid model id: %s for tenant: %s and user: %s", modelId, tenantId, userName); throw new MLModelHandlerException(msg); } MLModel builtModel = retrieveModel(modelId); if (builtModel.getFeatures().size() != data.get(0).length) { String msg = String.format("Prediction failed from model [id] %s since the number of features of model" + " [%s] doesn't match the number of features in the input data [%s]", modelId, builtModel.getFeatures().size(), data.get(0).length); throw new MLModelHandlerException(msg); } Predictor predictor = new Predictor(modelId, builtModel, data); List<?> predictions = predictor.predict(); log.info(String.format("Prediction from model [id] %s was successful.", modelId)); return predictions; }
Source:
public static String convertArtifactToPath(Artifact artifact) { final Gav gav = new Gav(artifact.getGroupId(), StringUtils.defaultString(artifact.getArtifactId()), StringUtils.defaultString(artifact.getVersion()), artifact.getClassifier(), artifact.getType(), null, null, null, false, null, false, null); return M2_GAV_CALCULATOR.gavToPath(gav).substring(1); }

Target:
public static String convertArtifactToPath(Artifact artifact) { final Gav gav = convertArtifactToGav(artifact); return M2_GAV_CALCULATOR.gavToPath(gav).substring(1); }
Source:
private void failUnpublished(final List<BatchItem> batch, final String reason) { batch.stream() .filter(item -> !(item.getResponse().getPublishingStatus().equals(EventPublishingStatus.SUBMITTED))) .forEach(item -> item.updateStatusAndDetail(EventPublishingStatus.FAILED, reason)); }

Target:
private void failUnpublished(final List<BatchItem> batch, final String reason) { batch.stream() .filter(item -> item.getResponse().getPublishingStatus() != EventPublishingStatus.SUBMITTED) .forEach(item -> item.updateStatusAndDetail(EventPublishingStatus.FAILED, reason)); }
Source:
private void animateProgress(int milliPosition, int milliDuration) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ProgressBar progressBar = (ProgressBar)findViewById(R.id.circular_progress_bar); animation = ObjectAnimator.ofInt(progressBar, "progress", 0, 500); animation.setDuration(milliDuration); animation.setCurrentPlayTime(milliPosition); animation.setInterpolator(new DecelerateInterpolator()); animation.start(); } }

Target:
private void animateProgress(int milliPosition, int milliDuration) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ProgressBar progressBar = (ProgressBar)findViewById(R.id.circular_progress_bar); int startPosition = 0; int progressDuration = 500; animation = ObjectAnimator.ofInt(progressBar, "progress", startPosition, progressDuration); animation.setDuration(milliDuration); animation.setCurrentPlayTime(milliPosition); animation.setInterpolator(new DecelerateInterpolator()); animation.start(); } }
Source:
public void channelLinked(ChannelUID channelUID) { switch (channelUID.getId()) { case CHANNEL_SWITCH: if (channels.size() > 0) { channels.get(0).addListener(channelUID, this, ListenerType.ONOFF); } break; case CHANNEL_BRIGHTNESS: if (channels.size() > 0) { channels.get(0).addListener(channelUID, this, ListenerType.VALUE); } break; case CHANNEL_COLOR: if (channels.size() > 2) { channels.get(0).addListener(channelUID, this, ListenerType.VALUE); channels.get(1).addListener(channelUID, this, ListenerType.VALUE); channels.get(2).addListener(channelUID, this, ListenerType.VALUE); } else { logger.warn("cannot link color channel with less than three DMX channels in thing {}", this.thing.getUID()); } break; default: logger.warn("channel not supported in thing {}", channelUID.getId(), this.thing.getUID()); } }

Target:
public void channelLinked(ChannelUID channelUID) { logger.trace("trying to add listeners for (Thing [})", channelUID, this.thing.getUID()); switch (channelUID.getId()) { case CHANNEL_SWITCH: if (channels.size() > 0) { channels.get(0).addListener(channelUID, this, ListenerType.ONOFF); } break; case CHANNEL_BRIGHTNESS: if (channels.size() > 0) { channels.get(0).addListener(channelUID, this, ListenerType.VALUE); } break; case CHANNEL_COLOR: if (channels.size() > 3) { channels.get(0).addListener(channelUID, this, ListenerType.VALUE); channels.get(1).addListener(channelUID, this, ListenerType.VALUE); channels.get(2).addListener(channelUID, this, ListenerType.VALUE); break; } default: logger.warn("channel not supported in thing {}", channelUID.getId(), this.thing.getUID()); } }
Source:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final Intent intent = new Intent(this, videoList[position].activity); intent.putExtra("embedcode", videoList[position].embedCode); intent.putExtra("embedcode2", videoList[position].embedCode2); intent.putExtra("pcode", videoList[position].pcode); intent.putExtra("domain", videoList[position].domain); startActivity(intent); }

Target:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final Intent intent = new Intent(this, videoList[position].activity); intent.putExtra("embedcode", videoList[position].embedCode); intent.putExtra("secondEmbedCode", videoList[position].secondEmbedCode); intent.putExtra("pcode", videoList[position].pcode); intent.putExtra("domain", videoList[position].domain); startActivity(intent); }
Source:
DataEntity entity() throws EntityNotFoundException; StructuredData data(RelativePath dataPath); StructuredData bareData(RelativePath dataPath); @Override default boolean exists() { try { bareData(RelativePath.empty().get()); return true; } catch (EntityNotFoundException | RelationNotFoundException ignored) { return false; } }

Target:
DataEntity entity() throws EntityNotFoundException; StructuredData data(RelativePath dataPath); StructuredData flatData(RelativePath dataPath); @Override default boolean exists() { try { flatData(RelativePath.empty().get()); return true; } catch (EntityNotFoundException | RelationNotFoundException ignored) { return false; } }
Source:
public UIScreenLayer pushScreen(UIElement element) { if (element != null && element.getRootWidget() instanceof CoreScreenLayer) { CoreScreenLayer result = (CoreScreenLayer) element.getRootWidget(); if (!result.equals(screens.peek())) { result.setId(element.getURI().toNormalisedSimpleString()); pushScreen(result, element.getURI()); } return result; } return null; }

Target:
public UIScreenLayer pushScreen(UIElement element) { if (element != null && element.getRootWidget() instanceof CoreScreenLayer) { CoreScreenLayer result = (CoreScreenLayer) element.getRootWidget(); if (!screens.contains(result)) { result.setId(element.getURI().toNormalisedSimpleString()); pushScreen(result, element.getURI()); } return result; } return null; }
Source:
private void onProjectUpdated(ProjectUpdatedEvent event) { ExecuteCommandParams params = new ExecuteCommandParams( GET_PROJECT_SOURCE_LOCATIONS_COMMAND, singletonList(prefixURI(event.getProjectPath()))); languageServer .getWorkspaceService() .executeCommand(params) .thenAccept( result -> { if (result == null) { return; } Type type = new TypeToken<ArrayList<String>>() {}.getType(); List<String> paths = gson.fromJson(gson.toJson(result), type); paths.stream().forEach(f -> matcher.accept(Paths.get(removeUriScheme(prefixURI(f))))); }); }

Target:
private void onProjectUpdated(ProjectUpdatedEvent event) { ExecuteCommandParams params = new ExecuteCommandParams( GET_PROJECT_SOURCE_LOCATIONS_COMMAND, singletonList(prefixURI(event.getProjectPath()))); ExtendedLanguageServer languageServer = lsRegistry.byId(JavaModule.LS_ID); if (languageServer == null) { return; } languageServer .getServer() .getWorkspaceService() .executeCommand(params) .thenAccept( result -> { if (result == null) { return; } Type type = new TypeToken<ArrayList<String>>() {}.getType(); List<String> paths = gson.fromJson(gson.toJson(result), type); paths.stream().forEach(f -> matcher.accept(Paths.get(removeUriScheme(prefixURI(f))))); }); }
Source:
public void findOneByDefault() throws Exception { List<AnnotationMetadataMongo> annotationMetadataMongoList = repository.findByDefaultVersionIsTrue(); assertEquals(1, annotationMetadataMongoList.size()); AnnotationMetadataMongo annotationMetadataMongo = annotationMetadataMongoList.get(0); assertEquals(true, annotationMetadataMongo.isDefault()); }

Target:
public void findOneByDefault() throws Exception { List<AnnotationMetadataMongo> annotationMetadataMongoList = repository.findByDefaultVersionTrue(); assertEquals(1, annotationMetadataMongoList.size()); AnnotationMetadataMongo annotationMetadataMongo = annotationMetadataMongoList.get(0); assertTrue(annotationMetadataMongo.isDefaultVersion()); }
Source:
public static String getEncodedPathInfo(HttpServletRequest req) { String servletPath = req.getServletPath(); int servletPathLength = servletPath.length(); String requestUri = req.getRequestURI(); String pathInfo = requestUri.substring(req.getContextPath().length()) .replaceAll("[/]{2,}", "/"); if (pathInfo.startsWith(servletPath)) { pathInfo = pathInfo.substring(servletPathLength); if (pathInfo.isEmpty() && servletPathLength > 0) { pathInfo = null; } } else { pathInfo = null; } return pathInfo; }

Target:
public static String getEncodedPathInfo(HttpServletRequest req) { return getEncodedPathInfo(req.getServletPath(), req.getRequestURI(), req.getContextPath()); }
Source:
public ValidationResult validateThereIsEnoughOfFreeMacs(List<? extends VmNic> vmNics, MacPool macPool) { Stream<? extends VmNic> nicsWithoutMacAddress = vmNics.stream().filter(vmNic -> !doesNicHaveMacAddress(vmNic)); long requiredMacs = nicsWithoutMacAddress.count(); boolean notEnoughOfMacs = requiredMacs > 0 && macPool.getAvailableMacsCount() < requiredMacs; return ValidationResult.failWith(EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES) .when(notEnoughOfMacs); }

Target:
public ValidationResult validateThereIsEnoughOfFreeMacs(List<? extends VmNic> vmNics, MacPool macPool) { Stream<? extends VmNic> nicsWithoutMacAddress = vmNics.stream().filter(this::nicWithoutMacAddress); long requiredMacs = nicsWithoutMacAddress.count(); boolean notEnoughOfMacs = requiredMacs > 0 && macPool.getAvailableMacsCount() < requiredMacs; return ValidationResult.failWith(EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES) .when(notEnoughOfMacs); }
Source:
public NameRevCommand add(Iterable<ObjectId> ids) throws MissingObjectException, JGitInternalException { for (ObjectId id : ids) { add(id); } return this; }

Target:
public NameRevCommand add(Iterable<ObjectId> ids) throws MissingObjectException, JGitInternalException { for (ObjectId id : ids) add(id); return this; }
Source:
public Boolean checkNextPageButtonIsEnabled() { WaitUtils.sleepQuietly(1); return seleniumWebDriver.findElement(By.id(Locators.NEXT_BUTTON)).isEnabled(); }

Target:
public Boolean checkNextPageButtonIsEnabled() { return seleniumWebDriver.findElement(By.id(Locators.NEXT_BUTTON)).isEnabled(); }
Source:
public void testCustomModelCount() { final KieServices ks = KieServices.Factory.get(); final KieFileSystem kfs = ks.newKieFileSystem(); final KieModuleModel kmm = ks.newKieModuleModel(); kmm.setConfigurationProperty("org.kie.dmn.profiles.CustomModelCountDMNProfile", CustomModelCountDMNProfile.class.getCanonicalName()); kfs.writeKModuleXML(kmm.toXML()); kfs.write(ks.getResources().newClassPathResource("customModelCount.dmn", this.getClass())); final KieBuilder kieBuilder = ks.newKieBuilder(kfs).buildAll(); final Results results = kieBuilder.getResults(); assertThat(results.getMessages().toString(), results.hasMessages(org.kie.api.builder.Message.Level.ERROR), is(false)); final KieContainer kieContainer = ks.newKieContainer(ks.getRepository().getDefaultReleaseId()); final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "Drawing 1"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final DMNContext context = DMNFactory.newContext(); final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); System.out.println(dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); final DMNContext result = dmnResult.getContext(); assertThat(result.get("main decision"), is(new BigDecimal(1))); }

Target:
public void testCustomModelCount() { final KieServices ks = KieServices.Factory.get(); final KieFileSystem kfs = ks.newKieFileSystem(); final KieModuleModel kmm = ks.newKieModuleModel(); kmm.setConfigurationProperty("org.kie.dmn.profiles.CustomModelCountDMNProfile", CustomModelCountDMNProfile.class.getCanonicalName()); kfs.writeKModuleXML(kmm.toXML()); kfs.write(ks.getResources().newClassPathResource("customModelCount.dmn", this.getClass())); final KieBuilder kieBuilder = ks.newKieBuilder(kfs).buildAll(); final Results results = kieBuilder.getResults(); assertThat(results.getMessages().toString(), results.hasMessages(org.kie.api.builder.Message.Level.ERROR), is(false)); final KieContainer kieContainer = ks.newKieContainer(ks.getRepository().getDefaultReleaseId()); final DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "Drawing 1"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final DMNContext context = DMNFactory.newContext(); final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); final DMNContext result = dmnResult.getContext(); assertThat(result.get("main decision"), is(new BigDecimal(1))); }
Source:
private TaskData doInBackgroundAnswerCard(TaskData... params) { Collection col = CollectionHelper.getInstance().getCol(mContext); AbstractSched sched = col.getSched(); Card oldCard = params[0].getCard(); int ease = params[0].getInt(); Card newCard = null; Timber.i(oldCard != null ? "Answering card" : "Obtaining card"); try { DB db = col.getDb(); db.getDatabase().beginTransaction(); try { if (oldCard != null) { Timber.i("Answering card %d", oldCard.getId()); sched.answerCard(oldCard, ease); } newCard = getCard(sched); if (newCard != null) { newCard._getQA(true); } publishProgress(new TaskData(newCard)); db.getDatabase().setTransactionSuccessful(); } finally { db.getDatabase().endTransaction(); } } catch (RuntimeException e) { Timber.e(e, "doInBackgroundAnswerCard - RuntimeException on answering card"); AnkiDroidApp.sendExceptionReport(e, "doInBackgroundAnswerCard"); return new TaskData(false); } return new TaskData(true); }

Target:
private TaskData doInBackgroundAnswerCard(TaskData... params) { Collection col = CollectionHelper.getInstance().getCol(mContext); AbstractSched sched = col.getSched(); Card oldCard = params[0].getCard(); int ease = params[0].getInt(); Card newCard = null; Timber.i(oldCard != null ? "Answering card" : "Obtaining card"); try { DB db = col.getDb(); db.getDatabase().beginTransaction(); try { if (oldCard != null) { Timber.i("Answering card %d", oldCard.getId()); sched.answerCard(oldCard, ease); } newCard = sched.getCard(); if (newCard != null) { newCard._getQA(true); } publishProgress(new TaskData(newCard)); db.getDatabase().setTransactionSuccessful(); } finally { db.getDatabase().endTransaction(); } } catch (RuntimeException e) { Timber.e(e, "doInBackgroundAnswerCard - RuntimeException on answering card"); AnkiDroidApp.sendExceptionReport(e, "doInBackgroundAnswerCard"); return new TaskData(false); } return new TaskData(true); }
Source:
public String getType(final Optional<String> operatorFromCell) throws ValueResolveException { try { Logger.add("Getting type from utils"); if (operatorFromCell.isPresent()) { return conditionColumn.getFieldType(); } final String type = utils.getType(conditionColumn, columnIndex); Logger.add("Resolver type from utils: " + type); return type; } catch (final Exception e) { throw new ValueResolveException("Failed to get type for " + ToString.toString(conditionColumn) + " columnIndex: " + columnIndex, e); } }

Target:
public String getType(final Optional<String> operatorFromCell) throws ValueResolveException { try { if (operatorFromCell.isPresent()) { return conditionColumn.getFieldType(); } final String type = utils.getType(conditionColumn, columnIndex); return type; } catch (final Exception e) { throw new ValueResolveException("Failed to get type for " + ToString.toString(conditionColumn) + " columnIndex: " + columnIndex, e); } }
Source:
public WikibaseUris(String host) { root = "http://" + host; String rootHttps = "https://" + host; entityData = root + "/wiki/Special:EntityData/"; entityDataHttps = rootHttps + "/wiki/Special:EntityData/"; entity = root + "/entity/"; statement = entity + "statement/"; value = root + "/value/"; reference = root + "/reference/"; prop = root + "/prop/"; }

Target:
public WikibaseUris(String host) { root = "http://" + host; rootHttps = "https://" + host; entityData = root + "/wiki/Special:EntityData/"; entityDataHttps = rootHttps + "/wiki/Special:EntityData/"; entity = root + "/entity/"; statement = entity + "statement/"; value = root + "/value/"; reference = root + "/reference/"; prop = root + "/prop/"; }
Source:
public Optional<ColumnMapper<?>> findColumnMapperFor(Type type, StatementContext ctx) { ColumnMapper<?> mapper = columnCache.get(type); if (mapper != null) { return Optional.of(mapper); } mapper = columnFactories.stream() .flatMap(factory -> toStream(factory.build(type, ctx))) .findFirst() .orElse(null); if (mapper != null) { columnCache.put(type, mapper); return Optional.of(mapper); } return Optional.empty(); }

Target:
public Optional<ColumnMapper<?>> findColumnMapperFor(Type type, StatementContext ctx) { ColumnMapper<?> cached = columnCache.get(type); if (cached != null) { return Optional.of(cached); } Optional<ColumnMapper<?>> mapper = columnFactories.stream() .flatMap(factory -> toStream(factory.build(type, ctx))) .findFirst(); mapper.ifPresent(m -> columnCache.put(type, m)); return mapper; }
Source:
public void prepareConfigForTestClass(Class<?> testClass, Method testMethod) { for(Class<?> parentClass : ClassUtils.getAllSuperclasses(testClass)) { classLevelOverrides.setProperties(testPropertyOverrideAnnotationReader.getPropertiesForAnnotation(parentClass.getAnnotation(TestPropertyOverride.class))); } classLevelOverrides.setProperties(testPropertyOverrideAnnotationReader.getPropertiesForAnnotation(testClass.getAnnotation(TestPropertyOverride.class))); methodLevelOverrides.setProperties(testPropertyOverrideAnnotationReader.getPropertiesForAnnotation(testMethod.getAnnotation(TestPropertyOverride.class))); }

Target:
public void prepareConfigForTestClass(Class<?> testClass, Method testMethod) { for(Class<?> parentClass : getAllSuperClassesInReverseOrder(testClass)) { classLevelOverrides.setProperties(testPropertyOverrideAnnotationReader.getPropertiesForAnnotation(parentClass.getAnnotation(TestPropertyOverride.class))); } classLevelOverrides.setProperties(testPropertyOverrideAnnotationReader.getPropertiesForAnnotation(testClass.getAnnotation(TestPropertyOverride.class))); methodLevelOverrides.setProperties(testPropertyOverrideAnnotationReader.getPropertiesForAnnotation(testMethod.getAnnotation(TestPropertyOverride.class))); }
Source:
private void updatePartitionStateIfChanged(Partition partition) { for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { String dcName = entry.getKey(); HelixAdmin dcAdmin = entry.getValue(); String partitionName = Long.toString(partition.getId()); boolean isSealed = partition.getPartitionState().equals(PartitionState.READ_ONLY); List<ReplicaId> replicaList = getReplicasInDc(partition, dcName); for (ReplicaId replicaId : replicaList) { DataNodeId node = replicaId.getDataNodeId(); String instanceName = node.getHostname() + "_" + node.getPort(); InstanceConfig instanceConfig = dcAdmin.getInstanceConfig(clusterName, instanceName); List<String> currentSealedPartitions = instanceConfig.getRecord().getListField("SEALED"); if (isSealed && !currentSealedPartitions.contains(partitionName)) { List<String> newSealedPartitionsList = new ArrayList<>(currentSealedPartitions); newSealedPartitionsList.add(partitionName); instanceConfig.getRecord().setListField("SEALED", newSealedPartitionsList); dcAdmin.setInstanceConfig(clusterName, instanceName, instanceConfig); } else if (!isSealed && currentSealedPartitions.contains(partitionName)) { List<String> newSealedPartitionsList = new ArrayList<>(currentSealedPartitions); newSealedPartitionsList.remove(partitionName); instanceConfig.getRecord().setListField("SEALED", newSealedPartitionsList); dcAdmin.setInstanceConfig(clusterName, instanceName, instanceConfig); } } } }

Target:
private void updatePartitionStateIfChanged(Partition partition) { for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { String dcName = entry.getKey(); HelixAdmin dcAdmin = entry.getValue(); String partitionName = Long.toString(partition.getId()); boolean isSealed = partition.getPartitionState().equals(PartitionState.READ_ONLY); List<ReplicaId> replicaList = getReplicasInDc(partition, dcName); for (ReplicaId replicaId : replicaList) { DataNodeId node = replicaId.getDataNodeId(); String instanceName = getInstanceName(node); InstanceConfig instanceConfig = dcAdmin.getInstanceConfig(clusterName, instanceName); List<String> currentSealedPartitions = instanceConfig.getRecord().getListField(SEALED_STR); List<String> newSealedPartitionsList = new ArrayList<>(currentSealedPartitions); if (isSealed && !currentSealedPartitions.contains(partitionName)) { newSealedPartitionsList.add(partitionName); } else if (!isSealed && currentSealedPartitions.contains(partitionName)) { newSealedPartitionsList.remove(partitionName); } instanceConfig.getRecord().setListField(SEALED_STR, newSealedPartitionsList); } } }
Source:
private void checkOverwriteDjangoHashers(AstNode expressionStatement) { AstNode lhsExpression = getLHSExpression(expressionStatement); if (lhsExpression == null) { return; } AstNode attributeRef = lhsExpression.getFirstDescendant(PythonGrammar.ATTRIBUTE_REF); if (attributeRef != null) { AstNode atom = attributeRef.getFirstChild(PythonGrammar.ATOM); if (atom != null && getQualifiedName(atom).equals("django.conf.settings") && attributeRef.getLastChild(PythonGrammar.NAME).getTokenValue().equals("PASSWORD_HASHERS")) { addIssue(expressionStatement, MESSAGE); } } if (getContext().pythonFile().fileName().equals("global_settings.py") && lhsExpression.getTokenValue().equals("PASSWORD_HASHERS")) { addIssue(expressionStatement, MESSAGE); } }

Target:
private void checkOverwriteDjangoHashers(AstNode expressionStatement) { List<AstNode> lhsExpressions = getLHSExpressions(expressionStatement); if (lhsExpressions == null) { return; } if (isOverwritingDjangoHashers(lhsExpressions)) { addIssue(expressionStatement, MESSAGE); return; } if (getContext().pythonFile().fileName().equals("global_settings.py") && lhsExpressions.stream().anyMatch(expression -> expression.getTokenValue().equals("PASSWORD_HASHERS"))) { addIssue(expressionStatement, MESSAGE); } }
Source:
public PlanNode visitTableScan(TableScanNode tableScan, Void context) { if (!isPushdownFilterSupported(session, tableScan.getTable())) { return tableScan; } HiveMetadata hiveMetadata = getMetadata(tableScan.getTable()); ConnectorPushdownFilterResult pushdownFilterResult = pushdownFilter( session, hiveMetadata, tableScan.getTable().getConnectorHandle(), TRUE_CONSTANT, tableScan.getTable().getLayout()); if (pushdownFilterResult.getLayout().getPredicate().isNone()) { return new ValuesNode(idAllocator.getNextId(), tableScan.getOutputVariables(), ImmutableList.of()); } TableHandle handle = tableScan.getTable(); return new TableScanNode( tableScan.getId(), new TableHandle(handle.getConnectorId(), handle.getConnectorHandle(), handle.getTransaction(), Optional.of(pushdownFilterResult.getLayout().getHandle())), tableScan.getOutputVariables(), tableScan.getAssignments(), pushdownFilterResult.getLayout().getPredicate(), TupleDomain.all()); }

Target:
public PlanNode visitTableScan(TableScanNode tableScan, Void context) { if (!isPushdownFilterSupported(session, tableScan.getTable())) { return tableScan; } TableHandle handle = tableScan.getTable(); HiveMetadata hiveMetadata = getMetadata(handle); ConnectorPushdownFilterResult pushdownFilterResult = pushdownFilter( session, hiveMetadata, handle.getConnectorHandle(), TRUE_CONSTANT, handle.getLayout()); if (pushdownFilterResult.getLayout().getPredicate().isNone()) { return new ValuesNode(idAllocator.getNextId(), tableScan.getOutputVariables(), ImmutableList.of()); } return new TableScanNode( tableScan.getId(), new TableHandle(handle.getConnectorId(), handle.getConnectorHandle(), handle.getTransaction(), Optional.of(pushdownFilterResult.getLayout().getHandle())), tableScan.getOutputVariables(), tableScan.getAssignments(), pushdownFilterResult.getLayout().getPredicate(), TupleDomain.all()); }
Source:
default boolean setTransformSafely(Transform<World> transform) { checkNotNull(transform, "The transform cannot be null!"); return Sponge.getGame().getTeleportHelper() .getSafeLocation(transform.getLocation()) .map(safe -> this.setTransform(transform.setLocation(safe))) .orElse(false); }

Target:
default boolean setTransformSafely(Transform<World> transform) { checkNotNull(transform, "The transform cannot be null!"); return setLocationAndRotationSafely(transform.getLocation(), transform.getRotation()); }
Source:
private String getACSUrlWithTenantPartitioning(String acsUrl, String tenantDomain) { return acsUrl; }

Target:
private String getACSUrlWithTenantPartitioning(String acsUrl, String tenantDomain) { String acsUrlWithTenantDomain = acsUrl; if (tenantDomain != null && "true".equals(IdentityUtil.getProperty( IdentityConstants.ServerConfig.SSO_TENANT_PARTITIONING_ENABLED))) { acsUrlWithTenantDomain = acsUrlWithTenantDomain + "?" + MultitenantConstants.TENANT_DOMAIN + "=" + tenantDomain; } return acsUrlWithTenantDomain; }
Source:
public String getArticlesFeed(SessionLanguage language) throws IOException, FeedException { SyndFeed feed = new SyndFeedImpl(); feed.setFeedType("rss_2.0"); feed.setTitle("Mix-IT articles"); feed.setLink(MIX_IT_ARTICLES); feed.setDescription(" "); List<Article> articles = articleRepository.findAllPublishedArticle(); List<SyndEntry> entries = new ArrayList<>(); feed.setEntries(entries); for (Article article : articles) { SyndEntry entry = article.buildRssEntry(language); entries.add(entry); } SyndFeedOutput output = new SyndFeedOutput(); return output.outputString(feed); }

Target:
private String getArticlesFeed(SessionLanguage language) throws IOException, FeedException { String baseUrl = absoluteUrlFactory.getBaseUrl(); SyndFeed feed = new SyndFeedImpl(); feed.setFeedType("rss_2.0"); feed.setTitle("Mix-IT articles"); feed.setLink(baseUrl + MIX_IT_ARTICLES); feed.setDescription(" "); List<Article> articles = articleRepository.findAllPublishedArticle(); List<SyndEntry> entries = new ArrayList<>(); feed.setEntries(entries); for (Article article : articles) { SyndEntry entry = article.buildRssEntry(baseUrl, language); entries.add(entry); } SyndFeedOutput output = new SyndFeedOutput(); return output.outputString(feed); }
Source:
public void setupMocks() { MockBrowserCapabilitiesRegistry registry = MockBrowserCapabilitiesRegistry.createSingletonRegistry(); desiredCapabilities = new DesiredCapabilities(registry.getAllBrowserCapabilities().iterator().next() .getRawCapabilities()); permanentStorage = new MockReusedSessionPermanentStorage(); when(serviceLoader.onlyOne(ReusedSessionPermanentStorage.class)).thenReturn(permanentStorage); bind(ApplicationScoped.class, ServiceLoader.class, serviceLoader); try { hubUrl = new URL("http://localhost:5555/wd/hub/"); } catch (MalformedURLException e) { throw new IllegalStateException(e); } runSeleniumServer(); initializationParameter = new InitializationParameter(hubUrl, desiredCapabilities); String browser = System.getProperty("browser", "phantomjs").toLowerCase(); if (browser.equals("chromeheadless")) { when(configuration.getBrowser()).thenReturn("chromeheadless"); ChromeDriverFactory.setChromeOptions(configuration, (DesiredCapabilities) desiredCapabilities); } when(configuration.getBrowser()).thenReturn("xyz"); when(configuration.isRemoteReusable()).thenReturn(true); when(configuration.getCapabilities()).thenReturn(desiredCapabilities); when(configuration.getRemoteAddress()).thenReturn(hubUrl); configuration.setSeleniumServerArgs("-debug true"); }

Target:
public void setupMocks() { MockBrowserCapabilitiesRegistry registry = MockBrowserCapabilitiesRegistry.createSingletonRegistry(); desiredCapabilities = new DesiredCapabilities(registry.getAllBrowserCapabilities().iterator().next() .getRawCapabilities()); permanentStorage = new MockReusedSessionPermanentStorage(); when(serviceLoader.onlyOne(ReusedSessionPermanentStorage.class)).thenReturn(permanentStorage); bind(ApplicationScoped.class, ServiceLoader.class, serviceLoader); try { hubUrl = new URL("http://localhost:5555/wd/hub/"); } catch (MalformedURLException e) { throw new IllegalStateException(e); } runSeleniumServer(); initializationParameter = new InitializationParameter(hubUrl, desiredCapabilities); String browser = System.getProperty("browser").toLowerCase(); if (browser.equals("chromeheadless")) { when(configuration.getBrowser()).thenReturn("chromeheadless"); new ChromeDriverFactory().setChromeOptions(configuration, (DesiredCapabilities) desiredCapabilities); } when(configuration.getBrowser()).thenReturn("xyz"); when(configuration.isRemoteReusable()).thenReturn(true); when(configuration.getCapabilities()).thenReturn(desiredCapabilities); when(configuration.getRemoteAddress()).thenReturn(hubUrl); configuration.setSeleniumServerArgs("-debug true"); }
Source:
private void addYoutubeCookies(@Nonnull String cookies) { String c_s_gl = ""; String c_goojf = ""; String[] parts = cookies.split(";"); for (String part : parts) { String trimmedPart = part.trim(); if (trimmedPart.startsWith("s_gl")) { c_s_gl = trimmedPart; } if (trimmedPart.startsWith("goojf")) { c_goojf = trimmedPart; } } if (c_s_gl.length() > 0 && c_goojf.length() > 0) { addCookie(cookies); } }

Target:
private void addYoutubeCookies(@Nonnull String cookies) { if (cookies.contains("s_gl=") || cookies.contains("goojf=") || cookies.contains("VISITOR_INFO1_LIVE=")) { addCookie(cookies); } }
Source:
BinaryMetadataFileStore( final ConcurrentMap<Integer, BinaryMetadataHolder> metadataLocCache, final GridKernalContext ctx, final IgniteLogger log, @Nullable final File binaryMetadataFileStoreDir ) throws IgniteCheckedException { this.metadataLocCache = metadataLocCache; this.ctx = ctx; this.log = log; if (!CU.isPersistenceEnabled(ctx.config())) { this.fileIOFactory = null; return; } else this.fileIOFactory = ctx.config().getDataStorageConfiguration().getFileIOFactory(); if (binaryMetadataFileStoreDir != null) workDir = binaryMetadataFileStoreDir; else { final String subFolder = ctx.pdsFolderResolver().resolveFolders().folderName(); workDir = new File(U.resolveWorkDirectory( ctx.config().getWorkDirectory(), "binary_meta", false ), subFolder); } U.ensureDirectory(workDir, "directory for serialized binary metadata", log); }

Target:
BinaryMetadataFileStore( final ConcurrentMap<Integer, BinaryMetadataHolder> metadataLocCache, final GridKernalContext ctx, final IgniteLogger log, @Nullable final File binaryMetadataFileStoreDir ) throws IgniteCheckedException { this.metadataLocCache = metadataLocCache; this.ctx = ctx; this.log = log; if (!CU.isPersistenceEnabled(ctx.config())) return; fileIOFactory = ctx.config().getDataStorageConfiguration().getFileIOFactory(); if (binaryMetadataFileStoreDir != null) workDir = binaryMetadataFileStoreDir; else { final String subFolder = ctx.pdsFolderResolver().resolveFolders().folderName(); workDir = new File(U.resolveWorkDirectory( ctx.config().getWorkDirectory(), "binary_meta", false ), subFolder); } U.ensureDirectory(workDir, "directory for serialized binary metadata", log); }
Source:
protected void unloadAndKillData(final String dataSource) throws Exception { ArrayList<String> dates = coordinator.getSegmentDatesForDataSource(dataSource); Collections.sort (dates); String first = dates.get(0).split("/")[0]; String last = dates.get(dates.size() -1).split("/")[1]; unloadAndKillData (dataSource, first, last); }

Target:
protected void unloadAndKillData(final String dataSource) throws Exception { ArrayList<String> intervals = coordinator.getSegmentIntervals(dataSource); Collections.sort (intervals); String first = intervals.get(0).split("/")[0]; String last = intervals.get(intervals.size() -1).split("/")[1]; unloadAndKillData (dataSource, first, last); }
Source:
public static void canSetConfigParm() throws Exception { SWTBotShell shell = openProperties("Autotools", "Configure Settings"); bot.treeWithLabel("Configure Settings").expandNode("configure") .select("Advanced"); SWTBotText text = bot.textWithLabel("Additional command-line options"); text.typeText("--enable-jeff"); bot.button("OK").click(); bot.waitUntil(Conditions.shellCloses(shell), 120000); IProject project = checkProject(); assertTrue(project != null); IPath path = project.getLocation(); path = path.append(".autotools"); File f = new File(path.toOSString()); assertTrue(f.exists()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document d = db.parse(f); Element e = d.getDocumentElement(); NodeList cfgs = e.getElementsByTagName("configuration"); assertEquals(1, cfgs.getLength()); Node n = cfgs.item(0); NodeList l = n.getChildNodes(); boolean foundUser = false; for (int y = 0; y < l.getLength(); ++y) { Node child = l.item(y); if (child.getNodeName().equals("option")) { NamedNodeMap optionAttrs = child.getAttributes(); Node idNode = optionAttrs.getNamedItem("id"); Node valueNode = optionAttrs.getNamedItem("value"); assertTrue(idNode != null); assertTrue(valueNode != null); String id = idNode.getNodeValue(); String value = valueNode.getNodeValue(); if (id.equals("user")) { foundUser = true; assertEquals(value, "--enable-jeff"); } } } assertTrue(foundUser); canBuildWithConfigParm(); }

Target:
public void canSetConfigParm() throws Exception { IProject project = checkProject(); assertTrue(project != null); IPath path = project.getLocation(); path = path.append(".autotools"); File f = new File(path.toOSString()); assertTrue(f.exists()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document d = db.parse(f); Element e = d.getDocumentElement(); NodeList cfgs = e.getElementsByTagName("configuration"); assertTrue(cfgs.getLength() > 0); Node n = cfgs.item(0); NodeList l = n.getChildNodes(); boolean foundUser = false; for (int y = 0; y < l.getLength(); ++y) { Node child = l.item(y); if (child.getNodeName().equals("option")) { NamedNodeMap optionAttrs = child.getAttributes(); Node idNode = optionAttrs.getNamedItem("id"); Node valueNode = optionAttrs.getNamedItem("value"); assertTrue(idNode != null); assertTrue(valueNode != null); String id = idNode.getNodeValue(); String value = valueNode.getNodeValue(); if (id.equals("user")) { foundUser = true; assertEquals(value, "--enable-jeff"); } } } assertTrue(foundUser); }
Source:
private static MetricFamilySamples.Sample buildStatusSample(String name, String status, double value) { return new MetricFamilySamples.Sample( name, Collections.singletonList("status"), Collections.singletonList(status), value); }

Target:
private static MetricFamilySamples.Sample buildStatusSample(String name, String status, double value) { return new MetricFamilySamples.Sample( name, Collections.singletonList("code"), Collections.singletonList(status), value); }
Source:
@Test public void getResourceById() throws IOException { Request request = new Request.Builder(RESOURCE_ID_URI).build(); Utils.ResourceResult result = Utils.getResources(mockPackageResourceContext(), request); assertThat(result.id).isEqualTo(RESOURCE_ID_1); }

Target:
@Test public void getResourceById() throws IOException { Request request = new Request.Builder(RESOURCE_ID_URI).build(); Resources resources = Utils.getResources(mockPackageResourceContext(), request); int id = Utils.getResourceId(resources, request); assertThat(id).isEqualTo(RESOURCE_ID_1); }
Source:
private WeightedDoubleReservoirSample(WeightedDoubleReservoirSample other) { checkArgument(other.size <= other.samples.length, "size must not be larger than samples"); this.size = other.size; this.samples = new double[other.samples.length]; this.weights = new double[other.weights.length]; System.arraycopy(other.samples, 0, samples, 0, size); System.arraycopy(other.weights, 0, weights, 0, size); checkArguments(); }

Target:
private WeightedDoubleReservoirSample(WeightedDoubleReservoirSample other) { this.count = other.count; this.samples = Arrays.copyOf(other.samples, other.samples.length); this.weights = Arrays.copyOf(other.weights, other.weights.length); }
Source:
private void initTls12IfNeeded() { if (Build.VERSION.SDK_INT >= 16 && Build.VERSION.SDK_INT < 22) { CommCareNetworkServiceGenerator.customizeRetrofitSetup(new ForceTLS12BuilderConfig()); } }

Target:
private void initTls12IfNeeded() { if (useConscryptSecurity()) { Security.insertProviderAt(Conscrypt.newProvider(), 1); } if (Build.VERSION.SDK_INT >= 16 && Build.VERSION.SDK_INT < 22) { CommCareNetworkServiceGenerator.customizeRetrofitSetup(new ForceTLS12BuilderConfig()); } }
Source:
public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(String principalName, PrincipalType principalType) { List<HiveObjectPrivilege> results = Collections.emptyList(); try { openTransaction(); results = convertDB(listPrincipalAllDBGrant(principalName, principalType)); commitTransaction(); } catch (Exception e) { throw new RuntimeException(e); } finally { rollbackAndCleanup(true, null); } return results; }

Target:
public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(String principalName, PrincipalType principalType) { List<HiveObjectPrivilege> results = Collections.emptyList(); boolean success = false; try { openTransaction(); results = convertDB(listPrincipalAllDBGrant(principalName, principalType)); success = commitTransaction(); } catch (Exception e) { throw new RuntimeException(e); } finally { rollbackAndCleanup(success, null); } return results; }
Source:
public List<String> getClusteringKeyPredicates() { if (clusteringPushDownResult.getDomainQuery().isEmpty()) { return ImmutableList.of(); } ImmutableList.Builder<String> clusteringColumnSql = ImmutableList.builder(); return clusteringColumnSql.add(Joiner.on(" AND ").join(clusteringPushDownResult.getDomainQuery())).build(); }

Target:
public String getClusteringKeyPredicates() { return clusteringPushDownResult.getDomainQuery(); }
Source:
public boolean isNull() { return false; }

Target:
public boolean isNull() { return true; }