auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps) throws ProjectManagerException { log.info("Uploading files to " + project.getName()); final Props prop = new Props(this.props); prop.putAll(additionalProps); final File file = unzipProject(archive, fileType); final Map<String, ValidationReport> reports = validateProject(project, archive, file, prop); final DirectoryFlowLoader directoryFlowLoader = new DirectoryFlowLoader(prop); reports.put(DIRECTORY_FLOW_REPORT_KEY, directoryFlowLoader.loadProject(project, file)); if(!isReportStatusValid(reports, project, file)) { return reports; } persistProject(project, archive, uploader); <START> cleanUpProject(project, file); <END> return reports; }</code><technical_language>cleanup in finally block</technical_language>

Target:
public Map<String, ValidationReport> uploadProject(final Project project, final File archive, final String fileType, final User uploader, final Props additionalProps) throws ProjectManagerException { log.info("Uploading files to " + project.getName()); final Map<String, ValidationReport> reports; final Props prop = new Props(this.props); prop.putAll(additionalProps); File file = null; try { file = unzipProject(archive, fileType); reports = validateProject(project, archive, file, prop); final DirectoryFlowLoader directoryFlowLoader = new DirectoryFlowLoader(prop); reports.put(DIRECTORY_FLOW_REPORT_KEY, directoryFlowLoader.loadProject(project, file)); } finally { cleanUpProjectTempDir(file); } if (!isReportStatusValid(reports, project)) { return reports; } persistProject(project, archive, uploader); cleanUpProjectOldInstallations(project); return reports; }
Source:
<code>public static Cost calculate(final Collection<EvaluatorParameters> activeEvaluators) { final EvaluatorParameters ctlTaskEvaluatorParameters = getControllerTaskParameters(activeEvaluators); <START> final Collection<EvaluatorParameters> cmpTasksEvaluatorParameters = getComputeTaskParameters(activeEvaluators); <END> final Collection<Cost.ComputeTaskCost> computeTaskCosts = getComputeTaskCosts(cmpTasksEvaluatorParameters); final double communicationCost = getCommunicationCost(ctlTaskEvaluatorParameters, computeTaskCosts); return new Cost(communicationCost, computeTaskCosts); }</code><technical_language>reason for iterating activeEvaluators extract evaluator parameters? original code in iteration</technical_language>

Target:
public static Cost calculate(final Collection<EvaluatorParameters> activeEvaluators) { final DolphinTaskParameters dolphinTaskParams = getDolphinTaskParameters(activeEvaluators); final Collection<Cost.ComputeTaskCost> computeTaskCosts = getComputeTaskCosts(dolphinTaskParams.getComputeTasksParameters()); final double communicationCost = getCommunicationCost(dolphinTaskParams.getControllerTaskParameters(), computeTaskCosts); return new Cost(communicationCost, computeTaskCosts); }
Source:
<code>private ResponseHandler<Object> createExecResponseHandler(LogOutputSpec outputSpec) throws FileNotFoundException { <START> final LogCallback callback = createLogCallback(outputSpec); <END> return new ResponseHandler<Object>() { @Override public Object handleResponse(HttpResponse response) throws IOException { try (InputStream stream = response.getEntity().getContent()) { LineNumberReader reader = new LineNumberReader(new InputStreamReader(stream)); String line; try { while ( (line = reader.readLine()) != null) { callback.log(1, new Timestamp(), line); } } catch (LogCallback.DoneException e) { } } return null; } }; }</code><technical_language>is closing this DefaultLogCallback()</technical_language>

Target:
private ResponseHandler<Object> createExecResponseHandler(LogOutputSpec outputSpec) throws FileNotFoundException { final LogCallback callback = new DefaultLogCallback(outputSpec); return new ResponseHandler<Object>() { @Override public Object handleResponse(HttpResponse response) throws IOException { try (InputStream stream = response.getEntity().getContent()) { LineNumberReader reader = new LineNumberReader(new InputStreamReader(stream)); String line; try { callback.open(); while ( (line = reader.readLine()) != null) { callback.log(1, new Timestamp(), line); } } catch (LogCallback.DoneException e) { } finally { callback.close(); } } return null; } }; }
Source:
<code><START> public static Predicate<Resource> createTestApiLiquibaseChangelogFilter() { <END> return r -> { try { URI uri = r.getURI(); return (uri.getScheme().equals("file") && uri.toString().contains("test-api/schema")) || (uri.getScheme().equals("jar") && uri.toString().contains("test-api.schema")); } catch (IOException e) { return false; } }; }</code><technical_language>This a final static constant</technical_language>

Target:
public static final Predicate<Resource> createTestApiLiquibaseChangelogFilter() { return r -> { try { URI uri = r.getURI(); return (uri.getScheme().equals("file") && uri.toString().contains("test-api/schema")) || (uri.getScheme().equals("jar") && uri.toString().contains("test-api.schema")); } catch (IOException e) { return false; } }; }
Source:
<code>private void unmarshalAndInsert(byte[] factBytes, Class<?> clazz) { try { String packageName = clazz.getPackage().getName(); String className = clazz.getSimpleName(); FactType factType = getFactType(packageName, className); if (factType != null) { m_kieSession.insert(DroolsStreamUtils.streamIn(factBytes, factType.getFactClass().getClassLoader())); } else { m_kieSession.insert(DroolsStreamUtils.streamIn(factBytes, clazz.getClassLoader())); } } catch (IOException | ClassNotFoundException e) { <START> LOG.error("Exception while unmarshalling fact with class {}", factBytes, clazz.getCanonicalName()); <END> } }</code><technical_language>Remove factBytes replace factBytes.length exception</technical_language>

