auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private PlanNodeStatsEstimate mapToOutputSymbols(PlanNodeStatsEstimate estimate, List<Symbol> inputs, List<Symbol> outputs) { <START> checkArgument(inputs.size() == outputs.size(), "Inputs does not match outputs"); <END> PlanNodeStatsEstimate.Builder mapped = PlanNodeStatsEstimate.builder() .setOutputRowCount(estimate.getOutputRowCount()); for (int i = 0; i < inputs.size(); i++) { mapped.addSymbolStatistics(outputs.get(i), estimate.getSymbolStatistics(inputs.get(i))); } return mapped.build(); }</code><technical_language>"input size match output size" more accurate</technical_language>

Target:
private PlanNodeStatsEstimate mapToOutputSymbols(PlanNodeStatsEstimate estimate, List<Symbol> inputs, List<Symbol> outputs) { checkArgument(inputs.size() == outputs.size(), "Input symbols count does not match output symbols count"); PlanNodeStatsEstimate.Builder mapped = PlanNodeStatsEstimate.builder() .setOutputRowCount(estimate.getOutputRowCount()); for (int i = 0; i < inputs.size(); i++) { mapped.addSymbolStatistics(outputs.get(i), estimate.getSymbolStatistics(inputs.get(i))); } return mapped.build(); }
Source:
<code>private void invalidate() { for(K key : map.keySet()) { try { invalidate(key); } catch (StoreAccessException cae) { LOG.warn("Failed to invalidate mapping for key {}", key, cae); } } <START> this.clear(); <END> }</code><technical_language>Code style: call clear() this prefix</technical_language>

Target:
private void invalidate() { for(K key : map.keySet()) { try { invalidate(key); } catch (StoreAccessException cae) { LOG.warn("Failed to invalidate mapping for key {}", key, cae); } } clear(); }
Source:
<code>private void addRecents(final HttpServletRequest request, final User user, Structure.Type type, List<BaseContentTypesView> baseContentTypesView) throws DotDataException, LanguageException { Locale locale = LocaleUtil.getLocale(request); <START> Map<String, String> baseContentTypeNames = this.getBaseContentTypeNames(locale); <END> List<ContentTypeView> recentsContent = structureAPI.getRecentContentType(type, user, -1) .stream() .map(map -> new ContentTypeView(map.get("type").toString(), map.get("name").toString(), map.get("inode").toString(), contentTypeUtil.getActionUrl(request, map.get("inode").toString(), user))) .collect(Collectors.toList()); if (!recentsContent.isEmpty()){ String name = String.format("RECENT_%s" ,type.toString()); String label = LanguageUtil.get(locale, name); baseContentTypesView.add(new BaseContentTypesView(name, label, recentsContent)); } }</code><technical_language>This thread-safe map inmutable</technical_language>

Target:
private void addRecents(final HttpServletRequest request, final User user, Structure.Type type, List<BaseContentTypesView> baseContentTypesView) throws DotDataException, LanguageException { Locale locale = LocaleUtil.getLocale(request); List<ContentTypeView> recentsContent = structureAPI.getRecentContentType(type, user, -1) .stream() .map(map -> new ContentTypeView(map.get("type").toString(), map.get("name").toString(), map.get("inode").toString(), contentTypeUtil.getActionUrl(request, map.get("inode").toString(), user))) .collect(Collectors.toList()); if (!recentsContent.isEmpty()){ String name = String.format("RECENT_%s" ,type.toString()); String label = LanguageUtil.get(locale, name.toLowerCase()); baseContentTypesView.add(new BaseContentTypesView(name, label, recentsContent)); } }
Source:
<code>public MeasurementDetailsLoader( @NonNull final Context context, @Nullable String measurementId, @Nullable String ministryId, @Nullable String mcc, @Nullable String period, @NonNull final IntentFilter... filters) { <START> super(context, filters); <END> measurementDao = MeasurementDao.getInstance(context); if(measurementId != null && ministryId != null && mcc != null) { if(period == null) { this.period = getCurrentPeriod(); } else { this.period = period; } this.measurementId = measurementId; this.ministryId = ministryId; this.mcc = mcc; } }</code><technical_language>add in IntentFilter listen for MeasurementDetails changing in background. I forgotten in ChurchesLoader originally, fixed in current PR. like: addIntentFilter(BroadcastUtils.updateChurchesFilter()) filter matches intent broadcast measurements updated. This allow Loader automatically refresh data is notified data changed</technical_language>

Target:
public MeasurementDetailsLoader( @NonNull final Context context, @Nullable String measurementId, @Nullable String ministryId, @Nullable String mcc, @Nullable String period, @NonNull final IntentFilter... filters) { super(context, filters); measurementDao = MeasurementDao.getInstance(context); if(measurementId != null && ministryId != null && mcc != null) { if(period == null) { this.period = getCurrentPeriod(); } else { this.period = period; } this.measurementId = measurementId; this.ministryId = ministryId; this.mcc = mcc; addIntentFilter(BroadcastUtils.updateMeasurementDetailsFilter()); } }
Source:
<code>public Response addServiceGroup( GroupBean serviceGroupDefinition) throws RestAPIException { try { StratosApiV41Utils.addServiceGroup(serviceGroupDefinition); URI url = uriInfo.getAbsolutePathBuilder().path(serviceGroupDefinition.getName()).build(); return Response.created(url).entity(new StatusResponseBean(Response.Status.CREATED.getStatusCode(), String.format("Cartridge Group added successfully: [cartridge-group] %s", serviceGroupDefinition.getName()))).build(); } catch (RestAPIException e) { if (e.getCause().getMessage().contains("already exists")) { return Response.status(Response.Status.CONFLICT).entity(new StatusResponseBean( Response.Status.CONFLICT.getStatusCode(), "Cartridge group not found")).build(); } else if(e.getCause().getMessage().contains("duplicate cartridges")) { return Response.status(Response.Status.BAD_REQUEST).entity(new StatusResponseBean( Response.Status.BAD_REQUEST.getStatusCode(), "Cartridges duplicated in the group definition")).build(); } else if(e.getCause().getMessage().contains("duplicate groups")) { return Response.status(Response.Status.BAD_REQUEST).entity(new StatusResponseBean( Response.Status.BAD_REQUEST.getStatusCode(), "Groups duplicated in the group definition")).build(); } else if(e.getCause().getMessage().contains("cyclic group")) { return Response.status(Response.Status.BAD_REQUEST).entity(new StatusResponseBean( <START> Response.Status.BAD_REQUEST.getStatusCode(), "Cyclic group behaviour identified in the group definition")).build(); <END> } else { throw e; } } }</code><technical_language>IMO e.getCause().getMessage().contains("") is a good filter out Status.Can't return status code exception self</technical_language>

