auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static String getDescriptionForFBFile(IFile fbtFile) { FBType type = null; if (TypeLibraryTags.FB_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getFBTypeFromFile(fbtFile); } else if (TypeLibraryTags.ADAPTER_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getAdapterTypeForFile(fbtFile); } if (null != type) { return type.getName() + ": " + ((null == type.getComment()) ? "" : type.getComment()); } return null; }

Target:
private static String getDescriptionForFBFile(IFile fbtFile) { FBType type = null; if (TypeLibraryTags.FB_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getFBTypeFromFile(fbtFile); } else if (TypeLibraryTags.ADAPTER_TYPE_FILE_ENDING.equalsIgnoreCase(fbtFile.getFileExtension())) { type = getAdapterTypeForFile(fbtFile); } if (null != type) { return generateTypeDescriptionString(type); } return null; }
Source:
public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos) throws IOException { if (closed) { throw new IllegalStateException("The NetworkClient is closed."); } List<ResponseInfo> responseInfoList = new ArrayList<ResponseInfo>(); numPendingConnections.set(pendingRequests.size()); for (RequestInfo requestInfo : requestInfos) { ClientNetworkRequestMetrics clientNetworkRequestMetrics = new ClientNetworkRequestMetrics(networkMetrics.requestQueueTime, networkMetrics.requestSendTime, networkMetrics.requestSendTotalTime, 0); pendingRequests.add(new RequestMetadata(time.milliseconds(), requestInfo, clientNetworkRequestMetrics)); numPendingConnections.set(pendingRequests.size()); } List<NetworkSend> sends = prepareSends(responseInfoList); selector.poll(POLL_TIMEOUT_MS, sends); handleSelectorEvents(responseInfoList); return responseInfoList; }

Target:
public List<ResponseInfo> sendAndPoll(List<RequestInfo> requestInfos) throws IOException { long startTime = time.milliseconds(); try { if (closed) { throw new IllegalStateException("The NetworkClient is closed."); } List<ResponseInfo> responseInfoList = new ArrayList<ResponseInfo>(); for (RequestInfo requestInfo : requestInfos) { ClientNetworkRequestMetrics clientNetworkRequestMetrics = new ClientNetworkRequestMetrics(networkMetrics.requestQueueTime, networkMetrics.requestSendTime, networkMetrics.requestSendTotalTime, 0); pendingRequests.add(new RequestMetadata(time.milliseconds(), requestInfo, clientNetworkRequestMetrics)); } List<NetworkSend> sends = prepareSends(responseInfoList); selector.poll(POLL_TIMEOUT_MS, sends); handleSelectorEvents(responseInfoList); return responseInfoList; } finally { numPendingRequests.set(pendingRequests.size()); networkMetrics.networkClientSendAndPollTime.update(time.milliseconds() - startTime); } }
Source:
public CommandCallback getCallback() { if (getVm().getVmPoolId() != null || getParameters() instanceof CloneVmParameters) { return callbackProvider.get(); } return null; }

Target:
public CommandCallback getCallback() { if (getVm().getVmPoolId() != null) { return callbackProvider.get(); } return getParameters().isUseCinderCommandCallback() ? callbackProvider.get() : null; }
Source:
public boolean acceptMarker(ProblemMarkerInfo markerInfo) { IProject project = markerInfo.file.getProject(); if (project == null) return true; List<ProblemMarkerFilterDesc> enabledFilters = findEnabledFilters(project); for (ProblemMarkerFilterDesc filterDesc: enabledFilters) { if ( ! filterDesc.getFilter().acceptMarker(markerInfo) ) { return false; } } return true; }

Target:
public boolean acceptMarker(ProblemMarkerInfo markerInfo) { IProject project = markerInfo.file.getProject(); if (project == null || !project.isOpen()) return true; List<ProblemMarkerFilterDesc> enabledFilters = findEnabledFilters(project); for (ProblemMarkerFilterDesc filterDesc: enabledFilters) { if ( ! filterDesc.getFilter().acceptMarker(markerInfo) ) { return false; } } return true; }
Source:
public void addFileHandler(String name) { clickButton("Add"); getWindowFragment().getEditor().text("name", name); getWindowFragment().clickButton("Save"); getWindowFragment().getEditor().text("path", "/logs/"); getWindowFragment().getEditor().clickButton("Finish"); }

Target:
public void addFileHandler(String name) { clickButton("Add"); getWindowFragment().getEditor().text("name", name); getWindowFragment().clickButton("Next"); getWindowFragment().getEditor().text("path", "/logs/"); getWindowFragment().getEditor().clickButton("Finish"); }
Source:
private String compressToThumbnail( String base64content, String extension ) { byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(base64content); double scaleFactor = 0.02; String base64thumb = ""; try { BufferedImage before = ImageIO.read( new ByteArrayInputStream( imageBytes ) ); int width = (int) Math.round( before.getWidth() * scaleFactor ); int height = (int) Math.round( before.getHeight() * scaleFactor ); BufferedImage after = new BufferedImage( width, height, BufferedImage.TYPE_INT_ARGB ); AffineTransform at = new AffineTransform( ); at.scale( scaleFactor, scaleFactor ); AffineTransformOp scaleOp = new AffineTransformOp( at, AffineTransformOp.TYPE_BILINEAR ); after = scaleOp.filter( before, after ); base64thumb = bufferedImageToBase64( after, extension ); } catch( IOException e ) { log.error( "Error while decoding the attachment to BufferedImage ", e); } return base64thumb; }

Target:
private byte[] compressToThumbnail( String base64content, String extension ) { byte[] imageBytes = javax.xml.bind.DatatypeConverter.parseBase64Binary( base64content ); double scaleFactor = 0.02; byte[] base64thumb = {}; try { BufferedImage before = ImageIO.read( new ByteArrayInputStream( imageBytes ) ); BufferedImage after = scaleBy( scaleFactor, before ); base64thumb = bufferedImageToBase64( after, extension ); } catch( IOException e ) { log.error( "Error while decoding the attachment to BufferedImage ", e ); } return base64thumb; }
Source:
public Property[] removeRandomPasswords(Property[] properties, boolean withCacheClear) { if (ArrayUtils.isEmpty(properties)) { return new Property[0]; } String uuid = IdentityApplicationManagementUtil.getPropertyValue(properties, IdentityApplicationConstants.UNIQUE_ID_CONSTANT); properties = (Property[]) removeUniqueIdProperty(properties); if (StringUtils.isBlank(uuid)) { if (log.isDebugEnabled()) { log.debug("Cache Key not found for Random Password Container"); } } else { RandomPassword[] randomPasswords = getAndRemoveRandomPasswordContainerFromCache(uuid, withCacheClear); if (!ArrayUtils.isEmpty(randomPasswords)) { replaceRandomPasswordsWithOriginalPasswords(properties, randomPasswords); } } return properties; }

