auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initializeServerAndConfiguration() { try { Executor executor = Executor.newInstance(); File configurationFile = new File(settings.getServerConfigurationLocalFile()); if (configurationFile.exists()) { configuration = ServerConfiguration.loadFromFile(configurationFile); } else { configuration = ServerConfiguration.download(new URI("<LINK_0>"), executor); ServerConfiguration.saveToFile(configurationFile, configuration); } server = new AeriServer(executor, configuration, settings); } catch (Exception e) { log(WARN_CONFIGURATION_DOWNLOAD_FAILED, e); } }

Target:
private void initializeServerAndConfiguration() { try { Executor executor = Executor.newInstance(); File configurationFile = new File(settings.getServerConfigurationLocalFile()); if (configurationFile.exists()) { configuration = AeriServer.loadFromFile(configurationFile); } else { configuration = AeriServer.download(new URI("<LINK_0>"), executor); AeriServer.saveToFile(configurationFile, configuration); } server = new AeriServer(executor, configuration, settings); } catch (UnknownHostException e) { settings.setAction(SendAction.IGNORE); settings.setRememberSendAction(RememberSendAction.RESTART); } catch (Exception e) { log(WARN_CONFIGURATION_DOWNLOAD_FAILED, e); settings.setAction(SendAction.IGNORE); settings.setRememberSendAction(RememberSendAction.RESTART); } }
Source:
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { if (!config.getConfig(Constants.Compat.WAILA_CONFIG_BLOOD_TANK)) return currenttip; if (accessor.getPlayer().isSneaking() || config.getConfig(Constants.Compat.WAILA_CONFIG_BYPASS_SNEAK)) { if (accessor.getBlock() instanceof BlockBloodTank && accessor.getTileEntity() instanceof TileBloodTank) { TileBloodTank bloodTank = (TileBloodTank) accessor.getTileEntity(); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.tier", bloodTank.getBlockMetadata() + 1)); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.capacity") + ": " + bloodTank.getCapacity() + "mB"); NBTTagCompound tag = bloodTank.getUpdateTag().getCompoundTag(Constants.NBT.TANK); if (!Strings.isNullOrEmpty(tag.getString("FluidName")) && FluidStack.loadFluidStackFromNBT(tag) != null) { currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.type") + ": " + FluidStack.loadFluidStackFromNBT(tag).getLocalizedName()); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.amount") + ": " + tag.getInteger("Amount") + "/" + bloodTank.getCapacity() + "mB"); } } } else { currenttip.add(TextHelper.localizeEffect("waila.BloodMagic.sneak")); } return currenttip; }

Target:
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { if (!config.getConfig(Constants.Compat.WAILA_CONFIG_BLOOD_TANK)) return currenttip; if (accessor.getPlayer().isSneaking() || config.getConfig(Constants.Compat.WAILA_CONFIG_BYPASS_SNEAK)) { if (accessor.getBlock() instanceof BlockBloodTank && accessor.getTileEntity() instanceof TileBloodTank) { TileBloodTank bloodTank = (TileBloodTank) accessor.getTileEntity(); NBTTagCompound tag = accessor.getNBTData(); int capacity = tag.getInteger(Constants.NBT.ALTAR_CAPACITY); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.tier", bloodTank.getBlockMetadata() + 1)); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.capacity") + ": " + capacity + "mB"); tag = tag.getCompoundTag(Constants.NBT.TANK); FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tag); if (!Strings.isNullOrEmpty(tag.getString("FluidName")) && fluidStack != null) { currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.type") + ": " + fluidStack.getLocalizedName()); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.amount") + ": " + tag.getInteger("Amount") + "/" + capacity + "mB"); } } } else { currenttip.add(TextHelper.localizeEffect("waila.BloodMagic.sneak")); } return currenttip; }
Source:
protected Instance createEmptyParameterExpression(final Instance validator, final Model model) { Instance expression; if (isBonitaGroovyBasedValidator(validator)) { expression = StringToExpressionConverter.createExpressionInstance(model, "", "", Boolean.class.getName(), ExpressionConstants.CONSTANT_TYPE, true); } else { expression = StringToExpressionConverter.createExpressionInstance(model, "", "", String.class.getName(), ExpressionConstants.CONSTANT_TYPE, false); } return expression; }

Target:
protected Instance createEmptyParameterExpression(final Instance validator, final Model model) { final boolean isBonitaGroovyBasedValidator = isBonitaGroovyBasedValidator(validator); final String returnType = isBonitaGroovyBasedValidator ? Boolean.class.getName() : String.class.getName(); return StringToExpressionConverter.createExpressionInstance( model, "", "", returnType, ExpressionConstants.CONSTANT_TYPE, isBonitaGroovyBasedValidator); }
Source:
private List<FeedbackResponseAttributes> getSortedExistingResponses(FeedbackQuestionAttributes questionAttributes) { List<FeedbackResponseAttributes> existingResponses = bundle.questionResponseBundle.get(questionAttributes); Map<String, String> emailNamePair = this.bundle.getSortedRecipientList(questionAttributes.getFeedbackQuestionId()); existingResponses.sort(Comparator.comparing(existingResponse -> emailNamePair.get(existingResponse.recipient))); return existingResponses; }

Target:
private List<FeedbackResponseAttributes> getSortedExistingResponses(FeedbackQuestionAttributes questionAttributes) { List<FeedbackResponseAttributes> existingResponses = bundle.questionResponseBundle.get(questionAttributes); Map<String, String> emailNamePair = this.bundle.getSortedRecipientList(questionAttributes.getFeedbackQuestionId()); Comparator<FeedbackResponseAttributes> responsesComparator = (response1, response2) -> { if (emailNamePair.containsKey(response1.recipient) && emailNamePair.containsKey(response2.recipient)) { return emailNamePair.get(response1.recipient).compareTo(emailNamePair.get(response2.recipient)); } else { return response1.recipient.compareTo(response2.recipient); } }; existingResponses.sort(responsesComparator); return existingResponses; }
Source:
static boolean isRejectedCard(String cardNumber) { return REJECTED_CARDS .keySet() .stream() .anyMatch(a -> a.contains(cardNumber)); }