Target:
public Response addServiceGroup( GroupBean serviceGroupDefinition) throws RestAPIException { try { StratosApiV41Utils.addServiceGroup(serviceGroupDefinition); URI url = uriInfo.getAbsolutePathBuilder().path(serviceGroupDefinition.getName()).build(); return Response.created(url).entity(new StatusResponseBean(Response.Status.CREATED.getStatusCode(), String.format("Cartridge Group added successfully: [cartridge-group] %s", serviceGroupDefinition.getName()))).build(); } catch (InvalidCartridgeGroupDefinitionException e) { return Response.status(Response.Status.BAD_REQUEST).entity(new StatusResponseBean( Response.Status.BAD_REQUEST.getStatusCode(), e.getMessage())).build(); } catch (RestAPIException e) { if (e.getCause().getMessage().contains("already exists")) { return Response.status(Response.Status.CONFLICT).entity(new StatusResponseBean( Response.Status.CONFLICT.getStatusCode(), "Cartridge group not found")).build(); } else { throw e; } } }
Source:
<code>private void setupCPU(MetricRegistry metricRegistry) { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = ObjectName.getInstance("java.lang:type=OperatingSystem"); attrList = mbs.getAttributes(objectName, new String[]{"ProcessCpuLoad"}); } catch (MalformedObjectNameException | ReflectionException | InstanceNotFoundException e) { LOG.error("can't get attribute list for jvm-cpu", e); } metricRegistry.register(MetricRegistry.name("jvm-cpu"), (Gauge<Double>) () -> { try { return getProcessCpuLoad(); <START> } catch (MalformedObjectNameException | ReflectionException | InstanceNotFoundException e) { <END> LOG.error("Can't get cpu", e); return Double.NaN; } }); }</code><technical_language>This catch needed anymore? is gone, lambda replaced metricRegistry.register(MetricRegistry.name("jvm-cpu"), this::getProcessCpuLoad); is more concise</technical_language>

Target:
private void setupCPU(MetricRegistry metricRegistry) { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = ObjectName.getInstance("java.lang:type=OperatingSystem"); AttributeList attrList = mbs.getAttributes(objectName, new String[]{"ProcessCpuLoad"}); attr = (Attribute)attrList.get(0); } catch (MalformedObjectNameException | ReflectionException | InstanceNotFoundException e) { LOG.error("can't get attribute list for jvm-cpu", e); } metricRegistry.register(MetricRegistry.name("jvm-cpu"), this.getProcessCpuLoad); }
Source:
<code>public static Bytes addShard(String nodeId, VariableOrder varOrder, VisibilityBindingSet bs) { String[] rowPrefixAndId = nodeId.split("_"); Preconditions.checkArgument(rowPrefixAndId.length == 2); String prefix = rowPrefixAndId[0]; String id = rowPrefixAndId[1]; String firstBindingString = ""; Bytes rowSuffix = Bytes.of(id); if (varOrder.getVariableOrders().size() > 0) { VariableOrder first = new VariableOrder(varOrder.getVariableOrders().get(0)); firstBindingString = BS_CONVERTER.convert(bs, first); rowSuffix = RowKeyUtil.makeRowKey(id, varOrder, bs); <START> } <END> BytesBuilder builder = Bytes.builder(); builder.append(Bytes.of(prefix + ":")); builder.append(genHash(Bytes.of(id + NODEID_BS_DELIM + firstBindingString))); builder.append(":"); builder.append(rowSuffix); return builder.toBytes(); }</code><technical_language>null check</technical_language>

Target:
public static Bytes addShard(String nodeId, VariableOrder varOrder, VisibilityBindingSet bs) { checkNotNull(nodeId); checkNotNull(varOrder); checkNotNull(bs); String[] rowPrefixAndId = nodeId.split("_"); Preconditions.checkArgument(rowPrefixAndId.length == 2); String prefix = rowPrefixAndId[0]; String id = rowPrefixAndId[1]; String firstBindingString = ""; Bytes rowSuffix = Bytes.of(id); if (varOrder.getVariableOrders().size() > 0) { VariableOrder first = new VariableOrder(varOrder.getVariableOrders().get(0)); firstBindingString = BS_CONVERTER.convert(bs, first); rowSuffix = RowKeyUtil.makeRowKey(id, varOrder, bs); } BytesBuilder builder = Bytes.builder(); builder.append(Bytes.of(prefix + ":")); builder.append(genHash(Bytes.of(id + NODEID_BS_DELIM + firstBindingString))); builder.append(":"); builder.append(rowSuffix); return builder.toBytes(); }
Source:
<code>public AssetIngestor.Source getSource() { <START> throw new UnsupportedOperationException("Not supported yet."); END> }</code><technical_language>A bit of IDE-generated noise here</technical_language>

Target:
public AssetIngestor.Source getSource() { throw new UnsupportedOperationException("This implementation of folder does not provide a source."); }
Source:
<code>public void setCardDetail(CardDetails cardDetail) { <START> CardDetail = cardDetail; <END> }</code><technical_language>Shouln't this this.variable name. This is a Potential Null pointer Exception</technical_language>

