auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); <START> ipw.println("DeviceStateMonitor:"); <END> ipw.increaseIndent(); ipw.println("mIsTetheringOn=" + mIsTetheringOn); ipw.println("mIsInteractive=" + mIsInteractive); ipw.println("mIsCharging=" + mIsCharging); ipw.println("mIsPowerSaveOn=" + mIsPowerSaveOn); ipw.println("mLegacyScreenState=" + mLegacyScreenState); ipw.println("mIsLowDataExpected=" + mIsLowDataExpected); ipw.println("mUnsolicitedResponseFilter=" + mUnsolicitedResponseFilter); ipw.println("++++++++++++++++++++++++++++++++"); ipw.println("Local logs:") ipw.increaseIndent(); mLocalLog.dump(fd, ipw, args); ipw.decreaseIndent(); ipw.decreaseIndent(); ipw.println("++++++++++++++++++++++++++++++++"); ipw.flush(); }</code><technical_language>put this in parent. context of dumping label this - if want dump array of this want this label for each</technical_language>

Target:
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); ipw.println("DeviceStateMonitor:"); ipw.increaseIndent(); ipw.println("mIsTetheringOn=" + mIsTetheringOn); ipw.println("mIsInteractive=" + mIsInteractive); ipw.println("mIsCharging=" + mIsCharging); ipw.println("mIsPowerSaveOn=" + mIsPowerSaveOn); ipw.println("mLegacyScreenState=" + mLegacyScreenState); ipw.println("mIsLowDataExpected=" + mIsLowDataExpected); ipw.println("mUnsolicitedResponseFilter=" + mUnsolicitedResponseFilter); ipw.println("++++++++++++++++++++++++++++++++"); ipw.println("Local logs:"); ipw.increaseIndent(); mLocalLog.dump(fd, ipw, args); ipw.decreaseIndent(); ipw.decreaseIndent(); ipw.println("++++++++++++++++++++++++++++++++"); ipw.flush(); }
Source:
<code>private String generateSnapshotTimestamp() { <START> int counter = 1; <END> SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd.hhmmss"); String timestamp = sdf.format(new Date()); StringBuilder builder = new StringBuilder(); builder.append(timestamp).append("-").append(counter); return builder.toString(); }</code><technical_language>counter is incremented. Is extra digit needed end, left entirely</technical_language>

Target:
private String generateSnapshotTimestamp() { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd.hhmmss"); String timestamp = sdf.format(new Date()); StringBuilder builder = new StringBuilder(); builder.append(timestamp).append("-1"); return builder.toString(); }
Source:
<code>public long indexGetCommittedId( IndexReference index ) throws SchemaRuleNotFoundException { sharedOptimisticLock( ResourceTypes.LABEL, index.label() ); ktx.assertOpen(); if ( index instanceof StoreIndexDescriptor ) { return ((StoreIndexDescriptor) index).getId(); } else { <START> return -1L; <END> } }</code><technical_language>throw. I this method eventually away</technical_language>

Target:
public long indexGetCommittedId( IndexReference index ) throws SchemaRuleNotFoundException { sharedOptimisticLock( ResourceTypes.LABEL, index.label() ); ktx.assertOpen(); if ( index instanceof StoreIndexDescriptor ) { return ((StoreIndexDescriptor) index).getId(); } else { throw new SchemaRuleNotFoundException( SchemaRule.Kind.INDEX_RULE, ((IndexDescriptor)index).schema() ); } }
Source:
<code>public void showError() { Snackbar snackbar = SnackBarHandler.create(coordinatorLayout, getString(no_account_signed_in)); <START> snackbar.show(); <END> }</code><technical_language>need save in a variable. call show</technical_language>

Target:
public void showError() { SnackBarHandler.create(coordinatorLayout, getString(no_account_signed_in)).show(); }
Source:
<code><START> public IndexWorker readObject(ObjectInput input) throws IOException, ClassNotFoundException { <END> String cacheName = (String) input.readObject(); int typesSize = input.readInt(); Set<IndexedTypeIdentifier> types = new HashSet<>(typesSize); if (typesSize > 0) { for (int i = 0; i < typesSize; i++) { types.add(PojoIndexedTypeIdentifier.convertFromLegacy((Class<?>) input.readObject())); } } boolean flush = input.readBoolean(); boolean clean = input.readBoolean(); boolean primaryOwner = input.readBoolean(); boolean skipIndex = input.readBoolean(); Set<Object> keys = (Set<Object>) input.readObject(); return new IndexWorker(cacheName, types, flush, clean, skipIndex, primaryOwner, keys); }</code><technical_language>Is initial capacity helping</technical_language>

Target:
public IndexWorker readObject(ObjectInput input) throws IOException, ClassNotFoundException { String cacheName = (String) input.readObject(); int typesSize = input.readInt(); Set<IndexedTypeIdentifier> types = new HashSet<>(typesSize); for (int i = 0; i < typesSize; i++) { types.add(PojoIndexedTypeIdentifier.convertFromLegacy((Class<?>) input.readObject())); } boolean flush = input.readBoolean(); boolean clean = input.readBoolean(); boolean primaryOwner = input.readBoolean(); boolean skipIndex = input.readBoolean(); Set<Object> keys = (Set<Object>) input.readObject(); return new IndexWorker(cacheName, types, flush, clean, skipIndex, primaryOwner, keys); }
Source:
<code>protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> vmIdSnapshotIdMap = new HashMap<>(); for (VM vm : vms) { try { Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.CreateAllSnapshotsFromVm, getCreateSnapshotParameters(vm), cloneContextAndDetachFromParent()); vmIdSnapshotIdMap.put(vm.getId(), future.get().getActionReturnValue()); } catch (InterruptedException | ExecutionException e) { <START> log.error("Error creating VM snapshots for DR sync", e.getMessage()); <END> log.debug("Exception", e); endWithFailure(); getParameters().setTaskGroupSuccess(false); } } getParameters().setVmIdSnapshotIds(vmIdSnapshotIdMap); getParameters().setNextStep(DRStep.GEO_REP); persistCommandIfNeeded(); setSucceeded(true); }</code><technical_language>please VM id name</technical_language>

