auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void getProgressAndPingTaskNode(RunningTaskData taskData) { if (!jobs.canPingTask(taskData) || taskData.isRestarting() || taskData.getPingAttempts() > PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()) { return; } InternalTask task = taskData.getTask(); try { int progress = taskData.getLauncher().getProgress(); taskData.resetFirstTaskLauncherFailureTime(); if (progress != task.getProgress()) { task.setProgress(progress); listener.taskStateUpdated(taskData.getUser(), new NotificationData<>(SchedulerEvent.TASK_PROGRESS, new TaskInfoImpl((TaskInfoImpl) task.getTaskInfo()))); } } catch (Throwable t) { <START> if (taskData.getFirstTaskLauncherFailureTime() < 0) { <END> taskData.setFirstTaskLauncherFailureTime(System.currentTimeMillis()); } if (tlogger.isDebugEnabled()) { tlogger.debug(task.getId(), "TaskLauncher is not accessible since " + new Date(taskData.getFirstTaskLauncherFailureTime()) + ", checking if the node can be reached.", t); } pingTaskNodeAndInitiateRestart(task); } }</code><technical_language>add method RunningTaskData, 'taskLauncherNeverFailed() '</technical_language>

Target:
void getProgressAndPingTaskNode(RunningTaskData taskData) { if (!jobs.canPingTask(taskData) || taskData.isRestarting() || taskData.getPingAttempts() > PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()) { return; } InternalTask task = taskData.getTask(); try { int progress = taskData.getLauncher().getProgress(); taskData.resetTaskLauncherFailure(); if (progress != task.getProgress()) { task.setProgress(progress); listener.taskStateUpdated(taskData.getUser(), new NotificationData<>(SchedulerEvent.TASK_PROGRESS, new TaskInfoImpl((TaskInfoImpl) task.getTaskInfo()))); } } catch (Throwable t) { taskData.setTaskLauncherFailure(); if (tlogger.isDebugEnabled()) { tlogger.debug(task.getId(), "TaskLauncher is not accessible for " + taskData.getTaskLauncherFailurePeriod() + " ms, checking if the node can be reached.", t); } pingTaskNodeAndInitiateRestart(task); } }
Source:
<code>public void function_with_tuple_param() { FunctionDef functionTree = functionTreesByName.get("func_with_tuple_param"); Map<String, Symbol> symbolByName = getSymbolByName(functionTree); assertThat(symbolByName).hasSize(4); for (Map.Entry<String, Symbol> stringSymbolEntry : symbolByName.entrySet()) { <START> System.out.println(stringSymbolEntry.getKey()+"-"+stringSymbolEntry.getValue().name()); <END> } }</code><technical_language>I forgot remove this</technical_language>

Target:
public void function_with_tuple_param() { FunctionDef functionTree = functionTreesByName.get("func_with_tuple_param"); Map<String, Symbol> symbolByName = getSymbolByName(functionTree); assertThat(symbolByName).hasSize(4); }
Source:
<code>private <K, V> V loadValue(Cache<K, V> cache, K key, Supplier<V> valueSupplier) { if (replay) { if (cache.asMap().containsKey(key)) { return cache.asMap().get(key); } <START> return valueSupplier.get(); <END> } V value = valueSupplier.get(); cache.put(key, value); return value; }</code><technical_language>throw here</technical_language>

Target:
private <K, V> V loadValue(Cache<K, V> cache, K key, Supplier<V> valueSupplier) { if (replay) { return Optional.ofNullable(cache.getIfPresent(key)) .orElseThrow(() -> new PrestoException(NOT_FOUND, "Missing entry found for key: " + key)); } V value = valueSupplier.get(); cache.put(key, value); return value; }
Source:
<code>public Collection<Student> selectAll(Long schoolId, Boolean activeStudents) { String whereClause = " WHERE s.currentSchoolId = :schoolId"; if(null == activeStudents || !activeStudents) { <START> whereClause += " and s.withdrawalDate is not null"; <END> } else { whereClause += ACTIVE_STUDENTS_CLAUSE; } if(null != schoolId) { String sql = STUDENT_HQL + whereClause; return (List<Student>) hibernateTemplate.findByNamedParam(sql, "schoolId", schoolId); } else { return hibernateTemplate.loadAll(Student.class); } }</code><technical_language>change this line include desired .enrollStatus (just safe)</technical_language>

Target:
public Collection<Student> selectAll(Long schoolId, Boolean activeStudents) { String whereClause = " WHERE s.currentSchoolId = :schoolId"; if(null == activeStudents || !activeStudents) { whereClause += " and s.withdrawalDate is not null or s.enrollStatus != '" + EnrollStatus.CURRENTLY_ENROLLED.name() + "'"; } else { whereClause += ACTIVE_STUDENTS_CLAUSE; } if(null != schoolId) { String sql = STUDENT_HQL + whereClause; return (List<Student>) hibernateTemplate.findByNamedParam(sql, "schoolId", schoolId); } else { return hibernateTemplate.loadAll(Student.class); } }
Source:
<code>private static <T extends Annotation> AnnotationDescriptor<T> findAnnotationDescriptor( Class<?> clazz, Set<Annotation> visited, Class<T> annotationType) { Assert.notNull(annotationType, "Annotation type must not be null"); if (clazz == null || Object.class == clazz) { return null; } <START> if (isAnnotationDeclaredLocally(annotationType, clazz)) { <END> return new AnnotationDescriptor<>(clazz, clazz.getAnnotation(annotationType)); } for (Annotation composedAnnotation : clazz.getDeclaredAnnotations()) { if (!AnnotationUtils.isInJavaLangAnnotationPackage(composedAnnotation) && visited.add(composedAnnotation)) { AnnotationDescriptor<T> descriptor = findAnnotationDescriptor( composedAnnotation.annotationType(), visited, annotationType); if (descriptor != null) { return new AnnotationDescriptor<>( clazz, descriptor.getDeclaringClass(), composedAnnotation, descriptor.getAnnotation()); } } } for (Class<?> ifc : clazz.getInterfaces()) { AnnotationDescriptor<T> descriptor = findAnnotationDescriptor(ifc, visited, annotationType); if (descriptor != null) { return new AnnotationDescriptor<>(clazz, descriptor.getDeclaringClass(), descriptor.getComposedAnnotation(), descriptor.getAnnotation()); } } return findAnnotationDescriptor(clazz.getSuperclass(), visited, annotationType); }</code><technical_language>Production code is allowed static imports</technical_language>