Target:
public void setCardDetail(CardDetails cardDetail) { this.cardDetail = cardDetail; }
Source:
<code>File findManifestInKnownPathsStartingFromGenFolder(String sourcesGenerationFolder) throws FileNotFoundException { Matcher gradleMatcher = GRADLE_GEN_FOLDER.matcher(sourcesGenerationFolder); Matcher mavenMatcher = MAVEN_GEN_FOLDER.matcher(sourcesGenerationFolder); Matcher eclipseMatcher = ECLIPSE_GEN_FOLDER.matcher(sourcesGenerationFolder); AndroidManifestFinderStrategy strategy = null; File androidManifestFile = null; <START> if (gradleMatcher.matches()) { <END> strategy = new GradleAndroidManifestFinderStrategy(gradleMatcher); } else if (mavenMatcher.matches()) { strategy = new MavenAndroidManifestFinderStrategy(mavenMatcher); } else if (eclipseMatcher.matches()) { strategy = new EclipseAndroidManifestFinderStrategy(eclipseMatcher); } if (strategy != null) { androidManifestFile = strategy.findAndroidManifestFile(); } if (androidManifestFile != null) { LOGGER.debug("{} AndroidManifest.xml file found using generation folder {}: {}", strategy.name, sourcesGenerationFolder, androidManifestFile.toString()); } else { LOGGER.error("Could not find the AndroidManifest.xml file, using generation folder [{}])", sourcesGenerationFolder); } return androidManifestFile; }</code><technical_language>I add a method matches(String sourceGenerationFolder in implementations of AndroidManifestFinderStrategy avoid if..else if..else. way, create a list a AndroidManifestFinderStrategy, iterate find right strategy. constants XXX_GEN_FOLDER a constant of strategy</technical_language>

Target:
File findManifestInKnownPathsStartingFromGenFolder(String sourcesGenerationFolder) throws FileNotFoundException { Iterable<AndroidManifestFinderStrategy> strategies = Arrays.asList(new GradleAndroidManifestFinderStrategy(sourcesGenerationFolder), new MavenAndroidManifestFinderStrategy(sourcesGenerationFolder), new EclipseAndroidManifestFinderStrategy(sourcesGenerationFolder)); AndroidManifestFinderStrategy applyingStrategy = null; for (AndroidManifestFinderStrategy strategy : strategies) { if (strategy.applies()) { applyingStrategy = strategy; break; } } File androidManifestFile = null; if (applyingStrategy != null) { androidManifestFile = applyingStrategy.findAndroidManifestFile(); } if (androidManifestFile != null) { LOGGER.debug("{} AndroidManifest.xml file found using generation folder {}: {}", applyingStrategy.name, sourcesGenerationFolder, androidManifestFile.toString()); } else { LOGGER.error("Could not find the AndroidManifest.xml file, using generation folder [{}])", sourcesGenerationFolder); } return androidManifestFile; }
Source:
<code>public RepositoryDTO fetchInstallableApplications() { final File[] categoryDirectories = repositoryDirectory.listFiles(); if (categoryDirectories == null) { return null; <START> } <END> LOGGER.info("Reading directory : " + repositoryDirectory); final RepositoryDTO.Builder repositoryDTOBuilder = new RepositoryDTO.Builder() .withName(repositoryDirectory.getName()).withCategories(fetchCategories(categoryDirectories)); final File i18nDirectory = new File(repositoryDirectory, "i18n"); if (i18nDirectory.exists()) { final File[] translationFiles = i18nDirectory.listFiles((dir, name) -> name.endsWith(".json")); HashMap<String, String> translations = new HashMap<>(); for (File translation : translationFiles) { try { final String content = new String(Files.readAllBytes(translation.toPath())); translations.put(translation.getName(), content); } catch (IOException e) { LOGGER.error("Could not read translation json", e); } } repositoryDTOBuilder.withTranslations(translations); } return repositoryDTOBuilder.build(); }</code><technical_language>Please return empty RepositoryDTO</technical_language>

Target:
public RepositoryDTO fetchInstallableApplications() { final File[] categoryDirectories = repositoryDirectory.listFiles(); if (categoryDirectories == null) { return new RepositoryDTO.Builder().build(); } LOGGER.info("Reading directory : " + repositoryDirectory); final RepositoryDTO.Builder repositoryDTOBuilder = new RepositoryDTO.Builder() .withName(repositoryDirectory.getName()).withCategories(fetchCategories(categoryDirectories)); final File i18nDirectory = new File(repositoryDirectory, "i18n"); if (i18nDirectory.exists()) { final File[] translationFiles = i18nDirectory.listFiles((dir, name) -> name.endsWith(".json")); Set<TranslationDTO> translations = new HashSet<>(); for (File translation : translationFiles) { try { final String language = translation.getName(); final String content = new String(Files.readAllBytes(translation.toPath())); final TranslationDTO.Builder translationDTOBuilder = new TranslationDTO.Builder() .withLanguage(language).withJson(content); translations.add(translationDTOBuilder.build()); } catch (IOException e) { LOGGER.error("Could not read translation json", e); } } repositoryDTOBuilder.withTranslations(translations); } return repositoryDTOBuilder.build(); }
Source:
<code>protected void initStructureMergeViewerFilter(Comparison comparison, IComparisonScope comparisonScope) { EMFCompareRCPUIPlugin plugin = EMFCompareRCPUIPlugin.getDefault(); IDifferenceFilter.Registry filterRegistry = plugin.getDifferenceFilterRegistry(); Collection<IDifferenceFilter> filters = filterRegistry.getFilters(comparisonScope, comparison); Collection<IDifferenceFilter> selectedFilters = Lists.newArrayList(); Collection<IDifferenceFilter> unselectedFilters = Lists.newArrayList(); Collection<IDifferenceFilter> activeFilters = Lists.newArrayList(); for (IDifferenceFilter filter : filters) { if (filter instanceof IDeactivableDiffFilter) { if (((IDeactivableDiffFilter)filter).isActive()) { <START> if (filter.defaultSelected()) { selectedFilters.add(filter); } else { unselectedFilters.add(filter); } <END> activeFilters.add(filter); } } else { if (filter.defaultSelected()) { selectedFilters.add(filter); } else { unselectedFilters.add(filter); } activeFilters.add(filter); } } getStructureMergeViewerFilter().init(selectedFilters, unselectedFilters, activeFilters); }</code><technical_language>is this if duplicated? easier apply this behavior (the if (filter.defaultSelected()... activeFilters.add(filter) for diffs IDeactivatableDiffFilters inactive IDeactivatableDiffFilters</technical_language>

Target:
protected void initStructureMergeViewerFilter(Comparison comparison, IComparisonScope comparisonScope) { EMFCompareRCPUIPlugin plugin = EMFCompareRCPUIPlugin.getDefault(); IDifferenceFilter.Registry filterRegistry = plugin.getDifferenceFilterRegistry(); Collection<IDifferenceFilter> filters = filterRegistry.getFilters(comparisonScope, comparison); Collection<IDifferenceFilter> selectedFilters = Lists.newArrayList(); Collection<IDifferenceFilter> unselectedFilters = Lists.newArrayList(); Collection<IDifferenceFilter> activeFilters = Lists.newArrayList(); for (IDifferenceFilter filter : filters) { if (!(filter instanceof IDeactivableDiffFilter) || ((IDeactivableDiffFilter)filter).isActive()) { if (filter.defaultSelected()) { selectedFilters.add(filter); } else { unselectedFilters.add(filter); } activeFilters.add(filter); } } getStructureMergeViewerFilter().init(selectedFilters, unselectedFilters, activeFilters); }
Source:
<code>private static void bindNamed(ParsedParameters params, Binding binding, PreparedStatement statement, StatementContext context) { List<String> paramNames = params.getParameterNames(); boolean argumentsProvidedButNoneDeclared = paramNames.isEmpty() && !binding.isEmpty(); if (argumentsProvidedButNoneDeclared && !context.getConfig(SqlStatements.class).isUnusedBindingAllowed()) { throw new UnableToCreateStatementException(String.format("Superfluous named parameters provided while the query declares none: '%s'.", binding), context); } for (int i = 0; i < paramNames.size(); i++) { String name = paramNames.get(i); Optional<Argument> argument = binding.findForName(name, context); if (argument.isPresent()) { try { <START> argument.get().apply(i + 1, statement, context); <END> } catch (SQLException e) { throw new UnableToCreateStatementException(String.format("Exception while binding named parameter '%s'", name), e, context); } } else { throw new UnableToCreateStatementException(String.format("Missing named parameter '%s'.", name), context); } } }</code><technical_language>improvement here. style orElseThrow is a preferred form isPresent style</technical_language>

Target:
private static void bindNamed(ParsedParameters params, Binding binding, PreparedStatement statement, StatementContext context) { List<String> paramNames = params.getParameterNames(); boolean argumentsProvidedButNoneDeclared = paramNames.isEmpty() && !binding.isEmpty(); if (argumentsProvidedButNoneDeclared && !context.getConfig(SqlStatements.class).isUnusedBindingAllowed()) { throw new UnableToCreateStatementException(String.format("Superfluous named parameters provided while the query declares none: '%s'.", binding), context); } for (int i = 0; i < paramNames.size(); i++) { String name = paramNames.get(i); Optional<Argument> argument = binding.findForName(name, context); try { argument.orElseThrow(() -> new UnableToCreateStatementException(String.format("Missing named parameter '%s'.", name), context)).apply(i + 1, statement, context); } catch (SQLException e) { throw new UnableToCreateStatementException(String.format("Exception while binding named parameter '%s'", name), e, context); } } }
Source:
<code>protected void processHeader(CommandLine cl) { printInfo("File Size", "In Alluxio", <START> cl.hasOption(MEMORY_OPTION_NAME) ? Optional.of("In Memory") : Optional.empty(), <END> "Path", cl.hasOption(GROUP_BY_WORKER_OPTION_NAME) ? Optional.of("Worker Host Name") : Optional.empty()); }</code><technical_language>is difference between: cl.hasOption(MEMORY_OPTION_NAME) ? Optional.of("In Memory") : Optional.empty() cl.hasOption(MEMORY_OPTION_NAME) ? "In Memory" : ""</technical_language>

Target:
protected void processHeader(CommandLine cl) { printInfo("File Size", "In Alluxio", "Path", cl.hasOption(MEMORY_OPTION_NAME) ? Optional.of("In Memory") : Optional.empty(), cl.hasOption(GROUP_BY_WORKER_OPTION_NAME) ? Optional.of("Worker Host Name") : Optional.empty()); }
Source:
<code>private String getWsAgentUrl(String workspaceId) throws Exception { Workspace workspace = workspaceServiceClient.getById(workspaceId); workspaceServiceClient.ensureRunningStatus(workspace); Map<String, ? extends Machine> machines = workspaceServiceClient.getById(workspaceId).getRuntime().getMachines(); for (Machine machine : machines.values()) { <START> if (machine.getServers().get("wsagent/http") != null) { <END> return machine.getServers().get("wsagent/http").getUrl() + "/project"; } } throw new RuntimeException("Cannot find dev machine on workspace"); }</code><technical_language>Reuse constant workspace module</technical_language>

Target:
private String getWsAgentUrl(String workspaceId) throws Exception { Workspace workspace = workspaceServiceClient.getById(workspaceId); workspaceServiceClient.ensureRunningStatus(workspace); Map<String, ? extends Machine> machines = workspaceServiceClient.getById(workspaceId).getRuntime().getMachines(); for (Machine machine : machines.values()) { if (containsWsAgentServer(machine)) { Server wsAgentServer = machine.getServers().get(SERVER_WS_AGENT_HTTP_REFERENCE); if (wsAgentServer != null) { return wsAgentServer.getUrl() + "/project"; } else { throw new RuntimeException("Workspace agent server is null"); } } } throw new RuntimeException("Cannot find dev machine on workspace"); }
Source:
<code>private static String toBase64_(byte[] bytes) { String base64 = Base64.getEncoder().encodeToString(bytes); StringBuilder str = new StringBuilder(base64.length() + base64.length() / 76); if (base64.length() > 76) { <START> Splitter.fixedLength(76).split(base64).iterator().forEachRemaining(s -> { <END> str.append(s); str.append("\n"); }); return str.substring(0, str.length() - 1); } return base64; }</code><technical_language>please clarify do split lines manually instead of java.util.Base64#getMimeEncoder() ? Base64 split lines fine</technical_language>

Target:
private static String toBase64_(byte[] bytes) { String base64 = Base64.getEncoder().encodeToString(bytes); StringBuilder str = new StringBuilder(base64.length() + base64.length() / 76); Splitter.fixedLength(76).split(base64).iterator().forEachRemaining(s -> { str.append(s); str.append("\n"); }); return str.substring(0, str.length() - 1); }
Source:
<code>public static void d(final String message, int padStack) { if (!BuildConfig.DEBUG) return; StackTraceElement calledFrom = Thread.currentThread().getStackTrace()[3 + padStack]; <START> Log.d(tag(), String.format("%1$-"+75+ "s", message) + " ~ [" + calledFrom.getClassName() + "." + calledFrom.getMethodName() + "@" + calledFrom.getLineNumber() + "]"); <END> }</code><technical_language>This method call is long. Construct string else where. I suggest letting developer add a bit more information tag filter debug data package. TUDELFT TAG relevant if add it</technical_language>

Target:
public static void d(final String message, int padStack) { if (!BuildConfig.DEBUG) return; StackTraceElement calledFrom = Thread.currentThread().getStackTrace()[3 + padStack]; String stack = " ~ [" + calledFrom.getClassName() + "." + calledFrom.getMethodName() + "@" + calledFrom.getLineNumber() + "]"; Log.d(tag(), String.format("%1$-"+75+ "s", message) + stack); }
Source:
<code>void validateListUserName(final String listUserName) throws FileParsingException { try { if (StringUtils.isNotEmpty(listUserName)) { final User user = this.userDataManager.getUserByFullname(listUserName); if (user != null) { this.importedList.setUserId(user.getUserid()); } else { throw new FileParsingException(CrossesListDescriptionSheetParser.INVALID_LIST_USER); } } } catch (MiddlewareQueryException e) { <START> throw new FileParsingException(CrossesListDescriptionSheetParser.MORE_THAN_ONE_USER1 + listUserName <END> + CrossesListDescriptionSheetParser.MORE_THAN_ONE_USER2); } }</code><technical_language>String.format() constant</technical_language>

Target:
void validateListUserName(final String listUserName) throws FileParsingException { try { if (StringUtils.isNotEmpty(listUserName)) { final User user = this.userDataManager.getUserByFullname(listUserName); if (user != null) { this.importedList.setUserId(user.getUserid()); } else { throw new FileParsingException(CrossesListDescriptionSheetParser.INVALID_LIST_USER); } } } catch (MiddlewareQueryException e) { throw new FileParsingException(String.format(MORE_THAN_ONE_USER, listUserName)); } }
Source:
<code>protected boolean canDoAction() { <START> if (getVm() == null) { <END> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (getVm().getTemplateVersionNumber() != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_SET_FOR_LATEST); } VmTemplate latest = getVmTemplateDAO().getTemplateWithLatestVersionInChain(getVm().getVmtGuid()); if (latest == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); } if (getVm().getVmtGuid().equals(latest.getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_ALREADY_IN_LATEST_VERSION); } setVmTemplateId(latest.getId()); setVmTemplate(latest); getVm().setVmtGuid(latest.getId()); return true; }</code><technical_language>VM</technical_language>

Target:
protected boolean canDoAction() { if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (getVm().getTemplateVersionNumber() != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_SET_FOR_LATEST); } if (getVmTemplate() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); } if (getVm().getVmtGuid().equals(getVmTemplate().getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_ALREADY_IN_LATEST_VERSION); } getVm().setVmtGuid(getVmTemplate().getId()); return true; }
Source:
<code>public ValueGenerator(Field field) { ValueCounts valueCounts = field.getValueCounts(); type = field.getType(); if (valueCounts.size() == 0) { length = field.getMaxLength(); generatorType = RANDOM; } else { int length = valueCounts.size(); int runningTotal = 0; values = new String[length]; cumulativeFrequency = new int[length]; for (int i = 0; i < length; i++) { values[i] = valueCounts.get(i).getValue(); runningTotal += valueCounts.get(i).getFrequency(); cumulativeFrequency[i] = runningTotal; } <START> totalFrequency = valueCounts.getSummedFrequency(); <END> generatorType = REGULAR; } }</code><technical_language>= runningTotal</technical_language>

