auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Date addToDate(Date startDate, OrderFrequency frequency) { if (SECONDS_CODE.equals(code)) return DateUtils.addSeconds(startDate, duration); if (MINUTES_CODE.equals(code)) return DateUtils.addMinutes(startDate, duration); if (HOURS_CODE.equals(code)) return DateUtils.addHours(startDate, duration); if (DAYS_CODE.equals(code)) return DateUtils.addDays(startDate, duration); if (WEEKS_CODE.equals(code)) return DateUtils.addWeeks(startDate, duration); if (MONTHS_CODE.equals(code)) return DateUtils.addMonths(startDate, duration); if (YEARS_CODE.equals(code)) return DateUtils.addYears(startDate, duration); if (RECURRING_INTERVAL_CODE.equals(code)) { <START> return DateUtils.addSeconds(startDate, (int) (duration * SECONDS_PER_DAY / frequency.getFrequencyPerDay())); <END> } return null; }</code><technical_language>I thought duration days i assumes is in days</technical_language>

Target:
public Date addToDate(Date startDate, OrderFrequency frequency) { if (SECONDS_CODE.equals(code)) return DateUtils.addSeconds(startDate, duration); if (MINUTES_CODE.equals(code)) return DateUtils.addMinutes(startDate, duration); if (HOURS_CODE.equals(code)) return DateUtils.addHours(startDate, duration); if (DAYS_CODE.equals(code)) return DateUtils.addDays(startDate, duration); if (WEEKS_CODE.equals(code)) return DateUtils.addWeeks(startDate, duration); if (MONTHS_CODE.equals(code)) return DateUtils.addMonths(startDate, duration); if (YEARS_CODE.equals(code)) return DateUtils.addYears(startDate, duration); if (RECURRING_INTERVAL_CODE.equals(code)) { if (frequency == null) throw new APIException("Frequency can not be null when duration in Recurring Interval"); return DateUtils.addSeconds(startDate, (int) (duration * SECONDS_PER_DAY / frequency.getFrequencyPerDay())); } throw new APIException(String.format("Unknown code '%s' for ISO8601 duration units", code)); }
Source:
<code>protected boolean validate() { boolean returnValue = true; if (Guid.Empty.equals(getVmId())) { addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_NO_AVAILABLE_POOL_VMS); returnValue = false; } if (returnValue) { List<VM> vmsForUser = getVmDao().getAllForUser(getAdUserId()); int vmCount = 0; for (VM vm : vmsForUser) { if (vm.getVmPoolId() != null && getVmPoolId().equals(vm.getVmPoolId())) { vmCount++; } } int limit = getVmPool().getMaxAssignedVmsPerUser(); if (vmCount >= limit) { addValidationMessage(EngineMessage.VM_POOL_CANNOT_ATTACH_TO_MORE_VMS_FROM_POOL); returnValue = false; } } if (!returnValue) { setActionMessageParameters(); <START> vmPoolHandler.releaseVm(getVmId(), !isVmPrestarted()); <END> } return returnValue; }</code><technical_language>pass lock this command (setLock) rely freeLock release instead? I prefer modify this method early-return statements day.</technical_language>

Target:
protected boolean validate() { boolean returnValue = true; if (getVmPool() == null) { addValidationMessage(EngineMessage.VM_POOL_NOT_FOUND); returnValue = false; } if (returnValue && Guid.Empty.equals(getVmId())) { addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_NO_AVAILABLE_POOL_VMS); returnValue = false; } if (returnValue) { List<VM> vmsForUser = getVmDao().getAllForUser(getAdUserId()); int vmCount = 0; for (VM vm : vmsForUser) { if (vm.getVmPoolId() != null && getVmPoolId().equals(vm.getVmPoolId())) { vmCount++; } } int limit = getVmPool().getMaxAssignedVmsPerUser(); if (vmCount >= limit) { addValidationMessage(EngineMessage.VM_POOL_CANNOT_ATTACH_TO_MORE_VMS_FROM_POOL); returnValue = false; } } if (!returnValue) { setActionMessageParameters(); } return returnValue; }
Source:
<code>public UserLogin login(Login login) { Session session = this.sessionFactory.getCurrentSession(); Query query = session.createQuery("from UserLogin where userName = :userName"); query.setParameter("userName", login.getUserName()); <START> List list = query.list(); <END> if (!list.isEmpty() && list.get(0) != null) { return (UserLogin) list.get(0); } else { return null; } }</code><technical_language>asking for a list here? query.uniqueResult()</technical_language>

