auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public <I extends T> LazyRegistryObject<I> lazyRegister(final String name, final Supplier<? extends I> sup) { Objects.requireNonNull(name); Objects.requireNonNull(sup); final ResourceLocation key = new ResourceLocation(modid, name); LazyRegistryObject<I> lazyRet = new LazyRegistryObject<>(()->RegistryObject.of(key, this.type)); if (lazyEntries.putIfAbsent(lazyRet.cast(), () -> sup.get().setRegistryName(key)) != null) { throw new IllegalArgumentException("Duplicate registration " + name); } return lazyRet; }

Target:
public <I extends T> LazyRegistryObject<I> lazyRegister(final String name, final Supplier<? extends I> sup) { Objects.requireNonNull(name); Objects.requireNonNull(sup); final ResourceLocation key = new ResourceLocation(modid, name); LazyRegistryObject<I> lazyRet = new LazyRegistryObject<>(()->RegistryObject.of(key, this.getType())); if (lazyEntries.putIfAbsent((LazyRegistryObject<T>)lazyRet, () -> sup.get().setRegistryName(key)) != null) { throw new IllegalArgumentException("Duplicate registration " + name); } return lazyRet; }
Source:
public void setProjectSaver(ProjectSaver projectSaver) { this.projectSaver = projectSaver; }

Target:
protected void setProjectSaver(ProjectSaver projectSaver) { this.projectSaver = projectSaver; }
Source:
public Object deserialize(ByteBuf b, CorfuRuntime rt) { try (ByteBufInputStream bbis = new ByteBufInputStream(b)) { MessageType type = MessageType.valueOf(bbis.readInt()); int size = bbis.readInt(); byte[] data = new byte[size]; bbis.readFully(data); Record record = Record.parseFrom(data); Any payload = record.getPayload(); FileDescriptor valueFileDescriptor = getDescriptor(messagesFdProtoNameMap.get(getFullMessageName(payload))); Descriptor valueDescriptor = valueFileDescriptor.findMessageTypeByName(getMessageName(payload)); DynamicMessage value = DynamicMessage.parseFrom(valueDescriptor, payload.getValue()); if (type.equals(MessageType.KEY)) { return new DynamicCorfuKey(payload.getTypeUrl(), value); } String metadataTypeUrl = null; DynamicMessage metadata = null; if (record.hasMetadata()) { Any anyMetadata = record.getMetadata(); metadataTypeUrl = anyMetadata.getTypeUrl(); FileDescriptor metaFileDescriptor = getDescriptor(messagesFdProtoNameMap.get(getFullMessageName(anyMetadata))); Descriptor metaDescriptor = metaFileDescriptor.findMessageTypeByName(getMessageName(anyMetadata)); metadata = DynamicMessage.parseFrom(metaDescriptor, anyMetadata.getValue()); } return new DynamicCorfuRecord(payload.getTypeUrl(), value, metadataTypeUrl, metadata); } catch (IOException | DescriptorValidationException ie) { log.error("Exception during deserialization!", ie); throw new SerializerException(ie); } }

Target:
public Object deserialize(ByteBuf b, CorfuRuntime rt) { try (ByteBufInputStream bbis = new ByteBufInputStream(b)) { MessageType type = MessageType.valueOf(bbis.readInt()); int size = bbis.readInt(); byte[] data = new byte[size]; bbis.readFully(data); Record record = Record.parseFrom(data); Any payload = record.getPayload(); FileDescriptor valueFileDescriptor = getDescriptor(messagesFdProtoNameMap.get(getFullMessageName(payload))); Descriptor valueDescriptor = valueFileDescriptor.findMessageTypeByName(getMessageName(payload)); DynamicMessage value = DynamicMessage.parseFrom(valueDescriptor, payload.getValue()); if (type.equals(MessageType.KEY)) { return new CorfuDynamicKey(payload.getTypeUrl(), value); } String metadataTypeUrl = null; DynamicMessage metadata = null; if (record.hasMetadata()) { Any anyMetadata = record.getMetadata(); metadataTypeUrl = anyMetadata.getTypeUrl(); FileDescriptor metaFileDescriptor = getDescriptor(messagesFdProtoNameMap.get(getFullMessageName(anyMetadata))); Descriptor metaDescriptor = metaFileDescriptor.findMessageTypeByName(getMessageName(anyMetadata)); metadata = DynamicMessage.parseFrom(metaDescriptor, anyMetadata.getValue()); } return new CorfuDynamicRecord(payload.getTypeUrl(), value, metadataTypeUrl, metadata); } catch (IOException | DescriptorValidationException ie) { log.error("Exception during deserialization!", ie); throw new SerializerException(ie); } }
Source:
public void onModuleLoad() { Debug.injectDebug(); Debug.devlog("onModuleLoad()!"); maybeDelayLoadApplication(this); }

Target:
public void onModuleLoad() { Debug.injectDebug(); maybeDelayLoadApplication(this); }
Source:
protected boolean canDoAction() { if (getVm() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); return false; } if (!canRunActionOnNonManagedVm()) { return false; } if (!isSpecifiedDisksExist(getParameters().getDisks())) { return false; } VmValidator vmValidator = createVmValidator(); SnapshotsValidator snapshotValidator = createSnapshotValidator(); StoragePoolValidator spValidator = createStoragePoolValidator(); if (!(validateVM(vmValidator) && validate(spValidator.isUp()) && validate(vmValidator.vmNotIlegal()) && validate(vmValidator.vmNotLocked()) && validate(snapshotValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotValidator.vmNotInPreview(getVmId())) && validate(vmValidator.vmNotDuringMigration()) && validate(vmValidator.vmNotRunningStateless()))) { return false; } List<DiskImage> disksList = getDisksListForChecks(); MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator(disksList); if (disksList.size() > 0) { DiskImagesValidator diskImagesValidator = createDiskImageValidator(disksList); if (!(validate(diskImagesValidator.diskImagesNotLocked()) && validate(diskImagesValidator.diskImagesNotIllegal()) && validate(sdValidator.allDomainsExistAndActive()))) { return false; } } if (!validateSpaceRequirements(sdValidator, disksList)) { return false; } if (getParameters().isSaveMemory() && Guid.Empty.equals(getStorageDomainIdForVmMemory())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_SUITABLE_DOMAIN_FOUND); } return true; }

