auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private AzureBlobFileSystem createTestFile(Path testFilePath, long testFileSize, <END> Configuration config) throws Exception { AzureBlobFileSystem fs; if (config == null) { fs = this.getFileSystem(); } else { final AzureBlobFileSystem currentFs = getFileSystem(); fs = (AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(), config); } if (fs.exists(testFilePath)) { FileStatus status = fs.getFileStatus(testFilePath); if (status.getLen() >= testFileSize) { return fs; } } byte[] buffer = new byte[EIGHT_MB]; char character = 'a'; for (int i = 0; i < buffer.length; i++) { buffer[i] = (byte) character; character = (character == 'z') ? 'a' : (char) ((int) character + 1); } try (FSDataOutputStream outputStream = fs.create(testFilePath)) { int bytesWritten = 0; while (bytesWritten < testFileSize) { outputStream.write(buffer); bytesWritten += buffer.length; } } assertEquals("File not created of expected size", testFileSize, fs.getFileStatus(testFilePath).getLen()); return fs; }</code><technical_language>if reuse data generation new file creation code ContractTestUtils.dataset() ContractTestUtils.createFile</technical_language>

Target:
private AzureBlobFileSystem createTestFile(Path testFilePath, long testFileSize, Configuration config) throws Exception { AzureBlobFileSystem fs; if (config == null) { fs = this.getFileSystem(); } else { final AzureBlobFileSystem currentFs = getFileSystem(); fs = (AzureBlobFileSystem) FileSystem.newInstance(currentFs.getUri(), config); } if (fs.exists(testFilePath)) { FileStatus status = fs.getFileStatus(testFilePath); if (status.getLen() >= testFileSize) { return fs; } } byte[] buffer = new byte[EIGHT_MB]; char character = 'a'; for (int i = 0; i < buffer.length; i++) { buffer[i] = (byte) character; character = (character == 'z') ? 'a' : (char) ((int) character + 1); } try (FSDataOutputStream outputStream = fs.create(testFilePath)) { int bytesWritten = 0; while (bytesWritten < testFileSize) { outputStream.write(buffer); bytesWritten += buffer.length; } } Assertions.assertThat(fs.getFileStatus(testFilePath).getLen()) .describedAs("File not created of expected size") .isEqualTo(testFileSize); return fs; }
Source:
<code>public static boolean isActive(IStructuredSelection selectedElements) { boolean result = true; final Iterator<?> iterator = selectedElements.iterator(); if (!iterator.hasNext()) { result = false; } while (iterator.hasNext()) { final Object <START> next = <END> iterator.next(); if (next instanceof IDiagramElementEditPart) { result = result && isActive((IDiagramElementEditPart) next); } else { result = false; } } return result; }</code><technical_language>selectedElement for readability</technical_language>

Target:
public static boolean isActive(IStructuredSelection selectedElements) { boolean result = true; final Iterator<?> iterator = selectedElements.iterator(); if (!iterator.hasNext()) { result = false; } while (iterator.hasNext()) { final Object selectedElement = iterator.next(); if (selectedElement instanceof IDiagramElementEditPart) { result = result && isActive((IDiagramElementEditPart) selectedElement); } else { result = false; } } return result; }
Source:
<code>private boolean isFlowRunningLongerThan(ExecutableFlow flow, long flowMaxRunningTimeInMins) { Set<Status> nonFinishingStatusAfterFlowStarts = new HashSet<>(); <START> nonFinishingStatusAfterFlowStarts.add(Status.RUNNING); <END> nonFinishingStatusAfterFlowStarts.add(Status.QUEUED); nonFinishingStatusAfterFlowStarts.add(Status.PAUSED); nonFinishingStatusAfterFlowStarts.add(Status.FAILED_FINISHING); return nonFinishingStatusAfterFlowStarts.contains(flow.getStatus()) && flow.getStartTime() > 0 && TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis()-flow.getStartTime()) >= flowMaxRunningTimeInMins; }</code><technical_language>nit: shorten this new Hashet<>(Arrays.asList(...))</technical_language>

Target:
private boolean isFlowRunningLongerThan(ExecutableFlow flow, long flowMaxRunningTimeInMins) { Set<Status> nonFinishingStatusAfterFlowStarts = new HashSet<>(Arrays.asList(Status.RUNNING, Status.QUEUED, Status.PAUSED, Status.FAILED_FINISHING)); return nonFinishingStatusAfterFlowStarts.contains(flow.getStatus()) && flow.getStartTime() > 0 && TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis()-flow.getStartTime()) >= flowMaxRunningTimeInMins; }
Source:
<code><START> public List getDataValue(String key) { <END> Object value = GetValue(key, new ArrayList()); if (value instanceof List) { return (List)value; } return new ArrayList(); }</code><technical_language>Consider switching this List<Object> instead of unspecified List type</technical_language>

Target:
public List<Object> getDataValue(String key) { Object value = GetValue(key, new ArrayList()); if (value instanceof List) { return (List<Object>) value; } return new ArrayList<Object>(); }
Source:
<code>protected void auditField(final ChangeSpec changeSpec) { final String fieldName = changeSpec.getFieldName(); Audit[] annotations = dictionary.getAttributeOrRelationAnnotations(getResourceClass(), Audit.class, fieldName ); if (annotations == null || annotations.length == 0) { auditClass(Audit.Action.UPDATE, changeSpec); return; } for (Audit annotation : annotations) { if (annotation.action().length == 1 && annotation.action()[0] == Audit.Action.UPDATE) { <START> LogMessageImpl message = new LogMessageImpl(annotation, this, Optional.of(changeSpec)); <END> getRequestScope().getAuditLogger().log(message); } else { throw new InvalidSyntaxException("Only Audit.Action.UPDATE is allowed on fields."); } } }</code><technical_language>suggestion LogMessage message = new LogMessageImpl(annotation, this, Optional.of(changeSpec));</technical_language>