Target:
private void unmarshalAndInsert(byte[] factBytes, Class<?> clazz) { try { String packageName = clazz.getPackage().getName(); String className = clazz.getSimpleName(); FactType factType = getDeclaredFactType(packageName, className); if (factType != null) { m_kieSession.insert(DroolsStreamUtils.streamIn(factBytes, factType.getFactClass().getClassLoader())); } else { m_kieSession.insert(DroolsStreamUtils.streamIn(factBytes, clazz.getClassLoader())); } } catch (IOException | ClassNotFoundException e) { LOG.error("Exception while unmarshalling fact of size with Class {}", factBytes.length, clazz.getCanonicalName()); } }
Source:
<code>public static String generate(String derivedClassName, ClassModel classModel) { final List<MethodModel> methodModels = classModel.getMethods().stream() .filter(method -> method.isAnnotatedWith(Unapply.class)) .collect(toList()); final String _package = classModel.getPackageName(); final ImportManager im = ImportManager.forClass(classModel, "javaslang.API.Match"); final String methods = generate(im, classModel, methodModels); return " <START> (_package.isEmpty() ? "" : "package " + _package + ";\n\n") + <END> im.getImports() + "\n\n "public final class " + derivedClassName + " {\n\n" + " private " + derivedClassName + "() {\n" + " }\n\n" + methods + "}\n" + " }</code><technical_language>please revert Generator.java - I prepare another PR</technical_language>

Target:
public static String generate(String derivedClassName, ClassModel classModel) { final List<MethodModel> methodModels = classModel.getMethods().stream() .filter(method -> method.isAnnotatedWith(Unapply.class)) .collect(toList()); final String _package = classModel.getPackageName(); final ImportManager im = ImportManager.forClass(classModel, "javaslang.API.Match"); final String methods = generate(im, classModel, methodModels); return " " (_package.isEmpty() ? "" : "package " + _package + ";\n\n") + im.getImports() + "\n\n "public final class " + derivedClassName + " {\n\n" + " private " + derivedClassName + "() {\n" + " }\n\n" + methods + "}\n" + " " }
Source:
<code>public void ClearTasks() { synchronized (_listTasks) { java.util.ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks(); for (CommandAsyncTask task : CurrentActionTypeTasks) { if (task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.finished) { task.clearAsyncTask(); <START> if (task.getVdsmTaskId() != null) { <END> _listTasks.remove(task.getVdsmTaskId()); } } } } }</code><technical_language>if called clearAsyncTask(), want remove list of vdsmTaskId</technical_language>

Target:
public void ClearTasks() { synchronized (_listTasks) { java.util.ArrayList<CommandAsyncTask> CurrentActionTypeTasks = getCurrentTasks(); for (CommandAsyncTask task : CurrentActionTypeTasks) { if (task.getLastTaskStatus().getStatus() == AsyncTaskStatusEnum.finished) { task.clearAsyncTask(); _listTasks.remove(task.getVdsmTaskId()); } } } }
Source:
<code>void incClearCount(LocalRegion lr) { if (lr != null && !(lr instanceof HARegion)) { CachePerfStats stats = lr.getCachePerfStats(); if (stats != null) { <START> if (lr instanceof BucketRegion) { <END> stats.incBucketClearCount(); } else { stats.incRegionClearCount(); } } } }</code><technical_language>use: if (owner.isUsedForPartitionedRegionBucket()) { instead</technical_language>

Target:
void incClearCount(LocalRegion lr) { if (lr != null && !(lr instanceof HARegion)) { CachePerfStats stats = lr.getCachePerfStats(); if (stats != null) { if (lr.isUsedForPartitionedRegionBucket()) { stats.incBucketClearCount(); } else { stats.incRegionClearCount(); } } } }
Source:
<code>private Set<String> locationRequestToRegions(LocationRequest location, String cloudPlatform) { <START> if (AWS.name().equals(cloudPlatform)) { <END> return Set.of(location.getName()); } else if (AZURE.name().equals(cloudPlatform)) { return Set.of(location.getName()); } return Set.of(); }</code><technical_language>merge if else if</technical_language>

Target:
private Set<String> locationRequestToRegions(LocationRequest location, String cloudPlatform) { return Set.of(location.getName()); }
Source:
<code>private void readResponseToFindActiveComponents() throws IOException { InputStream in = telnet.getInputStream(); BufferedReader inBuff = new BufferedReader(new InputStreamReader(in, "UTF-8")); String inputLine; while ((inputLine = inBuff.readLine()) != null) { if (inputLine.contains("Active")) { arrList.add(inputLine); log.info(inputLine); break; } } <START> inBuff.close(); <END> out.close(); }</code><technical_language>close streams in finally block</technical_language>

Target:
private void readResponseToFindActiveComponents() throws CarbonToolsIntegrationTestException { InputStream in = telnet.getInputStream(); try { BufferedReader inBuff = new BufferedReader(new InputStreamReader(in, "UTF-8")); String inputLine; while ((inputLine = inBuff.readLine()) != null) { if (inputLine.contains("Active")) { arrList.add(inputLine); log.info(inputLine); break; } } inBuff.close(); } catch (IOException ex) { log.error("Error while reading input stream ", ex); throw new CarbonToolsIntegrationTestException("Error while reading input stream ", ex); } out.close(); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); setHasOptionsMenu(true); final ProfileModel model = new PrefManager(getActivity(), PrefManager.Pref.LOGIN).getCurrentUserProfile(); isViewingOwnProfile = null != model && model.username.equalsIgnoreCase(username); getAccountTask = new GetAccountTask(getActivity(), username) { @Override <START> protected void onSuccess(Account account) throws Exception { <END> UserProfileFragment.this.account = account; if (null != viewHolder) { viewHolder.setAccount(account); } } }; getAccountTask.setTaskProcessCallback(null); getAccountTask.execute(); }</code><technical_language>handle failure well, hide loading indicator if more</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); setHasOptionsMenu(true); final ProfileModel model = new PrefManager(getActivity(), PrefManager.Pref.LOGIN).getCurrentUserProfile(); isViewingOwnProfile = null != model && model.username.equalsIgnoreCase(username); }
Source:
<code>private List stageHistoryAsJson(PipelineInstanceModel pipelineInstanceModel, StageInstanceModels stageHistory) { List json = new ArrayList(); for (StageInstanceModel stageHistoryItem : stageHistory) { Map<String, Object> jsonMap = new LinkedHashMap<>(); jsonMap.put("stageName", stageHistoryItem.getName()); jsonMap.put("stageId", stageHistoryItem.getId()); jsonMap.put("stageStatus", stageHistoryItem.getState().toString()); StageIdentifier stageIdentifier = new StageIdentifier(pipelineInstanceModel.getPipelineIdentifier(), stageHistoryItem.getName(), stageHistoryItem.getCounter()); jsonMap.put("stageLocator", encodeInUtf8(stageIdentifier.stageLocator())); jsonMap.put("getCanRun", Boolean.toString(stageHistoryItem.getCanRun())); if (!stageHistoryItem.getCanRun()) { <START> jsonMap.put("getErrorMessage", stageHistoryItem.getErrorMessage()); <END> } jsonMap.put("getCanCancel", Boolean.toString(stageHistoryItem.getCanCancel())); jsonMap.put("scheduled", Boolean.toString(stageHistoryItem.isScheduled())); jsonMap.put("stageCounter", stageHistoryItem.getCounter()); handleApproval(stageHistoryItem, jsonMap); json.add(jsonMap); } return json; }</code><technical_language>Json node called "errorMessage", perhaps, this is API, picky this</technical_language>

