auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, PerHostMessages messages) { Version vmCustomCompatibilityVersion = vm.getCustomCompatibilityVersion(); <START> List<VDS> hostsToRunOn = new ArrayList<>(); <END> if (vmCustomCompatibilityVersion == null) { return hosts; } for (VDS host : hosts) { if (host.getSupportedENGINESVersionsSet().contains(vmCustomCompatibilityVersion)) { hostsToRunOn.add(host); log.debug("Host wasn't filtered out as it supports the VM required compatibility version({})", host.getName(), vmCustomCompatibilityVersion); } else { log.debug("Host was filtered out as it doesn't support the VM required compatibility-version ({}). Host supported compatibility-versions are: {}.", host.getName(), vmCustomCompatibilityVersion, host.getSupportedEngines()); messages.addMessage(host.getId(), String.format("$vmCompatibilityVersions %1$s", vmCustomCompatibilityVersion)); messages.addMessage(host.getId(), String.format("$hostCompatibilityVersions %1$s", host.getSupportedEngines())); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__UNSUPPORTED_COMPATIBILITY_VERSION.toString()); } } return hostsToRunOn; }</code><technical_language>I expect compiler optimise still, moving this line check more clear this field is if VM custom compatibility version</technical_language>

Target:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, PerHostMessages messages) { Version vmCustomCompatibilityVersion = vm.getCustomCompatibilityVersion(); if (vmCustomCompatibilityVersion == null) { return hosts; } List<VDS> hostsToRunOn = new ArrayList<>(); for (VDS host : hosts) { if (host.getSupportedENGINESVersionsSet().contains(vmCustomCompatibilityVersion)) { hostsToRunOn.add(host); log.debug("Host wasn't filtered out as it supports the VM required compatibility version({})", host.getName(), vmCustomCompatibilityVersion); } else { log.debug("Host was filtered out as it doesn't support the VM required compatibility-version ({}). Host supported compatibility-versions are: {}.", host.getName(), vmCustomCompatibilityVersion, host.getSupportedEngines()); messages.addMessage(host.getId(), String.format("$vmCompatibilityVersions %1$s", vmCustomCompatibilityVersion)); messages.addMessage(host.getId(), String.format("$hostCompatibilityVersions %1$s", host.getSupportedEngines())); messages.addMessage(host.getId(), EngineMessage.VAR__DETAIL__UNSUPPORTED_COMPATIBILITY_VERSION.toString()); } } return hostsToRunOn; }
Source:
<code><START> private PBDSegment peekFirstSegment() { <END> Map.Entry<Long, PBDSegment> entry = m_segments.firstEntry(); return (entry!=null) ? entry.getValue() : null; }</code><technical_language>functions confusing return null assumption pdb segment. assert(entry != null) is more readable</technical_language>

Target:
private PBDSegment peekFirstSegment() { Map.Entry<Long, PBDSegment> entry = m_segments.firstEntry(); return (entry==null) ? null : entry.getValue(); }
Source:
<code>public CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries> readUnconfirmed(long firstEntry, <START> long lastEntry) { END> if (firstEntry < 0 || firstEntry > lastEntry) { LOG.error("IncorrectParameterException on ledgerId:{} firstEntry:{} lastEntry:{}", new Object[] { ledgerId, firstEntry, lastEntry }); return FutureUtils.exception(new BKIncorrectParameterException()); } return readEntriesInternalAsync(firstEntry, lastEntry); }</code><technical_language>Thanks. change it</technical_language>

Target:
public CompletableFuture<LedgerEntries> readUnconfirmed(long firstEntry, long lastEntry) { if (firstEntry < 0 || firstEntry > lastEntry) { LOG.error("IncorrectParameterException on ledgerId:{} firstEntry:{} lastEntry:{}", new Object[] { ledgerId, firstEntry, lastEntry }); return FutureUtils.exception(new BKIncorrectParameterException()); } return readEntriesInternalAsync(firstEntry, lastEntry); }
Source:
<code>public long calculateDuration() { if (!nodes.isEmpty()) { long endTimeNS = 0; for (int i = 0; i < getNodes().size(); i++) { Node node = getNodes().get(i); long et = node.overallEndTime(); if (et > endTimeNS) { endTimeNS = et; } } <START> long elapsedTime = endTimeNS - getNodes().get(0).getBaseTime(); <END> return elapsedTime; } return 0L; }</code><technical_language>rename local vars NS - get confusing</technical_language>

Target:
public long calculateDuration() { if (!nodes.isEmpty()) { long endTime = 0; for (int i = 0; i < getNodes().size(); i++) { Node node = getNodes().get(i); long nodeEndTime = node.overallEndTime(); if (nodeEndTime > endTime) { endTime = nodeEndTime; } } return endTime - getNodes().get(0).getBaseTime(); } return 0L; }
Source:
<code>public Observable<Receive> openEventStream(@NotNull final Send subscription) { return createPost.call(subscription) .flatMap(httpClient::submit) .subscribeOn(Schedulers.io()) .flatMap(resp -> { final HttpResponseStatus status = resp.getStatus(); final int code = status.code(); if (code == 200) { return resp.getContent(); } else { final HttpResponseHeaders headers = resp.getHeaders(); final List<Map.Entry<String, String>> entries = headers.entries(); String errorMessage; if (headers.getContentLength() > 0) { errorMessage = resp.getContent() .map(r -> r.toString(CharsetUtil.UTF_8)) .toBlocking() .first(); } else { errorMessage = ""; } final MesosClientErrorContext context = new MesosClientErrorContext(code, errorMessage, entries); if (400 <= code && code < 500) { throw new MesosClientException(subscription, context); } else if (500 <= code && code < 600) { throw new MesosServerException(subscription, context); } else { LOGGER.warn("Unhandled error: context = {}", context); throw new IllegalStateException("Unhandled error"); } } <START> }) <END> .lift(new RecordIOOperator()) .observeOn(Schedulers.computation()) .buffer(250, TimeUnit.MILLISECONDS) .flatMap(Observable::from) .map(receiveCodec::decode) .doOnNext(event -> LOGGER.trace("Observed Event: {}", receiveCodec.show(event))) .doOnError(t -> LOGGER.warn("doOnError", t)) ; }</code><technical_language>This is a long lambda; openEventStream() easier read if granted private-method status</technical_language>

