auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public JobInfo(String jobName_, String groupName_, Class job_, String shouldRecover) { this(jobName_, groupName_, job_); if(shouldRecover == null) { this.shouldRecover= true; } else { this.shouldRecover = Boolean.getBoolean(shouldRecover); } }

Target:
public JobInfo(String jobName_, String groupName_, Class job_, String shouldRecover) { this(jobName_, groupName_, job_); if(shouldRecover == null) { this.shouldRecover= true; } else { this.shouldRecover = Boolean.valueOf(shouldRecover); } }
Source:
private static void fillChecksFromModifierPackage() { NAME_TO_FULL_MODULE_NAME.put("ModifierOrderCheck", BASE_PACKAGE + ".checks.modifier.ModifierOrderCheck"); NAME_TO_FULL_MODULE_NAME.put("RedundantModifierCheck", BASE_PACKAGE + ".checks.modifier.RedundantModifierCheck"); NAME_TO_FULL_MODULE_NAME.put("InterfaceMemberImpliedModifierCheck", BASE_PACKAGE + ".checks.modifier.InterfaceMemberImpliedModifierCheck"); }

Target:
private static void fillChecksFromModifierPackage() { NAME_TO_FULL_MODULE_NAME.put("InterfaceMemberImpliedModifierCheck", BASE_PACKAGE + ".checks.modifier.InterfaceMemberImpliedModifierCheck"); NAME_TO_FULL_MODULE_NAME.put("ModifierOrderCheck", BASE_PACKAGE + ".checks.modifier.ModifierOrderCheck"); NAME_TO_FULL_MODULE_NAME.put("RedundantModifierCheck", BASE_PACKAGE + ".checks.modifier.RedundantModifierCheck"); }
Source:
private void openDatabase() { Boolean connected = viewModel.openDatabase(); if (connected) { this.close(); } }

Target:
private void openDatabase() { boolean connected = viewModel.openDatabase(); if (connected) { this.close(); } }
Source:
public void testInsertTemplateToUnregisteredEntity() { dao = dbFacade.getUnregisteredOVFDataDao(); final String OVF_EXTRA_DATA = "<ovf> Some extra OVF data </ovf>"; dao.insertOVFDataForEntities(FixturesTool.VM_TEMPLATE_RHEL5, "Stam", "TEMPLATE", null, 1, 1, 1, 1, null, 1, "3.4", FixturesTool.STORAGE_DOAMIN_NFS2_1, OVF_EXTRA_DATA); OvfEntityData ovfEntityData = dao.getByVmId(FixturesTool.VM_TEMPLATE_RHEL5); assertNotNull(ovfEntityData); assertTrue("The entity type should be template", ovfEntityData.getEntityType().equals("TEMPLATE")); assertTrue("The entity OVF extra data should be updated", ovfEntityData.getOvfExtraData().equals(OVF_EXTRA_DATA)); }

Target:
public void testInsertTemplateToUnregisteredEntity() { dao = dbFacade.getUnregisteredOVFDataDao(); final String ovfExtraData = "<ovf> Some extra OVF data </ovf>"; dao.insertOVFDataForEntities(FixturesTool.VM_TEMPLATE_RHEL5, "Stam", "TEMPLATE", 1, "3.4", FixturesTool.STORAGE_DOAMIN_NFS2_1, ovfExtraData); OvfEntityData ovfEntityData = dao.getByEntityIdAndStorageDomain(FixturesTool.VM_TEMPLATE_RHEL5, FixturesTool.STORAGE_DOAMIN_NFS2_1); assertNotNull(ovfEntityData); assertTrue("The entity type should be template", ovfEntityData.getEntityType().equals("TEMPLATE")); assertTrue("The entity OVF extra data should be updated", ovfEntityData.getOvfExtraData() .equals(ovfExtraData)); }
Source:
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(); String connectionId = localHost + ":" + localPort + "-" + remoteHost + ":" + remotePort; selector.register(connectionId, remoteHost, remotePort, channel); } }

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:
public String toString() { return "AbsoluteTimeframe{" + "start='" + start + '\'' + ", end='" + end + '\'' + '}'; }

