auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void visit(RepositoryBuild build) throws Exception { if (!build.getSha().isPresent()) { return; } GitInfo gitInfo = branchService.get(build.getBranchId()).get(); if (!gitHubConfigurationMap.get(gitInfo.getHost()).getSetCommitStatus()) { LOG.info("Git Hub Host has setCommitStatus set to false not sending message", gitInfo.getHost()); return; } String url = blazarUrlHelper.getBlazarUiLink(build); GHCommitState state = toGHCommitState(build.getState()); String sha = build.getSha().get(); String description = getStateDescription(build.getState()); final GHRepository repository; try { repository = gitHubHelper.repositoryFor(gitInfo); } catch (FileNotFoundException e) { LOG.warn("Couldn't find repository {}", gitInfo.getFullRepositoryName(), e); return; } LOG.info("Setting status of commit to for build {}", sha, state, build.getId().get()); try { repository.createCommitStatus(sha, state, url, description, "Blazar"); } catch (IOException e) { Optional<GitHubErrorResponse> gitHubErrorResponse = gitHubHelper.extractErrorResponseFromException(e); if (gitHubErrorResponse.isPresent()) { List<GitHubApiError> errors = gitHubErrorResponse.get().getErrors(); if (errors.stream().filter(er -> er.getMessage().contains(GITHUB_TOO_MANY_STATUSES_MESSAGE)).count() > 0) { LOG.info("Commit {}#{} has too many statuses status posting failed.", gitInfo.getFullRepositoryName(), sha); return; } } LOG.error("Error setting status of commit to for build {}", sha, state, build.getId().get(), e); } }

Target:
public void visit(RepositoryBuild build) throws Exception { if (!build.getSha().isPresent()) { return; } GitInfo gitInfo = branchService.get(build.getBranchId()).get(); if (!gitHubConfigurationMap.get(gitInfo.getHost()).getSetCommitStatus()) { LOG.info("Git Hub Host has setCommitStatus set to false not sending message", gitInfo.getHost()); return; } String url = blazarUrlHelper.getBlazarUiLink(build); GHCommitState state = toGHCommitState(build.getState()); String sha = build.getSha().get(); String description = getStateDescription(build.getState()); final GHRepository repository; try { repository = gitHubHelper.repositoryFor(gitInfo); } catch (FileNotFoundException e) { LOG.warn("Couldn't find repository {}", gitInfo.getFullRepositoryName(), e); return; } LOG.info("Setting status of commit to for build {}", sha, state, build.getId().get()); try { repository.createCommitStatus(sha, state, url, description, "Blazar"); } catch (IOException e) { Optional<GitHubErrorResponse> gitHubErrorResponse = gitHubHelper.extractErrorResponseFromException(e); if (gitHubErrorResponse.isPresent()) { List<GitHubApiError> errors = gitHubErrorResponse.get().getErrors(); if (errors.stream().filter(er -> er.getMessage().contains(GITHUB_TOO_MANY_STATUSES_MESSAGE)).count() > 0) { LOG.warn("Commit {}#{} has the maximum number of statuses GitHub allows, cannot post status.", gitInfo.getFullRepositoryName(), sha); return; } } LOG.error("Error setting status of commit to for build {}", sha, state, build.getId().get(), e); } }
Source:
void init() { controllerHomeDir = resolveControllerHomeDir(); this.initAccessOfDirectories(); this.initAccessOfHosts(); }

Target:
void init() { this.initAccessOfDirectories(); this.initAccessOfHosts(); }
Source:
private Object readResolve() { return ToStringStyle.NO_CLASS_NAME_MULTI_LINE_STYLE; }

Target:
private Object readResolve() { return NO_CLASS_NAME_MULTI_LINE_STYLE; }
Source:
private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null) { Guid taskId = asyncTask.getTaskId(); if (taskId != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(taskId); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } asyncTask.setStatus(entity.getStatusSummary().getStatus()); getGlusterTaskUtils().updateSteps(getClusterDao().get(clusterId), asyncTask, stepsList); if (getGlusterTaskUtils().hasTaskCompleted(asyncTask)) { getGlusterTaskUtils().releaseLock(volume.getId()); } } } updateHostIP(entity); return entity; }

Target:
protected GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = setStartTime((GlusterVolumeTaskStatusEntity) returnValue.getReturnValue()); updateStatusDetails(entity); return updateHostDetails(entity); }
Source:
public void setup() { Section section = new Section(new Shell(), SWT.NONE); event = new ExpansionEvent(section, true); expansionEventConsumer = new ExpansionEventConsumer(); }

Target:
public void setup() { event = new ExpansionEvent(section, true); expansionEventConsumer = new ExpansionEventConsumer(); }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } VDSGroup cluster = getVdsGroup(); if (cluster == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (!cluster.supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); return false; } if (!GlusterFeatureSupported.glusterSnapshot(cluster.getcompatibility_version())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED); return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } else if (volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } VDSGroup cluster = getVdsGroup(); if (cluster == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (!cluster.supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); return false; } if (!GlusterFeatureSupported.glusterSnapshot(cluster.getcompatibility_version())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED); return false; } GlusterVolumeEntity volume = getGlusterVolume(); if (volume == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID); } else if (volume.getStatus() == GlusterStatus.DOWN) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); } if (!isVolumeThinlyProvisioned(volume)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_NOT_THINLY_PROVISIONED); } if (getDbFacade().getGlusterVolumeSnapshotDao().getByName(getGlusterVolumeId(), snapshot.getSnapshotName()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SNAPSHOT_ALREADY_EXISTS); } return true; }
Source:
protected CompileToJarStepFactory buildCompileStepFactory() { return new KotlincToJarStepFactory( Preconditions.checkNotNull(kotlinBuckConfig).getKotlinc(), extraKotlincArguments, EMPTY_EXTRA_CLASSPATH, getJavac(), javacOptions, javacOptionsAmender); }