Target:
public Observable<Receive> openEventStream(@NotNull final Send subscription) { return createPost.call(subscription) .flatMap(httpClient::submit) .subscribeOn(Schedulers.io()) .flatMap(verifyResponseOk(subscription)) .lift(new RecordIOOperator()) .observeOn(Schedulers.computation()) .buffer(250, TimeUnit.MILLISECONDS) .flatMap(Observable::from) .map(receiveCodec::decode) .doOnNext(event -> LOGGER.trace("Observed Event: {}", receiveCodec.show(event))) .doOnError(t -> LOGGER.warn("doOnError", t)) ; }
Source:
<code>public void setUp() throws IOException { FileUtils.forceMkdir(INDEX_DIR); <START> int sequentialDocId = RANDOM.nextInt(32); <END> int sparseDocId = RANDOM.nextInt(32); for (int i = 0; i < NUM_DOC_IDS; i++) { _sequentialDocIds[i] = sequentialDocId; sequentialDocId++; _sparseDocIds[i] = sparseDocId; sparseDocId += 5 + RANDOM.nextInt(6); _lastSequentialDocIds[i] = NUM_VALUES - NUM_DOC_IDS + i; } }</code><technical_language>explicit values instead of random? For example, corner cases bits split read boundaries. programmatically generate splits. this is a fundamental change, feel more comfortable exhaustive testing corner cases explicitly tested</technical_language>

Target:
public void setUp() throws IOException { FileUtils.forceMkdir(INDEX_DIR); for (int i = 0; i < 32; i++) { int[] sequentialDocIds = new int[NUM_DOC_IDS]; _sequentialDocIds[i] = sequentialDocIds; for (int j = 0; j < NUM_DOC_IDS; j++) { sequentialDocIds[j] = i + j; } } int sparseDocId = RANDOM.nextInt(10); for (int i = 0; i < NUM_DOC_IDS; i++) { _sparseDocIds[i] = sparseDocId; sparseDocId += 5 + RANDOM.nextInt(6); _lastSequentialDocIds[i] = NUM_VALUES - NUM_DOC_IDS + i; } }
Source:
<code><START> public void judgmentIndexingJob() throws Exception { <END> Judgment firstJudgment = judgmentRepository.findOne(ccJudgments.get(1).getId()); firstJudgment.markAsIndexed(); judgmentRepository.save(firstJudgment); int alreadyIndexedCount = 1; JobExecution jobExecution = jobExecutor.forceStartNewJob(judgmentIndexingJob); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, ALL_JUDGMENTS_COUNT - alreadyIndexedCount); solrJudgmentsServer.commit(); assertAllMarkedAsIndexed(); assertAllInIndex(ALL_JUDGMENTS_COUNT - alreadyIndexedCount); assertCommonCourtJudgmentIndexed(ccJudgments.get(3)); assertCommonCourtJudgmentIndexed(ccJudgments.get(6)); assertSupremeCourtJudgmentIndexed(scJudgments.get(3)); assertSupremeCourtJudgmentIndexed(scJudgments.get(9)); assertConstitutionalTribunalJudgmentIndexed(ctJudgments.get(0)); }</code><technical_language>given/ execute/ assert sections</technical_language>

Target:
public void judgmentIndexingJob() throws Exception { Judgment firstJudgment = judgmentRepository.findOne(ccJudgments.get(1).getId()); firstJudgment.markAsIndexed(); judgmentRepository.save(firstJudgment); int alreadyIndexedCount = 1; JobExecution jobExecution = jobExecutor.forceStartNewJob(judgmentIndexingJob); solrJudgmentsServer.commit(); JobExecutionAssertUtils.assertJobExecution(jobExecution, 0, ALL_JUDGMENTS_COUNT - alreadyIndexedCount); assertAllMarkedAsIndexed(); assertAllInIndex(ALL_JUDGMENTS_COUNT - alreadyIndexedCount); assertCommonCourtJudgmentIndexed(ccJudgments.get(3)); assertCommonCourtJudgmentIndexed(ccJudgments.get(6)); assertSupremeCourtJudgmentIndexed(scJudgments.get(3)); assertSupremeCourtJudgmentIndexed(scJudgments.get(9)); assertConstitutionalTribunalJudgmentIndexed(ctJudgments.get(0)); }
Source:
<code><START> public SshKeyCacheEntryIterable(Iterable<SshKeyCacheEntry> sshKeyIter) { <END> this.sshKeyIter = sshKeyIter; }</code><technical_language>This public. default package access thee cache impl in this package it</technical_language>

Target:
SshKeyCacheEntryIterable(Iterable<SshKeyCacheEntry> sshKeyIter) { this.sshKeyIter = sshKeyIter; }
Source:
<code>private int getBucket(int count) { <START> return (int) (Math.log(count) / Math.log(mLogBase)); <END> }</code><technical_language>nit: save Math.log(mLogBase)) a constant need this frequently</technical_language>