Target:
public static boolean isRejectedCard(String cardNumber) { return REJECTED_CARDS .keySet() .stream() .anyMatch(rejectedCards -> rejectedCards.contains(cardNumber)); }
Source:
public List<Module> instantiate(String moduleClassName) { try { Module module = (Module) Class.forName(moduleClassName).newInstance(); return Collections.singletonList(module); } catch (Exception e) { String message = format("Instantiation of ''{0}'' failed", moduleClassName); logger.log(SEVERE, message, e); } return Collections.emptyList(); }

Target:
public List<Module> instantiate(String moduleClassName) { try { Module module = (Module) Class.forName(moduleClassName).newInstance(); return Collections.singletonList(module); } catch (Exception e) { String message = format("Instantiation of ''{0}'' failed", moduleClassName); throw new GuiceModuleInstantiationFailed(message, e); } }
Source:
void failOnMatcherError() { String expectedText = "Won't exist"; assertThatThrownBy(() -> new ItemWithText(expectedText) .fail(collection, collection.getElements(), new Exception("Exception message"), 10000)).isInstanceOf(TextsMismatch.class) .hasMessageContaining( String.format(String.format("Texts mismatch" + "%nActual: %s" + "%nExpected: %s", ElementsCollection.texts(collection.getElements()), Collections.singletonList(expectedText)))); }

Target:
void failOnMatcherError() { String expectedText = "Won't exist"; assertThatThrownBy(() -> new ItemWithText(expectedText) .fail(collection, collection.getElements(), new Exception("Exception message"), 10000)).isInstanceOf(ElementWithTextNotFound.class) .hasMessageContaining( String.format(String.format("Element with text not found" + "%nActual: %s" + "%nExpected: %s", ElementsCollection.texts(collection.getElements()), Collections.singletonList(expectedText)))); }
Source:
public boolean removeFirst() { if (innerList.size() < 1) { return false; } Node node = innerList.get(0); notifyElementRemoved(0, node); node.setParentNode(null); return innerList.remove(0) != null; }

Target:
public N removeFirst() { return remove(0); }
Source:
public void mouseDown(MouseEvent e) { if ((getChartViewer().getWindowDuration() != 0) && (e.button == 1)) { if ((e.stateMask & SWT.CTRL) != 0) { return; } fDragBeginMarker = false; if (((e.stateMask & (SWT.SHIFT | SWT.CTRL)) == 0) || (fEndTime == fBeginTime)) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); fBeginTime = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); fEndTime = fBeginTime; } else { long selectionBegin = fBeginTime; long selectionEnd = fEndTime; IAxis xAxis = getChart().getAxisSet().getXAxis(0); long time = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); if (Math.abs(time - selectionBegin) < Math.abs(time - selectionEnd)) { fDragBeginMarker = true; fBeginTime = time; fEndTime = selectionEnd; } else { fBeginTime = selectionBegin; fEndTime = time; } } fIsInternalUpdate = true; } }

Target:
public void mouseDown(MouseEvent e) { if ((getChartViewer().getWindowDuration() != 0) && (e.button == 1)) { if ((e.stateMask & SWT.CTRL) != 0) { return; } fDragBeginMarker = false; if (((e.stateMask & SWT.SHIFT) == 0) || (fEndTime == fBeginTime)) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); fBeginTime = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); fEndTime = fBeginTime; } else { long selectionBegin = fBeginTime; long selectionEnd = fEndTime; IAxis xAxis = getChart().getAxisSet().getXAxis(0); long time = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); if (Math.abs(time - selectionBegin) < Math.abs(time - selectionEnd)) { fDragBeginMarker = true; fBeginTime = time; fEndTime = selectionEnd; } else { fBeginTime = selectionBegin; fEndTime = time; } } fIsInternalUpdate = true; } }
Source:
public void testGenerateStudentCourseJoinEmail() throws IOException, MessagingException { CourseAttributes course = new CourseAttributes("course-id", "Course Name"); StudentAttributes student = new StudentAttributes(); student.name = "Student Name"; student.key = "skxxxxxxxxxks"; student.email = "student@email.tmt"; MimeMessage email = new EmailGenerator().generateStudentCourseJoinEmail(course, student); String subject = String.format(EmailType.STUDENT_COURSE_JOIN.getSubject(), course.getName(), course.getId()); String joinUrl = Config.getAppUrl(student.getRegistrationUrl()).toAbsoluteString(); String textInEmail = "Hello " + student.name + "{*}course <i>" + course.getName() + "{*}" + joinUrl + "{*}" + joinUrl + "{*}"; verifyEmail(email, student.email, subject, textInEmail); }

Target:
public void testGenerateStudentCourseJoinEmail() throws IOException, MessagingException { CourseAttributes course = new CourseAttributes("course-id", "Course Name"); StudentAttributes student = new StudentAttributes(); student.name = "Student Name"; student.key = "skxxxxxxxxxks"; student.email = "student@email.tmt"; MimeMessage email = new EmailGenerator().generateStudentCourseJoinEmail(course, student); String subject = String.format(EmailType.STUDENT_COURSE_JOIN.getSubject(), course.getName(), course.getId()); String joinUrl = Config.getAppUrl(student.getRegistrationUrl()).toAbsoluteString(); String textInEmail = "Hello " + student.name + "{*}" + course.getName() + "{*}" + joinUrl + "{*}" + joinUrl + "{*}"; verifyEmail(email, student.email, subject, textInEmail); }
Source:
public void clearDestinationHost() { nicsMap.values().forEach(nic -> { if (nic.isPartOfBond()) { Guid bondId = getDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(bondId); clearAttachments(bondId); } clearAttachments(nic.getId()); }); }