Target:
protected CompileToJarStepFactory buildCompileStepFactory() { return new KotlincToJarStepFactory( Preconditions.checkNotNull(kotlinBuckConfig).getKotlinc(), extraKotlincArguments, EMPTY_EXTRA_CLASSPATH, getJavac(), Preconditions.checkNotNull(javacOptions), javacOptionsAmender); }
Source:
private void setupEntityExpansionLimit(final SAXParser parser) throws SAXNotSupportedException { try { parser.setProperty( JDK_ENTITY_EXPANSION_LIMIT, entityExpansionLimit != null ? entityExpansionLimit : DEFAULT_ENTITY_EXPANSION_LIMIT); } catch (SAXNotRecognizedException ex) { LOGGER.warning( "Sax parser property '" + JDK_ENTITY_EXPANSION_LIMIT + "' not recognized. " + "Please check if XercesImpl jar dependency must be updated."); } }

Target:
private void setupEntityExpansionLimit(final SAXParser parser) throws SAXNotSupportedException { try { parser.setProperty( JDK_ENTITY_EXPANSION_LIMIT, entityExpansionLimit != null ? entityExpansionLimit : DEFAULT_ENTITY_EXPANSION_LIMIT); } catch (SAXNotRecognizedException ex) { LOGGER.warning( "Sax parser property '" + JDK_ENTITY_EXPANSION_LIMIT + "' not recognized. " + "Xerces version is incompatible."); } }
Source:
public static void initializeFlash() { Log.d(TAG, "initializeFlash()"); available = CameraManager.getInstance().isCameraFlashAvailable(); if (!available) { return; } CameraManager.getInstance().switchToCameraWithFlash(); if (!CameraManager.getInstance().isReady()) { CameraManager.getInstance().startCamera(); } paramsOn = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOn != null) { paramsOn.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); } paramsOff = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOff != null) { paramsOff.setFlashMode("off"); } }

Target:
public static void initializeFlash() { available = CameraManager.getInstance().isCameraFlashAvailable(); if (!available) { destroy(); return; } CameraManager.getInstance().switchToCameraWithFlash(); if (!CameraManager.getInstance().isReady()) { CameraManager.getInstance().startCamera(); } paramsOn = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOn != null) { paramsOn.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); } paramsOff = CameraManager.getInstance().getCurrentCamera().getParameters(); if (paramsOff != null) { paramsOff.setFlashMode("off"); } }
Source:
public void testInputStarvation() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = new StreamTaskMailboxTestHarnessBuilder<>(MultipleInputStreamTask::new, BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .setupOutputForSingletonOperatorChain(new TestInputStarvationMultipleInputOperatorFactory()) .build()) { for (int i = 0; i < testHarness.inputGates.length; i++) { testHarness.processSingleStep(); } Queue<StreamRecord> expectedOutput = new ArrayDeque<>(); testHarness.setAutoProcess(false); testHarness.processSingleStep(); assertTrue(testHarness.getOutput().isEmpty()); testHarness.processElement(new StreamRecord<>("NOT_SELECTED"), 0); testHarness.processElement(new StreamRecord<>("1"), 1); testHarness.processElement(new StreamRecord<>("2"), 1); testHarness.processElement(new StreamRecord<>("3"), 1); testHarness.processElement(new StreamRecord<>("4"), 1); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 1")); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 2")); assertThat(testHarness.getOutput(), contains(expectedOutput.toArray())); testHarness.processElement(new StreamRecord<>("1"), 2); testHarness.processSingleStep(); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[3]: 1")); expectedOutput.add(new StreamRecord<>("[2]: 3")); assertThat(testHarness.getOutput(), containsInAnyOrder(expectedOutput.toArray())); } }

Target:
public void testInputStarvation() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = new StreamTaskMailboxTestHarnessBuilder<>(MultipleInputStreamTask::new, BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .addInput(BasicTypeInfo.STRING_TYPE_INFO) .setupOutputForSingletonOperatorChain(new TestInputStarvationMultipleInputOperatorFactory()) .build()) { testHarness.processAll(); Queue<StreamRecord> expectedOutput = new ArrayDeque<>(); testHarness.setAutoProcess(false); testHarness.processSingleStep(); assertTrue(testHarness.getOutput().isEmpty()); testHarness.processElement(new StreamRecord<>("NOT_SELECTED"), 0); testHarness.processElement(new StreamRecord<>("1"), 1); testHarness.processElement(new StreamRecord<>("2"), 1); testHarness.processElement(new StreamRecord<>("3"), 1); testHarness.processElement(new StreamRecord<>("4"), 1); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 1")); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[2]: 2")); assertThat(testHarness.getOutput(), contains(expectedOutput.toArray())); testHarness.processElement(new StreamRecord<>("1"), 2); testHarness.processSingleStep(); testHarness.processSingleStep(); expectedOutput.add(new StreamRecord<>("[3]: 1")); expectedOutput.add(new StreamRecord<>("[2]: 3")); assertThat(testHarness.getOutput(), containsInAnyOrder(expectedOutput.toArray())); } }
Source:
public ActivationKeyDTO updateActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId, @ApiParam(name = "update", required = true) ActivationKeyDTO update) { ActivationKey toUpdate = activationKeyCurator.verifyAndLookupKey(activationKeyId); if (update.getName() != null) { toUpdate.setName(update.getName()); } String serviceLevel = update.getServiceLevel(); if (serviceLevel != null) { serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); toUpdate.setServiceLevel(serviceLevel); } if (update.getReleaseVer() != null && update.getReleaseVer().getReleaseVer() != null) { toUpdate.setReleaseVer(new Release(update.getReleaseVer().getReleaseVer())); } if (update.getDescription() != null) { toUpdate.setDescription(update.getDescription()); } if (update.isAutoAttach() != null) { toUpdate.setAutoAttach(update.isAutoAttach()); } activationKeyCurator.merge(toUpdate); return this.translator.translate(toUpdate, ActivationKeyDTO.class); }