Target:
public UserLogin login(Login login) { Session session = null; UserLogin userLogin = null; Query query = null; try { session = this.sessionFactory.getCurrentSession(); query = session.createQuery("from UserLogin where userName = :userName"); query.setParameter("userName", login.getUserName()); userLogin = (UserLogin) query.uniqueResult(); } catch (HibernateException e) { LOG.error("Exception during query execution by: " + e.getMessage(), e); } finally { closeSession(session, false); } return userLogin; }
Source:
<code>public Serializable execute(TaskResult... results) throws IOException { File file = new File(outputPath); containerURL = AzureStorageConnectorUtils.createContainerURL(storageAccount, accountKey, containerName); if (optionalBlobName.isPresent()) { String azureBlobLocalRelativePath = Paths.get(outputPath, Paths.get(optionalBlobName.get()).getFileName().toString()) .toString(); if (outputPath.endsWith(File.separator)) { SchedulerExamplesUtils.createDirIfNotExists(file); downloadBlob(new File(azureBlobLocalRelativePath), optionalBlobName.get()); } else if (outputPath.equals(getLocalSpace())) { <START> downloadBlob(new File(azureBlobLocalRelativePath), optionalBlobName.get()); <END> } else { downloadBlob(file, optionalBlobName.get()); } } else { SchedulerExamplesUtils.createDirIfNotExists(file); downloadContainerBlobs(containerURL); } return (Serializable) Arrays.asList(outputPath); }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Call "optionalBlobName.isPresent()" accessing value. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public Serializable execute(TaskResult... results) throws IOException { File file = new File(outputPath); containerURL = AzureStorageConnectorUtils.createContainerURL(storageAccount, accountKey, containerName); if (optionalBlobName.isPresent()) { String azureBlobLocalRelativePath = Paths.get(outputPath, Paths.get(optionalBlobName.get()).getFileName().toString()) .toString(); if (SchedulerExamplesUtils.isDirectoryPath(outputPath)) { SchedulerExamplesUtils.createDirIfNotExists(file); downloadBlob(new File(azureBlobLocalRelativePath), optionalBlobName.get()); } else if (outputPath.equals(getLocalSpace())) { downloadBlob(new File(azureBlobLocalRelativePath), optionalBlobName.get()); } else { downloadBlob(file, optionalBlobName.get()); } } else { SchedulerExamplesUtils.createDirIfNotExists(file); downloadContainerBlobs(containerURL); } return (Serializable) Arrays.asList(outputPath); }
Source:
<code>public CompletableFuture<Boolean> checkAndUpdateConfigMap( String configMapName, Function<KubernetesConfigMap, Optional<KubernetesConfigMap>> function) { return FutureUtils.retry( () -> CompletableFuture.supplyAsync( () -> getConfigMap(configMapName) .map( configMap -> function.apply(configMap).map( updatedConfigMap -> { try { this.internalClient.configMaps() .inNamespace(namespace) .withName(configMapName) .lockResourceVersion(updatedConfigMap.getResourceVersion()) .replace(updatedConfigMap.getInternalResource()); } catch (Throwable throwable) { LOG.debug("Failed to update ConfigMap with data because of concurrent " + "modifications. Trying again.", configMap.getName(), configMap.getData()); throw throwable; } return true; }).orElse(false)) .orElseThrow(() -> new CompletionException( <START> new KubernetesException("Not retry since " + configMapName + " does not exist."))), <END> kubeClientExecutorService), maxRetryAttempts, throwable -> ExceptionUtils.findThrowable(throwable, KubernetesClientException.class).isPresent(), kubeClientExecutorService); }</code><technical_language>Maybe: "Cannot retry checkAndUpdateConfigMap configMap " + configMapName + " exist."</technical_language>

Target:
public CompletableFuture<Boolean> checkAndUpdateConfigMap( String configMapName, Function<KubernetesConfigMap, Optional<KubernetesConfigMap>> function) { return FutureUtils.retry( () -> CompletableFuture.supplyAsync( () -> getConfigMap(configMapName) .map( configMap -> function.apply(configMap).map( updatedConfigMap -> { try { this.internalClient.configMaps() .inNamespace(namespace) .withName(configMapName) .lockResourceVersion(updatedConfigMap.getResourceVersion()) .replace(updatedConfigMap.getInternalResource()); } catch (Throwable throwable) { LOG.debug("Failed to update ConfigMap with data because of concurrent " + "modifications. Trying again.", configMap.getName(), configMap.getData()); throw throwable; } return true; }).orElse(false)) .orElseThrow(() -> new CompletionException( new KubernetesException("Cannot retry checkAndUpdateConfigMap with configMap " + configMapName + " because it does not exist."))), kubeClientExecutorService), maxRetryAttempts, throwable -> ExceptionUtils.findThrowable(throwable, KubernetesClientException.class).isPresent(), kubeClientExecutorService); }
Source:
<code>public static double[] trimDistribution(final double[] distribution) { int endOfDistribution = 0; <START> for (endOfDistribution = distribution.length-1;endOfDistribution >= 0;endOfDistribution--) { <END> if (distribution[endOfDistribution] != 0) { break; } } final double[] trimmedDistribution = new double[endOfDistribution+1]; for (int i = 0;i <= endOfDistribution;i++) { trimmedDistribution[i] = distribution[i]; } return trimmedDistribution; }</code><technical_language>spaces ; -</technical_language>

Target:
public static double[] trimDistribution(final double[] distribution) { int endOfDistribution = 0; for (endOfDistribution = distribution.length - 1; endOfDistribution >= 0; endOfDistribution--) { if (distribution[endOfDistribution] != 0) { break; } } return Arrays.copyOfRange(distribution, 0, endOfDistribution); }
Source:
<code>private void validateDirectPrerequisiteFileTypes( ConfiguredTargetAndData prerequisite, Attribute attribute) { if (attribute.isSkipAnalysisTimeFileTypeCheck()) { return; } FileTypeSet allowedFileTypes = attribute.getAllowedFileTypesPredicate(); if (allowedFileTypes == null) { return; } <START> if (!attribute.isNonEmpty() && !attribute.isSingleArtifact()) { <END> return; } if (allowedFileTypes != FileTypeSet.NO_FILE) { NestedSet<Artifact> artifacts = prerequisite.getConfiguredTarget().getProvider(FileProvider.class).getFilesToBuild(); if (attribute.isSingleArtifact() && !artifacts.isSingleton()) { attributeError( attribute.getName(), "'" + prerequisite.getTarget().getLabel() + "' must produce a single file"); return; } for (Artifact sourceArtifact : artifacts.toList()) { if (allowedFileTypes.apply(sourceArtifact.getFilename())) { return; } if (sourceArtifact.isTreeArtifact()) { return; } } attributeError( attribute.getName(), "'" + prerequisite.getTarget().getLabel() + "' does not produce any " + getRuleClassNameForLogging() + " " + attribute.getName() + " files (expected " + allowedFileTypes + ")"); } }</code><technical_language>I this is valid if set of prerequisite artefacts is _empty_</technical_language>