Target:
protected boolean canDoAction() { if (getVm() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); return false; } if (!canRunActionOnNonManagedVm()) { return false; } if (!isSpecifiedDisksExist(getParameters().getDisks())) { return false; } VmValidator vmValidator = createVmValidator(); SnapshotsValidator snapshotValidator = createSnapshotValidator(); StoragePoolValidator spValidator = createStoragePoolValidator(); if (!(validateVM(vmValidator) && validate(spValidator.isUp()) && validate(vmValidator.vmNotIlegal()) && validate(vmValidator.vmNotLocked()) && validate(snapshotValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotValidator.vmNotInPreview(getVmId())) && validate(vmValidator.vmNotDuringMigration()) && validate(vmValidator.vmNotRunningStateless()))) { return false; } List<DiskImage> disksList = getDisksListForChecks(); MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator(disksList); if (disksList.size() > 0) { DiskImagesValidator diskImagesValidator = createDiskImageValidator(disksList); if (!(validate(diskImagesValidator.diskImagesNotLocked()) && validate(diskImagesValidator.diskImagesNotIllegal()) && validate(sdValidator.allDomainsExistAndActive()))) { return false; } } List<DiskImage> cloneDisksList = getMemoryImageBuilder().getDisksToBeCreated(); if (!validateSpaceRequirements(sdValidator, disksList, cloneDisksList)) { return false; } if (getParameters().isSaveMemory() && Guid.Empty.equals(getStorageDomainIdForVmMemory())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_SUITABLE_DOMAIN_FOUND); } return true; }
Source:
public void removeTimestampedSnapshots(String storageId, String repositoryId, String artifactPath, int numberToKeep, int keepPeriod) throws IOException { try { DateFormat formatter = new SimpleDateFormat(TIMESTAMP_FORMAT); Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_MONTH, -keepPeriod); Date keepDate = formatter.parse(formatter.format(calendar.getTime())); removeTimestampedSnapshots(storageId, repositoryId, artifactPath, numberToKeep, keepDate); } catch (ParseException e) { logger.error(e.getMessage(), e); } }

Target:
public void removeTimestampedSnapshots(String storageId, String repositoryId, String artifactPath, int numberToKeep, int keepPeriod) throws IOException { try { DateFormat formatter = new SimpleDateFormat(MavenSnapshotManager.TIMESTAMP_FORMAT); Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_MONTH, -keepPeriod); Date keepDate = formatter.parse(formatter.format(calendar.getTime())); removeTimestampedSnapshots(storageId, repositoryId, artifactPath, numberToKeep, keepDate); } catch (ParseException e) { throw new IOException(e); } }
Source:
private static ConjureLockRequest clampLockRequestToDeadline(ConjureLockRequest request, Duration remainingTime) { return ConjureLockRequest.builder() .from(request) .acquireTimeoutMs(Ints.saturatedCast(remainingTime.toMillis())) .build(); }

Target:
private static ConjureLockRequest clampLockRequestToDeadline(ConjureLockRequest request, Duration remainingTime) { return ConjureLockRequest.builder() .from(request) .acquireTimeoutMs(Ints.checkedCast(remainingTime.toMillis())) .build(); }
Source:
public void testCreateListenerWithLocationIllegalStateException() throws Exception { final Method method = Main.class.getDeclaredMethod("createListener", String.class, String.class); method.setAccessible(true); final String outDir = "myfolder123"; final LocalizedMessage createListenerMessage = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, "Main.createListener", new String[] {"myformat", "plain", "xml"}, null, getClass(), null); try { method.invoke(null, "myformat", outDir); fail("InvocationTargetException is expected"); } catch (InvocationTargetException ex) { assertEquals(createListenerMessage.getMessage(), ex.getCause().getLocalizedMessage()); assertTrue(ex.getCause() instanceof IllegalStateException); } finally { FileUtils.deleteQuietly(new File(outDir)); } }

Target:
public void testCreateListenerWithLocationIllegalStateException() throws Exception { final Method method = Main.class.getDeclaredMethod("createListener", String.class, String.class); method.setAccessible(true); final String outDir = "myfolder123"; try { method.invoke(null, "myformat", outDir); fail("InvocationTargetException is expected"); } catch (InvocationTargetException ex) { final LocalizedMessage createListenerMessage = new LocalizedMessage(0, Definitions.CHECKSTYLE_BUNDLE, "Main.createListener", new String[] {"myformat", "plain", "xml"}, null, getClass(), null); assertEquals(createListenerMessage.getMessage(), ex.getCause().getLocalizedMessage()); assertTrue(ex.getCause() instanceof IllegalStateException); } finally { FileUtils.deleteQuietly(new File(outDir)); } }
Source:
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { StringBuilder response = new StringBuilder(); String requestedInfo = req.getParameter(PARAM); if (requestedInfo.equals(PARAM_STARTED)) { getStartedInfo(response); } else if (requestedInfo.equals(PARAM_SUMMARY)) { String givenKey = req.getParameter(PARAM_SUMMARY_KEY); if (getRuntimeService().getProperty(Environment.SERVER_STATUS_KEY).equals(givenKey)) { getSummaryInfo(response); } else { resp.setStatus(HttpServletResponse.SC_FORBIDDEN); } } else if (requestedInfo.equals(PARAM_RELOAD)) { if (isStarted()) { response.append("reload();"); } else { resp.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } } else if (requestedInfo.equals(PROBE_PARAM)) { String probetoEval = req.getParameter(PARAM_SUMMARY_KEY); HealthCheckResult result = getOrRunHealthCheck(probetoEval); if (result.toJson().isEmpty()) { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); } else { sendHealthCheckResponse(resp, result); } } sendResponse(resp, response.toString()); }