Target:
private List stageHistoryAsJson(PipelineInstanceModel pipelineInstanceModel, StageInstanceModels stageHistory) { List json = new ArrayList(); for (StageInstanceModel stageHistoryItem : stageHistory) { Map<String, Object> jsonMap = new LinkedHashMap<>(); jsonMap.put("stageName", stageHistoryItem.getName()); jsonMap.put("stageId", stageHistoryItem.getId()); jsonMap.put("stageStatus", stageHistoryItem.getState().toString()); StageIdentifier stageIdentifier = new StageIdentifier(pipelineInstanceModel.getPipelineIdentifier(), stageHistoryItem.getName(), stageHistoryItem.getCounter()); jsonMap.put("stageLocator", encodeInUtf8(stageIdentifier.stageLocator())); jsonMap.put("getCanRun", Boolean.toString(stageHistoryItem.getCanRun())); if (!stageHistoryItem.getCanRun()) { jsonMap.put("errorMessage", stageHistoryItem.getErrorMessage()); } jsonMap.put("getCanCancel", Boolean.toString(stageHistoryItem.getCanCancel())); jsonMap.put("scheduled", Boolean.toString(stageHistoryItem.isScheduled())); jsonMap.put("stageCounter", stageHistoryItem.getCounter()); handleApproval(stageHistoryItem, jsonMap); json.add(jsonMap); } return json; }
Source:
<code>public static DialogueChatHandler queue(int max) { <START> checkArgument(max > 0, "max > 0"); <END> return new QueueingChatHandler(max); }</code><technical_language>checkArgument(max > 0, "max greater 0");</technical_language>

Target:
public static DialogueChatHandler queue(int max) { checkArgument(max > 0, "max must be greater than 0"); return new QueueingChatHandler(max); }
Source:
<code>public boolean isValid() { <START> return StringUtils.equals(NAME_PROPERTY, type) <END> && properties != null && properties.keySet().size() == 1 && properties.containsKey(NAME_PROPERTY) && properties.get(NAME_PROPERTY).startsWith("EPSG"); }</code><technical_language>StringUtils.equals differ CharSequence.compare == 0 Objects.equals</technical_language>

Target:
public boolean isValid() { return NAME_PROPERTY.equals(type) && properties != null && properties.keySet().size() == 1 && properties.containsKey(NAME_PROPERTY) && properties.get(NAME_PROPERTY).startsWith("EPSG"); }
Source:
<code><START> public static CreateDevice create(final String hostname, final String plan, final String billingCycle, <END> final String facility, final Map<String, String> features, final String operatingSystem, final Boolean locked, final String userdata, final Set<String> tags) { return builder() .hostname(hostname) .plan(plan) .billingCycle(billingCycle) .facility(facility) .features(features) .operatingSystem(operatingSystem) .locked(locked) .userdata(userdata) .tags(tags) .build(); }</code><technical_language>[minor] this private enforce of builder</technical_language>

Target:
private static CreateDevice create(final String hostname, final String plan, final String billingCycle, final String facility, final Map<String, String> features, final String operatingSystem, final Boolean locked, final String userdata, final Set<String> tags) { return builder() .hostname(hostname) .plan(plan) .billingCycle(billingCycle) .facility(facility) .features(features) .operatingSystem(operatingSystem) .locked(locked) .userdata(userdata) .tags(tags) .build(); }
Source:
<code>private void updateChapterPages() { final boolean wasOrganizer = mViewPagerAdapter != null && mViewPagerAdapter.getCount() == ORGANIZER_PAGES.length; <START> if (organizerCheckCallback != null) { <END> organizerCheckCallback.cancel(); } organizerCheckCallback = new OrganizerCheckCallback(wasOrganizer); App.getInstance().checkOrganizer( getGoogleApiClient(), organizerCheckCallback ); }</code><technical_language>great initialize this beginning wasOrganizer = false is null</technical_language>

Target:
private void updateChapterPages() { if (organizerCheckCallback != null) { organizerCheckCallback.cancel(); } organizerCheckCallback = new OrganizerCheckCallback(isOrganizerFragmentShown()); App.getInstance().checkOrganizer( getGoogleApiClient(), organizerCheckCallback ); }
Source:
<code>public final TmfModelResponse<List<M>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { <START> if (fCached != null) { return fCached; } <END> fAnalysisModule.waitForInitialization(); ITmfStateSystem ss = fAnalysisModule.getStateSystem(); if (ss == null) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.STATE_SYSTEM_FAILED); } boolean complete = ss.waitUntilBuilt(0); try (FlowScopeLog scope = new FlowScopeLogBuilder(LOGGER, Level.FINE, "AbstractTreeDataProvider#fetchTree") .setCategory(getClass().getSimpleName()).build()) { synchronized (fIdToQuark) { List<M> tree = getTree(ss, filter, monitor); if (complete) { TmfModelResponse<List<M>> response = new TmfModelResponse<>(tree, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); if (isCacheable()) { fCached = response; } return response; } return new TmfModelResponse<>(tree, ITmfResponse.Status.RUNNING, CommonStatusMessage.RUNNING); } } catch (StateSystemDisposedException e) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.STATE_SYSTEM_FAILED); } }</code><technical_language>cache is protected for concurrent access</technical_language>

