auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private static int suffixMatch(String changedFile, String coverageFile) { <END> int changedFileSize = changedFile.length(); int coverageFileSize = coverageFile.length(); if (coverageFileSize > changedFileSize) { return 0; } int rIndex = 1; while (coverageFileSize - rIndex >= 0 && coverageFile.charAt(coverageFileSize - rIndex) == changedFile.charAt( changedFileSize - rIndex)) { rIndex++; } return rIndex - 1; }</code><technical_language>noticed java suffixMatch("pathA/file.ext", "pathB/file.ext") == 9 simplify java int prefixLength = changedFile.endsWith(coverageFile) ? changedFile.lastIndexOf(coverageFile) : -1; // -1 signals match boolean isMatch = prefixLength == 0 || (prefixLength > 0 && changedFile.charAt(prefixLength) == '/');</technical_language>

Target:
private static int suffixMatch(String changedFile, String coverageFile) { int changedFileSize = changedFile.length(); int coverageFileSize = coverageFile.length(); if (coverageFileSize > changedFileSize) { return 0; } int rIndex = 1; while (coverageFileSize - rIndex >= 0 && coverageFile.charAt(coverageFileSize - rIndex) == changedFile.charAt( changedFileSize - rIndex)) { rIndex++; } if (rIndex < coverageFileSize && coverageFile.charAt(rIndex - 1) != '/') { return 0; } return rIndex - 1; }
Source:
<code>public ImmutableSpongePersistingData(Boolean value) { <START> super(ImmutablePersistingData.class, value, Keys.PERSISTS, SpongePersistingData.class, true); <END> this.cachedValue = ImmutableSpongeValue.cachedOf(Keys.PERSISTS, true, this.value); }</code><technical_language>Default false</technical_language>

Target:
public ImmutableSpongePersistingData(Boolean value) { super(ImmutablePersistingData.class, value, Keys.PERSISTS, SpongePersistingData.class, false); }
Source:
<code>private static Long getFileSizeForDirName(String fileSizeDirName) { Long sizeInBytes = null; if (fileSizeDirName.startsWith(FILE_SIZE_DIR_PREFIX)) { String sizeString = fileSizeDirName.substring(FILE_SIZE_DIR_PREFIX.length()); try { sizeInBytes = Long.parseLong(sizeString); <START> } catch (NumberFormatException ignored) { <END> } } return sizeInBytes; }</code><technical_language>do ignore this</technical_language>

Target:
private static Long getFileSizeForDirName(String fileSizeDirName) { Long sizeInBytes = null; if (fileSizeDirName.startsWith(FILE_SIZE_DIR_PREFIX)) { String sizeString = fileSizeDirName.substring(FILE_SIZE_DIR_PREFIX.length()); sizeInBytes = Long.parseLong(sizeString); } return sizeInBytes; }
Source:
<code>public void visitNode(Tree tree) { TypeSymbol classSymbol = ((ClassTree) tree).symbol(); <START> Set<Symbol> fieldsReadOnAnotherInstance = FieldsReadOnAnotherInstanceVisitor.getFrom(classSymbol); <END> classSymbol.memberSymbols().stream() .filter(PrivateFieldUsedLocallyCheck::isPrivateField) .filter(s -> !s.usages().isEmpty()) .filter(s -> !fieldsReadOnAnotherInstance.contains(s)) .forEach(s -> checkPrivateField(s, classSymbol)); }</code><technical_language>getFrom method classTree symbol</technical_language>

Target:
public void visitNode(Tree tree) { TypeSymbol classSymbol = ((ClassTree) tree).symbol(); Set<Symbol> fieldsReadOnAnotherInstance = FieldsReadOnAnotherInstanceVisitor.getFrom(tree); classSymbol.memberSymbols().stream() .filter(PrivateFieldUsedLocallyCheck::isPrivateField) .filter(s -> !s.usages().isEmpty()) .filter(s -> !fieldsReadOnAnotherInstance.contains(s)) .forEach(s -> checkPrivateField(s, classSymbol)); }
Source:
<code>void handleResponse(ResponseInfo responseInfo) { <START> int correlationId = ((PutRequest) responseInfo.getRequest()).getCorrelationId(); <END> correlationIdToPutChunk.remove(correlationId).handleResponse(responseInfo); }</code><technical_language>Suggestion: leave casting onResponse() in NonBlockingRouter? a switch case, type of request. if this function in a PutRequest a response? If is of change contributes code bloat, this is alright</technical_language>

Target:
void handleResponse(ResponseInfo responseInfo) { int correlationId = ((PutRequest) responseInfo.getRequest()).getCorrelationId(); PutOperation putOperation = correlationIdToPutOperation.remove(correlationId); if (putOperations.contains(putOperation)) { putOperation.handleResponse(responseInfo); if (putOperation.isOperationComplete()) { putOperations.remove(putOperation); onComplete(putOperation); } } }
Source:
<code>public void setActive(final boolean active) { super.setActive(active); DELETE_SEARCH_SIZE = Platform.getPreferencesService().getInt( <START> EditPlugin.ID, PreferenceConstants.P_DELETE_TOOL_RADIUS, 6, null); <END> DELETE_CONFIRM = Platform.getPreferencesService().getBoolean( EditPlugin.ID, PreferenceConstants.P_DELETE_TOOL_CONFIRM, true, null); setStatusBarMessage(active); }</code><technical_language>global definition of Defaults well</technical_language>

Target:
public void setActive(final boolean active) { super.setActive(active); setStatusBarMessage(active); }
Source:
<code>private void updateDeviceAddresses() { if (isEmulatedMachineChanged()) { <START> log.info("Emulated machine changed for VM: {}. Clearing device addresses.", getVm().getName()); <END> getVmDeviceDao().clearAllDeviceAddressesByVmId(getVmId()); VmDevicesMonitoring.Change change = VmDevicesMonitoring.getInstance().createChange(System.nanoTime()); change.updateVm(getVmId(), VmDevicesMonitoring.EMPTY_HASH); change.flush(); } }</code><technical_language>please include VM's ID</technical_language>