Target:
protected void executeCommand() { List<VM> vms = runInternalQuery(VdcQueryType.GetVmsByStorageDomain, new IdQueryParameters(getStorageDomain().getId())) .getReturnValue(); Map<Guid, Guid> vmIdSnapshotIdMap = new HashMap<>(); for (VM vm : vms) { try { Future<VdcReturnValueBase> future = CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.CreateAllSnapshotsFromVm, getCreateSnapshotParameters(vm), cloneContextAndDetachFromParent()); vmIdSnapshotIdMap.put(vm.getId(), future.get().getActionReturnValue()); } catch (InterruptedException | ExecutionException e) { log.error("Error creating VM snapshot for VM with id '{}', name '{}' for DR sync", vm.getId(), vm.getName(), e.getMessage()); log.debug("Exception", e); endWithFailure(); getParameters().setTaskGroupSuccess(false); } } getParameters().setVmIdSnapshotIds(vmIdSnapshotIdMap); getParameters().setNextStep(DRStep.GEO_REP); persistCommandIfNeeded(); setSucceeded(true); }
Source:
<code>public void handleError(String error) { if (!TextUtils.isEmpty(error)) { Spanned result = Html.fromHtml(error); mErrorTextView.setText(result); mErrorTextView.setVisibility(View.VISIBLE); <START> mTextInputLayout.setContentDescription(String.format("%s. %s. Error, %s.", mField.getLabel(), mField.getInstructions(), error)); <END> } else { logger.warn("error message not provided, so not informing the user about this error"); } }</code><technical_language>This localization friendly. move word Error strings.xml file</technical_language>

Target:
public void handleError(String error) { if (!TextUtils.isEmpty(error)) { Spanned result = Html.fromHtml(error); mErrorTextView.setText(result); mErrorTextView.setVisibility(View.VISIBLE); final String errorTag = mTextInputLayout.getResources().getString(R.string.label_error); mTextInputLayout.setContentDescription(String.format("%s. %s. %s, %s.", mField.getLabel(), mField.getInstructions(), errorTag, error)); } else { logger.warn("error message not provided, so not informing the user about this error"); } }
Source:
<code>protected ActionProxy getActionProxy(String httpMethod, String uri) { request.setRequestURI(uri); request.setMethod(httpMethod); ActionMapping mapping = getActionMapping(request); String namespace = mapping.getNamespace(); String name = mapping.getName(); String method = mapping.getMethod(); Configuration config = configurationManager.getConfiguration(); ActionProxy proxy = config.getContainer() .getInstance(ActionProxyFactory.class) .createActionProxy(namespace, name, method, new HashMap<>(), true, false); ActionContext invocationContext = proxy.getInvocation().getInvocationContext(); invocationContext.getContextMap().put(ServletActionContext.ACTION_MAPPING, mapping); invocationContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); <START> ActionContext.bound(invocationContext); <END> ServletActionContext.setServletContext(servletContext); ServletActionContext.setRequest(request); ServletActionContext.setResponse(response); return proxy; }</code><technical_language>candidate for bind() if method is created</technical_language>

Target:
protected ActionProxy getActionProxy(String httpMethod, String uri) { request.setRequestURI(uri); request.setMethod(httpMethod); ActionMapping mapping = getActionMapping(request); String namespace = mapping.getNamespace(); String name = mapping.getName(); String method = mapping.getMethod(); Configuration config = configurationManager.getConfiguration(); ActionProxy proxy = config.getContainer() .getInstance(ActionProxyFactory.class) .createActionProxy(namespace, name, method, new HashMap<>(), true, false); ActionContext invocationContext = proxy.getInvocation().getInvocationContext(); invocationContext.getContextMap().put(ServletActionContext.ACTION_MAPPING, mapping); invocationContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); ActionContext.bind(invocationContext); ServletActionContext.setServletContext(servletContext); ServletActionContext.setRequest(request); ServletActionContext.setResponse(response); return proxy; }
Source:
<code>public ValueRange range(final TemporalField field) { boolean special = isYearDay() || isLeapDay(); if (field instanceof ChronoField) { if (isSupported(field)) { ChronoField f = (ChronoField) field; switch (f) { case ALIGNED_DAY_OF_WEEK_IN_MONTH: case ALIGNED_DAY_OF_WEEK_IN_YEAR: case DAY_OF_WEEK: return special ? InternationalFixedChronology.EMPTY_RANGE : InternationalFixedChronology.DAY_OF_WEEK_RANGE; case ALIGNED_WEEK_OF_MONTH: return special ? InternationalFixedChronology.EMPTY_RANGE : InternationalFixedChronology.WEEK_OF_MONTH_RANGE; case ALIGNED_WEEK_OF_YEAR: return special ? InternationalFixedChronology.EMPTY_RANGE : InternationalFixedChronology.WEEK_OF_YEAR_RANGE; case DAY_OF_MONTH: return special ? InternationalFixedChronology.EMPTY_RANGE : InternationalFixedChronology.DAY_OF_MONTH_RANGE; <START> case DAY_OF_YEAR: <END> return special ? ValueRange.of(getDayOfYear(), getDayOfYear()) : isLeapYear() ? InternationalFixedChronology.DAY_OF_YEAR_LEAP_RANGE : InternationalFixedChronology.DAY_OF_YEAR_NORMAL_RANGE; case EPOCH_DAY: return InternationalFixedChronology.EPOCH_DAY_RANGE; case ERA: return InternationalFixedChronology.ERA_RANGE; case MONTH_OF_YEAR: return special ? InternationalFixedChronology.EMPTY_RANGE : InternationalFixedChronology.MONTH_OF_YEAR_RANGE; default: break; } } } return super.range(field); }</code><technical_language>.. actual range change for DAY_OF_YEAR, leap-day year-day</technical_language>