Target:
protected void auditField(final ChangeSpec changeSpec) { final String fieldName = changeSpec.getFieldName(); Audit[] annotations = dictionary.getAttributeOrRelationAnnotations(getResourceClass(), Audit.class, fieldName ); if (annotations == null || annotations.length == 0) { auditClass(Audit.Action.UPDATE, changeSpec); return; } for (Audit annotation : annotations) { if (annotation.action().length == 1 && annotation.action()[0] == Audit.Action.UPDATE) { LogMessage message = new LogMessageImpl(annotation, this, Optional.of(changeSpec)); getRequestScope().getAuditLogger().log(message); } else { throw new InvalidSyntaxException("Only Audit.Action.UPDATE is allowed on fields."); } } }
Source:
<code>private void pull(Launcher launcher, FilePath repository, TaskListener listener, PrintStream output, Node node) throws IOException, InterruptedException { ArgumentListBuilder cmd = findHgExe(node, listener, false); cmd.add("pull"); <START> PossiblyCachedRepo cachedSource = cachedSource(node, launcher, listener, true); <END> if (cachedSource != null) { cmd.add(cachedSource.getRepoLocation()); } joinWithPossibleTimeout( launch(launcher).cmds(cmd).stdout(output).pwd(repository), true, listener); }</code><technical_language>This a job watching a single branch pull in full repo, substantially larger. Is another solution</technical_language>

Target:
private void pull(Launcher launcher, FilePath repository, TaskListener listener, PrintStream output, Node node) throws IOException, InterruptedException { ArgumentListBuilder cmd = findHgExe(node, listener, false); cmd.add("pull"); branchSelector.select(cmd); doPull(cmd, launcher, repository, listener, output, node); }
Source:
<code>public void ignoresWrongFile() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:2"; final User user = base.user(new URN(urn)); user.aliases().add("jeff2"); final Alias alias = user.aliases().iterate().iterator().next(); final long bout = alias.inbox().start(); alias.inbox().bout(bout).friends().invite(alias.name()); final String file = "test.bin"; final RqWithAuth request = new RqWithAuth( urn, new RqMultipart.Fake( TkAttachTest.fake(bout), new RqWithHeaders( new Request() { @Override public Iterable<String> head() throws IOException { return new LinkedList<>(); } @Override public InputStream body() throws IOException { return new ByteArrayInputStream("".getBytes()); } }, String.format(TkAttachTest.POST_URL, bout), String.format("Content-Disposition: form-data; name=\"file\"; filename=\"%s\"", file), "Content-Type: application/octet-stream" ) ) ); try { new FkBout(".*$", new TkAttach(base)).route(request); } catch (final RsFailure ex) { MatcherAssert.assertThat( "file unexpectedly exists after attach failure", new Attachments.Search( alias.inbox().bout(bout).attachments() ).exists(file), Matchers.is(false) ); return; } <START> Assert.fail("Expected RsFailure exception but nothing was thrown"); <END> }</code><technical_language>@exper0 move this line catch remove return in catch clause</technical_language>

Target:
public void ignoresWrongFile() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:2"; final User user = base.user(new URN(urn)); user.aliases().add("jeff2"); final Alias alias = user.aliases().iterate().iterator().next(); final long bout = alias.inbox().start(); alias.inbox().bout(bout).friends().invite(alias.name()); final String file = "test.bin"; final RqWithAuth request = new RqWithAuth( urn, new RqMultipart.Fake( TkAttachTest.fake(bout), new RqWithHeaders( TkAttachTest.body(""), String.format(TkAttachTest.POST_URL, bout), String.format("Content-Disposition: form-data; name=\"file\"; filename=\"%s\"", file), "Content-Type: application/octet-stream" ) ) ); try { new FkBout(".*$", new TkAttach(base)).route(request); Assert.fail("Expected RsFailure exception but nothing was thrown"); } catch (final RsFailure ex) { MatcherAssert.assertThat( "file unexpectedly exists after attach failure", new Attachments.Search( alias.inbox().bout(bout).attachments() ).exists(file), Matchers.is(false) ); } }
Source:
<code><START> public HealthAwareRecorder(String pluginName) { <END> this.pluginName = "[" + pluginName + "] "; }</code><technical_language>Note clearer for this marked protected: class is abstract this constructor called subclass constructors</technical_language>

Target:
protected HealthAwareRecorder(String pluginName) { this.pluginName = "[" + pluginName + "] "; }
Source:
<code>public void testFilterPluginErrorsOnly() throws Exception { String warningId = ingestXmlFromResourceAndWait(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); String errorId = ingestXmlFromResourceAndWait(ERROR_METACARD); Dictionary<String, Object> filterPluginProps = configureMetacardValidityFilterPlugin( Collections.singletonList("invalid-state=data-manager"), true, false, getAdminConfig()); <START> testWithRetry( <END> () -> { query(warningId, TRANSFORMER_XML, HttpStatus.SC_OK); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); query(errorId, TRANSFORMER_XML, HttpStatus.SC_NOT_FOUND); }); configureMetacardValidityFilterPlugin(filterPluginProps, getAdminConfig()); }</code><technical_language>Do need this test retry wait for configuration updated in ConfigureTestCommons now</technical_language>

Target:
public void testFilterPluginErrorsOnly() throws Exception { String warningId = ingestXmlFromResourceAndWait(WARNING_METACARD); String cleanId = ingestXmlFromResourceAndWait(CLEAN_METACARD); String errorId = ingestXmlFromResourceAndWait(ERROR_METACARD); Dictionary<String, Object> filterPluginProps = configureMetacardValidityFilterPlugin( Collections.singletonList("invalid-state=data-manager"), true, false, getAdminConfig()); query(warningId, TRANSFORMER_XML, HttpStatus.SC_OK); query(cleanId, TRANSFORMER_XML, HttpStatus.SC_OK); query(errorId, TRANSFORMER_XML, HttpStatus.SC_NOT_FOUND); configureMetacardValidityFilterPlugin(filterPluginProps, getAdminConfig()); }
Source:
<code>private int writeBytes(PutRecordRequest putRecordRequest, Object data) { ByteBuffer buffer; if (data instanceof ByteBuffer) { buffer = (ByteBuffer) data; } else if (data instanceof byte []) { buffer = ByteBuffer.wrap((byte []) data); } else { LOG.debug("Type is not supported for writing to stream", data.getClass().getName()); <START> return 0; <END> } putRecordRequest.setData(buffer); kinesisClient.putRecord(putRecordRequest); return 1; }</code><technical_language>this throw error</technical_language>