Target:
private void validateDirectPrerequisiteFileTypes( ConfiguredTargetAndData prerequisite, Attribute attribute) { if (attribute.isSkipAnalysisTimeFileTypeCheck()) { return; } FileTypeSet allowedFileTypes = attribute.getAllowedFileTypesPredicate(); if (allowedFileTypes == null) { return; } if (allowedFileTypes == FileTypeSet.ANY_FILE && !attribute.isNonEmpty() && !attribute.isSingleArtifact()) { return; } if (allowedFileTypes != FileTypeSet.NO_FILE) { NestedSet<Artifact> artifacts = prerequisite.getConfiguredTarget().getProvider(FileProvider.class).getFilesToBuild(); if (attribute.isSingleArtifact() && !artifacts.isSingleton()) { attributeError( attribute.getName(), "'" + prerequisite.getTarget().getLabel() + "' must produce a single file"); return; } if (artifacts.toList().isEmpty() && !attribute.isNonEmpty()) { return; } for (Artifact sourceArtifact : artifacts.toList()) { if (allowedFileTypes.apply(sourceArtifact.getFilename())) { return; } if (sourceArtifact.isTreeArtifact()) { return; } } attributeError( attribute.getName(), "'" + prerequisite.getTarget().getLabel() + "' does not produce any " + getRuleClassNameForLogging() + " " + attribute.getName() + " files (expected " + allowedFileTypes + ")"); } }
Source:
<code>public static boolean isResurrected(ChangeItem changeItem) { <START> return (changeItem.getBaselineVersion().isValid() && isDeleted( <END> changeItem.getBaselineVersion())) || (changeItem.getChangeType().equals( ChangeType.TUPLE_CHANGE) && changeItem.getDestinationVersion().isValid() && isDeleted( changeItem.getDestinationVersion()) && changeItem.getCurrentVersion().getModType().equals( ModificationType.INTRODUCED)); }</code><technical_language>I this logic require special support for tuples</technical_language>

Target:
public static boolean isResurrected(ChangeItem changeItem) { return (changeItem.getBaselineVersion().isValid() && isDeleted( changeItem.getBaselineVersion())) || changeItem.getCurrentVersion().getModType().equals( ModificationType.INTRODUCED); }
Source:
<code>public Commit remove( final String path, final String message, final String sha, final String branch, final Map<String, String> committer, final Map<String, String> author) throws IOException { <START> return new Commit.Smart(null); <END> }</code><technical_language>NULL, is a bad practice in general</technical_language>

Target:
public Commit remove( final String path, final String message, final String sha, final String branch, final Map<String, String> committer, final Map<String, String> author) throws IOException { return new Commit() { @Override public Repo repo() { return null; } @Override public String sha() { return null; } @Override public int compareTo(final Commit comm) { return 0; } @Override public JsonObject json() throws IOException { return null; } }; }
Source:
<code>public void testIndex() { Response response = dataUseResource.getSchema(); assertStatusAndHeader(response, Response.Status.OK, MediaType.APPLICATION_JSON); String content = response.getEntity().toString().trim(); Assert.assertTrue(content.contains("Data Use")); <START> } <END></code><technical_language>test this is valid json, a la new JSONObject(response.getEntity().toString())? need validate json-schema that, json? I feel strongly this</technical_language>

Target:
public void testIndex() { Response response = dataUseResource.getSchema(); assertStatusAndHeader(response, Response.Status.OK, MediaType.APPLICATION_JSON); String content = response.getEntity().toString().trim(); Assert.assertTrue(content.contains("Data Use")); try { new JSONObject(content); } catch (JSONException e) { fail("The response entity is not valid json"); } }
Source:
<code>protected void processCurrentMessages(final ActorProcessingThread currentThread, final WebDebugger dbg) { if (VmSettings.ACTOR_TRACING) { baseMessageId = currentThread.generateMessageBaseId(size); currentThread.currentMessageId = baseMessageId; } assert size > 0; try { execute(firstMessage, currentThread, dbg, -1); <START> stopNextMessage = firstMessage.isStepOver(); <END> if (size > 1) { int i = 0; for (EventualMessage msg : mailboxExtension) { execute(msg, currentThread, dbg, i); stopNextMessage = msg.isStepOver(); i++; } } } finally { if (VmSettings.ACTOR_TRACING) { currentThread.createdMessages += size; ActorExecutionTrace.mailboxExecuted(firstMessage, mailboxExtension, baseMessageId, currentMailboxNo, firstMessageTimeStamp, mailboxExtensionTimeStamps, executionTimeStamps, actor); } } }</code><technical_language>this done debugging is enabled, no? do in loop below, part of execute() method</technical_language>

Target:
protected void processCurrentMessages(final ActorProcessingThread currentThread, final WebDebugger dbg) { if (VmSettings.ACTOR_TRACING) { baseMessageId = currentThread.generateMessageBaseId(size); currentThread.currentMessageId = baseMessageId; } assert size > 0; try { execute(firstMessage, currentThread, dbg, -1); if (size > 1) { int i = 0; for (EventualMessage msg : mailboxExtension) { execute(msg, currentThread, dbg, i); i++; } } } finally { if (VmSettings.ACTOR_TRACING) { currentThread.createdMessages += size; ActorExecutionTrace.mailboxExecuted(firstMessage, mailboxExtension, baseMessageId, currentMailboxNo, firstMessageTimeStamp, mailboxExtensionTimeStamps, executionTimeStamps, actor); } } }
Source:
<code>public static void onRitualDeath(LivingDropsEvent event){ if(!ConfigHandler.values.wellOfSufferingDrops){ <START> if(event.getSource().equals(WayofTime.bloodmagic.ritual.RitualManager.RITUAL_DAMAGE)) { <END> event.getDrops().clear(); } } }</code><technical_language>fully qualified class name</technical_language>

Target:
public static void onRitualDeath(LivingDropsEvent event){ if(!ConfigHandler.values.wellOfSufferingDrops){ if(event.getSource().equals(RitualManager.RITUAL_DAMAGE)) { event.getDrops().clear(); } } }
Source:
<code>public void testInvokeMapperCancellation() throws Exception { MapReduceTask<String, String, String, Integer> task = invokeMapReduce(null, new LatchMapper(), new WordCountReducer()); final Future<Map<String, Integer>> future = task.executeAsynchronously(); Future<Boolean> cancelled = fork(new Callable<Boolean>() { @Override public Boolean call() throws Exception { eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return counter.get() >= nodeCount(); } }); <START> Thread.sleep(1500); <END> return future.cancel(true); } }); boolean mapperCancelled = false; Throwable root = null; try { future.get(); } catch (Exception e) { root = e; while(root.getCause() != null){ root = root.getCause(); } mapperCancelled = root.getClass().equals(RuntimeException.class); } assert mapperCancelled : "Mapper not cancelled, root cause " + root; assert cancelled.get(); assert future.isDone(); boolean canceled = future.cancel(true); assert !canceled; future.get(); }</code><technical_language>Anna, is necessary cancel future a background thread? I easier call future.cancel() main thread</technical_language>