Target:
public ValueRange range(final TemporalField field) { boolean special = this.day < 1; if (field instanceof ChronoField) { if (isSupported(field)) { ChronoField f = (ChronoField) field; switch (f) { case ALIGNED_DAY_OF_WEEK_IN_MONTH: case ALIGNED_DAY_OF_WEEK_IN_YEAR: case DAY_OF_WEEK: return special ? EMPTY_RANGE : ValueRange.of(1, DAYS_IN_WEEK); case ALIGNED_WEEK_OF_MONTH: return special ? EMPTY_RANGE : ValueRange.of(1, WEEKS_IN_MONTH); case ALIGNED_WEEK_OF_YEAR: return special ? EMPTY_RANGE : ValueRange.of(1, WEEKS_IN_YEAR); case DAY_OF_MONTH: return this.isYearDay ? EMPTY_RANGE : this.isLeapDay ? ValueRange.of(-1, -1) : ValueRange.of(1, DAYS_IN_MONTH); case DAY_OF_YEAR: return this.isLeapYear ? DAY_OF_YEAR_LEAP_RANGE : DAY_OF_YEAR_NORMAL_RANGE; case EPOCH_DAY: return EPOCH_DAY_RANGE; case ERA: return ERA_RANGE; case MONTH_OF_YEAR: return MONTH_OF_YEAR_RANGE; default: break; } } else { throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } } return super.range(field); }
Source:
<code>public void testGetMicrosoftTimeZoneNameBad() { try { Assert.fail(TimeZoneUtils.getMicrosoftTimeZoneName(null)); } catch (final IllegalArgumentException ignored) final TimeZone trollZone = TimeZone.getTimeZone("Antarctica/Troll"); final String trollZoneName = TimeZoneUtils.getMicrosoftTimeZoneName(trollZone); <START> Assert.assertTrue(trollZoneName == null || StringUtils.equals(trollZoneName, "UTC")); <END> checkGetMicrosoftTimeZoneName("africa/abidjan", "UTC"); }</code><technical_language>shouldnt this a design of unit-test assert another</technical_language>

Target:
public void testGetMicrosoftTimeZoneNameBad() { try { Assert.fail(TimeZoneUtils.getMicrosoftTimeZoneName(null)); } catch (final IllegalArgumentException ignored) checkGetMicrosoftTimeZoneName("africa/abidjan", "UTC"); }
Source:
<code>VCFReaderIterator(final InputStream inputStream) { this.inputStream = inputStream; <START> this.lineIterator = new AsciiLineReaderIterator(AsciiLineReader.from(inputStream)); <END> this.vcfHeader = (VCFHeader) this.codec.readActualHeader(this.lineIterator); }</code><technical_language>delegate codec's makeSourceFromStream method here</technical_language>

Target:
VCFReaderIterator(final InputStream inputStream) { this.inputStream = inputStream; this.lineIterator = this.codec.makeSourceFromStream(this.inputStream); this.vcfHeader = (VCFHeader) this.codec.readActualHeader(this.lineIterator); }
Source:
<code>private void quote(StringBuilder sb, String value) { <START> char quote = value.contains("'") ? '"' : '\''; END> sb.append(quote); sb.append(value); sb.append(quote); }</code><technical_language>if contains ' " ? code fail</technical_language>

Target:
private void quote(StringBuilder sb, String value) { char quote = '\''; if (value.contains("'")) { if (value.contains("\"")) { throw new IllegalArgumentException( "Cannot query for a job which contains both a single and double quote in its name"); } quote = '"'; } sb.append(quote); sb.append(value); sb.append(quote); }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) { Preconditions.checkArgument(!Strings.isNullOrEmpty(config.name), "Stream name should be non-null, non-empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.awsAccessKey), "Access Key required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.awsAccessSecret), "Access Key secret required"); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.partition), "partition name should be non-null, non-empty."); <START> Preconditions.checkArgument(!Strings.isNullOrEmpty(config.bodyField), <END> "Please map the input field containing data"); BasicAWSCredentials awsCred = new BasicAWSCredentials(config.awsAccessKey, config.awsAccessSecret); kinesisClient = new AmazonKinesisClient(awsCred); createAndWaitForStreamToBecomeAvailable(kinesisClient, config.name, config.shardCount); }</code><technical_language>this inverse of checking? ! isNullOrEmpty = false for null empty values</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { Preconditions.checkArgument(!Strings.isNullOrEmpty(config.name), "Stream name should be non-null, non-empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.awsAccessKey), "Access Key should be non-null, non-empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.awsAccessSecret), "Access Key secret should be non-null, non-empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.partition), "Partition name should be non-null, non-empty."); Preconditions.checkArgument(!Strings.isNullOrEmpty(config.bodyField), "Input field should be non-null, non-empty."); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); validateInputSchema(inputSchema); }
Source:
<code>public void post(String url, HttpResponse response, Map<String, Object> headers, File file) { HttpPost methodPost = new HttpPost(url); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); <START> builder.addBinaryBody(file.getName(), new File(file.getAbsolutePath()), <END> ContentType.APPLICATION_OCTET_STREAM, file.getName()); HttpEntity multipart = builder.build(); methodPost.setEntity(multipart); getResponse(url, response, methodPost, headers); }</code><technical_language>do need new File(file.getAbsolutePath()), instead of file</technical_language>

Target:
public void post(String url, HttpResponse response, Map<String, Object> headers, File file) { HttpPost methodPost = new HttpPost(url); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.addBinaryBody(file.getName(), file, ContentType.APPLICATION_OCTET_STREAM, file.getName()); HttpEntity multipart = builder.build(); methodPost.setEntity(multipart); getResponse(url, response, methodPost, headers); }
Source:
<code>public long getSessionSeqId() { if (sessionSeqId == null) { <START> sessionSeqId = -1L; <END> String sessionId = getContext().getEngineContext().getSessionId(); if (getSessionDataContainer().isSessionExists(sessionId)) { sessionSeqId = getSessionDataContainer().getEngineSessionSeqId(sessionId); } } return sessionSeqId; }</code><technical_language>instead of early assignment overridden in line 2355, set 'else' part of if statement (line 2356)</technical_language>