Target:
private void clearDestinationHost() { nicsMap.values().forEach(nic -> { if (nic.isPartOfBond()) { Guid bondId = calcDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(bondId); List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(bondId); attachmentsToRemove.addAll(destAttachmentIds); } List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(nic.getId()); attachmentsToRemove.addAll(destAttachmentIds); }); }
Source:
protected LinkedHashMap toStringMapper_RICE20_REFACTORME() { LinkedHashMap m = new LinkedHashMap(); m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); m.put("categoryCode", this.categoryCode); if (ObjectUtils.isNotNull(this.invoiceDetailIdentifier)) { m.put("invoiceDetailIdentifier", this.invoiceDetailIdentifier.toString()); } if (ObjectUtils.isNotNull(this.totalBudget)) { m.put("totalBudget", this.totalBudget.toString()); } if (ObjectUtils.isNotNull(this.invoiceAmount)) { m.put("invoiceAmount", this.invoiceAmount.toString()); } if (ObjectUtils.isNotNull(this.cumulativeExpenditures)) { m.put("cumulativeExpenditures", this.cumulativeExpenditures.toString()); } m.put("balance", getBudgetRemaining().toString()); if (ObjectUtils.isNotNull(this.totalPreviouslyBilled)) { m.put("totalPreviouslyBilled", this.totalPreviouslyBilled.toString()); } m.put("adjustedCumExpenditures", getTotalAmountBilledToDate().toString()); m.put("adjustedBalance", getAmountRemainingToBill().toString()); return m; }

Target:
protected LinkedHashMap toStringMapper_RICE20_REFACTORME() { LinkedHashMap m = new LinkedHashMap(); m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); m.put("categoryCode", this.categoryCode); if (ObjectUtils.isNotNull(this.invoiceDetailIdentifier)) { m.put("invoiceDetailIdentifier", this.invoiceDetailIdentifier.toString()); } if (ObjectUtils.isNotNull(this.totalBudget)) { m.put("totalBudget", this.totalBudget.toString()); } if (ObjectUtils.isNotNull(this.invoiceAmount)) { m.put("invoiceAmount", this.invoiceAmount.toString()); } if (ObjectUtils.isNotNull(this.cumulativeExpenditures)) { m.put("cumulativeExpenditures", this.cumulativeExpenditures.toString()); } m.put("budgetRemaining", getBudgetRemaining().toString()); if (ObjectUtils.isNotNull(this.totalPreviouslyBilled)) { m.put("totalPreviouslyBilled", this.totalPreviouslyBilled.toString()); } m.put("totalAmountBilledToDate", getTotalAmountBilledToDate().toString()); m.put("amountRemainingToBill", getAmountRemainingToBill().toString()); return m; }
Source:
public SchemaDescriptor getSchemaDescriptor(UUID dbId, String schemaName, TransactionController tc, boolean raiseError) throws StandardException{ if(tc==null){ tc=getTransactionCompile(); } if (dbId == null) { dbId = getLCC().getDatabaseId(); } if(getSystemSchemaDescriptor().getSchemaName().equals(schemaName)){ return getSystemSchemaDescriptor(); }else if(getSysIBMSchemaDescriptor().getSchemaName().equals(schemaName)){ if(dictionaryVersion.checkVersion(DataDictionary.DD_VERSION_CS_5_2,null)){ return getSysIBMSchemaDescriptor(); } } SchemaDescriptor sd = dataDictionaryCache.schemaCacheFind(dbId, schemaName); if (sd!=null) return sd; sd=locateSchemaRow(dbId, schemaName,tc); if (sd!=null) dataDictionaryCache.schemaCacheAdd(dbId, schemaName,sd); if(sd==null && getDeclaredGlobalTemporaryTablesSchemaDescriptor().getSchemaName().equals(schemaName)){ return getDeclaredGlobalTemporaryTablesSchemaDescriptor(); } if(sd==null && raiseError){ throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST,schemaName); }else{ return sd; } }

Target:
public SchemaDescriptor getSchemaDescriptor(UUID dbId, String schemaName, TransactionController tc, boolean raiseError) throws StandardException{ if(tc==null){ tc=getTransactionCompile(); } if (dbId == null) { dbId = getLCC().getDatabaseId(); } switch (schemaName) { case SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME: return getSystemSchemaDescriptor(); case SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME: if(dictionaryVersion.checkVersion(DataDictionary.DD_VERSION_CS_5_2,null)){ return getSysIBMSchemaDescriptor(); } break; case SchemaDescriptor.IBM_SYSTEM_ADM_SCHEMA_NAME: return sysIBMADMSchemaDesc; case SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME: return getSystemUtilSchemaDescriptor(); case SchemaDescriptor.IBM_SYSTEM_FUN_SCHEMA_NAME: return getSysFunSchemaDescriptor(); case SchemaDescriptor.STD_SYSTEM_VIEW_SCHEMA_NAME: return sysViewSchemaDesc; default: break; } SchemaDescriptor sd = dataDictionaryCache.schemaCacheFind(dbId, schemaName); if (sd!=null) return sd; sd=locateSchemaRow(dbId, schemaName,tc); if (sd!=null) dataDictionaryCache.schemaCacheAdd(dbId, schemaName,sd); if(sd==null && getDeclaredGlobalTemporaryTablesSchemaDescriptor().getSchemaName().equals(schemaName)){ return getDeclaredGlobalTemporaryTablesSchemaDescriptor(); } if(sd==null && raiseError){ throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST,schemaName); }else{ return sd; } }
Source:
public void checkAttributeRegex(Attribute attribute, String defaultRegex) throws InternalErrorException, WrongAttributeValueException { if (attribute == null || attribute.getValue() == null) throw new InternalErrorException("Attribute or it's value is null."); String attributeValue = (String) attribute.getValue(); try { String regex = BeansUtils.getPropertyFromCustomConfiguration("perun-namespaces.properties", attribute.getFriendlyName() + ":regex"); try { Pattern.compile(regex); } catch (PatternSyntaxException e) { log.error("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); throw new InternalErrorException("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); } if(!attributeValue.matches(regex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + regex +"\" expected for this attribute:"); } } catch (InternalErrorException e) { if (defaultRegex == null) return; if (!attributeValue.matches(defaultRegex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + defaultRegex +"\" expected for this attribute:"); } } }