Target:
private void updateDeviceAddresses() { if (isEmulatedMachineChanged()) { log.info("Emulated machine changed for VM: ({}). Clearing device addresses.", getVm().getName(), getVm().getId()); getVmDeviceDao().clearAllDeviceAddressesByVmId(getVmId()); VmDevicesMonitoring.Change change = vmDevicesMonitoring.createChange(System.nanoTime()); change.updateVm(getVmId(), VmDevicesMonitoring.EMPTY_HASH); change.flush(); } }
Source:
<code><START> public DataRecord getMetadataRecord(String name) { <END> return null; }</code><technical_language>Need implement</technical_language>

Target:
public DataRecord getMetadataRecord(String name) { if (null == name) { throw new IllegalArgumentException("The wildcard must not be null"); } Iterator<DataStore> iter = delegateHandler.getAllDelegatesIterator(); while (iter.hasNext()) { DataStore ds = iter.next(); if (ds instanceof SharedDataStore) { DataRecord result = ((SharedDataStore) ds).getMetadataRecord(name); if (null != result) { return result; } } } return null; }
Source:
<code>public EmbeddedCacheManager getDefaultCacheManager(@OverrideDefault Instance<EmbeddedCacheManager> providedDefaultCacheManager, @Default Configuration defaultConfiguration) { if (!providedDefaultCacheManager.isUnsatisfied()) { if (log.isTraceEnabled()) { <START> log.tracef("Default cache manager overridden by '%s'", providedDefaultCacheManager); <END> } return providedDefaultCacheManager.get(); } return new DefaultCacheManager(defaultConfiguration); }</code><technical_language>arguments passed as-is (no string concatenation) nice consequence of formatters is need if (log.isTraceEnabled). Of issue, FYI, code more readable</technical_language>

Target:
public EmbeddedCacheManager getDefaultCacheManager(@OverrideDefault Instance<EmbeddedCacheManager> providedDefaultCacheManager, @Default Configuration defaultConfiguration) { if (!providedDefaultCacheManager.isUnsatisfied()) { log.tracef("Default cache manager overridden by '%s'", providedDefaultCacheManager); return providedDefaultCacheManager.get(); } return new DefaultCacheManager(defaultConfiguration); }
Source:
<code>Supplier<Map<String, String>> reset() { return Memoize.referenceSupplier(() -> { Map<String, String> map = Arrays.stream(ResourcesPlugin.getWorkspace() .getRoot() .getProjects()) .filter(IProject::isOpen) .map(this::findBndrunFiles) .flatMap(Collection::stream) .map(IResource::getFullPath) .collect(toMap(IPath::toPortableString, IPath::toPortableString)); <START> ResourcesPlugin.getWorkspace() <END> .addResourceChangeListener(listener); return map; }, SoftReference::new); }</code><technical_language>want add listener in supplier get additional listener time reset is called new memoized is initialized. listener call reset... I need add listener in constructor</technical_language>