Target:
public void testInvokeMapperCancellation() throws Exception { counter = new AtomicInteger(); MapReduceTask<String, String, String, Integer> task = invokeMapReduce(null, new LatchMapper(), new WordCountReducer()); final Future<Map<String, Integer>> future = task.executeAsynchronously(); Future<Boolean> cancelled = fork(new Callable<Boolean>() { @Override public Boolean call() throws Exception { eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return counter.get() >= nodeCount(); } }); return future.cancel(true); } }); boolean mapperCancelled = false; Throwable root = null; try { future.get(); } catch (Exception e) { root = e; while(root.getCause() != null){ root = root.getCause(); } mapperCancelled = root.getClass().equals(RuntimeException.class); } assert mapperCancelled : "Mapper not cancelled, root cause " + root; assert cancelled.get(); assert future.isDone(); boolean canceled = future.cancel(true); assert !canceled; future.get(); }
Source:
<code>public void visitClass(PsiClass clazz) { super.visitClass(clazz); if (clazz.hasAnnotation(lombok.Value.class.getName())) { final PsiModifierList modifierList = clazz.getModifierList(); if (modifierList != null && modifierList.hasExplicitModifier(FINAL)) { final Optional<PsiElement> psiFinal = Arrays.stream(modifierList.getChildren()) .filter(psiElement -> FINAL.equals(psiElement.getText())) .findFirst(); psiFinal.ifPresent(psiElement -> holder.registerProblem(psiElement, <START> "Redundant final field modifier", <END> ProblemHighlightType.WARNING, new RemoveModifierFix(FINAL)) ); } } }</code><technical_language>"field" is wrong</technical_language>

Target:
public void visitClass(PsiClass clazz) { super.visitClass(clazz); if (clazz.hasAnnotation(lombok.Value.class.getName())) { final PsiModifierList modifierList = clazz.getModifierList(); if (modifierList != null && modifierList.hasExplicitModifier(FINAL)) { final Optional<PsiElement> psiFinal = Arrays.stream(modifierList.getChildren()) .filter(psiElement -> FINAL.equals(psiElement.getText())) .findFirst(); psiFinal.ifPresent(psiElement -> holder.registerProblem(psiElement, "Redundant final class modifier", ProblemHighlightType.WARNING, new RemoveModifierFix(FINAL)) ); } } }
Source:
<code>public long getBackoffPeriod(int numberOfAttempts) { <START> double randomCoeff = ThreadLocalRandom.current().nextDouble() + 0.5; <END> return (long) (Math.min(500 * Math.pow(2, numberOfAttempts), MAX_EXPECTED_BACKOFF) * randomCoeff); }</code><technical_language>Feels a bit odd average maximum control actual maximum - I want control maximum 30. cap 30s, 30s maximum, calculate 2/3 of this apply +/-50% this value</technical_language>

Target:
public long getBackoffPeriod(int numberOfAttempts) { double randomCoeff = ThreadLocalRandom.current().nextDouble(1 - UNCERTAINTY, 1 + UNCERTAINTY); return (long) (Math.min(500 * Math.pow(2, numberOfAttempts), MAX_EXPECTED_BACKOFF) * randomCoeff); }
Source:
<code>public void test_can_parse_next_major_release_version() { int internalId = Version.CURRENT.internalId + 1000000; Version futureVersion = Version.fromId(internalId); assertThat(futureVersion.major, is((byte) (Version.CURRENT.major + 1))); assertThat(futureVersion.minor, is(Version.CURRENT.minor)); assertThat(futureVersion.revision, is(Version.CURRENT.revision)); assertThat(futureVersion.luceneVersion, is(org.apache.lucene.util.Version.fromBits( <START> Version.CURRENT.luceneVersion.major + 1, <END> Version.CURRENT.luceneVersion.minor, Version.CURRENT.luceneVersion.bugfix) )); }</code><technical_language>ah, suggest a test guard assumption :) Nicely done</technical_language>

Target:
public void test_can_parse_next_major_release_version() { int internalId = Version.CURRENT.internalId + 1000000; Version futureVersion = Version.fromId(internalId); assertThat(futureVersion.major, is((byte) (Version.CURRENT.major + 1))); assertThat(futureVersion.minor, is(Version.CURRENT.minor)); assertThat(futureVersion.revision, is(Version.CURRENT.revision)); assertThat(futureVersion.luceneVersion, is(org.apache.lucene.util.Version.fromBits( Version.CURRENT.luceneVersion.major + 1, 0, 0) )); }
Source:
<code>public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); <START> if (needsFuel()) { <END> fuel = data.getLong("fuel"); } powered = data.getBoolean("powered"); pointPos = NBTPlugin.readBlockPos(data, "point"); prevX = data.getInteger("prevX"); prevY = data.getInteger("prevY"); prevZ = data.getInteger("prevZ"); }</code><technical_language>commit style changes</technical_language>

Target:
public void readFromNBT(NBTTagCompound data) { super.readFromNBT(data); if (needsFuel()) fuel = data.getLong("fuel"); powered = data.getBoolean("powered"); pointPos = NBTPlugin.readBlockPos(data, "point"); prevX = data.getInteger("prevX"); prevY = data.getInteger("prevY"); prevZ = data.getInteger("prevZ"); }
Source:
<code><START> public static PostDiscoveryFilter includeMatching(String infixTagExpression) { <END> TagExpression tagExpression = TagExpression.parseFrom(infixTagExpression).tagExpressionOrThrow( (message) -> new PreconditionViolationException( "Unable to parse tag expression [" + infixTagExpression + "]: " + message)); logger.config(() -> "parsed tag expression: " + tagExpression); return descriptor -> FilterResult.includedIf(tagExpression.evaluate(descriptor.getTags())); }</code><technical_language>mistaken, idea includeMatching a private method -- right</technical_language>