Target:
public void checkAttributeRegex(Attribute attribute, String defaultRegex) throws InternalErrorException, WrongAttributeValueException { if (attribute == null || attribute.getValue() == null) throw new InternalErrorException("Attribute or it's value is null."); String attributeValue = (String) attribute.getValue(); checkPerunNamespacesMap(); String regex = perunNamespaces.get(attribute.getFriendlyName() + ":regex"); if (regex != null) { try { Pattern.compile(regex); } catch (PatternSyntaxException e) { log.error("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); throw new InternalErrorException("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); } if(!attributeValue.matches(regex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + regex +"\" expected for this attribute:"); } } else { if (defaultRegex == null) return; if (!attributeValue.matches(defaultRegex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + defaultRegex +"\" expected for this attribute:"); } } }
Source:
public static Long getTotalAmountFor(ChargeEntity charge) { if (charge.getCorporateSurcharge().isPresent()) { return charge.getCorporateSurcharge().get() + charge.getAmount(); } return charge.getAmount(); }

Target:
public static Long getTotalAmountFor(ChargeEntity charge) { return charge.getCorporateSurcharge() .map(surcharge -> surcharge + charge.getAmount()) .orElseGet(charge::getAmount); }
Source:
private String getOriginUrl(Activity activity) { if(originUrl == null) { PackageManager pm; String packageName; ApplicationInfo appInfo; try { pm = activity.getPackageManager(); packageName = activity.getApplicationInfo().packageName; appInfo = pm.getApplicationInfo(packageName, 0); originUrl = pm.getApplicationLabel(appInfo).toString(); } catch (Exception e) { Log.e(Constants.TAG, "getOriginUrl: " + e.toString()); resetSurvey(); e.printStackTrace(); } } if(originUrl == null) { originUrl = ""; } return originUrl; }

Target:
private String getOriginUrl(Activity activity) { if(originUrl == null) { PackageManager pm; String packageName; ApplicationInfo appInfo; try { pm = activity.getPackageManager(); packageName = activity.getApplicationInfo().packageName; appInfo = pm.getApplicationInfo(packageName, 0); originUrl = pm.getApplicationLabel(appInfo).toString(); } catch (Exception e) { Log.e(Constants.TAG, "getOriginUrl: " + e.toString()); e.printStackTrace(); } } if(originUrl == null) { originUrl = ""; } return originUrl; }
Source:
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { if(side == null) return quads; return ImmutableList.of(); }

Target:
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { if(side == null) { return quads; } return ImmutableList.of(); }
Source:
public static void main(String[] args) throws Exception { String mintMode = null; if (mintEnv) { mintMode = System.getenv("MINT_MODE"); } Process minioProcess = null; if (args.length != 4) { endpoint = "http://localhost:9000"; accessKey = "minio"; secretKey = "minio123"; region = "us-east-1"; if (!downloadMinio()) { System.out.println("usage: FunctionalTest <ENDPOINT> <ACCESSKEY> <SECRETKEY> <REGION>"); System.exit(-1); } minioProcess = runMinio(); try { int exitValue = minioProcess.exitValue(); System.out.println("minio server process exited with " + exitValue); System.out.println("usage: FunctionalTest <ENDPOINT> <ACCESSKEY> <SECRETKEY> <REGION>"); System.exit(-1); } catch (IllegalThreadStateException e) { ignore(); } } else { String dataDir = System.getenv("MINT_DATA_DIR"); if (dataDir != null && !dataDir.equals("")) { mintEnv = true; dataFile1Kb = Paths.get(dataDir, "datafile-1-kB"); dataFile6Mb = Paths.get(dataDir, "datafile-6-MB"); } endpoint = args[0]; accessKey = args[1]; secretKey = args[2]; region = args[3]; } int exitValue = 0; try { client = new MinioClient(endpoint, accessKey, secretKey); if (mintEnv) { if (mintMode != null && mintMode.equals("full")) { FunctionalTest.runTests(); } else { FunctionalTest.runQuickTests(); } } else { FunctionalTest.runTests(); bucketName = getRandomName(); client = new MinioClient(endpoint, accessKey, secretKey, region); FunctionalTest.runQuickTests(); } } catch (Exception e) { exitValue = -1; } finally { if (minioProcess != null) { minioProcess.destroy(); } } System.exit(exitValue); }

Target:
public static void main(String[] args) throws Exception { String mintMode = null; if (mintEnv) { mintMode = System.getenv("MINT_MODE"); } Process minioProcess = null; if (args.length != 4) { endpoint = "http://localhost:9000"; accessKey = "minio"; secretKey = "minio123"; region = "us-east-1"; if (!downloadMinio()) { System.out.println("usage: FunctionalTest <ENDPOINT> <ACCESSKEY> <SECRETKEY> <REGION>"); System.exit(-1); } minioProcess = runMinio(); try { int exitValue = minioProcess.exitValue(); System.out.println("minio server process exited with " + exitValue); System.out.println("usage: FunctionalTest <ENDPOINT> <ACCESSKEY> <SECRETKEY> <REGION>"); System.exit(-1); } catch (IllegalThreadStateException e) { ignore(); } } else { String dataDir = System.getenv("MINT_DATA_DIR"); if (dataDir != null && !dataDir.equals("")) { mintEnv = true; dataFile1Kb = Paths.get(dataDir, "datafile-1-kB"); dataFile6Mb = Paths.get(dataDir, "datafile-6-MB"); } endpoint = args[0]; accessKey = args[1]; secretKey = args[2]; region = args[3]; } int exitValue = 0; try { client = new MinioClient(endpoint, accessKey, secretKey); if (mintEnv) { if (mintMode != null && mintMode.equals("full")) { FunctionalTest.runTests(); } else { FunctionalTest.runQuickTests(); } } else { FunctionalTest.runTests(); bucketName = getRandomName(); client = new MinioClient(endpoint, accessKey, secretKey, region); FunctionalTest.runQuickTests(); } } catch (Exception e) { if (!mintEnv) { e.printStackTrace(); } exitValue = -1; } finally { if (minioProcess != null) { minioProcess.destroy(); } } System.exit(exitValue); }
Source:
protected void mine() { IBlockState state = worldObj.getBlockState(currentPos); if (BlockUtils.isUnbreakableBlock(getWorld(), currentPos) || state.getBlock() == Blocks.BEDROCK) { setComplete(true); return; } int target = BlockUtils.computeBlockBreakPower(worldObj, currentPos); progress += battery.extractPower(0, target - progress); if (progress >= target) { progress = 0; if (!worldObj.isAirBlock(currentPos)) { BlockEvent.BreakEvent breakEvent = new BlockEvent.BreakEvent(worldObj, currentPos, state, FakePlayerUtil.INSTANCE.getBuildCraftPlayer((WorldServer) worldObj).get()); MinecraftForge.EVENT_BUS.post(breakEvent); if (breakEvent.isCanceled()) { setComplete(true); return; } List<ItemStack> stacks = BlockUtils.getItemStackFromBlock((WorldServer) worldObj, currentPos, pos); if (stacks != null) { for (ItemStack stack : stacks) { stack.stackSize -= Utils.addToRandomInventoryAround(worldObj, pos, stack); if (stack.stackSize > 0) { stack.stackSize -= Utils.addToRandomInjectableAround(worldObj, pos, null, stack); } InvUtils.dropItemUp(getWorld(), stack, getPos()); } } worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, -1); worldObj.destroyBlock(currentPos, false); } worldObj.setBlockState(currentPos, getBlockForDown().getDefaultState()); worldObj.scheduleUpdate(currentPos, getBlockForDown(), 100); currentPos = currentPos.down(); if (currentPos.getY() < 0) { setComplete(true); } } else { if (!worldObj.isAirBlock(currentPos)) { worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, (progress * 9) / target); } } }