Target:
public final TmfModelResponse<List<M>> fetchTree(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { if (fCached != null) { return fCached; } fAnalysisModule.waitForInitialization(); ITmfStateSystem ss = fAnalysisModule.getStateSystem(); if (ss == null) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.STATE_SYSTEM_FAILED); } boolean complete = ss.waitUntilBuilt(0); fLock.writeLock().lock(); try (FlowScopeLog scope = new FlowScopeLogBuilder(LOGGER, Level.FINE, "AbstractTreeDataProvider#fetchTree") .setCategory(getClass().getSimpleName()).build()) { List<M> tree = getTree(ss, filter, monitor); if (complete) { TmfModelResponse<List<M>> response = new TmfModelResponse<>(tree, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED); if (isCacheable()) { fCached = response; } return response; } return new TmfModelResponse<>(tree, ITmfResponse.Status.RUNNING, CommonStatusMessage.RUNNING); } catch (StateSystemDisposedException e) { return new TmfModelResponse<>(null, ITmfResponse.Status.FAILED, CommonStatusMessage.STATE_SYSTEM_FAILED); } finally { fLock.writeLock().unlock(); } }
Source:
<code><START> public ZkCloudname connectWithTimeout(long waitTime, TimeUnit waitUnit) { <END> try { zk = new ZooKeeper(connectString, SESSION_TIMEOUT, this); if (! connectedSignal.await(waitTime, waitUnit)) { throw new CloudnameException.CouldNotConnectToStorage(new RuntimeException( "Connecting to ZooKeeper timed out.")); } log.info("Connected to ZooKeeper " + connectString); } catch (IOException e) { throw new CloudnameException.CouldNotConnectToStorage(e); } catch (InterruptedException e) { throw new CloudnameException.CouldNotConnectToStorage(e); } return this; }</code><technical_language>variable final _unless_ intend modify value</technical_language>

Target:
public ZkCloudname connectWithTimeout(long waitTime, TimeUnit waitUnit) { try { zk = new ZooKeeper(connectString, SESSION_TIMEOUT, this); if (! connectedSignal.await(waitTime, waitUnit)) { throw new CloudnameException.CouldNotConnectToStorage( "Connecting to ZooKeeper timed out."); } log.info("Connected to ZooKeeper " + connectString); } catch (IOException e) { throw new CloudnameException.CouldNotConnectToStorage(e); } catch (InterruptedException e) { throw new CloudnameException.CouldNotConnectToStorage(e); } return this; }
Source:
<code>protected Object invokeInNoTx(InterceptorContext invocation, final EJBComponent component) throws Exception { try { return invocation.proceed(); } catch (EJBException | RemoteException e) { throw e; } catch (RuntimeException e) { throw new EJBException(e); <START> } catch (Exception e) { <END> throw e; } catch (Error e) { ApplicationExceptionDetails ae = component.getApplicationException(e.getClass(), invocation.getMethod()); if (ae != null) { throw e; } else { throw EjbLogger.ROOT_LOGGER.unexpectedError(e); } } catch (Throwable t2) { throw new UndeclaredThrowableException(t2); } }</code><technical_language>Previously if a RuntimeException listed application exception wrapped, is behaviour expected spec</technical_language>

Target:
protected Object invokeInNoTx(InterceptorContext invocation, final EJBComponent component) throws Exception { try { return invocation.proceed(); } catch (Error e) { throw EjbLogger.ROOT_LOGGER.unexpectedError(e); } catch (EJBException e) { throw e; } catch (RuntimeException e) { ApplicationExceptionDetails ae = component.getApplicationException(e.getClass(), invocation.getMethod()); throw ae != null ? e : new EJBException(e); } catch (Exception e) { throw e; } catch (Throwable t) { throw new EJBException(new UndeclaredThrowableException(t)); } }
Source:
<code>public List<Protos.Key> serializeToProtobuf() { lock.lock(); try { LinkedList<Protos.Key> entries = newLinkedList(); boolean isWatchingChain = false; if (seed != null) { Protos.Key.Builder seedEntry = BasicKeyChain.serializeEncryptableItem(seed); seedEntry.setType(Protos.Key.Type.DETERMINISTIC_ROOT_SEED); entries.add(seedEntry.build()); } else { isWatchingChain = true; } Map<ECKey, Protos.Key.Builder> keys = basicKeyChain.serializeToEditableProtobufs(); for (Map.Entry<ECKey, Protos.Key.Builder> entry : keys.entrySet()) { DeterministicKey key = (DeterministicKey) entry.getKey(); Protos.Key.Builder proto = entry.getValue(); proto.setType(Protos.Key.Type.DETERMINISTIC_KEY); final Protos.DeterministicKey.Builder detKey = proto.getDeterministicKeyBuilder(); detKey.setChainCode(ByteString.copyFrom(key.getChainCode())); for (ChildNumber num : key.getPath()) detKey.addPath(num.i()); if (key.equals(externalKey)) { detKey.setIssuedSubkeys(issuedExternalKeys); detKey.setLookaheadSize(lookaheadSize); } else if (key.equals(internalKey)) { detKey.setIssuedSubkeys(issuedInternalKeys); detKey.setLookaheadSize(lookaheadSize); } if (entries.isEmpty() && isWatchingChain) { <START> detKey.setIsFollowing(true); <END> } entries.add(proto.build()); } return entries; } finally { lock.unlock(); } }</code><technical_language>For a wallet is watching, this notion of multiple keychains of is another, this work? Remember valid a single chain in wallet seed</technical_language>