Target:
private int writeBytes(PutRecordRequest putRecordRequest, Object data) { ByteBuffer buffer; if (data instanceof ByteBuffer) { buffer = (ByteBuffer) data; } else if (data instanceof byte[]) { buffer = ByteBuffer.wrap((byte[]) data); } else { throw new IllegalStateException(String.format("Type %s is not supported for writing to stream", data.getClass().getName())); } putRecordRequest.setData(buffer); return putRecord(putRecordRequest); }
Source:
<code><START> public int hashCode() { <END> return Objects.hash(uuid, address1); }</code><technical_language>do need this fields ? if please add fields hashcode equals</technical_language>

Target:
public int hashCode() { return Objects.hash(uuid, address1, address2, cityVillage, stateProvince, country, postalCode, countryDistrict, address3, address4, address5, address6, startDate, endDate, latitude, longitude); }
Source:
<code>public List<BaragonConfigFile> synchronouslySendRenderConfigsRequest(String serviceId) throws Exception { final Set<String> loadBalancers = Sets.newHashSet(); final Optional<BaragonService> maybeOriginalService = stateDatastore.getService(serviceId); if (maybeOriginalService.isPresent()) { loadBalancers.addAll(maybeOriginalService.get().getLoadBalancerGroups()); } else { throw new BaragonWebException(String.format("Service with id=%s could not be found", serviceId)); } List<BaragonAgentMetadata> agents = agentManager.getAgents(loadBalancers).stream().collect(Collectors.toList()); BaragonAgentMetadata randomAgent = agents.get(RANDOM.nextInt(agents.size())); final String baseUrl = randomAgent.getBaseAgentUri(); final HttpRequest.Builder builder = HttpRequest.newBuilder().setUrl(baseUrl + "/renderedConfigs/" + serviceId); HttpResponse response = httpClient.execute(builder.build()); LOG.info(String.format("Got %s response from BaragonAgent", response.getStatusCode())); if (response.isError()) { throw new AgentServiceNotifyException(String.format("Bad response received from BaragonService %s", response.getAsString())); } <START> return response.getAs(new TypeReference<List<BaragonConfigFile>>(){}); <END> }</code><technical_language>nit, type reference a private static final class</technical_language>

Target:
public List<BaragonConfigFile> synchronouslySendRenderConfigsRequest(String serviceId) throws Exception { final Set<String> loadBalancers = Sets.newHashSet(); final Optional<BaragonService> maybeOriginalService = stateDatastore.getService(serviceId); if (maybeOriginalService.isPresent()) { loadBalancers.addAll(maybeOriginalService.get().getLoadBalancerGroups()); } else { throw new BaragonWebException(String.format("Service with id=%s could not be found", serviceId)); } List<BaragonAgentMetadata> agents = agentManager.getAgents(loadBalancers).stream().collect(Collectors.toList()); BaragonAgentMetadata randomAgent = agents.get(RANDOM.nextInt(agents.size())); final String baseUrl = randomAgent.getBaseAgentUri(); final HttpRequest.Builder builder = HttpRequest.newBuilder().setUrl(baseUrl + "/renderedConfigs/" + serviceId); HttpResponse response = httpClient.execute(builder.build()); LOG.info(String.format("Got %s response from BaragonAgent", response.getStatusCode())); if (response.isError()) { throw new AgentServiceNotifyException(String.format("Bad response received from BaragonService %s", response.getAsString())); } return response.getAs(BARAGON_CONFIG_FILE_LIST_TYPE_REFERENCE); }
Source:
<code>protected ILabelProvider getLabelProvider() { if (labelProvider == null) { try { labelProvider = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, input) .getLabelProvider(); } catch (ServiceException e) { <START> Activator.getDefault().error(e.getMessage(), e); <END> } } return labelProvider; }</code><technical_language>Okay, label provider is null. then? get NPEs in places getLabelProvider() is called</technical_language>

Target:
protected ILabelProvider getLabelProvider() { try { labelProvider = ServiceUtilsForEObject.getInstance().getService(LabelProviderService.class, input) .getLabelProvider(); } catch (ServiceException e) { Activator.getDefault().error(e.getMessage(), e); labelProvider = new UMLLabelProvider(); } return labelProvider; }
Source:
<code>private void registerSessionListenerForCurrentUser() { mMediaSessionManager.removeOnActiveSessionsChangedListener(mActiveMediaSessionListener); mMediaSessionManager.addOnActiveSessionsChangedListener(mActiveMediaSessionListener, null, <START> UserHandle.USER_CURRENT, null); <END> }</code><technical_language>call update media controller called re-registering for new user? If so, remove move updateMediaController move this method</technical_language>

Target:
private void registerSessionListenerForCurrentUser() { mMediaSessionManager.removeOnActiveSessionsChangedListener(mActiveMediaSessionListener); mMediaSessionManager.addOnActiveSessionsChangedListener(mActiveMediaSessionListener, null, UserHandle.USER_CURRENT, null); updateMediaController(mMediaSessionManager.getActiveSessionsForUser(null, UserHandle.USER_CURRENT)); }
Source:
<code>void letPass() { BusFilter<CommandEnvelope> filter = new BusFilters.Accepting(); Optional<Ack> ack = filter.filter(commandEnvelope); <START> Truth8.assertThat(ack).isEmpty(); <END> }</code><technical_language>Please import assertThat statically in other places</technical_language>