Target:
protected void mine() { IBlockState state = worldObj.getBlockState(currentPos); if (BlockUtils.isUnbreakableBlock(getWorld(), currentPos) || state.getBlock() == Blocks.BEDROCK) { setComplete(true); return; } int target = BlockUtils.computeBlockBreakPower(worldObj, currentPos); progress += battery.extractPower(0, target - progress); if (progress >= target) { progress = 0; if (!worldObj.isAirBlock(currentPos)) { BlockEvent.BreakEvent breakEvent = new BlockEvent.BreakEvent(worldObj, currentPos, state, FakePlayerUtil.INSTANCE.getBuildCraftPlayer((WorldServer) worldObj).get()); MinecraftForge.EVENT_BUS.post(breakEvent); if (breakEvent.isCanceled()) { setComplete(true); return; } List<ItemStack> stacks = BlockUtils.getItemStackFromBlock((WorldServer) worldObj, currentPos, pos); if (stacks != null) { for (ItemStack stack : stacks) { stack.stackSize -= Utils.addToRandomInventoryAround(worldObj, pos, stack); if (stack.stackSize > 0) { stack.stackSize -= Utils.addToRandomInjectableAround(worldObj, pos, null, stack); } InvUtils.dropItemUp(getWorld(), stack, getPos()); } } worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, -1); worldObj.destroyBlock(currentPos, false); } currentPos = currentPos.down(); if (currentPos.getY() < 0) { setComplete(true); } } else { if (!worldObj.isAirBlock(currentPos)) { worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, (progress * 9) / target); } } }
Source:
public ChannelFuture bind(SocketAddress localAddress) { validate(); ObjectUtil.checkNotNull(localAddress, "localAddress"); return doBind(localAddress); }

Target:
public ChannelFuture bind(SocketAddress localAddress) { validate(); return doBind(ObjectUtil.checkNotNull(localAddress, "localAddress")); }
Source:
public static ArtifactConfig fromCommandLineArgs( String[] args) throws CmdLineException, IOException { CmdLineArgs parsedArgs = new CmdLineArgs(); CmdLineParser parser = new CmdLineParser(parsedArgs); parser.parseArgument(args); ArtifactConfig artifactConfig; if (parsedArgs.artifactConfigJson != null) { Gson gson = new GsonBuilder().create(); String jsonData = com.google.common.io.Files.toString( new File(parsedArgs.artifactConfigJson), Charsets.UTF_8); artifactConfig = gson.fromJson(jsonData, ArtifactConfig.class); } else { artifactConfig = new ArtifactConfig(); } if (parsedArgs.buckRepoRoot != null) { artifactConfig.buckRepoRoot = parsedArgs.buckRepoRoot; } if (parsedArgs.mavenLocalRepo != null) { artifactConfig.mavenLocalRepo = parsedArgs.mavenLocalRepo; } if (parsedArgs.thirdParty != null) { artifactConfig.thirdParty = parsedArgs.thirdParty; } artifactConfig.artifacts.addAll(parsedArgs.artifacts); for (String url : parsedArgs.repositoryURIs) { artifactConfig.repositories.add(new Repository(url)); } return artifactConfig; }

Target:
public static ArtifactConfig fromCommandLineArgs( String[] args) throws CmdLineException, IOException { CmdLineArgs parsedArgs = new CmdLineArgs(); CmdLineParser parser = new CmdLineParser(parsedArgs); parser.parseArgument(args); if (parsedArgs.showHelp) { usage(parser); } ArtifactConfig artifactConfig; if (parsedArgs.artifactConfigJson != null) { ObjectMapper mapper = new ObjectMapper(); File jsonFile = new File(parsedArgs.artifactConfigJson); artifactConfig = mapper.readValue(jsonFile, ArtifactConfig.class); } else { artifactConfig = new ArtifactConfig(); } if (artifactConfig.buckRepoRoot == null && parsedArgs.buckRepoRoot == null) { usage(parser); } artifactConfig.mergeCmdLineArgs(parsedArgs); return artifactConfig; }
Source:
public void followerNotificationResponse_setup_1() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName5, credentials.password5, wikiURL); NewMessageWall wall = base.openMessageWall(credentials.userName6, wikiURL); WatchPageObject watch = wall.unfollowCurrentUrl(); watch.confirmWatchUnwatch(); }

Target:
public void followerNotificationResponse_setup_1() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName7, credentials.password7, wikiURL); NewMessageWall wall = base.openMessageWall(credentials.userName8, wikiURL); WatchPageObject watch = wall.unfollowCurrentUrl(); watch.confirmWatchUnwatch(); }
Source:
public synchronized void updateSubscription(Subscription newSubscription) { this.subscription = newSubscription; this.messageSender = messageSenderFactory.create(newSubscription); }

