auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Map<String, Float> classify(BufferedImage input) throws Exception { try (Predictor<BufferedImage, Classifications> predictor = model.newPredictor()) { Classifications classifications = predictor.predict(input); List<Classifications.Classification> list = classifications.items(); return list.stream().collect(Collectors.toMap(Classifications.Classification::getClassName, x -> (float) x.getProbability())); <START> } catch (TranslateException e) { <END> throw new TranslateException("Failed to process output", e); } }</code><technical_language>Do need re-throw exception TranslateException</technical_language>

Target:
public Map<String, Float> classify(BufferedImage input) throws Exception { try (Predictor<BufferedImage, Classifications> predictor = model.newPredictor()) { Classifications classifications = predictor.predict(input); List<Classifications.Classification> list = classifications.items(); return list.stream().collect(Collectors.toMap(Classifications.Classification::getClassName, x -> (float) x.getProbability())); } catch (TranslateException e) { LOG.error("Could not process input or output", e); throw new RuntimeException("Could not process input or output", e); } }
Source:
<code><START> public void test() { <END> for (TestBase test : new TestBase[] { basic, cashTerminal }) { current = test; for (DiagCode marker : DiagCode.values()) if (test.getIssueCode2diagnostic().containsKey(marker.diagCode)) for (AbstractValidationDiagnostic d : test .getIssueCode2diagnostic().get(marker.diagCode)) if (d instanceof FeatureBasedDiagnostic) checkDiagnostic((FeatureBasedDiagnostic) d, marker); } }</code><technical_language>This test checks diagnostics expected. fails check if diagnostics missing</technical_language>

Target:
public void test() { for (TestBase test : new TestBase[] { basic, cashTerminal }) { current = test; Set<StateGraphItem> items = new HashSet<StateGraphItem>(); for (ActorClass ac : current.getRoomModel().getActorClasses()) { if (ac.getStateMachine() == null) continue; TreeIterator<EObject> iter = ac.getStateMachine() .eAllContents(); while (iter.hasNext()) { EObject obj = iter.next(); if (obj instanceof StateGraphItem) items.add((StateGraphItem) obj); } } for (DiagCode marker : DiagCode.values()) if (test.getIssueCode2diagnostic().containsKey(marker.diagCode)) for (AbstractValidationDiagnostic d : test .getIssueCode2diagnostic().get(marker.diagCode)) if (d instanceof FeatureBasedDiagnostic) checkDiagnostic((FeatureBasedDiagnostic) d, marker, items); for (StateGraphItem item : items) { Assert.assertTrue(item + " does not have warnings", !item .getName().matches(".*_(vt|vm|rm|sm)+")); } } }
Source:
<code><START> public StreamsProducer(final Producer<byte[], byte[]> producer, final boolean eosEnabled, final LogContext logContext, final String applicationId) { <END> this.log = logContext.logger(getClass()); this.producer = Objects.requireNonNull(producer, "producer cannot be null"); this.applicationId = applicationId; this.eosEnabled = eosEnabled; }</code><technical_language>logContext.logPrefix() format of stream-thread [%s] task [%s] already, log4j entries good. For exception messages, get prefix encode exception message</technical_language>

Target:
public StreamsProducer(final Producer<byte[], byte[]> producer, final boolean eosEnabled, final LogContext logContext, final String applicationId) { log = logContext.logger(getClass()); logPrefix = logContext.logPrefix().trim(); this.producer = Objects.requireNonNull(producer, "producer cannot be null"); this.applicationId = applicationId; this.eosEnabled = eosEnabled; }
Source:
<code>private void getBlobInfoAndCompare(Router router, String blobId, BlobProperties blobProperties, byte[] usermetadata, RouterOperationCallback<BlobInfo> getBlobInfoCallback) throws Exception { Future<BlobInfo> getBlobInfoFuture; if (getBlobInfoCallback == null) { getBlobInfoFuture = router.getBlobInfo(blobId); } else { getBlobInfoFuture = router.getBlobInfo(blobId, getBlobInfoCallback); if (!getBlobInfoCallback.awaitCallback(1, TimeUnit.SECONDS)) { throw new IllegalStateException("getBlobInfo() timed out"); } else if (getBlobInfoCallback.getException() != null) { verifyExceptionMatch(getBlobInfoCallback, getBlobInfoFuture); throw getBlobInfoCallback.getException(); } assertTrue("GetBlobInfo: Future is not done but callback has been received", getBlobInfoFuture.isDone()); assertEquals("GetBlobInfo: Future BlobInfo and callback BlobInfo do not match", getBlobInfoFuture.get(), getBlobInfoCallback.getResult()); } BlobInfo blobInfo = getBlobInfoFuture.get(); compareBlobProperties(blobProperties, blobInfo.getBlobProperties()); <START> byte[] getBlobInfoUserMetadata = blobInfo.getUserMetadata(); <END> assertArrayEquals("User metadata does not match what was put", usermetadata, getBlobInfoUserMetadata); }</code><technical_language>if is a good idea, a similar 'ensure' method for usermetadata blob content for readability below</technical_language>