Target:
public Property[] removeRandomPasswords(Property[] properties, boolean withCacheClear) { if (ArrayUtils.isEmpty(properties)) { return new Property[0]; } String uuid = IdentityApplicationManagementUtil.getPropertyValue(properties, IdentityApplicationConstants.UNIQUE_ID_CONSTANT); if (StringUtils.isBlank(uuid)) { if (log.isDebugEnabled()) { log.debug("Cache Key not found for Random Password Container"); } } else { properties = removeUniqueIdProperty(properties); RandomPassword[] randomPasswords = getRandomPasswordContainerFromCache(uuid, withCacheClear); if (!ArrayUtils.isEmpty(randomPasswords)) { replaceRandomPasswordsWithOriginalPasswords(properties, randomPasswords); } } return properties; }
Source:
public void shouldReturnRandomEmailAddress() { final Set<String> randomEmailAddresses = new HashSet<>(); for (int n = 0; n < SAMPLE_SIZE; n++) { final String randomEmailAddress = Randoms.randomEmailAddress(); assertNotNull(randomEmailAddress); try { Check.isValidEmail("email", randomEmailAddress); } catch (final ValidationException e) { fail("Invalid random email addredd generated: " + randomEmailAddress); } randomEmailAddresses.add(randomEmailAddress); } assertEquals("Random sample e-mail addresses should be unique", SAMPLE_SIZE, randomEmailAddresses.size()); }

Target:
public void shouldReturnRandomEmailAddress() { final Set<String> randomEmailAddresses = new HashSet<>(); for (int n = 0; n < SAMPLE_SIZE; n++) { final String randomEmailAddress = Randoms.randomEmailAddress(); assertNotNull(randomEmailAddress); try { Check.isValidEmail("email", randomEmailAddress); } catch (final ValidationException e) { fail("Invalid random email address generated: " + randomEmailAddress); } randomEmailAddresses.add(randomEmailAddress); } assertEquals("Random sample e-mail addresses should be unique", SAMPLE_SIZE, randomEmailAddresses.size()); }
Source:
public void testOrphanedAllocationIsCanceledIfNotRemapped() throws Exception { final List<AllocationID> allocationIds = new ArrayList<>(); resourceManagerGateway.setRequestSlotConsumer( slotRequest -> allocationIds.add(slotRequest.getAllocationId())); final List<AllocationID> canceledAllocations = new ArrayList<>(); resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add); try (SlotPoolImpl slotPool = createAndSetUpSlotPool(resourceManagerGateway)) { slotPool.registerTaskManager(taskManagerLocation.getResourceID()); final SlotRequestId slotRequestId1 = new SlotRequestId(); final SlotRequestId slotRequestId2 = new SlotRequestId(); requestNewAllocatedSlots(slotPool, slotRequestId1, slotRequestId2); final AllocationID allocationId1 = allocationIds.get(0); final AllocationID allocationId2 = allocationIds.get(1); AllocationID randomAllocationId; do { randomAllocationId = new AllocationID(); } while (randomAllocationId.equals(allocationId1) || randomAllocationId.equals(allocationId2)); registerAndOfferSlot(taskManagerLocation, slotPool, randomAllocationId); assertThat(slotPool.getPendingRequests().values(), hasSize(1)); assertThat(canceledAllocations, contains(allocationId1)); } }

Target:
public void testOrphanedAllocationIsCanceledIfNotRemapped() throws Exception { final List<AllocationID> allocationIds = new ArrayList<>(); resourceManagerGateway.setRequestSlotConsumer( slotRequest -> allocationIds.add(slotRequest.getAllocationId())); final List<AllocationID> canceledAllocations = new ArrayList<>(); resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add); try (SlotPoolImpl slotPool = SlotPoolUtils.createAndSetUpSlotPool(resourceManagerGateway)) { final SlotRequestId slotRequestId1 = new SlotRequestId(); final SlotRequestId slotRequestId2 = new SlotRequestId(); requestNewAllocatedSlots(slotPool, slotRequestId1, slotRequestId2); final AllocationID allocationId1 = allocationIds.get(0); final AllocationID allocationId2 = allocationIds.get(1); AllocationID randomAllocationId; do { randomAllocationId = new AllocationID(); } while (randomAllocationId.equals(allocationId1) || randomAllocationId.equals(allocationId2)); registerAndOfferSlot(taskManagerLocation, slotPool, randomAllocationId); assertThat(slotPool.getPendingRequests().values(), hasSize(1)); assertThat(canceledAllocations, contains(allocationId1)); } }
Source:
void acquireToken(final IWindowComponent activity, final boolean useDialog, final AuthenticationRequest authRequest, final AuthenticationCallback<AuthenticationResult> authenticationCallback) { final CallbackHandler callbackHandle = new CallbackHandler(getHandler(), authenticationCallback); Logger.setCorrelationId(authRequest.getCorrelationId()); Logger.v(TAG, "Sending async task from thread:" + android.os.Process.myTid()); THREAD_EXECUTOR.execute(new Runnable() { @Override public void run() { Logger.v(TAG, "Running task in thread:" + android.os.Process.myTid()); try { validateAcquireTokenRequest(authRequest); performAcquireTokenRequest(callbackHandle, activity, useDialog, authRequest); } catch (final AuthenticationException authenticationException) { mAPIEvent.setSuccessStatus(false); Telemetry.getInstance().stopEvent(authRequest.getTelemetryRequestId(), mAPIEvent, mAPIEvent.getEventName()); callbackHandle.onError(authenticationException); } } }); }

