auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void rollbackQuota(storage_pool storagePool, List<Guid> quotaList) { synchronized (storagePoolQuotaMap.get(storagePool.getId())) { if (storagePoolQuotaMap.get(storagePool.getId()) == null) { return; } Map<Guid, Quota> map = storagePoolQuotaMap.get(storagePool.getId()); for (Guid quotaId : quotaList) { map.remove(quotaId); } } }

Target:
public void rollbackQuota(storage_pool storagePool, List<Guid> quotaList) { lock.readLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePool.getId())) { return; } synchronized (storagePoolQuotaMap.get(storagePool.getId())) { Map<Guid, Quota> map = storagePoolQuotaMap.get(storagePool.getId()); for (Guid quotaId : quotaList) { map.remove(quotaId); } } } finally { lock.readLock().unlock(); } }
Source:
public void suspend() { log.trace("No-op suspend with state {}", state()); switch (state()) { case CREATED: case RUNNING: case SUSPENDED: transitionTo(State.SUSPENDED); break; case RESTORING: case CLOSED: throw new IllegalStateException("Illegal state " + state() + " while suspending standby task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while suspending standby task " + id); } }

Target:
public void suspend() { switch (state()) { case CREATED: case RUNNING: transitionTo(State.SUSPENDED); log.info("Suspended {}", state()); break; case SUSPENDED: log.info("Skip suspending since state is {}", state()); break; case RESTORING: case CLOSED: throw new IllegalStateException("Illegal state " + state() + " while suspending standby task " + id); default: throw new IllegalStateException("Unknown state " + state() + " while suspending standby task " + id); } }
Source:
public void review(PendingCertifiedProductDTO listing) { for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria() != null && cert.getMeetsCriteria().equals(Boolean.TRUE)) { if (cert.getTestStandards() != null && cert.getTestStandards().size() > 0) { Iterator<PendingCertificationResultTestStandardDTO> testStandardIter = cert.getTestStandards().iterator(); while (testStandardIter.hasNext()) { PendingCertificationResultTestStandardDTO testStandard = testStandardIter.next(); if (StringUtils.isEmpty(testStandard.getName())) { listing.getErrorMessages().add( msgUtil.getMessage("listing.criteria.missingTestStandardName", Util.formatCriteriaNumber(cert.getCriterion()))); } else { TestStandardDTO foundTestStandard = testStandardDao.getByNumberAndEdition(testStandard.getName(), listing.getCertificationEditionId()); if (foundTestStandard == null) { listing.getWarningMessages().add( msgUtil.getMessage("listing.criteria.testStandardNotFound", Util.formatCriteriaNumber(cert.getCriterion()), testStandard.getName(), listing.getCertificationEdition())); } } } } } } }

Target:
public void review(PendingCertifiedProductDTO listing) { listing.getCertificationCriterion().stream() .filter(cert -> (cert.getMeetsCriteria() != null && cert.getMeetsCriteria().equals(Boolean.TRUE))) .filter(cert -> (cert.getTestStandards() != null && cert.getTestStandards().size() > 0)) .forEach(certResult -> certResult.getTestStandards().stream() .forEach(testStandard -> reviewTestStandard(listing, certResult, testStandard))); }
Source:
private void cleanupProfileRegistry() { IProfileRegistry registry = ProvisioningUI.getDefaultUI().getSession().getProvisioningAgent() .getService(IProfileRegistry.class); long[] history = registry.listProfileTimestamps(toImportFrom.getProfileId()); for (long element : history) { if (element < toImportFrom.getTimestamp()) try { registry.removeProfile(toImportFrom.getProfileId(), element); } catch (ProvisionException e) { } } }

Target:
private void cleanupProfileRegistry() { IProfileRegistry registry = ProvisioningUI.getDefaultUI().getSession().getProvisioningAgent() .getService(IProfileRegistry.class); for (long timestamp : registry.listProfileTimestamps(toImportFrom.getProfileId())) { if (timestamp < toImportFrom.getTimestamp()) try { registry.removeProfile(toImportFrom.getProfileId(), timestamp); } catch (ProvisionException e) { } } }
Source:
public void extractParticipantsInfo(String studyOid, String siteOid, String accessToken, String customerUuid, UserAccountBean userAccountBean, String schema, JobDetail jobDetail,boolean incRelatedInfo) { CoreResources.setRequestSchema(schema); Study site = studyDao.findByOcOID(siteOid); Study study = studyDao.findByOcOID(studyOid); logger.info("Execute method asynchronously. " + Thread.currentThread().getName()); List<StudySubject> studySubjects = studySubjectDao.findAllByStudy(site.getStudyId()); List<OCUserDTO> userDTOS = new ArrayList<>(); sdf_fileName.setTimeZone(TimeZone.getTimeZone("GMT")); String fileName = study.getUniqueIdentifier() + DASH + study.getEnvType() + PARTICIPANT_ACCESS_CODE +"_"+ sdf_fileName.format(new Date())+".csv"; try { for (StudySubject studySubject : studySubjects) { if (studySubject.getStatus().equals(Status.AVAILABLE) || studySubject.getStatus().equals(Status.SIGNED)) { OCUserDTO userDTO = buildOcUserDTO(studySubject,incRelatedInfo); ParticipantAccessDTO participantAccessDTO = getAccessInfo(accessToken, siteOid, studySubject.getLabel(), customerUuid, userAccountBean); if (participantAccessDTO != null && participantAccessDTO.getAccessCode() != null && incRelatedInfo) { userDTO.setAccessCode(participantAccessDTO.getAccessCode()); } userDTOS.add(userDTO); } } writeToFile(userDTOS, studyOid, fileName); } catch (Exception e) { persistJobFailed(jobDetail, fileName); logger.error(" Access code Job Creation Failed "); } persistJobCompleted(jobDetail, fileName); }