Target:
private static <T extends Annotation> AnnotationDescriptor<T> findAnnotationDescriptor( Class<?> clazz, Set<Annotation> visited, Class<T> annotationType) { Assert.notNull(annotationType, "Annotation type must not be null"); if (clazz == null || Object.class == clazz) { return null; } if (AnnotationUtils.isAnnotationDeclaredLocally(annotationType, clazz)) { return new AnnotationDescriptor<>(clazz, clazz.getAnnotation(annotationType)); } for (Annotation composedAnnotation : clazz.getDeclaredAnnotations()) { if (!AnnotationUtils.isInJavaLangAnnotationPackage(composedAnnotation) && visited.add(composedAnnotation)) { AnnotationDescriptor<T> descriptor = findAnnotationDescriptor( composedAnnotation.annotationType(), visited, annotationType); if (descriptor != null) { return new AnnotationDescriptor<>( clazz, descriptor.getDeclaringClass(), composedAnnotation, descriptor.getAnnotation()); } } } for (Class<?> ifc : clazz.getInterfaces()) { AnnotationDescriptor<T> descriptor = findAnnotationDescriptor(ifc, visited, annotationType); if (descriptor != null) { return new AnnotationDescriptor<>(clazz, descriptor.getDeclaringClass(), descriptor.getComposedAnnotation(), descriptor.getAnnotation()); } } return findAnnotationDescriptor(clazz.getSuperclass(), visited, annotationType); }
Source:
<code>public Set<String> getMetricNames() { <START> return this.metricNames; <END> }</code><technical_language>I guess out voted this. :-(</technical_language>

Target:
public Set<String> getMetricNames() { return metricNames; }
Source:
<code>public Object getObjectValue(ConnectorSession session, Block block, int position) { if (block.isNull(position)) { return null; } Slice slice = block.getSlice(position, 0, block.getSliceLength(position)); <START> if (slice == Slices.EMPTY_SLICE) { return null; } <END> return deserialize(slice).asText(); }</code><technical_language>Remove this returning null above</technical_language>

Target:
public Object getObjectValue(ConnectorSession session, Block block, int position) { if (block.isNull(position)) { return null; } Slice slice = block.getSlice(position, 0, block.getSliceLength(position)); return deserialize(slice).asText(); }
Source:
<code>DownloadSdkNotification(@NotNull Module module) { <START> setText("A valid App Engine SDK was not found for module :" + module.getName() + "."); <END> createActionLabel("Install using Gradle", new Runnable() { @Override public void run() { GradleInvoker.getInstance(myProject).executeTasks(Collections.singletonList("appengineDownloadSdk")); } }); final VirtualFile buildFile = GradleUtil.getGradleBuildFile(module); if (buildFile != null && buildFile.exists()) { createActionLabel("Open build.gradle", new Runnable() { @Override public void run() { FileEditorManager.getInstance(myProject).openFile(buildFile, true); } }); } }</code><technical_language>lllocalization</technical_language>

Target:
DownloadSdkNotification(@NotNull Module module) { setText(GctBundle.message("appengine.sdk.invalid",module.getName())); createActionLabel(GctBundle.message("appengine.sdk.gradle.install"), new Runnable() { @Override public void run() { GradleInvoker.getInstance(myProject).executeTasks(Collections.singletonList("appengineDownloadSdk")); } }); final VirtualFile buildFile = GradleUtil.getGradleBuildFile(module); if (buildFile != null && buildFile.exists()) { createActionLabel(GctBundle.message("appengine.sdk.open.gradle.build"), new Runnable() { @Override public void run() { FileEditorManager.getInstance(myProject).openFile(buildFile, true); } }); } }
Source:
<code>public void setInSlot(Object slot, PresenterWidget<?> content) { super.setInSlot(slot, content); if (slot == getTabContentSlot()) { try { Presenter<?, ?> presenter = (Presenter<?, ?>) content; TabContentProxy<?> proxy = (TabContentProxy<?>) presenter.getProxy(); getView().setActiveTabHistoryToken(proxy.getTargetHistoryToken()); } catch (Exception e) { <START> logger.log(Level.WARNING, "Failed setting slot. Exception message: " + e.getMessage()); END> } } }</code><technical_language>This is addressed <LINK_0> is fully acked, merge soon</technical_language>

Target:
public void setInSlot(Object slot, PresenterWidget<?> content) { super.setInSlot(slot, content); if (slot == getTabContentSlot()) { try { Presenter<?, ?> presenter = (Presenter<?, ?>) content; TabContentProxy<?> proxy = (TabContentProxy<?>) presenter.getProxy(); getView().setActiveTabHistoryToken(proxy.getTargetHistoryToken()); } catch (Exception e) { logger.log(Level.SEVERE, "Error while updating tab view", e); } } }
Source:
<code>private String parseDependencyVersion(Dependency dependency, MavenRepositorySystemSession mvnRepository, RepositorySystem system, RemoteRepository remoteRepository, PomInformation pomInformation) throws ArtifactResolutionException { String parsedVersion; String version = dependency.getArtifact().getVersion(); if (StringUtils.isEmpty(version)) { parsedVersion = "[0,)"; } else if (version.contains("${")) { <START> String propertyName = StringUtils.remove(version, "${"); <END> propertyName = StringUtils.remove(propertyName, '}'); parsedVersion = getVersionFromProperties(propertyName, mvnRepository, system, remoteRepository, pomInformation); if (parsedVersion == null) { throw new MotechException(String.format("The property %s used in dependency %s cannot be found in pom " + "and its parents", propertyName, dependency.getArtifact().getArtifactId())); } } else { parsedVersion = version; } return parsedVersion; }</code><technical_language>if i I ${baseVersion}-r1 version? ${major.x.version}.${minor.x.version} ? ways of parsing tokens in Strings hand</technical_language>

Target:
private String parseDependencyVersion(Dependency dependency, MavenRepositorySystemSession mvnRepository, RepositorySystem system, RemoteRepository remoteRepository, PomInformation pomInformation) throws ArtifactResolutionException { String parsedVersion; String version = dependency.getArtifact().getVersion(); if (StringUtils.isEmpty(version)) { parsedVersion = "[0,)"; } else { Set<String> properties = getPropertiesFromString(version); for (String propertyName : properties) { String parsedProperty = getPropertyFromPom(parsePropertyName(propertyName), mvnRepository, system, remoteRepository, pomInformation); if (parsedProperty == null) { LOGGER.error("The property: used in dependency: cannot be found in pom " + "and its parents. For this dependency the latest version will be used", propertyName, dependency.getArtifact().getArtifactId()); version = "[0,)"; break; } version = StringUtils.replace(version, propertyName, parsedProperty); } parsedVersion = version; } return parsedVersion; }
Source:
<code>@Override public E poll() { lock.lock(); try { if (queue.isEmpty()) { return null; } E peek = queue.peek(); queue.remove(); return peek; } catch (IOException e) { QueueFile.<Error>getSneakyThrowable(e); <START> return null; <END> } finally { lock.unlock(); } }</code><technical_language>throws</technical_language>

Target:
@Override public E poll() { lock.lock(); try { if (queue.isEmpty()) { return null; } E peek = queue.peek(); queue.remove(); return peek; } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } finally { lock.unlock(); } }
Source:
<code>private boolean existPartitionColumnName(String tableName, String columnName) { final TableDesc tableDesc = catalog.getTableDesc(tableName); <START> return tableDesc.getPartitionMethod().getExpressionSchema().contains(columnName) ? true : false; <END> }</code><technical_language>? conditional operator unnecessary. trivial, Intellij warning</technical_language>