Target:
private void getBlobInfoAndCompare(Router router, String blobId, BlobProperties blobProperties, byte[] usermetadata, RouterOperationCallback<BlobInfo> getBlobInfoCallback) throws Exception { Future<BlobInfo> getBlobInfoFuture; if (getBlobInfoCallback == null) { getBlobInfoFuture = router.getBlobInfo(blobId); } else { getBlobInfoFuture = router.getBlobInfo(blobId, getBlobInfoCallback); if (getBlobInfoCallback.awaitCallback(1, TimeUnit.SECONDS)) { assertTrue("GetBlobInfo: Future is not done but callback has been received", getBlobInfoFuture.isDone()); if (getBlobInfoCallback.getException() == null) { assertEquals("GetBlobInfo: Future BlobInfo and callback BlobInfo do not match", getBlobInfoFuture.get(), getBlobInfoCallback.getResult()); } else { verifyFutureCallbackExceptionMatch(getBlobInfoCallback, getBlobInfoFuture); throw getBlobInfoCallback.getException(); } } else { throw new IllegalStateException("getBlobInfo() timed out"); } } BlobInfo blobInfo = getBlobInfoFuture.get(); verifyBlobPropertiesMatch(blobProperties, blobInfo.getBlobProperties()); byte[] getBlobInfoUserMetadata = blobInfo.getUserMetadata(); assertArrayEquals("User metadata does not match what was put", usermetadata, getBlobInfoUserMetadata); }
Source:
<code>public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { if (authentication == null) { authentication = ACL.SYSTEM; } if (!ACL.SYSTEM.equals(authentication)) { User user; try { if (authentication == null || authentication instanceof AnonymousAuthenticationToken) { user = null; } else if (authentication == Jenkins.getAuthentication()) { user = User.current(); } else { user = User.get(authentication.getName()); } } catch (NullPointerException e) { LogRecord lr = new LogRecord(Level.FINE, "Could not find user for specified authentication. User credentials lookup aborted"); lr.setThrown(e); lr.setParameters(new Object[]{authentication}); LOGGER.log(lr); user = null; } if (user != null) { UserCredentialsProperty property = user.getProperty(UserCredentialsProperty.class); if (property != null) { boolean needImpersonation = !user.equals(User.current()); SecurityContext old = needImpersonation ? ACL.impersonate(user.impersonate()) : null; try { return DomainCredentials .getCredentials(property.getDomainCredentialsMap(), type, domainRequirements, always()); } finally { if (needImpersonation) { SecurityContextHolder.setContext(old); } } } } } <START> return new ArrayList<>(); <END> }</code><technical_language>suggestion return Collections.emptyList();</technical_language>

Target:
public <C extends Credentials> List<C> getCredentials(@NonNull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication, @NonNull List<DomainRequirement> domainRequirements) { if (authentication == null) { authentication = ACL.SYSTEM; } if (!ACL.SYSTEM.equals(authentication)) { User user; try { if (authentication == null || authentication instanceof AnonymousAuthenticationToken) { user = null; } else if (authentication == Jenkins.getAuthentication()) { user = User.current(); } else { user = User.get(authentication.getName()); } } catch (NullPointerException e) { LogRecord lr = new LogRecord(Level.FINE, "Could not find user for specified authentication. User credentials lookup aborted"); lr.setThrown(e); lr.setParameters(new Object[]{authentication}); LOGGER.log(lr); user = null; } if (user != null) { UserCredentialsProperty property = user.getProperty(UserCredentialsProperty.class); if (property != null) { boolean needImpersonation = !user.equals(User.current()); SecurityContext old = needImpersonation ? ACL.impersonate(user.impersonate()) : null; try { return DomainCredentials .getCredentials(property.getDomainCredentialsMap(), type, domainRequirements, always()); } finally { if (needImpersonation) { SecurityContextHolder.setContext(old); } } } } } return Collections.emptyList(); }
Source:
<code>private void addCriteriaForFlows(final OnmsCriteria criteria, final Boolean hasFlows) { <START> if (hasFlows == null) { <END> return; } criteria.add(Restrictions.eq("node.hasFlows", hasFlows)); }</code><technical_language>This is a duplicated check, this is invoked command.hasFlows() is true, required invoke again. If absolutely want this check, opt for java if (hasFlows != null) { ... } is easier read</technical_language>