Target:
private int getBucket(int count) { return (int) (Math.log(count) / mDivisor); }
Source:
<code>public static void refreshEditor(AbstractDTableEditor tableEditor, IProgressMonitor theMonitor) { <START> IProgressMonitor subMonitor = new SubProgressMonitor(theMonitor, 1); <END> final IRunnableWithProgress op = new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) { TransactionalEditingDomain domain = tableEditor.getEditingDomain(); domain.getCommandStack().execute(new RefreshRepresentationsCommand(domain, monitor, tableEditor.getTableModel())); } }; final Shell activeShell = tableEditor.getSite().getShell(); final ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(activeShell); try { tableEditor.enablePropertiesUpdate(false); RefreshActionListenerRegistry.INSTANCE.notifyRepresentationIsAboutToBeRefreshed(tableEditor.getTableModel()); monitorDialog.run(true, false, op); subMonitor.worked(1); } catch (final InvocationTargetException e) { MessageDialog.openError(activeShell, Messages.Refresh_error, e.getTargetException().getMessage()); SiriusPlugin.getDefault().error(Messages.Refresh_errorDuringRefresh, e); } catch (final InterruptedException e) { MessageDialog.openInformation(activeShell, Messages.Refresh_cancelled, e.getMessage()); } finally { tableEditor.enablePropertiesUpdate(true); subMonitor.done(); } }</code><technical_language>I need add theMonitor.begin("Refreshing", 1);</technical_language>