Target:
public List<Protos.Key> serializeToProtobuf() { lock.lock(); try { LinkedList<Protos.Key> entries = newLinkedList(); if (seed != null) { Protos.Key.Builder seedEntry = BasicKeyChain.serializeEncryptableItem(seed); seedEntry.setType(Protos.Key.Type.DETERMINISTIC_ROOT_SEED); entries.add(seedEntry.build()); } Map<ECKey, Protos.Key.Builder> keys = basicKeyChain.serializeToEditableProtobufs(); for (Map.Entry<ECKey, Protos.Key.Builder> entry : keys.entrySet()) { DeterministicKey key = (DeterministicKey) entry.getKey(); Protos.Key.Builder proto = entry.getValue(); proto.setType(Protos.Key.Type.DETERMINISTIC_KEY); final Protos.DeterministicKey.Builder detKey = proto.getDeterministicKeyBuilder(); detKey.setChainCode(ByteString.copyFrom(key.getChainCode())); for (ChildNumber num : key.getPath()) detKey.addPath(num.i()); if (key.equals(externalKey)) { detKey.setIssuedSubkeys(issuedExternalKeys); detKey.setLookaheadSize(lookaheadSize); } else if (key.equals(internalKey)) { detKey.setIssuedSubkeys(issuedInternalKeys); detKey.setLookaheadSize(lookaheadSize); } if (entries.isEmpty() && isFollowing()) { detKey.setIsFollowing(true); } entries.add(proto.build()); } return entries; } finally { lock.unlock(); } }
Source:
<code>public DiscoveredResourceDetails discoverResource(Configuration pluginConfig, ResourceDiscoveryContext context) throws InvalidPluginConfigurationException { DiscoveredResourceDetails discoveredResource = super.discoverResource(pluginConfig, context); <START> discoverAdditionalJavaOpts(discoveredResource); <END> return discoveredResource; }</code><technical_language>this sense? manually add a standalone server, is a remote server, inspect configuration dir</technical_language>

Target:
public DiscoveredResourceDetails discoverResource(Configuration pluginConfig, ResourceDiscoveryContext context) throws InvalidPluginConfigurationException { DiscoveredResourceDetails discoveredResource = super.discoverResource(pluginConfig, context); discoverAdditionalJavaOpts(discoveredResource, context); return discoveredResource; }
Source:
<code>protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { binding = WidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); <START> View answerView = binding.getRoot(); <END> if (prompt.isReadOnly()) { binding.widgetButton.setVisibility(GONE); } else { binding.widgetButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.widgetButton.setText(getContext().getString(R.string.select_time)); binding.widgetButton.setOnClickListener(v -> onButtonClick()); } binding.widgetAnswerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); if (getFormEntryPrompt().getAnswerValue() == null) { clearAnswer(); } else { Date date = (Date) getFormEntryPrompt().getAnswerValue().getValue(); DateTime dateTime = new DateTime(date); updateTime(dateTime); } return answerView; }</code><technical_language>in DateWidget need this variable return binding.getRoot() bottom</technical_language>

Target:
protected View onCreateAnswerView(Context context, FormEntryPrompt prompt, int answerFontSize) { binding = TimeWidgetAnswerBinding.inflate(((Activity) context).getLayoutInflater()); if (prompt.isReadOnly()) { binding.timeButton.setVisibility(GONE); } else { binding.timeButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); binding.timeButton.setOnClickListener(v -> { DateTimeWidgetUtils.setWidgetWaitingForData(prompt.getIndex()); widgetUtils.showTimePickerDialog(context, selectedTime); }); } binding.timeAnswerText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, answerFontSize); if (prompt.getAnswerValue() == null) { selectedTime = DateTimeUtils.getCurrentDateTime(); } else { DateTime dateTime = new DateTime(getFormEntryPrompt().getAnswerValue().getValue()); selectedTime = DateTimeUtils.getSelectedTime(dateTime.toLocalDateTime(), LocalDateTime.now()); binding.timeAnswerText.setText(DateTimeUtils.getTimeData(dateTime).getDisplayText()); } return binding.getRoot(); }
Source:
<code>public static String getIdentifiableComponentName(Component component) { if (component.getAlias() != null) { return component.getAlias(); } switch (component.getType()) { case EDITOR_COMPONENT_TYPE: case PLUGIN_COMPONENT_TYPE: return component.getId(); case DOCKERIMAGE_COMPONENT_TYPE: return component.getImage(); case KUBERNETES_COMPONENT_TYPE: case OPENSHIFT_COMPONENT_TYPE: <START> return component.getReference(); <END> default: return null; } }</code><technical_language>Is identifiable? I guess some situation following: components: - type: kubernetes reference: k8s.yaml selector: component: mysql - type: kubernetes reference: k8s.yaml selector: component: webapp</technical_language>

Target:
public static String getIdentifiableComponentName(Component component) throws IllegalStateException { if (component.getAlias() != null) { return component.getAlias(); } switch (component.getType()) { case EDITOR_COMPONENT_TYPE: case PLUGIN_COMPONENT_TYPE: return component.getId(); case DOCKERIMAGE_COMPONENT_TYPE: return component.getImage(); case KUBERNETES_COMPONENT_TYPE: case OPENSHIFT_COMPONENT_TYPE: return component.getReference(); default: throw new IllegalStateException( format("Unhandled component type: %s", component.getType())); } }
Source:
<code>private static boolean shouldServiceVersionBeTested(KeyServiceVersion serviceVersion) { if (Configuration.getGlobalConfiguration().get(AZURE_TEST_SERVICE_VERSIONS) == null) { return KeyServiceVersion.getLatest().equals(serviceVersion); } <START> return true; <END> }</code><technical_language>Check env variable returning true</technical_language>

Target:
private static boolean shouldServiceVersionBeTested(KeyServiceVersion serviceVersion) { if (CoreUtils.isNullOrEmpty(SERVICE_VERSION_FROM_ENV)) { return KeyServiceVersion.getLatest().equals(serviceVersion); } if (AZURE_TEST_SERVICE_VERSIONS_VALUE_ALL.equalsIgnoreCase(SERVICE_VERSION_FROM_ENV)) { return true; } String[] configuredServiceVersionList = SERVICE_VERSION_FROM_ENV.split(","); return Arrays.stream(configuredServiceVersionList).anyMatch(configuredServiceVersion -> serviceVersion.toString().equals(configuredServiceVersion.trim())); }
Source:
<code>public boolean hasUserData() { <START> return userData != null; <END> }</code><technical_language>A question: Omitting map.isEmpty() check is intended? Overrided default method check a null check is done</technical_language>

Target:
public boolean hasUserData() { return userData != null && !userData.isEmpty(); }
Source:
<code>public void preListeners(boolean render) { ArrayList<TickListener> list; if (render) { list = renderListeners; } else { list = gameListeners; } for (TickListener tl : list) { try { tl.preTick(); } catch (Exception ex) { log.log(LogLevel.ERROR, "Error in preTick!"); <START> ex.printStackTrace(); <END> } } }</code><technical_language>Correct if wrong, instead of ex.printStackTrace(); do log.log(LogLevel.ERROR, "Error in preTick!\t" + ex.getMessage() )</technical_language>