Target:
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { StringBuilder response = new StringBuilder(); String requestedInfo = req.getParameter(PARAM); if (requestedInfo.equals(PARAM_STARTED)) { getStartedInfo(response); } else if (requestedInfo.equals(PARAM_SUMMARY)) { String givenKey = req.getParameter(PARAM_SUMMARY_KEY); if (getRuntimeService().getProperty(Environment.SERVER_STATUS_KEY).equals(givenKey)) { getSummaryInfo(response); } else { resp.setStatus(HttpServletResponse.SC_FORBIDDEN); } } else if (requestedInfo.equals(PARAM_RELOAD)) { if (isStarted()) { response.append("reload();"); } else { resp.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } } else if (requestedInfo.equals(PROBE_PARAM)) { String probetoEval = req.getParameter(PARAM_SUMMARY_KEY); try { HealthCheckResult result = getOrRunHealthCheck(probetoEval); sendHealthCheckResponse(resp, result); } catch (IllegalArgumentException e) { resp.setStatus(HttpServletResponse.SC_NOT_FOUND); } } sendResponse(resp, response.toString()); }
Source:
private void waitForMockServer() throws Exception { RetryPolicy retryPolicy = new RetryPolicy() .withMaxDuration(2, TimeUnit.MINUTES) .withDelay(SLEEP_TIME, TimeUnit.MILLISECONDS); Failsafe.with(retryPolicy) .run( () -> given() .auth() .preemptive() .basic(ADMIN, ADMIN) .body( "<csw:GetCapabilities service=\"CSW\" xmlns:csw=\"<LINK_1>\" xmlns:ows=\"<LINK_0>\"/>") .header("Content-Type", "text/xml") .expect() .log() .ifValidationFails() .statusCode(200) .when() .post(CSW_PATH.getUrl())); }

Target:
private void waitForMockServer() throws Exception { RetryPolicy retryPolicy = new RetryPolicy() .withMaxDuration(2, TimeUnit.MINUTES) .withDelay(SLEEP_TIME, TimeUnit.MILLISECONDS); Failsafe.with(retryPolicy).run(this::mockServerIsReady); }
Source:
public void testBulkApiWithPkChunking() throws Throwable { TSalesforceInputProperties properties = createTSalesforceInputProperties(false, true); properties.manualQuery.setValue(false); List<IndexedRecord> readRows = readRows(properties); int defaultRecordsInSalesforce = readRows.size(); properties.pkChunking.setValue(true); properties.chunkSize.setValue(TSalesforceInputProperties.DEFAULT_CHUNK_SIZE); int count = 1500; String random = createNewRandom(); List<IndexedRecord> outputRows = makeRows(random, count, true); outputRows = writeRows(random, properties, outputRows); try { readRows = readRows(properties); LOGGER.info("Read rows count - {}", readRows.size()); Assert.assertTrue((readRows.size() - defaultRecordsInSalesforce) == outputRows.size()); } finally { deleteRows(outputRows, properties); } }

Target:
public void testBulkApiWithPkChunking() throws Throwable { TSalesforceInputProperties properties = createTSalesforceInputProperties(false, true); properties.manualQuery.setValue(false); List<IndexedRecord> readRows = readRows(properties); int defaultRecordsInSalesforce = readRows.size(); properties.pkChunking.setValue(true); properties.chunkSize.setValue(TSalesforceInputProperties.DEFAULT_CHUNK_SIZE); int count = 1500; String random = createNewRandom(); List<IndexedRecord> outputRows = makeRows(random, count, true); outputRows = writeRows(random, properties, outputRows); try { readRows = readRows(properties); LOGGER.info("Read rows count - {}", readRows.size()); Assert.assertEquals((readRows.size() - defaultRecordsInSalesforce), outputRows.size()); } finally { deleteRows(outputRows, properties); } }
Source:
public void tileEntity(AttachCapabilitiesEvent<TileEntity> event) { final TileEntity entity = event.getObject(); for (final Class<? extends TileEntity> c: kitchenItemProviderEntities) { if (! c.isInstance(entity)) continue; event.addCapability(capabilityKitchenItemProvider, crateItemCapabilityProvider(entity, false)); return; } for (final Class<? extends TileEntity> c: dynKitchenItemProviderEntities) { if (! c.isInstance(entity)) continue; event.addCapability(capabilityKitchenItemProvider, crateItemCapabilityProvider(entity, true)); return; } for (final Class<? extends TileEntity> c: kitchenConnectorEntities) { if (! c.isInstance(entity)) continue; event.addCapability(capabilityKitchenConnector, new ICapabilityProvider() { @Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { return CapabilityKitchenConnector.CAPABILITY == capability; } @Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { return null; } }); return; } }

Target:
public void tileEntity(AttachCapabilitiesEvent<TileEntity> event) { final TileEntity entity = event.getObject(); final Class<? extends TileEntity> entityClass = entity.getClass(); final CapabilityType type = tilesClasses.get(entityClass); if (type == null) { return; } switch (type) { case CONNECTOR: event.addCapability(connectorResourceKey, connectorCapabilityProvider); break; case ITEM_PROVIDER: event.addCapability(itemProviderResourceKey, new KitchenItemCapabilityProvider(entity)); break; } }
Source:
private void checkLastScalingActivity(AmazonAutoScalingClient asClient, AmazonAutoScalingRetryClient asRetryClient, String autoScalingGroupName, Date timeBeforeASUpdate) throws AmazonAutoscalingFailed { try { Waiter<DescribeScalingActivitiesRequest> autoscalingActivitesWaiter = customAmazonWaiterProvider .getAutoscalingActivitesWaiter(asClient, timeBeforeASUpdate); autoscalingActivitesWaiter.run(new WaiterParameters<>(new DescribeScalingActivitiesRequest().withAutoScalingGroupName(autoScalingGroupName))); } catch (Exception e) { LOGGER.error("Failed to list activities: {}", e.getMessage(), e); throw new AmazonAutoscalingFailed(e.getMessage(), e); } DescribeScalingActivitiesResult describeScalingActivitiesResult = asRetryClient .describeScalingActivities(new DescribeScalingActivitiesRequest().withAutoScalingGroupName(autoScalingGroupName)); Optional<Activity> firstActivity = describeScalingActivitiesResult.getActivities().stream().findFirst() .filter(activity -> "failed".equals(activity.getStatusCode().toLowerCase())); if (firstActivity.isPresent()) { Activity activity = firstActivity.get(); LOGGER.error("Cannot execute autoscale, because last activity is failed: {}", activity); throw new AmazonAutoscalingFailed(activity.getDescription() + " " + activity.getCause()); } }