Target:
public void extractParticipantsInfo(String studyOid, String siteOid, String accessToken, String customerUuid, UserAccountBean userAccountBean, String schema, JobDetail jobDetail,boolean incRelatedInfo) { CoreResources.setRequestSchema(schema); Study site = studyDao.findByOcOID(siteOid); Study study = studyDao.findByOcOID(studyOid); logger.info("Execute method asynchronously. " + Thread.currentThread().getName()); List<StudySubject> studySubjects = studySubjectDao.findAllByStudy(site.getStudyId()); List<OCUserDTO> userDTOS = new ArrayList<>(); sdf_fileName.setTimeZone(TimeZone.getTimeZone("GMT")); String fileName = study.getUniqueIdentifier() + DASH + study.getEnvType() + PARTICIPANT_ACCESS_CODE +"_"+ sdf_fileName.format(new Date())+".csv"; try { for (StudySubject studySubject : studySubjects) { if (!studySubject.getStatus().equals(Status.DELETED) && !studySubject.getStatus().equals(Status.AUTO_DELETED)) { if (studySubject.getStatus().equals(Status.AVAILABLE) || studySubject.getStatus().equals(Status.SIGNED)) { OCUserDTO userDTO = buildOcUserDTO(studySubject,incRelatedInfo); ParticipantAccessDTO participantAccessDTO = getAccessInfo(accessToken, siteOid, studySubject.getLabel(), customerUuid, userAccountBean,incRelatedInfo); if (participantAccessDTO != null && participantAccessDTO.getAccessCode() != null) { userDTO.setAccessCode(participantAccessDTO.getAccessCode()); } userDTOS.add(userDTO); } } } writeToFile(userDTOS, studyOid, fileName); } catch (Exception e) { persistJobFailed(jobDetail, fileName); logger.error(" Access code Job Creation Failed "); } persistJobCompleted(jobDetail, fileName); }
Source:
public Subscription subscribe() { return storIOContentResolver .observeChangesOfUri(Uri.parse(UserMeta.CONTENT_URI)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<Changes>() { @Override public void onError(Throwable e) { fail("Error occurred: " + e); } @Override public void onNext(Changes changes) { onNextObtained(changes); } @Override public void onCompleted() { } }); }

Target:
public Subscription subscribe() { return storIOContentResolver .observeChangesOfUri(Uri.parse(UserMeta.CONTENT_URI)) .subscribeOn(Schedulers.io()) .subscribe(new Action1<Changes>() { @Override public void call(Changes changes) { onNextObtained(changes); } }); }
Source:
public void testConsistentIdNotConfiguredWithPersistence() throws Exception { persistenceEnabled = true; Ignite ignite = startGrid(0); assertNull(ignite.configuration().getConsistentId()); assertTrue(UUID_PATTERN.matcher(ignite.cluster().localNode().consistentId().toString()).find()); info("Consistent id in that case: " + ignite.cluster().localNode().consistentId()); }

Target:
public void testConsistentIdNotConfiguredWithPersistence() throws Exception { persistenceEnabled = true; Ignite ignite = startGrid(0); assertNull(ignite.configuration().getConsistentId()); assertTrue(UUID_PATTERN.matcher(ignite.cluster().localNode().consistentId().toString()).find()); info("Consistent ID: " + ignite.cluster().localNode().consistentId()); }
Source:
public static void readFileToByteBuffer(FileChannel fileChannel, long offset, ByteBuffer buffer) throws IOException { int read = 0; int expectedRead = buffer.remaining(); while (buffer.hasRemaining()) { int sizeRead = fileChannel.read(buffer, offset); if (sizeRead == 0 || sizeRead == -1) { throw new IOException("Total size read " + read + " is less than the size to be read " + expectedRead); } read += sizeRead; offset += sizeRead; } }

Target:
public static void readFileToByteBuffer(FileChannel fileChannel, long offset, ByteBuffer buffer) throws IOException { int read = 0; int expectedRead = buffer.remaining(); while (buffer.hasRemaining()) { int sizeRead = fileChannel.read(buffer, offset); if (sizeRead == 0 || sizeRead == -1) { throw new IOException( "Total size read " + read + " is less than the size to be read " + expectedRead + ". sizeRead is " + sizeRead); } read += sizeRead; offset += sizeRead; } }
Source:
private Map<String, List<String>> freshMap() throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); new RqPrint(this.req).printBody(baos); final String body = new Utf8String(baos.toByteArray()).string(); final Map<String, List<String>> map = new HashMap<>(1); for (final String pair : body.split("&")) { if (pair.isEmpty()) { continue; } final String[] parts = pair.split("=", 2); if (parts.length < 2) { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "invalid form body pair: %s", pair ) ); } final String key = decode( new Utf8String(parts[0].trim()).englishLowerCase() ); if (!map.containsKey(key)) { map.put(key, new LinkedList<String>()); } map.get(key).add(decode(parts[1].trim())); } return map; }

Target:
private Map<String, List<String>> freshMap() throws IOException { final String body = new RqPrint(this.req).printBody(); final Map<String, List<String>> map = new HashMap<>(1); for (final String pair : body.split("&")) { if (pair.isEmpty()) { continue; } final String[] parts = pair.split("=", 2); if (parts.length < 2) { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "invalid form body pair: %s", pair ) ); } final String key = decode( new EnglishLowerCase(parts[0].trim()).string() ); if (!map.containsKey(key)) { map.put(key, new LinkedList<String>()); } map.get(key).add(decode(parts[1].trim())); } return map; }
Source:
private void primaryAction() { switch (getPrimaryAction()) { case UPDATE: showUpdateConfirmationDialogAndUploadPost(); return; case PUBLISH_NOW: showPublishConfirmationDialogAndPublishPost(); return; case SCHEDULE: uploadPost(false); return; case SUBMIT_FOR_REVIEW: case SAVE: uploadPost(false); break; } }

Target:
private void primaryAction() { switch (getPrimaryAction()) { case UPDATE: showUpdateConfirmationDialogAndUploadPost(); return; case PUBLISH_NOW: showPublishConfirmationDialogAndPublishPost(); return; case SCHEDULE: case SUBMIT_FOR_REVIEW: case SAVE: uploadPost(false); break; } }
Source:
public void activate() { seedWordsValid.addListener(seedWordsValidChangeListener); seedWordsTextArea.textProperty().addListener(seedWordsTextAreaChangeListener); restoreButton.disableProperty().bind(createBooleanBinding(() -> !seedWordsValid.get() || !seedWordsEdited.get(), seedWordsValid, seedWordsEdited)); restoreButton.setOnAction(e -> { new Popup().information(Res.get("account.seed.restore.info")) .closeButtonText(Res.get("shared.cancel")) .actionButtonText(Res.get("account.seed.restore.ok")) .onAction(this::onRestore) .show(); }); seedWordsTextArea.getStyleClass().remove("validation-error"); restoreDatePicker.getStyleClass().remove("validation-error"); new Popup().warning(Res.get("account.seed.backup.warning")) .onAction(() -> { activatePartTwo(); }) .actionButtonText(Res.get("shared.iUnderstand")) .useIUnderstandButton() .hideCloseButton() .show(); }