Target:
public ValueGenerator(Field field) { ValueCounts valueCounts = field.getValueCounts(); fieldName = field.getName(); type = field.getType(); boolean isUnique = field.getFractionUnique() != null && field.getFractionUnique() == 1; if (valueCounts.isEmpty()) { length = field.getMaxLength(); generatorType = RANDOM; } else { int length = valueCounts.size(); int runningTotal = 0; values = new String[length]; cumulativeFrequency = new int[length]; for (int i = 0; i < length; i++) { values[i] = valueCounts.get(i).getValue(); int frequency; if (doUniformSampling) { frequency = 1; } else { frequency = valueCounts.get(i).getFrequency(); } runningTotal += frequency; cumulativeFrequency[i] = runningTotal; } totalFrequency = runningTotal; generatorType = REGULAR; } if (isUnique) { generatorType = PRIMARY_KEY; pk_cursor = 0; } }
Source:
<code>private void determineDrawerItemsToInclude() { boolean shouldShowSavedFormsItem = CommCarePreferences.isSavedFormsEnabled(); boolean shouldShowChangeLanguageItem = ChangeLocaleUtil.getLocaleNames().length > 1; int numItemsToInclude = allDrawerItems.size() - (shouldShowChangeLanguageItem ? 0 : 1) - (shouldShowSavedFormsItem ? 0 : 1); drawerItemsShowing = new NavDrawerItem[numItemsToInclude]; int index = 0; for (String id : getAllItemIdsInOrder()) { NavDrawerItem item = allDrawerItems.get(id); if ((id.equals(CHANGE_LANGUAGE_DRAWER_ITEM_ID) && !shouldShowChangeLanguageItem) || (id.equals(SAVED_FORMS_ITEM_ID) && !shouldShowSavedFormsItem)) { <START> continue; <END> } else { drawerItemsShowing[index] = item; index++; } } }</code><technical_language>unneeded continue statement</technical_language>