Target:
public static void refreshEditor(AbstractDTableEditor tableEditor, IProgressMonitor theMonitor) { theMonitor.beginTask("Refreshing", 1); IProgressMonitor subMonitor = new SubProgressMonitor(theMonitor, 1); final IRunnableWithProgress op = new IRunnableWithProgress() { @Override public void run(final IProgressMonitor monitor) { TransactionalEditingDomain domain = tableEditor.getEditingDomain(); domain.getCommandStack().execute(new RefreshRepresentationsCommand(domain, monitor, tableEditor.getTableModel())); } }; final Shell activeShell = tableEditor.getSite().getShell(); final ProgressMonitorDialog monitorDialog = new ProgressMonitorDialog(activeShell); try { tableEditor.enablePropertiesUpdate(false); RefreshActionListenerRegistry.INSTANCE.notifyRepresentationIsAboutToBeRefreshed(tableEditor.getTableModel()); monitorDialog.run(true, false, op); subMonitor.worked(1); } catch (final InvocationTargetException e) { MessageDialog.openError(activeShell, Messages.Refresh_error, e.getTargetException().getMessage()); SiriusPlugin.getDefault().error(Messages.Refresh_errorDuringRefresh, e); } catch (final InterruptedException e) { MessageDialog.openInformation(activeShell, Messages.Refresh_cancelled, e.getMessage()); } finally { tableEditor.enablePropertiesUpdate(true); subMonitor.done(); } }
Source:
<code>public void createTransactionShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final UserCardService userCardService = adapter.create(UserCardService.class); userCardService.createTransaction("foobar", new TransactionRequest(new TransactionDenominationRequest("foo", "bar"), "bar"), new RetrofitPromise<Transaction>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/cards/%s/transactions", MOCK_URL, "foobar")); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); }</code><technical_language>Add newline return</technical_language>

Target:
public void createTransactionShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserCardService userCardService = adapter.create(UserCardService.class); userCardService.createTransaction("foobar", new TransactionRequest(new TransactionDenominationRequest("foo", "bar"), "bar"), new RetrofitPromise<Transaction>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/cards/%s/transactions", MOCK_URL, "foobar")); }
Source:
<code>public List<PictureView> computeViewsFor(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert) { List<PictureConversion> pictureConversions = getPictureConversions(); List<PictureView> pictureViews = new ArrayList<>(pictureConversions.size()); for (PictureConversion pictureConversion : pictureConversions) { if (canApplyPictureConversion(pictureConversion, doc)) { try { PictureView pictureView = computeView(doc, blob, pictureConversion, imageInfo, convert); pictureViews.add(pictureView); } catch (NuxeoException e) { <START> log.warn("Unable to compute view: for: {}: {}", pictureConversion::getId, doc::toString, <END> e::getMessage); log.debug(e, e); } } } return pictureViews; }</code><technical_language>remove 2 :</technical_language>

Target:
public List<PictureView> computeViewsFor(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert) { List<PictureConversion> pictureConversions = getPictureConversions(); List<PictureView> pictureViews = new ArrayList<>(pictureConversions.size()); for (PictureConversion pictureConversion : pictureConversions) { if (canApplyPictureConversion(pictureConversion, doc)) { try { PictureView pictureView = computeView(doc, blob, pictureConversion, imageInfo, convert); pictureViews.add(pictureView); } catch (NuxeoException e) { log.warn("Unable to compute view: for document: exception message: {}", pictureConversion::getId, doc::toString, e::getMessage); log.debug(e, e); } } } return pictureViews; }
Source:
<code>public static void resetRollingFileAppender(String pipeline, String rev, String suffix) { String loggerName = getLoggerName(pipeline, rev, suffix); Logger logger =Logger.getLogger(loggerName); Appender appender = logger.getAppender(loggerName); logger.removeAppender(loggerName); <START> appender.close(); <END> }</code><technical_language>method removeAppender(String) internally call getLogger(String), changging logger.appender(loggerName) loger.removeAppender(appender)</technical_language>

Target:
public static void resetRollingFileAppender(String pipeline, String rev, String suffix) { String loggerName = getLoggerName(pipeline, rev, suffix); Logger logger =Logger.getLogger(loggerName); Appender appender = logger.getAppender(loggerName); logger.removeAppender(appender); appender.close(); }
Source:
<code>protected void validate() { if (!PlannerBenchmarkConfig.VALID_NAME_PATTERN.matcher(name).matches()) { throw new IllegalStateException("The solverBenchmark name (" + name + ") is invalid because it does not follow the nameRegex (" + PlannerBenchmarkConfig.VALID_NAME_PATTERN.pattern() + ")" + " which might cause an illegal filename."); } if (!name.trim().equals(name)) { throw new IllegalStateException("The solverBenchmark name (" + name + ") is invalid because it starts or ends with whitespace."); } <START> if (subSingleCount == null || subSingleCount < 1) { <END> throw new IllegalStateException("The solverBenchmark name (" + name + ") is invalid because the subSingleCount (" + subSingleCount + ") must be greater than 1."); } }</code><technical_language>If null invalid? If null, valid (and default 1 basically)</technical_language>

Target:
protected void validate() { if (!PlannerBenchmarkConfig.VALID_NAME_PATTERN.matcher(name).matches()) { throw new IllegalStateException("The solverBenchmark name (" + name + ") is invalid because it does not follow the nameRegex (" + PlannerBenchmarkConfig.VALID_NAME_PATTERN.pattern() + ")" + " which might cause an illegal filename."); } if (!name.trim().equals(name)) { throw new IllegalStateException("The solverBenchmark name (" + name + ") is invalid because it starts or ends with whitespace."); } if (subSingleCount != null && subSingleCount < 1) { throw new IllegalStateException("The solverBenchmark name (" + name + ") is invalid because the subSingleCount (" + subSingleCount + ") must be greater than 1."); } }
Source:
<code>public String getString(String key, String defaultValue) { Object value = getRawProperty(key); if (value == null) { return notFound(key, defaultValue != null ? interpolator.create(getLookup()).resolve(defaultValue) : null); } if (value instanceof String) { <START> return resolve(value.toString()); <END> } else { return value.toString(); } }</code><technical_language>casting faster..</technical_language>

Target:
public String getString(String key, String defaultValue) { Object value = getRawProperty(key); if (value == null) { return notFound(key, defaultValue != null ? interpolator.create(getLookup()).resolve(defaultValue) : null); } if (value instanceof String) { return resolve((String)value); } else { return value.toString(); } }
Source:
<code>public ConfigLocation getConfigLocation() { Iterable<ConfigLocation> locations; <START> locations = configLocationFileStore.getAll(); <END> StringBuilder sb = new StringBuilder(""); for (ConfigLocation configLocation : locations) { sb.append(configLocation.getLocation()).append(' '); Resource configLocationResource = configLocation.toResource(); try { Resource motechSettings; motechSettings = configLocationResource.createRelative(ConfigurationConstants.SETTINGS_FILE_NAME); if (motechSettings.isReadable() && locations != null) { return configLocation; } LOGGER.warn("Could not read motech-settings.properties from: " + configLocationResource.toString()); } catch (IOException e) { LOGGER.warn("Problem reading motech-settings.properties from location: " + configLocationResource.toString(), e); } } throw new MotechConfigurationException(String.format("Could not read settings from any of the config locations. Searched directories: %s.", sb)); }</code><technical_language>done 1 line</technical_language>

Target:
public ConfigLocation getConfigLocation() { Iterable<ConfigLocation> locations = configLocationFileStore.getAll(); StringBuilder sb = new StringBuilder(""); for (ConfigLocation configLocation : locations) { sb.append(configLocation.getLocation()).append(' '); Resource configLocationResource = configLocation.toResource(); try { Resource motechSettings = configLocationResource.createRelative(ConfigurationConstants.SETTINGS_FILE_NAME); if (motechSettings.isReadable() && locations != null) { return configLocation; } LOGGER.warn("Could not read motech-settings.properties from: " + configLocationResource.toString()); } catch (IOException e) { LOGGER.warn("Problem reading motech-settings.properties from location: " + configLocationResource.toString(), e); } } throw new MotechConfigurationException(String.format("Could not read settings from any of the config locations. Searched directories: %s.", sb)); }
Source:
<code>public ProcessorExpressionRoute(String expression, Processor processor) { super(processor); <START> requireNonNull(expression, "expression can't be null"); <END> this.expression = expression; }</code><technical_language>this returns expression, combine this line next</technical_language>

Target:
public ProcessorExpressionRoute(String expression, Processor processor) { super(processor); this.expression = requireNonNull(expression, "expression can't be null"); }
Source:
<code>public Statement build() { final Map<String, Object> parameters = new HashMap<>(); final StringBuilder queryBuilder = new StringBuilder(); Edge firstEdge = deletedEdges.iterator().next(); if (deletedEdges != null && deletedEdges.size() > 0) { queryBuilder.append("UNWIND {rows} AS row MATCH ()-[r]-() WHERE ID(r) = row.relId "); if (firstEdge.hasVersionProperty()) { queryBuilder.append("AND r.`") .append(firstEdge.getVersion().getKey()) <START> .append("` = row.version SET r.`") <END> .append(firstEdge.getVersion().getKey()) .append("` = r.`") .append(firstEdge.getVersion().getKey()) .append("` + 1 WITH r,row WHERE r.`") .append(firstEdge.getVersion().getKey()) .append("` = row.version + 1 "); } queryBuilder.append("DELETE r RETURN ID(r) as ref, ID(r) as id, {type} as type"); List<Map> rows = new ArrayList<>(); for (Edge edge : deletedEdges) { Map<String, Object> rowMap = new HashMap<>(); rowMap.put("relId", edge.getId()); if (edge.hasVersionProperty()) { Property version = edge.getVersion(); rowMap.put((String) version.getKey(), version.getValue()); } rows.add(rowMap); } parameters.put("rows", rows); parameters.put("type", "rel"); } if (firstEdge.hasVersionProperty()) { return statementFactory.statement(queryBuilder.toString(), parameters, true, deletedEdges.size()); } else { return statementFactory.statement(queryBuilder.toString(), parameters); } }</code><technical_language>I choose another name for property name, term version widely in existing databases. Ideally configurable user</technical_language>

Target:
public Statement build() { final Map<String, Object> parameters = new HashMap<>(); final StringBuilder queryBuilder = new StringBuilder(); Edge firstEdge = deletedEdges.iterator().next(); if (deletedEdges != null && deletedEdges.size() > 0) { queryBuilder.append("UNWIND {rows} AS row MATCH ()-[r]-() WHERE ID(r) = row.relId "); if (firstEdge.hasVersionProperty()) { appendVersionPropertyCheck(queryBuilder, firstEdge, "r"); } queryBuilder.append("DELETE r RETURN ID(r) as ref, ID(r) as id, {type} as type"); List<Map> rows = new ArrayList<>(); for (Edge edge : deletedEdges) { Map<String, Object> rowMap = new HashMap<>(); rowMap.put("relId", edge.getId()); if (edge.hasVersionProperty()) { Property version = edge.getVersion(); rowMap.put((String) version.getKey(), version.getValue()); } rows.add(rowMap); } parameters.put("rows", rows); parameters.put("type", "rel"); if (firstEdge.hasVersionProperty()) { OptimisticLockingConfig olConfig = new OptimisticLockingConfig(rows.size(), new String[] { firstEdge.getType() }, firstEdge.getVersion().getKey()); return statementFactory.statement(queryBuilder.toString(), parameters, olConfig); } } return statementFactory.statement(queryBuilder.toString(), parameters); }
Source:
<code><START> public QualityProfileDto selectByNameAndLanguage(String name, String language, DbSession session) { <END> return mapper(session).selectByNameAndLanguage(name, language); }</code><technical_language>![INFO](<LINK_0> 'Severity: INFO') Do forget remove this deprecated code someday. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public QualityProfileDto selectByNameAndLanguage(String name, String language, DbSession session) { return mapper(session).selectByNameAndLanguage(null, name, language); }
Source:
<code>private void advance() { while ((currentIterator == null || !currentIterator.hasNext()) && this.intervals.hasNext()) { if (currentIterator != null) currentCloseableIterator.close(); final Interval interval = this.intervals.next(); final Interval previousInterval = this.lastInterval; this.currentCloseableIterator = this.reader.query(interval.getContig(), interval.getStart(), interval.getEnd()); this.currentIterator = this.currentCloseableIterator.stream().filter ( ctx -> <START> overlapsInterval(ctx, interval) && (null == previousInterval || !overlapsInterval(ctx, previousInterval)) <END> ).iterator(); this.lastInterval = interval; } }</code><technical_language>is overlapsInterval part needed in filter? true due query</technical_language>

Target:
private void advance() { while ((currentIterator == null || !currentIterator.hasNext()) && this.intervals.hasNext()) { if (currentIterator != null) currentCloseableIterator.close(); final Interval interval = this.intervals.next(); final Interval previousInterval = this.lastInterval; this.currentCloseableIterator = this.reader.query(interval.getContig(), interval.getStart(), interval.getEnd()); this.currentIterator = this.currentCloseableIterator.stream().filter ( ctx -> null == previousInterval || !overlapsInterval(ctx, previousInterval) ).iterator(); this.lastInterval = interval; } }
Source:
<code>public Edge(V from, V to, E label) { <START> this.from = from; <END> this.to = to; this.label = label; }</code><technical_language>remove this</technical_language>

Target:
public Edge(V from, V to, E label) { fFrom = from; fTo = to; fLabel = label; }
Source:
<code>public void evaluateRunnable(ThrowableRunnable<Throwable> runnable, ThrowableRunnable<Throwable> finisher) throws Throwable { Throwable error = null; try { runnable.run(); <START> } catch (Throwable t) { <END> error = t; } finally { try { finisher.run(); } catch (Throwable t) { if (error != null) { error.addSuppressed(t); } else { error = t; } } finally { if (error != null) { throw error; } } } }</code><technical_language>I a PITA I InterruptedException dealt specially reset interrupted status</technical_language>

Target:
public void evaluateRunnable(ThrowableRunnable<Throwable> runnable, ThrowableRunnable<Throwable> finisher) throws Throwable { Throwable error = null; try { runnable.run(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeServiceException(e); } catch (Throwable t) { throwSeriousError(t); error = t; } try { finisher.run(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeServiceException(e); } catch (Throwable t) { throwSeriousError(t); if (error == null) { error = t; } else { error.addSuppressed(t); } } if (error != null) { throw error; } }
Source:
<code>public CompletableFuture<URL> getAddress(final String name) { final URL cachedURL = cache.get(name); if(cachedURL != null) { final CompletableFuture<URL> future = new CompletableFuture<>(); future.complete(cachedURL); return future; } else { return httpClient.get(discoveryServiceEndpoint + "/services/" + name).withoutContent().readString().execute().handle((r, e) -> { if (e != null) { throw new DolphinRuntimeException("Can not get address for name " + name, e); } try { <START> URL url = new URL(r.getContent()); <END> cache.put(name, url); return url; } catch (MalformedURLException e1) { throw new DolphinRuntimeException("Can not get address for name " + name, e); } }); } }</code><technical_language>Add final keyword</technical_language>

Target:
public CompletableFuture<URL> getAddress(final String name) { final URL cachedURL = cache.get(name); if(cachedURL != null) { final CompletableFuture<URL> future = new CompletableFuture<>(); future.complete(cachedURL); return future; } else { return httpClient.get(discoveryServiceEndpoint + "/services/" + name).withoutContent().readString().execute().handle((r, e) -> { if (e != null) { throw new DolphinRuntimeException("Can not get address for name " + name, e); } try { final URL url = new URL(r.getContent()); cache.put(name, url); return url; } catch (final MalformedURLException e1) { throw new DolphinRuntimeException("Can not get address for name " + name, e); } }); } }
Source:
<code>public void testSimpleQuery() throws Exception { indexTweeterDocument(1); assertArrayEquals(new String[] { DEFAULT_TABLE_NAME }, dataContext .getDefaultSchema() .getTableNames() .toArray()); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); assertThat(table.getColumnNames(), containsInAnyOrder("_id", "message", "postDate", "user")); assertEquals(ColumnType.STRING, table.getColumnByName("user").getType()); assertEquals(ColumnType.DATE, table.getColumnByName("postDate").getType()); assertEquals(ColumnType.BIGINT, table.getColumnByName("message").getType()); dataContext.refreshSchemas(); <START> try (DataSet ds = dataContext.query().from(DEFAULT_TABLE_NAME).select("user").and("message").execute()) { <END> assertEquals(ElasticSearchRestDataSet.class, ds.getClass()); assertTrue(ds.next()); assertEquals("Row[values=[user1, 1]]", ds.getRow().toString()); } }</code><technical_language>final</technical_language>

Target:
public void testSimpleQuery() throws Exception { indexTweeterDocument(1); assertArrayEquals(new String[] { DEFAULT_TABLE_NAME }, dataContext .getDefaultSchema() .getTableNames() .toArray()); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); assertThat(table.getColumnNames(), containsInAnyOrder("_id", "message", "postDate", "user")); assertEquals(ColumnType.STRING, table.getColumnByName("user").getType()); assertEquals(ColumnType.DATE, table.getColumnByName("postDate").getType()); assertEquals(ColumnType.BIGINT, table.getColumnByName("message").getType()); dataContext.refreshSchemas(); try (final DataSet dataSet = dataContext .query() .from(DEFAULT_TABLE_NAME) .select("user") .and("message") .execute()) { assertEquals(ElasticSearchRestDataSet.class, dataSet.getClass()); assertTrue(dataSet.next()); assertEquals("Row[values=[user1, 1]]", dataSet.getRow().toString()); } }
Source:
<code>protected void executeCommand() { storage_server_connections currConnection = getConnection(); boolean isValidConnection = true; if (getParameters().getVdsId().equals(Guid.Empty)) { for (VDS vds : getAllRunningVdssInPool()) { <START> isValidConnection = isValidConnection && Connect(vds.getId()).getFirst(); <END> } } else { isValidConnection = Connect(getVds().getId()).getFirst(); } if (isValidConnection && (StringUtils.isNotEmpty(currConnection.getid()) || getDbFacade().getStorageServerConnectionDAO().get(currConnection.getid()) == null)) { currConnection.setid(Guid.NewGuid().toString()); getDbFacade().getStorageServerConnectionDAO().save(currConnection); } getReturnValue().setActionReturnValue(getConnection().getid()); setSucceeded(true); }</code><technical_language>added a break;</technical_language>

Target:
protected void executeCommand() { storage_server_connections currConnection = getConnection(); boolean isValidConnection = true; if (getParameters().getVdsId().equals(Guid.Empty)) { for (VDS vds : getAllRunningVdssInPool()) { if (Connect(vds.getId()).getFirst()) { break; } } } else { isValidConnection = Connect(getVds().getId()).getFirst(); } if (isValidConnection && (StringUtils.isNotEmpty(currConnection.getid()) || getDbFacade().getStorageServerConnectionDAO().get(currConnection.getid()) == null)) { currConnection.setid(Guid.NewGuid().toString()); getDbFacade().getStorageServerConnectionDAO().save(currConnection); } getReturnValue().setActionReturnValue(getConnection().getid()); setSucceeded(true); }
Source:
<code>private static boolean docTypeIsPossible(ProzesskopieForm dialog, String docType) { Boolean fieldIsUsed = dialog.getStandardFields().get("doctype"); if (fieldIsUsed == null || fieldIsUsed.equals(Boolean.FALSE)) { <START> logger.warn("Bad argument “docType”: Selected template doesn’t provide the standard field “doctype”."); <END> return false; } boolean valueIsValid; Iterator<ConfigOpacDoctype> configOpacDoctypeIterator = dialog.getAllDoctypes().iterator(); do { ConfigOpacDoctype option = configOpacDoctypeIterator.next(); valueIsValid = docType.equals(option.getTitle()); } while (!valueIsValid && configOpacDoctypeIterator.hasNext()); if (valueIsValid) { return true; } logger.warn("Bad argument “docType”: Selected template doesn’t provide " + "a docType “{0}”.".replace("{0}", docType)); return false; }</code><technical_language>checked if return of this method is in calling methods? - checked if previous thrown exception is handled in calling methods</technical_language>

Target:
private static boolean docTypeIsPossible(ProzesskopieForm dialog, String docType) { Boolean fieldIsUsed = dialog.getStandardFields().get("doctype"); if (fieldIsUsed == null || fieldIsUsed.equals(Boolean.FALSE)) { throw new IllegalArgumentException( "Bad argument “docType”: Selected template doesn’t provide " + "the standard field “doctype”."); } boolean valueIsValid; Iterator<ConfigOpacDoctype> configOpacDoctypeIterator = dialog.getAllDoctypes().iterator(); do { ConfigOpacDoctype option = configOpacDoctypeIterator.next(); valueIsValid = docType.equals(option.getTitle()); } while (!valueIsValid && configOpacDoctypeIterator.hasNext()); if (valueIsValid) { return true; } throw new IllegalArgumentException("Bad argument “docType”: Selected template doesn’t provide " + "a docType “{0}”.".replace("{0}", docType)); }
Source:
<code>private boolean matchesMethod(HttpMethod method, Entry<HttpMethod, ZuulRoute> zuulRoute) { <START> if (method == null) { <END> return true; } return method.equals(zuulRoute.getKey()); }</code><technical_language>is this possible</technical_language>

Target:
private boolean matchesMethod(HttpMethod method, Entry<HttpMethod, ZuulRoute> zuulRoute) { return method.equals(zuulRoute.getKey()); }
Source:
<code><START> public byte[] getKey(ZooKeeperServer zks) { <END> ZKDatabase db = zks.getZKDatabase(); if (db != null) { try { Stat stat = new Stat(); return db.getData("/key", stat, null); } catch (NoNodeException e) { } } return null; }</code><technical_language>Do need this public? I called in handleAuthentication</technical_language>

Target:
private byte[] getKey(ZooKeeperServer zks) { ZKDatabase db = zks.getZKDatabase(); if (db != null) { try { Stat stat = new Stat(); return db.getData("/key", stat, null); } catch (NoNodeException e) { LOG.error("getData failed", e); } } return null; }
Source:
<code>private String createTopic(Datastream datastream) throws TransportException { Properties datastreamProperties = new Properties(); if (datastream.hasMetadata()) { datastreamProperties.putAll(datastream.getMetadata()); } Properties topicProperties = new VerifiableProperties(datastreamProperties).getDomainProperties("topic"); int numberOfPartitions = DEFAULT_NUMBER_PARTITIONS; if (datastream.hasDestination() && datastream.getDestination().hasPartitions()) { numberOfPartitions = datastream.getDestination().getPartitions(); } else if (datastream.hasSource() && datastream.getSource().hasPartitions()) { numberOfPartitions = datastream.getSource().getPartitions(); } String connectionString = _transportProvider.createTopic(getTopicName(datastream), numberOfPartitions, topicProperties); DatastreamDestination destination = new DatastreamDestination(); destination.setConnectionString(connectionString); destination.setPartitions(numberOfPartitions); datastream.setDestination(destination); datastream.getMetadata().put(DatastreamMetadataConstants.DESTINATION_CREATION_MS, <START> String.valueOf(Instant.now().toEpochMilli())); <END> Duration retention = _transportProvider.getRetention(connectionString); if (retention != null) { datastream.getMetadata().put(DatastreamMetadataConstants.DESTINATION_RETENION_MS, String.valueOf(retention.toMillis())); } return connectionString; }</code><technical_language>Is this System.currentTime in milliseconds</technical_language>

Target:
private String createTopic(Datastream datastream) throws TransportException { Properties datastreamProperties = new Properties(); if (datastream.hasMetadata()) { datastreamProperties.putAll(datastream.getMetadata()); } Properties topicProperties = new VerifiableProperties(datastreamProperties).getDomainProperties(DESTINATION_DOMAIN); int numberOfPartitions = DEFAULT_NUMBER_PARTITIONS; if (datastream.hasDestination() && datastream.getDestination().hasPartitions()) { numberOfPartitions = datastream.getDestination().getPartitions(); } else if (datastream.hasSource() && datastream.getSource().hasPartitions()) { numberOfPartitions = datastream.getSource().getPartitions(); } String connectionString = _transportProvider.createTopic(getTopicName(datastream), numberOfPartitions, topicProperties); DatastreamDestination destination = new DatastreamDestination(); destination.setConnectionString(connectionString); destination.setPartitions(numberOfPartitions); datastream.setDestination(destination); datastream.getMetadata().put(DatastreamMetadataConstants.DESTINATION_CREATION_MS, String.valueOf(Instant.now().toEpochMilli())); Duration retention = _transportProvider.getRetention(connectionString); if (retention != null) { datastream.getMetadata().put(DatastreamMetadataConstants.DESTINATION_RETENION_MS, String.valueOf(retention.toMillis())); } return connectionString; }
Source:
<code>public void updateDocument(String entityType, int entityId, int documentId, String name, String desc, File file) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerDocument.updateDocument(entityType, entityId, documentId, name, desc, getRequestFileBody(file)) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<DocumentRelatedResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); <START> if (e instanceof HttpException) { <END> try { String errorMessage = ((HttpException) e).response().errorBody() .string(); getMvpView().showUpdationError(MFErrorParser .parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } else { getMvpView().showUpdationError(e.getLocalizedMessage()); } } @Override public void onNext(DocumentRelatedResponse documentUpdateResponse) { getMvpView().showProgressbar(false); getMvpView().showDocumentUpdatedSuccessfully(documentUpdateResponse); } }) ); }</code><technical_language>@tarun0 this <LINK_0></technical_language>