Target:
Supplier<Map<String, String>> reset() { return Memoize.supplier(() -> Arrays.stream(ResourcesPlugin.getWorkspace() .getRoot() .getProjects()) .filter(IProject::isOpen) .map(this::findBndrunFiles) .flatMap(Collection::stream) .map( IResource::getFullPath) .collect(toMap(IPath::toPortableString, IPath::toPortableString))); }
Source:
<code>public void replNameEndsWithWhitespace() { Note note = createNote(); Paragraph paragraph = new Paragraph(note, null, interpreterFactory); paragraph.setText("%test\r\n###Hello"); <START> assertEquals("test", paragraph.getIntpText()); <END> assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\t###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\u000b###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\f###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\n###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test ###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); }</code><technical_language>if matters, some tests a newline, if any? \r\n%test (which I is valid) %\r\ntest</technical_language>

Target:
public void replNameEndsWithWhitespace() { Note note = createNote(); Paragraph paragraph = new Paragraph(note, null, interpreterFactory); paragraph.setText("%test\r\n###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\t###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\u000b###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\f###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test\n###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%test ###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText(" %test ###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("\n\r%test ###Hello"); assertEquals("test", paragraph.getIntpText()); assertEquals("###Hello", paragraph.getScriptText()); paragraph.setText("%\r\n###Hello"); assertEquals("", paragraph.getIntpText()); assertEquals("%\r\n###Hello", paragraph.getScriptText()); }
Source:
<code>private List<JavaFileScannerContext.Location> flowFromLearnedConstraints(ExplodedGraph.Edge edge, Set<LearnedConstraint> learnedConstraints) { List<JavaFileScannerContext.Location> result = new ArrayList<>(); Set<String> messages = new HashSet<>(); learnedConstraints.stream() .map(lc -> learnedConstraintFlow(lc, edge)) .flatMap(List::stream) .forEach(location -> { <START> if (!location.syntaxNode.is(Tree.Kind.EQUAL_TO, Tree.Kind.NOT_EQUAL_TO) || messages.add(location.msg)) { <END> result.add(location); } }); return result; }</code><technical_language>Mmmh, follow here. is bothering is times message tree (so a duplicate of Location). considering kind of tree message value? simpler rely equality of locations filter out, a LinkedHashSet for instance</technical_language>

Target:
private List<JavaFileScannerContext.Location> flowFromLearnedConstraints(ExplodedGraph.Edge edge, Set<LearnedConstraint> learnedConstraints) { return learnedConstraints.stream() .map(lc -> learnedConstraintFlow(lc, edge)) .flatMap(List::stream) .distinct() .collect(Collectors.toList()); }
Source:
<code><START> public SMREntryList (int size, List<SMREntry> smrEntries) { <END> this.size = size; this.smrEntries = smrEntries; }</code><technical_language>rename sizeInBytes... confuse size of list..</technical_language>

Target:
public SMREntryList (int size, List<SMREntry> smrEntries) { this.sizeInBytes = size; this.smrEntries = smrEntries; }
Source:
<code>private Symbol flowFromLearnedSymbols(ExplodedGraph.Node currentNode, @Nullable Symbol trackSymbol) { ExplodedGraph.Node parent = currentNode.parent(); if (trackSymbol == null || parent == null) { return null; } Optional<ExplodedGraph.Node.LearnedValue> learnedValue = currentNode.getLearnedSymbols().stream() .filter(lv -> lv.getSymbol().equals(trackSymbol)) .findFirst(); if (learnedValue.isPresent()) { ExplodedGraph.Node.LearnedValue lv = learnedValue.get(); <START> Constraint constraintForSV = parent.programState.getConstraint(lv.getSv()); <END> if (constraintForSV == null) { flow.add(location(parent)); } else { flow.add(location(parent, lv.getSymbol().name() + " is assigned " + constraintForSV.valueAsString())); } return parent.programState.getLastEvaluated(); } return trackSymbol; }</code><technical_language>constraint enough ForSv is a bit of a pleonasm</technical_language>

Target:
private Symbol flowFromLearnedSymbols(ExplodedGraph.Node currentNode, @Nullable Symbol trackSymbol) { ExplodedGraph.Node parent = currentNode.parent(); if (trackSymbol == null || parent == null) { return null; } Optional<ExplodedGraph.Node.LearnedValue> learnedValue = currentNode.getLearnedSymbols().stream() .filter(lv -> lv.getSymbol().equals(trackSymbol)) .findFirst(); if (learnedValue.isPresent()) { ExplodedGraph.Node.LearnedValue lv = learnedValue.get(); Constraint constraint = parent.programState.getConstraint(lv.getSv()); JavaFileScannerContext.Location location = constraint == null ? location(parent) : location(parent, lv.getSymbol().name() + " is assigned " + constraint.valueAsString()); flow.add(location); return parent.programState.getLastEvaluated(); } return trackSymbol; }
Source:
<code>private void putMacImplClass(String algorithm, String className) { <START> String prefix = getClass().getPackage().getName() + "."; <END> String supportedKeyClasses = prefix + "OpenSSLKeyHolder"; String supportedKeyFormats = "RAW"; putImplClassWithKeyConstraints( "Mac." + algorithm, prefix + className, supportedKeyClasses, supportedKeyFormats); }</code><technical_language>move this out a private static field</technical_language>

Target:
private void putMacImplClass(String algorithm, String className) { String supportedKeyClasses = PREFIX + "OpenSSLKeyHolder"; String supportedKeyFormats = "RAW"; putImplClassWithKeyConstraints( "Mac." + algorithm, PREFIX + className, supportedKeyClasses, supportedKeyFormats); }
Source:
<code>public void customize() { isRiakOnPath = isPackageInstall ? isRiakOnPath() : true; OsDetails osDetails = getMachine().getMachineDetails().getOsDetails(); List<String> commands = Lists.newLinkedList(); String vmArgsTemplate = processTemplate(entity.getConfig(RiakNode.RIAK_VM_ARGS_TEMPLATE_URL)); DynamicTasks.queueIfPossible(newScript(CUSTOMIZING).body.append("true").newTask()); DynamicTasks.queueIfPossible(SshEffectorTasks.put(getRunDir() + "/vm.args") .contents(Streams.newInputStreamWithContents(vmArgsTemplate)) .machine(getMachine()) .summary("sending the vm.args file to the riak node")); if (osDetails.isMac()) commands.add("ulimit -n 4096"); <START> else if (osDetails.isLinux()) { <END> commands.add(sudo("chown riak:riak " + getRunDir() + "/vm.args")); } commands.add(sudo("mv " + getRunDir() + "/vm.args " + getEtcDir())); commands.add(sudo(format("sed -i -e \"s/127.0.0.1/%s/g\" %s", getPrivateIp(), getAppConfigLocation()))); ScriptHelper customizeScript = newScript(CUSTOMIZING) .failOnNonZeroResultCode() .body.append(commands); if (!isRiakOnPath) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); customizeScript.environmentVariablesReset(newPathVariable); } customizeScript.execute(); entity.setAttribute(RiakNode.RIAK_NODE_NAME, format("riak@%s", getHostname())); }</code><technical_language>Need braces parts of if/else statement</technical_language>

Target:
public void customize() { newScript(CUSTOMIZING).execute(); isRiakOnPath = isPackageInstall ? isRiakOnPath() : true; OsDetails osDetails = getMachine().getMachineDetails().getOsDetails(); List<String> commands = Lists.newLinkedList(); String vmArgsTemplate = processTemplate(entity.getConfig(RiakNode.RIAK_VM_ARGS_TEMPLATE_URL)); String saveAsVmArgs = Urls.mergePaths(getRunDir(), "vm.args"); DynamicTasks.queueIfPossible(SshEffectorTasks.put(saveAsVmArgs).contents(vmArgsTemplate)); commands.add(sudo("mv " + saveAsVmArgs + " " + getRiakEtcDir())); String appConfigTemplate = processTemplate(entity.getConfig(RiakNode.RIAK_APP_CONFIG_TEMPLATE_URL)); String saveAsAppConfig = Urls.mergePaths(getRunDir(), "app.config"); DynamicTasks.queueIfPossible(SshEffectorTasks.put(saveAsAppConfig).contents(appConfigTemplate)); commands.add(sudo("mv " + saveAsAppConfig + " " + getRiakEtcDir())); if (osDetails.isMac()) { commands.add("ulimit -n 4096"); } else if (osDetails.isLinux()) { commands.add(sudo("chown riak:riak " + getVmArgsLocation())); } ScriptHelper customizeScript = newScript(CUSTOMIZING) .failOnNonZeroResultCode() .body.append(commands); if (!isRiakOnPath) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); customizeScript.environmentVariablesReset(newPathVariable); } customizeScript.execute(); entity.setAttribute(RiakNode.RIAK_NODE_NAME, format("riak@%s", getHostname())); }
Source:
<code>private void initGlusterPeerProcess() { _glusterPeerListSucceeded = true; _glusterPeerProbeSucceeded = true; List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { <START> if (!Guid.OpEquality(getVdsId(), vds.getId())) { <END> upServer = vds; break; } } if (upServer != null) { List<GlusterServerInfo> glusterServers = getGlusterPeers(upServer.getId()); if (glusterServers.size() == 0) { setNonOperational(NonOperationalReason.GLUSTER_PEER_LIST_FAILED); } else if (!hostExists(glusterServers, getVds())) { if (!glusterPeerProbe(upServer.getId(), getVds().gethost_name())) { setNonOperational(NonOperationalReason.GLUSTER_PEER_PROBE_FAILED); } } } } }</code><technical_language>I prefer , if u equals. This OpEquality method removed, IMHO</technical_language>