Target:
private void addCriteriaForFlows(final OnmsCriteria criteria, final Boolean hasFlows) { criteria.add(Restrictions.eq("node.hasFlows", hasFlows)); }
Source:
<code>private List<UrlInfo> getTargetEndpoints(NhinTargetCommunitiesType targetCommunities) { List<UrlInfo> urlInfoList = null; try { urlInfoList = connectionManager.getEndpointURLFromNhinTargetCommunities(targetCommunities, NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Failed to obtain target URLs for service " <START> + NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME + ex.getMessage(), ex); <END> return null; } return urlInfoList; }</code><technical_language>Needs "getLocalizedMessage()"</technical_language>

Target:
private List<UrlInfo> getTargetEndpoints(NhinTargetCommunitiesType targetCommunities) { List<UrlInfo> urlInfoList = null; try { urlInfoList = connectionManager.getEndpointURLFromNhinTargetCommunities(targetCommunities, NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Failed to obtain target URLs for service " + NhincConstants.PATIENT_DISCOVERY_DEFERRED_RESP_SERVICE_NAME + ex.getLocalizedMessage(), ex); return null; } return urlInfoList; }
Source:
<code>void addVolume(FsVolumeImpl volume) { if (storageTypeVolumeMap.containsKey(volume.getStorageType())) { <START> FsDatasetImpl.LOG.error("Found storage type already exist." + <END> " Skipping for now. Please check disk configuration"); } else { storageTypeVolumeMap.put(volume.getStorageType(), volume); } }</code><technical_language>Do need throw exception here? Silently dropping volume a good option</technical_language>

Target:
boolean addVolume(FsVolumeImpl volume) { if (storageTypeVolumeMap.containsKey(volume.getStorageType())) { FsDatasetImpl.LOG.error("Found storage type already exist." + " Skipping for now. Please check disk configuration"); return false; } storageTypeVolumeMap.put(volume.getStorageType(), volume); return true; }
Source:
<code>public PopupFlagCustomPageIndicatorMenu(Context ctx) { this.contextId = ctx.getId(); this.setText(Constant.messages.getString("custompages.popup.indicator", ctx.getName())); <START> this.addActionListener( <END> new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { performAction(); } }); }</code><technical_language>a lambda e -> performAction()</technical_language>

Target:
public PopupFlagCustomPageIndicatorMenu(Context ctx) { this.contextId = ctx.getId(); this.setText(Constant.messages.getString("custompages.popup.indicator", ctx.getName())); this.addActionListener(event -> performAction()); }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { String key = getRequestParamValue(Const.ParamsNames.REGKEY); Assumption.assertNotNull(key); String institute = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_INSTITUTION); String isSampleDataImported = getRequestParamValue(Const.ParamsNames.IS_SAMPLE_DATA_IMPORTED); new GateKeeper().verifyLoggedInUserPrivileges(); try { if(institute !=null && !institute.isEmpty()){ Assumption.assertNotNull(isSampleDataImported); boolean isSampleImportedBool = true; if(isSampleDataImported.toLowerCase().contains("false")){ isSampleImportedBool = false; <START> } <END> logic.createAccountForNewInstructor(key, account.googleId, institute, isSampleImportedBool); }else{ logic.joinCourseForInstructor(key, account.googleId); } } catch (JoinCourseException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } catch (InvalidParametersException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } final String joinedCourseMsg = "Action Instructor Joins Course" + "<br/>Google ID: " + account.googleId + "<br/>Key : " + StringHelper.decrypt(key); if(statusToAdmin != null) { statusToAdmin += "<br/><br/>" + joinedCourseMsg; } else { statusToAdmin = joinedCourseMsg; } RedirectResult response = createRedirectResult(Const.ActionURIs.INSTRUCTOR_HOME_PAGE); InstructorAttributes instructor = logic.getInstructorForRegistrationKey(key); if(instructor != null) { response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, instructor.courseId); } return response; }</code><technical_language>convert string boolean here? is a do that</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String key = getRequestParamValue(Const.ParamsNames.REGKEY); Assumption.assertNotNull(key); String institute = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_INSTITUTION); String isSampleDataImported = getRequestParamValue(Const.ParamsNames.IS_SAMPLE_DATA_IMPORTED); new GateKeeper().verifyLoggedInUserPrivileges(); try { if(institute !=null && !institute.isEmpty()){ Assumption.assertNotNull(isSampleDataImported); boolean isSampleImportedBool = Boolean.valueOf(isSampleDataImported); logic.createAccountForNewInstructor(key, account.googleId, institute, isSampleImportedBool); }else{ logic.joinCourseForInstructor(key, account.googleId); } } catch (JoinCourseException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } catch (InvalidParametersException e) { setStatusForException(e, e.getMessage()); log.info(e.getMessage()); } final String joinedCourseMsg = "Action Instructor Joins Course" + "<br/>Google ID: " + account.googleId + "<br/>Key : " + StringHelper.decrypt(key); if(statusToAdmin != null) { statusToAdmin += "<br/><br/>" + joinedCourseMsg; } else { statusToAdmin = joinedCourseMsg; } RedirectResult response = createRedirectResult(Const.ActionURIs.INSTRUCTOR_HOME_PAGE); InstructorAttributes instructor = logic.getInstructorForRegistrationKey(key); if(instructor != null) { response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, instructor.courseId); } return response; }
Source:
<code>public void setApplicationName(String applicationName) { <START> this.applicationName = applicationName == null ? "Task-" + hashCode() : <END> applicationName; }</code><technical_language>hash code here? feel right change state of object hash code that. Correct if wrong, calling this method, if name is foo-123 (123 is hash code), if I call hashCode() this object now, I get 123 again. If case, advertise this object's hash code. a random UUID personally..</technical_language>

Target:
public void setApplicationName(String applicationName) { this.applicationName = !StringUtils.hasText(applicationName) ? "Task-" + UUID.randomUUID().toString() : applicationName; }
Source:
<code>public void testNumericLiteralDataType() { m_tester.sql("select * from R2 where si = 5.0 and i = 2 and f = 5.1") .transform("VoltLogicalCalc(expr#0..5=[{inputs}], expr#6=[CAST($t1):DOUBLE], expr#7=[5.0], expr#8=[=($t6, $t7)], " + <START> "expr#9=[2], expr#10=[=($t0, $t9)], expr#11=[5.0], expr#12=[=($t4, $t11)], expr#13=[AND($t8, $t10, $t12)], " + <END> "proj#0..5=[{exprs}], $condition=[$t13])\n" + " VoltLogicalTableScan(table=[[public, R2]])\n") .pass(); }</code><technical_language>s/5.0/5.1/</technical_language>

Target:
public void testNumericLiteralDataType() { m_tester.sql("select * from R2 where si = 5.0 and i = 2 and f = 5.0") .transform("VoltLogicalCalc(expr#0..5=[{inputs}], expr#6=[CAST($t1):DOUBLE], expr#7=[5.0], expr#8=[=($t6, $t7)], " + "expr#9=[2], expr#10=[=($t0, $t9)], expr#11=[5.0], expr#12=[=($t4, $t11)], expr#13=[AND($t8, $t10, $t12)], " + "proj#0..5=[{exprs}], $condition=[$t13])\n" + " VoltLogicalTableScan(table=[[public, R2]])\n") .pass(); }
Source:
<code>public void init(String restServerUrl, ISchedulerClient client) { this.httpEngine = new ApacheHttpClient4Engine(new HttpClientBuilder().disableContentCompression() .useSystemProperties() .build()); this.restDataspaceUrl = restDataspaceUrl(restServerUrl); try { this.sessionId = client.getSession(); } catch (NotConnectedException e) { if (log.isDebugEnabled()) { <START> log.debug("Error client trying to retrieve session from disconnected client"); <END> } throw Throwables.propagate(e); } this.schedulerClient = client; }</code><technical_language>message i is "Error : retrieve session disconnected client." this beat warn level</technical_language>

Target:
public void init(String restServerUrl, ISchedulerClient client) { this.httpEngine = new ApacheHttpClient4Engine(new HttpClientBuilder().disableContentCompression() .useSystemProperties() .build()); this.restDataspaceUrl = restDataspaceUrl(restServerUrl); this.sessionId = client.getSession(); if (log.isDebugEnabled()) { log.debug("Error : trying to retrieve session from disconnected client."); } this.schedulerClient = client; }
Source:
<code><START> public void deregisterToLogReplicationLock() throws Exception { <END> LockClient lockClient = createLockClient(LockStateType.HAS_LEASE); lockClient.deregisterInterest(); }</code><technical_language>add some description? deregister deregister interest for long lease_duration expires means revoke right away</technical_language>