Target:
public void updateDocument(String entityType, int entityId, int documentId, String name, String desc, File file) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerDocument.updateDocument(entityType, entityId, documentId, name, desc, getRequestFileBody(file)) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<DocumentRelatedResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showUpdationError(MFErrorParser.errorMessage(e)); } @Override public void onNext(DocumentRelatedResponse documentUpdateResponse) { getMvpView().showProgressbar(false); getMvpView().showDocumentUpdatedSuccessfully(documentUpdateResponse); } }) ); }
Source:
<code><START> StopModel getReverseStopID(String stopId, String routeShortName) { <END> List<Criteria> criteria = new ArrayList<>(2); criteria.add(new Criteria("route_short_name", Criteria.Operation.EQ, routeShortName)); criteria.add(new Criteria("stop_id", Criteria.Operation.EQ, stopId)); Cursor cursor = reverseStopCursorAdapterSupplier.getCursor(context, criteria); if (cursor.moveToFirst()) { return reverseStopCursorAdapterSupplier.getCurrentItemFromCursor(cursor); } else { return null; } }</code><technical_language>this private method</technical_language>

Target:
private StopModel getReverseStopID(String stopId, String routeShortName) { List<Criteria> criteria = new ArrayList<>(2); criteria.add(new Criteria("route_short_name", Criteria.Operation.EQ, routeShortName)); criteria.add(new Criteria("stop_id", Criteria.Operation.EQ, stopId)); Cursor cursor = reverseStopCursorAdapterSupplier.getCursor(context, criteria); if (cursor.moveToFirst()) { return reverseStopCursorAdapterSupplier.getCurrentItemFromCursor(cursor); } else { return null; } }
Source:
<code>private void loadState() { String dependValuesStr = OneSignalPrefs.getString(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_USERSTATE_DEPENDVALYES_ + persistKey,null); if (dependValuesStr == null) { dependValues = new JSONObject(); try { int subscribableStatus; boolean userSubscribePref = true; if (persistKey.equals("CURRENT_STATE")) subscribableStatus = OneSignalPrefs.getInt(OneSignalPrefs.PREFS_ONESIGNAL, <START> OneSignalPrefs.PREFS_ONESIGNAL_SUBSCRIPTION,1); <END> else subscribableStatus = OneSignalPrefs.getInt(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_SYNCED_SUBSCRIPTION,1); if (subscribableStatus == PUSH_STATUS_UNSUBSCRIBE) { subscribableStatus = 1; userSubscribePref = false; } dependValues.put("subscribableStatus", subscribableStatus); dependValues.put("userSubscribePref", userSubscribePref); } catch (JSONException e) } else { try { dependValues = new JSONObject(dependValuesStr); } catch (JSONException e) { e.printStackTrace(); } } String syncValuesStr = OneSignalPrefs.getString(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_USERSTATE_SYNCVALYES_ + persistKey,null); try { if (syncValuesStr == null) { syncValues = new JSONObject(); String gtRegistrationId = OneSignalPrefs.getString(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_GT_REGISTRATION_ID,null); syncValues.put("identifier", gtRegistrationId); } else syncValues = new JSONObject(syncValuesStr); } catch (JSONException e) { e.printStackTrace(); } }</code><technical_language>reformat code</technical_language>