Target:
public ActivationKeyDTO updateActivationKey( @PathParam("activation_key_id") @Verify(ActivationKey.class) String activationKeyId, @ApiParam(name = "update", required = true) ActivationKeyDTO update) { ActivationKey toUpdate = activationKeyCurator.verifyAndLookupKey(activationKeyId); if (update.getName() != null) { toUpdate.setName(update.getName()); } String serviceLevel = update.getServiceLevel(); if (serviceLevel != null) { serviceLevelValidator.validate(toUpdate.getOwner(), serviceLevel); toUpdate.setServiceLevel(serviceLevel); } if (update.getReleaseVersion() != null) { toUpdate.setReleaseVer(new Release(update.getReleaseVersion())); } if (update.getDescription() != null) { toUpdate.setDescription(update.getDescription()); } if (update.isAutoAttach() != null) { toUpdate.setAutoAttach(update.isAutoAttach()); } toUpdate = activationKeyCurator.merge(toUpdate); return this.translator.translate(toUpdate, ActivationKeyDTO.class); }
Source:
public String getNetworkWithPopularTerms() throws QStoreStorageException { try { return publicNetworks.get(); } catch (InterruptedException | ExecutionException e) { throw new QStoreStorageException(e); } }

Target:
public String getNetworkWithPopularTerms() throws AsyncExecutionException { try { return publicNetworks.get(); } catch (InterruptedException | ExecutionException e) { throw new AsyncExecutionException(e); } }
Source:
private void updateBackup() { if (getCurrentStorageItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isStorageDomainUnattached = getDataCenter().getSelectedItem().getId().equals(UnassignedDataCenterId); if (isStorageDomainUnattached) { if (getCurrentStorageItem().getRole().isDataDomain()) { getBackup().setIsAvailable(true); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } return; } if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } return; } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } return; }

Target:
private void updateBackup() { if (getCurrentStorageItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isStorageDomainUnattached = getDataCenter().getSelectedItem().getId().equals(UnassignedDataCenterId); if (isStorageDomainUnattached) { if (getCurrentStorageItem().getRole().isDataDomain()) { getBackup().setIsAvailable(true); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } } else if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); } }
Source:
private List<SessionDataDto> getAllWithMetaData(int start, int length) { System.out.println(start + " - " + length); @SuppressWarnings("unchecked") List<SessionData> sessionDataList = (List<SessionData>) entityManager.createQuery("select sd from SessionData as sd order by sd.startTime asc").setFirstResult(start).setMaxResults(length).getResultList(); if (sessionDataList.isEmpty()) { return Collections.EMPTY_LIST; } Map<Long, String> userCommentMap = Collections.EMPTY_MAP; List<Object[]> userComments = entityManager.createQuery( "select smd.sessionData.id, smd.userComment from SessionMetaDataEntity as smd where smd.sessionData in (:sessionDataList)") .setParameter("sessionDataList", sessionDataList) .getResultList(); if (!userComments.isEmpty()) { userCommentMap = new HashMap<Long, String>(userComments.size()); for (Object[] objects : userComments) { userCommentMap.put((Long)objects[0], (String)objects[1]); } } List<SessionDataDto> sessionDataDtoList = new ArrayList<SessionDataDto>(sessionDataList.size()); for (SessionData sessionData : sessionDataList) { sessionDataDtoList.add(new SessionDataDto( sessionData.getId(), sessionData.getSessionId(), dateFormatter.format(sessionData.getStartTime()), dateFormatter.format(sessionData.getEndTime()), sessionData.getActiveKernels(), sessionData.getTaskExecuted(), sessionData.getTaskFailed(), HTMLFormatter.format(sessionData.getComment()), userCommentMap.get(sessionData.getId())) ); } return sessionDataDtoList; }

Target:
private List<SessionDataDto> getAllWithMetaData(int start, int length) { @SuppressWarnings("unchecked") List<SessionData> sessionDataList = (List<SessionData>) entityManager.createQuery("select sd from SessionData as sd order by sd.startTime asc").setFirstResult(start).setMaxResults(length).getResultList(); if (sessionDataList.isEmpty()) { return Collections.EMPTY_LIST; } Map<Long, String> userCommentMap = Collections.EMPTY_MAP; List<Object[]> userComments = entityManager.createQuery( "select smd.sessionData.id, smd.userComment from SessionMetaDataEntity as smd where smd.sessionData in (:sessionDataList)") .setParameter("sessionDataList", sessionDataList) .getResultList(); if (!userComments.isEmpty()) { userCommentMap = new HashMap<Long, String>(userComments.size()); for (Object[] objects : userComments) { userCommentMap.put((Long)objects[0], (String)objects[1]); } } List<SessionDataDto> sessionDataDtoList = new ArrayList<SessionDataDto>(sessionDataList.size()); for (SessionData sessionData : sessionDataList) { sessionDataDtoList.add(createSessionDataDto(sessionData, userCommentMap.get(sessionData.getId()))); } return sessionDataDtoList; }
Source:
public final void render(float delta) { Gdx.gl.glClearColor(0, 132 / 255f, 197 / 255f, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); cBatch.begin(); cBatch.draw(cBackground, 0, 0); cBatch.end(); cStage.act(); cStage.draw(); }