Target:
public void deregisterToLogReplicationLock() throws Exception { LockClient lockClient = LockClient.newInstance(this.lockConfig, logReplicationNodeId, this.lockListener, runtime, Optional.of(LockStateType.HAS_LEASE)); lockClient.deregisterInterest(); }
Source:
<code>protected static JSONObject taskParams(final Activity activity, final Task task) { HashMap<String, JSONObject> params = new HashMap<String, JSONObject>(); ObjectMapper mapper = getNetworkManager(activity).getObjectMapper(); try { JSONObject taskJson = new JSONObject(mapper.writeValueAsString(task)); <START> taskJson.put("due_date", new SimpleDateFormat("yyyy/MM/dd").format(task.getDueDate())); END> params.put("task", taskJson); } catch (Exception e) { e.printStackTrace(); } return new JSONObject(params); }</code><technical_language>it</technical_language>

Target:
protected static JSONObject taskParams(final Activity activity, final Task task) { HashMap<String, JSONObject> params = new HashMap<String, JSONObject>(); ObjectMapper mapper = getNetworkManager(activity).getObjectMapper(); try { JSONObject taskJson = new JSONObject(mapper.writeValueAsString(task)); params.put("task", taskJson); } catch (Exception e) { e.printStackTrace(); } return new JSONObject(params); }
Source:
<code>public boolean canSpawnAt(LocalWorld world, Rotation rotation, int x, int y, int z) { BlockFunction[] blocks = settings.blocks[rotation.getRotationId()]; BO3Check[] checks = settings.bo3Checks[rotation.getRotationId()]; for (BO3Check check : checks) { if (check.preventsSpawn(world, x + check.x, y + check.y, z + check.z)) { return false; } } int blocksOutsideSourceBlock = 0; for (BlockFunction block : blocks) { if (!world.isLoaded(x + block.x, y + block.y, z + block.z)) { return false; } boolean insideSource = false; int blockPresent = world.getTypeId(x + block.x, y + block.y, z + block.z); <START> for (Integer sblock : settings.sourceBlock) <END> { if (sblock == blockPresent) { insideSource = true; break; } } if (!insideSource) { blocksOutsideSourceBlock++; } } if ((((double) blocksOutsideSourceBlock / (double) blocks.length) * 100.0) > settings.maxPercentageOutsideSourceBlock) { return false; } if (!TerrainControl.fireCanCustomObjectSpawnEvent(this, world, x, y, z)) { return false; } return true; }</code><technical_language>settings.sourceBlock.contains(blockPresent)? if (!settings.sourceBlock.contains(world.getTypeId(x + block.x, y + block.y, z + block.z)) {</technical_language>

Target:
public boolean canSpawnAt(LocalWorld world, Rotation rotation, int x, int y, int z) { BlockFunction[] blocks = settings.blocks[rotation.getRotationId()]; BO3Check[] checks = settings.bo3Checks[rotation.getRotationId()]; for (BO3Check check : checks) { if (check.preventsSpawn(world, x + check.x, y + check.y, z + check.z)) { return false; } } int blocksOutsideSourceBlock = 0; for (BlockFunction block : blocks) { if (!world.isLoaded(x + block.x, y + block.y, z + block.z)) { return false; } if (!settings.sourceBlock.contains(world.getTypeId(x + block.x, y + block.y, z + block.z))) { blocksOutsideSourceBlock++; } } if ((((double) blocksOutsideSourceBlock / (double) blocks.length) * 100.0) > settings.maxPercentageOutsideSourceBlock) { return false; } if (!TerrainControl.fireCanCustomObjectSpawnEvent(this, world, x, y, z)) { return false; } return true; }
Source:
<code>@Override protected void executeCommand() { <START> if (getLeaseAction().equals(VDSCommandType.AddVmLease)) { <END> ActionReturnValue retVal = runInternalAction(ActionType.GetVmLeaseInfo, getParameters()); if (retVal.getSucceeded() && retVal.getActionReturnValue() != null) { log.info("VM '{}' lease already exists on storage domain '{}': '{}'", getParameters().getVmId(), getParameters().getStorageDomainId(), retVal.getActionReturnValue()); getParameters().setVmLeaseInfo(retVal.getActionReturnValue()); setSucceeded(true); return; } } super.executeCommand(); }</code><technical_language>I meant block 'if', action type :)</technical_language>

Target:
@Override protected void executeCommand() { ActionReturnValue retVal = runInternalAction(ActionType.GetVmLeaseInfo, getParameters()); if (retVal.getSucceeded() && retVal.getActionReturnValue() != null) { log.info("VM '{}' lease already exists on storage domain '{}': '{}'", getParameters().getVmId(), getParameters().getStorageDomainId(), retVal.getActionReturnValue()); getParameters().setVmLeaseInfo(retVal.getActionReturnValue()); setSucceeded(true); return; } super.executeCommand(); }
Source:
<code>public ERDatabaseAttachment _process(EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete) throws IOException { NSData data = new NSData(uploadedFile.toURI().toURL()); ERDatabaseAttachment attachment = _process(editingContext, data, recommendedFileName, mimeType, configurationName); if (pendingDelete) { <START> uploadedFile.delete(); <END> } return attachment; }</code><technical_language>If line 33 throws error this line reached. Prior this PR delete executed in a finally block</technical_language>

Target:
public ERDatabaseAttachment _process(EOEditingContext editingContext, File uploadedFile, String recommendedFileName, String mimeType, String configurationName, String ownerID, boolean pendingDelete) throws IOException { try { NSData data = new NSData(uploadedFile.toURI().toURL()); ERDatabaseAttachment attachment = _process(editingContext, data, recommendedFileName, mimeType, configurationName); return attachment; } finally { if (pendingDelete) { uploadedFile.delete(); } } }
Source:
<code>public RuleAssert overrideStats(String nodeId, PlanNodeStatsEstimate nodeStats) { <START> ((TestingStatsCalculator) statsCalculator).setNodeStats(new PlanNodeId(nodeId), nodeStats); <END> return this; }</code><technical_language>cast is longer needed</technical_language>

Target:
public RuleAssert overrideStats(String nodeId, PlanNodeStatsEstimate nodeStats) { statsCalculator.setNodeStats(new PlanNodeId(nodeId), nodeStats); return this; }
Source:
<code>public static void beforeClass() throws Exception { adminSynapse = new SynapseAdminClientImpl(); SynapseClientHelper.setEndpoints(adminSynapse); adminSynapse.setUsername(StackConfigurationSingleton.singleton().getMigrationAdminUsername()); adminSynapse.setApiKey(StackConfigurationSingleton.singleton().getMigrationAdminAPIKey()); <START> synapse = new SynapseClientImpl(); <END> userId = SynapseClientHelper.createUser(adminSynapse, synapse); }</code><technical_language>setting endpoints for this client</technical_language>

Target:
public static void beforeClass() throws Exception { adminSynapse = new SynapseAdminClientImpl(); SynapseClientHelper.setEndpoints(adminSynapse); adminSynapse.setUsername(StackConfigurationSingleton.singleton().getMigrationAdminUsername()); adminSynapse.setApiKey(StackConfigurationSingleton.singleton().getMigrationAdminAPIKey()); synapse = new SynapseClientImpl(); userId = SynapseClientHelper.createUser(adminSynapse, synapse); SynapseClientHelper.setEndpoints(synapse); }
Source:
<code>private boolean verifyMetricsFromSinkOnce(Map<String, Long> expectedMetrics) { synchronized (GlobalPhoenixMetricsTestSink.lock) { for (AbstractMetric metric : GlobalPhoenixMetricsTestSink.metrics) { if (expectedMetrics.containsKey(metric.name())) { Long value = expectedMetrics.get(metric.name()); if (value != null) { long expectedValue = value; long actualValue = metric.value().longValue(); if (expectedValue != actualValue) { LOG.warn("Metric from Hadoop Sink: " + metric.name() + " didn't match expected."); <START> LOG.warn("Expected: " + expectedValue + " Actual: " + actualValue); <END> return false; } expectedMetrics.remove(metric.name()); } } } } assertTrue("Metric expected but not present in Hadoop Metrics Sink (GlobalPhoenixMetricsTestSink)", expectedMetrics.size() == 0); return true; }</code><technical_language>remove this log line merge previous one, difficult comprehend log lines together</technical_language>

Target:
private boolean verifyMetricsFromSinkOnce(Map<String, Long> expectedMetrics) { synchronized (GlobalPhoenixMetricsTestSink.lock) { for (AbstractMetric metric : GlobalPhoenixMetricsTestSink.metrics) { if (expectedMetrics.containsKey(metric.name())) { Long value = expectedMetrics.get(metric.name()); if (value != null) { long expectedValue = value; long actualValue = metric.value().longValue(); if (expectedValue != actualValue) { LOG.warn("Metric from Hadoop Sink: " + metric.name() + " didn't match expected."); return false; } expectedMetrics.remove(metric.name()); } } } } assertTrue("Metric expected but not present in Hadoop Metrics Sink (GlobalPhoenixMetricsTestSink)", expectedMetrics.size() == 0); return true; }
Source:
<code>private boolean isUpgradeButtonAvailable(int position) { long currentPlanProductId = WordPress.wpDB.getPlanIdForLocalTableBlogId(mLocalBlogID); if (isBuyButtonAvailable(position) || PlansUtils.isFreePlan(currentPlanProductId)) { return false; } final Plan plan = getPageAdapter().getPlan(position); <START> if (PlansUtils.isFreePlan(plan) || currentPlanProductId > plan.getProductID()) { <END> return false; } return plan.isAvailable() && !plan.isCurrentPlan(); }</code><technical_language>hard-code currentPlanProductId > plan.getProductID(), I a helper routine checks if plan is "greater" another. this earlier on, added avoid sprinkling code assumptions a greater plan ID meant a more expensive plan</technical_language>

Target:
private boolean isUpgradeButtonAvailable(int position) { long currentPlanProductId = WordPress.wpDB.getPlanIdForLocalTableBlogId(mLocalBlogID); if (isBuyButtonAvailable(position) || PlansUtils.isFreePlan(currentPlanProductId)) { return false; } Plan currentPlan = PlansUtils.getPlan(mAvailablePlans, currentPlanProductId); if (currentPlan == null) { AppLog.w(AppLog.T.PLANS, "Blog's current plan with ID " + currentPlanProductId + "is not available anymore on wpcom!"); return false; } final Plan selectedPlan = getPageAdapter().getPlan(position); if (PlansUtils.isGreaterEquals(currentPlan, selectedPlan)) { return false; } return selectedPlan.isAvailable() && !selectedPlan.isCurrentPlan(); }
Source:
<code>public synchronized JDBCConfiguration getJDBCDiskQuotaConfig() throws IOException, org.geowebcache.config.ConfigurationException { Resource configFile = configDir.get("geowebcache-diskquota-jdbc.xml"); if (!Resources.exists(configFile)) { return null; } try { JDBCConfiguration configuration; InputStream is = configFile.in(); try { configuration = JDBCConfiguration.load(is); } finally { is.close(); <START> } <END> return passwordHelper.unencryptPassword(configuration); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to load geowebcache-diskquota-jdbc.xml", e); return null; } }</code><technical_language>try-with-resources</technical_language>

Target:
public synchronized JDBCConfiguration getJDBCDiskQuotaConfig() throws IOException, org.geowebcache.config.ConfigurationException { Resource configFile = configDir.get("geowebcache-diskquota-jdbc.xml"); if (!Resources.exists(configFile)) { return null; } try { JDBCConfiguration configuration; try (InputStream is = configFile.in()) { configuration = JDBCConfiguration.load(is); } return passwordHelper.unencryptPassword(configuration); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to load geowebcache-diskquota-jdbc.xml", e); return null; } }
Source:
<code>private CompletableFuture<Void> handleBatchRequest(TransferBatchRequest request, CompletableFuture<Void> allFutures, Semaphore semaphore) throws InterruptedException { if (request.getBatchType() == SEGMENT_INIT) { int numPermits = request.getDestinationNodes() .map(AbstractCollection::size).orElse(1) * NUM_REQUESTS_PER_NODE; if (numPermits == 0) { throw new IllegalStateException("Number of permits should be equal to" + " at least one."); } log.trace("Starting a new segment transfer. Parallelism level: {}", numPermits); semaphore.drainPermits(); semaphore.release(numPermits); } else if (request.getBatchType() == DATA) { semaphore.acquire(); CompletableFuture<Void> batchTransferResult = stateTransferBatchProcessor .transfer(request) .thenApply(response -> { semaphore.release(); if (response.getStatus() == SUCCEEDED) { return null; } else if (response.getStatus() == FAILED && response.getCauseOfFailure().isPresent()) { throw response.getCauseOfFailure().get(); } else { throw new StateTransferBatchProcessorException(); } }); <START> allFutures = CFUtils.allOfOrTerminateExceptionally(allFutures, batchTransferResult); <END> } else { throw new IllegalStateException("Unrecognized batch type: " + request.getBatchType()); } return allFutures; }</code><technical_language>I this solve problem have. is impl of CFUtils.allOfOrTerminateExceptionally: java CompletableFuture<Void> result = CompletableFuture.allOf(futures); for (CompletableFuture<?> future : futures) { future.handle((res, ex) -> ex == null || result.completeExceptionally(ex)); } suppose this is current allFutures structure: a3<a2<a1<f0, f1>, f2>, f3> a_i means allFuture, f_i means individual transfer future. If f1 fails this moment, cancel a1, f2 f3 finished yet, a1 is exceptionally completedly, curerrnt allFuture, i.e. a3 waits f2 f3 finishes. if more futures, able jump out of loop, right</technical_language>

Target:
private CompletableFuture<Void> handleBatchRequest(TransferBatchRequest request, CompletableFuture<Void> allFutures, Semaphore semaphore) throws InterruptedException { semaphore.acquire(); CompletableFuture<Void> batchTransferResult = stateTransferBatchProcessor .transfer(request) .thenApply(response -> { semaphore.release(); if (response.getStatus() == SUCCEEDED) { return null; } else if (response.getStatus() == FAILED && response.getCauseOfFailure().isPresent()) { throw response.getCauseOfFailure().get(); } else { throw new StateTransferBatchProcessorException(); } }); allFutures = CFUtils.allOfOrTerminateExceptionally(allFutures, batchTransferResult); return allFutures; }
Source:
<code>CircuitBreakerRegistry createCircuitBreakerRegistry( CircuitBreakerConfigurationProperties circuitBreakerProperties, RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer, CompositeCustomizer<CircuitBreakerConfigCustomizer> customizerMap) { Map<String, CircuitBreakerConfig> configs = circuitBreakerProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> circuitBreakerProperties .createCircuitBreakerConfig(entry.getKey(), entry.getValue(), customizerMap))); <START> return CircuitBreakerRegistry.of(configs, circuitBreakerRegistryEventConsumer, circuitBreakerProperties.getTags()); <END> }</code><technical_language>I create a defensive copy of Map</technical_language>

Target:
CircuitBreakerRegistry createCircuitBreakerRegistry( CircuitBreakerConfigurationProperties circuitBreakerProperties, RegistryEventConsumer<CircuitBreaker> circuitBreakerRegistryEventConsumer, CompositeCustomizer<CircuitBreakerConfigCustomizer> customizerMap) { Map<String, CircuitBreakerConfig> configs = circuitBreakerProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> circuitBreakerProperties .createCircuitBreakerConfig(entry.getKey(), entry.getValue(), customizerMap))); return CircuitBreakerRegistry.of(configs, circuitBreakerRegistryEventConsumer, Map.copyOf(circuitBreakerProperties.getTags())); }
Source:
<code>public synchronized Configuration getUserCmpTaskConf() { final String initialWorkloadStr; final String computationSpeedStr; try { if (bufferedReader == null) { <START> bufferedReader = new BufferedReader(new FileReader(confFile)); <END> } final String str = bufferedReader.readLine(); if (str == null) { initialWorkloadStr = "0"; computationSpeedStr = "1.0"; } else { final String[] args = str.trim().split("\\s+"); initialWorkloadStr = args[0]; final int initialWorkload = Integer.parseInt(initialWorkloadStr); if (initialWorkload < 0) { throw new RuntimeException(String.format("Initial workload is negative %d", initialWorkload)); } computationSpeedStr = args[1]; final float computationSpeed = Float.parseFloat(computationSpeedStr); if (computationSpeed < 0) { throw new RuntimeException(String.format("Computation speed is negative %f", computationSpeed)); } } } catch (final FileNotFoundException e) { throw new RuntimeException(String.format("No file named %s", confFile), e); } catch (final IOException e) { throw new RuntimeException(String.format("Failed to read line from %s", confFile), e); } catch (final NumberFormatException e) { throw new RuntimeException(String.format("Failed to parse integer or float from %s", confFile), e); } return Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(InitialWorkload.class, initialWorkloadStr) .bindNamedParameter(ComputationSpeed.class, computationSpeedStr) .build(); }</code><technical_language>If this happen once, belongs in constructor (and bufferedReader final)</technical_language>

Target:
public Configuration getUserCmpTaskConf() { final String initialWorkloadStr; final String computationRateStr; final String str = readLineFromFile(); if (str == null) { return Tang.Factory.getTang().newConfigurationBuilder().build(); } else { final String[] args = str.split("\\s+"); initialWorkloadStr = args[0]; final int initialWorkload = Integer.parseInt(initialWorkloadStr); if (initialWorkload < 0) { throw new RuntimeException(String.format("Initial workload is negative %d", initialWorkload)); } computationRateStr = args[1]; final long computationRate = Long.parseLong(computationRateStr); if (computationRate < 0) { throw new RuntimeException(String.format("Computation rate is negative %d", computationRate)); } } return Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(InitialWorkload.class, initialWorkloadStr) .bindNamedParameter(ComputationRate.class, computationRateStr) .build(); }
Source:
<code>public Object register(Object obj, Runnable action) { try { return createMtd.invoke(null, obj, action); } catch (IllegalAccessException | InvocationTargetException e) { <START> e.printStackTrace(); <END> throw new RuntimeException("Reflection failure: invoke sun.misc.Cleaner.create method failed", e); } }</code><technical_language>print stack trace if rethrow a</technical_language>

Target:
public Object register(Object obj, Runnable action) { try { return createMtd.invoke(null, obj, action); } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException("Reflection failure: invoke sun.misc.Cleaner.create method failed", e); } }
Source:
<code>public static boolean canBeDynamic() { Bundle uiWorkbenchBundle = Platform.getBundle("org.eclipse.ui.workbench"); Version junoStart = Version.parseVersion("3.103"); Version lunaStart = Version.parseVersion("3.106"); <START> return uiWorkbenchBundle != null && uiWorkbenchBundle.getVersion().compareTo(junoStart) < 0 && uiWorkbenchBundle.getVersion().compareTo(lunaStart) >= 0; <END> }</code><technical_language>Ranges.open(junoStart, lunaStart).contains(version) for more readable code. of open(), closed(), opendClosed() etc. is needed here</technical_language>