Target:
void acquireToken(final IWindowComponent activity, final boolean useDialog, final AuthenticationRequest authRequest, final AuthenticationCallback<AuthenticationResult> authenticationCallback) { final CallbackHandler callbackHandle = new CallbackHandler(getHandler(), authenticationCallback); Logger.setCorrelationId(authRequest.getCorrelationId()); Logger.v(TAG, "Sending async task from thread:" + android.os.Process.myTid()); THREAD_EXECUTOR.execute(new Runnable() { @Override public void run() { Logger.v(TAG, "Running task in thread:" + android.os.Process.myTid()); try { validateAcquireTokenRequest(authRequest); performAcquireTokenRequest(callbackHandle, activity, useDialog, authRequest); } catch (final AuthenticationException authenticationException) { mAPIEvent.setWasApiCallSuccessful(false, authenticationException); mAPIEvent.setCorrelationId(authRequest.getCorrelationId().toString()); mAPIEvent.stopTelemetryAndFlush(); callbackHandle.onError(authenticationException); } } }); }
Source:
private GroupReference getOrCreateGroupForIndividuals(ReviewDb db, ProjectConfig config, List<AccountGroup.Id> adminGroupIds, ContributorAgreement agreement) throws OrmException { if (!agreement.getAccepted().isEmpty()) { return agreement.getAccepted().get(0).getGroup(); } String name = "CLA Accepted - " + agreement.getName(); AccountGroupName agn = db.accountGroupNames().get(new AccountGroup.NameKey(name)); AccountGroup ag; if (agn != null) { ag = db.accountGroups().get(agn.getId()); if (ag == null) { throw new IllegalStateException( "account group name exists but account group does not: " + name); } if (!adminGroupIds.contains(ag.getOwnerGroupId())) { throw new IllegalStateException( "individual group exists with non admin owner group: " + name); } } else { ag = createGroup(db, name, adminGroupIds.get(0), String.format("Users who have accepted the %s CLA", agreement.getName())); } GroupReference group = config.resolve(ag); agreement.setAccepted(Lists.newArrayList(new PermissionRule(group))); if (agreement.getAutoVerify() != null) { agreement.setAutoVerify(group); } return group; }

Target:
private GroupReference getOrCreateGroupForIndividuals(ReviewDb db, ProjectConfig config, List<AccountGroup.Id> adminGroupIds, ContributorAgreement agreement) throws OrmException { if (!agreement.getAccepted().isEmpty()) { return agreement.getAccepted().get(0).getGroup(); } String name = "CLA Accepted - " + agreement.getName(); AccountGroupName agn = db.accountGroupNames().get(new AccountGroup.NameKey(name)); AccountGroup ag; if (agn != null) { ag = db.accountGroups().get(agn.getId()); if (ag == null) { throw new IllegalStateException( "account group name exists but account group does not: " + name); } if (!adminGroupIds.contains(ag.getOwnerGroupId())) { throw new IllegalStateException( "individual group exists with non admin owner group: " + name); } } else { ag = createGroup(db, name, adminGroupIds.get(0), String.format("Users who have accepted the %s CLA", agreement.getName())); } GroupReference group = config.resolve(ag); agreement.setAccepted(Lists.newArrayList(new PermissionRule(group))); if (agreement.getAutoVerify() != null) { agreement.setAutoVerify(group); } List<PermissionRule> sameGroupVisibility = config.getAccountsSection().getSameGroupVisibility(); PermissionRule rule = new PermissionRule(group); rule.setDeny(); if (!sameGroupVisibility.contains(rule)) { sameGroupVisibility.add(rule); } return group; }
Source:
public static Bond map(HostNIC model, Bond template) { Bond entity = template == null ? new Bond() : template; if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetBonding()) { entity.setBonded(true); if (model.getBonding().isSetSlaves()) { Set<String> slaveNamesInConfig = new HashSet<String>(); for (HostNIC slave : model.getBonding().getSlaves().getSlaves()) { if (!entity.getSlaves().contains(slave.getName())) { entity.getSlaves().add(slave.getName()); } slaveNamesInConfig.add(slave.getName()); } for (int i = entity.getSlaves().size()-1; i>=0; i--){ if (!slaveNamesInConfig.contains(entity.getSlaves().get(i))){ entity.getSlaves().remove(i); } } } if (model.getBonding().isSetOptions()) { entity.setBondOptions(calculateBondingOptionsString(model)); } } if (model.isSetQos()) { entity.setQos((HostNetworkQos) QosMapper.map(model.getQos(), null)); } return entity; }

Target:
public static Bond map(HostNIC model, Bond template) { Bond entity = template == null ? new Bond() : template; if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetBonding()) { entity.setBonded(true); if (model.getBonding().isSetSlaves()) { entity.getSlaves().clear(); for (HostNIC slave : model.getBonding().getSlaves().getSlaves()) { entity.getSlaves().add(slave.getName()); } } if (model.getBonding().isSetOptions()) { entity.setBondOptions(calculateBondingOptionsString(model)); } } if (model.isSetQos()) { entity.setQos((HostNetworkQos) QosMapper.map(model.getQos(), null)); } return entity; }
Source:
public Account(short id, String name, AccountStatus status, Collection<Container> containers) { this.id = id; this.name = name; this.status = status; checkRequiredFieldsForBuild(); if (containers != null) { for (Container container : containers) { checkParentAccountIdInContainers(container); checkDuplicateContainerNameOrId(container); updateContainerMap(container); } } }

Target:
Account(short id, String name, AccountStatus status, Collection<Container> containers) { this.id = id; this.name = name; this.status = status; checkRequiredFieldsForBuild(); if (containers != null) { for (Container container : containers) { checkParentAccountIdInContainers(container); checkDuplicateContainerNameOrId(container); updateContainerMap(container); } } }
Source:
public Set<String> dispatch(RejectionEnvelope envelope) { final Rejection rejection = envelope.getOuterObject(); final ExternalMessage message = ExternalMessages.of(rejection, boundedContextName); final Iterable<Publisher> channels = router.route(message); final ImmutableSet<String> result = from(channels) .transform(new Function<Publisher, String>() { @Override public String apply(Publisher input) { return input.toString(); } }) .toSet(); return result; }