Target:
public long getSessionSeqId() { if (sessionSeqId == null) { String sessionId = getContext().getEngineContext().getSessionId(); sessionSeqId = getSessionDataContainer().isSessionExists(sessionId) ? getSessionDataContainer().getEngineSessionSeqId(sessionId) : -1L; } return sessionSeqId; }
Source:
<code>private void executeFolderRemoval(FolderDeletedActivity activity) throws IOException { SPath path = activity.getPath(); IFolder folder = path.getFolder(); <START> this.editorManager.closeEditorsInFolder(path); <END> folder.delete(IResource.NONE); }</code><technical_language>this keyword is unnecessary</technical_language>

Target:
private void executeFolderRemoval(FolderDeletedActivity activity) throws IOException { SPath path = activity.getPath(); IFolder folder = path.getFolder(); folder.delete(IResource.NONE); editorManager.closeEditorsInFolder(path); }
Source:
<code>private Map<String, String> getAttributeData(String id) { Map<String, String> map = attributesById.get(id); if (map == null) { map = new HashMap<>(); attributesById.put(id, map); } <START> return map; <END> }</code><technical_language>Method compacted one-liner computeIfAbsent</technical_language>

Target:
private Map<String, String> getAttributeData(String id) { return attributesById.computeIfAbsent(id, key -> new HashMap<>()); }
Source:
<code>public TimestampRangeAndPartition getFreshTimestampsForClient(UUID clientIdentifier, int numTransactionsRequested) { while (true) { <START> TimestampRange timestampRange = delegate.getFreshTimestamps(NUM_PARTITIONS * numTransactionsRequested); <END> int targetResidue = allocator.getRelevantModuli(clientIdentifier).iterator().next(); OptionalLong startTimestamp = TimestampRanges.getLowestTimestampMatchingModulus( timestampRange, targetResidue, NUM_PARTITIONS); if (startTimestamp.isPresent()) { OptionalLong endTimestamp = TimestampRanges.getHighestTimestampMatchingModulus( timestampRange, targetResidue, NUM_PARTITIONS); return TimestampRangeAndPartition.of( TimestampRange.createInclusiveRange(startTimestamp.getAsLong(), endTimestamp.getAsLong()), targetResidue); } log.info("The timestamp range we received from the underlying timestamp service - -" + " did not contain a value with residue modulo {}. We will try again." + " This is not a bug; but if it happens excessively frequently, please contact support.", SafeArg.of("timestampRange", timestampRange), SafeArg.of("targetResidue", targetResidue), SafeArg.of("modulus", NUM_PARTITIONS)); } }</code><technical_language>this correctly handle case asked for more 10k timestamps hand 10k timestamps</technical_language>

Target:
public PartitionedTimestamps getFreshTimestampsForClient(UUID clientIdentifier, int numTransactionsRequested) { while (true) { TimestampRange timestampRange = delegate.getFreshTimestamps(NUM_PARTITIONS * numTransactionsRequested); int targetResidue = allocator.getRelevantModuli(clientIdentifier).iterator().next(); PartitionedTimestamps partitionedTimestamps = TimestampRanges.getPartitionedTimestamps( timestampRange, targetResidue, NUM_PARTITIONS); if (partitionedTimestamps.count() > 0) { return partitionedTimestamps; } log.info("The timestamp range we received from the underlying timestamp service - -" + " did not contain a value with residue modulo {}. We will try again." + " This is not a bug; but if it happens excessively frequently, please contact support.", SafeArg.of("timestampRange", timestampRange), SafeArg.of("targetResidue", targetResidue), SafeArg.of("modulus", NUM_PARTITIONS)); } }
Source:
<code>public static Symbol from(Expression expression) { <START> return optionalFrom(expression).orElseThrow(() -> new IllegalArgumentException("Unexpected expression: %s" + expression)); <END> }</code><technical_language>put a new line .orElseThrow(...),</technical_language>

Target:
public static Symbol from(Expression expression) { checkArgument(expression instanceof SymbolReference, "Unexpected expression: %s", expression); return new Symbol(((SymbolReference) expression).getName()); }
Source:
<code>public MigrateBrokerVDSCommand(P parameters) { super(parameters); String migMethod = VdsProperties.MigrationMethostoString(parameters.getMigrationMethod()); log.infoFormat("VdsBroker::migrate::Entered (vm_guid='{0}', srcHost='{1}', dstHost='{2}', method='{3}'", parameters.getVmId().toString(), parameters.getSrcHost(), parameters.getDstHost(), migMethod); migrationInfo = new HashMap<String, String>(); migrationInfo.put(VdsProperties.vm_guid, parameters.getVmId().toString()); migrationInfo.put(VdsProperties.src, String.format("%1$s", parameters.getSrcHost())); migrationInfo.put(VdsProperties.dst, String.format("%1$s", parameters.getDstHost())); migrationInfo.put(VdsProperties.method, migMethod); if (parameters.getTunnelMigration() != null) { <START> migrationInfo.put(VdsProperties.tunneled, String.valueOf(parameters.getTunnelMigration())); <END> } }</code><technical_language>verified parameters.getTunnelMigration() is null parameters.getTunnelMigration().toString()</technical_language>