Target:
private void loadState() { String dependValuesStr = OneSignalPrefs.getString(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_USERSTATE_DEPENDVALYES_ + persistKey, null); if (dependValuesStr == null) { dependValues = new JSONObject(); try { int subscribableStatus; boolean userSubscribePref = true; if (persistKey.equals(CURRENT_STATE)) subscribableStatus = OneSignalPrefs.getInt(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_SUBSCRIPTION, 1); else subscribableStatus = OneSignalPrefs.getInt(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_SYNCED_SUBSCRIPTION, 1); if (subscribableStatus == PUSH_STATUS_UNSUBSCRIBE) { subscribableStatus = 1; userSubscribePref = false; } dependValues.put(SUBSCRIBABLE_STATUS, subscribableStatus); dependValues.put(UNSUBSCRIBE_PREF, userSubscribePref); } catch (JSONException e) { } } else { try { dependValues = new JSONObject(dependValuesStr); } catch (JSONException e) { e.printStackTrace(); } } String syncValuesStr = OneSignalPrefs.getString(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_ONESIGNAL_USERSTATE_SYNCVALYES_ + persistKey, null); try { if (syncValuesStr == null) { syncValues = new JSONObject(); String gtRegistrationId = OneSignalPrefs.getString(OneSignalPrefs.PREFS_ONESIGNAL, OneSignalPrefs.PREFS_GT_REGISTRATION_ID, null); syncValues.put(IDENTIFIER, gtRegistrationId); } else syncValues = new JSONObject(syncValuesStr); } catch (JSONException e) { e.printStackTrace(); } }
Source:
<code>public void testNullInterfaceReturnsNull() { <START> assertTrue(null <END> == InterfaceParams.getByName(null)); }</code><technical_language>assertNull</technical_language>