Target:
public synchronized void updateSubscription(Subscription newSubscription) { boolean endpointUpdated = !this.subscription.getEndpoint().equals(newSubscription.getEndpoint()); this.subscription = newSubscription; if (endpointUpdated) { this.messageSender = messageSenderFactory.create(newSubscription); } }
Source:
public void onProjectPathChanged(@NotNull final String projectPath) { if (lastPath.equals(projectPath)) { lastPath = projectPath; return; } else { lastPath = projectPath; } myTargetSpecsBox.clear(); errors.clear(); final VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtil.pathToUrl(projectPath)); if (file == null || !PantsUtil.isPantsProjectFile(file)) { myTargetSpecsBox.setEnabled(true); errors.add(String.format("Pants project not found given project path: %s", projectPath)); return; } if (file.isDirectory()) { myTargetSpecsBox.setEnabled(false); Optional<String> relativeProjectPath = PantsUtil.getRelativeProjectPath(file.getPath()); if (!relativeProjectPath.isPresent()) { errors.add(String.format("Fail to find relative path from %s to build root.", file.getPath())); return; } String spec = relativeProjectPath.get() + "/::"; myTargetSpecsBox.setEmptyText(spec); myTargetSpecsBox.addItem(spec, spec, true); myLibsWithSourcesCheckBox.setEnabled(true); } else if (PantsUtil.isExecutable(file.getPath())) { myTargetSpecsBox.setEnabled(false); myTargetSpecsBox.setEmptyText(file.getName()); myLibsWithSourcesCheckBox.setSelected(false); myLibsWithSourcesCheckBox.setEnabled(false); } else { myTargetSpecsBox.setEnabled(true); myTargetSpecsBox.setEmptyText(StatusText.DEFAULT_EMPTY_TEXT); myLibsWithSourcesCheckBox.setEnabled(true); ProgressManager.getInstance().run(new Task.Modal(getProject(), PantsBundle.message("pants.getting.target.list"), false) { @Override public void run(@NotNull ProgressIndicator indicator) { loadTargets(projectPath); } }); } }