Target:
private boolean existPartitionColumnName(String tableName, String columnName) { final TableDesc tableDesc = catalog.getTableDesc(tableName); if (tableDesc.getPartitionMethod().getExpressionSchema().contains(columnName)) { return true; } else { return false; } }
Source:
<code>private void updateWorkspaceOnLSStarted() { projectManager .getAll() .forEach( registeredProject -> { if (!registeredProject.getProblems().isEmpty()) { try { projectManager.update(registeredProject); eventService.publish(new ProjectUpdatedEvent(registeredProject.getPath())); <START> } catch (Exception e) { <END> LOG.error( String.format( "Failed to update project '%s' configuration", registeredProject.getName()), e); } } }); }</code><technical_language>This catch runtime exceptions, etc. I this want? I multi-catch catch expected Exceptions</technical_language>

Target:
private void updateWorkspaceOnLSStarted() { projectManager .getAll() .forEach( registeredProject -> { if (!registeredProject.getProblems().isEmpty()) { try { projectManager.update(registeredProject); eventService.publish(new ProjectUpdatedEvent(registeredProject.getPath())); } catch (ForbiddenException | ServerException | NotFoundException | ConflictException | BadRequestException e) { LOG.error( String.format( "Failed to update project '%s' configuration", registeredProject.getName()), e); } } }); }
Source:
<code>protected final ScheduledExecutor getMainThreadExecutor() { <START> return Preconditions.checkNotNull( <END> this.mainThreadExecutor, "Cannot get main thread executor. Resource manager driver is not initialized."); }</code><technical_language>here: throwing IllegalStateException a match for actual error private member set null is more implementation detail need exposed</technical_language>

Target:
protected final ScheduledExecutor getMainThreadExecutor() { Preconditions.checkState(mainThreadExecutor != null, "Cannot get main thread executor. Resource manager driver is not initialized."); return mainThreadExecutor; }
Source:
<code>protected void configureJPA() { JPAConfigParser parser = new JPAConfigParser(); <START> install(new JpaPersistModule("default").properties(parser.parseConfig(this.config.toMap()))); <END> bind(JPAInitializer.class).asEagerSingleton(); }</code><technical_language>alternative is Candlepin same. problem is inconsistency implementation of toMap. if toMap is preferred, Candlepin it. confusion</technical_language>

Target:
protected void configureJPA() { install(new JpaPersistModule("default").properties(this.config.getNamespaceProperties("jpa.config"))); bind(JPAInitializer.class).asEagerSingleton(); }
Source:
<code>public void destroy() throws IOException { for (Closeable resource : resources) { <START> try { <END> resource.close(); } catch (Throwable t) { LOGGER.info("Exception closing resource : {}", resource, t); } } connection.close(); }</code><technical_language>"info"</technical_language>