Target:
public static boolean canBeDynamic() { Bundle uiWorkbenchBundle = Platform.getBundle("org.eclipse.ui.workbench"); Version junoStart = Version.parseVersion("3.103"); Version lunaStart = Version.parseVersion("3.106"); return uiWorkbenchBundle != null && !Ranges.closedOpen(junoStart, lunaStart).contains(uiWorkbenchBundle.getVersion()); }
Source:
<code>private String flattenList(List<?> list) { if (list.size() == 1) { return list.get(0).toString(); } if (list.size() > 1) { <START> logger.warn("The JsonPath expression yielded more than one result: {}", list); <END> } return UnDefType.NULL.toFullString(); }</code><technical_language>Imho this error imply NULL is returned... end user supposed do here</technical_language>

Target:
private String flattenList(List<?> list) { if (list.size() == 1) { return list.get(0).toString(); } if (list.size() > 1) { logger.warn( "JsonPath expressions with more than one result are not allowed, please adapt your selector. Result: {}", list); } return UnDefType.NULL.toFullString(); }
Source:
<code>public static BloomFilterReader getBloomFilterReader(PinotDataBuffer dataBuffer) { <START> int typeValue = dataBuffer.getInt(0); <END> int version = dataBuffer.getInt(4); Preconditions.checkState(typeValue == 1 && version == 1); return new OffHeapGuavaBloomFilterReader(dataBuffer.view(8, dataBuffer.size())); }</code><technical_language>0, 4 static final variable? e.g. TYPE_VALUE_OFFSET, VERSION_OFFSET</technical_language>