Target:
private void initGlusterPeerProcess() { _glusterPeerListSucceeded = true; _glusterPeerProbeSucceeded = true; List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!getVdsId().equals(vds.getId())) { upServer = vds; break; } } if (upServer != null) { List<GlusterServerInfo> glusterServers = getGlusterPeers(upServer.getId()); if (glusterServers.size() == 0) { setNonOperational(NonOperationalReason.GLUSTER_PEER_LIST_FAILED); } else if (!hostExists(glusterServers, getVds())) { if (!glusterPeerProbe(upServer.getId(), getVds().gethost_name())) { setNonOperational(NonOperationalReason.GLUSTER_PEER_PROBE_FAILED); } } } } }
Source:
<code>public void testSocketFinderAllowedInterfacesPrivate() throws Exception { ConcurrentOpenSocketFinder finder = new ConcurrentOpenSocketFinder(socketAlwaysOpen, nodeRunning, userExecutor); <START> finder.allowedInterfaces = ConcurrentOpenSocketFinder.AllowedInterfaces.PRIVATE; <END> HostAndPort result = finder.findOpenSocketOnNode(node, 22, 2000, MILLISECONDS); assertEquals(result, HostAndPort.fromParts(PRIVATE_IP, 22)); }</code><technical_language>Static import ConcurrentOpenSocketFinder.AllowedInterfaces</technical_language>

Target:
public void testSocketFinderAllowedInterfacesPrivate() throws Exception { FluentIterable<String> ips = ConcurrentOpenSocketFinder.checkNodeHasIps(node, AllowedInterfaces.PRIVATE); assertFalse(ips.contains(PUBLIC_IP)); assertTrue(ips.contains(PRIVATE_IP)); }
Source:
<code>public void init(final ProcessorContext context, final StateStore root) { this.context = (InternalProcessorContext) context; final StreamsMetricsImpl metrics = this.context.metrics(); final String taskName = context.taskId().toString(); expiredRecordSensor = metrics.storeLevelSensor( taskName, name(), EXPIRED_WINDOW_RECORD_DROP, Sensor.RecordingLevel.INFO ); addInvocationRateAndCountToSensor( expiredRecordSensor, "stream-" + metricScope + "-metrics", <START> metrics.storeLevelTagMap(taskName, metricScope, name()), <END> EXPIRED_WINDOW_RECORD_DROP ); segments.openExisting(this.context, observedStreamTime); bulkLoadSegments = new HashSet<>(segments.allSegments()); context.register(root, new RocksDBSegmentsBatchingRestoreCallback()); open = true; }</code><technical_language>"incorrect" metrics name is out in previous releases, fixing effectively breaking user's compatibility. I this fixing a bug, worth clarifying in upgrade guide docs</technical_language>

Target:
public void init(final ProcessorContext context, final StateStore root) { this.context = (InternalProcessorContext) context; final StreamsMetricsImpl metrics = this.context.metrics(); final String threadId = Thread.currentThread().getName(); final String taskName = context.taskId().toString(); expiredRecordSensor = metrics.storeLevelSensor( threadId, taskName, name(), EXPIRED_WINDOW_RECORD_DROP, Sensor.RecordingLevel.INFO ); addInvocationRateAndCountToSensor( expiredRecordSensor, "stream-" + metricScope + "-metrics", metrics.storeLevelTagMap(threadId, taskName, metricScope, name()), EXPIRED_WINDOW_RECORD_DROP ); segments.openExisting(this.context, observedStreamTime); bulkLoadSegments = new HashSet<>(segments.allSegments()); context.register(root, new RocksDBSegmentsBatchingRestoreCallback()); open = true; }
Source:
<code>protected void commitWorkingCopy(IProgressMonitor monitor, Object element, TranslationUnitInfo info, boolean overwrite) throws CoreException { if (monitor == null) monitor= new NullProgressMonitor(); monitor.beginTask("", 100); try { IDocument document= info.fTextFileBuffer.getDocument(); IResource resource= info.fCopy.getResource(); if (resource instanceof IFile && !resource.exists()) { createFileFromDocument(monitor, (IFile) resource, document); return; } try { CoreException saveActionException= null; try { ICProject cproject = CoreModel.getDefault().create(resource.getProject()); performSaveActions(cproject, info.fTextFileBuffer, getSubProgressMonitor(monitor, 20)); } catch (CoreException e) { saveActionException = e; } <START> commitFileBuffer(monitor, info, overwrite); <END> if (saveActionException != null) { throw saveActionException; } } catch (CoreException x) { fireElementStateChangeFailed(element); throw x; } catch (RuntimeException x) { fireElementStateChangeFailed(element); throw x; } } finally { monitor.done(); } }</code><technical_language>If progress monitor monitor, this monitor</technical_language>