Target:
public void testNullInterfaceReturnsNull() { assertNull(InterfaceParams.getByName(null)); }
Source:
<code><START> public void setContent(Simulation simulation) { <END> scenarioGridPanel.getScenarioGrid().setContent(simulation); selectLeftTopCell(); focusGrid(); }</code><technical_language>1. I expected this kind of code in parent component. 2. sight, **BaseGridWidgetKeyboardHandler** handle operation a *different* gridLayer (since operations in constructor) 3. is written, is gridLayer *is not* contained gridPanel 4. this gridPanel, since: alter gridPanel status; a gridPanel' property; is done for other handler (addClickHandler)</technical_language>

Target:
public void setContent(Simulation simulation) { scenarioGridPanel.getScenarioGrid().setContent(simulation); scenarioGridPanel.setFocus(true); }
Source:
<code>public TargetReference build() { String targetName = mapping.getTargetName(); if ( targetName == null ) { return null; } String targetNameTrimmed = targetName.trim(); if ( !targetName.equals( targetNameTrimmed ) ) { <START> messager.printMessage( method.getExecutable(), mapping.getMirror(), mapping.getSourceAnnotationValue(), <END> Message.PROPERTYMAPPING_WHITESPACE_TRIMMED, mapping.getTargetName() ); } String[] segments = targetNameTrimmed.split( "\\." ); Parameter parameter = method.getMappingTargetParameter(); boolean foundEntryMatch; Type resultType = method.getResultType(); String[] targetPropertyNames = segments; List<PropertyEntry> entries = getTargetEntries( resultType, targetPropertyNames ); foundEntryMatch = (entries.size() == targetPropertyNames.length); if ( !foundEntryMatch && segments.length > 1 && matchesSourceOrTargetParameter( segments[0], parameter, reverseSourceParameter, isReverse ) ) { targetPropertyNames = Arrays.copyOfRange( segments, 1, segments.length ); entries = getTargetEntries( resultType, targetPropertyNames ); foundEntryMatch = (entries.size() == targetPropertyNames.length); } if ( !foundEntryMatch && errorMessage != null) { errorMessage.report( isReverse ); } return new TargetReference( parameter, entries, foundEntryMatch ); }</code><technical_language>This needs mapping.getTargetAnnotationValue() instead of mapping.getSourceAnnotationValue(). This property is in Java 8, is correctly Java 9, of us, correctly implemented in JDK then</technical_language>