Target:
public void preListeners(boolean render) { ArrayList<TickListener> list; if (render) { list = renderListeners; } else { list = gameListeners; } for (TickListener tl : list) { try { tl.preTick(); } catch (Exception ex) { log.log(LogLevel.ERROR, "Error in preTick:\t" + ex.getMessage()); ex.printStackTrace(); } } }
Source:
<code>private Map<SystemStreamPartition, List<IncomingMessageEnvelope>> processResults(ConsumerRecords<K, V> records) { if (records == null) { return Collections.emptyMap(); } int capacity = (int) (records.count() / 0.75 + 1); Map<SystemStreamPartition, List<IncomingMessageEnvelope>> results = new HashMap<>(capacity); <START> for (ConsumerRecord<K, V> r : records) { <END> int partition = r.partition(); String topic = r.topic(); TopicPartition tp = new TopicPartition(topic, partition); updateMetrics(r, tp); SystemStreamPartition ssp = topicPartitions2SSP.get(tp); List<IncomingMessageEnvelope> listMsgs = results.get(ssp); if (listMsgs == null) { listMsgs = new ArrayList<>(); results.put(ssp, listMsgs); } final K key = r.key(); final Object value = r.value(); IncomingMessageEnvelope imEnvelope = new IncomingMessageEnvelope(ssp, String.valueOf(r.offset()), key, value, getRecordSize(r)); listMsgs.add(imEnvelope); } if (LOG.isDebugEnabled()) { LOG.debug("# records per SSP:"); for (Map.Entry<SystemStreamPartition, List<IncomingMessageEnvelope>> e : results.entrySet()) { List<IncomingMessageEnvelope> list = e.getValue(); LOG.debug(e.getKey() + " = " + ((list == null) ? 0 : list.size())); } } return results; }</code><technical_language>s/r/record</technical_language>

Target:
private Map<SystemStreamPartition, List<IncomingMessageEnvelope>> processResults(ConsumerRecords<K, V> records) { if (records == null) { throw new SamzaException("Received null 'records' after polling consumer in KafkaConsumerProxy " + this); } Map<SystemStreamPartition, List<IncomingMessageEnvelope>> results = new HashMap<>(records.count()); for (ConsumerRecord<K, V> record : records) { int partition = record.partition(); String topic = record.topic(); TopicPartition tp = new TopicPartition(topic, partition); updateMetrics(record, tp); SystemStreamPartition ssp = topicPartitionToSSP.get(tp); List<IncomingMessageEnvelope> messages = results.get(ssp); if (messages == null) { messages = new ArrayList<>(); results.put(ssp, messages); } K key = record.key(); Object value = record.value(); IncomingMessageEnvelope imEnvelope = new IncomingMessageEnvelope(ssp, String.valueOf(record.offset()), key, value, getRecordSize(record)); messages.add(imEnvelope); } if (LOG.isDebugEnabled()) { LOG.debug("# records per SSP:"); for (Map.Entry<SystemStreamPartition, List<IncomingMessageEnvelope>> e : results.entrySet()) { List<IncomingMessageEnvelope> list = e.getValue(); LOG.debug(e.getKey() + " = " + ((list == null) ? 0 : list.size())); } } return results; }
Source:
<code>public void open(ExecutionContext ctx) throws Exception { super.open(ctx); ValueStateDescriptor<Boolean> stateDesc = new ValueStateDescriptor<>("existsState", Types.BOOLEAN); <START> if (!stateTtlConfig.equals(StateTtlConfig.DISABLED)){ <END> stateDesc.enableTimeToLive(stateTtlConfig); } state = ctx.getRuntimeContext().getState(stateDesc); }</code><technical_language>stateTtlConfig.isEnabled. correct implementation in JoinRecordStateViews</technical_language>

Target:
public void open(ExecutionContext ctx) throws Exception { super.open(ctx); ValueStateDescriptor<Boolean> stateDesc = new ValueStateDescriptor<>("existsState", Types.BOOLEAN); StateTtlConfig ttlConfig = createTtlConfig(minRetentionTime); if (ttlConfig.isEnabled()) { stateDesc.enableTimeToLive(ttlConfig); } state = ctx.getRuntimeContext().getState(stateDesc); }
Source:
<code>private String getHumanReadableSize(long bytes) { int unit = 1000; if (bytes < unit) <START> return bytes + " B"; <END> int exp = (int) (Math.log(bytes) / Math.log(unit)); String pre = "" + "KMGTPE".charAt(exp - 1); return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre); }</code><technical_language>Cosmetic: Please, braces conditions loops. Thanks! :)</technical_language>

Target:
private String getHumanReadableSize(long bytes) { int unit = 1000; if (bytes < unit) { return bytes + " B"; } int exp = (int) (Math.log(bytes) / Math.log(unit)); String pre = "" + "KMGTPE".charAt(exp - 1); return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre); }
Source:
<code>public void buildStarted(Run build, TaskListener taskListener, GerritTriggeredEvent event, BuildsStartedStats stats) { try { if (event instanceof ChangeBasedEvent) { String command = parameterExpander.getBuildStartedCommand(build, taskListener, (ChangeBasedEvent)event, stats); if (command != null) { if (!command.isEmpty()) { <START> logger.info("Notifying BuildStarted to gerrit: {}", truncateCommandForLog(command)); <END> cmdRunner.sendCommand(command); GerritTriggeredBuildListener.fireOnStarted(event, command); } else { logger.info("BuildStarted command is empty. Gerrit will not be notified of BuildStarted"); } } else { logger.error("Something wrong during parameter extraction. " + "Gerrit will not be notified of BuildStarted"); } } } catch (Exception ex) { logger.error("Could not complete BuildStarted notification!", ex); } }</code><technical_language>Yea, this info level I</technical_language>

