auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void configureNewConnections() throws ClosedChannelException { while (newConnections.size() > 0) { SocketChannel channel = newConnections.poll(); logger.debug("Processor listening to new connection from {}", id, channel.socket().getRemoteSocketAddress()); String localHost = channel.socket().getLocalAddress().getHostAddress(); int localPort = channel.socket().getLocalPort(); String remoteHost = channel.socket().getInetAddress().getHostAddress(); int remotePort = channel.socket().getPort(); <START> String connectionId = localHost + ":" + localPort + "-" + remoteHost + ":" + remotePort; <END> selector.register(connectionId, remoteHost, remotePort, channel); } }</code><technical_language>this inspired kafka</technical_language>

Target:
private void configureNewConnections() throws ClosedChannelException { while (newConnections.size() > 0) { SocketChannel channel = newConnections.poll(); logger.debug("Processor listening to new connection from {}", id, channel.socket().getRemoteSocketAddress()); selector.register(channel); } }
Source:
<code><START> public String toString() { <END> return "AbsoluteTimeframe{" + "start='" + start + '\'' + ", end='" + end + '\'' + '}'; }</code><technical_language>toString() impls for debug only, inspect objects? If org.apache.commons.lang3.builder.ReflectionToStringBuilder a debug-only dep? a thought</technical_language>

Target:
public String toString() { return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); }
Source:
<code>protected void executeCommand() { Cluster cluster = getCluster(); boolean initSucceeded = true; initHostKdumpDetectionStatus(); getVds().setPowerManagementControlledByPolicy(true); vdsDynamicDao.updateVdsDynamicPowerManagementPolicyFlag( getVds().getId(), getVds().isPowerManagementControlledByPolicy()); if (cluster.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && cluster.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && getVds().getHighlyAvailableIsConfigured()) { <START> haMaintenanceFailed = !hostedEngineHelper.updateHaLocalMaintenanceMode(getVds(), false); <END> } if (initSucceeded && cluster.supportsGlusterService()) { initSucceeded = glusterCommandHelper.initGlusterHost(getVds()); } setSucceeded(initSucceeded); if (getSucceeded()) { addCustomValue("HostStatus", getVds().getStatus().toString()); auditLogDirector.log(this, AuditLogType.VDS_DETECTED); } }</code><technical_language>move right updateVdsDynamic... invocation</technical_language>

Target:
protected void executeCommand() { Cluster cluster = getCluster(); boolean initSucceeded = true; initHostKdumpDetectionStatus(); getVds().setPowerManagementControlledByPolicy(true); vdsDynamicDao.updateVdsDynamicPowerManagementPolicyFlag( getVds().getId(), getVds().isPowerManagementControlledByPolicy()); if (getVds().getHighlyAvailableIsConfigured()) { haMaintenanceFailed = !hostedEngineHelper.updateHaLocalMaintenanceMode(getVds(), false); } if (cluster.supportsTrustedService()) { initSucceeded = initTrustedService(); } if (initSucceeded && cluster.supportsVirtService()) { initSucceeded = initVirtResources(); } if (initSucceeded && cluster.supportsGlusterService()) { initSucceeded = glusterCommandHelper.initGlusterHost(getVds()); } setSucceeded(initSucceeded); if (getSucceeded()) { addCustomValue("HostStatus", getVds().getStatus().toString()); auditLogDirector.log(this, AuditLogType.VDS_DETECTED); } }
Source:
<code>private Guid findAvailableStorageDomain(long diskSize) { StorageDomain dest = null; for (StorageDomain domain: targetDomains.keySet()) { <START> if (dest == null || targetDomains.get(domain) > targetDomains.get(dest)) { <END> dest = domain; } } long destSize = targetDomains.get(dest); targetDomains.replace(dest, destSize, destSize - diskSize); return dest.getId(); }</code><technical_language>good account amount of disks domain in case of block storage performance falls rapidly disks block domain..</technical_language>

Target:
private Guid findAvailableStorageDomain(long diskSize) { StorageDomain dest = null; for (StorageDomain domain: targetDomainsSize.keySet()) { if (dest == null || targetDomainsSize.get(domain) > targetDomainsSize.get(dest)) { dest = domain; } } long destSize = targetDomainsSize.get(dest); targetDomainsSize.replace(dest, destSize, destSize - diskSize); return dest.getId(); }
Source:
<code>private void onManageTagsResult(Intent data) { ArrayList<ManageTagsActivity.TagMutation> mutations = (ArrayList<ManageTagsActivity.TagMutation>)data.getSerializableExtra(ManageTagsActivity.EXTRA_TAG_MUTATIONS); SparseArray<ExpenseClaim> modifiedClaims = new SparseArray<ExpenseClaim>(); for (ManageTagsActivity.TagMutation mutation : mutations) { Tag tag = mutation.getOldTag(); int i = 0; for (ExpenseClaim claim : listModel.getItems()) { if (!claim.hasTag(tag)) continue; switch (mutation.getMutationType()) { case DELETE: claim.removeTag(tag); if(filteredTagsList.contains(tag) && checkFilteredTags()) { filteredTagsList.remove(tag); } break; case EDIT: int tagIndex = claim.getTags().indexOf(tag); claim.setTag(tagIndex, mutation.getNewTag()); <START> if(filteredTagsList.contains(tag) && checkFilteredTags()) { <END> int selectedIndex = filteredTagsList.indexOf(tag); filteredTagsList.set(selectedIndex, mutation.getNewTag()); } break; } modifiedClaims.append(i, claim); i++; } } for (int i = 0; i < modifiedClaims.size(); i++) { listModel.set(modifiedClaims.keyAt(i), modifiedClaims.valueAt(i)); } if(checkFilteredTags()) { setFilteredClaims(); } }</code><technical_language>Style inconsistency: space if</technical_language>