Target:
public static BloomFilterReader getBloomFilterReader(PinotDataBuffer dataBuffer) { int typeValue = dataBuffer.getInt(TYPE_VALUE_OFFSET); int version = dataBuffer.getInt(VERSION_OFFSET); Preconditions.checkState( typeValue == OnHeapGuavaBloomFilterCreator.TYPE_VALUE && version == OnHeapGuavaBloomFilterCreator.VERSION, "Unsupported bloom filter type value: %s and version: %s", typeValue, version); return new OffHeapGuavaBloomFilterReader(dataBuffer.view(HEADER_SIZE, dataBuffer.size())); }
Source:
<code>public ConnectionAnchor(Block block) { this.block = block; this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handleMousePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, this::handleMouseDrag); this.addEventHandler(MouseEvent.MOUSE_RELEASED, this::handleMouseRelease); this.addEventHandler(TouchEvent.TOUCH_PRESSED, this::handleTouchPress); this.addEventHandler(TouchEvent.TOUCH_MOVED, this::handleTouchMove); <START> this.addEventHandler(TouchEvent.TOUCH_RELEASED, this::handleTouchRelease); <END> }</code><technical_language>This opportunity names for more consistent: this handleFoo, other bits onFoo</technical_language>

Target:
public ConnectionAnchor(Block block) { this.block = block; this.addEventHandler(MouseEvent.MOUSE_PRESSED, this::handleMousePress); this.addEventHandler(MouseEvent.MOUSE_DRAGGED, event -> { if (this.wireInProgress != null && !event.isSynthesized()) { this.wireInProgress.handleMouseDrag(event); } }); this.addEventHandler(MouseEvent.MOUSE_RELEASED, event -> { if (this.wireInProgress != null && !event.isSynthesized()) { this.wireInProgress.handleMouseRelease(event); } }); this.addEventHandler(TouchEvent.TOUCH_PRESSED, this::handleTouchPress); this.addEventHandler(TouchEvent.TOUCH_MOVED, event -> { if (this.wireInProgress != null) { this.wireInProgress.handleTouchMove(event); } }); this.addEventHandler(TouchEvent.TOUCH_RELEASED, event -> { if (this.wireInProgress != null) { this.wireInProgress.handleTouchRelease(event); } }); }
Source:
<code>private Mono<CosmosDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options, Context context) { <START> String spanName = "createDatabase." + database.getId(); <END> Mono<CosmosDatabaseResponse> responseMono = createDatabaseInternal(database, options); return tracerProvider.traceEnabledCosmosResponsePublisher(responseMono, context, spanName, database.getId(), this.serviceEndpoint); }</code><technical_language>store database.getId() in a variable. Also, some places below</technical_language>