Target:
private void determineDrawerItemsToInclude() { boolean hideSavedFormsItem = !CommCarePreferences.isSavedFormsEnabled(); boolean hideChangeLanguageItem = ChangeLocaleUtil.getLocaleNames().length <= 1; int numItemsToInclude = allDrawerItems.size() - (hideChangeLanguageItem ? 1 : 0) - (hideSavedFormsItem ? 1 : 0); drawerItemsShowing = new NavDrawerItem[numItemsToInclude]; int index = 0; for (String id : getAllItemIdsInOrder()) { NavDrawerItem item = allDrawerItems.get(id); if (!excludeItem(id, hideChangeLanguageItem, hideSavedFormsItem)) { drawerItemsShowing[index] = item; index++; } } }
Source:
<code>public Duration getNextRetryInterval(Exception lastException, Duration remainingTime) { int baseWaitTime = 0; <START> if (lastException == null || !(lastException instanceof AmqpException)) { <END> return this.onGetNextRetryInterval(lastException, remainingTime, baseWaitTime, this.getRetryCount()); } if (((AmqpException) lastException).getErrorCondition() == ErrorCondition.SERVER_BUSY_ERROR) { baseWaitTime += ClientConstants.SERVER_BUSY_BASE_SLEEP_TIME_IN_SECS; } return this.onGetNextRetryInterval(lastException, remainingTime, baseWaitTime, this.getRetryCount()); }</code><technical_language>If lastException is null instance of AmqpException, return null. For example, IllegalArgumentException is retriable</technical_language>