Target:
void checkLastScalingActivity(AmazonAutoScalingClient asClient, AmazonAutoScalingRetryClient asRetryClient, String autoScalingGroupName, Date timeBeforeASUpdate) throws AmazonAutoscalingFailed { Optional<Activity> firstActivity; try { Waiter<DescribeScalingActivitiesRequest> autoscalingActivitiesWaiter = customAmazonWaiterProvider .getAutoscalingActivitesWaiter(asClient, timeBeforeASUpdate); autoscalingActivitiesWaiter.run(new WaiterParameters<>(new DescribeScalingActivitiesRequest().withAutoScalingGroupName(autoScalingGroupName))); DescribeScalingActivitiesResult describeScalingActivitiesResult = asRetryClient .describeScalingActivities(new DescribeScalingActivitiesRequest().withAutoScalingGroupName(autoScalingGroupName)); firstActivity = describeScalingActivitiesResult.getActivities().stream().findFirst() .filter(activity -> "failed".equals(activity.getStatusCode().toLowerCase())); } catch (Exception e) { LOGGER.error("Failed to list activities: {}", e.getMessage(), e); throw new AmazonAutoscalingFailed(e.getMessage(), e); } if (firstActivity.isPresent()) { Activity activity = firstActivity.get(); LOGGER.error("Cannot execute autoscale, because last activity is failed: {}", activity); throw new AmazonAutoscalingFailed(activity.getDescription() + " " + activity.getCause()); } }
Source:
public boolean isSealed() { return false; }

Target:
public boolean isSealed() { return partitionId.getPartitionState().equals(PartitionState.READ_ONLY); }
Source:
public void SetVmUnknown(VM vm) { RemoveAsyncRunningVm(vm.getId()); InternalSetVmStatus(vm, VMStatus.Unknown, vm.getStatusUpdatedTime()); AuditLogableBase logable = new AuditLogableBase(); logable.setVmId(vm.getId()); auditLogDirector.log(logable, AuditLogType.VM_SET_TO_UNKNOWN_STATUS); storeVm(vm); }

Target:
public void SetVmUnknown(VM vm) { RemoveAsyncRunningVm(vm.getId()); InternalSetVmStatus(vm, VMStatus.Unknown); AuditLogableBase logable = new AuditLogableBase(); logable.setVmId(vm.getId()); auditLogDirector.log(logable, AuditLogType.VM_SET_TO_UNKNOWN_STATUS); storeVm(vm); }
Source:
private void processInput() { if(getThreadCount() == 1 && getCallContexts().size() == 1) processInput(getCallContext()); else if(getThreadCount() == 1 && getCallContexts().size()>1) { while(!getCallContexts().isEmpty()) { CallContext callContext = getCallContexts().poll(); if(callContext != null) processInput(callContext); } } else { try { for (int i = 0; i < getThreadCount(); i++) { BulkCallableImpl bulkCallableImpl = new BulkCallableImpl(this); submitTask(bulkCallableImpl); } getCallerThreadPoolExecutor().awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); } catch(Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination "+throwable.getMessage()); } } }

Target:
private void processInput() { InputStream[] inputBatch = getInputBatch(getQueue(), getBatchSize()); if(getCallContext()!=null) processInput(getCallContext(), inputBatch); else if(getCallContextQueue() != null && !getCallContextQueue().isEmpty()){ BulkCallableImpl bulkCallableImpl = new BulkCallableImpl(this, inputBatch); submitTask(bulkCallableImpl); } else { throw new IllegalArgumentException("Cannot process input without Callcontext."); } }
Source:
void addDoneListenerToFormatJob() { formatJob.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { if (!event.getResult().isOK()) return; final StyledText text = getTextWidget(); if (text == null || text.isDisposed()) return; final FormatJob job = (FormatJob) event.getJob(); text.getDisplay().asyncExec(new Runnable() { public void run() { if (text.isDisposed()) return; setDocument(new Document(job.getFormatResult() .getCommitInfo())); List<StyleRange> styleRangeList = new ArrayList<StyleRange>(); for (StyleRange styleRange : job.getFormatResult() .getStyleRange()) styleRangeList.add(styleRange); StyleRange[] hyperlinkDetectorStyleRanges = getHyperlinkDetectorStyleRanges(); for (StyleRange styleRange : hyperlinkDetectorStyleRanges) styleRangeList.add(styleRange); styleRanges = new StyleRange[styleRangeList .size()]; styleRangeList.toArray(styleRanges); Arrays.sort(styleRanges, new Comparator<StyleRange>() { public int compare(StyleRange o1, StyleRange o2) { if (o2.start > o1.start) return -1; if (o1.start > o2.start) return 1; return 0; } }); text.setStyleRanges(new StyleRange[0]); for (StyleRange sr : styleRanges) { text.setStyleRange(sr); } } }); } }); }

Target:
void addDoneListenerToFormatJob() { formatJob.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { if (!event.getResult().isOK()) return; final StyledText text = getTextWidget(); if (text == null || text.isDisposed()) return; final FormatJob job = (FormatJob) event.getJob(); text.getDisplay().asyncExec(new Runnable() { public void run() { if (text.isDisposed()) return; setDocument(new Document(job.getFormatResult() .getCommitInfo())); List<StyleRange> styleRangeList = new ArrayList<StyleRange>(); for (StyleRange styleRange : job.getFormatResult() .getStyleRange()) styleRangeList.add(styleRange); StyleRange[] hyperlinkDetectorStyleRanges = UIUtils .getHyperlinkDetectorStyleRanges( CommitMessageViewer.this, fHyperlinkDetectors); for (StyleRange styleRange : hyperlinkDetectorStyleRanges) styleRangeList.add(styleRange); styleRanges = new StyleRange[styleRangeList .size()]; styleRangeList.toArray(styleRanges); Arrays.sort(styleRanges, new Comparator<StyleRange>() { public int compare(StyleRange o1, StyleRange o2) { if (o2.start > o1.start) return -1; if (o1.start > o2.start) return 1; return 0; } }); text.setStyleRanges(new StyleRange[0]); for (StyleRange sr : styleRanges) text.setStyleRange(sr); } }); } }); }
Source:
public String isCan_delete() { return can_delete; }