Target:
void letPass() { BusFilter<CommandEnvelope> filter = new BusFilters.Accepting(); Optional<Ack> ack = filter.filter(commandEnvelope); assertThat(ack).isEmpty(); }
Source:
<code>public void checkAmbiguousUri() { for (Map.Entry<String, List<ResourceInvoker>> entry : this.root.getBounded().entrySet()) { List<ResourceInvoker> values = entry.getValue(); if (values.size() > 1) { int locatorCnt = 0; int methodCnt = 0; for(ResourceInvoker rInvoker : values) { if (rInvoker instanceof ResourceLocatorInvoker) { locatorCnt++; } else if (rInvoker instanceof ResourceMethodInvoker) { methodCnt++; } } if (methodCnt > 0 && locatorCnt > 0) { StringBuilder sb = new StringBuilder(); for (ResourceInvoker exp : values) { sb.append(exp.getMethod().getDeclaringClass().getName() + "." + exp.getMethod().getName()+ ", "); } LogMessages.LOGGER.uriAmbiguity(entry.getKey(), sb.toString().substring(0, sb.toString().length()-2)); } } } <START> } <END></code><technical_language>StringBuilder instance here. sb.append(exp.getMethod().getDeclaringClass().getName()).append(".").append(exp.getMethod().getName()).append(", ); avoid creating useless String instances</technical_language>

Target:
public void checkAmbiguousUri() { for (Map.Entry<String, List<ResourceInvoker>> entry : this.root.getBounded().entrySet()) { List<ResourceInvoker> values = entry.getValue(); if (values.size() > 1) { int locatorCnt = 0; int methodCnt = 0; for(ResourceInvoker rInvoker : values) { if (rInvoker instanceof ResourceLocatorInvoker) { locatorCnt++; } else if (rInvoker instanceof ResourceMethodInvoker) { methodCnt++; } } if (methodCnt > 0 && locatorCnt > 0) { StringBuilder sb = new StringBuilder(); int cnt = values.size(); for (int i=0; i < cnt; i++) { ResourceInvoker exp = values.get(i); sb.append(exp.getMethod().getDeclaringClass().getName()) .append(".") .append(exp.getMethod().getName()); if (i < cnt-1) { sb.append(", "); } } LogMessages.LOGGER.uriAmbiguity(entry.getKey(), sb.toString()); } } } }
Source:
<code>public CaseInsensitiveDictionaryMap(Map<? extends K, ? extends V> map) { this(initialCapacity(map.size())); for (Entry<? extends K, ? extends V> e : map.entrySet()) { K key = e.getKey(); <START> V value = e.getValue(); <END> if (key != null && value != null) { if (put(key, value) != null) { throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key)); } } } }</code><technical_language>I test for non-null key calling getValue</technical_language>

Target:
public CaseInsensitiveDictionaryMap(Map<? extends K, ? extends V> map) { this(initialCapacity(map.size())); for (Entry<? extends K, ? extends V> e : map.entrySet()) { K key = e.getKey(); if (key != null) { V value = e.getValue(); if (value != null) { if (put(key, value) != null) { throw new IllegalArgumentException(NLS.bind(Msg.HEADER_DUPLICATE_KEY_EXCEPTION, key)); } } } } }
Source:
<code>public void testSeekEvent_location() { <START> final CtfLocationData loation2 = new CtfLocationData(1L, 0L); <END> CtfLocation ctfLocation = new CtfLocation(loation2); ITmfContext result = fixture.seekEvent(ctfLocation); assertNotNull(result); }</code><technical_language>location2</technical_language>

Target:
public void testSeekEvent_location() { final CtfLocationData location2 = new CtfLocationData(1L, 0L); CtfLocation ctfLocation = new CtfLocation(location2); ITmfContext result = fixture.seekEvent(ctfLocation); assertNotNull(result); }
Source:
<code>public BooleanWrapper disconnect() { try { getMonitoringOrFail().removeRMEventListener(); <START> } catch (Exception ignored) { <END> } BooleanWrapper r = target.disconnect(); return r; }</code><technical_language>I guess understand this exception is inclusive. However, for debugging purpose, great notify failure, why. A debug in logs adapted</technical_language>