Target:
public Set<String> dispatch(RejectionEnvelope envelope) { final Rejection rejection = envelope.getOuterObject(); final ExternalMessage message = ExternalMessages.of(rejection, boundedContextName); final Iterable<Publisher> channels = router.route(message); final Set<String> result = ImmutableSet.copyOf(Channels.toString(channels)); return result; }
Source:
public boolean validate(IOperationMonitor monitor) throws BugzillaRestException { try { ErrorResponse validateResponse = new BugzillaRestValidateRequest(client).run(monitor); return validateResponse.isError() && validateResponse.getCode() == 32614; } catch (BugzillaRestException e) { if (e instanceof BugzillaRestResourceNotFoundException && e.getMessage().equals("Error 32614: A REST API resource was not found for 'GET '.")) { return true; } else { throw e; } } }

Target:
public boolean validate(IOperationMonitor monitor) throws BugzillaRestException { RepositoryLocation location = getClient().getLocation(); if (Boolean.parseBoolean(location.getProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY))) { UserCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } String url = MessageFormat.format("/valid_login?login={0}&api_key={1}", new Object[] { credentials.getUserName(), location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY) }); BooleanResult response = new BugzillaRestUnauthenticatedGetRequest<BooleanResult>(client, url, new TypeToken<BooleanResult>() { }).run(monitor); return response.getResult(); } else { LoginToken validateResponse = new BugzillaRestLoginRequest(client).run(monitor); if (validateResponse != null && !Strings.isNullOrEmpty(validateResponse.getId())) { String url = MessageFormat.format("/logout?token={0}", new Object[] { validateResponse.getToken() }); new BugzillaRestUnauthenticatedGetRequest<BooleanResult>(client, url, new TypeToken<BooleanResult>() { }).run(monitor); return true; } } return false; }
Source:
public Register.DoubleLongRegister indexSample( IndexReference index, Register.DoubleLongRegister target ) throws IndexNotFoundKernelException { ktx.assertOpen(); ktx.assertOpen(); return storeReadLayer.indexUpdatesAndSize( SchemaDescriptorFactory.forLabel( index.label(), index.properties() ), target ); }

Target:
public Register.DoubleLongRegister indexSample( IndexReference index, Register.DoubleLongRegister target ) throws IndexNotFoundKernelException { ktx.assertOpen(); return storeReadLayer.indexSample( SchemaDescriptorFactory.forLabel( index.label(), index.properties() ), target ); }
Source:
private void openBackgroundPlayer(final boolean append) { if (MobileDataHelper.shouldDisplayWarningForMobileData(currentInfo, getContext())) { displayWarningForMobileData((dialog, which) -> { if (which == DialogInterface.BUTTON_POSITIVE) { playInBackground(append); PreferenceManager.getDefaultSharedPreferences(getContext()).edit() .putBoolean(getResources().getString(R.string.show_warning_live_stream_on_mobile), false) .apply(); } }); } else { playInBackground(append); } }

Target:
private void openBackgroundPlayer(final boolean append) { NavigationHelper.playInBackground(activity, new SinglePlayQueue(currentInfo), append, msg -> true); }
Source:
public void saveObs_shouldReturnPopulatedModelAndViewIfBindingErrorsOccurForComplexConcept() { MockHttpSession mockSession = new MockHttpSession(); MockMultipartHttpServletRequest mockRequest = new MockMultipartHttpServletRequest(); mockRequest.addParameter("saveObs", "saveObs"); mockRequest.setSession(mockSession); final String fileName = "test.txt"; final byte[] content = "Hello World".getBytes(); MockMultipartFile mockMultipartFile = new MockMultipartFile("complexDataFile", fileName, "text/plain", content); mockRequest.addFile(mockMultipartFile); when(obsErrors.hasErrors()).thenReturn(true); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HTML_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObsForMockObs3()); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HYPERLINK_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObs2ForMockObs3()); ModelAndView modelAndView = radiologyObsFormController.saveObs(mockRequest, null, "Test Edit Reason", mockRadiologyOrder, mockObsWithComplexConcept, obsErrors); assertThat(modelAndView.getViewName(), is("module/radiology/radiologyObsForm")); assertThat(modelAndView.getModelMap(), hasKey("obs")); Obs obs = (Obs) modelAndView.getModelMap().get("obs"); assertThat(obs, is(mockObsWithComplexConcept)); }

Target:
public void saveObs_shouldReturnPopulatedModelAndViewIfBindingErrorsOccurForComplexConcept() { MockHttpSession mockSession = new MockHttpSession(); MockMultipartHttpServletRequest mockRequest = new MockMultipartHttpServletRequest(); mockRequest.addParameter("saveObs", "saveObs"); mockRequest.setSession(mockSession); final String fileName = "test.txt"; final byte[] content = "Hello World".getBytes(); MockMultipartFile mockMultipartFile = new MockMultipartFile("complexDataFile", fileName, "text/plain", content); mockRequest.addFile(mockMultipartFile); when(obsErrors.hasErrors()).thenReturn(true); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HTML_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObsAsHtmlViewForMockObs3()); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HYPERLINK_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObsAsHyperlinkViewForMockObs3()); ModelAndView modelAndView = radiologyObsFormController.saveObs(mockRequest, null, "Test Edit Reason", mockRadiologyOrder, mockObsWithComplexConcept, obsErrors); assertThat(modelAndView.getViewName(), is("module/radiology/radiologyObsForm")); assertThat(modelAndView.getModelMap(), hasKey("obs")); Obs obs = (Obs) modelAndView.getModelMap().get("obs"); assertThat(obs, is(mockObsWithComplexConcept)); }
Source:
public void startFailedAutoStartVms() { LinkedList<RecordOfAutoStartVmToRestart> recordsToRemove = new LinkedList<>(); final DateTime now = DateTime.getNow(); final Date nextTimeOfRetryToRun = now.addSeconds(RETRY_TO_RUN_HA_VM_INTERVAL); for(RecordOfAutoStartVmToRestart recordOfAutoStartVmToRestart: recordsOfAutoStartVmsToRestart) { if (!recordOfAutoStartVmToRestart.isTimeToRun(now)) { continue; } Guid vmId = recordOfAutoStartVmToRestart.getVmId(); EngineLock runVmLock = createEngineLockForRunVm(vmId); if (!acquireLock(runVmLock)) { log.debugFormat("Could not acquire lock for running HA VM {0}", vmId); continue; } if (!isVmNeedsToBeAutoStarted(vmId)) { releaseLock(runVmLock); recordsToRemove.add(recordOfAutoStartVmToRestart); continue; } if (runVm(vmId, runVmLock)) { recordsToRemove.add(recordOfAutoStartVmToRestart); } else { logFailedAttemptToRestartHighlyAvailableVm(vmId); if (!recordOfAutoStartVmToRestart.scheduleNextTimeToRun(nextTimeOfRetryToRun)) { recordsToRemove.add(recordOfAutoStartVmToRestart); logFailureToRestartHighlyAvailableVm(vmId); } } } recordsOfAutoStartVmsToRestart.removeAll(recordsToRemove); }