Target:
public Duration getNextRetryInterval(Exception lastException, Duration remainingTime) { int baseWaitTime = 0; if (!isRetriableException(lastException)) { return null; } if (retryCount.get() >= maxRetryCount) { return null; } if (((AmqpException) lastException).getErrorCondition() == ErrorCondition.SERVER_BUSY_ERROR) { baseWaitTime += ClientConstants.SERVER_BUSY_BASE_SLEEP_TIME_IN_SECS; } return this.calculateNextRetryInterval(lastException, remainingTime, baseWaitTime, this.getRetryCount()); }
Source:
<code>public TaskSerdeTest() { TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); for (final Module jacksonModule : new FirehoseModule().getJacksonModules()) { jsonMapper.registerModule(jacksonModule); } final File baseDir = new File("lol"); baseDir.mkdir(); <START> baseDir.deleteOnExit(); <END> }</code><technical_language>this a @Rule TemporaryFolder instead</technical_language>

Target:
public TaskSerdeTest() { TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); for (final Module jacksonModule : new FirehoseModule().getJacksonModules()) { jsonMapper.registerModule(jacksonModule); } }
Source:
<code><START> public DeclarationTree IMPORT_DECLARATION() { <END> return b.<DeclarationTree>nonterminal(EcmaScriptLexer.IMPORT_DECLARATION) .is(b.firstOf( f.importDeclaration( b.token(JavaScriptKeyword.IMPORT), IMPORT_CLAUSE(), FROM_CLAUSE(), b.token(EcmaScriptLexer.EOS)), f.importModuleDeclaration( b.token(JavaScriptKeyword.IMPORT), STRING_LITERAL(), b.token(EcmaScriptLexer.EOS)))); }</code><technical_language>Consider pushing this import clause up, NAMED_IMPORTS</technical_language>

Target:
public DeclarationTree IMPORT_DECLARATION() { return b.<DeclarationTree>nonterminal(EcmaScriptLexer.IMPORT_DECLARATION) .is(b.firstOf( f.importDeclaration( b.token(JavaScriptKeyword.IMPORT), IMPORT_CLAUSE(), FROM_CLAUSE(), b.token(EcmaScriptLexer.EOS)), f.importDeclaration( b.token(JavaScriptKeyword.IMPORT), FLOW_TYPE_KEYWORD(), IMPORT_CLAUSE(), FROM_CLAUSE(), b.token(EcmaScriptLexer.EOS)), f.importModuleDeclaration( b.token(JavaScriptKeyword.IMPORT), STRING_LITERAL(), b.token(EcmaScriptLexer.EOS)))); }
Source:
<code>protected void reduce( LongWritable key, Iterable<BytesWritable> values, Context context ) throws IOException, InterruptedException { HyperLogLogCollector aggregate = HyperLogLogCollector.makeLatestCollector(); for (BytesWritable value : values) { aggregate.fold( HyperLogLogCollector.makeCollector(ByteBuffer.wrap(value.getBytes(), 0, value.getLength())) ); } <START> Interval interval = config.getGranularitySpec().getSegmentGranularity().bucket(new DateTime(key.get())); <END> intervals.add(interval); final Path outPath = config.makeSegmentPartitionInfoPath(interval); final OutputStream out = Utils.makePathAndOutputStream( context, outPath, config.isOverwriteFiles() ); try { HadoopDruidIndexerConfig.JSON_MAPPER.writerWithType( new TypeReference<Long>() { } ).writeValue( out, new Double(aggregate.estimateCardinality()).longValue() ); } finally { Closeables.close(out, false); } }</code><technical_language>config.getGranularitySpec().bucketInterval() config.getGranularitySpec().getSegmentGranularity().bucket() interchangeable? config.getGranularitySpec().bucketInterval() finds a proper interval bucket intervals in granularity spec while config.getGranularitySpec().getSegmentGranularity().bucket() computes interval input dateTime. I determinIntervals means compute intervals inputs bucket intervals is absent in granularity spec if true. Otherwise, find proper intervals bucket intervals</technical_language>

Target:
protected void reduce( LongWritable key, Iterable<BytesWritable> values, Context context ) throws IOException, InterruptedException { HyperLogLogCollector aggregate = HyperLogLogCollector.makeLatestCollector(); for (BytesWritable value : values) { aggregate.fold( HyperLogLogCollector.makeCollector(ByteBuffer.wrap(value.getBytes(), 0, value.getLength())) ); } Interval interval; if (determineIntervals) { interval = config.getGranularitySpec().getSegmentGranularity().bucket(DateTimes.utc(key.get())); } else { Optional<Interval> intervalOptional = config.getGranularitySpec().bucketInterval(DateTimes.utc(key.get())); if (!intervalOptional.isPresent()) { throw new ISE("WTF?! No bucket found for timestamp: %s", key.get()); } interval = intervalOptional.get(); } intervals.add(interval); final Path outPath = config.makeSegmentPartitionInfoPath(interval); final OutputStream out = Utils.makePathAndOutputStream( context, outPath, config.isOverwriteFiles() ); try { HadoopDruidIndexerConfig.JSON_MAPPER.writerWithType( new TypeReference<Long>() { } ).writeValue( out, aggregate.estimateCardinalityRound() ); } finally { Closeables.close(out, false); } }
Source:
<code>public String get(String name) { <START> List<String> requestIdList = values(name); <END> String requestId = null; if (requestIdList != null && requestIdList.size() > 0) { requestId = requestIdList.get(0); } return requestId; }</code><technical_language>rename requestIdList variable a more generic</technical_language>