Target:
public void activate() { seedWordsValid.addListener(seedWordsValidChangeListener); seedWordsTextArea.textProperty().addListener(seedWordsTextAreaChangeListener); restoreButton.disableProperty().bind(createBooleanBinding(() -> !seedWordsValid.get() || !seedWordsEdited.get(), seedWordsValid, seedWordsEdited)); restoreButton.setOnAction(e -> { new Popup().information(Res.get("account.seed.restore.info")) .closeButtonText(Res.get("shared.cancel")) .actionButtonText(Res.get("account.seed.restore.ok")) .onAction(this::onRestore) .show(); }); seedWordsTextArea.getStyleClass().remove("validation-error"); restoreDatePicker.getStyleClass().remove("validation-error"); String key = "showBackupWarningAtSeedPhrase"; if (DontShowAgainLookup.showAgain(key)) { new Popup().warning(Res.get("account.seed.backup.warning")) .onAction(() -> { showSeedPhrase(); }) .actionButtonText(Res.get("shared.iUnderstand")) .useIUnderstandButton() .dontShowAgainId(key) .hideCloseButton() .show(); } else { showSeedPhrase(); } }
Source:
public String asSummaryString() { return name; }

Target:
public String asSummaryString() { return "JDBC:" + dialectName; }
Source:
public ClusterSearchShardsResponse getSearchShards(String index, ElasticsearchTableDescription tableDescription) { TransportClient client = clients.get(tableDescription.getClusterName()); verify(client != null, "TransportClient is null"); ClusterSearchShardsRequest request = new ClusterSearchShardsRequest(index); return client.admin() .cluster() .searchShards(request) .actionGet(timeout.toMillis()); }

Target:
public ClusterSearchShardsResponse getSearchShards(String index, ElasticsearchTableDescription tableDescription) { TransportClient client = clients.get(tableDescription.getClusterName()); verify(client != null, "client is null"); ClusterSearchShardsRequest request = new ClusterSearchShardsRequest(index); return client.admin() .cluster() .searchShards(request) .actionGet(timeout.toMillis()); }
Source:
protected void initListeners() { super.initListeners(); itemListAdapter.setSelectedListener(new OnClickGesture<LocalItem>() { @Override public void selected(LocalItem selectedItem) { FragmentManager fragmentManager; if (getParentFragment() == null) { fragmentManager = getFragmentManager(); } else { fragmentManager = getParentFragment().getFragmentManager(); } if (selectedItem instanceof PlaylistMetadataEntry) { final PlaylistMetadataEntry entry = ((PlaylistMetadataEntry) selectedItem); NavigationHelper.openLocalPlaylistFragment(fragmentManager, entry.uid, entry.name); } else if (selectedItem instanceof PlaylistRemoteEntity) { final PlaylistRemoteEntity entry = ((PlaylistRemoteEntity) selectedItem); NavigationHelper.openPlaylistFragment(fragmentManager, entry.getServiceId(), entry.getUrl(), entry.getName()); } } @Override public void held(LocalItem selectedItem) { if (selectedItem instanceof PlaylistMetadataEntry) { showLocalDeleteDialog((PlaylistMetadataEntry) selectedItem); } else if (selectedItem instanceof PlaylistRemoteEntity) { showRemoteDeleteDialog((PlaylistRemoteEntity) selectedItem); } } }); }

Target:
protected void initListeners() { super.initListeners(); itemListAdapter.setSelectedListener(new OnClickGesture<LocalItem>() { @Override public void selected(LocalItem selectedItem) { FragmentManager fragmentManager = getFM(); if (selectedItem instanceof PlaylistMetadataEntry) { final PlaylistMetadataEntry entry = ((PlaylistMetadataEntry) selectedItem); NavigationHelper.openLocalPlaylistFragment(fragmentManager, entry.uid, entry.name); } else if (selectedItem instanceof PlaylistRemoteEntity) { final PlaylistRemoteEntity entry = ((PlaylistRemoteEntity) selectedItem); NavigationHelper.openPlaylistFragment(fragmentManager, entry.getServiceId(), entry.getUrl(), entry.getName()); } } @Override public void held(LocalItem selectedItem) { if (selectedItem instanceof PlaylistMetadataEntry) { showLocalDeleteDialog((PlaylistMetadataEntry) selectedItem); } else if (selectedItem instanceof PlaylistRemoteEntity) { showRemoteDeleteDialog((PlaylistRemoteEntity) selectedItem); } } }); }
Source:
public int hashCode() { return value == null ? 0 : value.hashCode(); }

Target:
public int hashCode() { return value.hashCode(); }
Source:
public void addTeam() { String teamName = con.readLine(msgEnterTeamName); try { tm.begin(); teams.putIfAbsent(teamName, new Team(teamName)); tm.commit(); } catch (Exception e) { con.printf("Exception message %s", e.getMessage()); } }

Target:
public void addTeam() { String teamName = con.readLine(msgEnterTeamName); try { tm.begin(); teams.putIfAbsent(teamName, new Team(teamName)); } catch (Exception e) { markForRollback(e); } finally { endTransaction(); } }
Source:
public AgentInstances agents() { return agentInstances.allAgents(); }

Target:
AgentInstances agents() { return agentInstances; }
Source:
public String getClassName() { String className = ctClass.getName().replace('$', '.'); if (getPackageName() != null) { return className.substring(getPackageName().length() + 1, className.length()); } return className; }