Target:
public void onProjectPathChanged(@NotNull final String projectPath) { if (lastPath.equals(projectPath)) { return; } lastPath = projectPath; myTargetSpecsBox.clear(); errors.clear(); final VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtil.pathToUrl(projectPath)); if (file == null || !PantsUtil.isPantsProjectFile(file)) { myTargetSpecsBox.setEnabled(true); errors.add(String.format("Pants project not found given project path: %s", projectPath)); return; } if (file.isDirectory()) { myTargetSpecsBox.setEnabled(false); Optional<String> relativeProjectPath = PantsUtil.getRelativeProjectPath(file.getPath()); if (!relativeProjectPath.isPresent()) { errors.add(String.format("Fail to find relative path from %s to build root.", file.getPath())); return; } String spec = relativeProjectPath.get() + "/::"; myTargetSpecsBox.setEmptyText(spec); myTargetSpecsBox.addItem(spec, spec, true); myLibsWithSourcesCheckBox.setEnabled(true); } else if (PantsUtil.isExecutable(file.getPath())) { myTargetSpecsBox.setEnabled(false); myTargetSpecsBox.setEmptyText(file.getName()); myLibsWithSourcesCheckBox.setSelected(false); myLibsWithSourcesCheckBox.setEnabled(false); } else { myTargetSpecsBox.setEnabled(true); myTargetSpecsBox.setEmptyText(StatusText.DEFAULT_EMPTY_TEXT); myLibsWithSourcesCheckBox.setEnabled(true); ProgressManager.getInstance().run(new Task.Modal(getProject(), PantsBundle.message("pants.getting.target.list"), false) { @Override public void run(@NotNull ProgressIndicator indicator) { loadTargets(projectPath); } }); } }
Source:
protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args) throws AlgebricksException { final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage(); final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable(); final TaggedValuePointable nodep = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable(); final ByteBufferInputStream bbis = new ByteBufferInputStream(); final DataInputStream di = new DataInputStream(bbis); final SequenceBuilder sb = new SequenceBuilder(); final ArrayBackedValueStorage abvsFileNode = new ArrayBackedValueStorage(); final int partition = ctx.getTaskAttemptId().getTaskId().getPartition(); final String nodeId = ctx.getJobletContext().getApplicationContext().getNodeId(); final ITreeNodeIdProvider nodeIdProvider = new TreeNodeIdProvider((short) partition); return new AbstractTaggedValueArgumentScalarEvaluator(args) { @Override protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { try { IndexConstructorUtil.evaluate(args, result, stringp, bbis, di, sb, abvs, nodeIdProvider, abvsFileNode, nodep, false, nodeId); } catch (JAXBException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } }; }

Target:
protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args) throws AlgebricksException { final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage(); final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable(); final TaggedValuePointable nodep = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable(); final ByteBufferInputStream bbis = new ByteBufferInputStream(); final DataInputStream di = new DataInputStream(bbis); final SequenceBuilder sb = new SequenceBuilder(); final ArrayBackedValueStorage abvsFileNode = new ArrayBackedValueStorage(); final int partition = ctx.getTaskAttemptId().getTaskId().getPartition(); final String nodeId = ctx.getJobletContext().getApplicationContext().getNodeId(); final ITreeNodeIdProvider nodeIdProvider = new TreeNodeIdProvider((short) partition); return new AbstractTaggedValueArgumentScalarEvaluator(args) { @Override protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { try { IndexConstructorUtil.evaluate(args, result, stringp, bbis, di, sb, abvs, nodeIdProvider, abvsFileNode, nodep, false, nodeId); XDMConstants.setTrue(result); } catch (JAXBException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } }; }
Source:
public Mono<ServiceBusReceiverAsyncClient> acceptSession(String sessionId) { if (CoreUtils.isNullOrEmpty(sessionId)) { return monoError(logger, new IllegalArgumentException("sessionId can not be null or empty")); } ReceiverOptions newReceiverOptions = new ReceiverOptions(receiverOptions.getReceiveMode(), receiverOptions.getPrefetchCount(), sessionId, null, receiverOptions.getMaxLockRenewDuration()); final ServiceBusSessionManager sessionSpecificManager = new ServiceBusSessionManager(entityPath, entityType, connectionProcessor, tracerProvider, messageSerializer, newReceiverOptions); return sessionSpecificManager.getActiveLink().thenReturn(new ServiceBusReceiverAsyncClient( fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, onClientClose, sessionSpecificManager)); }

Target:
public Mono<ServiceBusReceiverAsyncClient> acceptSession(String sessionId) { if (sessionId == null) { return monoError(logger, new NullPointerException("'sessionId' cannot be null")); } if (CoreUtils.isNullOrEmpty(sessionId)) { return monoError(logger, new IllegalArgumentException("'sessionId' cannot be empty")); } final ReceiverOptions newReceiverOptions = new ReceiverOptions(receiverOptions.getReceiveMode(), receiverOptions.getPrefetchCount(), receiverOptions.getMaxLockRenewDuration(), receiverOptions.isAutoLockRenewEnabled(), sessionId, null); final ServiceBusSessionManager sessionSpecificManager = new ServiceBusSessionManager(entityPath, entityType, connectionProcessor, tracerProvider, messageSerializer, newReceiverOptions); return sessionSpecificManager.getActiveLink().map(receiveLink -> new ServiceBusReceiverAsyncClient( fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, () -> { }, sessionSpecificManager)); }
Source:
public void onUnityAdsReady(String placementId) { Log.d("alice", "onUnityAdsReady: " + placementId); if (mPlacementsInUse.containsKey(placementId) && mPlacementsInUse.get(placementId).get() != null) { mPlacementsInUse.get(placementId).get().onUnityAdsReady(placementId); } }

Target:
public void onUnityAdsReady(String placementId) { if (mPlacementsInUse.containsKey(placementId) && mPlacementsInUse.get(placementId).get() != null) { mPlacementsInUse.get(placementId).get().onUnityAdsReady(placementId); } }
Source:
public void performSearchWithoutFetchers() { Set<SearchBasedFetcher> empty = new HashSet<>(); CompositeSearchBasedFetcher fetcher = new CompositeSearchBasedFetcher(empty); List<BibEntry> result = fetcher.performSearch("quantum"); Assertions.assertTrue(result.isEmpty()); }

Target:
public void performSearchWithoutFetchers() { Set<SearchBasedFetcher> empty = new HashSet<>(); CompositeSearchBasedFetcher fetcher = new CompositeSearchBasedFetcher(empty, Integer.MAX_VALUE); List<BibEntry> result = fetcher.performSearch("quantum"); Assertions.assertEquals(result, Collections.EMPTY_LIST); }
Source:
public View getBannerView() { return mChartboostBanner; }

Target:
public View getBannerView() { return mBannerContainer; }
Source:
private List<Change.Id> changesReviewedBy(final ReviewDb db, final String userName) { UserNameProcessor processor = new UserNameProcessor(db, userName) { @Override void process(ReviewDb db, Account.Id account, Map<Id, Change> outResultChanges) throws OrmException { ChangeApprovalAccess changes = db.changeApprovals(); ChangeAccess changeAccess = db.changes(); Iterator<ChangeApproval> changeIterator = changes.reviewedByUser(account).iterator(); while (changeIterator.hasNext()) { ChangeApproval approval = changeIterator.next(); Change change = changeAccess.get(approval.getChangeId()); if (change != null) { outResultChanges.put(change.getId(), change); } } } }; return new ArrayList<Change.Id>(processor.call()); }

Target:
private Set<Change.Id> changesReviewedBy(final ReviewDb db, final String userName) throws OrmException { UserNameProcessor processor = new UserNameProcessor(db, userName) { @Override void process(ReviewDb db, Account.Id account, Map<Id, Change> outResultChanges) throws OrmException { ChangeApprovalAccess changes = db.changeApprovals(); ChangeAccess changeAccess = db.changes(); Iterator<ChangeApproval> changeIterator = changes.reviewedByUser(account).iterator(); while (changeIterator.hasNext()) { ChangeApproval approval = changeIterator.next(); Change change = changeAccess.get(approval.getChangeId()); if (change != null) { outResultChanges.put(change.getId(), change); } } } }; return processor.call(); }
Source:
private static void addConfigDetail(StringBuilder builder, String name, String value) { builder.append("<tr style=\"background-color: transparent; padding: 0 0 0 0;\">" + "<th style=\"border-width: 0; background-color: transparent; text-align: right; padding: 0 0 0 0; \">" + name + ":</th>" + "<td style=\"border-width: 0; background-color: transparent; text-align: left; padding: 0 0 0 10;\">" + value + "</td>" + "</tr>"); }

Target:
private static void addConfigDetail(StringBuilder builder, String name, String value) { builder.append("<tr>" + "<th>" + name + ":</th>" + "<td>" + value + "</td>" + "</tr>\n"); }
Source:
protected MessageDigest getMd5Digest(final HttpServletRequest request) throws NoSuchAlgorithmException { MessageDigest digest = createMd5Digest(); for (MD5Attributes attribute: MD5Attributes.values()) { if (request.getAttribute(attribute.getKey()) != null) { digest.update(request.getAttribute(attribute.getKey()). toString().getBytes()); } } digest.update(request.getAttribute(ATTR_ENGINE_SESSION_TIMEOUT).toString().getBytes()); return digest; }

Target:
protected MessageDigest getMd5Digest(final HttpServletRequest request) throws NoSuchAlgorithmException { MessageDigest digest = createMd5Digest(); for (MD5Attributes attribute: MD5Attributes.values()) { if (request.getAttribute(attribute.getKey()) != null) { digest.update(request.getAttribute(attribute.getKey()). toString().getBytes()); } } digest.update(request.getAttribute(ATTR_ENGINE_SESSION_TIMEOUT).toString().getBytes(Charset.forName("UTF-8"))); return digest; }
Source:
private boolean checkVmIsDown() { return Config.<Boolean> GetValue( ConfigValues.LiveSnapshotEnabled, getStoragePool().getcompatibility_version().getValue()); }

Target:
private boolean checkVmIsDown() { return !Config.<Boolean> GetValue( ConfigValues.LiveSnapshotEnabled, getStoragePool().getcompatibility_version().getValue()); }
Source:
public boolean isHardwareFlowControl() { if (parameters.flowControl == FLOW_CONTROL_HW) return true; return false; }

Target:
public boolean isHardwareFlowControl() { return parameters.flowControl == FLOW_CONTROL_HW; }
Source:
public void flush() { if (subnet == null) { subnet = new ExternalSubnet(); } subnet.setName(getName().getEntity()); Network network = getNetwork().getSelectedItem(); subnet.setExternalNetwork(network != null ? network.getProvidedBy() : null); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); }