Target:
public MigrateBrokerVDSCommand(P parameters) { super(parameters); String migMethod = VdsProperties.MigrationMethostoString(parameters.getMigrationMethod()); log.infoFormat("VdsBroker::migrate::Entered (vm_guid='{0}', srcHost='{1}', dstHost='{2}', method='{3}'", parameters.getVmId().toString(), parameters.getSrcHost(), parameters.getDstHost(), migMethod); migrationInfo = new HashMap<String, String>(); migrationInfo.put(VdsProperties.vm_guid, parameters.getVmId().toString()); migrationInfo.put(VdsProperties.src, String.format("%1$s", parameters.getSrcHost())); migrationInfo.put(VdsProperties.dst, String.format("%1$s", parameters.getDstHost())); migrationInfo.put(VdsProperties.method, migMethod); if (parameters.getTunnelMigration() != null) { migrationInfo.put(VdsProperties.TUNNELED, parameters.getTunnelMigration().toString()); } }
Source:
<code>private void validateRowsAreNotMaskedUsingCounts(long probeTimestamp, DataReader dataReader, SchemaBuilder schemaBuilder) throws SQLException { String tenantConnectUrl = getUrl() + ';' + TENANT_ID_ATTRIB + '=' + schemaBuilder.getDataOptions() .getTenantId(); long scnTimestamp = EnvironmentEdgeManager.currentTimeMillis(); Properties props = new Properties(); props.setProperty("CurrentSCN", Long.toString(scnTimestamp )); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); <START> assertTrue("Fetched data should not be null", fetchedData != null); <END> assertTrue("Rows should exists before ttl expiration (now)", fetchedData.rowKeySet().size() > 0); } props.setProperty("CurrentSCN", Long.toString(probeTimestamp)); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); assertTrue("Fetched data should not be null", fetchedData != null); assertTrue("Rows should exists before ttl expiration (probe-timestamp)", fetchedData.rowKeySet().size() > 0); } }</code><technical_language>nit: User assertNotNull()</technical_language>

Target:
private void validateRowsAreNotMaskedUsingCounts(long probeTimestamp, DataReader dataReader, SchemaBuilder schemaBuilder) throws SQLException { String tenantConnectUrl = getUrl() + ';' + TENANT_ID_ATTRIB + '=' + schemaBuilder.getDataOptions() .getTenantId(); long scnTimestamp = EnvironmentEdgeManager.currentTimeMillis(); Properties props = new Properties(); props.setProperty("CurrentSCN", Long.toString(scnTimestamp )); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); assertNotNull("Fetched data should not be null", fetchedData); assertTrue("Rows should exists before ttl expiration (now)", fetchedData.rowKeySet().size() > 0); } props.setProperty("CurrentSCN", Long.toString(probeTimestamp)); try (Connection readConnection = DriverManager.getConnection(tenantConnectUrl, props)) { dataReader.setConnection(readConnection); com.google.common.collect.Table<String, String, Object> fetchedData = fetchData(dataReader); assertNotNull("Fetched data should not be null", fetchedData); assertTrue("Rows should exists before ttl expiration (probe-timestamp)", fetchedData.rowKeySet().size() > 0); } }
Source:
<code>protected RevCommit commitFile(String filename, String contents, String branch) { try { Git git = new Git(db); <START> String originalBranch = git.getRepository().getBranch(); <END> if (git.getRepository().getRef(branch) == null) git.branchCreate().setName(branch).call(); git.checkout().setName(branch).call(); writeTrashFile(filename, contents); git.add().addFilepattern(filename).call(); RevCommit commit = git.commit() .setMessage(branch + ": " + filename).call(); if (originalBranch != null) git.checkout().setName(originalBranch).call(); return commit; } catch (IOException e) { throw new RuntimeException(e); } catch (GitAPIException e) { throw new RuntimeException(e); } }</code><technical_language>I getFullBranch() here. method use, getBranch(), additionally shorten refName is a feature need here. Additionally this shortening of ref names lead problems if refs .git/xyz .git/refs/heads/xyz checked out .git/refs/heads/xyz</technical_language>

Target:
protected RevCommit commitFile(String filename, String contents, String branch) { try { Git git = new Git(db); String originalBranch = git.getRepository().getFullBranch(); if (git.getRepository().getRef(branch) == null) git.branchCreate().setName(branch).call(); git.checkout().setName(branch).call(); writeTrashFile(filename, contents); git.add().addFilepattern(filename).call(); RevCommit commit = git.commit() .setMessage(branch + ": " + filename).call(); if (originalBranch != null) git.checkout().setName(originalBranch).call(); return commit; } catch (IOException e) { throw new RuntimeException(e); } catch (GitAPIException e) { throw new RuntimeException(e); } }
Source:
<code>public String parseMessage(HttpResponse response) { if (response.getPayload() == null) return null; try { return Strings2.toString(response.getPayload()); } catch (IOException e) { throw new RuntimeException(e); } finally { try { response.getPayload().getInput().close(); } catch (IOException e) { <START> Throwables.propagate(e); <END> } } }</code><technical_language>This silently ignore exception. throw Throwables.propagate(e);</technical_language>

Target:
public String parseMessage(HttpResponse response) { if (response.getPayload() == null) return null; try { return Strings2.toString(response.getPayload()); } catch (IOException e) { throw Throwables.propagate(e); } finally { try { response.getPayload().getInput().close(); } catch (IOException e) { throw Throwables.propagate(e); } } }
Source:
<code>protected Session getSession() { Session session = null; <START> if (HibernateUtilFactory.getAsyncMsgsHibernateUtil() != null) { <END> session = HibernateUtilFactory.getAsyncMsgsHibernateUtil().getSessionFactory().openSession(); } else { LOG.error("Session is null"); } return session; }</code><technical_language>HibernateUtilFactory.getAsyncMsgsHibernateUtil() call impact performance bean applicationcontext. Recommend assign variable if sonar mark violation</technical_language>

Target:
protected Session getSession() { Session session = null; HibernateUtil util = HibernateUtilFactory.getAsyncMsgsHibernateUtil(); if (util != null) { session = util.getSessionFactory().openSession(); } else { LOG.error("Session is null"); } return session; }
Source:
<code><START> private void typeSearchQuery(String query) { <END> waitForElementByElement(searchField); searchField.sendKeys(query); }</code><technical_language>This method is in another method, this encapsulation</technical_language>