Target:
private static PostDiscoveryFilter includeMatching(String infixTagExpression) { TagExpression tagExpression = TagExpression.parseFrom(infixTagExpression).tagExpressionOrThrow( (message) -> new PreconditionViolationException( "Unable to parse tag expression [" + infixTagExpression + "]: " + message)); logger.config(() -> "parsed tag expression: " + tagExpression); return descriptor -> FilterResult.includedIf(tagExpression.evaluate(descriptor.getTags())); }
Source:
<code><START> private NamedFields getNamedFields(final Model rdf, final URI uri) throws IOException, HttpException { <END> final RDFNode indexingTransform = rdf.listObjectsOfProperty(createResource(uri.toString()), INDEXING_TRANSFORM_PREDICATE).next(); final String transformKey = indexingTransform.asLiteral().getString(); LOGGER.debug("Discovered transform key: {}", transformKey); final HttpGet transformedResourceRequest = new HttpGet(uri.toString() + "/fcr:transform/" + transformKey); LOGGER.debug("Retrieving transformed resource from: {}", transformedResourceRequest.getURI()); final HttpResponse response = httpClient.execute(transformedResourceRequest); if (response.getStatusLine().getStatusCode() != SC_OK) { throw new HttpException(response.getStatusLine().toString()); } try ( Reader r = new InputStreamReader(response.getEntity().getContent(), "UTF8")) { return gson.fromJson(r, typeToken); } }</code><technical_language>right track PR, blindly returning getNamedFields above, ensure triple exists, lines of: if (!rdf.contains(createResource(uri.toString()), INDEXING_TRANSFORM_PREDICATE)) check in getNamedFields method, in get method. In case, check if triple exists in supplied rdf, if not, check descriptionURI. current logic checks if transform triple exists, if not, blindly hopes triple exists descriptionURI</technical_language>

Target:
private NamedFields getNamedFields(final Model rdf, final URI uri) throws IOException, HttpException { final NodeIterator nodeIterator = rdf.listObjectsOfProperty(createResource(uri.toString()), INDEXING_TRANSFORM_PREDICATE); if (!nodeIterator.hasNext()) { throw new AbsentTransformPropertyException("Property lookup failed for uri: " + uri); } final RDFNode indexingTransform = nodeIterator.next(); final String transformKey = indexingTransform.asLiteral().getString(); LOGGER.debug("Discovered transform key: {}", transformKey); final HttpGet transformedResourceRequest = new HttpGet(uri.toString() + "/fcr:transform/" + transformKey); LOGGER.debug("Retrieving transformed resource from: {}", transformedResourceRequest.getURI()); final HttpResponse response = httpClient.execute(transformedResourceRequest); if (response.getStatusLine().getStatusCode() != SC_OK) { throw new HttpException(response.getStatusLine().toString()); } try ( Reader r = new InputStreamReader(response.getEntity().getContent(), "UTF8")) { return gson.fromJson(r, typeToken); } }
Source:
<code>private List<DiskImage> createChildSnapshots(List<DiskImage> parentSnapshots) { List<DiskImage> children = new ArrayList<>(parentSnapshots.size()); parentSnapshots .stream() .forEach(parent -> { DiskImage child = createDiskImage(STORAGE_DOMAIN_ID); child.setParentId(parent.getImageId()); <START> children.add(child); <END> }); return children; }</code><technical_language>add collect list</technical_language>

Target:
private List<DiskImage> createChildSnapshots(List<DiskImage> parentSnapshots) { return parentSnapshots .stream() .map(parent -> { DiskImage child = createDiskImage(STORAGE_DOMAIN_ID); child.setParentId(parent.getImageId()); return child; }) .collect(Collectors.toList()); }
Source:
<code><START> public StreamVariantsRequest getStreamVariantsRequest(String variantSetId) { <END> return StreamVariantsRequest.newBuilder() .setVariantSetId(variantSetId) .setReferenceName(referenceName) .setStart(start) .setEnd(end) .build(); }</code><technical_language>instead of adding a new method here, move original method place this it</technical_language>

Target:
StreamVariantsRequest getStreamVariantsRequest(String variantSetId) { return StreamVariantsRequest.newBuilder() .setVariantSetId(variantSetId) .setReferenceName(referenceName) .setStart(start) .setEnd(end) .build(); }
Source:
<code>private MCompositePart createCompositePart(MPart originalPart) { MCompositePart compPart = ms.createModelElement(MCompositePart.class); compPart.setElementId("Split Host(" + originalPart.getLabel() + ")"); compPart.setLabel(originalPart.getLabel()); compPart.setTooltip(originalPart.getTooltip()); compPart.setIconURI(originalPart.getIconURI()); compPart.setCloseable(true); compPart.setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.splitteraddon.SplitHost"); Object overriddenImage = originalPart.getTransientData().get(IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY); <START> if (overriddenImage != null) <END> compPart.getTransientData().put(IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY, overriddenImage); compPart.getTags().add(EPartService.REMOVE_ON_HIDE_TAG); return compPart; }</code><technical_language>Please brackets for if body</technical_language>

Target:
private MCompositePart createCompositePart(MPart originalPart) { MCompositePart compPart = ms.createModelElement(MCompositePart.class); compPart.setElementId("Split Host(" + originalPart.getLabel() + ")"); compPart.setLabel(originalPart.getLabel()); compPart.setTooltip(originalPart.getTooltip()); compPart.setIconURI(originalPart.getIconURI()); compPart.setCloseable(true); compPart.setContributionURI("bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.splitteraddon.SplitHost"); Object overriddenImage = originalPart.getTransientData().get(IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY); if (overriddenImage != null) { compPart.getTransientData().put(IPresentationEngine.OVERRIDE_ICON_IMAGE_KEY, overriddenImage); } compPart.getTags().add(EPartService.REMOVE_ON_HIDE_TAG); return compPart; }
Source:
<code>protected Optional<DecorrelationResult> visitPlan(PlanNode node, Void context) { return Optional.of(new DecorrelationResult( <START> node, <END> ImmutableSet.of(), ImmutableList.of())); }</code><technical_language>require null empty collection</technical_language>

Target:
protected Optional<DecorrelationResult> visitPlan(PlanNode node, Void context) { return Optional.of(new DecorrelationResult( node, ImmutableSet.of(), ImmutableList.of(), ImmutableMultimap.of(), false)); }
Source:
<code>public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleConnectionTimeout=" + idleConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", inetSocketProxyAddress=" + inetSocketProxyAddress + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectionTimeout=" + connectionTimeout + ", idleEndpointTimeout=" + idleEndpointTimeout + ", maxChannelsPerEndpoint=" + maxConnectionsPerEndpoint + <START> ", maxRequestsPerChannel=" + maxRequestsPerConnection + <END> '}'; }</code><technical_language>rename string wordings -> maxChannelsPerEndpoint -> maxConnectionsPerEndpoint maxRequestsPerChannel -> maxRequestsPerConnection</technical_language>