Target:
public BooleanWrapper disconnect() { try { getMonitoringOrFail().removeRMEventListener(); } catch (Exception ignored) { logger.debug("", ignored); } BooleanWrapper r = target.disconnect(); return r; }
Source:
<code>private void rebuildIndexRows(Map<byte[], List<Mutation>> indexKeyToMutationMap, List<Mutation> oldIndexRowsToBeDeletedList, IndexToolVerificationResult verificationResult) throws IOException { if (ignoreIndexRebuildForTesting) { return; } try { int batchSize = 0; List<Mutation> indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (List<Mutation> mutationList : indexKeyToMutationMap.values()) { indexUpdates.addAll(mutationList); batchSize += mutationList.size(); if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (Mutation mutation : oldIndexRowsToBeDeletedList) { indexUpdates.add(mutation); batchSize ++; if (batchSize >= maxBatchSize) { indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); <START> indexHTable.batch(indexUpdates); <END> } if (verify) { verificationResult.setRebuiltIndexRowCount(verificationResult.getRebuiltIndexRowCount() + indexKeyToMutationMap.size()); } } catch (Throwable t) { ServerUtil.throwIOException(indexHTable.getName().toString(), t); } }</code><technical_language>missed for loop this (line 903)</technical_language>

Target:
private void rebuildIndexRows(Map<byte[], List<Mutation>> indexKeyToMutationMap, List<Mutation> oldIndexRowsToBeDeletedList, IndexToolVerificationResult verificationResult) throws IOException { if (ignoreIndexRebuildForTesting) { return; } try { int batchSize = 0; List<Mutation> indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (List<Mutation> mutationList : indexKeyToMutationMap.values()) { indexUpdates.addAll(mutationList); batchSize += mutationList.size(); if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (Mutation mutation : oldIndexRowsToBeDeletedList) { indexUpdates.add(mutation); batchSize ++; if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); indexHTable.batch(indexUpdates); } if (verify) { verificationResult.setRebuiltIndexRowCount(verificationResult.getRebuiltIndexRowCount() + indexKeyToMutationMap.size()); } } catch (Throwable t) { ServerUtil.throwIOException(indexHTable.getName().toString(), t); } }
Source:
<code>String getSeasonName(final String value, final List<ValueReference> possibleValues) { if (possibleValues != null && !possibleValues.isEmpty()) { for (final ValueReference valueReference : possibleValues) { if (StringUtils.isNumeric(value) && valueReference.getId().intValue() == Integer.parseInt(value)) { return valueReference.getName(); } else if (valueReference.getDescription().equals(value)) { return valueReference.getName(); <START> } <END> } } return value; }</code><technical_language>conditions returning **valueReference.getName();** do need if else</technical_language>

Target:
String getSeasonName(final String value, final List<ValueReference> possibleValues) { if (possibleValues != null && !possibleValues.isEmpty()) { for (final ValueReference valueReference : possibleValues) { if ((StringUtils.isNumeric(value) && valueReference.getId().intValue() == Integer.parseInt(value)) || valueReference.getDescription().equals(value)) { return valueReference.getName(); } } } return value; }
Source:
<code>public BenchmarkRequestSubscriber(Meter successMeter, Meter failureMeter, Semaphore concurrencyControlSemaphore, AtomicLong count) { this.successMeter = successMeter; this.failureMeter = failureMeter; this.concurrencyControlSemaphore = concurrencyControlSemaphore; this.count = count; <START> logger = LoggerFactory.getLogger(this.getClass()); <END> }</code><technical_language>this class is instantiated in a for loop in benchmark, meaning logger initialization called for loop iteration. logger static avoid initialization cost loop iteration</technical_language>

Target:
public BenchmarkRequestSubscriber(Meter successMeter, Meter failureMeter, Semaphore concurrencyControlSemaphore, AtomicLong count) { this.successMeter = successMeter; this.failureMeter = failureMeter; this.concurrencyControlSemaphore = concurrencyControlSemaphore; this.count = count; }
Source:
<code>public CheWsAgentCorsAllowedOriginsProvider( @Named("che.api") String apiEndpoint, @Nullable @Named("che.wsagent.cors.allowed_origins") String allowedOrigins, HttpJsonRequestFactory httpJsonRequestFactory) throws ApiException, IOException { this.apiEndpoint = apiEndpoint; <START> if (allowedOrigins == null) { <END> final UriBuilder builder = UriBuilder.fromUri(apiEndpoint) .path(WorkspaceService.class) .path(WorkspaceService.class, "getByKey") .queryParam("includeInternalServers", "true"); String href = builder.build(System.getenv("CHE_WORKSPACE_ID")).toString(); WorkspaceDto workspaceDto = httpJsonRequestFactory.fromUrl(href).useGetMethod().request().asDto(WorkspaceDto.class); String ideUrl = getIdeUrl(workspaceDto); if (ideUrl != null) { this.allowedOrigins = UriBuilder.fromUri(ideUrl).replacePath(null).build().toString(); } else { this.allowedOrigins = UriBuilder.fromUri(workspaceDto.getLinks().getOrDefault("ide", apiEndpoint)) .replacePath(null) .build() .toString(); } } else { this.allowedOrigins = allowedOrigins; } }</code><technical_language>heavy logic for constructor. if rewrite in way: java public CheWsAgentCorsAllowedOriginsProvider(@Named("env.CHE_WORKSPACE_ID") String wsId, ....) { .... this.allowedOrigins = evaluateOrigins(allowedOrigins, wsId); } private String evaluateOrigins(....) { if (allowedOrigins != null) { return allowedOrigins } WorkpsaceDto workpsace = fetchWorkpace(workspaceId); Optional<String> ideServerURL = findIdeServerURL(workpsace); if (ideServerURL.isPresent()) { return UriBuilder.fromUri(ideServerURL.get()).replacePath(null).build().toString(); } return UriBuilder.fromUri(workspaceDto.getLinks().getOrDefault("ide", apiEndpoint)) .replacePath(null) .build() .toString(); } WDYT</technical_language>

Target:
public CheWsAgentCorsAllowedOriginsProvider( @Named("che.api") String apiEndpoint, @Nullable @Named("che.wsagent.cors.allowed_origins") String allowedOrigins, HttpJsonRequestFactory httpJsonRequestFactory) throws ApiException, IOException { this.allowedOrigins = evaluateOrigins(apiEndpoint, allowedOrigins, httpJsonRequestFactory); }
Source:
<code>public boolean renderOutput(PrintStream out, OutputFormat outputFormat, boolean interactive) { Thread clientThread = Thread.currentThread(); SignalHandler oldHandler = Signal.handle(SIGINT, signal -> { if (ignoreUserInterrupt.get() || client.isAborted()) { return; } <START> userAbortedQuery.set(true); <END> client.close(); clientThread.interrupt(); }); try { return renderQueryOutput(out, outputFormat, interactive); } finally { Signal.handle(SIGINT, oldHandler); Thread.interrupted(); } }</code><technical_language>get rid of this</technical_language>

Target:
public boolean renderOutput(PrintStream out, OutputFormat outputFormat, boolean interactive) { Thread clientThread = Thread.currentThread(); SignalHandler oldHandler = Signal.handle(SIGINT, signal -> { if (ignoreUserInterrupt.get() || client.isClientAborted()) { return; } client.close(); clientThread.interrupt(); }); try { return renderQueryOutput(out, outputFormat, interactive); } finally { Signal.handle(SIGINT, oldHandler); Thread.interrupted(); } }
Source:
<code>public WorldcatFetcher (String worldcatKey) { <START> API_KEY = worldcatKey; <END> }</code><technical_language>Codacy complains here: "Possible unsafe assignment a non-final static field in a constructor.". I think, right static variable in line 29 replaced instance variable Check <LINK_0> for details</technical_language>

Target:
public WorldcatFetcher(String worldcatKey) { WORLDCAT_OPEN_SEARCH_URL += worldcatKey; WORLDCAT_READ_URL += worldcatKey; }
Source:
<code>public void testBlockingChannelInfoForPlainText() throws Exception { <START> testBlockingChannelInfo("127.0.0.1", new Port(6667, PortType.PLAINTEXT), 5, 2); <END> }</code><technical_language>2? matter number send argument right</technical_language>

Target:
public void testBlockingChannelInfoForPlainText() throws Exception { testBlockingChannelInfo("127.0.0.1", new Port(6667, PortType.PLAINTEXT), 5, 5); }
Source:
<code>private void initPreferences() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Settings.nativeTongue = sp.getString(PREF_KEY_NATIVE_TONGUE, SUPPORTED_LANGUAGES[0]); Settings.contributeRecordings = sp.getBoolean(PREF_KEY_CONTRIBUTE_SND, true); Log.d("AAA", "nativeTongue: " + Settings.nativeTongue); <START> Log.d("AAA", "contributeRecordings: " + Settings.contributeRecordings); <END> }</code><technical_language>create a static variable store Log's tag</technical_language>