Target:
protected void commitWorkingCopy(IProgressMonitor monitor, Object element, TranslationUnitInfo info, boolean overwrite) throws CoreException { if (monitor == null) monitor= new NullProgressMonitor(); monitor.beginTask("", 100); try { IDocument document= info.fTextFileBuffer.getDocument(); IResource resource= info.fCopy.getResource(); if (resource instanceof IFile && !resource.exists()) { createFileFromDocument(monitor, (IFile) resource, document); return; } try { CoreException saveActionException= null; IProgressMonitor sub = getSubProgressMonitor(monitor, 20); try { ICProject cproject = CoreModel.getDefault().create(resource.getProject()); performSaveActions(cproject, info.fTextFileBuffer, sub); } catch (CoreException e) { saveActionException = e; } commitFileBuffer(sub, info, overwrite); if (saveActionException != null) { CUIPlugin.log(saveActionException); } } catch (CoreException x) { fireElementStateChangeFailed(element); throw x; } catch (RuntimeException x) { fireElementStateChangeFailed(element); throw x; } } finally { monitor.done(); } }
Source:
<code>public void doAuthorise_shouldRespondAuthorisationSuccess() throws Exception { providerWillAuthorise(); GatewayResponse response = cardAuthorisationService.doAuthorise(charge.getExternalId(), aValidAuthorisationDetails()); assertThat(response.isSuccessful(), is(true)); assertThat(response.getSessionIdentifier().get(), is(SESSION_IDENTIFIER)); assertThat(charge.getProviderSessionId(), is(SESSION_IDENTIFIER)); assertThat(charge.getStatus(), is(AUTHORISATION_SUCCESS.getValue())); assertThat(charge.getGatewayTransactionId(), is(TRANSACTION_ID)); verify(mockedChargeEventDao).persistChargeEventOf(charge, Optional.empty()); assertThat(charge.get3dsDetails(), is(nullValue())); assertThat(charge.getCardDetails(), is(notNullValue())); assertThat(paymentRequest.getChargeTransaction().getGatewayTransactionId(), is(TRANSACTION_ID)); verify(mockPaymentRequestDao).updateChargeTransactionStatus(charge.getExternalId(), AUTHORISATION_READY); <START> verify(mockPaymentRequestDao).updateChargeTransactionStatus(charge.getExternalId(), AUTHORISATION_SUCCESS); <END> }</code><technical_language>in-order verification here</technical_language>

Target:
public void doAuthorise_shouldRespondAuthorisationSuccess() throws Exception { providerWillAuthorise(); GatewayResponse response = cardAuthorisationService.doAuthorise(charge.getExternalId(), aValidAuthorisationDetails()); assertThat(response.isSuccessful(), is(true)); assertThat(response.getSessionIdentifier().get(), is(SESSION_IDENTIFIER)); assertThat(charge.getProviderSessionId(), is(SESSION_IDENTIFIER)); assertThat(charge.getStatus(), is(AUTHORISATION_SUCCESS.getValue())); assertThat(charge.getGatewayTransactionId(), is(TRANSACTION_ID)); verify(mockedChargeEventDao).persistChargeEventOf(charge, Optional.empty()); assertThat(charge.get3dsDetails(), is(nullValue())); assertThat(charge.getCardDetails(), is(notNullValue())); assertThat(paymentRequest.getChargeTransaction().getGatewayTransactionId(), is(TRANSACTION_ID)); InOrder inOrder = inOrder(mockStatusUpdater); inOrder.verify(mockStatusUpdater).updateChargeTransactionStatus(charge.getExternalId(), AUTHORISATION_READY); inOrder.verify(mockStatusUpdater).updateChargeTransactionStatus(charge.getExternalId(), AUTHORISATION_SUCCESS); }
Source:
<code>public String toString() { <START> final StringBuffer sb = new StringBuffer("FileTailerEvent{"); <END> sb.append("state=").append(state); sb.append(", eventData='").append(eventData).append('\''); sb.append('}'); return sb.toString(); }</code><technical_language>StringBuilder instead. Also, ToStringHelper in guava</technical_language>

Target:
public String toString() { return new StringBuilder("FileTailerEvent{") .append("state=").append(state) .append(", eventData='").append(eventData).append('\'') .append('}').toString(); }
Source:
<code>public void resetCounters() throws Exception { PetFailingPollingSource.STARTED_POLLS = 0; STARTED_POLLS = 0; <START> } <END></code><technical_language>This test is yielding false positives. test pases number of invokations want is correct, instance is modifying this is wanted. Change this a Map<Source, Integer> assert instances invokations</technical_language>

Target:
public void resetCounters() throws Exception { PetFailingPollingSource.STARTED_POLLS = 0; POLL_INVOCATIONS.clear(); STARTED_SOURCES.clear(); STARTED_POLLS = 0; }
Source:
<code>public void should_ignore_test_when_assumption_fails() { <START> assumeThat((Object) "test").isNotNull().isEqualTo("other"); <END> assertThat(true).isFalse(); }</code><technical_language>I prefer a Object objectUnderTest field is initialized in test avoid inelegant casts</technical_language>

Target:
public void should_ignore_test_when_assumption_fails() { assumeThat(STRING_OBJECT).isNotNull().isEqualTo("other"); assertThat(true).isFalse(); }
Source:
<code>private void assertGreaterThan(String msg, int a, int b) { <START> assertTrue(msg + ": " + a + " > " + b, a > b); <END> }</code><technical_language>1. showing observed expected? unclear me. 2. this is once, is assertTrue in l.108? 3. static</technical_language>

Target:
static private void assertGreaterThan(String msg, int a, int b) { assertTrue(msg + ": " + a + " > " + b, a > b); }
Source:
<code>public ConfigAccessor(String zkAddress) { RealmAwareZkClient zkClient; try { zkClient = new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), new RealmAwareZkClient.RealmAwareZkClientConfig()); <START> } catch (IOException | InvalidRoutingDataException e) { <END> LOG.info( "ConfigAccessor: not able to connect on multi-realm mode; connecting single-realm mode to ZK: {}", zkAddress, e); zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer())); } _zkClient = zkClient; _usesExternalZkClient = false; }</code><technical_language>IllegalStateException floated HttpRoutingDataReader caught</technical_language>

Target:
public ConfigAccessor(String zkAddress) { RealmAwareZkClient zkClient; try { zkClient = new FederatedZkClient( new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(), new RealmAwareZkClient.RealmAwareZkClientConfig()); } catch (IOException | InvalidRoutingDataException | IllegalStateException e) { LOG.info( "ConfigAccessor: not able to connect on multi-realm mode; connecting single-realm mode to ZK: {}", zkAddress, e); zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddress), new HelixZkClient.ZkClientConfig().setZkSerializer(new ZNRecordSerializer())); } _zkClient = zkClient; _usesExternalZkClient = false; }
Source:
<code>final public Date getExtendedExpiresOn() { <START> return this.mExtendedExpiresOn; <END> }</code><technical_language>this [](start = 15, length = 4) remove this. (its needed)</technical_language>