Target:
private Mono<CosmosDatabaseResponse> createDatabaseInternal(Database database, CosmosDatabaseRequestOptions options, Context context) { String spanName = "createDatabase." + database.getId(); Mono<CosmosDatabaseResponse> responseMono = asyncDocumentClient.createDatabase(database, ModelBridgeInternal.toRequestOptions(options)) .map(databaseResourceResponse -> ModelBridgeInternal.createCosmosDatabaseResponse(databaseResourceResponse)) .single(); return tracerProvider.traceEnabledCosmosResponsePublisher(responseMono, context, spanName, database.getId(), this.serviceEndpoint); }
Source:
<code><START> static public int getRapidDefaultReadNameRegexSplit(final String readName, final char delim, final int[] tokens) { <END> int tokensIdx = 0; int prevIdx = 0; for (int i = 0; i < readName.length(); i++) { if (readName.charAt(i) == delim) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, i)); tokensIdx++; if (4 < tokensIdx) return tokensIdx; prevIdx = i + 1; } } if (prevIdx < readName.length()) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, readName.length())); tokensIdx++; } return tokensIdx; }</code><technical_language>Nitpick: Java Language Specification [says](<LINK_0> "it is customary, required" order of class modifiers public static</technical_language>

Target:
public static int getRapidDefaultReadNameRegexSplit(final String readName, final char delim, final int[] tokens) { int tokensIdx = 0; int prevIdx = 0; for (int i = 0; i < readName.length(); i++) { if (readName.charAt(i) == delim) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, i)); tokensIdx++; if (4 < tokensIdx) return tokensIdx; prevIdx = i + 1; } } if (prevIdx < readName.length()) { if (1 < tokensIdx && tokensIdx < 5) tokens[tokensIdx] = rapidParseInt(readName.substring(prevIdx, readName.length())); tokensIdx++; } return tokensIdx; }
Source:
<code>private void startProcessMonitor() { this.getTaskExecutor().execute(() -> { Process process = OSDelegatingFileTailingMessageProducer.this.process; if (process == null) { if (logger.isDebugEnabled()) { logger.debug("Process destroyed before starting process monitor"); } return; } <START> int result = Integer.MIN_VALUE; <END> try { if (logger.isDebugEnabled()) { logger.debug("Monitoring process " + process); } result = process.waitFor(); if (logger.isInfoEnabled()) { logger.info("tail process terminated with value " + result); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.error("Interrupted - stopping adapter", e); stop(); } finally { destroyProcess(); } if (isRunning()) { if (logger.isInfoEnabled()) { logger.info("Restarting tail process in " + getMissingFileDelay() + " milliseconds"); } this.getRequiredTaskScheduler() .schedule(this::runExec, new Date(System.currentTimeMillis() + getMissingFileDelay())); } }); }</code><technical_language>OK. I is root of getRequiredTaskScheduler(). a decision is same: reuse TaskScheduler application context</technical_language>

Target:
private void startProcessMonitor() { this.getTaskExecutor().execute(() -> { Process process = OSDelegatingFileTailingMessageProducer.this.process; if (process == null) { if (logger.isDebugEnabled()) { logger.debug("Process destroyed before starting process monitor"); } return; } int result = Integer.MIN_VALUE; try { if (logger.isDebugEnabled()) { logger.debug("Monitoring process " + process); } result = process.waitFor(); if (logger.isInfoEnabled()) { logger.info("tail process terminated with value " + result); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.error("Interrupted - stopping adapter", e); stop(); } finally { destroyProcess(); } if (isRunning()) { if (logger.isInfoEnabled()) { logger.info("Restarting tail process in " + getMissingFileDelay() + " milliseconds"); } getTaskScheduler() .schedule(this::runExec, new Date(System.currentTimeMillis() + getMissingFileDelay())); } }); }
Source:
<code>public void onBindViewHolder(@NonNull LanguageViewHolder holder, int position) { String languageName = WikipediaApp.getInstance().getAppLanguageLocalizedName(items.get(position)); <START> holder.languageName.setText(String.format(getContext().getString(R.string.multilingual_onboarding_laguage_string), String.valueOf(position + 1), languageName == null ? items.get(position) : languageName)); <END> }</code><technical_language>This line need additional logic for unsupporting languages. updated patch fix it. Please try rebase patch, thanks</technical_language>

Target:
public void onBindViewHolder(@NonNull LanguageViewHolder holder, int position) { String languageName = WikipediaApp.getInstance().getAppLanguageLocalizedName(items.get(position)); holder.languageName.setText(String.format(getContext().getString(R.string.multilingual_onboarding_laguage_string), String.valueOf(position + 1), languageName)); }
Source:
<code>private AbstractTreeIterator combineDF(final AbstractTreeIterator minRef) throws CorruptObjectException { AbstractTreeIterator treeMatch = null; for (final AbstractTreeIterator t : trees) { if (t.matches == minRef || t.eof()) continue; for (;;) { final int cmp = t.pathCompare(minRef, TREE_MODE); if (cmp < 0) { t.matchShift++; t.next(1); if (t.eof()) { t.back(t.matchShift); t.matchShift = 0; break; } } else if (cmp == 0) { t.matches = minRef; treeMatch = t; break; } else { if (t.matchShift != 0) { t.back(t.matchShift); t.matchShift = 0; } break; } } } if (treeMatch != null) { for (final AbstractTreeIterator t : trees) if (t.matches == minRef) t.matches = treeMatch; <START> if (dfConflict == null && !isGitlink(minRef)) <END> dfConflict = treeMatch; return treeMatch; } return minRef; }</code><technical_language>missing braces</technical_language>

Target:
private AbstractTreeIterator combineDF(final AbstractTreeIterator minRef) throws CorruptObjectException { AbstractTreeIterator treeMatch = null; for (final AbstractTreeIterator t : trees) { if (t.matches == minRef || t.eof()) continue; for (;;) { final int cmp = t.pathCompare(minRef, TREE_MODE); if (cmp < 0) { t.matchShift++; t.next(1); if (t.eof()) { t.back(t.matchShift); t.matchShift = 0; break; } } else if (cmp == 0) { t.matches = minRef; treeMatch = t; break; } else { if (t.matchShift != 0) { t.back(t.matchShift); t.matchShift = 0; } break; } } } if (treeMatch != null) { for (final AbstractTreeIterator t : trees) if (t.matches == minRef) t.matches = treeMatch; if (dfConflict == null && !isGitlink(minRef)) { dfConflict = treeMatch; } return treeMatch; } return minRef; }