Target:
public TargetReference build() { String targetName = mapping.getTargetName(); if ( targetName == null ) { return null; } String targetNameTrimmed = targetName.trim(); if ( !targetName.equals( targetNameTrimmed ) ) { messager.printMessage( method.getExecutable(), mapping.getMirror(), mapping.getTargetAnnotationValue(), Message.PROPERTYMAPPING_WHITESPACE_TRIMMED, targetName, targetNameTrimmed ); } String[] segments = targetNameTrimmed.split( "\\." ); Parameter parameter = method.getMappingTargetParameter(); boolean foundEntryMatch; Type resultType = method.getResultType(); String[] targetPropertyNames = segments; List<PropertyEntry> entries = getTargetEntries( resultType, targetPropertyNames ); foundEntryMatch = (entries.size() == targetPropertyNames.length); if ( !foundEntryMatch && segments.length > 1 && matchesSourceOrTargetParameter( segments[0], parameter, reverseSourceParameter, isReverse ) ) { targetPropertyNames = Arrays.copyOfRange( segments, 1, segments.length ); entries = getTargetEntries( resultType, targetPropertyNames ); foundEntryMatch = (entries.size() == targetPropertyNames.length); } if ( !foundEntryMatch && errorMessage != null) { errorMessage.report( isReverse ); } return new TargetReference( parameter, entries, foundEntryMatch ); }