Target:
public void startFailedAutoStartVms() { LinkedList<AutoStartVmToRestart> vmsToRemove = new LinkedList<>(); final DateTime iterationStartTime = DateTime.getNow(); final Date nextTimeOfRetryToRun = iterationStartTime.addSeconds(RETRY_TO_RUN_HA_VM_INTERVAL); for(AutoStartVmToRestart autoStartVmToRestart: autoStartVmsToRestart) { if (!autoStartVmToRestart.isTimeToRun(iterationStartTime)) { continue; } Guid vmId = autoStartVmToRestart.getVmId(); EngineLock runVmLock = createEngineLockForRunVm(vmId); if (!acquireLock(runVmLock)) { log.debugFormat("Could not acquire lock for running HA VM {0}", vmId); continue; } if (!isVmNeedsToBeAutoStarted(vmId)) { releaseLock(runVmLock); vmsToRemove.add(autoStartVmToRestart); continue; } if (runVm(vmId, runVmLock)) { vmsToRemove.add(autoStartVmToRestart); } else { logFailedAttemptToRestartHighlyAvailableVm(vmId); if (!autoStartVmToRestart.scheduleNextTimeToRun(nextTimeOfRetryToRun)) { vmsToRemove.add(autoStartVmToRestart); logFailureToRestartHighlyAvailableVm(vmId); } } } autoStartVmsToRestart.removeAll(vmsToRemove); }
Source:
public Network getNetwork(@Nonnull UUID id) throws ConflictHttpException, NotFoundHttpException { try { return networkZkManager.getNetwork(id); } catch (Exception e) { throw handle(e); } }

Target:
public Network getNetwork(@Nonnull UUID id) throws WebApplicationException { try { return networkZkManager.getNetwork(id); } catch (Exception e) { throw handle(e); } }
Source:
public void load() { getViewModel().showStartOperation(DEFAULT_ACTION); if (portletConfiguration != null) { String finalUrl = buildPortletUrl(portletConfiguration.getPortletUrl()); String body = buildBody(); String screensJs = new AssetReader(getContext()).read(R.raw.screens); getViewModel().addScript(new JsScript("Screens.js", screensJs)); if (portletConfiguration.isThemeEnabled() && !portletConfiguration.getWebType() .equals(PortletConfiguration.WebType.CUSTOM)) { getViewModel().setTheme(true); } for (InjectableScript script : portletConfiguration.getScripts()) { getViewModel().addScript(script); } if (portletConfiguration.getWebType() .equals(PortletConfiguration.WebType.LIFERAY_AUTHENTICATED)) { if (SessionContext.isLoggedIn()) { getViewModel().postUrl(finalUrl, body); } else { Exception exception = new Exception( "You have to be logged to use the LIFERAY_AUTHENTICATED web type"); getViewModel().showFailedOperation(DEFAULT_ACTION, exception); error(exception, DEFAULT_ACTION); } } else { getViewModel().loadUrl(finalUrl); } } else { getViewModel().showFailedOperation(DEFAULT_ACTION, new MalformedURLException()); } }

Target:
public void load() { getViewModel().showStartOperation(DEFAULT_ACTION); if (portletConfiguration != null) { String finalUrl = buildPortletUrl(portletConfiguration.getPortletUrl()); String body = buildBody(); String screensJs = new AssetReader(getContext()).read(R.raw.screens); getViewModel().addScript(new JsScript("Screens.js", screensJs)); if (portletConfiguration.isThemeEnabled() && !PortletConfiguration.WebType.OTHER.equals(portletConfiguration.getWebType())) { getViewModel().setTheme(true); } for (InjectableScript script : portletConfiguration.getScripts()) { getViewModel().addScript(script); } if (PortletConfiguration.WebType.LIFERAY_AUTHENTICATED.equals( portletConfiguration.getWebType())) { if (SessionContext.isLoggedIn()) { getViewModel().postUrl(finalUrl, body); } else { Exception exception = new Exception( "You have to be logged to use the LIFERAY_AUTHENTICATED web type"); getViewModel().showFailedOperation(DEFAULT_ACTION, exception); error(exception, DEFAULT_ACTION); } } else { getViewModel().loadUrl(finalUrl); } } else { getViewModel().showFailedOperation(DEFAULT_ACTION, new MalformedURLException()); } }
Source:
public boolean doesFileExist(String apiUri) throws ApiException { String lfcPath = getLFCPathFromApiUri(apiUri); checkReadPermission(lfcPath); return lfcPath.equals(ROOT) || baseDoesFileExist(lfcPath); }

Target:
public boolean doesFileExist(String apiUri) throws ApiException { String lfcPath = checkReadPermission(apiUri); return lfcPath.equals(ROOT) || baseDoesFileExist(lfcPath); }
Source:
private void writeNamedCurve(DatagramWriter writer) { writer.write(hintEncoded.length, IDENTITY_HINT_LENGTH_BITS); writer.writeBytes(hintEncoded); writer.write(NAMED_CURVE, CURVE_TYPE_BITS); writer.write(curveId, NAMED_CURVE_BITS); writer.write(pointEncoded.length, PUBLIC_LENGTH_BITS); writer.writeBytes(pointEncoded); }