Target:
public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleConnectionTimeout=" + idleConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + proxy.getType() + ", inetSocketProxyAddress=" + proxy.getAddress() + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectionTimeout=" + connectionTimeout + ", idleEndpointTimeout=" + idleEndpointTimeout + ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + ", maxRequestsPerConnection=" + maxRequestsPerConnection + '}'; }
Source:
<code>void recordGatewayResponse(RxDocumentServiceRequest rxDocumentServiceRequest, StoreResponse storeResponse, CosmosClientException exception) { ZonedDateTime responseTime = ZonedDateTime.now(ZoneOffset.UTC); connectionMode = ConnectionMode.GATEWAY; synchronized (this) { if (responseTime.isAfter(this.requestEndTime)) { this.requestEndTime = responseTime; } this.gatewayStatistic = new GatewayStatistic(); this.gatewayStatistic.operationType = rxDocumentServiceRequest.getOperationType(); if (storeResponse != null) { this.gatewayStatistic.statusCode = storeResponse.getStatus(); this.gatewayStatistic.subStatusCode = DirectBridgeInternal.getSubStatusCode(storeResponse); ISessionToken sessionToken = null; String headerValue; if ((headerValue = storeResponse.getHeaderValue(HttpConstants.HttpHeaders.SESSION_TOKEN)) != null) { <START> sessionToken = SessionTokenHelper.parse(headerValue); <END> } double requestCharge = 0; if ((headerValue = storeResponse.getHeaderValue(HttpConstants.HttpHeaders.REQUEST_CHARGE)) != null) { requestCharge = Double.parseDouble(headerValue); } this.gatewayStatistic.sessionToken = sessionToken; this.gatewayStatistic.requestCharge = requestCharge; } else if(exception != null){ this.gatewayStatistic.statusCode = exception.getStatusCode(); this.gatewayStatistic.subStatusCode = exception.getSubStatusCode(); } } }</code><technical_language>encoding SessionToken a string decode SessionToken object. end encode string in ClientStatistics.toString() avoid parsing SessionToken rely string value</technical_language>

Target:
void recordGatewayResponse(RxDocumentServiceRequest rxDocumentServiceRequest, StoreResponse storeResponse, CosmosClientException exception) { ZonedDateTime responseTime = ZonedDateTime.now(ZoneOffset.UTC); connectionMode = ConnectionMode.GATEWAY; synchronized (this) { if (responseTime.isAfter(this.requestEndTime)) { this.requestEndTime = responseTime; } this.gatewayStatistic = new GatewayStatistic(); this.gatewayStatistic.operationType = rxDocumentServiceRequest.getOperationType(); if (storeResponse != null) { this.gatewayStatistic.statusCode = storeResponse.getStatus(); this.gatewayStatistic.subStatusCode = DirectBridgeInternal.getSubStatusCode(storeResponse); this.gatewayStatistic.sessionToken = storeResponse.getHeaderValue(HttpConstants.HttpHeaders.SESSION_TOKEN); this.gatewayStatistic.requestCharge = storeResponse.getHeaderValue(HttpConstants.HttpHeaders.REQUEST_CHARGE); } else if(exception != null){ this.gatewayStatistic.statusCode = exception.getStatusCode(); this.gatewayStatistic.subStatusCode = exception.getSubStatusCode(); } } }
Source:
<code>private boolean isFirstArgumentCredentials(CallExpression callExpression) { return callExpression.arguments().get(0).is(Tree.Kind.REGULAR_ARGUMENT) && ((RegularArgument) callExpression.arguments().get(0)).expression().is(Tree.Kind.NAME) <START> && isCredential(((Name) ((RegularArgument) callExpression.arguments().get(0)).expression()).name(), variablePatterns()); <END> }</code><technical_language>I suggest declare callExpression.arguments().get(0) in a variable avoid this casting</technical_language>

Target:
private boolean isFirstArgumentCredentials(CallExpression callExpression) { Argument argument = callExpression.arguments().get(0); if (argument.is(Kind.REGULAR_ARGUMENT)) { RegularArgument regularArgument = (RegularArgument) argument; return regularArgument.expression().is(Kind.NAME) && isCredential(((Name) regularArgument.expression()).name(), variablePatterns()); } return false; }
Source:
<code><START> public List<Long> getIds(final int size) { <END> final Vector<Long> idVector = new Vector<>(); for (int i = 0; i < size; i++) { idVector.add(base + counter.getAndIncrement()); } return idVector; }</code><technical_language>here. getIds() throw IdGenerationException if counter exceeds range of integer(2^32)? Creating more 2^32 ids conflicts ids created other IdFactory</technical_language>