Target:
public void buildStarted(Run build, TaskListener taskListener, GerritTriggeredEvent event, BuildsStartedStats stats) { try { if (event instanceof ChangeBasedEvent) { String command = parameterExpander.getBuildStartedCommand(build, taskListener, (ChangeBasedEvent)event, stats); if (command != null) { if (!command.isEmpty()) { logger.debug("Notifying BuildStarted to gerrit: {}", command); cmdRunner.sendCommand(command); GerritTriggeredBuildListener.fireOnStarted(event, command); } else { logger.debug("BuildStarted command is empty. Gerrit will not be notified of BuildStarted"); } } else { logger.error("Something wrong during parameter extraction. " + "Gerrit will not be notified of BuildStarted"); } } } catch (Exception ex) { logger.error("Could not complete BuildStarted notification!", ex); } }
Source:
<code>private DigitalTwinsAsyncClient getAsyncClient(HttpClient httpClient, DigitalTwinsServiceVersion serviceVersion) { <START> return getDigitalTwinsClientBuilder().serviceVersion(serviceVersion).httpClient(httpClient).buildAsyncClient(); <END> }</code><technical_language>useful enable logger well</technical_language>

Target:
private DigitalTwinsAsyncClient getAsyncClient(HttpClient httpClient, DigitalTwinsServiceVersion serviceVersion) { return getDigitalTwinsClientBuilder(httpClient, serviceVersion) .buildAsyncClient(); }
Source:
<code><START> public FormatInfo process(String templatePath, ImageFormat format, String templateName, long processTimeout) { <END> return process(templatePath, format, templateName); }</code><technical_language>call hierarchy reversed</technical_language>

Target:
public FormatInfo process(String templatePath, ImageFormat format, String templateName, long processTimeout) { if (format != null) { s_logger.debug("We don't handle conversion from " + format + " to ISO."); return null; } String isoPath = templatePath + File.separator + templateName + "." + ImageFormat.ISO.getFileExtension(); if (!_storage.exists(isoPath)) { s_logger.debug("Unable to find the iso file: " + isoPath); return null; } FormatInfo info = new FormatInfo(); info.format = ImageFormat.ISO; info.filename = templateName + "." + ImageFormat.ISO.getFileExtension(); info.size = _storage.getSize(isoPath); info.virtualSize = info.size; return info; }
Source:
<code>public Void visitJoin(JoinNode node, Integer indent) { JoinNode.DistributionType distributionType = node.getDistributionType() .orElseThrow(() -> new IllegalStateException("Expected distribution type to be present")); if (node.isCrossJoin()) { <START> checkState(node.getType() == INNER && distributionType == REPLICATED, "Expected CROSS join to be INNER REPLICATED"); <END> lines.add(indentString(indent) + "cross join:"); } else { lines.add(format("%sjoin (%s, %s):", indentString(indent), node.getType(), distributionType)); } return visitPlan(node, indent + 1); }</code><technical_language>nit: s/join/JOIN/</technical_language>

Target:
public Void visitJoin(JoinNode node, Integer indent) { JoinNode.DistributionType distributionType = node.getDistributionType() .orElseThrow(() -> new IllegalStateException("Expected distribution type to be present")); if (node.isCrossJoin()) { checkState(node.getType() == INNER && distributionType == REPLICATED, "Expected CROSS JOIN to be INNER REPLICATED"); lines.add(indentString(indent) + "cross join:"); } else { lines.add(format("%sjoin (%s, %s):", indentString(indent), node.getType(), distributionType)); } return visitPlan(node, indent + 1); }
Source:
<code>private void onDisconnect(JdbcThinTcpIo cliIo) { assert connCnt.get() > 0; if (partitionAwareness) { cliIo.close(); ios.remove(cliIo.nodeId()); } else { if (singleIo != null) singleIo.close(); } connCnt.decrementAndGet(); if (streamState != null) { streamState.close0(); streamState = null; } synchronized (stmtsMux) { for (JdbcThinStatement s : stmts) s.closeOnDisconnect(); stmts.clear(); } <START> metaHnd = new JdbcBinaryMetadataHandler(); <END> }</code><technical_language>enough swap links here, metaHnd a BinaryContext, update link</technical_language>

Target:
private void onDisconnect(JdbcThinTcpIo cliIo) { assert connCnt.get() > 0; if (partitionAwareness) { cliIo.close(); ios.remove(cliIo.nodeId()); } else { if (singleIo != null) singleIo.close(); } connCnt.decrementAndGet(); if (streamState != null) { streamState.close0(); streamState = null; } synchronized (stmtsMux) { for (JdbcThinStatement s : stmts) s.closeOnDisconnect(); stmts.clear(); } metaHnd = new JdbcBinaryMetadataHandler(); ctx = createBinaryCtx(metaHnd, marshCtx); }
Source:
<code>public CandlepinQuery<Content> getContentByProductUuids(Collection<String> productUuids) { if (productUuids != null && !productUuids.isEmpty()) { Session session = this.currentSession(); Collection<String> uuids = new HashSet<String>(); Iterable<List<String>> uuidBlocks = Iterables.partition(productUuids, AbstractHibernateCurator.QUERY_PARAMETER_LIMIT); for (List<String> uuidBlock : uuidBlocks) { StringBuilder builder = new StringBuilder("SELECT DISTINCT content_uuid FROM ") .append(ProductContent.DB_TABLE) .append(" WHERE ("); int blockCount = (int) Math.ceil(uuidBlock.size() / (float) AbstractHibernateCurator.IN_OPERATOR_BLOCK_SIZE); for (int i = 0; i < blockCount;) { if (i != 0) { builder.append(" OR "); } builder.append("product_uuid IN (?").append(++i).append(')'); } builder.append(')'); <START> SQLQuery query = session.createSQLQuery(builder.toString()); <END> int param = 0; Iterable<List<String>> blocks = Iterables.partition(uuidBlock, AbstractHibernateCurator.IN_OPERATOR_BLOCK_SIZE); for (List<String> block : blocks) { query.setParameterList(String.valueOf(++param), block); } uuids.addAll(query.list()); } if (uuids != null && !uuids.isEmpty()) { DetachedCriteria criteria = this.createSecureDetachedCriteria() .add(CPRestrictions.in("uuid", uuids)); return this.cpQueryFactory.<Content>buildQuery(session, criteria); } } return this.cpQueryFactory.<Content>buildQuery(); }</code><technical_language>Due complex nature of building this query, lets add a quick debug statement showing resulting query</technical_language>