Target:
private void writeNamedCurve(DatagramWriter writer) { writer.write(NAMED_CURVE, CURVE_TYPE_BITS); writer.write(curveId, NAMED_CURVE_BITS); writer.write(pointEncoded.length, PUBLIC_LENGTH_BITS); writer.writeBytes(pointEncoded); }
Source:
private void setTimeZone(final ZoneId timeZone) { if (timeZone != null) { try { this.timeZone = TimeZone.getTimeZone(timeZone).toZoneId(); } catch (IllegalArgumentException e) { this.timeZone = TimeZone.getDefault().toZoneId(); logger.warn("Could not set a new time zone, the system's default time zone will be used ", e); } } }

Target:
private void setTimeZone(final ZoneId timeZone) { if (timeZone != null) { try { this.timeZone = TimeZone.getTimeZone(timeZone).toZoneId(); } catch (IllegalArgumentException e) { this.timeZone = TimeZone.getDefault().toZoneId(); logger.warn("Could not set a new time zone, the system's default time zone will be used ", timeZone, e.getMessage()); } } }
Source:
private File createTempFile(String prefix, String suffix) { File tempFile; try { tempFile = File.createTempFile(prefix, suffix); } catch (IOException e) { throw new GoodDataException("Unable to create temporary file", e); } return tempFile; }

Target:
private File createTempFile(String prefix, String suffix) { File tempFile; try { tempFile = File.createTempFile(prefix, suffix); tempFile.deleteOnExit(); } catch (IOException e) { throw new GoodDataException("Unable to create temporary file", e); } return tempFile; }
Source:
public void writeItems(java.util.List<Object> items) throws Exception { for(Object o : items){ LOG.info(o.toString()); } }

Target:
public void writeItems(java.util.List<Object> items) throws Exception { }
Source:
private String uncompressLogoutMessage(final String originalMessage) { final byte[] binaryMessage = Base64.decodeBase64(originalMessage); try { final Inflater decompresser = new Inflater(); decompresser.setInput(binaryMessage); byte[] result = new byte[binaryMessage.length * 10]; int resultLength = decompresser.inflate(result); decompresser.end(); return new String(result, 0, resultLength, "UTF-8"); } catch (DataFormatException e) { logger.error("Unable to decompress logout message", e); throw new RuntimeException(e); } catch (UnsupportedEncodingException e) { logger.error("Unable to decompress logout message", e); throw new RuntimeException(e); } }

Target:
private String uncompressLogoutMessage(final String originalMessage) { final byte[] binaryMessage = Base64.decodeBase64(originalMessage); Inflater decompresser = null; try { decompresser = new Inflater(); decompresser.setInput(binaryMessage); final byte[] result = new byte[binaryMessage.length * DECOMPRESSION_FACTOR]; final int resultLength = decompresser.inflate(result); return new String(result, 0, resultLength, "UTF-8"); } catch (final Exception e) { logger.error("Unable to decompress logout message", e); throw new RuntimeException(e); } finally { if (decompresser != null) { decompresser.end(); } } }
Source:
private static AnalyzerMessage.TextSpan textSpanBetween(SyntaxToken firstSyntaxToken, SyntaxToken lastSyntaxToken) { AnalyzerMessage.TextSpan location = new AnalyzerMessage.TextSpan( firstSyntaxToken.line(), firstSyntaxToken.column(), lastSyntaxToken.line(), lastSyntaxToken.column() + lastSyntaxToken.text().length() ); Preconditions.checkState(!location.isEmpty(), "Issue location should not be empty"); return location; }

Target:
private static AnalyzerMessage.TextSpan textSpanBetween(SyntaxToken firstSyntaxToken, SyntaxToken lastSyntaxToken) { AnalyzerMessage.TextSpan location = new AnalyzerMessage.TextSpan( firstSyntaxToken.line(), firstSyntaxToken.column(), lastSyntaxToken.line(), lastSyntaxToken.column() + lastSyntaxToken.text().length() ); Preconditions.checkState(!location.isEmpty(), "Invalid issue location: Text span is empty when trying reporting on (l:%s, c:%s).", firstSyntaxToken.line(), firstSyntaxToken.column()); return location; }
Source:
public T fromJson(JsonReader reader) throws IOException { String name = reader.nextString(); try { T[] values = (T[]) clazz.getMethod("values").invoke(null); for (T value : values) { if (value.toString().equals(name)) { return value; } } return null; } catch (Exception e) { return null; } }

Target:
public T fromJson(JsonReader reader) throws IOException { String name = reader.nextString(); for (T value : values) { if (value.name().equals(name)) { return value; } } return null; }
Source:
public static String quotePattern(String pattern) { final String START = "\\Q"; final String STOP = "\\E"; final int STOP_LENGTH = 2; int stopIndex = pattern.indexOf(STOP); if (stopIndex < 0) { return START + pattern + STOP; } StringBuilder result = new StringBuilder(START); for (int position=0; ;) { stopIndex = pattern.indexOf(STOP, position); if (stopIndex >= 0) { result.append(pattern.substring(position, stopIndex + 2) + "\\" + STOP + START); position = stopIndex + STOP_LENGTH; } else { result.append(pattern.substring(position) + STOP); break; } } return result.toString(); }

Target:
public static String quotePattern(String pattern) { final String START = "\\Q"; final String STOP = "\\E"; final int STOP_LENGTH = 2; StringBuilder result = new StringBuilder(START); int stopIndex = pattern.indexOf(STOP); if (stopIndex < 0) { return result.append(pattern).append(STOP).toString(); } for (int position=0; ;) { stopIndex = pattern.indexOf(STOP, position); if (stopIndex >= 0) { result.append(pattern.substring(position, stopIndex + 2)).append("\\").append(STOP).append(START); position = stopIndex + STOP_LENGTH; } else { result.append(pattern.substring(position)).append(STOP); break; } } return result.toString(); }
Source:
private void intiChangeListener() { final EditText phone = (EditText) findViewById(R.id.phone); findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = new User(); user.mobile = phone.getText().toString(); TaskQueue.loadQueueDefault(v.getContext()).execute(new UpdateUserTask(user)); Toast.makeText(v.getContext(), "TODO", Toast.LENGTH_SHORT).show(); } }); }