Target:
private void onManageTagsResult(Intent data) { ArrayList<ManageTagsActivity.TagMutation> mutations = (ArrayList<ManageTagsActivity.TagMutation>)data.getSerializableExtra(ManageTagsActivity.EXTRA_TAG_MUTATIONS); SparseArray<ExpenseClaim> modifiedClaims = new SparseArray<ExpenseClaim>(); for (ManageTagsActivity.TagMutation mutation : mutations) { Tag tag = mutation.getOldTag(); int i = 0; for (ExpenseClaim claim : listModel.getItems()) { if (!claim.hasTag(tag)) continue; switch (mutation.getMutationType()) { case DELETE: claim.removeTag(tag); if (filteredTagsList.contains(tag) && !filteredTagsList.isEmpty()) { filteredTagsList.remove(tag); } break; case EDIT: int tagIndex = claim.getTags().indexOf(tag); claim.setTag(tagIndex, mutation.getNewTag()); if (filteredTagsList.contains(tag) && !filteredTagsList.isEmpty()) { int selectedIndex = filteredTagsList.indexOf(tag); filteredTagsList.set(selectedIndex, mutation.getNewTag()); } break; } modifiedClaims.append(i, claim); i++; } } for (int i = 0; i < modifiedClaims.size(); i++) { listModel.set(modifiedClaims.keyAt(i), modifiedClaims.valueAt(i)); } if (!filteredTagsList.isEmpty()) { setFilteredClaims(); } }
Source:
<code>public void onUrlClick(@NonNull String href, @Nullable String titleString) { if (href.startsWith(" href = "https:" + href; } Log.d("Wikipedia", "Link clicked was " + href); <START> if (!DeviceUtil.isOnline() && !TextUtils.isEmpty(titleString) <END> && OfflineManager.instance().titleExists(titleString)) { PageTitle title = PageTitle.withSeparateFragment(titleString, UriUtil.getFragment(href), getWikiSite()); onInternalLinkClicked(title); } else if (href.startsWith("/wiki/")) { PageTitle title = TextUtils.isEmpty(titleString) ? getWikiSite().titleForInternalLink(href) : PageTitle.withSeparateFragment(titleString, UriUtil.getFragment(href), getWikiSite()); onInternalLinkClicked(title); } else if (href.startsWith("#")) { onPageLinkClicked(href.substring(1)); } else { Uri uri = Uri.parse(href); String authority = uri.getAuthority(); if (authority != null && WikiSite.supportedAuthority(authority) && uri.getPath().startsWith("/wiki/")) { WikiSite wiki = new WikiSite(authority, getWikiSite().languageCode()); PageTitle title = wiki.titleForUri(uri); onInternalLinkClicked(title); } else { if (href.startsWith("/w/")) { href = String.format("%1$s://%2$s", getWikiSite().scheme(), getWikiSite().authority()) + href; } handleExternalLink(context, Uri.parse(href)); } } }</code><technical_language>preempt cache here, meaning user potentially get staler content otherwise. I suppose necessary able hook page load pipeline interceptor, changing in a future refinement, if get pre-processing ZIM contents lead/remaining sections. (Or, I say, retiring two-step loading...?)</technical_language>

Target:
public void onUrlClick(@NonNull String href, @Nullable String titleString) { if (href.startsWith(" href = "https:" + href; } Log.d("Wikipedia", "Link clicked was " + href); if (!TextUtils.isEmpty(titleString)) { PageTitle title = PageTitle.withSeparateFragment(titleString, UriUtil.getFragment(href), getWikiSite()); onInternalLinkClicked(title); } else if (href.startsWith("/wiki/")) { PageTitle title = getWikiSite().titleForInternalLink(href); onInternalLinkClicked(title); } else if (href.startsWith("#")) { onPageLinkClicked(href.substring(1)); } else { Uri uri = Uri.parse(href); String authority = uri.getAuthority(); if (authority != null && WikiSite.supportedAuthority(authority) && uri.getPath().startsWith("/wiki/")) { WikiSite wiki = new WikiSite(authority, getWikiSite().languageCode()); PageTitle title = wiki.titleForUri(uri); onInternalLinkClicked(title); } else { if (href.startsWith("/w/")) { href = String.format("%1$s://%2$s", getWikiSite().scheme(), getWikiSite().authority()) + href; } handleExternalLink(context, Uri.parse(href)); } } }
Source:
<code>public PythonInterpreterSelectionDialog(final JsArray<PythonInterpreter> interpreters, final OperationWithInput<PythonInterpreter> operation) { super("Python Interpreters", Roles.getDialogRole(), operation); setOkButtonCaption("Select"); <START> widgets_ = new WidgetListBox<PythonInterpreterListEntryUi>(); <END> for (PythonInterpreter interpreter : JsUtil.asIterable(interpreters)) if (interpreter.getVersion() != null) widgets_.addItem(new PythonInterpreterListEntryUi(interpreter)); }</code><technical_language>listbox a label for screen readers (for a visual user obvious for unlabeled control a screen reader): widgets_.setAriaLabel("Python Interpreters");</technical_language>

Target:
public PythonInterpreterSelectionDialog(final JsArray<PythonInterpreter> interpreters, final OperationWithInput<PythonInterpreter> operation) { super("Python Interpreters", Roles.getDialogRole(), operation); setOkButtonCaption("Select"); widgets_ = new WidgetListBox<PythonInterpreterListEntryUi>(); widgets_.setAriaLabel("Python Interpreters"); for (PythonInterpreter interpreter : JsUtil.asIterable(interpreters)) if (interpreter.getVersion() != null) widgets_.addItem(new PythonInterpreterListEntryUi(interpreter)); }
Source:
<code>public static <T extends ERXCopyable> NSArray<EOAttribute> exposedPKAndFKAttributes(T source) { EOEntity entity = Utility.entity(source); String entityName = entity.name(); <START> if (Utility._exposedPKAndFKAttributeDictionary == null) { <END> Utility._exposedPKAndFKAttributeDictionary = new NSMutableDictionary<String, NSArray<EOAttribute>>(); } NSArray<EOAttribute> exposedPKAndFKAttributes = Utility._exposedPKAndFKAttributeDictionary.objectForKey(entityName); if (exposedPKAndFKAttributes == null) { ERXCopyable.copyLogger.debug("Checking " + entityName + " for Primary and/or Foreign Key attributes that are marked as class properties in the EOModel..."); NSArray<EOAttribute> classAttributes = classAttributes(entity); NSArray<EOAttribute> primaryAndForeignKeyAttributes = primaryAndForeignKeyAttributes(source); exposedPKAndFKAttributes = ERXArrayUtilities.intersectingElements(classAttributes, primaryAndForeignKeyAttributes); if (exposedPKAndFKAttributes.isEmpty()) { ERXCopyable.copyLogger.debug("--> NO Primary or Foreign Key attributes are marked as class properties in the EOModel. Excellent! Good work designer."); } else { ERXCopyable.copyLogger.debug("--> The following Primary and/or Foreign Key attributes are marked as class properties in the EOModel." + exposedPKAndFKAttributes.componentsJoinedByString(",") + ". There better be a good reason."); } Utility._exposedPKAndFKAttributeDictionary.setObjectForKey(exposedPKAndFKAttributes, entityName); } return exposedPKAndFKAttributes; }</code><technical_language>accesses static variables synchronized in some sort of way</technical_language>

Target:
public static synchronized <T extends ERXCopyable> NSArray<EOAttribute> exposedPKAndFKAttributes(T source) { EOEntity entity = Utility.entity(source); String entityName = entity.name(); if (Utility._exposedPKAndFKAttributeDictionary == null) { Utility._exposedPKAndFKAttributeDictionary = new NSMutableDictionary<String, NSArray<EOAttribute>>(); } NSArray<EOAttribute> exposedPKAndFKAttributes = Utility._exposedPKAndFKAttributeDictionary.objectForKey(entityName); if (exposedPKAndFKAttributes == null) { ERXCopyable.copyLogger.debug("Checking " + entityName + " for Primary and/or Foreign Key attributes that are marked as class properties in the EOModel..."); NSArray<EOAttribute> classAttributes = classAttributes(entity); NSArray<EOAttribute> primaryAndForeignKeyAttributes = primaryAndForeignKeyAttributes(source); exposedPKAndFKAttributes = ERXArrayUtilities.intersectingElements(classAttributes, primaryAndForeignKeyAttributes); if (exposedPKAndFKAttributes.isEmpty()) { ERXCopyable.copyLogger.debug("--> NO Primary or Foreign Key attributes are marked as class properties in the EOModel. Excellent! Good work designer."); } else { ERXCopyable.copyLogger.debug("--> The following Primary and/or Foreign Key attributes are marked as class properties in the EOModel." + exposedPKAndFKAttributes.componentsJoinedByString(",") + ". There better be a good reason."); } Utility._exposedPKAndFKAttributeDictionary.setObjectForKey(exposedPKAndFKAttributes, entityName); } return exposedPKAndFKAttributes; }
Source:
<code>public boolean onPrepareOptionsMenu(Menu menu) { <START> menu.getItem(0).setEnabled(historyEntryList.getCount() > 0); <END> return super.onPrepareOptionsMenu(menu); }</code><technical_language>findItem ID rely index</technical_language>

Target:
public boolean onPrepareOptionsMenu(Menu menu) { menu.findItem(R.id.menu_clear_all_history).setEnabled(historyEntryList.getCount() > 0); return super.onPrepareOptionsMenu(menu); }
Source:
<code>public static String getUserSecretKey(final Ds3Client client, final String username) { try { return client.getUserSpectraS3(new GetUserSpectraS3Request(username)).getSpectraUserResult().getSecretKey(); } catch (final Exception e) { <START> return ""; <END> } }</code><technical_language>swallow exceptions logging exception</technical_language>

Target:
public static String getUserSecretKey(final Ds3Client client, final String username) { try { return client.getUserSpectraS3(new GetUserSpectraS3Request(username)).getSpectraUserResult().getSecretKey(); } catch (final Exception e) { LOG.error("Could not get Secret Key for User " + username, e); return ""; } }
Source:
<code>public static Map<String, Properties> getImportProcessorConfig(ImportType importType) { Map<String, Properties> processorConfig = new HashMap<String, Properties>(); if (importType == null) { return processorConfig; } List<String> streamList = new ArrayList<String>(); int i = 0; for (ImportConfigurationType importConfiguration : importType.getConfiguration()) { boolean connectorEnabled = importConfiguration.isEnabled(); if (!connectorEnabled) continue; if (!streamList.contains(importConfiguration.getModule())) { streamList.add(importConfiguration.getModule()); } Properties processorProperties = checkImportProcessorConfiguration(importConfiguration); String transformer = (importConfiguration.getTransformer() == null) ? null : importConfiguration.getTransformer().getName(); if (transformer != null && !transformer.trim().isEmpty()) { <START> processorProperties.put(ImportDataProcessor.IMPORT_TRANSFORMER, transformer); <END> } processorConfig.put(importConfiguration.getModule() + i++, processorProperties); } return processorConfig; }</code><technical_language>put trimmed in processorProperties</technical_language>

Target:
public static Map<String, Properties> getImportProcessorConfig(ImportType importType) { Map<String, Properties> processorConfig = new HashMap<String, Properties>(); if (importType == null) { return processorConfig; } List<String> streamList = new ArrayList<String>(); int i = 0; for (ImportConfigurationType importConfiguration : importType.getConfiguration()) { boolean connectorEnabled = importConfiguration.isEnabled(); if (!connectorEnabled) continue; if (!streamList.contains(importConfiguration.getModule())) { streamList.add(importConfiguration.getModule()); } Properties processorProperties = checkImportProcessorConfiguration(importConfiguration); String transformer = (importConfiguration.getTransformer() == null) ? null : importConfiguration.getTransformer().getName().trim(); if (transformer != null && !transformer.isEmpty()) { processorProperties.put(ImportDataProcessor.IMPORT_TRANSFORMER, transformer); } processorConfig.put(importConfiguration.getModule() + i++, processorProperties); } return processorConfig; }
Source:
<code>private V innerGet(long timeout, TimeUnit unit) throws ExecutionException, TimeoutException, InterruptedException { if (isCancelled()) throw new CancellationException("Task already cancelled"); long timeoutNanos = computeTimeoutNanos(timeout, unit); long endNanos = System.nanoTime() + timeoutNanos; V response; try { if (timeoutNanos > 0) { response = retrieveResult(f.get(timeoutNanos, TimeUnit.NANOSECONDS)); } else { response = retrieveResult(f.get()); } } catch (TimeoutException te) { throw te; } catch (Exception e) { long remainingNanos = timeoutNanos > 0 ? endNanos - System.nanoTime() : timeoutNanos; if (timeoutNanos > 0 && remainingNanos <= 0) { <START> log.tracef("Distributed task timed out, throwing a TimeoutException and ignoring exception", e); <END> throw new TimeoutException(); } boolean canFailover = failedOverCount++ < getOwningTask().getTaskFailoverPolicy().maxFailoverAttempts(); if (canFailover) { try { response = failoverExecution(e, timeoutNanos, TimeUnit.NANOSECONDS); } catch (Exception failedOver) { throw wrapIntoExecutionException(failedOver); } } else { throw wrapIntoExecutionException(e); } } return response; }</code><technical_language>put log.trace guarded if condition if (log.isTraceEnabled())</technical_language>

Target:
private V innerGet(long timeout, TimeUnit unit) throws ExecutionException, TimeoutException, InterruptedException { if (isCancelled()) throw new CancellationException("Task already cancelled"); long timeoutNanos = computeTimeoutNanos(timeout, unit); long endNanos = System.nanoTime() + timeoutNanos; V response; try { if (timeoutNanos > 0) { response = retrieveResult(f.get(timeoutNanos, TimeUnit.NANOSECONDS)); } else { response = retrieveResult(f.get()); } } catch (TimeoutException te) { throw te; } catch (Exception e) { long remainingNanos = timeoutNanos > 0 ? endNanos - System.nanoTime() : timeoutNanos; if (timeoutNanos > 0 && remainingNanos <= 0) { if (trace) log.tracef("Distributed task timed out, throwing a TimeoutException and ignoring exception", e); throw new TimeoutException(); } boolean canFailover = failedOverCount++ < getOwningTask().getTaskFailoverPolicy().maxFailoverAttempts(); if (canFailover) { try { response = failoverExecution(e, timeoutNanos, TimeUnit.NANOSECONDS); } catch (Exception failedOver) { throw wrapIntoExecutionException(failedOver); } } else { throw wrapIntoExecutionException(e); } } return response; }
Source:
<code>private void renderJPEG2k(final ImageSegment imageSegment, final Graphics2D targetGraphic) throws IOException { final ImageReader reader = getImageReader("image/jp2"); reader.setInput(imageSegment.getData(), true, true); final ImageReadParam param = reader.getDefaultReadParam(); if (ImageRepresentation.MULTIBAND.equals(imageSegment.getImageRepresentation())) { final int[] sourceBands = getSourceBands(imageSegment); param.setSourceBands(sourceBands); } processBlocks(imageSegment, (r, c) -> { Rectangle rect = new Rectangle((int) (c * imageSegment.getNumberOfPixelsPerBlockVertical()), <START> (int) (r * imageSegment.getNumberOfPixelsPerBlockHorizontal()), <END> (int) imageSegment.getNumberOfPixelsPerBlockHorizontal(), (int) imageSegment.getNumberOfPixelsPerBlockVertical()); param.setSourceRegion(rect); BufferedImage renderedBlock = reader.read(0, param); param.setDestination(renderedBlock); targetGraphic.drawImage(renderedBlock, (int) (c * imageSegment.getNumberOfPixelsPerBlockVertical()), (int) (r * imageSegment.getNumberOfPixelsPerBlockHorizontal()), null); } ); }</code><technical_language>trouble convincing this logic is right for non-square blocks. of image is 400 pixels wide 300 pixels high. Assume block is 200 pixels wide (horizontal) 100 pixels high (vertical). 2 blocks wide 3 blocks high. For block (0,0) matter. (0,1) start (100, 0), I (200,0). if find a test case non-square blocks</technical_language>

Target:
private void renderJPEG2k(final ImageSegment imageSegment, final Graphics2D targetGraphic) throws IOException { final ImageReader reader = getImageReader("image/jp2"); reader.setInput(imageSegment.getData(), true, true); final ImageReadParam param = reader.getDefaultReadParam(); if (ImageRepresentation.MULTIBAND.equals(imageSegment.getImageRepresentation())) { final int[] sourceBands = getSourceBands(imageSegment); param.setSourceBands(sourceBands); } processBlocks(imageSegment, (r, c) -> { Rectangle rect = new Rectangle((int) (c * imageSegment.getNumberOfPixelsPerBlockHorizontal()), (int) (r * imageSegment.getNumberOfPixelsPerBlockVertical()), (int) imageSegment.getNumberOfPixelsPerBlockHorizontal(), (int) imageSegment.getNumberOfPixelsPerBlockVertical()); param.setSourceRegion(rect); BufferedImage renderedBlock = reader.read(0, param); param.setDestination(renderedBlock); targetGraphic.drawImage(renderedBlock, (int) (c * imageSegment.getNumberOfPixelsPerBlockVertical()), (int) (r * imageSegment.getNumberOfPixelsPerBlockHorizontal()), null); } ); }
Source:
<code>private JsonResponse saveOrUpdateGroup(@Valid @RequestBody GroupAdministrationDto groupDto, BindingResult result, Locale locale) throws org.jtalks.common.service.exceptions.NotFoundException { checkForAdminPermissions(); if (result.hasFieldErrors() || result.hasGlobalErrors()) { return new JsonResponse(JsonResponseStatus.FAIL, result.getAllErrors()); } try { <START> groupService.saveGroup(groupDto); <END> } catch (ValidationException e) { return new JsonResponse(JsonResponseStatus.FAIL, convertErrors(e.getErrors(), result.getObjectName(), locale)); } return new JsonResponse(JsonResponseStatus.SUCCESS); }</code><technical_language>transform DTO Entity here</technical_language>

Target:
private JsonResponse saveOrUpdateGroup(@Valid @RequestBody GroupAdministrationDto groupDto, BindingResult result, Locale locale) throws org.jtalks.common.service.exceptions.NotFoundException { checkForAdminPermissions(); if (result.hasFieldErrors() || result.hasGlobalErrors()) { return new JsonResponse(JsonResponseStatus.FAIL, result.getAllErrors()); } try { groupService.saveOrUpdate(groupDto); } catch (ValidationException e) { return new JsonResponse(JsonResponseStatus.FAIL, convertErrors(e.getErrors(), result.getObjectName(), locale)); } return new JsonResponse(JsonResponseStatus.SUCCESS); }
Source:
<code>public BinaryContent transform( SourceResponse upstreamResponse, Map<String, Serializable> arguments) throws CatalogTransformerException { if (upstreamResponse == null) { throw new CatalogTransformerException("Null result set cannot be transformed to RTF"); } Rtf doc = createRtfDoc(); upstreamResponse .getResults() .stream() .map(Result::getMetacard) .forEach(metacard -> toRtf(doc, metacard)); ByteArrayInputStream templateStream = Optional.ofNullable(doc) .map(Rtf::out) .map(Objects::toString) .map(this::rtfStringToInputStream) <START> .orElse(null); <END> return asBinaryContent(templateStream); }</code><technical_language>question, i.e., throw exception instead of passing null asBinaryContent()</technical_language>

Target:
public BinaryContent transform( SourceResponse upstreamResponse, Map<String, Serializable> arguments) throws CatalogTransformerException { if (upstreamResponse == null) { throw new CatalogTransformerException("Null result set cannot be transformed to RTF"); } Rtf doc = createRtfDoc(); upstreamResponse .getResults() .stream() .map(Result::getMetacard) .forEach(metacard -> toRtf(doc, metacard)); ByteArrayInputStream templateStream = Optional.ofNullable(doc) .map(Rtf::out) .map(Objects::toString) .map(this::rtfStringToInputStream) .orElseThrow(this::emptyRtfException); return new BinaryContentImpl(templateStream, mimeType); }
Source:
<code>IndexSegment(String dataDir, Offset startOffset, StoreKeyFactory factory, int keySize, int valueSize, <START> StoreConfig config, StoreMetrics metrics, Time time) { <END> this.rwLock = new ReentrantReadWriteLock(); this.startOffset = startOffset; this.endOffset = new AtomicReference<>(startOffset); index = new ConcurrentSkipListMap<>(); mapped = new AtomicBoolean(false); sizeWritten = new AtomicLong(0); this.factory = factory; this.keySize = keySize; this.valueSize = valueSize; this.version = PersistentIndex.VERSION_1; bloomFilter = FilterFactory.getFilter(config.storeIndexMaxNumberOfInmemElements, config.storeIndexBloomMaxFalsePositiveProbability); numberOfItems = new AtomicInteger(0); this.metrics = metrics; this.lastModifiedTimeSec = new AtomicLong(time.seconds()); this.time = time; indexSegmentFilenamePrefix = generateIndexSegmentFilenamePrefix(); indexFile = new File(dataDir, indexSegmentFilenamePrefix + INDEX_SEGMENT_FILE_NAME_SUFFIX); bloomFile = new File(dataDir, indexSegmentFilenamePrefix + BLOOM_FILE_NAME_SUFFIX); }</code><technical_language>need time get time system</technical_language>

Target:
IndexSegment(String dataDir, Offset startOffset, StoreKeyFactory factory, int keySize, int valueSize, StoreConfig config, StoreMetrics metrics, Time time) { this.rwLock = new ReentrantReadWriteLock(); this.startOffset = startOffset; this.endOffset = new AtomicReference<>(startOffset); index = new ConcurrentSkipListMap<>(); mapped = new AtomicBoolean(false); sizeWritten = new AtomicLong(0); this.factory = factory; this.keySize = keySize; this.valueSize = valueSize; this.version = PersistentIndex.CURRENT_VERSION; bloomFilter = FilterFactory.getFilter(config.storeIndexMaxNumberOfInmemElements, config.storeIndexBloomMaxFalsePositiveProbability); numberOfItems = new AtomicInteger(0); this.metrics = metrics; this.time = time; lastModifiedTimeSec = new AtomicLong(time.seconds()); indexSegmentFilenamePrefix = generateIndexSegmentFilenamePrefix(); indexFile = new File(dataDir, indexSegmentFilenamePrefix + INDEX_SEGMENT_FILE_NAME_SUFFIX); bloomFile = new File(dataDir, indexSegmentFilenamePrefix + BLOOM_FILE_NAME_SUFFIX); }
Source:
<code>public void testConstructor() { try { MqttBrokerConnection a = new MqttBrokerConnection("name", "tcp://123.123.123.123", false); MqttBrokerConnection b = new MqttBrokerConnection("name", "ssl://123.123.123.123", true); assertFalse(a.isTextualConfiguredBroker()); assertTrue(b.isTextualConfiguredBroker()); } catch (ConfigurationException e) { fail("Unexpected configuration exception: " + e.getMessage()); } try { @SuppressWarnings("unused") <START> MqttBrokerConnection ignored = new MqttBrokerConnection("name", "unsupported://123.123.123.123", false); <END> fail("Configuration exception expected: No valid url protocol"); } catch (ConfigurationException e) { } try { @SuppressWarnings("unused") MqttBrokerConnection ignored = new MqttBrokerConnection(" ", "tcp://123.123.123.123", false); fail("Configuration exception expected: No valid name"); } catch (ConfigurationException e) { } }</code><technical_language>I guess this is a matter of taste: I prefer separate tests for assertions. shorten test @Test(expected = ConfigurationException.class) public void unsupportedProtocolShouldThrowException() throws Exception { new MqttBrokerConnection("name", "unsupported://123.123.123.123", false); }</technical_language>

Target:
public void testConstructor() throws ConfigurationException { MqttBrokerConnection a = new MqttBrokerConnection("name", "tcp://123.123.123.123", false); MqttBrokerConnection b = new MqttBrokerConnection("name", "ssl://123.123.123.123", true); assertFalse(a.isTextualConfiguredBroker()); assertTrue(b.isTextualConfiguredBroker()); }
Source:
<code><START> public Connectives getConnectives() { <END> return connectives; }</code><technical_language>want this ideally package protected</technical_language>

Target:
Connectives getConnectives() { return connectives; }
Source:
<code><START> private String validateAndFormat(String diagnosisSetIds) { <END> if ("".equals(diagnosisSetIds)) { return diagnosisSetIds; } List<Concept> concepts = new ArrayList<Concept>(); for (StringTokenizer st = new StringTokenizer(diagnosisSetIds, ","); st.hasMoreTokens();) { String id = st.nextToken().trim(); Concept concept = HtmlFormEntryUtil.getConcept(id); if (concept == null) { throw new IllegalArgumentException("Cannot find diagnosis set for value " + id + " in diagnosisSets attribute value. Parameters: " + diagnosisSetIds); } concepts.add(concept); } StringBuilder sb = new StringBuilder(""); if (CollectionUtils.isNotEmpty(concepts)) { for (Concept con : concepts) { sb.append(con.getUuid() + ","); } } String uuids = sb.toString(); return uuids.substring(0, uuids.lastIndexOf(",")); }</code><technical_language>is this again</technical_language>

Target:
private String validateAndFormat(String diagnosisSetIds) { if (StringUtils.isEmpty(diagnosisSetIds)) { return ""; } List<Concept> concepts = new ArrayList<Concept>(); for (StringTokenizer st = new StringTokenizer(diagnosisSetIds, ","); st.hasMoreTokens();) { String id = st.nextToken().trim(); Concept concept = HtmlFormEntryUtil.getConcept(id); if (concept == null) { throw new IllegalArgumentException("Cannot find diagnosis set for value '" + id + "' in diagnosisSets attribute value. Parameters: " + diagnosisSetIds); } concepts.add(concept); } StringBuilder sb = new StringBuilder(""); if (CollectionUtils.isNotEmpty(concepts)) { for (Concept con : concepts) { sb.append(con.getUuid() + ","); } } String uuids = sb.toString(); return StringUtils.removeEnd(uuids, ","); }
Source:
<code>public static Type getPrestoTypeFromPinotType(FieldSpec field, boolean inferDateType, boolean inferTimestampType) { if (field.isSingleValueField()) { switch (field.getFieldType()) { case TIME: TimeFieldSpec timeFieldSpec = (TimeFieldSpec) field; TimeGranularitySpec outSpec = timeFieldSpec.getOutgoingGranularitySpec(); if (outSpec != null) { <START> if (outSpec.getTimeFormat().equalsIgnoreCase(TimeGranularitySpec.TimeFormat.EPOCH.name())) { <END> if (inferDateType && (TimeUnit.DAYS == outSpec.getTimeType()) && (outSpec.getTimeUnitSize() == 1)) { return DateType.DATE; } if (inferTimestampType && (TimeUnit.MILLISECONDS == outSpec.getTimeType()) && (outSpec.getTimeUnitSize() == 1)) { return TimestampType.TIMESTAMP; } } } else { TimeGranularitySpec inSpec = timeFieldSpec.getIncomingGranularitySpec(); if (inferDateType && (TimeUnit.DAYS == inSpec.getTimeType()) && (inSpec.getTimeUnitSize() == 1)) { return DateType.DATE; } if (inferTimestampType && (TimeUnit.MILLISECONDS == inSpec.getTimeType()) && (inSpec.getTimeUnitSize() == 1)) { return TimestampType.TIMESTAMP; } } return getPrestoTypeFromPinotType(field.getDataType()); case DATE_TIME: DateTimeFieldSpec dateTimeFieldSpec = (DateTimeFieldSpec) field; if (inferDateType && dateTimeFieldSpec.getFormat().equalsIgnoreCase(DAYS_SINCE_EPOCH_TIME_FORMAT)) { return DateType.DATE; } if (inferTimestampType && dateTimeFieldSpec.getFormat().equalsIgnoreCase(MILLISECONDS_SINCE_EPOCH_TIME_FORMAT)) { return TimestampType.TIMESTAMP; } } return getPrestoTypeFromPinotType(field.getDataType()); } return VarcharType.VARCHAR; }</code><technical_language>static import EPOCH</technical_language>

Target:
public static Type getPrestoTypeFromPinotType(FieldSpec field, boolean inferDateType, boolean inferTimestampType) { if (field.isSingleValueField()) { switch (field.getFieldType()) { case TIME: TimeFieldSpec timeFieldSpec = (TimeFieldSpec) field; TimeGranularitySpec outSpec = timeFieldSpec.getOutgoingGranularitySpec(); if (outSpec != null) { if (outSpec.getTimeFormat().equalsIgnoreCase(EPOCH.name())) { if (inferDateType && (DAYS == outSpec.getTimeType()) && (outSpec.getTimeUnitSize() == 1)) { return DateType.DATE; } if (inferTimestampType && (MILLISECONDS == outSpec.getTimeType()) && (outSpec.getTimeUnitSize() == 1)) { return TimestampType.TIMESTAMP; } } } else { TimeGranularitySpec inSpec = timeFieldSpec.getIncomingGranularitySpec(); if (inferDateType && (DAYS == inSpec.getTimeType()) && (inSpec.getTimeUnitSize() == 1)) { return DateType.DATE; } if (inferTimestampType && (MILLISECONDS == inSpec.getTimeType()) && (inSpec.getTimeUnitSize() == 1)) { return TimestampType.TIMESTAMP; } } return getPrestoTypeFromPinotType(field.getDataType()); case DATE_TIME: DateTimeFieldSpec dateTimeFieldSpec = (DateTimeFieldSpec) field; if (inferDateType && dateTimeFieldSpec.getFormat().equalsIgnoreCase(DAYS_SINCE_EPOCH_TIME_FORMAT)) { return DateType.DATE; } if (inferTimestampType && dateTimeFieldSpec.getFormat().equalsIgnoreCase(MILLISECONDS_SINCE_EPOCH_TIME_FORMAT)) { return TimestampType.TIMESTAMP; } } return getPrestoTypeFromPinotType(field.getDataType()); } return VarcharType.VARCHAR; }
Source:
<code>void isFirstCharacterANumber(){ var bibDatabaseContextEdition=new BibDatabaseContext(); var editionChecker=new EditionChecker(bibDatabaseContextEdition,allowIntegerEdition); var stringWithNumber="0HelloWorld"; <START> boolean flag=editionChecker.isFirstCharDigit(stringWithNumber); <END> assertTrue(flag,"check for true"); }</code><technical_language>Combine this next line to: java assertTrue(editionChecker.isFirstCharDigit(stringWithNumber)); need for text outputs in assert statements</technical_language>

Target:
void isFirstCharacterANumber() { boolean allowIntegerEdition = false; var bibDatabaseContextEdition = new BibDatabaseContext(); var editionChecker = new EditionChecker(bibDatabaseContextEdition, allowIntegerEdition); var stringWithNumber = "0HelloWorld"; assertTrue(editionChecker.isFirstCharDigit(stringWithNumber)); }
Source:
<code>protected void initChannel(SocketChannel channel) throws Exception { channel.attr(Message.CODEC_REGISTRY_ATTRIBUTE_KEY).set(codecRegistry); ChannelPipeline pipeline = channel.pipeline(); if (sslOptions != null) { pipeline.addLast("ssl", sslOptions.newSSLHandler(channel)); } pipeline.addLast("frameDecoder", new Frame.Decoder()); pipeline.addLast("frameEncoder", frameEncoder); if (useBeta) { <START> pipeline.addLast(new Frame.BetaVersionFlagAdder()); <END> } if (compressor != null) { pipeline.addLast("frameDecompressor", new Frame.Decompressor(compressor)); pipeline.addLast("frameCompressor", new Frame.Compressor(compressor)); } pipeline.addLast("messageDecoder", messageDecoder); pipeline.addLast("messageEncoder", messageEncoderFor(protocolVersion)); pipeline.addLast("idleStateHandler", idleStateHandler); pipeline.addLast("dispatcher", connection.dispatcher); nettyOptions.afterChannelInitialized(channel); }</code><technical_language>minor suggestions: 1. I practical implications of _not_ giving a name a handler, other handlers names in this method, suggest name this new too. 2. this handler is stateless, a singleton, Frame.Encoder? good annotate @ChannelHandler.Sharable</technical_language>

Target:
protected void initChannel(SocketChannel channel) throws Exception { channel.attr(Message.CODEC_REGISTRY_ATTRIBUTE_KEY).set(codecRegistry); ChannelPipeline pipeline = channel.pipeline(); if (sslOptions != null) { pipeline.addLast("ssl", sslOptions.newSSLHandler(channel)); } pipeline.addLast("frameDecoder", new Frame.Decoder()); pipeline.addLast("frameEncoder", frameEncoder); if (compressor != null) { pipeline.addLast("frameDecompressor", new Frame.Decompressor(compressor)); pipeline.addLast("frameCompressor", new Frame.Compressor(compressor)); } pipeline.addLast("messageDecoder", messageDecoder); pipeline.addLast("messageEncoder", messageEncoderFor(protocolVersion)); pipeline.addLast("idleStateHandler", idleStateHandler); pipeline.addLast("dispatcher", connection.dispatcher); nettyOptions.afterChannelInitialized(channel); }
Source:
<code>@Override public double determinant() { checkCardinality(vector.size(), replicationCnt); <START> return vector.size() > 0 ? 0 : vector.get(1); <END> }</code><technical_language>weird, it</technical_language>

Target:
@Override public double determinant() { checkCardinality(vector.size(), replicationCnt); return vector.size() > 1 ? 0 : vector.get(1); }
Source:
<code>Optional<TypedValue> createSummaryProperty(SubjectReference source, DataSet dataSet) { QuadStore quadStore = dataSet.getQuadStore(); <START> Optional<CursorQuad> userConfigured = quadStore.getQuads( <END> source.getSubjectUri(), userConfiguredPredicate, Direction.OUT, "" ).findFirst(); if (userConfigured.isPresent()) { return Optional.ofNullable(createTypedValue(userConfigured.get(), dataSet)); } else { Optional<CursorQuad> quad = Optional.empty(); for (SummaryProp prop : defaultProperties) { for (String path : prop.getPath()) { String uri = quad.isPresent() ? quad.get().getObject() : source.getSubjectUri(); quad = quadStore.getQuads(uri, path, Direction.OUT, "").findAny(); if (!quad.isPresent()) { break; } } if (quad.isPresent()) { break; } } Optional<CursorQuad> foundData = quad; if (foundData.isPresent()) { return Optional.ofNullable(createTypedValue(foundData.get(), dataSet)); } } return Optional.empty(); }</code><technical_language>userConfigure predicate points a path. as: Optional<CursorQuad> userConfigured = quadStore.getQuads( dataSet.getMetadata().getBaseUri(), userConfiguredPredicate, Direction.OUT, "" ).findFirst(); if (userConfigured.isPresent()) { final SummaryProp summaryProp = SummaryProp.create(Lists.newArrayList(userConfigured.get() .getObject() .split(" ")), "SimplePath"); }</technical_language>

Target:
public Optional<TypedValue> createSummaryProperty(SubjectReference source, DataSet dataSet) { QuadStore quadStore = dataSet.getQuadStore(); final Optional<TypedValue> localConfiguredSummaryProp = getQuad(quadStore, source.getSubjectUri(), RdfConstants.RDF_TYPE) .flatMap(collection -> getQuad(quadStore, collection.getObject(), summaryPropConfigPredicate)) .flatMap(userConfigured -> { try { SummaryProp summaryProp = OBJECT_MAPPER.readValue(userConfigured.getObject(), SummaryProp.class); return getQuad(summaryProp.getPath(), source.getSubjectUri(), quadStore) .map(quad -> createTypedValue(quad, dataSet)); } catch (IOException e) { LOG.error("Cannot parse SummaryProp: '{}'", userConfigured.getObject()); } return Optional.empty(); }); if (localConfiguredSummaryProp.isPresent()) { return localConfiguredSummaryProp; } else { for (SummaryProp prop : defaultProperties) { Optional<CursorQuad> quad = getQuad(prop.getPath(), source.getSubjectUri(), quadStore); if (quad.isPresent()) { return Optional.of(createTypedValue(quad.get(), dataSet)); } } return Optional.empty(); } }
Source:
<code>private void handleSignInResponse(int resultCode, Intent data) { IdpResponse response = IdpResponse.fromResultIntent(data); if (resultCode == ResultCodes.OK) { startActivity( SignedInActivity.createIntent( this, response, new SignedInActivity.SignedInConfig( getSelectedLogo(), getSelectedTheme(), getSelectedProviders(), getSelectedTosUrl(), <START> mEnableSmartLock.isEnabled()))); <END> finish(); return; } else { if (response == null) { showSnackbar(R.string.sign_in_cancelled); return; } if (response.getErrorCode() == ErrorCodes.NO_NETWORK) { showSnackbar(R.string.no_internet_connection); return; } if (response.getErrorCode() == ErrorCodes.UNKNOWN_ERROR) { showSnackbar(R.string.unknown_error); return; } } showSnackbar(R.string.unknown_sign_in_response); }</code><technical_language>@amandle new SignedInActivity.SignedInConfig(...) part a method a copy paste of above? (Actually, I do a Ctrl + Alt + M startActivity Intellij generate a response parameter nicer a method for SignedInConfig part.)</technical_language>

Target:
private void handleSignInResponse(int resultCode, Intent data) { IdpResponse response = IdpResponse.fromResultIntent(data); if (resultCode == ResultCodes.OK) { startSignedInActivity(response); finish(); return; } else { if (response == null) { showSnackbar(R.string.sign_in_cancelled); return; } if (response.getErrorCode() == ErrorCodes.NO_NETWORK) { showSnackbar(R.string.no_internet_connection); return; } if (response.getErrorCode() == ErrorCodes.UNKNOWN_ERROR) { showSnackbar(R.string.unknown_error); return; } } showSnackbar(R.string.unknown_sign_in_response); }
Source:
<code>public ReferencedEnvelope getEnlargedEnvelope() { if(this.enlargedEnvelope == null) { <START> log.warn("Enlarged envelope not created"); <END> if(this.envelope == null) { this.getEnvelope(); } return this.envelope; } return this.enlargedEnvelope; }</code><technical_language>I this logged debug</technical_language>

Target:
public ReferencedEnvelope getEnlargedEnvelope() { if(this.enlargedEnvelope == null) { log.debug("Enlarged envelope not created"); if(this.envelope == null) { this.getEnvelope(); } return this.envelope; } return this.enlargedEnvelope; }
Source:
<code><START> public Builder(final File jbossHome) { <END> this(jbossHome.toPath()); }</code><technical_language>Builder constructors private hidden of methods</technical_language>

Target:
private Builder(final File jbossHome) { this(jbossHome.toPath()); }
Source:
<code>public EntityArchetype build() { <START> checkState(!this.entityData.isEmpty()); <END> checkNotNull(this.entityType); checkState(this.entityType != UNKNOWN); return new SpongeEntityArchetype(this); }</code><technical_language>This removed - absolutely fine for entity data empty. serialization native format empty (ie adding EntityType field)</technical_language>

Target:
public EntityArchetype build() { checkNotNull(this.entityType); checkState(this.entityType != UNKNOWN); if(this.entityData == null) { this.entityData = new MemoryDataContainer(); } else { this.entityData.remove(DataQuery.of("Pos")); this.entityData.remove(DataQuery.of("UUID")); } return new SpongeEntityArchetype(this); }
Source:
<code>public void testCloseAllocations() throws Exception { BufferPool pool = new BufferPool(10, 1, metrics, Time.SYSTEM, metricGroup); ByteBuffer buffer = pool.allocate(1, maxBlockTimeMs); pool.close(); try { <START> pool.allocate(1, maxBlockTimeMs); <END> fail("Should have thrown KafkaException"); } catch (KafkaException e) { } pool.deallocate(buffer); }</code><technical_language>nit: assertThrows</technical_language>

Target:
public void testCloseAllocations() throws Exception { BufferPool pool = new BufferPool(10, 1, metrics, Time.SYSTEM, metricGroup); ByteBuffer buffer = pool.allocate(1, maxBlockTimeMs); pool.close(); assertThrows(KafkaException.class, () -> pool.allocate(1, maxBlockTimeMs)); pool.deallocate(buffer); }
Source:
<code>private boolean isLocatorOffline(OperationState operationState) { if (operationState.getOperationEnd() == null && (operationState.getLocator() != null) <START> && cache.getMyId().toString().compareTo(operationState.getLocator()) != 0 <END> && (!cache.getDistributedSystem().getAllOtherMembers().stream().map(Object::toString) .collect(Collectors.toSet()).contains(operationState.getLocator()))) { return true; } return false; }</code><technical_language>need compared? changed "equals"...</technical_language>

Target:
private boolean isLocatorOffline(OperationState operationState) { return operationState.getOperationEnd() == null && (operationState.getLocator() != null) && !cache.getMyId().toString().equals(operationState.getLocator()) && (!cache.getDistributedSystem().getAllOtherMembers().stream().map(Object::toString) .collect(Collectors.toSet()).contains(operationState.getLocator())); }
Source:
<code><START> public String getGenericFields() { <END> return genericFields; }</code><technical_language>suggestion /** * @return a map of pairs of fields values in this header line */ public Map<String, String> getGenericFields() { return Collections.unmodifiableMap(genericFields); }</technical_language>

Target:
public Map<String, String> getGenericFields() { return Collections.unmodifiableMap(genericFields); }
Source:
<code>public CPPASTAttributeSpecifier() { <START> super(new char[0], null); <END> }</code><technical_language>CharArrayUtils.EMPTY_CHAR_ARRAY</technical_language>

Target:
public CPPASTAttributeSpecifier() { super(CharArrayUtils.EMPTY_CHAR_ARRAY, null); }
Source:
<code>private String getDataAgentConfigPath() { <START> Path path = Paths.get(appServerHome, getConfigFileFolder(), "data-agent-conf.xml"); <END> return path.toString(); }</code><technical_language>Define "data-agent-conf.xml" a constant</technical_language>

Target:
private String getDataAgentConfigPath() { Path path = Paths.get(appServerHome, getConfigFileFolder(), DefaultConfigurationConstants.DATA_AGENT_CONF); return path.toString(); }
Source:
<code>public DispatchRequest execute(RestAction action, AsyncCallback<Object> resultCallback, ExecuteCommand<RestAction, Object> executeCommand) { executeCommand.execute(action, resultCallback); <START> return new CompletedDispatchRequest(); <END> }</code><technical_language>I return executeCommand.execute(action, resultCallback); else lose "good" DispatchRequest in process</technical_language>

Target:
public DispatchRequest execute(RestAction action, AsyncCallback<Object> resultCallback, ExecuteCommand<RestAction, Object> executeCommand) { return executeCommand.execute(action, resultCallback); }
Source:
<code>public Ray (Vector3 origin, Vector3 direction, boolean normalizeDirection) { <START> this(origin, normalizeDirection ? direction.nor() : direction); <END> }</code><technical_language>This change direction vector passed in, please do that. Simple java this(origin, direction); if (normalizeDirection) { this.direction.nor(); } suffice. for setNormalize</technical_language>

Target:
public Ray (Vector3 origin, Vector3 direction, boolean normalizeDirection) { this(origin, direction); if (normalizeDirection) this.direction.nor(); }
Source:
<code>public Column[] getColumns() { if (_columns == null) { <START> final JsonDataContext jsonContext = new JsonDataContext(_jsonDatastore.getResource()); <END> final Table table = jsonContext.getDefaultSchema().getTable(0); _columns = table.getColumns(); } return _columns; }</code><technical_language>I a clearer open a connection datastore (and instantiate DataContext)</technical_language>

Target:
public Column[] getColumns() { if (_columns == null) { try (final DatastoreConnection openConnection = _jsonDatastore.openConnection()) { _columns = openConnection.getDataContext().getDefaultSchema().getTable(0).getColumns(); } } return _columns; }
Source:
<code>public void testGetInvalidityInfoForEmailSubject_null_throwException() { AdminEmailAttributes adminEmailAttributes = new AdminEmailAttributes( null, addressReceiverListString, groupReceiverListFileKey, content, date); <START> String errorMessage = "Did not throw the expected AssertionError for null Email Subject"; <END> try { fieldValidator.getInvalidityInfoForEmailSubject(adminEmailAttributes.subject); signalFailureToDetectException(errorMessage); } catch (AssertionError e) { ignoreExpectedException(); } }</code><technical_language>this need a variable</technical_language>

Target:
public void testGetInvalidityInfoForEmailSubject_null_throwException() { AdminEmailAttributes adminEmailAttributes = new AdminEmailAttributes( null, addressReceiverListString, groupReceiverListFileKey, content, date); try { fieldValidator.getInvalidityInfoForEmailSubject(adminEmailAttributes.subject); signalFailureToDetectException("Did not throw the expected AssertionError for null Email Subject"); } catch (AssertionError e) { ignoreExpectedException(); } }
Source:
<code>@NonNull public PreparedDeleteCollectionOfObjects<T> prepare() { if (deleteResolver == null) { deleteResolver = DefaultDeleteResolver.INSTANCE; } <START> Checks.checkNotNull(mapFunc, "Please specify map function"); <END> return new PreparedDeleteCollectionOfObjects<>( storIOSQLiteDb, objects, mapFunc, useTransactionIfPossible, deleteResolver ); }</code><technical_language>Static import</technical_language>

Target:
@NonNull public PreparedDeleteCollectionOfObjects<T> prepare() { if (deleteResolver == null) { deleteResolver = DefaultDeleteResolver.INSTANCE; } checkNotNull(mapFunc, "Please specify map function"); return new PreparedDeleteCollectionOfObjects<>( storIOSQLiteDb, objects, mapFunc, useTransactionIfPossible, deleteResolver ); }