Target:
public List<Long> getIds(final int size) throws IdGenerationException { if (counter.get() + size > 0x100000000L) { throw new IdGenerationException("No more id available"); } final Vector<Long> idVector = new Vector<>(); for (int i = 0; i < size; i++) { idVector.add(base + counter.getAndIncrement()); } return idVector; }
Source:
<code>public void run() { try { if (keepAliveSender.test(gameId)) { if (!lastAttemptWasSuccess) { reportReconnected(); } } else { final PostGameResponse postGameResponse = gamePoster.get(); gameId = postGameResponse.getGameId(); <START> connectivityHandler.accept(postGameResponse.isSuccessfulConnectivityCheck()); <END> if (keepAliveSender.test(gameId)) { gameIdSetter.accept(gameId); reportReconnected(); } } } catch (final FeignException e) { if (lastAttemptWasSuccess) { connectionLostReporter.accept( "Connection to lobby lost.\nWill automatically re-connect when it is available."); lastAttemptWasSuccess = false; } } }</code><technical_language>This pose a major problem. a user disconnects a network a direct connection longer (which is able create post a game connectivity fail a re-posting). In scenario alive sender no-op while disconnected, design, get a reconnection get a new game id connectivity check fail. connectivity handler crash game is in-progress. game crash severe, option save, game closes error message. simply do connectivity check here, point a bit interface segregation principle. leaning decoupling functionality dead code call paths. if functionalities remain coupled, need a error handler implementation crash already-in-progress game</technical_language>

Target:
public void run() { try { if (!keepAliveSender.test(gameId)) { gameId = gamePoster.get(); if (keepAliveSender.test(gameId)) { gameIdSetter.accept(gameId); } } } catch (final FeignException e) { log.log(Level.INFO, "Unable to connect to lobby (lobby is shut down?)", e); } }
Source:
<code>private void emit(final MistDataEvent input, final EventStack<T> eventStack) { final Map<String, List<T>> output = new HashMap<>(); final long timeStamp = input.getTimestamp(); final int finalStateIndex = eventStack.getStack().peek().getIndex(); final EventStackEntry<T> finalEntry = eventStack.getStack().peek(); final int times = finalEntry.getlist().size(); final CepEventPattern<T> finalState = eventPatternList.get(finalStateIndex); if (!finalState.isTimes() <START> || (times >= finalState.getMinTimes() <END> && (finalState.getMaxTimes() == -1 || times <= finalState.getMaxTimes()))) { for (final EventStackEntry<T> iterEntry : eventStack.getStack()) { output.put(eventPatternList.get(iterEntry.getIndex()).getEventPatternName(), iterEntry.getlist()); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "{0} processes {1} to {2}", new Object[]{this.getClass().getName(), input, output}); } outputEmitter.emitData(new MistDataEvent(output, timeStamp)); eventStack.setAlreadyEmitted(); } }</code><technical_language>getMinIteration getMinRepetition</technical_language>

Target:
private void emit(final MistDataEvent input, final EventStack<T> eventStack) { final Map<String, List<T>> output = new HashMap<>(); final long timeStamp = input.getTimestamp(); final int finalStateIndex = eventStack.getStack().peek().getIndex(); final EventStackEntry<T> finalEntry = eventStack.getStack().peek(); final int times = finalEntry.getlist().size(); final CepEventPattern<T> finalState = eventPatternList.get(finalStateIndex); if (!finalState.isRepeated() || (times >= finalState.getMinRepetition() && (finalState.getMaxRepetition() == -1 || times <= finalState.getMaxRepetition()))) { for (final EventStackEntry<T> iterEntry : eventStack.getStack()) { output.put(eventPatternList.get(iterEntry.getIndex()).getEventPatternName(), iterEntry.getlist()); } if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "{0} processes {1} to {2}", new Object[]{this.getClass().getName(), input, output}); } outputEmitter.emitData(new MistDataEvent(output, timeStamp)); eventStack.setAlreadyEmitted(); } }
Source:
<code>public String toString() { <START> return String.valueOf(firstDigitsCardNumber); <END> }</code><technical_language>firstDigitsCardNumber is a String</technical_language>

Target:
public String toString() { return firstDigitsCardNumber; }
Source:
<code><START> public List<QuotaConsumptionParameter> getQuotaStorageConsumptionParameters() { <END> List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); if (getVm().getis_stateless()) { for (DiskImage image : getVm().getDiskList()) { if (image.getQuotaId() != null) { list.add(new QuotaStorageConsumptionParameter(image.getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, image.getstorage_ids().get(0), image.getActualSize())); } } } return list; }</code><technical_language>putting here: if (!getVm().getis_stateless()) { return null; } nesting level removed</technical_language>

Target:
public List<QuotaConsumptionParameter> getQuotaStorageConsumptionParameters() { List<QuotaConsumptionParameter> list = new ArrayList<QuotaConsumptionParameter>(); if (getVm().getis_stateless()) { for (DiskImage image : getVm().getDiskList()) { if (image.getQuotaId() != null) { list.add(new QuotaStorageConsumptionParameter(image.getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.RELEASE, image.getstorage_ids().get(0), image.getActualSize())); } } } return list; }
Source:
<code>private void filterFeedbackSessions(String courseId, List<FeedbackSessionAttributes> feedbacks, InstructorAttributes instructor, StudentAttributes student) { Iterator<FeedbackSessionAttributes> iterFs = feedbacks.iterator(); while (iterFs.hasNext()) { FeedbackSessionAttributes tempFs = iterFs.next(); if (!tempFs.courseId.equals(courseId)) { iterFs.remove(); <START> } else if (!instructor.isAllowedForPrivilege(student.section, tempFs.getSessionName(), <END> Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)) { iterFs.remove(); } } }</code><technical_language>iterFs.remove(), this || if-else-if</technical_language>

Target:
private void filterFeedbackSessions(String courseId, List<FeedbackSessionAttributes> feedbacks, InstructorAttributes instructor, StudentAttributes student) { Iterator<FeedbackSessionAttributes> iterFs = feedbacks.iterator(); while (iterFs.hasNext()) { FeedbackSessionAttributes tempFs = iterFs.next(); if (!tempFs.courseId.equals(courseId) || !instructor.isAllowedForPrivilege(student.section, tempFs.getSessionName(), Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)) { iterFs.remove(); } } }
Source:
<code>private void startSync() { Configuration config = Configuration.get(); FileWatcher fileWatcher = new FileWatcher(config.getUsersFile(), config.getProjectsFile(), config.getRolesFile(), config.getAssignmentsFile()) { @Override protected void onFilesModified(Set<File> files) { syncFromFiles(files); } }; <START> timer.schedule(fileWatcher, 0, 1000); <END> }</code><technical_language>this timer run often. file propably changed often</technical_language>