Target:
public String get(String name) { List<String> valuesList = values(name); String value = null; if (valuesList != null && valuesList.size() > 0) { value = valuesList.get(0); } return value; }
Source:
<code>protected void executeCommand() { DbUser userToAdd = getParameters().getUserToAdd(); for (DbUser user : SyncUsers.sync(Arrays.asList(userToAdd))) { <START> DbFacade.getInstance().getDbUserDao().saveOrUpdate(user); <END> } setActionReturnValue(DbFacade.getInstance().getDbUserDao().getByExternalId(userToAdd.getDomain(), userToAdd.getExternalId()).getId()); setSucceeded(true); }</code><technical_language>user... need loop... if is a new user - save if active if is existing user - update</technical_language>

Target:
protected void executeCommand() { DbUser userToAdd = getParameters().getUserToAdd(); DbUser syncedUser = SyncUsers.sync(Arrays.asList(userToAdd)).get(0); if (Guid.isNullOrEmpty(syncedUser.getId()) && syncedUser.isActive()) { DbFacade.getInstance().getDbUserDao().save(syncedUser); } else { if (!Guid.isNullOrEmpty(syncedUser.getId())) { DbFacade.getInstance().getDbUserDao().update(syncedUser); } } setActionReturnValue(DbFacade.getInstance().getDbUserDao().getByExternalId(userToAdd.getDomain(), userToAdd.getExternalId()).getId()); setSucceeded(true); }
Source:
<code>private void testGetFeedbackSessionsClosedWithinThePastHour() throws Exception { ______TS("init : 0 standard sessions closed within the past hour"); List<FeedbackSessionAttributes> sessionList = fsLogic.getFeedbackSessionsClosedWithinThePastHour(); assertEquals(0, sessionList.size()); ______TS("case : 1 closed session in undeleted course within the past hour"); FeedbackSessionAttributes session = getNewFeedbackSession(); session.setTimeZone(ZoneId.of("UTC")); session.setSessionVisibleFromTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session.setEndTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-1)); <START> ThreadHelper.waitBriefly(); END> fsLogic.createFeedbackSession(session); sessionList = fsLogic.getFeedbackSessionsClosedWithinThePastHour(); assertEquals(1, sessionList.size()); assertEquals(session.getFeedbackSessionName(), sessionList.get(0).getFeedbackSessionName()); ______TS("case : 1 closed session in deleted course within the past hour"); coursesLogic.moveCourseToRecycleBin(session.getCourseId()); sessionList = fsLogic.getFeedbackSessionsClosedWithinThePastHour(); assertEquals(0, sessionList.size()); coursesLogic.restoreCourseFromRecycleBin(session.getCourseId()); fsLogic.deleteFeedbackSessionCascade(session.getFeedbackSessionName(), session.getCourseId()); }</code><technical_language>I guess test grace period? java public boolean isClosedWithinPastHour() { Instant = Instant.now(); Instant = endTime.plus(gracePeriod); return given.isBefore(now) && Duration.between(given, now).compareTo(Duration.ofHours(1)) < 0; }</technical_language>

Target:
private void testGetFeedbackSessionsClosedWithinThePastHour() throws Exception { ______TS("init : 0 standard sessions closed within the past hour"); List<FeedbackSessionAttributes> sessionList = fsLogic.getFeedbackSessionsClosedWithinThePastHour(); assertEquals(0, sessionList.size()); ______TS("case : 1 closed session in undeleted course within the past hour"); FeedbackSessionAttributes session = getNewFeedbackSession(); session.setTimeZone(ZoneId.of("UTC")); session.setSessionVisibleFromTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session.setEndTime(TimeHelperExtension.getInstantMinutesOffsetFromNow(-59)); fsLogic.createFeedbackSession(session); sessionList = fsLogic.getFeedbackSessionsClosedWithinThePastHour(); assertEquals(1, sessionList.size()); assertEquals(session.getFeedbackSessionName(), sessionList.get(0).getFeedbackSessionName()); ______TS("case : 1 closed session in deleted course within the past hour"); coursesLogic.moveCourseToRecycleBin(session.getCourseId()); sessionList = fsLogic.getFeedbackSessionsClosedWithinThePastHour(); assertEquals(0, sessionList.size()); coursesLogic.restoreCourseFromRecycleBin(session.getCourseId()); fsLogic.deleteFeedbackSessionCascade(session.getFeedbackSessionName(), session.getCourseId()); }
Source:
<code><T> boolean containsJsonSerializable(Class<T> c) { <START> return CompositePath.class.isAssignableFrom(c) <END> || ConflictResolutionPolicy.class.isAssignableFrom(c) || ConsistencyPolicy.class.isAssignableFrom(c) || DatabaseAccountLocation.class.isAssignableFrom(c) || ExcludedPath.class.isAssignableFrom(c) || IncludedPath.class.isAssignableFrom(c) || IndexingPolicy.class.isAssignableFrom(c) || PartitionKeyDefinition.class.isAssignableFrom(c) || SpatialSpec.class.isAssignableFrom(c) || SqlParameter.class.isAssignableFrom(c) || SqlQuerySpec.class.isAssignableFrom(c) || UniqueKey.class.isAssignableFrom(c) || UniqueKeyPolicy.class.isAssignableFrom(c) || Index.class.isAssignableFrom(c) || CosmosError.class.isAssignableFrom(c); }</code><technical_language>able do class equality of classes is expected subclassed. suggestion CompositePath.class.equals(c)</technical_language>