Target:
private void intiChangeListener() { final EditText phone = (EditText) findViewById(R.id.phone); findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = new User(); user.id = AppPrefs.getInstance(v.getContext()).getCurrentUserId(); user.mobile = phone.getText().toString(); TaskQueue.loadQueueDefault(v.getContext()).execute(new UpdateUserTask(user)); } }); }
Source:
private WriteResult insertDoc(CRUDOperationContext ctx, DBCollection collection, EntityMetadata md, DBObject dbObject, DocCtx inputDoc) { LOGGER.debug("Inserting doc"); if (!md.getAccess().getInsert().hasAccess(ctx.getCallerRoles())) { inputDoc.addError(Error.get("insert", MongoCrudConstants.ERR_NO_ACCESS, "insert:" + md.getName())); } else { Set<Path> paths = roleEval.getInaccessibleFields_Insert(inputDoc); LOGGER.debug("Inaccessible fields:{}", paths); if (paths == null || paths.isEmpty()) { ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.PRE_CRUD_INSERT_DOC, ctx, inputDoc); WriteResult r = new InsertCommand(collection, dbObject).executeAndUnwrap(); inputDoc.setCRUDOperationPerformed(CRUDOperation.INSERT); ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.POST_CRUD_INSERT_DOC, ctx, inputDoc); return r; } else { for(Path path : paths){ inputDoc.addError(Error.get("insert", CrudConstants.ERR_NO_FIELD_INSERT_ACCESS, path.toString())); } } } return null; }

Target:
private WriteResult insertDoc(CRUDOperationContext ctx, DBCollection collection, EntityMetadata md, DBObject dbObject, DocCtx inputDoc) { LOGGER.debug("Inserting doc"); if (!md.getAccess().getInsert().hasAccess(ctx.getCallerRoles())) { inputDoc.addError(Error.get("insert", MongoCrudConstants.ERR_NO_ACCESS, "insert:" + md.getName())); } else { Set<Path> paths = roleEval.getInaccessibleFields_Insert(inputDoc); LOGGER.debug("Inaccessible fields:{}", paths); if (paths == null || paths.isEmpty()) { try { ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.PRE_CRUD_INSERT_DOC, ctx, inputDoc); WriteResult r = new InsertCommand(collection, dbObject).executeAndUnwrap(); inputDoc.setCRUDOperationPerformed(CRUDOperation.INSERT); ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.POST_CRUD_INSERT_DOC, ctx, inputDoc); return r; } catch (DuplicateKeyException dke) { LOGGER.error("saveOrInsert failed: {}", dke); inputDoc.addError(Error.get("insert", MongoCrudConstants.ERR_DUPLICATE, dke)); } } else { for(Path path : paths){ inputDoc.addError(Error.get("insert", CrudConstants.ERR_NO_FIELD_INSERT_ACCESS, path.toString())); } } } return null; }
Source:
Object getValue(Object obj, String attributePath) throws Exception { String[] paths = getPath(attributePath); JsonParser parser = createParser(obj); parser.nextToken(); for (int i = 0; i < paths.length; i++) { String path = paths[i]; String arrayIndexText = getIndexTextOrNull(path); if (arrayIndexText == null) { if (!findAttribute(parser, path)) { return null; } } else { if ("any".equals(arrayIndexText)) { String lastPath = i + 1 < paths.length ? paths[i + 1] : null; return getMultiValue(parser, lastPath); } else { JsonToken token = parser.getCurrentToken(); if (token != JsonToken.START_ARRAY) { return null; } token = parser.nextToken(); int arrayIndex = Integer.parseInt(arrayIndexText); for (int j = 0; j < arrayIndex; j++) { if (token == JsonToken.END_ARRAY) { return null; } parser.skipChildren(); token = parser.nextToken(); } } } } Object ret = convertJsonTokenToValue(parser); parser.close(); return ret; }

Target:
Object getValue(Object obj, String attributePath) throws Exception { String[] paths = getPath(attributePath); JsonParser parser = createParser(obj); try { parser.nextToken(); for (int i = 0; i < paths.length; i++) { String path = paths[i]; String arrayIndexText = getIndexTextOrNull(path); if (arrayIndexText == null) { if (!findAttribute(parser, path)) { return null; } } else { if ("any".equals(arrayIndexText)) { String lastPath = i + 1 < paths.length ? paths[i + 1] : null; return getMultiValue(parser, lastPath); } else { JsonToken token = parser.currentToken(); if (token != JsonToken.START_ARRAY) { return null; } token = parser.nextToken(); int arrayIndex = Integer.parseInt(arrayIndexText); for (int j = 0; j < arrayIndex; j++) { if (token == JsonToken.END_ARRAY) { return null; } parser.skipChildren(); token = parser.nextToken(); } } } } return convertJsonTokenToValue(parser); } finally { parser.close(); } }
Source:
private void parseKeyAndValue(String key, String value, int digits, int plane, int nPlanes) { for (int i=plane; i<plane+nPlanes; i++) { addSeriesMeta(String.format("Plane #%0" + digits + "d %s", i, key), value); if (key.equals("XPositionUm")) { try { Position p = positions.get(getCoreIndex()); p.positions[i][0] = DataTools.parseDouble(value); } catch (NumberFormatException e) { } } else if (key.equals("YPositionUm")) { try { Position p = positions.get(getCoreIndex()); p.positions[i][1] = DataTools.parseDouble(value); } catch (NumberFormatException e) { } } else if (key.equals("ZPositionUm")) { try { Position p = positions.get(getCoreIndex()); p.positions[i][2] = DataTools.parseDouble(value); } catch (NumberFormatException e) { } } } }

Target:
private void parseKeyAndValue(String key, String value, int digits, int plane, int nPlanes) { for (int i=plane; i<plane+nPlanes; i++) { addSeriesMeta(String.format("Plane #%0" + digits + "d %s", i, key), value); if (key.equals("XPositionUm")) { Position p = positions.get(getCoreIndex()); p.positions[i][0] = DataTools.parseDouble(value); } else if (key.equals("YPositionUm")) { Position p = positions.get(getCoreIndex()); p.positions[i][1] = DataTools.parseDouble(value); } else if (key.equals("ZPositionUm")) { Position p = positions.get(getCoreIndex()); p.positions[i][2] = DataTools.parseDouble(value); } } }
Source:
public static GoCompositeLit createCompositeLit(@NotNull Project project, @NotNull GoType type) { String typeText = type.getText(); GoFile file = createFileFromText(project, "package a; struct " + typeText + " {}; var _ = " + typeText + "{}"); return PsiTreeUtil.findChildOfType(file, GoCompositeLit.class); }