Target:
public void typeSearchQuery(String query) { searchField.sendKeys(query); }
Source:
<code>public void getCollaborators_validRepoId_successful() throws IOException { MockServerClient mockServer = ClientAndServer.startClientAndServer(8888); String sampleCollaborators = TestUtils.readFileFromResource(this, "tests/CollaboratorsSample.json"); mockServer.when( request() .withPath(TestUtils.API_PREFIX + "/repos/hubturbo/tests/collaborators") ).respond( response() .withBody(sampleCollaborators) ); GitHubClient client = new GitHubClient("localhost", 8888, "http"); CollaboratorServiceEx service = new CollaboratorServiceEx(client); Type listOfUsers = new TypeToken<List<User>>() {}.getType(); List<User> expectedCollaborators = new Gson().fromJson(sampleCollaborators, listOfUsers); List<User> actualCollaborators = service.getCollaborators(RepositoryId.createFromId("hubturbo/tests")); assertEquals(expectedCollaborators.size(), actualCollaborators.size()); for (int i = 0; i < expectedCollaborators.size(); i++) { assertEquals(expectedCollaborators.get(i).getLogin(), actualCollaborators.get(i).getLogin()); <START> assertEquals(expectedCollaborators.get(i).getName(), actualCollaborators.get(i).getName()); <END> } mockServer.stop(); }</code><technical_language>check names of actual collaborators empty</technical_language>

Target:
public void getCollaborators_validRepoId_successful() throws IOException { MockServerClient mockServer = ClientAndServer.startClientAndServer(8888); String sampleCollaborators = TestUtils.readFileFromResource(this, "tests/CollaboratorsSample.json"); mockServer.when( request() .withPath(TestUtils.API_PREFIX + "/repos/hubturbo/tests/collaborators") ).respond( response() .withBody(sampleCollaborators) ); Type listOfUsers = new TypeToken<List<User>>() {}.getType(); List<User> expectedCollaborators = new Gson().fromJson(sampleCollaborators, listOfUsers); List<User> actualCollaborators = service.getCollaborators(RepositoryId.createFromId("hubturbo/tests")); assertEquals(expectedCollaborators.size(), actualCollaborators.size()); for (int i = 0; i < expectedCollaborators.size(); i++) { assertEquals(expectedCollaborators.get(i).getLogin(), actualCollaborators.get(i).getLogin()); assertEquals(expectedCollaborators.get(i).getName(), actualCollaborators.get(i).getName()); assertEquals(true, actualCollaborators.get(i).getName() != null); } mockServer.stop(); }
Source:
<code><START> Consumer<HttpClientBuilder> zipkinElasticsearchHttpLogging( <END> ZipkinElasticsearchStorageProperties es) { LoggingClientBuilder builder = new LoggingClientBuilder() .requestLogLevel(LogLevel.INFO) .successfulResponseLogLevel(LogLevel.INFO); switch (es.getHttpLogging()) { case HEADERS: builder.contentSanitizer(unused -> ""); break; case BASIC: builder.contentSanitizer(unused -> ""); builder.headersSanitizer(unused -> HttpHeaders.of()); break; case BODY: default: break; } return client -> client.decorator(builder.newDecorator()); }</code><technical_language>cool. curious do this</technical_language>

Target:
Consumer<HttpClientBuilder> zipkinElasticsearchHttpLogging( ZipkinElasticsearchStorageProperties es) { LoggingClientBuilder builder = new LoggingClientBuilder() .requestLogLevel(LogLevel.INFO) .successfulResponseLogLevel(LogLevel.INFO); switch (es.getHttpLogging()) { case HEADERS: builder.contentSanitizer(unused -> ""); break; case BASIC: builder.contentSanitizer(unused -> ""); builder.headersSanitizer(unused -> HttpHeaders.of()); break; case BODY: default: break; } return new Consumer<HttpClientBuilder>() { @Override public void accept(HttpClientBuilder client) { client .decorator(builder.newDecorator()) .decorator( es.getHttpLogging() == ZipkinElasticsearchStorageProperties.HttpLoggingLevel.BODY ? RawContentLoggingClient.newDecorator() : Function.identity()); } @Override public String toString() { return "LoggingCustomizer{httpLogging=" + es.getHttpLogging() + "}"; } }; }
Source:
<code>protected void addNode(final Node<E> nodeToInsert, final Node<E> insertBeforeNode) { <START> Objects.requireNonNull(nodeToInsert,"The new node on insert must not be null."); <END> Objects.requireNonNull(insertBeforeNode,"The node to insert before must not be null."); nodeToInsert.next = insertBeforeNode; nodeToInsert.previous = insertBeforeNode.previous; insertBeforeNode.previous.next = nodeToInsert; insertBeforeNode.previous = nodeToInsert; size++; modCount++; }</code><technical_language>Please add a space comma</technical_language>