Target:
public void render(float delta) { final float red = 0f; final float green = 132 / 255f; final float blue = 197 / 255f; final float alpha = 0f; Gdx.gl.glClearColor(red, green, blue, alpha); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); cBatch.begin(); cBatch.draw(cBackground, 0, 0); cBatch.end(); cStage.act(); cStage.draw(); }
Source:
public void setUp() throws Exception { super.setUp(); TestUtil.createTable(con, "updateable", "id int primary key, name text, notselected text, ts timestamp with time zone, intarr int[]"); TestUtil.createTable(con, "second", "id1 int primary key, name1 text"); TestUtil.createTable(con, "serialtable", "gen_id serial primary key, name text"); TestUtil.createTable(con, "compositepktable", "gen_id serial, dec_id serial, name text"); TestUtil.execute( "alter sequence compositepktable_dec_id_seq increment by 10; alter sequence compositepktable_dec_id_seq restart with 10", con); TestUtil.execute( "alter table compositepktable add primary key ( gen_id, dec_id )", con); TestUtil.createTable(con, "stream", "id int primary key, asi text, chr text, bin bytea"); TestUtil.createTable(con, "multicol", "id1 int not null, id2 int not null, val text"); TestUtil.createTable(con, "booltable", "id int not null primary key, b boolean default false"); TestUtil.execute( "insert into booltable (id) values (1)", con); Statement st2 = con.createStatement(); st2.execute("ALTER TABLE multicol ADD CONSTRAINT multicol_pk PRIMARY KEY (id1, id2)"); st2.execute("insert into second values (1,'anyvalue' )"); st2.close(); }

Target:
public void setUp() throws Exception { super.setUp(); TestUtil.createTable(con, "updateable", "id int primary key, name text, notselected text, ts timestamp with time zone, intarr int[]"); TestUtil.createTable(con, "second", "id1 int primary key, name1 text"); TestUtil.createTable(con, "serialtable", "gen_id serial primary key, name text"); TestUtil.createTable(con, "compositepktable", "gen_id serial, name text, dec_id serial"); TestUtil.execute( "alter sequence compositepktable_dec_id_seq increment by 10; alter sequence compositepktable_dec_id_seq restart with 10", con); TestUtil.execute( "alter table compositepktable add primary key ( gen_id, dec_id )", con); TestUtil.createTable(con, "stream", "id int primary key, asi text, chr text, bin bytea"); TestUtil.createTable(con, "multicol", "id1 int not null, id2 int not null, val text"); TestUtil.createTable(con, "booltable", "id int not null primary key, b boolean default false"); TestUtil.execute( "insert into booltable (id) values (1)", con); Statement st2 = con.createStatement(); st2.execute("ALTER TABLE multicol ADD CONSTRAINT multicol_pk PRIMARY KEY (id1, id2)"); st2.execute("insert into second values (1,'anyvalue' )"); st2.close(); }
Source:
private void excludeSingleTag(PostDiscoveryFilter filter) { assertTrue(filter.apply(classWithTag1).excluded()); assertTrue(filter.apply(classWithTag1AndSurroundingWhitespace).excluded()); assertTrue(filter.apply(classWithBothTags).excluded()); assertThat(filter.apply(classWithTag1).getReason().get()).contains( "Test excluded Because it contains tags: [tag1]"); assertThat(filter.apply(classWithTag1AndSurroundingWhitespace).getReason().get()).contains( "Test excluded Because it contains tags: [tag1]"); assertThat(filter.apply(classWithBothTags).getReason().get()).contains( "Test excluded Because it contains tags: [tag1,tag2]"); assertTrue(filter.apply(classWithTag2).included()); assertTrue(filter.apply(classWithDifferentTags).included()); assertTrue(filter.apply(classWithNoTags).included()); assertThat(filter.apply(classWithTag2).getReason().get()).contains( "Test included Because it contains tags: [tag2]"); assertThat(filter.apply(classWithDifferentTags).getReason().get()).contains( "Test included Because it contains tags: [foo,bar]"); assertThat(filter.apply(classWithNoTags).getReason().get()).contains( "Test included Because it contains tags: []"); }

Target:
private void excludeSingleTag(PostDiscoveryFilter filter) { assertTrue(filter.apply(classWithTag1).excluded()); assertTrue(filter.apply(classWithTag1AndSurroundingWhitespace).excluded()); assertTrue(filter.apply(classWithBothTags).excluded()); assertReason(filter.apply(classWithTag1), "Test excluded Because it satisfy expression(s): [tag1]"); assertReason(filter.apply(classWithTag1AndSurroundingWhitespace), "Test excluded Because it satisfy expression(s): [tag1]"); assertReason(filter.apply(classWithBothTags), "Test excluded Because it satisfy expression(s): [tag1]"); assertTrue(filter.apply(classWithTag2).included()); assertTrue(filter.apply(classWithDifferentTags).included()); assertTrue(filter.apply(classWithNoTags).included()); assertReason(filter.apply(classWithTag2), "Test included Because it does not satisfy expression(s): [tag1]"); assertReason(filter.apply(classWithDifferentTags), "Test included Because it does not satisfy expression(s): [tag1]"); assertReason(filter.apply(classWithNoTags), "Test included Because it does not satisfy expression(s): [tag1]"); }
Source:
private void execute(IExecution<DB> execution, boolean asTransaction) { query( db -> { execution.execute(db); return Optional.empty(); }, asTransaction ); }

Target:
private void execute(IExecution<DB> execution, boolean asTransaction) { query( db -> { execution.execute(db); return null; }, asTransaction ); }
Source:
private Agency findOrCreateAuthority(Line line) { String groupRef = line.getRepresentedByGroupRef().getRef(); Network network = netexIndex.lookupNetworkForLine(groupRef); if(network != null) { String orgRef = network.getTransportOrganisationRef().getValue().getRef(); Agency agency = agenciesById.get(orgRef); if(agency != null) return agency; } LOG.warn("No authority found for " + line.getId()); Agency agency = agenciesById.get(authorityMapper.dummyAgencyId()); if (agency == null) { agency = authorityMapper.createDummyAgency(); agenciesById.add(agency); } return agency; }