Target:
public String getClassName() { String qualifiedName = getQualifiedName(); if(qualifiedName.contains(".")) { return qualifiedName.substring(qualifiedName.lastIndexOf(".") + 1, qualifiedName.length()); } else { return qualifiedName; } }
Source:
public String putBlob(BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream) throws CoordinatorException { try { logger.trace("putBlob. " + blobProperties); long startTimeInMs = System.currentTimeMillis(); if (blobProperties == null) { logger.info("Caller passed in null blobProperties."); throw new CoordinatorException("BlobProperties argument to put operation is null.", CoordinatorError.InvalidPutArgument); } if (userMetadata == null) { logger.info("Caller passed in null userMetadata."); throw new CoordinatorException("UserMetadata argument to put operation is null.", CoordinatorError.InvalidPutArgument); } if (blobStream == null) { logger.info("Caller passed in null blobStream."); throw new CoordinatorException("Blob stream argument to put operation is null.", CoordinatorError.InvalidPutArgument); } PartitionId partitionId = getPartitionForPut(); BlobId blobId = new BlobId(partitionId); PutOperation putOperation = new PutOperation(datacenterName, connectionPool, requesterPool, getOperationContext(), blobId, operationTimeoutMs, blobProperties, userMetadata, blobStream); putOperation.execute(); if (notificationSystem != null) { notificationSystem.onBlobCreated(clientId, blobId.toString(), blobProperties, userMetadata.array()); } coordinatorMetrics.putBlobOperationRate.mark(); coordinatorMetrics.putBlobOperationLatencyInMs.update(System.currentTimeMillis() - startTimeInMs); return blobId.toString(); } catch (CoordinatorException e) { coordinatorMetrics.countError(e.getErrorCode()); throw e; } }

Target:
public String putBlob(BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream) throws CoordinatorException { try { logger.trace("putBlob. " + blobProperties); long startTimeInMs = System.currentTimeMillis(); if (blobProperties == null) { logger.info("Caller passed in null blobProperties."); throw new CoordinatorException("BlobProperties argument to put operation is null.", CoordinatorError.InvalidPutArgument); } if (userMetadata == null) { logger.info("Caller passed in null userMetadata."); throw new CoordinatorException("UserMetadata argument to put operation is null.", CoordinatorError.InvalidPutArgument); } if (blobStream == null) { logger.info("Caller passed in null blobStream."); throw new CoordinatorException("Blob stream argument to put operation is null.", CoordinatorError.InvalidPutArgument); } PartitionId partitionId = getPartitionForPut(); BlobId blobId = new BlobId(partitionId); PutOperation putOperation = new PutOperation(datacenterName, connectionPool, requesterPool, getOperationContext(), blobId, operationTimeoutMs, blobProperties, userMetadata, blobStream); putOperation.execute(); if (notificationSystem != null) { notificationSystem.onBlobCreated(clientId, blobId.toString(), blobProperties, userMetadata.array()); } coordinatorMetrics.putBlobOperationRate.mark(); coordinatorMetrics.putBlobOperationLatencyInMs.update(System.currentTimeMillis() - startTimeInMs); return blobId.toString(); } catch (CoordinatorException e) { coordinatorMetrics.countError(CoordinatorMetrics.CoordinatorOperationType.PutBlob, e.getErrorCode()); throw e; } }
Source:
public DecisionTableAnalyzer getAnalyser( final GuidedDecisionTable52 table52 ) { if ( checkRunner == null ) { checkRunner = new CheckRunner() { @Override protected void doRun( final CancellableRepeatingCommand command ) { while ( command.execute() ) { } } }; } final UpdateManager updateManager = getUpdateManager( checkRunner, table52 ); final DecisionTableAnalyzer analyzer = new DecisionTableAnalyzer( new AnalysisReporter( mock( PlaceRequest.class ), mock( AnalysisReportScreen.class ) ) { @Override public void sendReport( final AnalysisReport report ) { analysisReport = report; } @Override public void sendStatus( final Status _status ) { status = _status; } }, table52, cache, updateManager, checkRunner ) { }; return analyzer; }

Target:
public DecisionTableAnalyzer getAnalyser( final GuidedDecisionTable52 table52 ) { final DecisionTableAnalyzerBuilder builder = getDecisionTableAnalyzerBuilder() .withPlaceRequest( mock( PlaceRequest.class ) ) .withReportScreen( mock( AnalysisReportScreen.class ) ) .withOracle( oracle ) .withModel( table52 ); return builder.build(); }
Source:
public String toString() { final String greaterThan = "> " + min; final String lessThan = "< " + max; final String between = min + " ~ " + max; if (clazz == Byte.class) if (max.equals(Byte.MAX_VALUE)) return greaterThan; else if (min.equals(Byte.MIN_VALUE)) return lessThan; else return between; if (clazz == Short.class) if (max.equals(Short.MAX_VALUE)) return greaterThan; else if (min.equals(Short.MIN_VALUE)) return lessThan; else return between; if (clazz == Integer.class) if (max.equals(Integer.MAX_VALUE)) return greaterThan; else if (min.equals(Integer.MIN_VALUE)) return lessThan; else return between; if (clazz == Long.class) if (max.equals(Long.MAX_VALUE)) return greaterThan; else if (min.equals(Long.MIN_VALUE)) return lessThan; else return between; else if (clazz == Float.class) if (max.equals(Float.MAX_VALUE)) return greaterThan; else if (min.equals(Float.MIN_VALUE)) return lessThan; else return between; else if (clazz == Double.class) if (max.equals(Double.MAX_VALUE)) return greaterThan; else if (min.equals(Double.MIN_VALUE)) return lessThan; else return between; return between; }

Target:
public String toString() { final String greaterThan = "> " + min; final String lessThan = "< " + max; final String between = min + " ~ " + max; if (clazz == Byte.class) if (max.equals(Byte.MAX_VALUE)) return greaterThan; else if (min.equals(Byte.MIN_VALUE)) return lessThan; else return between; if (clazz == Short.class) if (max.equals(Short.MAX_VALUE)) return greaterThan; else if (min.equals(Short.MIN_VALUE)) return lessThan; else return between; if (clazz == Integer.class) if (max.equals(Integer.MAX_VALUE)) return greaterThan; else if (min.equals(Integer.MIN_VALUE)) return lessThan; else return between; if (clazz == Long.class) if (max.equals(Long.MAX_VALUE)) return greaterThan; else if (min.equals(Long.MIN_VALUE)) return lessThan; else return between; else if (clazz == Float.class) if (max.equals(Float.MAX_VALUE)) return greaterThan; else if (min.equals(-Float.MAX_VALUE)) return lessThan; else return between; else if (clazz == Double.class) if (max.equals(Double.MAX_VALUE)) return greaterThan; else if (min.equals(-Double.MAX_VALUE)) return lessThan; else return between; return between; }
Source:
public boolean awaitVdsmResponse() { HostSetupNetworkPoller poller = new HostSetupNetworkPoller(); boolean success = poller.pollWithDefaultTimeout(host.getId()); if (success) { log.info("Engine managed to communicate with VDSM agent on host '{}' ('{}')", host.getName(), host.getId()); return true; } else { log.warn("Engine failed to communicate with VDSM agent on host '{}' ('{}')", host.getName(), host.getId()); return false; } }