Target:
private void initPreferences() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); Settings.nativeTongue = sp.getString(PREF_KEY_NATIVE_TONGUE, SUPPORTED_LANGUAGES[0]); Settings.contributeRecordings = sp.getBoolean(PREF_KEY_CONTRIBUTE_SND, true); }
Source:
<code>protected void configure() { addExposedPort(POSTGRESQL_PORT); <START> withUrlParam("loggerLevel", "OFF"); <END> addEnv("POSTGRES_DB", databaseName); addEnv("POSTGRES_USER", username); addEnv("POSTGRES_PASSWORD", password); }</code><technical_language>I investigated this does, a bit weird. I understand if default logging level DEBUG so, I errors warnings default (i.e. investigate change this manually). Please disregard if I missed something</technical_language>

Target:
protected void configure() { withUrlParam("loggerLevel", "OFF"); addEnv("POSTGRES_DB", databaseName); addEnv("POSTGRES_USER", username); addEnv("POSTGRES_PASSWORD", password); }
Source:
<code>private Pair<DbEndpoint, Connection> connectToBestAvailableEndpoint(boolean needWritable) throws SQLException { SQLException lastException = null; for (DbEndpoint dbEndpoint : sortedDbEndpoints) { if (!isBetterEndpoint(dbEndpoint, connectedEndpoint)) { if (needWritable && !connectedEndpoint.isWriteable()) { throw new SQLException("Could not connect to any writable database"); } else { return new Pair<>(connectedEndpoint, activeConnection); } } if (needWritable && !dbEndpoint.isWriteable()) { <START> continue; <END> } Properties credentials = new Properties(); credentials.setProperty("user", dbEndpoint.getUsername()); credentials.setProperty("password", dbEndpoint.getPassword()); try { Connection connection = mysqlDriver.connect(dbEndpoint.getUrl(), credentials); return new Pair<>(dbEndpoint, connection); } catch (SQLException e) { logger.warn("Unable to connect to endpoint due to {}", dbEndpoint.getUrl(), e.getMessage()); if (isCredentialError(e)) { throw e; } else { lastException = e; } } } if (lastException != null) { throw lastException; } else { throw new IllegalStateException("No suitable connection found"); } }</code><technical_language>returning too? db end points sorted writable property, remaining read-only ones</technical_language>

Target:
private Pair<DbEndpoint, Connection> connectToBestAvailableEndpoint(boolean needWritable) throws SQLException { SQLException lastException = null; for (DbEndpoint candidateEndpoint : sortedDbEndpoints) { if (!isBetterEndpoint(candidateEndpoint, connectedEndpoint)) { if (needWritable && !connectedEndpoint.isWriteable()) { throw Optional.ofNullable(lastException).orElse(noWritableEndpointException); } else { return new Pair<>(connectedEndpoint, activeConnection); } } if (needWritable && !candidateEndpoint.isWriteable()) { throw Optional.ofNullable(lastException).orElse(noWritableEndpointException); } Properties credentials = new Properties(); credentials.setProperty("user", candidateEndpoint.getUsername()); credentials.setProperty("password", candidateEndpoint.getPassword()); try { Connection connection = mysqlDriver.connect(candidateEndpoint.getUrl(), credentials); metrics.connectionSuccessCount.inc(); return new Pair<>(candidateEndpoint, connection); } catch (SQLException e) { logger.warn("Unable to connect to endpoint due to {}", candidateEndpoint.getUrl(), e.getMessage()); metrics.connectionFailureCount.inc(); if (isCredentialError(e)) { throw e; } else { lastException = e; } } } throw Optional.ofNullable(lastException).orElse(noEndpointException); }
Source:
<code>public void testClientScopesPolicy() throws Exception { setTrustedHost("localhost"); <START> ClientScopeRepresentation clientTemplate = new ClientScopeRepresentation(); <END> clientTemplate.setName("foo"); Response response = realmResource().clientScopes().create(clientTemplate); String clientScopeId = ApiUtil.getCreatedId(response); response.close(); ClientRepresentation clientRep = createRep("test-app"); clientRep.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.CREATE, clientRep, 403, "Not permitted to use specified clientScope"); clientRep.setDefaultClientScopes(null); ClientRepresentation registeredClient = reg.create(clientRep); reg.auth(Auth.token(registeredClient)); registeredClient.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.UPDATE, registeredClient, 403, "Not permitted to use specified clientScope"); ClientResource client = ApiUtil.findClientByClientId(realmResource(), "test-app"); client.addDefaultClientScope(clientScopeId); reg.update(registeredClient); realmResource().clients().get(client.toRepresentation().getId()).remove(); realmResource().clientScopes().get(clientScopeId).remove(); }</code><technical_language>clientTemplate > clientScope</technical_language>

Target:
public void testClientScopesPolicy() throws Exception { setTrustedHost("localhost"); ClientScopeRepresentation clientScope = new ClientScopeRepresentation(); clientScope.setName("foo"); Response response = realmResource().clientScopes().create(clientScope); String clientScopeId = ApiUtil.getCreatedId(response); response.close(); ClientRepresentation clientRep = createRep("test-app"); clientRep.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.CREATE, clientRep, 403, "Not permitted to use specified clientScope"); clientRep.setDefaultClientScopes(null); ClientRepresentation registeredClient = reg.create(clientRep); reg.auth(Auth.token(registeredClient)); registeredClient.setDefaultClientScopes(Collections.singletonList("foo")); assertFail(ClientRegOp.UPDATE, registeredClient, 403, "Not permitted to use specified clientScope"); ClientResource client = ApiUtil.findClientByClientId(realmResource(), "test-app"); client.addDefaultClientScope(clientScopeId); reg.update(registeredClient); realmResource().clients().get(client.toRepresentation().getId()).remove(); realmResource().clientScopes().get(clientScopeId).remove(); }
Source:
<code>public void ClickTrackingArticleEditMode_001_verifyPreviewModalEvents() { WikiBasePageObject base = new WikiBasePageObject(driver); base.openMainPage(wikiURL); NavigationBar navbar = new NavigationBar(driver); <START> navbar.executeScript(script); <END> ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article.editArticleInRTEUsingDropdown(); visualEditMode.verifyContentLoaded(); visualEditMode.executeScript(ClickTrackingScriptsProvider.TRACKER_INSTALLATION); visualEditMode.previewArticle(); List<JsonObject> expectedEvents = Arrays.asList( EventsArticleEditMode.previewEvent ); visualEditMode.compareTrackedEventsTo(expectedEvents); }</code><technical_language>executeScript() NavigationBar? base</technical_language>