Target:
final Date getExtendedExpiresOn() { return mExtendedExpiresOn; }
Source:
<code><START> final public void initialize() { <END> if (previous != null && (previous.isScheduled())) { previous.cancel(); } onInitialize(); }</code><technical_language>public final final public</technical_language>

Target:
public final void initialize() { if (previous != null && previous.isScheduled()) { previous.cancel(); } onInitialize(); }
Source:
<code>public ArrayList<String> getProxyProperties() { ArrayList<String> properties = new ArrayList<String>(); String prop = System.getProperty("http.proxyHost"); if (prop != null) { properties.add("-Dhttp.proxyHost=" + prop); } prop = System.getProperty("http.proxyPort"); if (prop != null) { properties.add("-Dhttp.proxyPort=" + prop); } prop = System.getProperty("https.proxyHost"); if (prop != null) { properties.add("-Dhttps.proxyHost=" + prop); } prop = System.getProperty("https.proxyPort"); if (prop != null) { properties.add("-Dhttps.proxyPort=" + prop); } prop = System.getProperty("http.nonProxyHosts"); if (prop != null) { properties.add("-Dhttp.nonProxyHosts=" + prop); <START> } <END> return properties; }</code><technical_language>a private helper method remove duplicated blocks? method propertyName properties params, add property properties if non-null</technical_language>

Target:
public ArrayList<String> getProxyProperties() { ArrayList<String> properties = new ArrayList<String>(); addProxyProperty(properties, "http.proxyHost"); addProxyProperty(properties, "http.proxyPort"); addProxyProperty(properties, "https.proxyHost"); addProxyProperty(properties, "https.proxyPort"); addProxyProperty(properties, "http.nonProxyHosts"); return properties; }
Source:
<code>public Integer getPreKmerLength() { <START> if(preKmerLength == null) <END> preKmerLength = new Integer(0); return preKmerLength; }</code><technical_language>reason do otherwise, return int Integer set 0 default. way, if call getPreKmerLength() initializing, get a NPE (which is bug!)</technical_language>

Target:
public Integer getPreKmerLength() { return preKmerLength; }
Source:
<code>private Double getEntriesReadInBatchMeanThorough() { <START> return (Double) getGaugeThorough(AtlasDbMetricNames.BATCH_SIZE_MEAN).getValue(); <END> }</code><technical_language>yeah, need cast params helpful, missing</technical_language>

Target:
private Double getEntriesReadInBatchMeanThorough() { Gauge<Double> gauge = getGaugeThorough(AtlasDbMetricNames.BATCH_SIZE_MEAN); return gauge.getValue(); }
Source:
<code>public void setUOM(@NonNull final org.compiere.model.I_M_InventoryLine inventoryLine) { <START> final UomId stockUOMId = inventoryLine.getM_Product_ID() > 0 ? productBL.getStockUOMId(ProductId.ofRepoId(inventoryLine.getM_Product_ID())) : UomId.ofRepoIdOrNull(0); inventoryLine.setC_UOM_ID(stockUOMId != null ? stockUOMId.getRepoId() : 0); <END> }</code><technical_language>suggestion final UomId stockUOMId = inventoryLine.getM_Product_ID() > 0 ? productBL.getStockUOMId(inventoryLine.getM_Product_ID()) : null; inventoryLine.setC_UOM_ID(UomId.toRepoId(stockUOMId)); simplified method call</technical_language>

Target:
public void setUOM(@NonNull final org.compiere.model.I_M_InventoryLine inventoryLine) { final UomId stockUOMId = inventoryLine.getM_Product_ID() > 0 ? productBL.getStockUOMId(inventoryLine.getM_Product_ID()) : null; inventoryLine.setC_UOM_ID(UomId.toRepoId(stockUOMId)); }
Source:
<code>private boolean isSearchTableHeaderCorrect(int tableNum) { List<String> expectedSearchTableHeaders; List<String> actualSessionTableHeaders; int numColumns = searchPage.getNumberOfColumnsFromDataTable(tableNum); switch (searchPage.getDataTableId(tableNum)) { case "search_table_instructor": <START> if (numColumns != 5) { <END> return false; } expectedSearchTableHeaders = Arrays.asList("Course", "Name", "Google ID", "Institute", "Options"); actualSessionTableHeaders = new ArrayList<String>(); for (int i = 0 ; i < numColumns ; i++) { actualSessionTableHeaders.add(searchPage.getHeaderValueFromDataTable(tableNum, 0, i)); } break; case "search_table": if (numColumns != 6) { return false; } expectedSearchTableHeaders = Arrays.asList("Institute", "Course[Section](Team)", "Name", "Google ID[Details]", "Comments", "Options"); actualSessionTableHeaders = new ArrayList<String>(); for (int i = 0 ; i < numColumns ; i++) { actualSessionTableHeaders.add(searchPage.getHeaderValueFromDataTable(tableNum, 0, i)); } break; default: return false; } return actualSessionTableHeaders.equals(expectedSearchTableHeaders); }</code><technical_language>extract this a constant in this class. INSTRUCTOR_SEARCH_TABLE_NUM_COLUMNS</technical_language>

Target:
private boolean isSearchTableHeaderCorrect(int tableNum) { List<String> expectedSearchTableHeaders; List<String> actualSessionTableHeaders; int numColumns = searchPage.getNumberOfColumnsFromDataTable(tableNum); switch (searchPage.getDataTableId(tableNum)) { case "search_table_instructor": if (numColumns != ADMIN_SEARCH_INSTRUCTOR_TABLE_NUM_COLUMNS) { return false; } expectedSearchTableHeaders = Arrays.asList("Course", "Name", "Google ID", "Institute", "Options"); actualSessionTableHeaders = new ArrayList<String>(); for (int i = 0 ; i < numColumns ; i++) { actualSessionTableHeaders.add(searchPage.getHeaderValueFromDataTable(tableNum, 0, i)); } break; case "search_table": if (numColumns != ADMIN_SEARCH_STUDENT_TABLE_NUM_COLUMNS) { return false; } expectedSearchTableHeaders = Arrays.asList("Institute", "Course[Section](Team)", "Name", "Google ID[Details]", "Comments", "Options"); actualSessionTableHeaders = new ArrayList<String>(); for (int i = 0 ; i < numColumns ; i++) { actualSessionTableHeaders.add(searchPage.getHeaderValueFromDataTable(tableNum, 0, i)); } break; default: return false; } return actualSessionTableHeaders.equals(expectedSearchTableHeaders); }
Source:
<code>public void emitBatch(final long batchId, final TridentCollector collector) { List<List<Object>> batch = this.getBatches().get(batchId); if (batch == null) { batch = new ArrayList<List<Object>>(); <START> if (index >= outputs.length && isCycle()) { <END> index = 0; } for (int i = 0; i < getMaxBatchSize(); index++, i++) { if (index == outputs.length) { index = 0; } batch.add(outputs[index]); } this.getBatches().put(batchId, batch); } for (List<Object> list : batch) { collector.emit(list); } }</code><technical_language>Nit: reason getter referring field</technical_language>