Target:
public boolean awaitVdsmResponse() { HostSetupNetworkPoller poller = new HostSetupNetworkPoller(); boolean success = poller.pollWithDefaultTimeout(host.getId()); if (success) { log.info("Engine managed to communicate with VDSM agent on host '{}' ('{}')", host.getName(), host.getId()); } return success; }
Source:
public TSQueueLock(File queueDirectoryPath, Supplier<Pauser> pauser) { final File storeFilePath; if ("".equals(queueDirectoryPath.getPath())) { storeFilePath = new File(QUEUE_LOCK_FILE); } else { storeFilePath = new File(queueDirectoryPath, QUEUE_LOCK_FILE); queueDirectoryPath.mkdirs(); } TableStore tableStore = SingleTableBuilder.binary(storeFilePath).build(); this.lock = tableStore.acquireValueFor(LOCK_KEY); this.pauser = pauser.get(); }

Target:
public TSQueueLock(File queueDirectoryPath, Supplier<Pauser> pauser) { final File storeFilePath; if ("".equals(queueDirectoryPath.getPath())) { storeFilePath = new File(QUEUE_LOCK_FILE); } else { storeFilePath = new File(queueDirectoryPath, QUEUE_LOCK_FILE); queueDirectoryPath.mkdirs(); } TableStore tableStore = SingleTableBuilder.binary(storeFilePath).build(); this.lock = tableStore.doWithExclusiveLock(ts -> ts.acquireValueFor(LOCK_KEY)); this.pauser = pauser.get(); }
Source:
public RunningSplitInfo(long startTime, String threadId, Thread thread, PrioritizedSplitRunner split) { this.startTime = startTime; this.threadId = threadId; this.thread = thread; this.printed = false; this.split = split; }

Target:
public RunningSplitInfo(long startTime, String threadId, Thread thread, PrioritizedSplitRunner split) { this.startTime = startTime; this.threadId = threadId; this.thread = thread; this.split = split; this.printed = false; }
Source:
public CompositeEnvironmentRepositoryBeanFactoryPostProcessor compositeEnvironmentRepositoryBeanFactoryPostProcessor( Environment environment) { return new CompositeEnvironmentRepositoryBeanFactoryPostProcessor(environment); }

Target:
public static CompositeEnvironmentBeanFactoryPostProcessor compositeEnvironmentRepositoryBeanFactoryPostProcessor( Environment environment) { return new CompositeEnvironmentBeanFactoryPostProcessor(environment); }
Source:
public InstallBuiltinLfsCommand setRepository(Repository repo) { this.repository = repo; return this; }

Target:
public LfsInstallCommand setRepository(Repository repo) { this.repository = repo; return this; }
Source:
protected void createGoogleApiClient() { GoogleApiClient.Builder builder = new GoogleApiClient.Builder(this) .addApiIfAvailable(AppStateManager.API); if (PrefUtils.isSignedIn(this)) { builder.addApiIfAvailable(Plus.API, Plus.SCOPE_PLUS_LOGIN, Plus.SCOPE_PLUS_PROFILE) .addApiIfAvailable(Games.API, Games.SCOPE_GAMES); } else { builder.addApiIfAvailable(Plus.API) .addApiIfAvailable(Games.API); } mGoogleApiClient = builder.build(); }

Target:
protected GoogleApiClient createGoogleApiClient() { GoogleApiClient.Builder builder = new GoogleApiClient.Builder(this) .addApiIfAvailable(AppStateManager.API); if (PrefUtils.isSignedIn(this)) { builder.addApiIfAvailable(Plus.API, Plus.SCOPE_PLUS_LOGIN, Plus.SCOPE_PLUS_PROFILE) .addApiIfAvailable(Games.API, Games.SCOPE_GAMES); } else { builder.addApiIfAvailable(Plus.API) .addApiIfAvailable(Games.API); } return builder.build(); }
Source:
public List<Metric> getMetrics(List<String> expressions, long relativeTo) { requireNotDisposed(); SystemAssert.requireArgument(MetricReader.isValid(expressions), "Illegal metric expression found: " + expressions); MetricReader<Metric> reader = _metricReaderProviderForMetrics.get(); List<Metric> metrics = new ArrayList<>(expressions.size()); try { numDiscoveryResults = 0; numDiscoveryQueries = 0; for (String expression : expressions) { _logger.debug("Reading metric for expression {}", expression); metrics.addAll(reader.parse(expression, relativeTo, Metric.class)); expandedTimeSeriesRange = reader.getExpandedTimeSeriesRange(); queryTimeWindow = reader.getQueryTimeWindow(); numDiscoveryResults += getNumDiscoveryResults(); numDiscoveryQueries += getNumDiscoveryQueries(); } } catch (ParseException ex) { throw new SystemException("Failed to parse the given expression", ex); } catch(Exception ex) { _logger.error("Exception occured when evaluating metric expressions - {}" , Arrays.toString(expressions.toArray()), ExceptionUtils.getFullStackTrace(ex)); throw ex; } _monitorService.modifyCounter(Counter.DATAPOINT_READS, _getDatapointsAcrossMetrics(metrics), null); return metrics; }