Target:
public void ClickTrackingArticleEditMode_001_verifyPreviewModalEvents() { WikiBasePageObject base = new WikiBasePageObject(driver); ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article .editArticleInRTEUsingDropdown(); visualEditMode.verifyContentLoaded(); visualEditMode .executeScript(ClickTrackingScriptsProvider.TRACKER_INSTALLATION); visualEditMode.previewArticle(); List<JsonObject> expectedEvents = Arrays .asList(EventsArticleEditMode.previewEvent); visualEditMode.compareTrackedEventsTo(expectedEvents); }
Source:
<code>private void setAccountItemAttributes(AccountItem item, ContentValues cv, long accountId) { if (item.getDbId() != null) cv.put("id", item.getDbId()); cv.put("account", accountId); putOrNull(cv, "title", item.getTitle()); putOrNull(cv, "author", item.getAuthor()); putOrNull(cv, "format", item.getFormat()); putOrNull(cv, "itemid", item.getId()); putOrNull(cv, "status", item.getStatus()); putOrNull(cv, "cover", item.getCover()); <START> putOrNull(cv, "mediatype", item.getMediaType().toString()); <END> }</code><technical_language>This crashed for repeatedly APIs getMediaType returns null, e.g. Test API Adis</technical_language>

Target:
private void setAccountItemAttributes(AccountItem item, ContentValues cv, long accountId) { if (item.getDbId() != null) cv.put("id", item.getDbId()); cv.put("account", accountId); putOrNull(cv, "title", item.getTitle()); putOrNull(cv, "author", item.getAuthor()); putOrNull(cv, "format", item.getFormat()); putOrNull(cv, "itemid", item.getId()); putOrNull(cv, "status", item.getStatus()); putOrNull(cv, "cover", item.getCover()); putOrNull(cv, "mediatype", item.getMediaType() != null ? item.getMediaType().toString() : null); }
Source:
<code>if (properties.useDatastoreToReadData()) { try { <START> Datastore ds = new Datastore("<LINK_0>"); <END> File f = ds.getDirectory("org.cogcomp.comma-srl", "comma-srl-data", 2.2, false); ANNOTATION_SOURCE_DIR = f.getAbsolutePath() + File.separator + "comma-srl-data" + File.separator + "Bayraktar-SyntaxToLabel" + File.separator + "modified" + File.separator; } catch (DatastoreException e) { e.printStackTrace(); } }</code><technical_language>datastore URL a constant set in default configurator. Otherwise, if change datastore host, a lot of places in code need manually changed</technical_language>

Target:
if (properties.useDatastoreToReadData()) { try { Datastore ds = new Datastore(new ResourceConfigurator().getDefaultConfig()); File f = ds.getDirectory("org.cogcomp.comma-srl", "comma-srl-data", 2.2, false); ANNOTATION_SOURCE_DIR = f.getAbsolutePath() + File.separator + "comma-srl-data" + File.separator + "Bayraktar-SyntaxToLabel" + File.separator + "modified" + File.separator; } catch (Exception e) { e.printStackTrace(); } }
Source:
<code><START> private static void addAllAnnotations(List<PDAnnot> annotations, <END> List<PDAnnotation> pdfboxAnnotations) { for (PDAnnotation annotation : pdfboxAnnotations) { if (annotation != null) { annotations.add(new PBoxPDAnnot(annotation)); } } }</code><technical_language>remove static</technical_language>

Target:
private void addAllAnnotations(List<PDAnnot> annotations, List<PDAnnotation> pdfboxAnnotations) { for (PDAnnotation annotation : pdfboxAnnotations) { if (annotation != null) { annotations.add(new PBoxPDAnnot(annotation)); } } }
Source:
<code>public Optional<Boolean> getValueFromContainer(ValueContainer<?> container) { if (supports(container)) { net.minecraft.entity.Entity entity = ((net.minecraft.entity.Entity) container); <START> boolean isFlying = entity.isAirBorne; <END> return Optional.of(isFlying); } return Optional.absent(); }</code><technical_language>forgot check for EntityPlayer</technical_language>

Target:
public Optional<Boolean> getValueFromContainer(ValueContainer<?> container) { final boolean isFlying; if (supports(container)) { if (container instanceof EntityPlayer) { isFlying = ((EntityPlayer) container).capabilities.isFlying; } else { isFlying = ((Entity) container).isAirBorne; } return Optional.of(isFlying); } return Optional.absent(); }
Source:
<code>static ReceiveCommand parseCommand(String line) throws PackProtocolException { if (line.length() < 83) { <START> String m = JGitText.get().errorInvalidProtocolWantedOldNewRef; throw new PackProtocolException(m); <END> } String oldStr = line.substring(0, 40); String newStr = line.substring(41, 81); ObjectId oldId, newId; try { oldId = ObjectId.fromString(oldStr); newId = ObjectId.fromString(newStr); } catch (IllegalArgumentException e) { throw new PackProtocolException( JGitText.get().errorInvalidProtocolWantedOldNewRef, e); } String name = line.substring(82); if (!Repository.isValidRefName(name)) { throw new PackProtocolException( JGitText.get().errorInvalidProtocolWantedOldNewRef); } return new ReceiveCommand(oldId, newId, name); }</code><technical_language>(optional) inline of m</technical_language>