Target:
public void emitBatch(final long batchId, final TridentCollector collector) { List<List<Object>> batch = this.batches.get(batchId); if (batch == null) { batch = new ArrayList<List<Object>>(); if (index >= outputs.length && cycle) { index = 0; } for (int i = 0; i < maxBatchSize; index++, i++) { if (index == outputs.length) { index = 0; } batch.add(outputs[index]); } this.batches.put(batchId, batch); } for (List<Object> list : batch) { collector.emit(list); } }
Source:
<code>public void putJobCreatedNotification() throws IOException, SignatureException { UUID notificationUUID = null; try { final PutJobCreatedNotificationRegistrationSpectraS3Response response = client .putJobCreatedNotificationRegistrationSpectraS3(new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")); notificationUUID = response.getJobCreatedNotificationRegistrationResult().getId(); assertThat(response.getStatusCode(), is(201)); } finally { client.deleteJobCreatedNotificationRegistrationSpectraS3( <START> new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); <END> } }</code><technical_language>check notificationUUID is null</technical_language>

Target:
public void putJobCreatedNotification() throws IOException, SignatureException { UUID notificationUUID = null; try { final PutJobCreatedNotificationRegistrationSpectraS3Response response = client .putJobCreatedNotificationRegistrationSpectraS3(new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")); notificationUUID = response.getJobCreatedNotificationRegistrationResult().getId(); assertThat(response.getStatusCode(), is(201)); } finally { if (notificationUUID != null) { client.deleteJobCreatedNotificationRegistrationSpectraS3( new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); } } }
Source:
<code>private String getFullPath(final String path) { String result = null; if (ServletUtils.isSane(path)) { List<BrandingTheme> brandingPaths = brandingManager. getBrandingThemes(); for (BrandingTheme brandingTheme: brandingPaths) { <START> if (path.startsWith(brandingTheme.getPath())) { <END> result = brandingManager.getBrandingRootPath(). getAbsolutePath() + path; } } } else { log.error("The path \"" + path + "\" is not sane"); } return result; }</code><technical_language>Instead of iterating List<BrandingTheme> request, Map<String, BrandingTheme> - mapping brandingTheme.getPath() BrandingTheme instance. This is avoid O(n) access due iteration, in favor of O(1) access due map access, regard BrandingTheme instance</technical_language>

Target:
String getFullPath(final String path) { String result = null; if (ServletUtils.isSane(path)) { result = brandingManager.getBrandingRootPath().getAbsolutePath() + path; } else { log.error("The path \"" + path + "\" is not sane"); } return result; }
Source:
<code>protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); <START> orderList.remove(orderList.indexOf("stepRemoteConnection")); END> orderList.add(orderList.indexOf("stepInitializeBaseSequence") + 1, "stepInitializeSequence_7_2"); orderList.add(orderList.indexOf("stepInitializeSequence_7_2") + 1, "stepAddInferior"); orderList.add(orderList.indexOf("stepSetExecutable") + 1, "stepSetRemoteExecutable"); return orderList.toArray(new String[orderList.size()]); } return null; }</code><technical_language>"stepRemoteConnection" done in DebugNewProcessSequence deal 'remote' protocol. For 'extended-remote' (and should) done in FinalLaunchSequence. removing step right do time</technical_language>

Target:
protected String[] getExecutionOrder(String group) { if (GROUP_TOP_LEVEL.equals(group)) { List<String> orderList = new ArrayList<String>(Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL))); orderList.add(orderList.indexOf("stepInitializeBaseSequence") + 1, "stepInitializeSequence_7_2"); orderList.add(orderList.indexOf("stepInitializeSequence_7_2") + 1, "stepAddInferior"); orderList.add(orderList.indexOf("stepSetExecutable") + 1, "stepSetRemoteExecutable"); return orderList.toArray(new String[orderList.size()]); } return null; }
Source:
<code>private void toggleGoogleDriveSync(){ SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); final String appFolderId = sharedPreferences.getString(getString(R.string.key_google_drive_app_folder_id), null); if (appFolderId != null){ sharedPreferences.edit().remove(getString(R.string.key_google_drive_app_folder_id)).commit(); mGoogleApiClient.disconnect(); <START> onGoogleDriveFolderForgot(appFolderId); <END> } else { mGoogleApiClient.connect(); } }</code><technical_language>onGoogleDriveFolderForgot method? inline code here</technical_language>

Target:
private void toggleGoogleDriveSync(){ SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); final String appFolderId = sharedPreferences.getString(getString(R.string.key_google_drive_app_folder_id), null); if (appFolderId != null){ sharedPreferences.edit().remove(getString(R.string.key_google_drive_app_folder_id)).commit(); mGoogleApiClient.disconnect(); } else { mGoogleApiClient.connect(); } }
Source:
<code>public boolean isContingentOn(PartialWorld world, BayesNetVar X, BayesNetVar Y, BayesNetVar Z) { TraceParentRecEvalContext context = new TraceParentRecEvalContext(world); if (Z instanceof VarWithDistrib) { <START> ((VarWithDistrib) Z).getDistrib(context); <END> } else if (Z instanceof DerivedVar) { ((DerivedVar) Z).getValue(context); } else { return true; } LinkedList parentTrace = new LinkedList(); parentTrace.addAll(context.getParentTrace()); int x = parentTrace.indexOf(X), y = parentTrace.indexOf(Y); if (x < 0 || y < 0) { return false; } if (X instanceof NumberVar) { if (x < y && world.getCBN().getAncestors(Y).contains(X)) { if (Util.verbose()) { System.out.println("\t Contingent relations type 1: " + X.toString() + " " + Y.toString() + " " + Z.toString()); } return true; } else { return false; } } else { if (x < y) { if (Util.verbose()) { System.out.println("\t Contingent relations type 2: " + X.toString() + " " + Y.toString() + " " + Z.toString()); } return true; } else { return false; } } }</code><technical_language>use</technical_language>