Target:
public CandlepinQuery<Content> getContentByProductUuids(Collection<String> productUuids) { if (productUuids != null && !productUuids.isEmpty()) { Session session = this.currentSession(); Collection<String> uuids = new HashSet<String>(); Iterable<List<String>> uuidBlocks = Iterables.partition(productUuids, AbstractHibernateCurator.QUERY_PARAMETER_LIMIT); for (List<String> uuidBlock : uuidBlocks) { StringBuilder builder = new StringBuilder("SELECT DISTINCT content_uuid FROM ") .append(ProductContent.DB_TABLE) .append(" WHERE ("); int blockCount = (int) Math.ceil(uuidBlock.size() / (float) AbstractHibernateCurator.IN_OPERATOR_BLOCK_SIZE); for (int i = 0; i < blockCount;) { if (i != 0) { builder.append(" OR "); } builder.append("product_uuid IN (?").append(++i).append(')'); } builder.append(')'); log.debug("getContentByProductUuids query: {}", builder); SQLQuery query = session.createSQLQuery(builder.toString()); int param = 0; Iterable<List<String>> blocks = Iterables.partition(uuidBlock, AbstractHibernateCurator.IN_OPERATOR_BLOCK_SIZE); for (List<String> block : blocks) { query.setParameterList(String.valueOf(++param), block); } uuids.addAll(query.list()); } if (uuids != null && !uuids.isEmpty()) { DetachedCriteria criteria = this.createSecureDetachedCriteria() .add(CPRestrictions.in("uuid", uuids)); return this.cpQueryFactory.<Content>buildQuery(session, criteria); } } return this.cpQueryFactory.<Content>buildQuery(); }
Source:
<code>public DateTime getEndDate() { <START> return mEndDateInMillis; <END> }</code><technical_language>rename field endDate</technical_language>

Target:
public DateTime getEndDate() { return mEndDateIn; }
Source:
<code>public void startServer() { _server = new Server(); HttpConnectionFactory http = new HttpConnectionFactory(); http.getHttpConfiguration().setSecurePort(9999); http.getHttpConfiguration().setSecureScheme("BWTP"); _connector = new LocalConnector(_server, http); _connector.setIdleTimeout(300000); HttpConnectionFactory https = new HttpConnectionFactory(); https.getHttpConfiguration().addCustomizer(new HttpConfiguration.Customizer() { @Override public void customize(Connector connector, HttpConfiguration channelConfig, Request request) { <START> request.setHttpURI(HttpURI.build(request.getHttpURI()).scheme(HttpScheme.HTTPS).asImmutable()); <END> request.setSecure(true); } }); _connectorS = new LocalConnector(_server, https); _server.setConnectors(new Connector[]{_connector, _connectorS}); ContextHandler contextHandler = new ContextHandler(); _session = new SessionHandler(); contextHandler.setContextPath("/ctx"); _server.setHandler(contextHandler); contextHandler.setHandler(_session); _security = new ConstraintSecurityHandler(); _session.setHandler(_security); _security.setHandler(new AbstractHandler() { @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { baseRequest.setHandled(true); response.sendError(404); } }); }</code><technical_language>Remove asImmutable() this test class</technical_language>

Target:
public void startServer() { _server = new Server(); HttpConnectionFactory http = new HttpConnectionFactory(); http.getHttpConfiguration().setSecurePort(9999); http.getHttpConfiguration().setSecureScheme("BWTP"); _connector = new LocalConnector(_server, http); _connector.setIdleTimeout(300000); HttpConnectionFactory https = new HttpConnectionFactory(); https.getHttpConfiguration().addCustomizer(new HttpConfiguration.Customizer() { @Override public void customize(Connector connector, HttpConfiguration channelConfig, Request request) { request.setHttpURI(HttpURI.build(request.getHttpURI()).scheme(HttpScheme.HTTPS)); request.setSecure(true); } }); _connectorS = new LocalConnector(_server, https); _server.setConnectors(new Connector[]{_connector, _connectorS}); ContextHandler contextHandler = new ContextHandler(); _session = new SessionHandler(); contextHandler.setContextPath("/ctx"); _server.setHandler(contextHandler); contextHandler.setHandler(_session); _security = new ConstraintSecurityHandler(); _session.setHandler(_security); _security.setHandler(new AbstractHandler() { @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { baseRequest.setHandled(true); response.sendError(404); } }); }
Source:
<code>public ValueNode replaceIndexExpression(ResultColumnList childRCL) throws StandardException { if (childRCL != null) { for (ResultColumn childRC : childRCL) { <START> if (this.equals(childRC.getIndexExpression())) { <END> return childRC.getColumnReference(this); } } } return this; }</code><technical_language>a good idea a method equals in of locations compare index expressions, a wrapper function. For now, wrapper function call equals, later, want a+1 matched equivalent 1+a, simply add new logic method required locations new logic</technical_language>

Target:
public ValueNode replaceIndexExpression(ResultColumnList childRCL) throws StandardException { if (childRCL != null) { for (ResultColumn childRC : childRCL) { if (this.semanticallyEquals(childRC.getIndexExpression())) { return childRC.getColumnReference(this); } } } return this; }
Source:
<code>public MatchClause append(Filter filter) { <START> if (filter.getRelationshipDirection().equals(Direction.INCOMING)) { <END> clause.append("<"); } clause.append( String.format("-[%s:`%s`]-", filter.isNestedRelationshipEntity() ? "r" : "", filter.getRelationshipType()) ); if (filter.getRelationshipDirection().equals(Direction.OUTGOING)) { clause.append(">"); } clause.append(String.format("(%s) ", "m" + index)); return this; }</code><technical_language>suggestion if (filter.getRelationshipDirection() == Direction.INCOMING) {</technical_language>

Target:
public MatchClause append(Filter filter) { if (filter.getRelationshipDirection() == Direction.INCOMING) { clause.append("<"); } clause.append( String.format("-[%s:`%s`]-", filter.isNestedRelationshipEntity() ? "r" : "", filter.getRelationshipType()) ); if (filter.getRelationshipDirection() == Direction.OUTGOING) { clause.append(">"); } clause.append(String.format("(%s) ", "m" + index)); return this; }