Target:
private Agency findOrCreateAuthority(Line line) { String groupRef = line.getRepresentedByGroupRef().getRef(); Network network = netexIndex.lookupNetworkForLine(groupRef); if(network != null) { String orgRef = network.getTransportOrganisationRef().getValue().getRef(); Agency agency = agenciesById.get(orgRef); if(agency != null) return agency; } return createOrGetDummyAgency(line); }
Source:
public void testPredicate() throws Exception { MockWebServer server = mockWebServer(); byte[] payloadInProcess = payloadFromResource("/datacenter/datacenter-state-inprocess.xml"); byte[] payloadAvailable = payloadFromResource("/datacenter/datacenter-state.xml"); server.enqueue(new MockResponse().setBody(payloadInProcess)); server.enqueue(new MockResponse().setBody(payloadInProcess)); server.enqueue(new MockResponse().setBody(payloadInProcess)); server.enqueue(new MockResponse().setBody(payloadAvailable)); server.enqueue(new MockResponse().setBody(payloadAvailable)); ProfitBricksApi pbApi = api(server.getUrl(rootUrl)); Predicate<String> waitUntilAvailable = Predicates2.retry( new ProvisioningStatusPollingPredicate(pbApi, ProvisioningStatusAware.DATACENTER, ProvisioningState.AVAILABLE), 30l, 1l, TimeUnit.SECONDS); String id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; try { waitUntilAvailable.apply(id); ProvisioningState finalState = pbApi.dataCenterApi().getDataCenterState(id); assertEquals(finalState, ProvisioningState.AVAILABLE); } finally { pbApi.close(); server.shutdown(); } }

Target:
public void testPredicate() throws Exception { MockWebServer server = mockWebServer(); byte[] payloadInProcess = payloadFromResource("/datacenter/datacenter-state-inprocess.xml"); byte[] payloadAvailable = payloadFromResource("/datacenter/datacenter-state.xml"); server.enqueue(new MockResponse().setBody(payloadInProcess)); server.enqueue(new MockResponse().setBody(payloadInProcess)); server.enqueue(new MockResponse().setBody(payloadInProcess)); server.enqueue(new MockResponse().setBody(payloadAvailable)); server.enqueue(new MockResponse().setBody(payloadAvailable)); ProfitBricksApi pbApi = api(server.getUrl(rootUrl)); Predicate<String> waitUntilAvailable = Predicates2.retry( new ProvisioningStatusPollingPredicate(pbApi, ProvisioningStatusAware.DATACENTER, ProvisioningState.AVAILABLE), 30l, 1l, TimeUnit.SECONDS); String id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; try { waitUntilAvailable.apply(id); ProvisioningState finalState = pbApi.dataCenterApi().getDataCenterState(id); assertRequestHasCommonProperties(server.takeRequest()); assertEquals(finalState, ProvisioningState.AVAILABLE); } finally { pbApi.close(); server.shutdown(); } }
Source:
private Value(DoubleAdder count, DoubleAdder sum, List<Double> quantiles, TimeWindowQuantiles quantileValues) { this.count = count.sum(); this.sum = sum.sum(); this.min = quantileValues == null ? Double.NaN : quantileValues.getMin(); this.max = quantileValues == null ? Double.NaN : quantileValues.getMax(); this.quantiles = Collections.unmodifiableSortedMap(snapshot(quantiles, quantileValues)); }

Target:
private Value(DoubleAdder count, DoubleAdder sum, List<Double> quantiles, TimeWindowQuantiles quantileValues) { this.count = count.sum(); this.sum = sum.sum(); this.quantiles = Collections.unmodifiableSortedMap(snapshot(quantiles, quantileValues)); }
Source:
public void start() { IResourceRegistry registry = new ResourceRegistry(); OseeTemplateTokens.register(registry); singletons.add(new AgileEndpointImpl(atsServer)); singletons.add(new AgileTeamEndpointImpl(atsServer)); singletons.add(new VersionResource(atsServer)); singletons.add(new TeamResource(atsServer)); singletons.add(new ProgramResource(atsServer)); singletons.add(new ActionableItemResource(atsServer)); singletons.add(new ActionResource(atsServer, orcsApi)); singletons.add(new StateResource(atsServer)); singletons.add(new ConvertResource(atsServer)); singletons.add(new CpaResource(orcsApi, atsServer, cpaRegistry)); singletons.add(new UserResource(atsServer.getUserService())); singletons.add(new AtsEndpointImpl(atsServer, logger, registry, cpaRegistry)); singletons.add(new ActionUiResource(atsServer, logger)); logger.info("ATS - Application started - %s", System.getProperty("OseeApplicationServer")); }

Target:
public void start() { IResourceRegistry registry = new ResourceRegistry(); OseeTemplateTokens.register(registry); singletons.add(new AgileEndpointImpl(atsServer)); singletons.add(new AgileTeamEndpointImpl(atsServer)); singletons.add(new VersionResource(atsServer)); singletons.add(new TeamResource(atsServer)); singletons.add(new ProgramResource(atsServer)); singletons.add(new ActionableItemResource(atsServer)); singletons.add(new ActionResource(atsServer, orcsApi)); singletons.add(new StateResource(atsServer)); singletons.add(new ConvertResource(atsServer)); singletons.add(new CpaResource(orcsApi, atsServer, cpaRegistry)); singletons.add(new UserResource(atsServer.getUserService())); singletons.add(new AtsEndpointImpl(atsServer, logger, registry, cpaRegistry)); singletons.add(new ActionUiResource(atsServer, logger)); }
Source:
private void releaseSegment(int segmentId){ activeSegments.remove(segmentId); if (segmentsToRelease.contains(segmentId)){ doSleepFor(DEFAULT_BACKOFF_TIME_MILLIS * 2); segmentsToRelease.remove(segmentId); } }