Target:
protected void addNode(final Node<E> nodeToInsert, final Node<E> insertBeforeNode) { Objects.requireNonNull(nodeToInsert, "nodeToInsert"); Objects.requireNonNull(insertBeforeNode, "insertBeforeNode"); nodeToInsert.next = insertBeforeNode; nodeToInsert.previous = insertBeforeNode.previous; insertBeforeNode.previous.next = nodeToInsert; insertBeforeNode.previous = nodeToInsert; size++; modCount++; }
Source:
<code>public String acquireGuestIpv6Address(Network network, String requestedIpv6) throws InsufficientAddressCapacityException { if (!_networkModel.isIP6AddressAvailableInNetwork(network.getId())) { throw new InsufficientAddressCapacityException( String.format("There is no IPv6 address available in the network [name=%s, network id=%s]", network.getName(), network.getId()), DataCenter.class, network.getDataCenterId()); } if (ipAddressManager.isIpEqualsGatewayOrNetworkOfferingsEmpty(network, requestedIpv6)) { throw new InvalidParameterValueException( String.format("The network [id=%s] Offering is Empty or the requested IP address [%s] is equals to the Gateway", network.getId(), requestedIpv6)); } String networkIp6Cidr = network.getIp6Cidr(); if (StringUtils.isNotBlank(networkIp6Cidr) && NetUtils.isIp6InNetwork(requestedIpv6, networkIp6Cidr)) { <START> throw new InvalidParameterValueException(String.format("The requested IPv6 address [%s] doesn't belong to the network [id=%s]", requestedIpv6, network.getId())); <END> } if (isIp6Taken(network, requestedIpv6)) { throw new InsufficientAddressCapacityException(String.format("The given IPv6 [%s] is already used in the network", requestedIpv6), Network.class, network.getId()); } IpAddresses requestedIpPair = new IpAddresses(null, requestedIpv6); _networkModel.checkRequestedIpAddresses(network.getId(), requestedIpPair); IPAddressVO ip = ipAddressDao.findByIpAndSourceNetworkId(network.getId(), requestedIpv6); if (ip != null) { State ipState = ip.getState(); if (ipState != State.Free) { throw new InvalidParameterValueException(String.format("Requested ip address [%s] is not free [ip state=%]", requestedIpv6, ipState)); } } return requestedIpv6; }</code><technical_language>Do validate else if IP is valid</technical_language>

Target:
public String acquireGuestIpv6Address(Network network, String requestedIpv6) throws InsufficientAddressCapacityException { if (!_networkModel.areThereIPv6AddressAvailableInNetwork(network.getId())) { throw new InsufficientAddressCapacityException( String.format("There is no IPv6 address available in the network [name=%s, network id=%s]", network.getName(), network.getId()), DataCenter.class, network.getDataCenterId()); } checkIfCanAllocateIpv6Address(network, requestedIpv6); IpAddresses requestedIpPair = new IpAddresses(null, requestedIpv6); _networkModel.checkRequestedIpAddresses(network.getId(), requestedIpPair); IPAddressVO ip = ipAddressDao.findByIpAndSourceNetworkId(network.getId(), requestedIpv6); if (ip != null) { State ipState = ip.getState(); if (ipState != State.Free) { throw new InsufficientAddressCapacityException(String.format("Requested ip address [%s] is not free [ip state=%]", requestedIpv6, ipState), DataCenter.class, network.getDataCenterId()); } } return requestedIpv6; }
Source:
<code>public void makeOmeTiff(final String name, final CoreMetadata info) throws FormatException, IOException { final String id = getId(name); final OMETiffWriter out = createWriter(name, info, id); writeData(name, info, id, out); <START> out.close(); <END> }</code><technical_language>move <LINK_0> yet</technical_language>

Target:
public void makeOmeTiff(final String name, final CoreMetadata info) throws FormatException, IOException { final String id = getId(name); try (OMETiffWriter out = createWriter(name, info, id)) { writeData(name, info, id, out); } }
Source:
<code>protected void endSuccessfully() { <START> if (getParameters().isHotPlugLease() && !runVdsCommand(VDSCommandType.HotPlugLease, <END> new LeaseVDSParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStorageDomainId())).getSucceeded()) { setVmId(getParameters().getVmId()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); setSucceeded(false); return; } setSucceeded(true); }</code><technical_language>a good idea catch EngineException (thrown runVdsCommand) here, log</technical_language>

Target:
protected void endSuccessfully() { try { if (getParameters().isHotPlugLease() && !runVdsCommand(VDSCommandType.HotPlugLease, new LeaseVDSParameters(getParameters().getVdsId(), getParameters().getVmId(), getParameters().getStorageDomainId())).getSucceeded()) { setVmId(getParameters().getVmId()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); setSucceeded(false); return; } } catch (EngineException e) { log.error("Failure in hot plugging a lease to VM {}, message: {}", getParameters().getVmId(), e.getMessage()); auditLog(this, AuditLogType.HOT_PLUG_LEASE_FAILED); return; } setSucceeded(true); }
Source:
<code>private void checkDio(int channel) { if (channel >= 10) { if(channel > 13 && channel < 18) { <START> throw new RuntimeException("Allocated MXP digital pin that does not exist!"); <END> } checkDevice(mxpDigital, channel); } else { checkDevice(dios, channel); } }</code><technical_language>nice list valid dio pins out in message</technical_language>

Target:
private void checkDio(int channel) { if (channel >= 10) { if(channel > 13 && channel < 18) { throw new RuntimeException("Allocated MXP digital pin that does not exist! Valid I/O expansion pins are 10 through 23."); } checkDevice(mxpDigital, channel); } else { checkDevice(dios, channel); } }
Source:
<code>public void expandAll() { List<WebElement> expanders = getItemExpanderInPublishTreeForm(); <START> if (expanders.size() == 0) { <END> return; } else { for (WebElement expander : expanders) { Locator.waitUntilEnabledAndClick(expander); } } }</code><technical_language>expanders.isEmpty()</technical_language>

Target:
public void expandAll() { List<WebElement> expanders = getItemExpanderInPublishTreeForm(); if (expanders.isEmpty()) { return; } else { for (WebElement expander : expanders) { Locator.waitUntilEnabledAndClick(expander); } } }
Source:
<code>@NotNull private GridClientConfiguration getClientConfiguration( String userName, String password, ConnectionAndSslParameters args ) throws IgniteCheckedException { GridClientConfiguration clientCfg = new GridClientConfiguration(); clientCfg.setPingInterval(args.pingInterval()); clientCfg.setPingTimeout(args.pingTimeout()); clientCfg.setServers(Collections.singletonList(args.host() + ":" + args.port())); if (!F.isEmpty(userName)) clientCfg.setSecurityCredentialsProvider(getSecurityCredentialsProvider(userName, password, clientCfg)); if (!F.isEmpty(args.sslKeyStorePath())) clientCfg.setSslContextFactory(createSslSupportFactory(args)); <START> if (clientCfg.getUserAttributes() == null) <END> clientCfg.setUserAttributes(args.userAttributes()); else throw new IgniteCheckedException("Internal error: User attributes already set!"); return clientCfg; }</code><technical_language>true created a new configuration</technical_language>