Target:
public boolean isCan_delete() { return can_delete; }
Source:
public static WebArchive createDeployment() { return ShrinkWrap.create(WebArchive.class, "ContextTrackerRegistryTest.war") .addClass(TrackerCountReportingRouteBuilder.class) .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); }

Target:
public static WebArchive createDeployment() { return ShrinkWrap.create(WebArchive.class, "ContextTrackerRegistryTest.war") .addClass(TrackerCountReportingRouteBuilder.class) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); }
Source:
private void executeOpenCommandWithConfirmation(String refName) { if (!BranchOperationUI.checkoutWillShowQuestionDialog(refName)) { String shortName = Repository.shortenRefName(refName); IPreferenceStore store = Activator.getDefault() .getPreferenceStore(); if (store.getBoolean(UIPreferences.SHOW_CHECKOUT_CONFIRMATION)) { String toggleMessage = UIText.RepositoriesView_CheckoutConfirmationToggleMessage; MessageDialogWithToggle dlg = null; boolean canUseNewApi = Platform.getBundle("org.eclipse.jface") .getVersion() .compareTo(Version.valueOf("3.13.0.qualifier")) >= 0; if(canUseNewApi) { LinkedHashMap<String, Integer> buttonLabelToIdMap = new LinkedHashMap<>(); buttonLabelToIdMap.put( UIText.RepositoriesView_CheckoutConfirmationOkButtonLabel, IDialogConstants.OK_ID); buttonLabelToIdMap.put(IDialogConstants.CANCEL_LABEL, IDialogConstants.CANCEL_ID); dlg = MessageDialogWithToggle.open(MessageDialog.CONFIRM, getViewSite().getShell(), UIText.RepositoriesView_CheckoutConfirmationTitle, MessageFormat.format( UIText.RepositoriesView_CheckoutConfirmationMessage, shortName), toggleMessage, false, store, UIPreferences.SHOW_CHECKOUT_CONFIRMATION, SWT.NONE, buttonLabelToIdMap); } else { dlg = MessageDialogWithToggle.openOkCancelConfirm( getViewSite().getShell(), UIText.RepositoriesView_CheckoutConfirmationTitle, MessageFormat.format( UIText.RepositoriesView_CheckoutConfirmationMessage, shortName), toggleMessage, false, store, UIPreferences.SHOW_CHECKOUT_CONFIRMATION); } if (dlg.getReturnCode() != Window.OK) return; } } executeOpenCommand(); }

Target:
private void executeOpenCommandWithConfirmation(String refName) { if (!BranchOperationUI.checkoutWillShowQuestionDialog(refName)) { String shortName = Repository.shortenRefName(refName); IPreferenceStore store = Activator.getDefault() .getPreferenceStore(); if (store.getBoolean(UIPreferences.SHOW_CHECKOUT_CONFIRMATION)) { MessageDialogWithToggle dlg = showCheckoutConfirmationDialog( shortName, store); if (dlg.getReturnCode() != Window.OK) return; } } executeOpenCommand(); }
Source:
private String getNextUidNumber(LdapServer ldapServer) { Hashtable<String, String> ldapEnvironment = initializeWithLdapConnectionSettings(ldapServer); DirContext ctx; String rueckgabe = ""; try { ctx = new InitialDirContext(ldapEnvironment); Attributes attrs = ctx.getAttributes(ldapServer.getNextFreeUnixIdPattern()); Attribute la = attrs.get("uidNumber"); rueckgabe = (String) la.get(0); ctx.close(); } catch (NamingException e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(e.getMessage()); } return rueckgabe; }

Target:
private String getNextUidNumber(LdapServer ldapServer) { Hashtable<String, String> ldapEnvironment = initializeWithLdapConnectionSettings(ldapServer); DirContext ctx; String rueckgabe = ""; try { ctx = new InitialDirContext(ldapEnvironment); Attributes attrs = ctx.getAttributes(ldapServer.getNextFreeUnixIdPattern()); Attribute la = attrs.get("uidNumber"); rueckgabe = (String) la.get(0); ctx.close(); } catch (NamingException e) { Helper.setErrorMessage(e.getMessage(), logger, e); } return rueckgabe; }
Source:
protected InputStream getImageInput(String ref) throws IOException { File f = new File(imageTargetFolder + ref); if (!f.exists()) { FileOutputStream fos = new FileOutputStream(f); String url = wikiFileDownloadBaseUrl + documentName + "/" + ref; System.out.println("Downloading image " + url + " to " + f.getAbsolutePath() + "..."); try { WGet wget = new WGet(); wget.fetchURL(url, fos); } catch (Exception e) { LOGGER.error("Error while getting image input",e);; } fos.flush(); fos.close(); } FileInputStream fis = new FileInputStream(f); return fis; }

Target:
protected InputStream getImageInput(String ref) throws IOException { File f = new File(imageTargetFolder + ref); if (!f.exists()) { FileOutputStream fos = new FileOutputStream(f); String url = wikiFileDownloadBaseUrl + documentName + "/" + ref; System.out.println("Downloading image " + url + " to " + f.getAbsolutePath() + "..."); try { WGet wget = new WGet(); wget.fetchURL(url, fos); } catch (Exception e) { LOGGER.error("Error while getting image input with ref [{}], and url [{}]", ref, url, e); } fos.flush(); fos.close(); } FileInputStream fis = new FileInputStream(f); return fis; }
Source:
private void contextMenuActionDelete(String tagName) { openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext()); onView(withText(R.string.delete)) .perform(click()); onView(withText(tagName)) .perform(click()); onView(withContentDescription(R.string.done)).perform(click()); onView(allOf(withId(android.R.id.button1), withText(R.string.yes))) .check(matches(isDisplayed())); onView(allOf(withId(android.R.id.button2), withText(R.string.no))) .check(matches(isDisplayed())); onView(allOf(withId(android.R.id.button1), withText(R.string.yes))) .perform(click()); onView(withText(tagName)) .check(doesNotExist()); }