Target:
public List<Metric> getMetrics(List<String> expressions, long relativeTo) { requireNotDisposed(); SystemAssert.requireArgument(MetricReader.isValid(expressions), "Illegal metric expression found: " + expressions); MetricReader<Metric> reader = _metricReaderProviderForMetrics.get(); List<Metric> metrics = new ArrayList<>(expressions.size()); try { numDiscoveryResults = 0; numDiscoveryQueries = 0; for (String expression : expressions) { _logger.debug("Reading metric for expression {}", expression); metrics.addAll(reader.parse(expression, relativeTo, Metric.class)); expandedTimeSeriesRange = reader.getExpandedTimeSeriesRange(); queryTimeWindow = reader.getQueryTimeWindow(); numDiscoveryResults += reader.getNumDiscoveryResults(); numDiscoveryQueries += reader.getNumDiscoveryQueries(); } } catch (ParseException ex) { throw new SystemException("Failed to parse the given expression", ex); } catch(Exception ex) { _logger.error("Exception occured when evaluating metric expressions - {}" , Arrays.toString(expressions.toArray()), ExceptionUtils.getFullStackTrace(ex)); throw ex; } _monitorService.modifyCounter(Counter.DATAPOINT_READS, _getDatapointsAcrossMetrics(metrics), null); return metrics; }
Source:
public void confirmLeadership(UUID leaderSessionID, String leaderAddress) { if (LOG.isDebugEnabled()) { LOG.debug( "Confirm leader session ID for leader {}.", leaderSessionID, leaderAddress); } Preconditions.checkNotNull(leaderSessionID); synchronized (lock) { if (hasLeadership(leaderSessionID)) { if (running) { confirmLeaderInformation(leaderSessionID, leaderAddress); leaderElectionDriver.writeLeaderInformation(confirmedLeaderSessionID, confirmedLeaderAddress); } else { LOG.debug("Ignoring the leader session Id confirmation, since the " + "LeaderElectionService has already been stopped.", leaderSessionID); } } else { if (!leaderSessionID.equals(this.issuedLeaderSessionID)) { LOG.debug("Receive an old confirmation call of leader session ID {}, " + "current issued session ID is {}", leaderSessionID, issuedLeaderSessionID); } else { LOG.warn("The leader session ID was confirmed even though the " + "corresponding JobManager was not elected as the leader.", leaderSessionID); } } } }