Target:
public boolean isContingentOn(PartialWorld world, BayesNetVar X, BayesNetVar Y, BayesNetVar Z) { TraceParentRecEvalContext context = new TraceParentRecEvalContext(world); if (Z instanceof VarWithDistrib) { ((VarWithDistrib) Z).getDistrib(context); } else if (Z instanceof DerivedVar) { ((DerivedVar) Z).getValue(context); } else { return true; } LinkedList<BayesNetVar> parentTrace = new LinkedList<BayesNetVar>(); parentTrace.addAll(context.getParentTrace()); int x = parentTrace.indexOf(X), y = parentTrace.indexOf(Y); if (x < 0 || y < 0) { return false; } if (X instanceof NumberVar) { if (x < y && world.getCBN().getAncestors(Y).contains(X)) { if (Util.verbose()) { System.out.println("\t Contingent relations type 1: " + X.toString() + " " + Y.toString() + " " + Z.toString()); } return true; } else { return false; } } else { if (x < y) { if (Util.verbose()) { System.out.println("\t Contingent relations type 2: " + X.toString() + " " + Y.toString() + " " + Z.toString()); } return true; } else { return false; } } }
Source:
<code>private SearchHit createSearchHit(SearchContext context, FieldsVisitor fieldsVisitor, int docId, int subDocId, Map<String, Set<String>> storedToRequestedFields, LeafReaderContext subReaderContext) { Map<String, DocumentField> docFields = emptyMap(); Map<String, DocumentField> metaFields = emptyMap(); if (fieldsVisitor == null) { <START> return new SearchHit(docId, null, docFields, metaFields); <END> } loadStoredFields(context.shardTarget(), subReaderContext, fieldsVisitor, subDocId); fieldsVisitor.postProcess(context.mapperService()); if (fieldsVisitor.fields().isEmpty() == false) { docFields = new HashMap<>(); metaFields = new HashMap<>(); fillDocAndMetaFields(context, fieldsVisitor, storedToRequestedFields, docFields, metaFields); } SearchHit searchHit = new SearchHit(docId, fieldsVisitor.id(), docFields, metaFields); SourceLookup sourceLookup = context.lookup().source(); sourceLookup.setSegmentAndDocument(subReaderContext, subDocId); if (fieldsVisitor.source() != null) { sourceLookup.setSource(fieldsVisitor.source()); } return searchHit; }</code><technical_language>prefer if continue null arguments remove earlier declaration of maps (move needed?)</technical_language>

Target:
private SearchHit createSearchHit(SearchContext context, FieldsVisitor fieldsVisitor, int docId, int subDocId, Map<String, Set<String>> storedToRequestedFields, LeafReaderContext subReaderContext) { if (fieldsVisitor == null) { return new SearchHit(docId, null, null, null); } loadStoredFields(context.shardTarget(), subReaderContext, fieldsVisitor, subDocId); fieldsVisitor.postProcess(context.mapperService()); SearchHit searchHit; if (fieldsVisitor.fields().isEmpty() == false) { Map<String, DocumentField> docFields = new HashMap<>(); Map<String, DocumentField> metaFields = new HashMap<>(); fillDocAndMetaFields(context, fieldsVisitor, storedToRequestedFields, docFields, metaFields); searchHit = new SearchHit(docId, fieldsVisitor.id(), docFields, metaFields); } else { searchHit = new SearchHit(docId, fieldsVisitor.id(), emptyMap(), emptyMap()); } SourceLookup sourceLookup = context.lookup().source(); sourceLookup.setSegmentAndDocument(subReaderContext, subDocId); if (fieldsVisitor.source() != null) { sourceLookup.setSource(fieldsVisitor.source()); } return searchHit; }
Source:
<code><START> static boolean isCompactibleSize(long targetBytes, long currentTotalBytes, long additionalBytes) <END> { return targetBytes * (1 + ALLOWED_MARGIN_OF_COMPACTION_SIZE) >= currentTotalBytes + additionalBytes; }</code><technical_language>this is a confusing name for a function - rename</technical_language>

Target:
static boolean isCompactibleSize(long targetBytes, long currentTotalBytes, long additionalBytes) { return currentTotalBytes + additionalBytes <= targetBytes; }
Source:
<code>public void test() { final File file = mockPlatform.createTempFile(true); EditorGame game = new EditorGame(); game.setEditScene("scene0"); mockController.action(NewGame.class, file.getAbsolutePath(), game, new Game()); mockController.action(action, file.getAbsoluteFile(), new DeleteProjectListener() { @Override public void projectDeleted(boolean succeed) { assertTrue( "Project deletion failed! (project file still exists)", <START> succeed); <END> } }); }</code><technical_language>Ok, thing: I a bad idea check file exist - all, if action work notified file deleted. assertions: java assertTrue("Project deletion failed (listener invoked succeeded=false)", succeeded); assertFalse("Project deletion failed (project file exists)", file.exists());</technical_language>

Target:
public void test() { final File file = mockPlatform.createTempFile(true); EditorGame game = new EditorGame(); game.setEditScene("scene0"); mockController.action(NewGame.class, file.getAbsolutePath(), game, new Game()); mockController.action(action, file.getAbsoluteFile(), new DeleteProjectListener() { @Override public void projectDeleted(boolean succeeded) { assertTrue( "Project deletion failed (listener invoked with succeeded=false)", succeeded); assertFalse( "Project deletion failed (project file still exists)", file.exists()); } }); }