Target:
private void contextMenuActionDelete(String tagName) { openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext()); onView(withText(R.string.delete)) .perform(click()); onData(allOf(instanceOf(NfcTagData.class), NFCTagDataNameMatchers.isNFCTagDataName(tagName))) .inAdapterView(NFCTagListMatchers.isNFCTagListView()) .onChildView(withText(tagName)) .perform(click()); onView(withContentDescription(R.string.done)) .perform(click()); onView(allOf(withId(android.R.id.button1), withText(R.string.yes))) .perform(click()); onView(withText(tagName)) .check(doesNotExist()); }
Source:
private boolean checkCertificate(X509Certificate cert, AuditLogType alertExpirationEventType, AuditLogType alertAboutToExpireEventType, AuditLogType warnAboutToExpireEventType, VDS host) { Date expirationDate = cert.getNotAfter(); Date certWarnTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationWarnPeriodInDays); Date certAlertTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationAlertPeriodInDays); Date now = new Date(); AuditLogType eventType = null; if (now.compareTo(expirationDate) > 0) { eventType = alertExpirationEventType; } else if (now.compareTo(certAlertTime) > 0) { eventType = alertAboutToExpireEventType; } else if (now.compareTo(certWarnTime) > 0) { eventType = warnAboutToExpireEventType; } if (eventType != null) { AuditLogableBase event = new AuditLogableBase(); event.addCustomValue("ExpirationDate", new SimpleDateFormat("yyyy-MM-dd").format(expirationDate)); if (host != null) { event.setVds(host); } auditLogDirector.log(event, eventType); return false; } return true; }

Target:
private boolean checkCertificate(X509Certificate cert, AuditLogType alertExpirationEventType, AuditLogType alertAboutToExpireEventType, AuditLogType warnAboutToExpireEventType, VDS host) { Date expirationDate = cert.getNotAfter(); Date certWarnTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationWarnPeriodInDays); Date certAlertTime = getExpirationDate(expirationDate, ConfigValues.CertExpirationAlertPeriodInDays); Date now = new Date(); AuditLogType eventType = null; if (now.compareTo(expirationDate) > 0) { eventType = alertExpirationEventType; } else if (now.compareTo(certAlertTime) > 0) { eventType = alertAboutToExpireEventType; } else if (now.compareTo(certWarnTime) > 0) { eventType = warnAboutToExpireEventType; } if (eventType != null) { AuditLogableBase event = new AuditLogableBase(); event.addCustomValue("ExpirationDate", new SimpleDateFormat("yyyy-MM-dd").format(expirationDate)); if (host != null) { event.setVdsName(host.getName()); } auditLogDirector.log(event, eventType); return false; } return true; }
Source:
public void enQueue(Mail mail, long delay, TimeUnit unit) throws MailQueueException { final String key = mail.getName() + "-" + COUNTER.incrementAndGet(); try { int i = RANDOM.nextInt(SPLITCOUNT) + 1; String name = queueDirName + "/" + i + "/" + key; final FileItem item = FileItem.of(name + OBJECT_EXTENSION, name + MSG_EXTENSION); if (delay > 0) { mail.setAttribute(NEXT_DELIVERY, System.currentTimeMillis() + unit.toMillis(delay)); } try (FileOutputStream foout = new FileOutputStream(item.getObjectFile()); ObjectOutputStream oout = new ObjectOutputStream(foout)) { oout.writeObject(mail); oout.flush(); if (sync) { foout.getFD().sync(); } } try (FileOutputStream out = new FileOutputStream(item.getMessageFile())) { mail.getMessage().writeTo(out); out.flush(); if (sync) { out.getFD().sync(); } } indexWriter.addDocument(toIndexDocument(mail, key)); indexWriter.commit(); keyMappings.put(key, item); if (delay > 0) { scheduler.schedule(() -> enqueueInMemory(key), delay, unit); } else { inmemoryQueue.put(key); } } catch (IOException | MessagingException | InterruptedException e) { throw new MailQueueException("Unable to enqueue mail", e); } }

Target:
public void enQueue(Mail mail, long delay, TimeUnit unit) throws MailQueueException { final String key = mail.getName() + "-" + COUNTER.incrementAndGet(); try { int i = RANDOM.nextInt(SPLITCOUNT) + 1; String name = queueDirName + "/" + i + "/" + key; final FileItem item = FileItem.of(name + OBJECT_EXTENSION, name + MSG_EXTENSION); if (delay > 0) { mail.setAttribute(NEXT_DELIVERY, System.currentTimeMillis() + unit.toMillis(delay)); } try (FileOutputStream foout = new FileOutputStream(item.getObjectFile()); ObjectOutputStream oout = new ObjectOutputStream(foout)) { oout.writeObject(mail); oout.flush(); if (sync) { foout.getFD().sync(); } } try (FileOutputStream out = new FileOutputStream(item.getMessageFile())) { mail.getMessage().writeTo(out); out.flush(); if (sync) { out.getFD().sync(); } } mailQueueIndex.index(mail, key); keyMappings.put(key, item); if (delay > 0) { scheduler.schedule(() -> enqueueInMemory(key), delay, unit); } else { inmemoryQueue.put(key); } } catch (IOException | MessagingException | InterruptedException e) { throw new MailQueueException("Unable to enqueue mail", e); } }
Source:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin, ":"); String exchangeType = st.nextToken(); if ("lskFix".equalsIgnoreCase(exchangeType)) { String preferedFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new BinanceRateSource(preferedFiatCurrency); } } return null; }

Target:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin, ":"); String exchangeType = st.nextToken(); if ("lskFix".equalsIgnoreCase(exchangeType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); } catch (Throwable e) { } } String preferedFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate, preferedFiatCurrency); } else if ("binanceRateSource".equalsIgnoreCase(exchangeType)) { String preferedFiatCurrency = Currencies.USD; if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new BinanceRateSource(preferedFiatCurrency); } } return null; }
Source:
public void checkOpenFileFeatureTest() throws Exception { createProject(PROJECT_NAME); projectExplorer.waitItem(PROJECT_NAME); dashboard.open(); dashboard.selectFactoriesOnDashbord(); dashboardFactories.clickOnAddFactoryBtn(); dashboardFactories.selectWorkspaceForCreation(testWorkspace.getName()); dashboardFactories.setFactoryName(FACTORY_NAME); dashboardFactories.clickOnCreateFactoryBtn(); dashboardFactories.selectAction(OPEN_FILE); dashboardFactories.enterParamValue(OPEN_FILE_URL); dashboardFactories.clickAddOnAddAction(); dashboardFactories.clickOnOpenFactory(); String currentWin = seleniumWebDriver.getWindowHandle(); seleniumWebDriverHelper.switchToNextWindow(currentWin); loadingBehaviorPage.waitWhileLoadPageIsClosed(); seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); projectExplorer.waitItem(PROJECT_NAME); try { editor.waitTabIsPresent("web-java-spring", WIDGET_TIMEOUT_SEC); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } }

Target:
public void checkOpenFileFeatureTest() throws Exception { createProject(PROJECT_NAME); projectExplorer.waitItem(PROJECT_NAME); dashboard.open(); dashboard.selectFactoriesOnDashbord(); dashboardFactories.clickOnAddFactoryBtn(); dashboardFactories.selectWorkspaceForCreation(testWorkspace.getName()); dashboardFactories.setFactoryName(FACTORY_NAME); dashboardFactories.clickOnCreateFactoryBtn(); dashboardFactories.selectAction(OPEN_FILE); dashboardFactories.enterParamValue(OPEN_FILE_URL); dashboardFactories.clickAddOnAddAction(); dashboardFactories.clickOnOpenFactory(); String currentWin = seleniumWebDriver.getWindowHandle(); seleniumWebDriverHelper.switchToNextWindow(currentWin); loadingBehaviorPage.waitWhileLoadPageIsClosed(); seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); projectExplorer.waitItem(PROJECT_NAME); try { editor.waitTabIsPresent("web-java-spring", WIDGET_TIMEOUT_SEC); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>"); } }
Source:
public boolean isQuestionSkipped(String[] answer) { boolean allAnswersEmpty = true; if(answer!=null){ for(int i=0 ; i<answer.length ; i++){ if(answer[i]!=null && !answer[i].trim().isEmpty()){ allAnswersEmpty = false; } } } return answer == null || allAnswersEmpty; }

Target:
public boolean isQuestionSkipped(String[] answer) { if (answer == null) { return true; } boolean allAnswersEmpty = true; for(int i=0 ; i<answer.length ; i++) { if (answer[i] != null && !answer[i].trim().isEmpty()) { allAnswersEmpty = false; break; } } return allAnswersEmpty; }
Source:
protected List<String> getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) { if (args.length == 1) { return new ArrayList<>(ess.getWarps().getList()); } else { return Collections.emptyList(); } }

Target:
protected List<String> getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) { if (args.length == 1) { if (ess.getSettings().getPerWarpPermission() && sender.isPlayer()) { final List<String> list = new ArrayList<>(); for (String curWarp : ess.getWarps().getList()) { if (sender.isAuthorized("essentials.warps." + curWarp, ess)) { list.add(curWarp); } } return list; } return new ArrayList<>(ess.getWarps().getList()); } else { return Collections.emptyList(); } }
Source:
public CompletionStage<TimeSeriesResult> executeQuery(final String query) throws ExecutionException { throw new ExecutionException(Collections.singletonList("Queries are not enabled")); }

Target:
public CompletionStage<TimeSeriesResult> executeQuery(final String query) throws QueryExecutionException { final QueryProblem notEnabledProblem = new QueryProblem.Builder().setProblemCode("NOT_ENABLED").build(); throw new QueryExecutionException("Queries are not enabled", ImmutableList.of(notEnabledProblem)); }
Source:
public void validate(String type, GenericProperties<?> genericProperties, Settings settings) { TypeSettings typeSettings = settingsForType(type); Map<String, Setting<?>> allSettings = typeSettings.all(); GenericProperties<?> dynamicProperties = typeSettings.dynamicProperties(genericProperties); if (!dynamicProperties.isEmpty()) { allSettings = Maps.newHashMap(allSettings); for (String key : dynamicProperties.properties().keySet()) { allSettings.put(key, Setting.simpleString(key)); } } Set<String> names = settings.keySet(); Sets.SetView<String> missingRequiredSettings = Sets.difference(typeSettings.required().keySet(), names); if (!missingRequiredSettings.isEmpty()) { throw new IllegalArgumentException( String.format( Locale.ENGLISH, "The following required parameters are missing to create a repository of type \"%s\": [%s]", type, Joiner.on(", ").join(missingRequiredSettings))); } }

Target:
public void validate(String type, GenericProperties<?> genericProperties, Settings settings) { TypeSettings typeSettings = settingsForType(type); Map<String, Setting<?>> allSettings = typeSettings.all(); GenericProperties<?> dynamicProperties = typeSettings.dynamicProperties(genericProperties); if (!dynamicProperties.isEmpty()) { allSettings = Maps.newHashMap(allSettings); for (String key : dynamicProperties.properties().keySet()) { allSettings.put(key, Setting.simpleString(key)); } } Set<String> names = settings.keySet(); Sets.SetView<String> missingRequiredSettings = Sets.difference(typeSettings.required().keySet(), names); if (!missingRequiredSettings.isEmpty()) { throw new IllegalArgumentException( String.format( Locale.ENGLISH, "The following required parameters are missing to create a repository of type \"%s\": [%s]", type, String.join(", ", missingRequiredSettings)) ); } }
Source:
private void validateFilter() { String filter = getProperty(NotificationProperties.FILTER); if (!StringUtils.isEmpty(filter)) { String[] filterElements = filter.split("\\s+"); for (String filterElement : filterElements) { if (!StringUtils.isEmpty(filterElement)) { if (!FILTER_ELEMENT_PATTERN.matcher(filterElement).matches()) { throw new IllegalArgumentException( String.format("%s Illegal value for %s , (%s)", GENERIC_MESSAGE, FILTER, filterElement)); } } } } }

Target:
private void validateFilter() { String filter = getProperty(NotificationProperties.FILTER); if (!StringUtils.isEmpty(filter)) { String[] filterElements = filter.split("\\s+"); for (String filterElement : filterElements) { if (!StringUtils.isEmpty(filterElement)) { if (!FirstMatchSimpleFilter.PARSE_PATTERN.matcher(filterElement).matches()) { throw new IllegalArgumentException( String.format("%s Illegal value for %s , (%s)", GENERIC_MESSAGE, FILTER, filterElement)); } } } } }
Source:
private void initNetworkProvidersList() { startProgress(); getNetworkProviders().setItems(new ArrayList()); AsyncDataProvider.getInstance().getAllProvidersByType(new AsyncQuery<>(result -> { stopProgress(); List<Provider<OpenstackNetworkProviderProperties>> providers = (List) result; providers.add(0, null); getNetworkProviders().setItems(providers); getNetworkProviders().setSelectedItem(null); }), ProviderType.OPENSTACK_NETWORK, ProviderType.EXTERNAL_NETWORK); }