Target:
@NotNull private GridClientConfiguration getClientConfiguration( String userName, String password, ConnectionAndSslParameters args ) throws IgniteCheckedException { GridClientConfiguration clientCfg = new GridClientConfiguration(); clientCfg.setPingInterval(args.pingInterval()); clientCfg.setPingTimeout(args.pingTimeout()); clientCfg.setServers(Collections.singletonList(args.host() + ":" + args.port())); if (!F.isEmpty(userName)) clientCfg.setSecurityCredentialsProvider(getSecurityCredentialsProvider(userName, password, clientCfg)); if (!F.isEmpty(args.sslKeyStorePath())) clientCfg.setSslContextFactory(createSslSupportFactory(args)); clientCfg.setUserAttributes(args.userProperties()); return clientCfg; }
Source:
<code>public void TestCollectionInputValidation() throws Exception { try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) <START> tmp.add(i); <END> CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_double_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) tmp.add(i); tmp.add("a"); CollectionDataSource source = new CollectionDataSource(tmp,"test_invalid_collection"); Assert.fail("input type is different"); } catch (Exception e) { } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } List<Object> inner = new ArrayList<Object>(); inner.add('a'); inner.add('a'); tmp.add(inner); CollectionDataSource source = new CollectionDataSource(tmp, "test_invalid_double_collection"); Assert.fail("input type is different"); } catch (Exception e) { } }</code><technical_language>style. Please check code for correct style. Thank you</technical_language>

Target:
public void TestCollectionInputValidation() throws Exception { try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { tmp.add(i); } CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } CollectionDataSource source = new CollectionDataSource(tmp,"test_valid_double_collection"); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { tmp.add(i); } tmp.add("a"); CollectionDataSource source = new CollectionDataSource(tmp,"test_invalid_collection"); Assert.fail("input type is different"); } catch (Exception e) { } try { List<Object> tmp= new ArrayList<Object>(); for (int i = 0; i < 100; i++) { List<Object> inner = new ArrayList<Object>(); inner.add(i); inner.add('a' + i); tmp.add(inner); } List<Object> inner = new ArrayList<Object>(); inner.add('a'); inner.add('a'); tmp.add(inner); CollectionDataSource source = new CollectionDataSource(tmp, "test_invalid_double_collection"); Assert.fail("input type is different"); } catch (Exception e) { } }
Source:
<code>private int parseIdFromInsertedUri(Uri uri) throws NumberFormatException { <START> int id = -1; if (uri != null) { id = Integer.parseInt(uri.getLastPathSegment()); } return id; <END> }</code><technical_language>reduced a single line: return (uri != null ? Integer.parseInt(uri.getLastPathSegment()) : -1)</technical_language>

Target:
private int parseIdFromInsertedUri(Uri uri) throws NumberFormatException { return (uri != null) ? Integer.parseInt(uri.getLastPathSegment()) : -1; }
Source:
<code>public Map<String, AlarmWrapper> lookup(Set<String> reductionKeys) { if (reductionKeys == null || reductionKeys.isEmpty()) { return new HashMap<>(); } <START> if (reductionKeys.size() <= 1000) { <END> List<OnmsAlarm> alarms = alarmDao.findMatching(new CriteriaBuilder(OnmsAlarm.class).in("reductionKey", reductionKeys).toCriteria()); return alarms.stream().collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } else { return alarmDao.findAll().stream() .filter(a -> reductionKeys.contains(a.getReductionKey())) .collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } }</code><technical_language>move 1000 a constant, configurable a system property? Similar pollInterval: <LINK_0></technical_language>

Target:
public Map<String, AlarmWrapper> lookup(Set<String> reductionKeys) { if (reductionKeys == null || reductionKeys.isEmpty()) { return new HashMap<>(); } if (reductionKeys.size() <= threshold) { List<OnmsAlarm> alarms = alarmDao.findMatching(new CriteriaBuilder(OnmsAlarm.class).in("reductionKey", reductionKeys).toCriteria()); return alarms.stream().collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } else { return alarmDao.findAll().stream() .filter(a -> reductionKeys.contains(a.getReductionKey())) .collect(Collectors.toMap(alarm -> alarm.getReductionKey(), alarm -> new AlarmWrapperImpl(alarm))); } }
Source:
<code>public ImageTicketInformationReturn(Map<String, Object> innerMap) { super(innerMap); <START> this.ticketInfo <END> = (Map<String, Object>) innerMap.get(TICKET_INFO); }</code><technical_language>need for 'this'</technical_language>

Target:
public ImageTicketInformationReturn(Map<String, Object> innerMap) { super(innerMap); ticketInfo = (Map<String, Object>) innerMap.get(TICKET_INFO); }
Source:
<code>public void testGetJtsEnvelopeEmpty() { String wkt = "MULTIPOLYGON EMPTY"; Envelope expected = new Envelope(); <START> assertJtsEnvelope(wkt, expected); <END> }</code><technical_language>shorten assertJtsEnvelope("MULTIPOLYGON EMPTY", new Envelope()); - ditto other tests</technical_language>

Target:
public void testGetJtsEnvelopeEmpty() { assertJtsEnvelope( "MULTIPOLYGON EMPTY", new Envelope()); }
Source:
<code>public String formatDateAs(String date, String newFormat) { SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); SimpleDateFormat targetFormat = new SimpleDateFormat(newFormat); String formattedDate = null; try { formattedDate = targetFormat.format(sdf.parse(date)); } catch (ParseException e) { <START> e.printStackTrace(); <END> } return formattedDate; }</code><technical_language>Instead of printing a stack trace standard error, throw a SlimFixtureException message date parsed e cause</technical_language>

Target:
public String formatDateAs(String date, String newFormat) { Date parsedDate = parseDate(date); DateFormat targetFormat = getDateFormat(newFormat); return targetFormat.format(parsedDate); }