Target:
<T> boolean containsJsonSerializable(Class<T> c) { return CompositePath.class.equals(c) || ConflictResolutionPolicy.class.equals(c) || ConsistencyPolicy.class.equals(c) || DatabaseAccountLocation.class.equals(c) || ExcludedPath.class.equals(c) || IncludedPath.class.equals(c) || IndexingPolicy.class.equals(c) || PartitionKeyDefinition.class.equals(c) || SpatialSpec.class.equals(c) || SqlParameter.class.equals(c) || SqlQuerySpec.class.equals(c) || UniqueKey.class.equals(c) || UniqueKeyPolicy.class.equals(c) || Index.class.isAssignableFrom(c) || CosmosError.class.equals(c); }
Source:
<code>public WsWorkunitsClientSoapProxyWrapper(String baseURL, String user, String pass, Version platformVersion) { this.platformVersion=platformVersion; version7WorkunitsServiceSoapProxy = new WsWorkunitsServiceSoapProxy(baseURL); if (version7WorkunitsServiceSoapProxy != null) { version7WorkunitsServiceSoap = version7WorkunitsServiceSoapProxy.getWsWorkunitsServiceSoap(); if (user != null && pass != null) Connection.initStub((Stub) version7WorkunitsServiceSoap, user, pass); } <START> version5WorkunitsServiceSoapProxy = new org.hpccsystems.ws.client.gen.wsworkunits.v1_56.WsWorkunitsServiceSoapProxy( <END> baseURL); if (version5WorkunitsServiceSoapProxy != null) { version5WorkunitsServiceSoap = version5WorkunitsServiceSoapProxy.getWsWorkunitsServiceSoap(); if (user != null && pass != null) Connection.initStub((Stub) version5WorkunitsServiceSoap, user, pass); } version6WorkunitsServiceSoapProxy = new org.hpccsystems.ws.client.gen.wsworkunits.v1_69.WsWorkunitsServiceSoapProxy( baseURL); if (version6WorkunitsServiceSoapProxy != null) { version6WorkunitsServiceSoap = version6WorkunitsServiceSoapProxy.getWsWorkunitsServiceSoap(); if (user != null && pass != null) Connection.initStub((Stub) version6WorkunitsServiceSoap, user, pass); } }</code><technical_language>inclined defer instantiating requested</technical_language>

Target:
public WsWorkunitsClientSoapProxyWrapper(String baseURL, String user, String pass, Version platformVersion) { this.platformVersion=platformVersion; this.baseURL=baseURL; this.user=user; this.password=pass; }
Source:
<code>private static boolean isSwitchReturningValue(SwitchStatementTree switchStatementTree) { <START> for (CaseGroupTree caseGroupTree : switchStatementTree.cases()) { <END> if (hasSingleStatement(caseGroupTree.body(), THROW_STATEMENT, RETURN_STATEMENT)) { continue; } return false; } return true; }</code><technical_language>relying streams? java return switchStatementTree.cases().stream() .map(CaseGroupTree::body) .allMatch(body -> hasSingleStatement(body, THROW_STATEMENT, RETURN_STATEMENT));</technical_language>

Target:
private static boolean isSwitchReturningValue(SwitchStatementTree switchStatementTree) { return switchStatementTree.cases().stream() .map(CaseGroupTree::body) .allMatch(body -> hasSingleStatement(body, THROW_STATEMENT, RETURN_STATEMENT)); }
Source:
<code>public void publishJobModelVersion(String oldVersion, String newVersion) { Stat stat = new Stat(); String currentVersion = zkClient.<String>readData(keyBuilder.getJobModelVersionPath(), stat); LOG.info("pid=" + processorId + " publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat .getVersion() + ")"); if (currentVersion != null && !currentVersion.equals(oldVersion)) { throw new SamzaException( "Someone change JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion); } int dataVersion = stat.getVersion(); try { stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion); } catch (Exception e) { <START> LOG.error("publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion, e); <END> } LOG.info("pid=" + processorId + " published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) + "(actual data version after update = " + stat.getVersion() + ")"); }</code><technical_language>re-throw exception here</technical_language>

Target:
public void publishJobModelVersion(String oldVersion, String newVersion) { Stat stat = new Stat(); String currentVersion = zkClient.<String>readData(keyBuilder.getJobModelVersionPath(), stat); LOG.info("pid=" + processorId + " publishing new version: " + newVersion + "; oldVersion = " + oldVersion + "(" + stat .getVersion() + ")"); if (currentVersion != null && !currentVersion.equals(oldVersion)) { throw new SamzaException( "Someone change JobModelVersion while the leader was generating one: expected" + oldVersion + ", got " + currentVersion); } int dataVersion = stat.getVersion(); try { stat = zkClient.writeDataReturnStat(keyBuilder.getJobModelVersionPath(), newVersion, dataVersion); } catch (Exception e) { String msg = "publish job model version failed for new version = " + newVersion + "; old version = " + oldVersion; LOG.error(msg, e); throw new SamzaException(msg); } LOG.info("pid=" + processorId + " published new version: " + newVersion + "; expected data version = " + (dataVersion + 1) + "(actual data version after update = " + stat.getVersion() + ")"); }
Source:
<code>private void validateIpAddress() { String address = getIpAddress(); if (address == null) { return; } <START> if (address.trim().isEmpty()) { <END> addError(IP_ADDRESS, "IpAddress cannot be empty if it is present."); return; } try { IpAddress.create(address); } catch (Exception e) { addError(IP_ADDRESS, String.format("'%s' is an invalid IP address.", address)); } }</code><technical_language>Change StringUtils.isBlank</technical_language>

Target:
private void validateIpAddress() { String address = getIpAddress(); if (address == null) { return; } if (StringUtil.isBlank(address)) { addError(IP_ADDRESS, "IpAddress cannot be empty if it is present."); return; } try { IpAddress.create(address); } catch (Exception e) { addError(IP_ADDRESS, String.format("'%s' is an invalid IP address.", address)); } }
Source:
<code>public Frame getInvoke(RelNode r, RelNode parent) { final Frame frame = dispatcher.invoke(r); <START> if (frame != null && parent instanceof Correlate && r instanceof Sort) { <END> Sort sort = (Sort) r; if (sort.offset != null || sort.fetch != null) { currentRel = parent; return null; } } if (frame != null) { map.put(r, frame); } currentRel = parent; return frame; }</code><technical_language>this code check parent ancestor? Is valid check parent</technical_language>

Target:
public Frame getInvoke(RelNode r, RelNode parent) { final Frame frame = dispatcher.invoke(r); currentRel = parent; if (frame != null && parent != null && r instanceof Sort) { final Sort sort = (Sort) r; if (sort.offset != null || sort.fetch != null) { return null; } } if (frame != null) { map.put(r, frame); } return frame; }