Target:
private void initNetworkProvidersList() { startProgress(); AsyncDataProvider.getInstance().getAllProvidersByType(new AsyncQuery<>(result -> { stopProgress(); List<Provider<OpenstackNetworkProviderProperties>> providers = (List) result; providers.add(0, null); getNetworkProviders().setItems(providers); getNetworkProviders().setSelectedItem(null); }), ProviderType.OPENSTACK_NETWORK, ProviderType.EXTERNAL_NETWORK); }
Source:
public VariantWithSamplesAndAnnotation(IVariant variant, List<String> sampleNames) { super(variant.getChromosome(), variant.getStart(), variant.getEnd(), variant.getReference(), variant.getAlternate()); this.sourceEntries = new HashMap<>(); for (IVariantSourceEntry entry : variant.getSourceEntries()) { VariantSourceEntryWithSampleNames entrySN = new VariantSourceEntryWithSampleNames(entry, sampleNames); this.sourceEntries.put(getSourceEntryIndex(entrySN), entrySN); } }

Target:
public VariantWithSamplesAndAnnotation(IVariant variant, List<String> sampleNames) { super(variant.getChromosome(), variant.getStart(), variant.getEnd(), variant.getReference(), variant.getAlternate()); this.sourceEntries = new HashMap<>(); for (IVariantSourceEntry entry : variant.getSourceEntries()) { VariantSourceEntryWithSampleNames entryWithSampleNames = new VariantSourceEntryWithSampleNames(entry, sampleNames); this.sourceEntries.put(getSourceEntryIndex(entryWithSampleNames), entryWithSampleNames); } }
Source:
public static void main(String[] args) throws Exception { log.info("Starting Application... [params=" + args[0] + "]"); String[] params = args[0].split(","); Class<?> clazz = Class.forName(params[0]); IgniteAwareApplication app = (IgniteAwareApplication)clazz.getConstructor().newInstance(); ObjectMapper mapper = new ObjectMapper(); ObjectReader reader = mapper.readerFor(Map.class); JsonNode jsonNode = params.length > 2 ? reader.readTree(new String(Base64.getDecoder().decode(params[2]), UTF_8)) : mapper.createObjectNode(); ((ObjectNode)jsonNode).put("cfgPath", params[1]); app.start(jsonNode); }

Target:
public static void main(String[] args) throws Exception { log.info("Starting Application... [params=" + args[0] + "]"); String[] params = args[0].split(","); Class<?> clazz = Class.forName(params[0]); IgniteAwareApplication app = (IgniteAwareApplication)clazz.getConstructor().newInstance(); ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = params.length > 2 ? mapper.readTree(Base64.getDecoder().decode(params[2])) : mapper.createObjectNode(); ((ObjectNode)jsonNode).put("cfgPath", params[1]); app.start(jsonNode); }
Source:
private int getNextSeparatorAt(String fullId, int start) { String propertyId = fullId.substring(start); int nextObjectSeparator = propertyId.indexOf(OBJECT_SEPARATOR); nextObjectSeparator = nextObjectSeparator >= 0 ? nextObjectSeparator : fullId.length() - start; int nextMapSeparator = propertyId.indexOf(MAP_SEPARATOR[0]); nextMapSeparator = nextMapSeparator >= 0 ? nextMapSeparator : fullId .length() - start; int nextListSeparator = propertyId.indexOf(LIST_SEPARATOR[0]); nextListSeparator = nextListSeparator >= 0 ? nextListSeparator : fullId .length() - start; return Math.min(nextListSeparator, Math.min(nextMapSeparator, nextObjectSeparator)) + start; }

Target:
private int getNextSeparatorAt(String fullId, int start) { String propertyId = fullId.substring(start); int nextSeparator = fullId.length(); Pattern pattern = Pattern.compile(Pattern.quote(OBJECT_SEPARATOR) + "|" + Pattern.quote(LIST_SEPARATOR[0]) + "|" + Pattern.quote(MAP_SEPARATOR[0])); Matcher matcher = pattern.matcher(propertyId); if (matcher.find()) { nextSeparator = matcher.start() + start; } return nextSeparator; }
Source:
public Supplier<ValueType> getPipelined(final Object key, final Pipeline pipeline) { final String redisKey = generateRedisKey(turnObjectIntoKeyType(key)); final Response<String> valAsString; valAsString = pipeline.get(redisKey); pipeline.expire(redisKey, valueTtl); return new ValueSupplier(valAsString); }

Target:
public Supplier<ValueType> getPipelined(final Object key, final Pipeline pipeline) { final String redisKey = generateRedisKey(turnObjectIntoKeyType(key)); final Response<String> valAsString = pipeline.get(redisKey); pipeline.expire(redisKey, valueTtl); return new ValueSupplier(valAsString); }
Source:
public WatchableInputStream(@Nonnull InputStream delegate) { Objects.requireNonNull(delegate, "null pass passed into a WatchableInputStream"); this.delegate = delegate; this.completionFuture = new Future(); }

Target:
public WatchableInputStream(@Nonnull InputStream delegate) { Objects.requireNonNull(delegate, "null was passed into a WatchableInputStream"); this.delegate = delegate; this.completionFuture = new Future(); }
Source:
private void onChannelFailure(ClientChannelHolder hld, ClientChannel ch) { if (hld != null && ch != null && ch == hld.ch) hld.closeChannel(); rollCurrentChannel(hld); chFailLsnrs.forEach(Runnable::run); }

Target:
private void onChannelFailure(ClientChannelHolder hld, ClientChannel ch) { if (ch != null && ch == hld.ch) hld.closeChannel(); chFailLsnrs.forEach(Runnable::run); rollCurrentChannel(hld); if (scheduledChannelsReinit.get() && !partitionAwarenessEnabled) channelsInit(); }