Target:
public void confirmLeadership(UUID leaderSessionID, String leaderAddress) { if (LOG.isDebugEnabled()) { LOG.debug( "Confirm leader session ID for leader {}.", leaderSessionID, leaderAddress); } checkNotNull(leaderSessionID); synchronized (lock) { if (hasLeadership(leaderSessionID)) { if (running) { confirmLeaderInformation(leaderSessionID, leaderAddress); } else { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring the leader session Id confirmation, since the " + "LeaderElectionService has already been stopped.", leaderSessionID); } } } else { if (!leaderSessionID.equals(this.issuedLeaderSessionID)) { if (LOG.isDebugEnabled()) { LOG.debug("Receive an old confirmation call of leader session ID {}, " + "current issued session ID is {}", leaderSessionID, issuedLeaderSessionID); } } else { LOG.warn("The leader session ID was confirmed even though the " + "corresponding JobManager was not elected as the leader.", leaderSessionID); } } } }
Source:
public Object getKey(Row value) throws Exception { if (this.unpickler == null) { unpickler = new Unpickler(); } Object key = value.getField(0); if (key instanceof byte[]) { Object unpickledKey = this.unpickler.loads((byte[]) key); return unpickledKey; } return null; }

Target:
public Object getKey(Row value) throws Exception { Object key = value.getField(0); if (!isPickledByteArray){ return key; } else { if (this.unpickler == null) { unpickler = new Unpickler(); } return this.unpickler.loads((byte[]) key); } }
Source:
public CompletionStage<Void> wrapEntryForWriting(InvocationContext ctx, Object key, int segment, boolean isOwner, boolean isRead) { CacheEntry contextEntry = getFromContext(ctx, key); CompletionStage<Void> returnedStage = CompletableFutures.completedNull(); if (contextEntry instanceof MVCCEntry) { } else if (contextEntry != null) { MVCCEntry mvccEntry = createWrappedEntry(key, contextEntry); ctx.putLookedUpEntry(key, mvccEntry); if (trace) log.tracef("Updated context entry %s -> %s", contextEntry, mvccEntry); } else { InternalCacheEntry ice = getFromContainer(key, segment); if (isOwner) { if (ice == null) { addWriteEntryToContext(ctx, NullCacheEntry.getInstance(), key, isRead); } else { CompletionStage<Boolean> expiredStage = handlePossibleExpiredEntry(ice, true); if (expiredStage != null) { returnedStage = expiredStage.thenApply(expired -> { if (expired == Boolean.FALSE) { addWriteEntryToContext(ctx, ice, key, isRead); } else { if (trace) { log.tracef("Entry retrieved for key %s was expired, returning null entry", key); } addWriteEntryToContext(ctx, NullCacheEntry.getInstance(), key, isRead); } return null; }); } else { addWriteEntryToContext(ctx, ice, key, isRead); } } } else if (isL1Enabled && ice != null && !ice.isL1Entry()) { addWriteEntryToContext(ctx, ice, key, isRead); } } return returnedStage; }

Target:
public CompletionStage<Void> wrapEntryForWriting(InvocationContext ctx, Object key, int segment, boolean isOwner, boolean isRead) { CacheEntry contextEntry = getFromContext(ctx, key); CompletionStage<Void> returnedStage = CompletableFutures.completedNull(); if (contextEntry instanceof MVCCEntry) { } else if (contextEntry != null) { MVCCEntry mvccEntry = createWrappedEntry(key, contextEntry); ctx.putLookedUpEntry(key, mvccEntry); if (trace) log.tracef("Updated context entry %s -> %s", contextEntry, mvccEntry); } else { InternalCacheEntry ice = getFromContainer(key, segment); if (isOwner) { if (ice == null) { addWriteEntryToContext(ctx, NullCacheEntry.getInstance(), key, isRead); } else { CompletionStage<Boolean> expiredStage = handlePossibleExpiredEntry(ice, true); if (expiredStage != null) { if (CompletionStages.isCompletedSuccessfully(expiredStage)) { Boolean expired = CompletionStages.join(expiredStage); handleWriteExpiredEntryContextAddition(expired, ctx, ice, key, isRead); } else { returnedStage = expiredStage.thenApply(expired -> { handleWriteExpiredEntryContextAddition(expired, ctx, ice, key, isRead); return null; }); } } else { addWriteEntryToContext(ctx, ice, key, isRead); } } } else if (isL1Enabled && ice != null && !ice.isL1Entry()) { addWriteEntryToContext(ctx, ice, key, isRead); } } return returnedStage; }
Source:
private void setAppLastOpenedDateIfNewer(User userEntity, UserDevice deviceEntity) { LocalDate currentDate = userEntity.getDateInUserTimezone(TimeUtil.utcNow()); LocalDate appLastOpenedDate = deviceEntity.getAppLastOpenedDate(); if (appLastOpenedDate.isBefore(currentDate)) { deviceEntity.setAppLastOpenedDateToNow(userEntity); } }

Target:
private void setAppLastOpenedDateIfNewer(User userEntity, UserDevice deviceEntity) { LocalDate today = userEntity.getDateInUserTimezone(TimeUtil.utcNow()); LocalDate appLastOpenedDate = deviceEntity.getAppLastOpenedDate(); if (appLastOpenedDate.isBefore(today)) { deviceEntity.setAppLastOpenedDateToNow(userEntity); } }
Source:
public void workingWithInstallers() { dashboardWorkspace.selectTabInWorspaceMenu(INSTALLERS); Assert.assertTrue(dashboardWorkspace.getInstallerState("Workspace API", "1.0.1")); Assert.assertFalse(dashboardWorkspace.getInstallerState("Workspace API", "1.0.0")); dashboardWorkspace.switchInstallerState("Workspace API", "1.0.1"); dashboardWorkspace.switchInstallerState("Workspace API", "1.0.0"); Assert.assertTrue(dashboardWorkspace.getInstallerState("Workspace API", "1.0.1")); Assert.assertFalse(dashboardWorkspace.getInstallerState("Workspace API", "1.0.0")); dashboardWorkspace.selectMachine("Workspace Installers", "dev-machine"); installers.forEach( (name, value) -> { dashboardWorkspace.checkInstallerExists(name); }); installers.forEach( (name, value) -> { Assert.assertEquals(dashboardWorkspace.getInstallerState(name), value); dashboardWorkspace.switchInstallerState(name); WaitUtils.sleepQuietly(1); }); clickOnSaveButton(); installers.forEach( (name, value) -> { dashboardWorkspace.switchInstallerState(name); loader.waitOnClosed(); }); clickOnSaveButton(); installers.forEach( (name, value) -> { Assert.assertEquals(dashboardWorkspace.getInstallerState(name), value); }); }

Target:
public void workingWithInstallers() { workspaceDetails.selectTabInWorkspaceMenu(INSTALLERS); assertTrue(workspaceInstallers.isInstallerStateTurnedOn("Workspace API", "1.0.1")); assertFalse(workspaceInstallers.isInstallerStateTurnedOn("Workspace API", "1.0.0")); assertTrue(workspaceInstallers.isInstallerStateNotChangeable("Workspace API", "1.0.1")); assertTrue(workspaceInstallers.isInstallerStateNotChangeable("Workspace API", "1.0.0")); workspaceMachines.selectMachine("Workspace Installers", "dev-machine"); installers.forEach( (name, value) -> { workspaceInstallers.checkInstallerExists(name); }); installers.forEach( (name, value) -> { Assert.assertEquals(workspaceInstallers.isInstallerStateTurnedOn(name), value); workspaceInstallers.switchInstallerState(name); WaitUtils.sleepQuietly(1); }); clickOnSaveButton(); installers.forEach( (name, value) -> { workspaceInstallers.switchInstallerState(name); loader.waitOnClosed(); }); clickOnSaveButton(); installers.forEach( (name, value) -> { Assert.assertEquals(workspaceInstallers.isInstallerStateTurnedOn(name), value); }); }
Source:
public <R, D> void registerView(String name, String desc, Class<R> rowCls, Supplier<Collection<D>> dataSupplier, Function<D, R> rowFunc) { SystemView sysView = new SystemViewAdapter<>(name, desc, rowCls, (SystemViewRowAttributeWalker<R>)walkers.get(rowCls), dataSupplier, rowFunc); SystemView<?> old = systemViews.putIfAbsent(name, sysView); assert old == null; notifyListeners(sysView, viewCreationLsnrs, log); }

Target:
public <R, D> void registerView(String name, String desc, Class<R> rowCls, Supplier<Collection<D>> dataSupplier, Function<D, R> rowFunc) { registerView0(name, new SystemViewAdapter<>(name, desc, rowCls, (SystemViewRowAttributeWalker<R>)walkers.get(rowCls), dataSupplier, rowFunc)); }
Source:
private String getNextGreaterString(String volumeName, String bucketName, String keyPrefix) { String nextPrefix = keyPrefix.substring(0, keyPrefix.length() - 1) + String.valueOf((char) (keyPrefix.charAt(keyPrefix.length() - 1) + 1)); return metadataManager.getOzoneKey(volumeName, bucketName, nextPrefix); }

Target:
private String getNextGreaterString(String volumeName, String bucketName, String keyPrefix) throws IOException { Preconditions.checkArgument(!Strings.isNullOrEmpty(keyPrefix), "Key prefix is null or empty"); CodecRegistry codecRegistry = ((RDBStore) metadataManager.getStore()).getCodecRegistry(); byte[] keyPrefixInBytes = codecRegistry.asRawData(keyPrefix); keyPrefixInBytes[keyPrefixInBytes.length - 1]++; String nextPrefix = codecRegistry.asObject(keyPrefixInBytes, String.class); return metadataManager.getOzoneKey(volumeName, bucketName, nextPrefix); }
Source:
protected Boolean doInBackground(String... strings) { String replayData = strings[0]; try { JSONObject jsonObject = new JSONObject(replayData); roomId = jsonObject.getString("id"); String postData = "log=" + jsonObject.getString("log") + "&id=" + jsonObject.getString("id"); URL url = new URL(REPLAY_EXPORT_URL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoInput(true); conn.setDoOutput(true); DataOutputStream outStream = new DataOutputStream(conn.getOutputStream()); outStream.writeBytes(postData); outStream.flush(); outStream.close(); InputStream inputStream = conn.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader((inputStream))); String output = bufferedReader.readLine(); inputStream.close(); if (output.equals("success")) { return true; } else { return false; } } catch (Exception e) { this.e = e; return false; } }

Target:
protected Boolean doInBackground(String... strings) { String replayData = strings[0]; try { JSONObject jsonObject = new JSONObject(replayData); roomId = jsonObject.getString("id"); String postData = "log=" + jsonObject.getString("log") + "&id=" + jsonObject.getString("id"); URL url = new URL(REPLAY_EXPORT_URL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoInput(true); conn.setDoOutput(true); DataOutputStream outStream = new DataOutputStream(conn.getOutputStream()); outStream.writeBytes(postData); outStream.flush(); outStream.close(); InputStream inputStream = conn.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader((inputStream))); String output = bufferedReader.readLine(); inputStream.close(); return output.equals("success"); } catch (Exception e) { this.e = e; return false; } }
Source:
public V remove (K key) { int loc = locateKey(key); if (loc == -1) { return null; } V oldValue = valueTable[loc]; while ((key = keyTable[loc + 1 & mask]) != null && (loc + 1 & mask) != place(key)) { keyTable[loc] = key; valueTable[loc] = valueTable[++loc & mask]; } keyTable[loc] = null; valueTable[loc] = null; --size; return oldValue; }

Target:
public V remove (K key) { int loc = locateKey(key); if (loc == -1) { return null; } V oldValue = valueTable[loc]; int nl = (loc + 1 & mask); while ((key = keyTable[nl]) != null && nl != place(key)) { keyTable[loc] = key; valueTable[loc] = valueTable[nl]; loc = nl; nl = loc + 1 & mask; } keyTable[loc] = null; valueTable[loc] = null; --size; return oldValue; }
Source:
public void setTheme(String themeId, boolean restore) { String osVersion = System.getProperty("os.version"); if (osVersion != null) { boolean found = false; for (Theme t : themes) { String osVersionList = t.getOsVersion(); if (osVersionList != null) { String[] osVersions = osVersionList.split(","); for (String osVersion2 : osVersions) { if (osVersion2 != null && osVersion.contains(osVersion2)) { String themeVersion = themeId + osVersionList; if (t.getId().equals(themeVersion)) { setTheme(t, restore); found = true; break; } } } } } if (found) { return; } } for (Theme t : themes) { if (t.getId().equals(themeId)) { setTheme(t, restore); break; } } }

Target:
public void setTheme(String themeId, boolean restore) { String osVersion = System.getProperty("os.version"); if (osVersion != null) { boolean found = false; for (Theme t : themes) { String osVersionList = t.getOsVersion(); if (osVersionList != null) { String[] osVersions = osVersionList.split(","); for (String osVersionFromTheme : osVersions) { if (osVersionFromTheme != null && osVersion.contains(osVersionFromTheme)) { String themeVersion = themeId + osVersionList; if (t.getId().equals(themeVersion)) { setTheme(t, restore); found = true; break; } } } } } if (found) { return; } } for (Theme t : themes) { if (t.getId().equals(themeId)) { setTheme(t, restore); break; } } }
Source:
public synchronized void close( PagedIndexInput input ) throws IOException { assert input.resources == this : String.format( "Closing input with unrelated resource tracker: " + "%s closed by %s", input, this ); if ( clones == null ) { return; } LinkedList<PagedIndexInput> localClones = this.clones; this.clones = null; IOException errorOnClose = null; for ( PagedIndexInput clone : localClones ) { try { clone.close(); } catch ( IOException e ) { if ( errorOnClose == null ) { errorOnClose = e; } else { errorOnClose.addSuppressed( e ); } } } try { input.cursor.close(); } finally { input.cursor = null; } pagedFile.close(); if ( errorOnClose != null ) { throw errorOnClose; } }

Target:
public synchronized void close( PagedIndexInput input ) throws IOException { assert input.resources == this : String.format( "Closing input with unrelated resource tracker: " + "%s closed by %s", input, this ); if ( closed ) { return; } closed = true; try { Throwable error; error = IOUtils.chainedClose( null, input.cursor ); error = IOUtils.chainedClose( error, pagedFile ); IOUtils.chainedCloseFinish( IOException.class, error ); } finally { input.cursor = null; } }
Source:
private void handleUri(Uri uri) { final Intent intent; final XmppUri xmppUri = new XmppUri(uri); final List<Jid> accounts = DatabaseBackend.getInstance(this).getAccountJids(); if (accounts.size() == 0) { intent = new Intent(getApplicationContext(), WelcomeActivity.class); WelcomeActivity.addInvitee(intent, xmppUri); startActivity(intent); return; } if (xmppUri.isAction(XmppUri.ACTION_MESSAGE)) { final Jid jid = xmppUri.getJid(); final String body = xmppUri.getBody(); if (jid != null) { intent = new Intent(getApplicationContext(), ShareViaAccountActivity.class); intent.putExtra(ShareViaAccountActivity.EXTRA_CONTACT, jid.toString()); intent.putExtra(ShareViaAccountActivity.EXTRA_BODY, body); } else { intent = new Intent(getApplicationContext(), ShareWithActivity.class); intent.setAction(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, body); } } else if (accounts.contains(xmppUri.getJid())) { final String name = xmppUri.getName(); intent = new Intent(getApplicationContext(), EditAccountActivity.class); intent.setAction(Intent.ACTION_VIEW); intent.putExtra("jid", xmppUri.getJid().toBareJid().toString()); if (name != null) intent.putExtra("name", xmppUri.getName().toString()); intent.setData(uri); } else { intent = new Intent(getApplicationContext(), StartConversationActivity.class); intent.setAction(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.setData(uri); } startActivity(intent); }

Target:
private void handleUri(Uri uri) { final Intent intent; final XmppUri xmppUri = new XmppUri(uri); final List<Jid> accounts = DatabaseBackend.getInstance(this).getAccountJids(); if (accounts.size() == 0) { intent = new Intent(getApplicationContext(), WelcomeActivity.class); WelcomeActivity.addInvitee(intent, xmppUri); startActivity(intent); return; } if (xmppUri.isAction(XmppUri.ACTION_MESSAGE)) { final Jid jid = xmppUri.getJid(); final String body = xmppUri.getBody(); if (jid != null) { intent = new Intent(getApplicationContext(), ShareViaAccountActivity.class); intent.putExtra(ShareViaAccountActivity.EXTRA_CONTACT, jid.toString()); intent.putExtra(ShareViaAccountActivity.EXTRA_BODY, body); } else { intent = new Intent(getApplicationContext(), ShareWithActivity.class); intent.setAction(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, body); } } else if (accounts.contains(xmppUri.getJid())) { intent = new Intent(getApplicationContext(), EditAccountActivity.class); intent.setAction(Intent.ACTION_VIEW); intent.putExtra("jid", xmppUri.getJid().toBareJid().toString()); intent.setData(uri); } else { intent = new Intent(getApplicationContext(), StartConversationActivity.class); intent.setAction(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.setData(uri); } startActivity(intent); }