Target:
public void releaseSegment(int segmentId) { releaseSegment(segmentId, tokenClaimInterval * 2, MILLISECONDS); }
Source:
public static void addPrettyPathToModel(FileModel fileModel, GraphContext context) { if (fileModel == null) { return; } ArrayList<String> types = fileModel.asVertex().getProperty(WindupVertexFrame.TYPE_PROP); if (types.contains(JavaClassFileModel.TYPE)) { JavaClassFileModel jcfm = ((JavaClassFileModel) fileModel); jcfm.setCachedPrettyPath(jcfm.getPrettyPathWithinProject(true)); } else if (types.contains(JavaSourceFileModel.TYPE)) { JavaSourceFileModel jsfm = context.getFramed().frame(fileModel.asVertex(), JavaSourceFileModel.class); jsfm.setCachedPrettyPath(jsfm.getPrettyPathWithinProject(true)); } else if (types.contains(ReportResourceFileModel.TYPE)) { ReportResourceFileModel rrfm = (ReportResourceFileModel)fileModel; rrfm.setCachedPrettyPath(rrfm.getPrettyPathWithinProject(false)); } else { fileModel.setCachedPrettyPath(fileModel.getPrettyPathWithinProject(false)); } }

Target:
public static void addPrettyPathToModel(FileModel fileModel, GraphContext context) { if (fileModel == null) { return; } ArrayList<String> types = fileModel.asVertex().getProperty(WindupVertexFrame.TYPE_PROP); if (types.contains(JavaClassFileModel.TYPE)) { JavaClassFileModel jcfm = ((JavaClassFileModel) fileModel); jcfm.setCachedPrettyPath(jcfm.getPrettyPathWithinProject(true)); } else if (types.contains(JavaSourceFileModel.TYPE)) { JavaSourceFileModel jsfm = ((JavaSourceFileModel)fileModel); jsfm.setCachedPrettyPath(jsfm.getPrettyPathWithinProject(true)); } else if (types.contains(ReportResourceFileModel.TYPE)) { ReportResourceFileModel rrfm = (ReportResourceFileModel)fileModel; rrfm.setCachedPrettyPath(rrfm.getPrettyPathWithinProject(false)); } else { fileModel.setCachedPrettyPath(fileModel.getPrettyPathWithinProject(false)); } }
Source:
public void before() throws Throwable { try (Connection connection = DriverManager.getConnection(pgUrl, pgUser, "")) { try(Statement statement = connection.createStatement()){ statement.execute("DROP TABLE IF EXISTS ordered_entry_index"); statement.execute("CREATE TABLE ordered_entry_index (SERIAL_NUMBER INTEGER PRIMARY KEY, ENTRY JSONB, leaf_input varchar)"); statement.execute("DROP TABLE IF EXISTS total_entries"); statement.execute("CREATE TABLE IF NOT EXISTS total_entries (count INTEGER, last_updated TIMESTAMP WITHOUT TIME ZONE DEFAULT now())"); statement.execute("INSERT INTO TOTAL_ENTRIES(COUNT) VALUES(0)"); statement.execute("DROP TABLE IF EXISTS CURRENT_KEYS"); statement.execute("CREATE TABLE CURRENT_KEYS (SERIAL_NUMBER INTEGER PRIMARY KEY, KEY VARCHAR UNIQUE)"); statement.execute("DROP TABLE IF EXISTS TOTAL_RECORDS"); statement.execute("CREATE TABLE TOTAL_RECORDS (COUNT INTEGER)"); statement.execute("INSERT INTO TOTAL_RECORDS(COUNT) VALUES(0)"); } } }

Target:
public void before() throws Throwable { try (Connection connection = DriverManager.getConnection(pgUrl, pgUser, "")) { try(Statement statement = connection.createStatement()){ statement.execute("DROP TABLE IF EXISTS ordered_entry_index"); statement.execute("CREATE TABLE ordered_entry_index (SERIAL_NUMBER INTEGER PRIMARY KEY, ENTRY JSONB)"); statement.execute("DROP TABLE IF EXISTS total_entries"); statement.execute("CREATE TABLE IF NOT EXISTS total_entries (count INTEGER, last_updated TIMESTAMP WITHOUT TIME ZONE DEFAULT now())"); statement.execute("INSERT INTO TOTAL_ENTRIES(COUNT) VALUES(0)"); statement.execute("DROP TABLE IF EXISTS CURRENT_KEYS"); statement.execute("CREATE TABLE CURRENT_KEYS (SERIAL_NUMBER INTEGER PRIMARY KEY, KEY VARCHAR UNIQUE)"); statement.execute("DROP TABLE IF EXISTS TOTAL_RECORDS"); statement.execute("CREATE TABLE TOTAL_RECORDS (COUNT INTEGER)"); statement.execute("INSERT INTO TOTAL_RECORDS(COUNT) VALUES(0)"); } } }
Source:
public final boolean incrementToken() throws IOException { if (state != null) { restoreState(state); if (toCyrillic.length() > 0) { replayTerm(toCyrillic); if (toLatin.length() == 0) { state = null; } return true; } if (toLatin.length() > 0) { replayTerm(toLatin); state = null; return true; } assert false; } if (!input.incrementToken()) { return false; } boolean matchesCyrillicAndLatin = hasChars(LATIN_REG) && hasChars(CYR_REG); if (matchesCyrillicAndLatin) { toCyrillic.setLength(0); toCyrillic.append(termAtt); translationTable.replaceLatinToCyrillic(toCyrillic); toLatin.setLength(0); toLatin.append(termAtt); translationTable.replaceCyrillicToLatin(toLatin); if (!LATIN_REG.matcher(toCyrillic).find()) { state = captureState(); } else { toCyrillic.setLength(0); } if (!CYR_REG.matcher(toLatin).find()) { if (state == null) { state = captureState(); } } else { toLatin.setLength(0); } } return true; }