Target:
public void flush() { subnet = new ExternalSubnet(); subnet.setName(getName().getEntity()); Network network = getNetwork().getSelectedItem(); subnet.setExternalNetwork(network.getProvidedBy()); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); }
Source:
public List<Pair<String, Long>> getTimingLog() { List<Pair<String, Long>> rtn = new ArrayList<Pair<String, Long>>(); if (mMarkers == null || mMarkers.size() == 0) { return rtn; } long prevTime = mMarkers.get(0).time; for (Marker marker : mMarkers) { long thisTime = marker.time; rtn.add(new Pair<String, Long>(marker.name, (thisTime - prevTime))); prevTime = thisTime; } return rtn; }

Target:
public List<Pair<String, Long>> getTimingLog() { List<Pair<String, Long>> rtn = new ArrayList<Pair<String, Long>>(); if (mMarkers == null || mMarkers.size() == 0) { return rtn; } long prevTime = mMarkers.get(0).time; for (Marker marker : mMarkers) { long thisTime = marker.time; rtn.add(Pair.create(marker.name, (thisTime - prevTime))); prevTime = thisTime; } return rtn; }
Source:
public void setUp() { discoveryParticipant = getService(UpnpDiscoveryParticipant.class, FSInternetRadioDiscoveryParticipant.class); assertThat("The FSInternetRadioDiscoveryParticipant service cannot be found", discoveryParticipant, is(notNullValue())); }

Target:
public void setUp() { discoveryParticipant = getService(UpnpDiscoveryParticipant.class, FSInternetRadioDiscoveryParticipant.class); assertNotNull(discoveryParticipant); }
Source:
public TranslatedExpression<String> translateCall(CallExpression callExpression, Map<VariableReferenceExpression, ColumnHandle> context, RowExpressionTreeTranslator<String, Map<VariableReferenceExpression, ColumnHandle>> rowExpressionTreeTranslator) { List<TranslatedExpression<String>> translatedExpressions = callExpression.getArguments().stream() .map(expression -> expression.accept(rowExpressionTreeTranslator.getVisitor(), context)) .collect(Collectors.toList()); FunctionMetadata functionMetadata = functionManager.getFunctionMetadata(callExpression.getFunctionHandle()); try { return functionTranslator.translate(functionMetadata, callExpression, translatedExpressions); } catch (Throwable t) { return untranslated(callExpression); } }

Target:
public TranslatedExpression<String> translateCall(CallExpression callExpression, Map<VariableReferenceExpression, ColumnHandle> context, RowExpressionTreeTranslator<String, Map<VariableReferenceExpression, ColumnHandle>> rowExpressionTreeTranslator) { List<TranslatedExpression<String>> translatedExpressions = callExpression.getArguments().stream() .map(expression -> rowExpressionTreeTranslator.rewrite(expression, context)) .collect(Collectors.toList()); FunctionMetadata functionMetadata = functionManager.getFunctionMetadata(callExpression.getFunctionHandle()); try { return functionTranslator.translate(functionMetadata, callExpression, translatedExpressions); } catch (Throwable t) { return untranslated(callExpression); } }
Source:
public Mono<AccessToken> getToken(TokenRequestContext request) { return Mono.defer(() -> { if (cachedToken.get() != null) { return identityClient.authenticateWithUserRefreshToken(request, cachedToken.get()) .onErrorResume(t -> Mono.empty()); } else { return Mono.empty(); } }).switchIfEmpty( Mono.defer(() -> identityClient.authenticateWithVsCodeCredential(request))) .map(msalToken -> { cachedToken.set(msalToken); return msalToken; }); }

Target:
public Mono<AccessToken> getToken(TokenRequestContext request) { return Mono.defer(() -> { if (cachedToken.get() != null) { return identityClient.authenticateWithUserRefreshToken(request, cachedToken.get()) .onErrorResume(t -> Mono.empty()); } else { return Mono.empty(); } }).switchIfEmpty( Mono.defer(() -> identityClient.authenticateWithVsCodeCredential(request, cloudInstance))) .map(msalToken -> { cachedToken.set(msalToken); return msalToken; }); }
Source:
public Iterable<Hook> iterate() { return new RtPagination<Hook>( this.request, new RtPagination.Mapping<Hook>() { @Override public Hook map(final JsonObject object) { return RtHooks.this.get(object.getInt("id")); } } ); }

Target:
public Iterable<Hook> iterate() { return new RtPagination<Hook>( this.request, new RtPagination.Mapping<Hook, JsonObject>() { @Override public Hook map(final JsonObject object) { return RtHooks.this.get(object.getInt("id")); } } ); }
Source:
private ArrayList<BasicNameValuePair> getParams() { ArrayList<BasicNameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("access_token", WIKIA_PRODUCTION_APP_ACCESS_TOKEN)); return params; }

Target:
private List<BasicNameValuePair> getParams() { return Collections.singletonList( new BasicNameValuePair("access_token", WIKIA_PRODUCTION_APP_ACCESS_TOKEN)); }
Source:
static Long toEpochHoursBucket(Long millis, String bucket) { return TimeUnit.MILLISECONDS.toHours(millis) / Integer.parseInt(bucket); }

Target:
static Long toEpochHoursBucket(Long millis, String bucket) { return TimeUnit.MILLISECONDS.toHours(millis) / Integer.valueOf(bucket); }