Target:
private void startSync() { Configuration config = Configuration.get(); FileWatcher fileWatcher = new FileWatcher(config.getUsersFile(), config.getProjectsFile(), config.getRolesFile(), config.getAssignmentsFile()) { @Override protected void onFilesModified(Set<File> files) { syncFromFiles(files); } }; timer.schedule(fileWatcher, 5000, 1000); }
Source:
<code>private static boolean testExpression(LiteralExpression inputStrLiteral, LiteralExpression localeIsoCodeLiteral, LiteralExpression upperCaseBooleanLiteral, LiteralExpression strengthLiteral, LiteralExpression decompositionLiteral, String expectedCollationKeyBytesHex) throws Exception { List<Expression> expressions = Lists.newArrayList((Expression) inputStrLiteral, (Expression) localeIsoCodeLiteral, (Expression) upperCaseBooleanLiteral, (Expression) strengthLiteral, (Expression) decompositionLiteral); Expression collationKeyFunction = new CollationKeyFunction(expressions); ImmutableBytesWritable ptr = new ImmutableBytesWritable(); boolean ret = collationKeyFunction.evaluate(null, ptr); if (ret) { byte[] result = (byte[]) collationKeyFunction.getDataType().toObject(ptr, collationKeyFunction.getSortOrder()); byte[] expectedCollationKeyByteArray = Hex.decodeHex(expectedCollationKeyBytesHex.toCharArray()); <START> <END> assertEquals( String.format("Size of collation key byte arrays was not as expected for [%s], [%s]", inputStrLiteral.getValue(), localeIsoCodeLiteral.getValue()), expectedCollationKeyByteArray.length, result.length); for (int i = 0; i < expectedCollationKeyByteArray.length; i++) { assertEquals( String.format( "Element " + i + " of collation key byte array was not as expected for [%s], [%s]", inputStrLiteral.getValue(), localeIsoCodeLiteral.getValue()), expectedCollationKeyByteArray[i], result[i]); } } else { fail(String.format("CollationKeyFunction.evaluate returned false for %s, %s", inputStrLiteral.getValue(), localeIsoCodeLiteral.getValue())); } return ret; }</code><technical_language>assertArrayEquals instead</technical_language>

Target:
private static void testExpression(LiteralExpression inputStrLiteral, LiteralExpression localeIsoCodeLiteral, LiteralExpression upperCaseBooleanLiteral, LiteralExpression strengthLiteral, LiteralExpression decompositionLiteral, String expectedCollationKeyBytesHex) throws Exception { List<Expression> expressions = Lists.newArrayList((Expression) inputStrLiteral, (Expression) localeIsoCodeLiteral, (Expression) upperCaseBooleanLiteral, (Expression) strengthLiteral, (Expression) decompositionLiteral); Expression collationKeyFunction = new CollationKeyFunction(expressions); ImmutableBytesWritable ptr = new ImmutableBytesWritable(); boolean ret = collationKeyFunction.evaluate(null, ptr); if (ret) { byte[] result = (byte[]) collationKeyFunction.getDataType().toObject(ptr, collationKeyFunction.getSortOrder()); byte[] expectedCollationKeyByteArray = Hex.decodeHex(expectedCollationKeyBytesHex.toCharArray()); assertArrayEquals("COLLATION_KEY did not return the expected byte array", expectedCollationKeyByteArray, result); } else { fail(String.format("CollationKeyFunction.evaluate returned false for %s, %s", inputStrLiteral.getValue(), localeIsoCodeLiteral.getValue())); } }
Source:
<code>public static boolean isComposedJobDefinition(String definition){ String patternString = "(\\|\\|(?=([^\\\"']*[\\\"'][^\\\"']*[\\\"'])*[^\\\"']*$)) " + <START> "| (\\&(?=([^\\\"']*[\\\"'][^\\\"']*[\\\"'])*[^\\\"']*$)) "; <END> Pattern pattern = Pattern.compile(patternString); Matcher matcher = pattern.matcher(definition); return matcher.find(); }</code><technical_language>shot of breaking this a bit understand for</technical_language>

Target:
public static boolean isComposedJobDefinition(String definition){ Matcher matcher = pattern.matcher(definition); return matcher.find(); }
Source:
<code>private boolean isWorktreeDirty(WorkingTreeIterator work) { if (inCore || work == null) return false; final int modeF = tw.getRawMode(T_FILE); final int modeO = tw.getRawMode(T_OURS); boolean isDirty = work.isModeDifferent(modeO); if (!isDirty && nonTree(modeF)) isDirty = !tw.idEqual(T_FILE, T_OURS); if (isDirty && modeF == FileMode.TYPE_TREE && modeO == FileMode.TYPE_MISSING) <START> isDirty = false; <END> if (isDirty) failingPaths.put(tw.getPathString(), MergeFailureReason.DIRTY_WORKTREE); return isDirty; }</code><technical_language>if this is sufficient. I agree empty dir in working tree prevent a merge. thought case - base&ours for path p/x - worktree contains folder p/x - contains a file p/x After/during a succesful merge want update working tree file p/x theirs. This fail if in location a folder p/x exists, or? need a test for this</technical_language>

Target:
private boolean isWorktreeDirty(WorkingTreeIterator work) { if (work == null) return false; final int modeF = tw.getRawMode(T_FILE); final int modeO = tw.getRawMode(T_OURS); boolean isDirty = work.isModeDifferent(modeO); if (!isDirty && nonTree(modeF)) isDirty = !tw.idEqual(T_FILE, T_OURS); if (isDirty && modeF == FileMode.TYPE_TREE && modeO == FileMode.TYPE_MISSING) isDirty = false; if (isDirty) failingPaths.put(tw.getPathString(), MergeFailureReason.DIRTY_WORKTREE); return isDirty; }