Target:
public String toString() { return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); }
Source:
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()) { haMaintenanceFailed = !hostedEngineHelper.updateHaLocalMaintenanceMode(getVds(), false); } if (initSucceeded && cluster.supportsGlusterService()) { initSucceeded = glusterCommandHelper.initGlusterHost(getVds()); } setSucceeded(initSucceeded); if (getSucceeded()) { addCustomValue("HostStatus", getVds().getStatus().toString()); auditLogDirector.log(this, AuditLogType.VDS_DETECTED); } }

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:
private Guid findAvailableStorageDomain(long diskSize) { StorageDomain dest = null; for (StorageDomain domain: targetDomains.keySet()) { if (dest == null || targetDomains.get(domain) > targetDomains.get(dest)) { dest = domain; } } long destSize = targetDomains.get(dest); targetDomains.replace(dest, destSize, destSize - diskSize); return dest.getId(); }

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:
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()); if(filteredTagsList.contains(tag) && checkFilteredTags()) { 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(); } }

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:
public void onUrlClick(@NonNull String href, @Nullable String titleString) { if (href.startsWith(" href = "https:" + href; } Log.d("Wikipedia", "Link clicked was " + href); if (!DeviceUtil.isOnline() && !TextUtils.isEmpty(titleString) && 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)); } } }

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:
public PythonInterpreterSelectionDialog(final JsArray<PythonInterpreter> interpreters, final OperationWithInput<PythonInterpreter> operation) { super("Python Interpreters", Roles.getDialogRole(), operation); setOkButtonCaption("Select"); widgets_ = new WidgetListBox<PythonInterpreterListEntryUi>(); for (PythonInterpreter interpreter : JsUtil.asIterable(interpreters)) if (interpreter.getVersion() != null) widgets_.addItem(new PythonInterpreterListEntryUi(interpreter)); }

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:
public static <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; }

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:
public boolean onPrepareOptionsMenu(Menu menu) { menu.getItem(0).setEnabled(historyEntryList.getCount() > 0); return super.onPrepareOptionsMenu(menu); }

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

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:
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()) { processorProperties.put(ImportDataProcessor.IMPORT_TRANSFORMER, transformer); } processorConfig.put(importConfiguration.getModule() + i++, processorProperties); } return processorConfig; }

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:
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) { 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; }

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:
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()), (int) (r * imageSegment.getNumberOfPixelsPerBlockHorizontal()), (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); } ); }

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:
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.saveGroup(groupDto); } catch (ValidationException e) { return new JsonResponse(JsonResponseStatus.FAIL, convertErrors(e.getErrors(), result.getObjectName(), locale)); } return new JsonResponse(JsonResponseStatus.SUCCESS); }

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:
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) .orElse(null); return asBinaryContent(templateStream); }

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:
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.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); }

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:
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") MqttBrokerConnection ignored = new MqttBrokerConnection("name", "unsupported://123.123.123.123", false); 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) { } }

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:
public Connectives getConnectives() { return connectives; }

Target:
Connectives getConnectives() { return connectives; }
Source:
private String validateAndFormat(String diagnosisSetIds) { 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(",")); }

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:
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(TimeGranularitySpec.TimeFormat.EPOCH.name())) { 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; }

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:
void isFirstCharacterANumber(){ var bibDatabaseContextEdition=new BibDatabaseContext(); var editionChecker=new EditionChecker(bibDatabaseContextEdition,allowIntegerEdition); var stringWithNumber="0HelloWorld"; boolean flag=editionChecker.isFirstCharDigit(stringWithNumber); assertTrue(flag,"check for true"); }

Target:
void isFirstCharacterANumber() { boolean allowIntegerEdition = false; var bibDatabaseContextEdition = new BibDatabaseContext(); var editionChecker = new EditionChecker(bibDatabaseContextEdition, allowIntegerEdition); var stringWithNumber = "0HelloWorld"; assertTrue(editionChecker.isFirstCharDigit(stringWithNumber)); }
Source:
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) { pipeline.addLast(new Frame.BetaVersionFlagAdder()); } 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); }

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:
@Override public double determinant() { checkCardinality(vector.size(), replicationCnt); return vector.size() > 0 ? 0 : vector.get(1); }

Target:
@Override public double determinant() { checkCardinality(vector.size(), replicationCnt); return vector.size() > 1 ? 0 : vector.get(1); }
Source:
Optional<TypedValue> createSummaryProperty(SubjectReference source, DataSet dataSet) { QuadStore quadStore = dataSet.getQuadStore(); Optional<CursorQuad> userConfigured = quadStore.getQuads( 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(); }

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:
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(), mEnableSmartLock.isEnabled()))); 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); }

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:
public ReferencedEnvelope getEnlargedEnvelope() { if(this.enlargedEnvelope == null) { log.warn("Enlarged envelope not created"); if(this.envelope == null) { this.getEnvelope(); } return this.envelope; } return this.enlargedEnvelope; }

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:
public Builder(final File jbossHome) { this(jbossHome.toPath()); }