Target:
static ReceiveCommand parseCommand(String line) throws PackProtocolException { if (line == null || line.length() < 83) { throw new PackProtocolException( JGitText.get().errorInvalidProtocolWantedOldNewRef); } String oldStr = line.substring(0, 40); String newStr = line.substring(41, 81); ObjectId oldId, newId; try { oldId = ObjectId.fromString(oldStr); newId = ObjectId.fromString(newStr); } catch (IllegalArgumentException e) { throw new PackProtocolException( JGitText.get().errorInvalidProtocolWantedOldNewRef, e); } String name = line.substring(82); if (!Repository.isValidRefName(name)) { throw new PackProtocolException( JGitText.get().errorInvalidProtocolWantedOldNewRef); } return new ReceiveCommand(oldId, newId, name); }
Source:
<code>private void copyUploadedFileToReferenceDataDirectory() { final File tenantHome = getWizardContext().getTenantContext().getConfiguration().getHomeFolder().toFile(); final File referenceDataDirectory = new File(tenantHome.getAbsolutePath() + File.separator + "reference-data"); final File targetFile = new File(referenceDataDirectory.getAbsolutePath() + File.separator + _filePath); if (!referenceDataDirectory.exists() && !referenceDataDirectory.mkdirs()) { throw new DCUserInputException("Could not create directory for file:\n" + targetFile.getAbsolutePath()); <START> } <END> if (!referenceDataDirectory.canWrite()) { throw new DCUserInputException("Cannot write data to directory of file:\n" + targetFile.getAbsolutePath()); } final File temporaryFile = (File) getWizardContext().getHttpSession().eval(_sessionKey); FileHelper.copy(temporaryFile, targetFile); _filePath = targetFile.getAbsolutePath(); }</code><technical_language>removed usages of javax.xml.parsers.DoumentBuilder org.w3c.dom.Element class, imports removed. Next private method copyUploadedFileToReferenceDataDirectory is longer invoked, removed</technical_language>

Target:
protected void copyUploadedFileToReferenceDataDirectory() { final File tenantHome = getWizardContext().getTenantContext().getConfiguration().getHomeFolder().toFile(); final File referenceDataDirectory = new File(tenantHome.getAbsolutePath() + File.separator + "reference-data"); final File targetFile = new File(referenceDataDirectory.getAbsolutePath() + File.separator + _filePath); if (!referenceDataDirectory.exists() && !referenceDataDirectory.mkdirs()) { throw new DCUserInputException("Could not create directory for file:\n" + targetFile.getAbsolutePath()); } if (!referenceDataDirectory.canWrite()) { throw new DCUserInputException("Cannot write data to directory of file:\n" + targetFile.getAbsolutePath()); } final File temporaryFile = (File) getWizardContext().getHttpSession().eval(_sessionKey); FileHelper.copy(temporaryFile, targetFile); _filePath = targetFile.getAbsolutePath(); }
Source:
<code>void performCustomMigration() { ProjectId id = createId(42); TestProcessManagerRepository repository = repository(); TestProcessManager pm = new TestProcessManager(id); repository.store(pm); TargetFilters targetFilters = targetFilters(Project.Column.idString(), id.toString()); Iterator<TestProcessManager> found = repository.find(targetFilters, ResponseFormat.getDefaultInstance()); assertThat(found.hasNext()).isFalse(); repository.applyMigration(id, new SetTestProcessId()); Iterator<TestProcessManager> afterMigration = repository.find(targetFilters, ResponseFormat.getDefaultInstance()); assertThat(afterMigration.hasNext()).isTrue(); TestProcessManager entityWithColumns = afterMigration.next(); <START> assertThat(entityWithColumns.state() .getIdString()).isEqualTo(id.toString()); <END> }</code><technical_language>compare state ID only</technical_language>

Target:
void performCustomMigration() { ProjectId id = createId(42); TestProcessManagerRepository repository = repository(); TestProcessManager pm = new TestProcessManager(id); repository.store(pm); TargetFilters targetFilters = targetFilters(Project.Column.idString(), id.toString()); Iterator<TestProcessManager> found = repository.find(targetFilters, ResponseFormat.getDefaultInstance()); assertThat(found.hasNext()).isFalse(); repository.applyMigration(id, new SetTestProcessId()); Iterator<TestProcessManager> afterMigration = repository.find(targetFilters, ResponseFormat.getDefaultInstance()); assertThat(afterMigration.hasNext()).isTrue(); TestProcessManager entityWithColumns = afterMigration.next(); Project expectedState = pm .state() .toBuilder() .setIdString(pm.getIdString()) .build(); assertThat(entityWithColumns.state()).isEqualTo(expectedState); }
Source:
<code>public void testTransformNativeRserveMultipleExpressionInPlaceFalse() throws DDFException { Boolean inPlace = Boolean.FALSE; String[] expressions = {"newcol = deptime / arrtime","newcol2=log(arrdelay)"}; DDF newDdf3 = ddf.copy(); DDF newDdf4 = newDdf3.Transform.transformNativeRserve(expressions, inPlace); Assert.assertNotNull(newDdf3); Assert.assertNotNull(newDdf4); <START> Assert.assertFalse("With inPlace being false, two DDF should have different UUID", newDdf3.getUUID().equals(newDdf4.getUUID())); <END> }</code><technical_language>check for newcol in newDdf4</technical_language>

Target:
public void testTransformNativeRserveMultipleExpressionInPlaceFalse() throws DDFException { Boolean inPlace = Boolean.FALSE; String[] expressions = {"newcol = deptime / arrtime","newcol2=log(arrdelay)"}; DDF newDdf3 = ddf.copy(); DDF newDdf4 = newDdf3.Transform.transformNativeRserve(expressions, inPlace); Assert.assertNotNull(newDdf3); Assert.assertNotNull(newDdf4); Assert.assertFalse("With inPlace being false, two DDF should have different UUID", newDdf3.getUUID().equals(newDdf4.getUUID())); Assert.assertEquals("transformed DDF newDdf4 should have newcol added", "newcol", newDdf4.getColumnName(8)); Assert.assertEquals("transformed DDF newDdf4 should have newcol2 added", "newcol2", newDdf4.getColumnName(9)); }