Target:
public void destroy() throws IOException { closeResources(); connection.close(); }
Source:
<code>public NodeAndNovaTemplateOptions(AtomicReference<NodeMetadata> nodeMetadata, AtomicReference<NovaTemplateOptions> novaTemplateOptions){ this.nodeMetadata = nodeMetadata; this.novaTemplateOptions = novaTemplateOptions; <START> } <END></code><technical_language>[minor] create directly, static helpers? reduce this private protected constructor, static builders public static NodeAndNovaTemplateOptions newNodeAndNovaTemplateOptions(AtomicReference<NodeMetadata> node, AtomicReference<NovaTemplateOptions> options) { return new NodeAndNovaTemplateOptions(node, options); } public static NodeAndNovaTemplateOptions newNodeAndNovaTemplateOptions(NodeMetadata node, NovaTemplateOptions options) { return newNodeAndNovaTemplateOptions(Atomics.newReference(node), Atomics.newReference(options)); // return new NodeAndNovaTemplateOptions(Atomics.newReference(node), Atomics.newReference(options)); // if prefer }</technical_language>

Target:
protected NodeAndNovaTemplateOptions(AtomicReference<NodeMetadata> nodeMetadata, AtomicReference<NovaTemplateOptions> novaTemplateOptions){ this.nodeMetadata = nodeMetadata; this.novaTemplateOptions = novaTemplateOptions; }
Source:
<code>private void buildPrefilledCardHolderDetails(PrefilledCardholderDetails prefilledCardholderDetails, JsonStringBuilder request) { if (prefilledCardholderDetails.getCardholderName().isPresent()) { <START> request.addToMap("prefilled_cardholder_details", "cardholder_name", prefilledCardholderDetails.getCardholderName().get()); <END> } if (prefilledCardholderDetails.getBillingAddress().isPresent()) { Address address = prefilledCardholderDetails.getBillingAddress().get(); request.addToNestedMap("line1", address.getLine1(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("line2", address.getLine2(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("postcode", address.getPostcode(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("city", address.getCity(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("country", address.getCountry(), "prefilled_cardholder_details", "billing_address"); } }</code><technical_language>worth defining prefilled_cardholder_details, billing_address constants instead of duplicating multiple times ? thought lambdas reduce lines prefilledCardholderDetails.getCardholderName().ifPresent(name -> { request.addToMap(PRE_FILLED_CARD_HOLDER_DETAILS, "cardholder_name", name); }); prefilledCardholderDetails.getBillingAddress().ifPresent(address -> { request.addToNestedMap("line1", address.getLine1(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("line2", address.getLine2(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("postcode", address.getPostcode(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("city", address.getCity(), "prefilled_cardholder_details", "billing_address"); request.addToNestedMap("country", address.getCountry(), "prefilled_cardholder_details", "billing_address"); });</technical_language>

Target:
private void buildPrefilledCardHolderDetails(PrefilledCardholderDetails prefilledCardholderDetails, JsonStringBuilder request) { prefilledCardholderDetails.getCardholderName() .ifPresent(name -> request.addToMap(PREFILLED_CARDHOLDER_DETAILS, "cardholder_name", name)); prefilledCardholderDetails.getBillingAddress().ifPresent(address -> { request.addToNestedMap("line1", address.getLine1(), PREFILLED_CARDHOLDER_DETAILS, BILLING_ADDRESS); request.addToNestedMap("line2", address.getLine2(), PREFILLED_CARDHOLDER_DETAILS, BILLING_ADDRESS); request.addToNestedMap("postcode", address.getPostcode(), PREFILLED_CARDHOLDER_DETAILS, BILLING_ADDRESS); request.addToNestedMap("city", address.getCity(), PREFILLED_CARDHOLDER_DETAILS, BILLING_ADDRESS); request.addToNestedMap("country", address.getCountry(), PREFILLED_CARDHOLDER_DETAILS, BILLING_ADDRESS); }); }
Source:
<code>public KieContainer getKieContainer(ReleaseId releaseId) throws SrampClientException, SrampAtomException { KieServices ks = KieServices.Factory.get(); KieRepository repo = ks.getRepository(); SrampAtomApiClient client = SrampAtomApiClientFactory.createAtomApiClient(); Governance governance = new Governance(); String workflowGroupId = governance.getGovernanceWorkflowGroup(); String workflowArtifactId = governance.getGovernanceWorkflowName(); String workflowVersion = SrampMavenUtil.getVersion(SRAMP_KIE_MODEL, workflowGroupId, workflowArtifactId, <START> governance.getGovernanceWorkflowVersion()); <END> QueryResultSet results = null; ArtifactSummary artifactSummary = null; results = client.buildQuery(SRAMP_KIE_JAR_QUERY).parameter(workflowGroupId).parameter(workflowArtifactId).parameter(workflowVersion).count(1) .query(); if (results.size() > 0) { artifactSummary = results.get(0); InputStream is = client.getArtifactContent(artifactSummary); KieModule kModule = repo.addKieModule(ks.getResources().newInputStreamResource(is)); logger.info(Messages.i18n.format("KieSrampUtil.CreatingKieContainer", artifactSummary.getName())); KieContainer kContainer = ks.newKieContainer(kModule.getReleaseId()); logger.info(Messages.i18n.format("KieSrampUtil.FindKieBase", governance.getGovernanceWorkflowPackage())); return kContainer; } else { return null; } }</code><technical_language>If workflowVersion is null, throw exception a message like: "DTGov workflow KIE jar in S-RAMP repository." For bonus points include groupId, artifactId, version info in error message</technical_language>

Target:
public KieContainer getKieContainer(ReleaseId releaseId) throws SrampClientException, SrampAtomException { KieServices ks = KieServices.Factory.get(); KieRepository repo = ks.getRepository(); SrampAtomApiClient client = SrampAtomApiClientFactory.createAtomApiClient(); Governance governance = new Governance(); String workflowGroupId = governance.getGovernanceWorkflowGroup(); String workflowArtifactId = governance.getGovernanceWorkflowName(); String workflowVersion = SrampMavenUtil.getVersion(SRAMP_KIE_MODEL, workflowGroupId, workflowArtifactId, governance.getGovernanceWorkflowVersion()); if (StringUtils.isBlank(workflowVersion)) { throw new RuntimeException(Messages.i18n.format("maven.version.not.found", workflowGroupId, workflowArtifactId, workflowVersion)); } QueryResultSet results = null; ArtifactSummary artifactSummary = null; results = client.buildQuery(SRAMP_KIE_JAR_QUERY).parameter(workflowGroupId).parameter(workflowArtifactId).parameter(workflowVersion).count(1) .query(); if (results.size() > 0) { artifactSummary = results.get(0); InputStream is = client.getArtifactContent(artifactSummary); KieModule kModule = repo.addKieModule(ks.getResources().newInputStreamResource(is)); logger.info(Messages.i18n.format("KieSrampUtil.CreatingKieContainer", artifactSummary.getName())); KieContainer kContainer = ks.newKieContainer(kModule.getReleaseId()); logger.info(Messages.i18n.format("KieSrampUtil.FindKieBase", governance.getGovernanceWorkflowPackage())); return kContainer; } else { return null; } }
Source:
<code>private void generateSubPlanForJoinNodeRecursively(JoinNode rootNode, int nextNode, List<JoinNode> nodes) { assert(nodes.size() > nextNode); JoinNode joinNode = nodes.get(nextNode); if (nodes.size() == nextNode + 1) { for (AccessPath path : joinNode.m_accessPaths) { joinNode.m_currentAccessPath = path; AbstractPlanNode plan = getSelectSubPlanForJoinNode(rootNode); if (plan == null) { continue; } m_plans.add(plan); } return; } if (! m_plans.isEmpty() && m_plans.size() % S_PLAN_ESTIMATE_PERIOD == 0) { <START> final long usedHeapMemory = evaluatePlanSize() * S_PLAN_SIZE; <END> if (usedHeapMemory >= S_MAX_ALLOWED_PLAN_MEMORY) { return; } } for (AccessPath path : joinNode.m_accessPaths) { joinNode.m_currentAccessPath = path; generateSubPlanForJoinNodeRecursively(rootNode, nextNode+1, nodes); } }</code><technical_language>I this calculation is right. evaluatePlanSize returns number of nodes in plan tree. Is S_PLAN_SIZE supposed max size of a plan node</technical_language>

Target:
private void generateSubPlanForJoinNodeRecursively(JoinNode rootNode, int nextNode, List<JoinNode> nodes) { assert(nodes.size() > nextNode); JoinNode joinNode = nodes.get(nextNode); if (nodes.size() == nextNode + 1) { for (AccessPath path : joinNode.m_accessPaths) { joinNode.m_currentAccessPath = path; AbstractPlanNode plan = getSelectSubPlanForJoinNode(rootNode); if (plan == null) { continue; } m_plans.add(plan); } return; } if (! m_plans.isEmpty() && m_plans.size() % PLAN_ESTIMATE_PERIOD == 0 && shouldStopPlanning()) { return; } for (AccessPath path : joinNode.m_accessPaths) { joinNode.m_currentAccessPath = path; generateSubPlanForJoinNodeRecursively(rootNode, nextNode+1, nodes); } }
Source:
<code>public void start(ArrayList<Object> unsupportedBlocksList) { if (!mStarted) { Map<String, Object> properties = getCommonProperties(); <START> mHasUnsupportedBlocks = unsupportedBlocksList != null && unsupportedBlocksList.size() > 0; <END> properties.put(KEY_UNSUPPORTED_BLOCKS, unsupportedBlocksList != null ? unsupportedBlocksList : new ArrayList<>()); AnalyticsTracker.track(Stat.EDITOR_SESSION_START, properties); mStarted = true; } else { AppLog.w(T.EDITOR, "An editor session cannot be attempted to be started more than once, " + "unless it's due to rotation or Editor switch"); } }</code><technical_language>Hmm, actually, need compute mHasUnsupportedBlocks getCommonProperties() call there</technical_language>

Target:
public void start(ArrayList<Object> unsupportedBlocksList) { if (!mStarted) { mHasUnsupportedBlocks = unsupportedBlocksList != null && unsupportedBlocksList.size() > 0; Map<String, Object> properties = getCommonProperties(); properties.put(KEY_UNSUPPORTED_BLOCKS, unsupportedBlocksList != null ? unsupportedBlocksList : new ArrayList<>()); AnalyticsTracker.track(Stat.EDITOR_SESSION_START, properties); mStarted = true; } else { AppLog.w(T.EDITOR, "An editor session cannot be attempted to be started more than once, " + "unless it's due to rotation or Editor switch"); } }
Source:
<code>public IStructuredSelection findSelection(IEditorInput anInput) { if (!(anInput instanceof IURIEditorInput)) { return null; } URI uri = ((IURIEditorInput) anInput).getURI(); if (!uri.getScheme().equals("file")) return null; File file = new File(uri.getPath()); if (!file.exists()) return null; RepositoryUtil config = Activator.getDefault().getRepositoryUtil(); List<String> repos = config.getConfiguredRepositories(); for (String repo : repos) { Repository repository; try { <START> repository = new RepositoryBuilder().setGitDir(new File(repo)) <END> .build(); } catch (IOException e) { continue; } if (repository.isBare()) continue; if (file.getPath().startsWith(repository.getWorkTree().getPath())) { RepositoriesViewContentProvider cp = new RepositoriesViewContentProvider(); RepositoryNode repoNode = new RepositoryNode(null, repository); RepositoryTreeNode result = null; for (Object child : cp.getChildren(repoNode)) { if (child instanceof WorkingDirNode) { result = (WorkingDirNode) child; break; } } if (result == null) return null; IPath remainingPath = new Path(file.getPath().substring( repository.getWorkTree().getPath().length())); for (String segment : remainingPath.segments()) { for (Object child : cp.getChildren(result)) { RepositoryTreeNode<File> fileNode; try { fileNode = (RepositoryTreeNode<File>) child; } catch (ClassCastException e) { return null; } if (fileNode.getObject().getName().equals(segment)) { result = fileNode; break; } } } return new StructuredSelection(result); } } return null; }</code><technical_language>FileRepositoryBuilder.create</technical_language>

Target:
public IStructuredSelection findSelection(IEditorInput anInput) { if (!(anInput instanceof IURIEditorInput)) { return null; } URI uri = ((IURIEditorInput) anInput).getURI(); if (!uri.getScheme().equals("file")) return null; File file = new File(uri.getPath()); if (!file.exists()) return null; RepositoryUtil config = Activator.getDefault().getRepositoryUtil(); List<String> repos = config.getConfiguredRepositories(); for (String repo : repos) { Repository repository; try { repository = FileRepositoryBuilder.create(new File(repo)); } catch (IOException e) { continue; } if (repository.isBare()) continue; if (file.getPath().startsWith(repository.getWorkTree().getPath())) { RepositoriesViewContentProvider cp = new RepositoriesViewContentProvider(); RepositoryNode repoNode = new RepositoryNode(null, repository); RepositoryTreeNode result = null; for (Object child : cp.getChildren(repoNode)) { if (child instanceof WorkingDirNode) { result = (WorkingDirNode) child; break; } } if (result == null) return null; IPath remainingPath = new Path(file.getPath().substring( repository.getWorkTree().getPath().length())); for (String segment : remainingPath.segments()) { for (Object child : cp.getChildren(result)) { RepositoryTreeNode<File> fileNode; try { fileNode = (RepositoryTreeNode<File>) child; } catch (ClassCastException e) { return null; } if (fileNode.getObject().getName().equals(segment)) { result = fileNode; break; } } } return new StructuredSelection(result); } } return null; }
Source:
<code>public void visitAttackSignal(AttackSignal s) { InternalRobot attacker = (InternalRobot) getObjectByID(s.getRobotID()); MapLocation targetLoc = s.getTargetLoc(); double rate = 1.0; switch (attacker.type) { case STANDARDZOMBIE: <START> case FASTZOMBIE: <END> case RANGEDZOMBIE: case BIGZOMBIE: rate = 1.0; case SCOUT: case SOLDIER: case GUARD: case VIPER: case TURRET: int splashRadius = 0; InternalRobot[] targets = getAllRobotsWithinRadiusSq(targetLoc, splashRadius); for (InternalRobot target : targets) { if (target.getTeam() != attacker.getTeam()) { double damage = (attacker.type.attackPower) * rate; target.takeDamage(damage, attacker); } } break; default: } addSignal(s); removeDead(); }</code><technical_language>space-indentation, Luke. start a holy war, consistent. in Eclipse code format preferences - run Format file fix inconsistencies</technical_language>

Target:
public void visitAttackSignal(AttackSignal s) { InternalRobot attacker = (InternalRobot) getObjectByID(s.getRobotID()); MapLocation targetLoc = s.getTargetLoc(); double rate = 1.0; switch (attacker.type) { case STANDARDZOMBIE: case FASTZOMBIE: case RANGEDZOMBIE: case BIGZOMBIE: case SCOUT: case SOLDIER: case GUARD: case VIPER: case TURRET: int splashRadius = 0; InternalRobot[] targets = getAllRobotsWithinRadiusSq(targetLoc, splashRadius); for (InternalRobot target : targets) { if (target.getTeam() != attacker.getTeam()) { if (attacker.type == RobotType.GUARD && target.type.isZombie) rate = GameConstants.GUARD_ZOMBIE_MULTIPLIER; if (attacker.type.canInfect() && target.type.isInfectable()) target.setInfected(attacker); double damage = (attacker.type.attackPower) * rate; target.takeDamage(damage, attacker); } } break; default: } addSignal(s); removeDead(); }
Source:
<code>public void testQuerySerialization() throws IOException { RegexSearchQuerySpec spec = new RegexSearchQuerySpec("(upfront|total_market)"); String json = jsonMapper.writeValueAsString(spec); <START> RegexSearchQuerySpec serdeQuery = jsonMapper.readValue(json, RegexSearchQuerySpec.class); <END> Assert.assertEquals(spec, serdeQuery); }</code><technical_language>u change (RegexSearchQuerySpec) jsonMapper.readValue(json, SearchQuerySpec.class);</technical_language>

Target:
public void testQuerySerialization() throws IOException { RegexSearchQuerySpec spec = new RegexSearchQuerySpec("(upfront|total_market)"); String json = jsonMapper.writeValueAsString(spec); RegexSearchQuerySpec serdeQuery = (RegexSearchQuerySpec) jsonMapper.readValue(json, RegexSearchQuerySpec.class); Assert.assertEquals(spec, serdeQuery); }
Source:
<code>public boolean isDomainAvailable(String domain) throws TenantMgtException { TenantManager tenantManager = TenantMgtServiceComponent.getTenantManager(); try { int tenantID = tenantManager.getTenantId(domain); if (tenantID == -1) { return true; } } catch (org.wso2.carbon.user.api.UserStoreException e) { <START> throw new TenantManagementServerException("Error while getting the tenant.", e); <END> } return false; }</code><technical_language>adding domain message</technical_language>

Target:
public boolean isDomainAvailable(String domain) throws TenantMgtException { TenantManager tenantManager = TenantMgtServiceComponent.getTenantManager(); try { int tenantID = tenantManager.getTenantId(domain); if (tenantID == -1) { return true; } } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new TenantManagementServerException("Error while getting the tenant - " + domain, e); } return false; }
Source:
<code>public String toString() <START> { <END> StringBuilder sb = new StringBuilder("ColumnarMap{"); sb.append("positionCount=").append(getPositionCount()).append(","); sb.append("offsetsOffset=").append(offsetsOffset).append(","); sb.append("nullCheckBlock=").append(nullCheckBlock.toString()).append(","); sb.append("keysBlock=").append(keysBlock.toString()).append(","); sb.append("valuesBlock=").append(valuesBlock.toString()).append(","); sb.append("hashTablesSize=").append(hashTables == null ? 0 : hashTables.length).append(","); sb.append('}'); return sb.toString(); }</code><technical_language>@Override</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("positionCount=").append(getPositionCount()).append(","); sb.append("offsetsOffset=").append(offsetsOffset).append(","); sb.append("nullCheckBlock=").append(nullCheckBlock.toString()).append(","); sb.append("keysBlock=").append(keysBlock.toString()).append(","); sb.append("valuesBlock=").append(valuesBlock.toString()).append(","); sb.append("hashTablesSize=").append(hashTables == null ? 0 : hashTables.length).append(","); sb.append('}'); return sb.toString(); }
Source:
<code>public SELF containsAnyElementsOf(Iterable<ELEMENT> iterable) { iterables.assertContainsAnyElementsOf(info, actual, iterable); <START> return myself; <END> }</code><technical_language>is simpler call containsAnyOf this: return containsAnyOf(toArray(iterable)); test need for this guys is delegates correctly iterables.assertContainsAnyOf. get rid of iterables.assertContainsAnyElementsOf tests</technical_language>

Target:
public SELF containsAnyElementsOf(Iterable<ELEMENT> iterable) { containsAnyOf(toArray(iterable)); return myself; }
Source:
<code>private ResourceInfo getResourceInfo( QueryResponse queryResponse, Object queriedAttributeValue, Map<String, Serializable> requestProperties, StringBuilder federatedSite) throws ResourceNotFoundException, UnsupportedQueryException { Metacard metacard; URI resourceUri; if (queryResponse.getResults().size() > 1) { throw new UnsupportedQueryException( <START> "A resource request resulted in multiple metacards being returned."); <END> } metacard = queryResponse.getResults().get(0).getMetacard(); if (requestProperties != null && requestProperties.get(ContentItem.QUALIFIER_KEYWORD) instanceof String && StringUtils.isNotBlank((String) requestProperties.get(ContentItem.QUALIFIER_KEYWORD))) { resourceUri = getDerivedResourceUri( metacard, (String) requestProperties.get(ContentItem.QUALIFIER_KEYWORD)); } else if (queriedAttributeValue instanceof URI) { resourceUri = (URI) queriedAttributeValue; } else { resourceUri = metacard.getResourceURI(); } federatedSite.append(metacard.getSourceId()); LOGGER.debug( "Trying to lookup resource URI for metacardId: {}", resourceUri, metacard.getId()); if (requestProperties != null) { if (!requestProperties.containsKey(Metacard.ID)) { requestProperties.put(Metacard.ID, metacard.getId()); } if (!requestProperties.containsKey(Metacard.RESOURCE_URI)) { requestProperties.put(Metacard.RESOURCE_URI, metacard.getResourceURI()); } } return new ResourceInfo(metacard, resourceUri); }</code><technical_language>useful include log attribute unique</technical_language>

Target:
private ResourceInfo getResourceInfo( QueryResponse queryResponse, Object queriedAttributeValue, Map<String, Serializable> requestProperties, StringBuilder federatedSite) throws ResourceNotFoundException, UnsupportedQueryException { Metacard metacard; URI resourceUri; metacard = queryResponse.getResults().get(0).getMetacard(); if (requestProperties != null && requestProperties.get(ContentItem.QUALIFIER_KEYWORD) instanceof String && StringUtils.isNotBlank((String) requestProperties.get(ContentItem.QUALIFIER_KEYWORD))) { resourceUri = getDerivedResourceUri( metacard, (String) requestProperties.get(ContentItem.QUALIFIER_KEYWORD)); } else if (queriedAttributeValue instanceof URI) { resourceUri = (URI) queriedAttributeValue; } else { resourceUri = metacard.getResourceURI(); } federatedSite.append(metacard.getSourceId()); LOGGER.debug( "Trying to lookup resource URI for metacardId: {}", resourceUri, metacard.getId()); if (requestProperties != null) { if (!requestProperties.containsKey(Metacard.ID)) { requestProperties.put(Metacard.ID, metacard.getId()); } if (!requestProperties.containsKey(Metacard.RESOURCE_URI)) { requestProperties.put(Metacard.RESOURCE_URI, metacard.getResourceURI()); } } return new ResourceInfo(metacard, resourceUri); }
Source:
<code>private synchronized void saveFilestoreModel(FilestoreModel model) { try { File metaFile = new File(getStorageFolder(), METAFILE); boolean isNewFile = !metaFile.exists(); <START> RandomAccessFile fs = new RandomAccessFile(metaFile, "rw"); <END> if (isNewFile) { metaFile.getParentFile().mkdirs(); metaFile.createNewFile(); fs.writeBytes("["); } else { fs.seek(fs.length() - 1); fs.writeBytes(","); } fs.writeBytes(gson().toJson(model)); fs.writeBytes("]"); fs.close(); } catch (IOException e) { logger.error("Writing filestore model to file {0}, {1}", METAFILE, e); } }</code><technical_language>in ConfigUserService I write a temp file rename target file successful completion of write. logic here</technical_language>

Target:
private synchronized void saveFilestoreModel(FilestoreModel model) { File metaFile = new File(getStorageFolder(), METAFILE); File metaFileTmp = new File(getStorageFolder(), METAFILE_TMP); boolean isNewFile = false; try { if (!metaFile.exists()) { metaFile.getParentFile().mkdirs(); metaFile.createNewFile(); isNewFile = true; } FileUtils.copyFile(metaFile, metaFileTmp); } catch (IOException e) { logger.error("Writing filestore model to file {0}, {1}", METAFILE, e); } try (RandomAccessFile fs = new RandomAccessFile(metaFileTmp, "rw")) { if (isNewFile) { fs.writeBytes("["); } else { fs.seek(fs.length() - 1); fs.writeBytes(","); } fs.writeBytes(gson().toJson(model)); fs.writeBytes("]"); fs.close(); } catch (IOException e) { logger.error("Writing filestore model to file {0}, {1}", METAFILE_TMP, e); } try { if (metaFileTmp.exists()) { FileUtils.copyFile(metaFileTmp, metaFile); metaFileTmp.delete(); } else { logger.error("Writing filestore model to file {0}", METAFILE); } } catch (IOException e) { logger.error("Writing filestore model to file {0}, {1}", METAFILE, e); } }
Source:
<code>public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { final HttpRequest request = context.getHttpRequest(); return next.process().flatMap( response -> { if (!isResponseSuccessful(response)) { HttpResponse bufferedResponse = response.buffer(); return FluxUtil.collectBytesInByteBufferStream(bufferedResponse.getBody()).flatMap( body -> { String bodyStr = new String(body, StandardCharsets.UTF_8); AzureJacksonAdapter jacksonAdapter = new AzureJacksonAdapter(); CloudError cloudError; try { cloudError = jacksonAdapter.deserialize( bodyStr, CloudError.class, SerializerEncoding.JSON); } catch (IOException e) { return Mono.just(bufferedResponse); } if (cloudError != null && MISSING_SUBSCRIPTION_REGISTRATION.equals(cloudError.getCode())) { ResourceManager resourceManager = ResourceManager.authenticate(credential, profile) <START> .withDefaultSubscription(); <END> Pattern providerPattern = Pattern.compile(".*'(.*)'"); Matcher providerMatcher = providerPattern.matcher(cloudError.getMessage()); providerMatcher.find(); return registerProviderUntilSuccess(providerMatcher.group(1), resourceManager) .flatMap(afterRegistered -> next.process()); } return Mono.just(bufferedResponse); } ); } return Mono.just(response); } ); }</code><technical_language>above, if profile, defaultsubs? defaultsubs</technical_language>

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { return next.process().flatMap( response -> { if (!isResponseSuccessful(response)) { HttpResponse bufferedResponse = response.buffer(); return FluxUtil.collectBytesInByteBufferStream(bufferedResponse.getBody()).flatMap( body -> { String bodyStr = new String(body, StandardCharsets.UTF_8); AzureJacksonAdapter jacksonAdapter = new AzureJacksonAdapter(); CloudError cloudError; try { cloudError = jacksonAdapter.deserialize( bodyStr, CloudError.class, SerializerEncoding.JSON); } catch (IOException e) { return Mono.just(bufferedResponse); } if (cloudError != null && MISSING_SUBSCRIPTION_REGISTRATION.equals(cloudError.getCode())) { ResourceManager resourceManager = ResourceManager.authenticate(credential, profile) .withDefaultSubscription(); Pattern providerPattern = Pattern.compile(".*'(.*)'"); Matcher providerMatcher = providerPattern.matcher(cloudError.getMessage()); providerMatcher.find(); return registerProviderUntilSuccess(providerMatcher.group(1), resourceManager) .flatMap(afterRegistered -> next.process()); } return Mono.just(bufferedResponse); } ); } return Mono.just(response); } ); }
Source:
<code>public String index(Request request, Response response) throws IOException { List<String> environmentNames = environmentConfigService.environmentNames() .stream().map(CaseInsensitiveString::toString).collect(Collectors.toList()); <START> return GSON.toJson(environmentNames); <END> }</code><technical_language>Please jackson for JSON serialization: java return JsonOutputWriter.OBJECT_MAPPER.writeValueAsString(resourceList);</technical_language>

Target:
public String index(Request request, Response response) throws IOException { List<String> environmentNames = environmentConfigService.environmentNames() .stream().map(CaseInsensitiveString::toString).collect(Collectors.toList()); return JsonOutputWriter.OBJECT_MAPPER.writeValueAsString(environmentNames); }
Source:
<code>public int getDurationMinutes() { <START> return (int) TimeUnit.MILLISECONDS.toMinutes(this.getEndTime().getTime() - this.getStartTime().getTime()); <END> }</code><technical_language>This return 1 if time difference start end is > 0 (in unit), ensure nothing</technical_language>

Target:
public int getDurationMinutes() { return (int) TimeUnit.MILLISECONDS.toMinutes(this.getEndTime().getTime() - this.getStartTime().getTime()) + 1; }
Source:
<code>public Response<String> acquireLeaseWithResponse(int duration, RequestConditions modifiedRequestConditions, Duration timeout, Context context) { <START> try { <END> return blobLeaseClient.acquireLeaseWithResponse(duration, modifiedRequestConditions, timeout, context); } catch (BlobStorageException ex) { throw logger.logExceptionAsError(new DataLakeStorageException(ex.getServiceMessage(), ex.getResponse(), ex.getValue())); } }</code><technical_language>returnOrMapException method in this file? Also, I constructing DataLakeStorageException, of constructors accepts a Throwable pass original exception in. I this helps preserve cause/stack trace</technical_language>

Target:
public Response<String> acquireLeaseWithResponse(int duration, RequestConditions modifiedRequestConditions, Duration timeout, Context context) { return DataLakeImplUtils.returnOrConvertException(() -> blobLeaseClient.acquireLeaseWithResponse(duration, modifiedRequestConditions, timeout, context), logger); }
Source:
<code>public Options(long connectTimeout, TimeUnit connectTimeoutUnit, long readTimeout, TimeUnit readTimeoutUnit, boolean followRedirects) { super(); this.connectTimeout = connectTimeout; this.connectTimeoutUnit = connectTimeoutUnit; this.readTimeout = readTimeout; this.readTimeoutUnit = readTimeoutUnit; this.followRedirects = followRedirects; <START> this.allowStreamingMode = true; <END> }</code><technical_language>idea of defaulting true</technical_language>

Target:
public Options(long connectTimeout, TimeUnit connectTimeoutUnit, long readTimeout, TimeUnit readTimeoutUnit, boolean followRedirects) { super(); this.connectTimeout = connectTimeout; this.connectTimeoutUnit = connectTimeoutUnit; this.readTimeout = readTimeout; this.readTimeoutUnit = readTimeoutUnit; this.followRedirects = followRedirects; }
Source:
<code>public void testListAvailabilityZones() throws Exception { URI endpoint = URI.create("<LINK_0>"); AvailabilityZoneApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/availability_zones_list.json")).build() ).getAvailabilityZoneApi("RegionOne"); AvailabilityZone availabilityZoneActual = Iterables.getFirst(api.list(), null); AvailabilityZone availabilityZoneExpected = getTestAvailabilityZone(); assertNotNull(availabilityZoneActual); assertEquals(availabilityZoneActual.getName(), availabilityZoneExpected.getName()); <START> assertEquals(availabilityZoneActual.getState().available(), availabilityZoneExpected.getState().available()); <END> }</code><technical_language>AvailabilityZone implements equals. instead of asserting fields</technical_language>

Target:
public void testListAvailabilityZones() throws Exception { URI endpoint = URI.create("<LINK_0>"); AvailabilityZoneApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/availability_zones_list.json")).build() ).getAvailabilityZoneApi("RegionOne"); AvailabilityZone availabilityZoneActual = Iterables.getFirst(api.list(), null); AvailabilityZone availabilityZoneExpected = getTestAvailabilityZone(); assertNotNull(availabilityZoneActual); assertEquals(availabilityZoneActual, availabilityZoneExpected); }
Source:
<code>private void makeActions() { fPreviousThreadAction = fTimeGraphCombo.getTimeGraphViewer().getPreviousItemAction(); <START> fPreviousThreadAction.setText("Previous Thread"); END> fPreviousThreadAction.setToolTipText("Select Previous Thread"); fNextThreadAction = fTimeGraphCombo.getTimeGraphViewer().getNextItemAction(); fNextThreadAction.setText("Next Thread"); fNextThreadAction.setToolTipText("Select Next Thread"); }</code><technical_language>externalized</technical_language>

Target:
private void makeActions() { fPreviousItemAction = fTimeGraphCombo.getTimeGraphViewer().getPreviousItemAction(); fPreviousItemAction.setText(Messages.TmfTimeGraphViewer_PreviousItemActionNameText); fPreviousItemAction.setToolTipText(Messages.TmfTimeGraphViewer_PreviousItemActionToolTipText); fNextItemAction = fTimeGraphCombo.getTimeGraphViewer().getNextItemAction(); fNextItemAction.setText(Messages.TmfTimeGraphViewer_NextItemActionNameText); fNextItemAction.setToolTipText(Messages.TmfTimeGraphViewer_NextItemActionToolTipText); }
Source:
<code><START> public String getZkRealmAddress() { <END> return _zkRealmAddress; }</code><technical_language>Is case this address valid initialized if this is a leaf node? If so, create a leaf class extends this this method there? If this is case, please ignore I said</technical_language>

Target:
public String getZkRealmAddress() { if (!_isLeaf) { throw new IllegalStateException("only leaf nodes have meaningful zkRealmAddress"); } return _zkRealmAddress; }