Target:
private Builder(final File jbossHome) { this(jbossHome.toPath()); }
Source:
public EntityArchetype build() { checkState(!this.entityData.isEmpty()); checkNotNull(this.entityType); checkState(this.entityType != UNKNOWN); return new SpongeEntityArchetype(this); }

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:
public void testCloseAllocations() throws Exception { BufferPool pool = new BufferPool(10, 1, metrics, Time.SYSTEM, metricGroup); ByteBuffer buffer = pool.allocate(1, maxBlockTimeMs); pool.close(); try { pool.allocate(1, maxBlockTimeMs); fail("Should have thrown KafkaException"); } catch (KafkaException e) { } pool.deallocate(buffer); }

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:
private boolean isLocatorOffline(OperationState operationState) { if (operationState.getOperationEnd() == null && (operationState.getLocator() != null) && cache.getMyId().toString().compareTo(operationState.getLocator()) != 0 && (!cache.getDistributedSystem().getAllOtherMembers().stream().map(Object::toString) .collect(Collectors.toSet()).contains(operationState.getLocator()))) { return true; } return false; }

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:
public String getGenericFields() { return genericFields; }

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

Target:
public CPPASTAttributeSpecifier() { super(CharArrayUtils.EMPTY_CHAR_ARRAY, null); }
Source:
private String getDataAgentConfigPath() { Path path = Paths.get(appServerHome, getConfigFileFolder(), "data-agent-conf.xml"); return path.toString(); }

Target:
private String getDataAgentConfigPath() { Path path = Paths.get(appServerHome, getConfigFileFolder(), DefaultConfigurationConstants.DATA_AGENT_CONF); return path.toString(); }
Source:
public DispatchRequest execute(RestAction action, AsyncCallback<Object> resultCallback, ExecuteCommand<RestAction, Object> executeCommand) { executeCommand.execute(action, resultCallback); return new CompletedDispatchRequest(); }

Target:
public DispatchRequest execute(RestAction action, AsyncCallback<Object> resultCallback, ExecuteCommand<RestAction, Object> executeCommand) { return executeCommand.execute(action, resultCallback); }
Source:
public Ray (Vector3 origin, Vector3 direction, boolean normalizeDirection) { this(origin, normalizeDirection ? direction.nor() : direction); }

Target:
public Ray (Vector3 origin, Vector3 direction, boolean normalizeDirection) { this(origin, direction); if (normalizeDirection) this.direction.nor(); }
Source:
public Column[] getColumns() { if (_columns == null) { final JsonDataContext jsonContext = new JsonDataContext(_jsonDatastore.getResource()); final Table table = jsonContext.getDefaultSchema().getTable(0); _columns = table.getColumns(); } return _columns; }

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

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

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 ); }
Source:
public static DefaultExecutionTopology fromExecutionGraph(ExecutionGraph executionGraph) { checkNotNull(executionGraph, "execution graph can not be null"); ExecutionGraphIndex executionGraphIndex = computeExecutionGraphIndex( executionGraph.getAllExecutionVertices(), executionGraph.getNumberOfExecutionJobVertices()); IndexedPipelinedRegions indexedPipelinedRegions = computePipelinedRegions(executionGraphIndex.executionVerticesList); ensureCoLocatedVerticesInSameRegion(indexedPipelinedRegions.pipelinedRegions, executionGraph); return new DefaultExecutionTopology( executionGraphIndex.executionVerticesById, executionGraphIndex.executionVerticesList, executionGraphIndex.resultPartitionsById, indexedPipelinedRegions.pipelinedRegionsByVertex, indexedPipelinedRegions.pipelinedRegions); }

Target:
public static DefaultExecutionTopology fromExecutionGraph(ExecutionGraph executionGraph) { checkNotNull(executionGraph, "execution graph can not be null"); ExecutionGraphIndex executionGraphIndex = computeExecutionGraphIndex( executionGraph.getAllExecutionVertices(), executionGraph.getTotalNumberOfVertices()); IndexedPipelinedRegions indexedPipelinedRegions = computePipelinedRegions(executionGraphIndex.executionVerticesList); ensureCoLocatedVerticesInSameRegion(indexedPipelinedRegions.pipelinedRegions, executionGraph); return new DefaultExecutionTopology( executionGraphIndex.executionVerticesById, executionGraphIndex.executionVerticesList, executionGraphIndex.resultPartitionsById, indexedPipelinedRegions.pipelinedRegionsByVertex, indexedPipelinedRegions.pipelinedRegions); }
Source:
public void visitInsn(int opcode) { if (opcode == MONITORENTER) { onBeforeSyncEntry(); } else if (opcode == MONITOREXIT) { onBeforeSyncExit(); } switch (opcode) { case IRETURN: case ARETURN: case FRETURN: case LRETURN: case DRETURN: case RETURN: onMethodReturn(opcode); break; default: break; } super.visitInsn(opcode); if (opcode == MONITORENTER) { onAfterSyncEntry(); } else if (opcode == MONITOREXIT) { onAfterSyncExit(); } }

Target:
public void visitInsn(int opcode) { if (opcode == MONITORENTER) { onBeforeSyncEntry(); } else if (opcode == MONITOREXIT) { onBeforeSyncExit(); } super.visitInsn(opcode); if (opcode == MONITORENTER) { onAfterSyncEntry(); } else if (opcode == MONITOREXIT) { onAfterSyncExit(); } }