Target:
public final boolean incrementToken() throws IOException, IllegalStateException { if (state != null) { restoreState(state); if (scriptOne.length() > 0) { replayTerm(scriptOne); if (scriptTwo.length() == 0) { state = null; } return true; } if (scriptTwo.length() > 0) { replayTerm(scriptTwo); state = null; return true; } throw new IllegalStateException(); } if (!input.incrementToken()) { return false; } boolean matchesBothScripts = hasChars(TranslationTableDictionaries.LATIN_REG) && hasChars(TranslationTableDictionaries.CYR_REG); if (matchesBothScripts) { scriptOne.setLength(0); scriptOne.append(termAtt); translationTable.replaceScriptOne(scriptOne); scriptTwo.setLength(0); scriptTwo.append(termAtt); translationTable.replaceScriptTwo(scriptTwo); if (!TranslationTableDictionaries.LATIN_REG.matcher(scriptOne).find()) { state = captureState(); } else { scriptOne.setLength(0); } if (!TranslationTableDictionaries.CYR_REG.matcher(scriptTwo).find()) { if (state == null) { state = captureState(); } } else { scriptTwo.setLength(0); } } return true; }
Source:
public void testMethodsOnClassNoViolationsChecked() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ClassMemberImpliedModifierCheck.class); checkConfig.addAttribute("violateImpliedStaticOnNestedEnum", "false"); checkConfig.addAttribute("violateImpliedStaticOnNestedInterface", "false"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputClassMemberImpliedModifierOnClass.java"), expected); }

Target:
public void testMethodsOnClassNoViolationsChecked() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ClassMemberImpliedModifierCheck.class); checkConfig.addAttribute("violateImpliedStaticOnNestedEnum", "false"); checkConfig.addAttribute("violateImpliedStaticOnNestedInterface", "false"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputClassMemberImpliedModifierOnClassNoViolations.java"), expected); }
Source:
public StatusCheckerResult postExecutionCheck(ITestDevice device) throws DeviceNotAvailableException { errors = new ArrayList(); UserInfo postUserInfo = new UserInfo(device); CLog.d("postExecutionUsers=" + postUserInfo.format()); for (Integer preUser : preUserInfo.users) { if (!postUserInfo.runningUsers.containsKey(preUser)) { errors.add("User " + preUser + " no longer exists after test"); } } for (Integer postUser : postUserInfo.users) { if (!preUserInfo.runningUsers.containsKey(postUser)) { errors.add("User " + postUser + " was created during the test and not deleted"); } } if (preUserInfo.currentUser != postUserInfo.currentUser) { errors.add( "User " + preUserInfo.currentUser + " was the currentUser before, has changed to " + postUserInfo.currentUser); } for (Integer user : preUserInfo.users) { Boolean preUserRunning = preUserInfo.runningUsers.get(user); Boolean postUserRunning = postUserInfo.runningUsers.get(user); if (postUserRunning == null) { continue; } if (preUserRunning != postUserRunning) { errors.add( "User " + user + " was " + formatRunning(preUserRunning) + ", has changed to " + formatRunning(postUserRunning)); } } if (errors.size() > 0) { CLog.w("UserInfo has changed: " + String.join("; ", errors)); } if (!isTesting) { errors = null; } return new StatusCheckerResult(CheckStatus.SUCCESS); }

Target:
public StatusCheckerResult postExecutionCheck(ITestDevice device) throws DeviceNotAvailableException { errors = new ArrayList(); DeviceUserState postDeviceUserState = new DeviceUserState(device); CLog.d("postExecutionUsers=" + postDeviceUserState.toString()); ArrayList<Integer> removedUsers = mPreDeviceUserState.findRemovedUsers(postDeviceUserState); ArrayList<Integer> addedUsers = mPreDeviceUserState.findAddedUsers(postDeviceUserState); boolean currentUserChanged = mPreDeviceUserState.currentUserChanged(postDeviceUserState); ArrayList<UserRunningChanged> changedRunningUsers = mPreDeviceUserState.findRunningChanged(postDeviceUserState); for (Integer removedUser : removedUsers) { errors.add("User " + removedUser + " no longer exists after test"); } for (Integer addedUser : addedUsers) { errors.add("User " + addedUser + " was created during the test and not deleted"); } if (currentUserChanged) { errors.add( "User " + mPreDeviceUserState.currentUser + " was the currentUser before, has changed to " + postDeviceUserState.currentUser); } for (UserRunningChanged changedRunningUser : changedRunningUsers) { boolean wasRunning = changedRunningUser.wasRunning; errors.add( "User " + changedRunningUser.userID + " was " + formatRunning(wasRunning) + ", has changed to " + formatRunning(!wasRunning)); } if (errors.size() > 0) { CLog.w("DeviceUserState has changed: " + String.join("; ", errors)); } if (!isTesting) { errors = null; } return new StatusCheckerResult(CheckStatus.SUCCESS); }
Source:
public Map<String, Serializable> extractVariables(TaskContext taskContext, TaskResult taskResult, boolean useTaskVariables) throws IOException, ClassNotFoundException { Map<String, Serializable> variables = new HashMap<>(); if (taskContext.getInitializer().getJobVariables() != null) { for (JobVariable jobVariable : taskContext.getInitializer().getJobVariables().values()) { variables.put(jobVariable.getName(), jobVariable.getValue()); } } try { if (taskContext.getPreviousTasksResults() != null) { variables.putAll(extractPreviousTaskResultVariablesFromTaskContext(taskContext)); } if (useTaskVariables && taskContext.getInitializer().getTaskVariables() != null) { variables.putAll(addTaskVariablesAndBackupInheritedVariables(variables, taskContext.getInitializer() .getTaskVariables())); } if (taskResult != null && taskResult.getPropagatedVariables() != null) { variables.putAll(SerializationUtil.deserializeVariableMap(taskResult.getPropagatedVariables())); } } catch (IOException | ClassNotFoundException e) { logger.error("Could not deserialize variables", e); throw e; } variables.putAll(retrieveContextVariables(taskContext.getInitializer())); variables.put(SchedulerVars.PA_SCHEDULER_HOME.toString(), taskContext.getSchedulerHome()); return variables; }

Target:
public Map<String, Serializable> extractVariables(TaskContext taskContext, TaskResult taskResult, boolean useTaskVariables) throws IOException, ClassNotFoundException { Map<String, Serializable> variables = new HashMap<>(); if (taskContext.getInitializer().getJobVariables() != null) { for (JobVariable jobVariable : taskContext.getInitializer().getJobVariables().values()) { variables.put(jobVariable.getName(), jobVariable.getValue()); } } try { if (taskContext.getPreviousTasksResults() != null) { variables.putAll(extractPreviousTaskResultVariablesFromTaskContext(taskContext)); } if (useTaskVariables && taskContext.getInitializer().getTaskVariables() != null) { addTaskVariablesAndBackupInheritedVariables(variables, taskContext.getInitializer().getTaskVariables()); } if (taskResult != null && taskResult.getPropagatedVariables() != null) { variables.putAll(SerializationUtil.deserializeVariableMap(taskResult.getPropagatedVariables())); } } catch (IOException | ClassNotFoundException e) { logger.error("Could not deserialize variables", e); throw e; } variables.putAll(retrieveContextVariables(taskContext.getInitializer())); variables.put(SchedulerVars.PA_SCHEDULER_HOME.toString(), taskContext.getSchedulerHome()); return variables; }
Source:
public MessageLockContainer(Duration cleanupInterval) { cleanupOperation = Flux.interval(cleanupInterval).subscribe(e -> { if (lockTokens.isEmpty()) { return; } final Instant now = Instant.now(); final boolean removed = lockTokens.entrySet().removeIf(entry -> { final Instant expiration = entry.getValue(); return expiration != null && expiration.isBefore(now); }); if (removed) { logger.verbose("{}: Removed expired entries.", e); } }); }

Target:
public MessageLockContainer(Duration cleanupInterval) { cleanupOperation = Flux.interval(cleanupInterval).subscribe(e -> { if (lockTokens.isEmpty()) { return; } final Instant now = Instant.now(); lockTokens.entrySet().removeIf(entry -> { final Instant expiration = entry.getValue(); final boolean isExpired = expiration != null && expiration.isBefore(now); if (isExpired) { logger.info("lockToken[{}]. expiration[{}]. Removing expired entry. ", entry.getKey(), expiration, e); } return isExpired; }); }); }
Source:
void createConnectionsUponTopologyChange() { if(!m_topologyChangeAware || m_createConnectionUponTopoChangeInProgress.get()) { return; } m_createConnectionUponTopoChangeInProgress.set(true); ImmutableSet<Integer> unconnected = m_unconnectedHosts.get(); if (unconnected != null && !unconnected.isEmpty()) { m_unconnectedHosts.set(ImmutableSet.copyOf(new HashSet<Integer>())); for (Integer host : unconnected) { if (!isHostConnected(host)) { for (ClientStatusListenerExt csl : m_listeners) { if (csl instanceof ClientImpl.CSL) { ((ClientImpl.CSL)csl).createConnectionsUponTopologyChange(); m_createConnectionUponTopoChangeInProgress.set(false); return; } } } } } m_createConnectionUponTopoChangeInProgress.set(false); }

Target:
void createConnectionsUponTopologyChange() { if(!m_topologyChangeAware || m_createConnectionUponTopoChangeInProgress.get()) { return; } m_createConnectionUponTopoChangeInProgress.set(true); ImmutableSet<Integer> unconnected = m_unconnectedHosts.get(); if (unconnected != null && !unconnected.isEmpty()) { m_unconnectedHosts.compareAndSet(unconnected, ImmutableSet.copyOf(new HashSet<Integer>())); for (Integer host : unconnected) { if (!isHostConnected(host)) { for (ClientStatusListenerExt csl : m_listeners) { if (csl instanceof ClientImpl.InternalClientStatusListener) { ((ClientImpl.InternalClientStatusListener)csl).createConnectionsUponTopologyChange(); break; } } } } } m_createConnectionUponTopoChangeInProgress.set(false); }
Source:
public Pair<CursorStreamProviderFactory, CursorIteratorProviderFactory> getPairFor(CursorProviderFactory provider) { CursorStreamProviderFactory cursorStreamProviderFactory; CursorIteratorProviderFactory cursorIteratorProviderFactory; if (provider instanceof CursorIteratorProviderFactory) { cursorIteratorProviderFactory = (CursorIteratorProviderFactory) provider; if (provider instanceof NullCursorIteratorProviderFactory && muleContext.getConfiguration().isInheritIterableRepeatability()) { cursorStreamProviderFactory = forBytes().getNullCursorProviderFactory(); } else { cursorStreamProviderFactory = forBytes().getDefaultCursorProviderFactory(); } } else if (provider instanceof CursorStreamProviderFactory) { cursorStreamProviderFactory = (CursorStreamProviderFactory) provider; cursorIteratorProviderFactory = forObjects().getDefaultCursorProviderFactory(); } else { cursorStreamProviderFactory = forBytes().getDefaultCursorProviderFactory(); cursorIteratorProviderFactory = forObjects().getDefaultCursorProviderFactory(); } return new Pair<>(cursorStreamProviderFactory, cursorIteratorProviderFactory); }

Target:
public Pair<CursorStreamProviderFactory, CursorIteratorProviderFactory> getPairFor(CursorProviderFactory provider) { CursorStreamProviderFactory cursorStreamProviderFactory; CursorIteratorProviderFactory cursorIteratorProviderFactory; if (provider instanceof CursorIteratorProviderFactory) { cursorIteratorProviderFactory = (CursorIteratorProviderFactory) provider; if (provider instanceof NullCursorIteratorProviderFactory && muleContext.getConfiguration().isInheritIterableRepeatability()) { cursorStreamProviderFactory = forBytes().getNullCursorProviderFactory(); } else { cursorStreamProviderFactory = forBytes().getDefaultCursorProviderFactory(); } } else if (provider instanceof CursorStreamProviderFactory) { cursorStreamProviderFactory = (CursorStreamProviderFactory) provider; cursorIteratorProviderFactory = forObjects().getDefaultCursorProviderFactory(); } else { throw new IllegalArgumentException("The given cursor provider factory must be either a CursorStreamProviderFactory or a CursorIteratorProviderFactory"); } return new Pair<>(cursorStreamProviderFactory, cursorIteratorProviderFactory); }