Target:
public static GoCompositeLit createCompositeLit(@NotNull Project project, @NotNull GoType type) { GoFile file = createFileFromText(project, "package a; var _ = " + type.getText() + "{}"); return PsiTreeUtil.findChildOfType(file, GoCompositeLit.class); }
Source:
private void setProxyServer(Request request, String proxyServerParameters) { if (!proxyServerParameters.contains("://")) { proxyServerParameters = "http://" + proxyServerParameters; } URI uriProxy = null; try { uriProxy = new URI(proxyServerParameters); request.setProxyServer("scheme", uriProxy.getScheme()); Optional<String> userInfoOptional = Optional.ofNullable(uriProxy.getUserInfo()); if (userInfoOptional.isPresent()) { String userinfo = userInfoOptional.get(); if (userinfo.contains(":")) { String[] userInfo = userinfo.split(":"); request.setProxyServer("username", userInfo[0]); request.setProxyServer("password", userInfo[1]); } } Optional<String> hostOptional = Optional.ofNullable(uriProxy.getHost()); if (hostOptional.isPresent()) { request.setProxyServer("servername", hostOptional.get()); } if (uriProxy.getPort() != -1) { request.setProxyServer("port", String.valueOf(uriProxy.getPort())); } else { request.setProxyServer("port", "1080"); } } catch (URISyntaxException e) { LOGGER.error("string '{}' cannot be converted to a URL", proxyServerParameters); throw new IllegalArgumentException(proxyServerParameters + " cannot be converted to a URL"); } }

Target:
private void setProxyServer(Request request, String proxyServerParameters) { if (!proxyServerParameters.contains("://")) { proxyServerParameters = "http://" + proxyServerParameters; } URI uriProxy = null; try { uriProxy = new URI(proxyServerParameters); request.setProxyServer("scheme", uriProxy.getScheme()); Optional<String> userInfoOptional = Optional.ofNullable(uriProxy.getUserInfo()); if (userInfoOptional.isPresent()) { setProxyServerUserInfo(request, userInfoOptional.get()); } Optional<String> hostOptional = Optional.ofNullable(uriProxy.getHost()); if (hostOptional.isPresent()) { request.setProxyServer("servername", hostOptional.get()); } if (uriProxy.getPort() != -1) { request.setProxyServer("port", String.valueOf(uriProxy.getPort())); } else { request.setProxyServer("port", "1080"); } } catch (URISyntaxException e) { LOGGER.error("string '{}' cannot be converted to a URL", proxyServerParameters); throw new IllegalArgumentException(proxyServerParameters + " cannot be converted to a URL"); } }
Source:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getParameters().getVmPool().getName(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_POOL, getVmPoolIsBeingCreatedMessage())); }

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getParameters().getVmPool().getName(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_POOL_NAME, getVmPoolIsBeingCreatedMessage())); }
Source:
public String withParams(String url) throws URISyntaxException { return new URIBuilder(url) .addParameter(TmcConstants.API_VERSION_PARAM, settings.apiVersion()) .addParameter(TmcConstants.CLIENT_NAME_PARAM, settings.clientName()) .addParameter(TmcConstants.CLIENT_VERSION_PARAM, settings.clientVersion()) .build().toString(); }

Target:
public String withParams(String url) throws URISyntaxException { return new URIBuilder(url) .addParameter(API_VERSION_PARAM, settings.apiVersion()) .addParameter(CLIENT_NAME_PARAM, settings.clientName()) .addParameter(CLIENT_VERSION_PARAM, settings.clientVersion()) .build().toString(); }
Source:
private Action onReleaseSession( final DirectBuffer buffer, final int offset, final int blockLength, final int version, final Header header) { releaseSession.wrap(buffer, offset, blockLength, version); final int libraryId = releaseSession.libraryId(); final Action action = handler.onApplicationHeartbeat(libraryId, header.sessionId()); if (action == ABORT) { return CONTINUE; } return handler.onReleaseSession( libraryId, releaseSession.connection(), releaseSession.sessionId(), releaseSession.correlationId(), releaseSession.state(), releaseSession.heartbeatIntervalInMs(), releaseSession.lastSentSequenceNumber(), releaseSession.lastReceivedSequenceNumber(), releaseSession.username(), releaseSession.password(), header); }

Target:
private Action onReleaseSession( final DirectBuffer buffer, final int offset, final int blockLength, final int version, final Header header) { releaseSession.wrap(buffer, offset, blockLength, version); final int libraryId = releaseSession.libraryId(); final Action action = handler.onApplicationHeartbeat(libraryId, header.sessionId()); if (action != null) { return action; } return handler.onReleaseSession( libraryId, releaseSession.connection(), releaseSession.sessionId(), releaseSession.correlationId(), releaseSession.state(), releaseSession.heartbeatIntervalInMs(), releaseSession.lastSentSequenceNumber(), releaseSession.lastReceivedSequenceNumber(), releaseSession.username(), releaseSession.password(), header); }
Source:
private void spongeImpl$onEntityCollideWithBlockState(BlockState blockState, net.minecraft.world.World worldIn, BlockPos pos, Entity entityIn) { if (!((BlockBridge) blockState.getBlock()).bridge$hasCollideWithStateLogic()) { return; } if (world.isRemote) { blockState.onEntityCollision(world, pos, entityIn); return; } if (!SpongeCommonEventFactory.handleCollideBlockEvent(blockState.getBlock(), world, pos, blockState, entityIn, Direction.NONE)) { blockState.onEntityCollision(world, pos, entityIn); this.lastCollidedBlockPos = pos; } }

Target:
private void impl$onEntityCollideWithBlockState(BlockState blockState, net.minecraft.world.World worldIn, BlockPos pos, Entity entityIn) { if (!((BlockBridge) blockState.getBlock()).bridge$hasCollideWithStateLogic()) { return; } if (world.isRemote) { blockState.onEntityCollision(world, pos, entityIn); return; } if (!SpongeCommonEventFactory.handleCollideBlockEvent(blockState.getBlock(), world, pos, blockState, entityIn, Direction.NONE)) { blockState.onEntityCollision(world, pos, entityIn); this.impl$lastCollidedBlockPos = pos; } }