auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected UriBuilder createAuthorizationUrl(AuthenticationRequest request) { final UriBuilder uriBuilder = UriBuilder.fromUri(getConfig().getAuthorizationUrl()) .queryParam(OAUTH2_PARAMETER_SCOPE, getConfig().getDefaultScope()) .queryParam(OAUTH2_PARAMETER_STATE, request.getState().getEncoded()) .queryParam(OAUTH2_PARAMETER_RESPONSE_TYPE, "code") .queryParam(OAUTH2_PARAMETER_CLIENT_ID, getConfig().getClientId()) .queryParam(OAUTH2_PARAMETER_REDIRECT_URI, request.getRedirectUri()); String loginHint = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.LOGIN_HINT_PARAM); if (getConfig().isLoginHint() && loginHint != null) { uriBuilder.queryParam(OIDCLoginProtocol.LOGIN_HINT_PARAM, loginHint); } String prompt = getConfig().getPrompt(); if (prompt == null || prompt.isEmpty()) { prompt = request.getAuthenticationSession().getClientNote(OAuth2Constants.PROMPT); } if (prompt != null) { uriBuilder.queryParam(OAuth2Constants.PROMPT, prompt); } String acr = request.getAuthenticationSession().getClientNote(OAuth2Constants.ACR_VALUES); if (acr != null) { uriBuilder.queryParam(OAuth2Constants.ACR_VALUES, acr); } String nonce = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.NONCE_PARAM); if (nonce == null || nonce.isEmpty()) { nonce = UUID.randomUUID().toString(); request.getAuthenticationSession().setClientNote(OIDCLoginProtocol.NONCE_PARAM, nonce); } if (nonce != null) { uriBuilder.queryParam(OIDCLoginProtocol.NONCE_PARAM, nonce); } return uriBuilder; }

Target:
protected UriBuilder createAuthorizationUrl(AuthenticationRequest request) { final UriBuilder uriBuilder = UriBuilder.fromUri(getConfig().getAuthorizationUrl()) .queryParam(OAUTH2_PARAMETER_SCOPE, getConfig().getDefaultScope()) .queryParam(OAUTH2_PARAMETER_STATE, request.getState().getEncoded()) .queryParam(OAUTH2_PARAMETER_RESPONSE_TYPE, "code") .queryParam(OAUTH2_PARAMETER_CLIENT_ID, getConfig().getClientId()) .queryParam(OAUTH2_PARAMETER_REDIRECT_URI, request.getRedirectUri()); String loginHint = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.LOGIN_HINT_PARAM); if (getConfig().isLoginHint() && loginHint != null) { uriBuilder.queryParam(OIDCLoginProtocol.LOGIN_HINT_PARAM, loginHint); } String prompt = getConfig().getPrompt(); if (prompt == null || prompt.isEmpty()) { prompt = request.getAuthenticationSession().getClientNote(OAuth2Constants.PROMPT); } if (prompt != null) { uriBuilder.queryParam(OAuth2Constants.PROMPT, prompt); } String acr = request.getAuthenticationSession().getClientNote(OAuth2Constants.ACR_VALUES); if (acr != null) { uriBuilder.queryParam(OAuth2Constants.ACR_VALUES, acr); } String nonce = request.getAuthenticationSession().getClientNote(OIDCLoginProtocol.NONCE_PARAM); if (nonce == null || nonce.isEmpty()) { nonce = UUID.randomUUID().toString(); request.getAuthenticationSession().setClientNote(OIDCLoginProtocol.NONCE_PARAM, nonce); } uriBuilder.queryParam(OIDCLoginProtocol.NONCE_PARAM, nonce); return uriBuilder; }
Source:
public void ecj() { final Label start = new Label(); final Label end = new Label(); final Label handler = new Label(); final Label handlerEnd = new Label(); m.visitTryCatchBlock(start, end, handler, null); m.visitTryCatchBlock(handler, handlerEnd, handler, null); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitFieldInsn(Opcodes.GETFIELD, "Target", "lock", "Ljava/lang/Object;"); m.visitInsn(Opcodes.DUP); m.visitVarInsn(Opcodes.ASTORE, 1); m.visitInsn(Opcodes.MONITORENTER); m.visitLabel(start); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitInsn(Opcodes.NOP); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(end); final Label exit = new Label(); m.visitJumpInsn(Opcodes.GOTO, exit); m.visitLabel(handler); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(handlerEnd); m.visitInsn(Opcodes.ATHROW); m.visitLabel(exit); m.visitInsn(Opcodes.RETURN); new SynchronizedFilter().filter(m, this); assertEquals(m.instructions.get(12), from); assertEquals(m.instructions.get(16), to); }

Target:
public void ecj() { final Label start = new Label(); final Label end = new Label(); final Label handler = new Label(); final Label handlerEnd = new Label(); m.visitTryCatchBlock(start, end, handler, null); m.visitTryCatchBlock(handler, handlerEnd, handler, null); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitFieldInsn(Opcodes.GETFIELD, "Target", "lock", "Ljava/lang/Object;"); m.visitInsn(Opcodes.DUP); m.visitVarInsn(Opcodes.ASTORE, 1); m.visitInsn(Opcodes.MONITORENTER); m.visitLabel(start); m.visitVarInsn(Opcodes.ALOAD, 0); m.visitInsn(Opcodes.NOP); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(end); final Label exit = new Label(); m.visitJumpInsn(Opcodes.GOTO, exit); m.visitLabel(handler); m.visitVarInsn(Opcodes.ALOAD, 1); m.visitInsn(Opcodes.MONITOREXIT); m.visitLabel(handlerEnd); m.visitInsn(Opcodes.ATHROW); m.visitLabel(exit); m.visitInsn(Opcodes.RETURN); filter.filter(m, this); assertEquals(handler.info, fromInclusive); assertEquals(((LabelNode) exit.info).getPrevious(), toInclusive); }
Source:
protected void executeQueryCommand() { List<? extends IVdcQueryable> returnValue = new ArrayList<IVdcQueryable>(); switch (getParameters().getSearchTypeValue()) { case VM: { returnValue = searchVmsFromDb(); break; } case DirectoryGroup: { returnValue = searchDirectoryGroups(); break; } case DirectoryUser: { returnValue = searchDirectoryUsers(); break; } case AuditLog: { returnValue = searchAuditLogEvents(); break; } case DBUser: { returnValue = UserGroupUtil.retrieveUserAdGroups(searchDbUsers()); break; } case DBGroup: { returnValue = searchDbGroups(); break; } case VDS: { returnValue = searchVDSsByDb(); break; } case VmTemplate: { returnValue = searchVMTemplates(); break; } case VmPools: { returnValue = searchVmPools(); break; } case Cluster: { returnValue = searchClusters(); break; } case StoragePool: { returnValue = searchStoragePool(); break; } case StorageDomain: { returnValue = searchStorageDomain(); break; } case Quota: { returnValue = searchQuota(); break; } case Disk: { returnValue = searchDisk(); break; } case GlusterVolume: { returnValue = searchGlusterVolumes(); break; } case Network: { returnValue = searchNetworks(); break; } case Provider: { returnValue = searchProviders(); break; } case InstanceType: { returnValue = searchInstanceTypes(); break; } case ImageType: { returnValue = searchVMTemplates(); break; } default: { log.error("Search object type not handled: {}", getParameters().getSearchTypeValue()); break; } } getQueryReturnValue().setReturnValue(returnValue); }

Target:
protected void executeQueryCommand() { List<? extends IVdcQueryable> returnValue = new ArrayList<IVdcQueryable>(); switch (getParameters().getSearchTypeValue()) { case VM: { returnValue = searchVmsFromDb(); break; } case DirectoryGroup: { returnValue = searchDirectoryGroups(); break; } case DirectoryUser: { returnValue = searchDirectoryUsers(); break; } case AuditLog: { returnValue = searchAuditLogEvents(); break; } case DBUser: { List<DbUser> users = searchDbUsers(); if (getParameters().getResolveGroups()) { UserGroupUtil.retrieveUserGroups(users); } returnValue = users; break; } case DBGroup: { returnValue = searchDbGroups(); break; } case VDS: { returnValue = searchVDSsByDb(); break; } case VmTemplate: { returnValue = searchVMTemplates(); break; } case VmPools: { returnValue = searchVmPools(); break; } case Cluster: { returnValue = searchClusters(); break; } case StoragePool: { returnValue = searchStoragePool(); break; } case StorageDomain: { returnValue = searchStorageDomain(); break; } case Quota: { returnValue = searchQuota(); break; } case Disk: { returnValue = searchDisk(); break; } case GlusterVolume: { returnValue = searchGlusterVolumes(); break; } case Network: { returnValue = searchNetworks(); break; } case Provider: { returnValue = searchProviders(); break; } case InstanceType: { returnValue = searchInstanceTypes(); break; } case ImageType: { returnValue = searchVMTemplates(); break; } default: { log.error("Search object type not handled: {}", getParameters().getSearchTypeValue()); break; } } getQueryReturnValue().setReturnValue(returnValue); }
Source:
protected boolean considerEvent(@NonNull ITmfEvent event) { return true; }

Target:
protected boolean considerEvent(@NonNull ITmfEvent event) { String ph = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); return (ph != null); }
Source:
public void setSelectedChapter(@NonNull Chapter chapter) { if (mSelectedChapter != null) { trackView(); } this.mSelectedChapter = chapter; }

Target:
public void setSelectedChapter(@NonNull Chapter chapter) { if (mSelectedChapter != null) { trackView(); } mSelectedChapter = chapter; }
Source:
private synchronized void loadSettings() { try (InputStream is = settingsFacade.getRawConfig(SETTINGS)) { String jsonText = IOUtils.toString(is); Gson gson = new Gson(); settings = gson.fromJson(jsonText, Settings.class); } catch (Exception e) { LOGGER.debug(e.toString()); throw new JsonIOException(e); } }

Target:
private synchronized void loadSettings() { try (InputStream is = settingsFacade.getRawConfig(SETTINGS)) { String jsonText = IOUtils.toString(is); Gson gson = new Gson(); settings = gson.fromJson(jsonText, Settings.class); } catch (Exception e) { throw new JsonIOException(e); } }
Source:
private QualityProfileDto dto(String key) { return new QualityProfileDto() { { setKey(key); } @Override public String toString() { return getKey(); } }; }

Target:
private QualityProfileDto dto(String key) { return new QualityProfileDto() { @Override public String toString() { return getKey(); } }.setKey(key); }
Source:
protected void executeCommand() { StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (actionReturnValue.getSucceeded() && proccessedDomains != null && proccessedDomains.contains(getStorageDomainId())) { runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); } setSucceeded(true); }

Target:
protected void executeCommand() { Guid storageDomainId = getStorageDomainId(); StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (actionReturnValue.getSucceeded() && proccessedDomains != null && proccessedDomains.contains(storageDomainId)) { runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); } log.info("OVFs update was ignored - nothing to update for storage domain '{}'", storageDomainId); setSucceeded(true); }
Source:
public StudentProfileAttributes getCopy() { return builder() .withGoogleId(googleId) .withShortName(shortName) .withEmail(email) .withInstitute(institute) .withGender(GenderType.other) .withNationality(nationality) .withMoreInfo(moreInfo) .withPictureKey(pictureKey) .withModifiedDate(modifiedDate) .build(); }

Target:
public StudentProfileAttributes getCopy() { return builder() .withGoogleId(googleId) .withShortName(shortName) .withEmail(email) .withInstitute(institute) .withGender(gender) .withNationality(nationality) .withMoreInfo(moreInfo) .withPictureKey(pictureKey) .withModifiedDate(modifiedDate) .build(); }
Source:
public Preferences() { gameTileSortingOrder = new SimpleObjectProperty<>(TilesSortingOrder.PLAYER_DES); chat = new ChatPrefs(); login = new LoginPrefs(); localization = new LocalizationPrefs(); lastGamePrefs = new LastGamePrefs(); mainWindow = new WindowPrefs(); forgedAlliance = new ForgedAlliancePrefs(); themeName = new SimpleStringProperty(DEFAULT_THEME_NAME); ignoredNotifications = new SimpleListProperty<>(observableArrayList()); notification = new NotificationsPrefs(); rememberLastTab = new SimpleBooleanProperty(true); ladder1v1 = new Ladder1v1Prefs(); gamesViewMode = new SimpleStringProperty(); news = new NewsPrefs(); developer = new DeveloperPrefs(); gameListSorting = new SimpleListProperty<>(observableArrayList()); vaultPrefs = new VaultPrefs(); unitDataBaseType = new SimpleObjectProperty<>(UnitDataBaseType.RACKOVER); storedCookies = new SimpleMapProperty<>(FXCollections.observableHashMap()); showPasswordProtectedGames = new SimpleBooleanProperty(true); showModdedGames = new SimpleBooleanProperty(true); disallowJoinsViaDiscord = new SimpleBooleanProperty(); showGameDetailsSidePane = new SimpleBooleanProperty(false); advancedIceLogEnabled = new SimpleBooleanProperty(false); prereleaseCheckEnabled = new SimpleBooleanProperty(false); cacheLifeTime = new SimpleIntegerProperty(30); }

Target:
public Preferences() { gameTileSortingOrder = new SimpleObjectProperty<>(TilesSortingOrder.PLAYER_DES); chat = new ChatPrefs(); login = new LoginPrefs(); generatorPrefs = new GeneratorPrefs(); localization = new LocalizationPrefs(); lastGamePrefs = new LastGamePrefs(); mainWindow = new WindowPrefs(); forgedAlliance = new ForgedAlliancePrefs(); themeName = new SimpleStringProperty(DEFAULT_THEME_NAME); ignoredNotifications = new SimpleListProperty<>(observableArrayList()); notification = new NotificationsPrefs(); ladder1v1 = new Ladder1v1Prefs(); gamesViewMode = new SimpleStringProperty(); news = new NewsPrefs(); developer = new DeveloperPrefs(); gameListSorting = new SimpleListProperty<>(observableArrayList()); vaultPrefs = new VaultPrefs(); unitDataBaseType = new SimpleObjectProperty<>(UnitDataBaseType.SPOOKY); storedCookies = new SimpleMapProperty<>(FXCollections.observableHashMap()); showPasswordProtectedGames = new SimpleBooleanProperty(true); showModdedGames = new SimpleBooleanProperty(true); disallowJoinsViaDiscord = new SimpleBooleanProperty(); showGameDetailsSidePane = new SimpleBooleanProperty(false); advancedIceLogEnabled = new SimpleBooleanProperty(false); prereleaseCheckEnabled = new SimpleBooleanProperty(false); cacheLifeTimeInDays = new SimpleIntegerProperty(30); gameDataCacheActivated = new SimpleBooleanProperty(false); }
Source:
public void beforeLogon(Project project) throws PersistenceException, LoginException { String productVersion = VersionUtils.getDisplayVersion(); if (GlobalServiceRegister.getDefault().isServiceRegistered(IInstalledPatchService.class)) { IInstalledPatchService pachService = (IInstalledPatchService) GlobalServiceRegister .getDefault().getService(IInstalledPatchService.class); if (pachService != null && pachService.isMonthlyPatch()) { String patchVersion = pachService.getLatestInstalledVersion(); if(patchVersion != null) { System.setProperty(VersionUtils.STUDIO_VERSION_PROP, patchVersion); productVersion = patchVersion; } } } if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) { IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault() .getService(IBrandingService.class); String version = brandingService.getFullProductName() + "-" + productVersion; if (!version.equals(project.getEmfProject().getProductVersion())) { updatePreferenceProjectVersion(project); } } }

Target:
public void beforeLogon(Project project) throws PersistenceException, LoginException { if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) { IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault() .getService(IBrandingService.class); String productVersion = VersionUtils.getDisplayVersion(); String version = brandingService.getFullProductName() + "-" + productVersion; if (!version.equals(project.getEmfProject().getProductVersion())) { updatePreferenceProjectVersion(project); } } }
Source:
public List<Metacard> getMetacardListByTag(String tagStr) { Filter filter = filterBuilder.attribute(Core.METACARD_TAGS).is().like().text(tagStr); return resultIterable( catalogFramework, new QueryRequestImpl( new QueryImpl( filter, 1, pageSize, new SortByImpl(Core.MODIFIED, SortOrder.DESCENDING), false, TimeUnit.SECONDS.toMillis(10)), false, null, additionalSort(new HashMap<>(), Core.ID, SortOrder.ASCENDING))) .stream() .filter(Objects::nonNull) .map(this::getMetacardFromResult) .filter(Objects::nonNull) .collect(Collectors.toList()); }

Target:
public List<Metacard> getMetacardListByTag(String tagStr) { Filter filter = filterBuilder.attribute(Core.METACARD_TAGS).is().like().text(tagStr); return resultIterable( catalogFramework, new QueryRequestImpl( new QueryImpl( filter, 1, pageSize, new SortByImpl(Core.MODIFIED, SortOrder.DESCENDING), false, TimeUnit.SECONDS.toMillis(10)), false, null, null)) .stream() .filter(Objects::nonNull) .map(Result::getMetacard) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
private boolean isInstructorPage(String actionName) { return actionName.toLowerCase().startsWith(Const.ActivityLog.PREFIX_INSTRUCTOR_PAGE) || Const.ActionURIs.INSTRUCTOR_FEEDBACK_STATS_PAGE.contains(actionName); }

Target:
private boolean isInstructorPage(String actionName) { return actionName.toLowerCase().startsWith(Const.ActivityLog.PREFIX_INSTRUCTOR_PAGE) || Const.ActionURIs.INSTRUCTOR_FEEDBACK_STATS_PAGE.contains(actionName) || Const.ActionURIs.INSTRUCTOR_COURSE_STATS_PAGE.contains(actionName); }
Source:
public boolean isNoexcept(boolean inCalledContext) { if (inCalledContext) { return EvalUtil.bindingIsNoexcept(getMember()); } else return true; }

Target:
public boolean isNoexcept(boolean inCalledContext) { if (!fOwnerEval.isNoexcept(inCalledContext)) return false; if (inCalledContext) { return EvalUtil.bindingIsNoexcept(getMember()); } else return true; }
Source:
final void onPrimaryError(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res) { assert res.error() != null; if (err == null) err = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible)."); Collection<KeyCacheObject> keys0 = res.failedKeys() != null ? res.failedKeys() : req.keys(); Collection<Object> keys = new ArrayList<>(keys0.size()); for (KeyCacheObject key : keys0) keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false)); err.add(keys, res.error(), req.topologyVersion()); }

Target:
final void onPrimaryError(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res) { assert res.error() != null; if (err == null) err = new CachePartialUpdateCheckedException("Failed to update keys (retry update if possible)."); Collection<KeyCacheObject> keys0 = res.failedKeys() != null ? res.failedKeys() : req.keys(); Collection<Object> keys = new ArrayList<>(keys0.size()); Collection<Object> failedToUnwrapKeys = null; Exception suppressedErr = null; for (KeyCacheObject key : keys0) { try { keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false)); } catch (BinaryInvalidTypeException e) { keys.add(cctx.toCacheKeyObject(key)); if (log.isDebugEnabled()) { if (failedToUnwrapKeys == null) failedToUnwrapKeys = new ArrayList<>(); if (failedToUnwrapKeys.size() < 5) failedToUnwrapKeys.add(key); } suppressedErr = e; } catch (Exception e) { keys.add(cctx.toCacheKeyObject(key)); suppressedErr = e; } } if (failedToUnwrapKeys != null) { log.warning("Failed to unwrap keys: " + failedToUnwrapKeys + " (the binary objects will be used instead)."); } IgniteCheckedException error = res.error(); if (suppressedErr != null) error.addSuppressed(suppressedErr); err.add(keys, error, req.topologyVersion()); }
Source:
public static void main(String[] args) throws IOException { List<String> lines = FileUtils.readLines(new File( "/Users/Shyam/mention.eval.dl")); for (String line : lines) { String[] parts = line.split("\\s+"); logger.info(parts[0] + parts[1] + parts[2]); StringBuilder sb = new StringBuilder(); for (int i = 3; i < parts.length; i++) sb.append(parts[i] + " "); if (mentionFilter(parts)) { logger.info("removing " + Arrays.asList(parts)); continue; } if (mentions.containsKey(parts[0])) { mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } else { mentions.put(parts[0], new ArrayList<DocMention>()); mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } } for (String doc : mentions.keySet()) { handleDoc(mentions.get(doc)); } outputMentions(); }

Target:
public static void main(String[] args) throws IOException { List<String> lines = FileUtils.readLines(new File( "/Users/Shyam/mention.eval.dl")); for (String line : lines) { String[] parts = line.split("\\s+"); System.out.println(parts[0] + parts[1] + parts[2]); StringBuilder sb = new StringBuilder(); for (int i = 3; i < parts.length; i++) sb.append(parts[i] + " "); if (mentionFilter(parts)) { System.out.println("removing " + Arrays.asList(parts)); continue; } if (mentions.containsKey(parts[0])) { mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } else { mentions.put(parts[0], new ArrayList<DocMention>()); mentions.get(parts[0]) .add(new DocMention(parts[0], sb.toString(), Integer .parseInt(parts[1]), Integer.parseInt(parts[2]))); } } for (String doc : mentions.keySet()) { handleDoc(mentions.get(doc)); } outputMentions(); }
Source:
public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(); retVal.setPersistenceUnitName("HAPI_PU"); retVal.setDataSource(myDataSource); retVal.setPackagesToScan("ca.uhn.fhir.jpa.model.entity", "ca.uhn.fhir.jpa.entity"); retVal.setPersistenceProvider(new HibernatePersistenceProvider()); retVal.setJpaProperties(myJpaProperties); return retVal; }

Target:
public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(); retVal.setPersistenceUnitName("HAPI_PU"); retVal.setDataSource(myDataSource); retVal.setJpaProperties(myJpaProperties); return retVal; }
Source:
List<NameValuePair> buildCommonParams(List<String> journalKeys, int start, int rows, SearchCriterion sortOrder, SearchCriterion dateRange, boolean forHomePage) { List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("wt", "json")); params.add(new BasicNameValuePair("fl", FL)); params.add(new BasicNameValuePair("fq", "doc_type:full")); params.add(new BasicNameValuePair("fq", "!article_type_facet:\"Issue Image\"")); params.add(new BasicNameValuePair("rows", Integer.toString(rows))); if (start > 0) { params.add(new BasicNameValuePair("start", Integer.toString(start))); } params.add(new BasicNameValuePair("hl", "false")); params.add(new BasicNameValuePair("facet", "false")); String sortOrderStr = sortOrder.getValue(); if (!forHomePage) { sortOrderStr += ",id desc"; } params.add(new BasicNameValuePair("sort", sortOrderStr)); String dateRangeStr = dateRange.getValue(); if (!Strings.isNullOrEmpty(dateRangeStr)) { params.add(new BasicNameValuePair("fq", "publication_date:" + dateRangeStr)); } StringBuilder crossPublishedJournals = new StringBuilder(); for (int i = 0; i < journalKeys.size(); i++) { crossPublishedJournals.append("cross_published_journal_key:"); crossPublishedJournals.append(journalKeys.get(i)); if (i < journalKeys.size() - 1) { crossPublishedJournals.append(" OR "); } } params.add(new BasicNameValuePair("fq", crossPublishedJournals.toString())); return params; }

Target:
List<NameValuePair> buildCommonParams(List<String> journalKeys, int start, int rows, SearchCriterion sortOrder, SearchCriterion dateRange, boolean forHomePage) { List<NameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("wt", "json")); params.add(new BasicNameValuePair("fl", FL)); params.add(new BasicNameValuePair("fq", "doc_type:full")); params.add(new BasicNameValuePair("fq", "!article_type_facet:\"Issue Image\"")); params.add(new BasicNameValuePair("rows", Integer.toString(rows))); if (start > 0) { params.add(new BasicNameValuePair("start", Integer.toString(start))); } params.add(new BasicNameValuePair("hl", "false")); params.add(new BasicNameValuePair("facet", "false")); String sortOrderStr = sortOrder.getValue(); if (!forHomePage) { sortOrderStr += ",id desc"; } params.add(new BasicNameValuePair("sort", sortOrderStr)); String dateRangeStr = dateRange.getValue(); if (!Strings.isNullOrEmpty(dateRangeStr)) { params.add(new BasicNameValuePair("fq", "publication_date:" + dateRangeStr)); } List<String> crossPublishedJournals = new ArrayList<>(); for (String journalKey : journalKeys) { crossPublishedJournals.add("cross_published_journal_key:" + journalKey); } params.add(new BasicNameValuePair("fq", Joiner.on(" OR ").join(crossPublishedJournals))); return params; }
Source:
private <T> LinkedList<T> getEventJournalEvents(EventJournalReader<T> reader) { final LinkedList<T> events = new LinkedList<T>(); for (int i = 1; i < TEST_PARTITION_COUNT; i++) { try { final EventJournalInitialSubscriberState state = reader.subscribeToEventJournal(i).get(); final ReadResultSet<T> partitionEvents = reader.readFromEventJournal( state.getOldestSequence(), 1, (int) (state.getNewestSequence() - state.getOldestSequence() + 1), i, new TruePredicate<T>(), new IdentityFunction<>()).get(); for (T event : partitionEvents) { events.add(event); } } catch (Exception e) { throw rethrow(e); } } return events; }

Target:
private <T> LinkedList<T> getEventJournalEvents(EventJournalReader<T> reader) { final LinkedList<T> events = new LinkedList<T>(); for (int i = 1; i < TEST_PARTITION_COUNT; i++) { try { final EventJournalInitialSubscriberState state = reader.subscribeToEventJournal(i).get(); final ReadResultSet<T> partitionEvents = reader.readFromEventJournal( state.getOldestSequence(), 1, (int) (state.getNewestSequence() - state.getOldestSequence() + 1), i, new TruePredicate<T>(), new IdentityFunction<T>()).get(); for (T event : partitionEvents) { events.add(event); } } catch (Exception e) { throw rethrow(e); } } return events; }
Source:
void onDependencyPathSelectedEvent(@Observes final DependencyPathSelectedEvent event) { if (event != null && event.getContext() != null && event.getPath() != null) { m2RepoService.call(new RemoteCallback<String>() { @Override public void callback(String kMoudleText) { m2RepoService.call(new RemoteCallback<String>() { @Override public void callback(String kieDeploymentDescriptorText) { setupView(createProcessConfig(kieDeploymentDescriptorText, kMoudleText)); } }).getKieDeploymentDescriptorText(event.getPath()); } }).getKMoudleText(event.getPath()); } }

Target:
void onDependencyPathSelectedEvent(@Observes final DependencyPathSelectedEvent event) throws IOException { if (event != null && event.getContext() != null && event.getPath() != null) { deploymentDescriptorService.call(processConfigModule -> { ProcessConfigModule module = (ProcessConfigModule) processConfigModule; view.setContent(ClientRuntimeStrategy.convert(module.getRuntimeStrategy()).getValue(view.getTranslationService()), module.getKBase(), module.getKSession(), ClientMergeMode.MERGE_COLLECTIONS.getValue(view.getTranslationService())); }).getProcessConfig(event.getPath()); } }
Source:
protected void onResume() { super.onResume(); Log.v(LOG_TAG, "mainService onResume is: " + mMainService); if (!UsageSharedPrefernceHelper.isServiceRunning(mContext)) { mFragment.setmUsageAppData(UsageSharedPrefernceHelper.getAllKeyValuePairs(mContext)); } else { if (mMainService != null) { Log.v(LOG_TAG, "Data : " + mMainService.getCurrentMap()); if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) mFragment.setmUsageAppData(mMainService.getCurrentMap()); else mFragment.setmUsageAppData(Utils.getAppUsageFromLAndroidDb(this)); mFragment.setmMusicData(mMainService.mListMusicPlayTimes); } } }

Target:
protected void onResume() { super.onResume(); Log.v(LOG_TAG, "mainService onResume is: " + mMainService); if (!UsageSharedPrefernceHelper.isServiceRunning(mContext)) { mFragment.setmUsageAppData(UsageSharedPrefernceHelper.getAllKeyValuePairs(mContext)); } else { if (mMainService != null) { Log.v(LOG_TAG, "Data : " + mMainService.getCurrentMap()); if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) { mFragment.setmUsageAppData(mMainService.getCurrentMap()); } else { mFragment.setmUsageAppData(Utils.getAppUsageFromLAndroidDb(this)); } mFragment.setmMusicData(mMainService.mListMusicPlayTimes); } } }
Source:
private Callback<Long> fetchAccountUpdateBodyCallback(RetainingAsyncWritableChannel channel) { return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> { JSONObject jsonPayload = readJsonFromChannel(channel); ReadableStreamChannel outputChannel; if (restRequest.getPath().startsWith(Operations.UPDATE_ACCOUNT_CONTAINERS)) { logger.debug("Got request for with payload {}", Operations.UPDATE_ACCOUNT_CONTAINERS, jsonPayload); JSONObject outputPayload = updateContainers(jsonPayload); outputChannel = serializeJsonToChannel(outputPayload); } else { updateAccounts(jsonPayload); outputChannel = new ByteBufferReadableStreamChannel(ByteBuffer.allocate(0)); } restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, outputChannel.getSize()); finalCallback.onCompletion(outputChannel, null); }, uri, logger, finalCallback); }

Target:
private Callback<Long> fetchAccountUpdateBodyCallback(RetainingAsyncWritableChannel channel) { return buildCallback(frontendMetrics.postAccountsReadRequestMetrics, bytesRead -> { JSONObject jsonPayload = readJsonFromChannel(channel); ReadableStreamChannel outputChannel; if (RestUtils.getRequestPath(restRequest).matchesOperation(UPDATE_ACCOUNT_CONTAINERS)) { logger.debug("Got request for with payload {}", UPDATE_ACCOUNT_CONTAINERS, jsonPayload); JSONObject outputPayload = updateContainers(jsonPayload); outputChannel = serializeJsonToChannel(outputPayload); } else { updateAccounts(jsonPayload); outputChannel = new ByteBufferReadableStreamChannel(ByteBuffer.allocate(0)); } restResponseChannel.setHeader(RestUtils.Headers.DATE, new GregorianCalendar().getTime()); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_TYPE, RestUtils.JSON_CONTENT_TYPE); restResponseChannel.setHeader(RestUtils.Headers.CONTENT_LENGTH, outputChannel.getSize()); finalCallback.onCompletion(outputChannel, null); }, uri, logger, finalCallback); }
Source:
public void testGetMenuLanguage() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (!HdmiCecUtils.isHdmiCecFeatureSupported(getDevice())) { CLog.v("No HDMI CEC feature running, should skip test."); return; } try { hdmiCecUtils.init(); hdmiCecUtils.sendCecMessage(CecDevice.TV, CecMessage.GET_MENU_LANGUAGE); String message = hdmiCecUtils.checkExpectedOutput(CecDevice.TV, CecMessage.FEATURE_ABORT); int messageId = hdmiCecUtils.getParamsFromMessage(message, CecMessage.GET_MENU_LANGUAGE.toString().length()); assertEquals(CecMessage.getMessage(messageId), CecMessage.GET_MENU_LANGUAGE); } finally { hdmiCecUtils.killCecProcess(); } }

Target:
public void testGetMenuLanguage() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (!HdmiCecUtils.isHdmiCecFeatureSupported(getDevice())) { CLog.v("No HDMI CEC feature running, should skip test."); return; } try { hdmiCecUtils.init(); hdmiCecUtils.sendCecMessage(CecDevice.TV, CecMessage.GET_MENU_LANGUAGE); String message = hdmiCecUtils.checkExpectedOutput(CecDevice.TV, CecMessage.FEATURE_ABORT); int abortedOpcode = hdmiCecUtils.getParamsFromMessage(message, CecMessage.GET_MENU_LANGUAGE.toString().length()); assertEquals(CecMessage.getMessage(abortedOpcode), CecMessage.GET_MENU_LANGUAGE); } finally { hdmiCecUtils.killCecProcess(); } }
Source:
public void validateObservationsValuesDataTypes(final Table<String, String, String> inputData, final List<MeasurementVariable> measurementVariables) throws ApiRequestValidationException { final Map<String, MeasurementVariable> mappedVariables = Maps.uniqueIndex(measurementVariables, new Function<MeasurementVariable, String>() { public String apply(final MeasurementVariable from) { return from.getAlias(); } }); final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), ObservationsPutRequestInput.class.getName()); for (final String observationUnitId : inputData.rowKeySet()) { for (final String variableName : inputData.columnKeySet()) { if (!this.isValidValue(mappedVariables.get(variableName), inputData.get(observationUnitId, variableName))) { errors.reject("warning.import.save.invalidCellValue", new String[] {variableName, inputData.get(observationUnitId, variableName)}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } else if (!this.validateCategoricalValue(mappedVariables.get(variableName))) { errors.reject("warning.import.save.invalidCategoricalValue", new String[] {variableName}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } } } }

Target:
public void validateObservationsValuesDataTypes(final Table<String, String, String> inputData, final List<MeasurementVariable> measurementVariables) throws ApiRequestValidationException { final Map<String, MeasurementVariable> mappedVariables = Maps.uniqueIndex(measurementVariables, new Function<MeasurementVariable, String>() { public String apply(final MeasurementVariable from) { return from.getAlias(); } }); final BindingResult errors = new MapBindingResult(new HashMap<String, String>(), ObservationsPutRequestInput.class.getName()); for (final String observationUnitId : inputData.rowKeySet()) { for (final String variableName : inputData.columnKeySet()) { if (!this.validateCategoricalVariableHasAPossibleValue(mappedVariables.get(variableName))) { errors.reject("warning.import.save.invalidCategoricalValue", new String[] {variableName}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } else if (!this.isValidValue(mappedVariables.get(variableName), inputData.get(observationUnitId, variableName))) { errors.reject("warning.import.save.invalidCellValue", new String[] {variableName, inputData.get(observationUnitId, variableName)}, ""); throw new ApiRequestValidationException(errors.getAllErrors()); } } } }
Source:
public String getOrcSchemaMapFile() { String prefix = "secor.orc.schema.mapfile"; return getString(prefix); }

Target:
public String getOrcSchemaMapFile() { return getString("secor.orc.schema.mapfile"); }
Source:
public void setInSlot(Object slot, Widget content) { if (content == null) { main.clear(); } else if (slot == ApplicationPresenter.TYPE_SetMainContent) { main.clear(); main.add(content); } }

Target:
public void setInSlot(Object slot, Widget content) { if (slot == ApplicationPresenter.TYPE_SetMainContent) { main.setWidget(content); } else { super.setInSlot(slot, content); } }
Source:
public Set<Integer> getPartitionIds(String stream) { return wrapExceptions(() -> { Map<String, List<PartitionInfo>> topics = consumer.listTopics(); if (topics == null || topics.get(stream) == null) { throw new ISE("Topic [%s] is not found in KafkaConsumer's list of topics", stream); } return topics.get(stream).stream().map(PartitionInfo::partition).collect(Collectors.toSet()); }); }

Target:
public Set<Integer> getPartitionIds(String stream) { return wrapExceptions(() -> { List<PartitionInfo> partitions = consumer.partitionsFor(stream); if (partitions == null) { throw new ISE("Topic [%s] is not found in KafkaConsumer's list of topics", stream); } return partitions.stream().map(PartitionInfo::partition).collect(Collectors.toSet()); }); }
Source:
public void handleInitiateResponseMessage(InitiateResponseMessage message) { if (message.isReadOnly() && m_defaultConsistencyReadLevel.hasShortcutRead()) { m_mailbox.send(message.getInitiatorHSId(), message); return; } final long spHandle = message.getSpHandle(); final DuplicateCounterKey dcKey = new DuplicateCounterKey(message.getTxnId(), spHandle); DuplicateCounter counter = m_duplicateCounters.get(dcKey); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { m_duplicateCounters.remove(dcKey); m_repairLogTruncationHandle = spHandle; m_mailbox.send(counter.m_destinationId, counter.getLastResponse()); } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH: replicas produced different results.", true, null); } } else { m_repairLogTruncationHandle = spHandle; m_mailbox.send(message.getInitiatorHSId(), message); } if (m_defaultConsistencyReadLevel == ReadLevel.SAFE && m_isLeader && message.isReadOnly() && m_shortCircuitReadLog != null) { m_shortCircuitReadLog.offerSp(message, m_repairLogTruncationHandle); } }

Target:
public void handleInitiateResponseMessage(InitiateResponseMessage message) { if (message.isReadOnly()) { if (m_defaultConsistencyReadLevel == ReadLevel.FAST) { m_mailbox.send(message.getInitiatorHSId(), message); return; } if (m_defaultConsistencyReadLevel == ReadLevel.SAFE && m_isLeader) { assert(m_bufferedReadLog != null); m_bufferedReadLog.offerSp(message, m_repairLogTruncationHandle); return; } } final long spHandle = message.getSpHandle(); final DuplicateCounterKey dcKey = new DuplicateCounterKey(message.getTxnId(), spHandle); DuplicateCounter counter = m_duplicateCounters.get(dcKey); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { m_duplicateCounters.remove(dcKey); m_repairLogTruncationHandle = spHandle; m_mailbox.send(counter.m_destinationId, counter.getLastResponse()); } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH: replicas produced different results.", true, null); } } else { m_repairLogTruncationHandle = spHandle; m_mailbox.send(message.getInitiatorHSId(), message); } }
Source:
public void run(@Nonnull JDefinedClassOrInterface type) throws Exception { if (type instanceof JDefinedClass) { JDefinedClass definedClass = (JDefinedClass) type; if (!DirectlyDerivedClassesMarker.hasDirectlyDerivedClasses(definedClass)) { if (!type.isAbstract() && !type.isFinal()) { EffectivelyFinalClassMarker.markAsEffectivelyFinal(definedClass); if (!preserveReflections()) { definedClass.setFinal(); tracer.getStatistic(TYPES_FINALIZED).incValue(); } } } } }

Target:
public void run(@Nonnull JDefinedClassOrInterface type) throws Exception { if (type instanceof JDefinedClass) { JDefinedClass definedClass = (JDefinedClass) type; if (!DirectlyDerivedClassesMarker.hasDirectlyDerivedClasses(definedClass)) { if (!type.isAbstract() && !type.isFinal()) { EffectivelyFinalClassMarker.markAsEffectivelyFinal(definedClass); if (!preserveReflections) { definedClass.setFinal(); tracer.getStatistic(TYPES_FINALIZED).incValue(); } } } } }
Source:
private HttpHandler withAuthenticationHandlersChain(HttpHandler next) { AuthenticationConfiguration authConfig = authenticationConfigurationProvider.getAuthenticationConfiguration() .orElseThrow(() -> new IllegalStateException("AuthenticationConfiguration was not provided")); try { return createAuthenticationHandlersChain(next, authConfig); } catch (Exception e) { throw new IllegalStateException("Could not create authentication handlers chain", e); } }

Target:
private HttpHandler withAuthenticationHandlersChain(HttpHandler next) { AuthenticationConfiguration authConfig = authenticationConfigurationProvider.getAuthenticationConfiguration() .orElseThrow(() -> new IllegalStateException("AuthenticationConfiguration was not provided")); try { return createAuthenticationHandlersChain(next, authConfig); } catch (Exception e) { logger.error("Could not create authentication handlers chain", e); throw e; } }
Source:
public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream) { if (isAvailable() && isEnabled(repo)) { return new LfsPrePushHook(repo, outputStream); } return null; }

Target:
public PrePushHook getPrePushHook(Repository repo, PrintStream outputStream) { if (isEnabled(repo)) { return new LfsPrePushHook(repo, outputStream); } return null; }
Source:
public void visitEnumConstant(EnumConstantTree tree) { scan(((NewClassTree) tree.initializer()).classBody()); }

Target:
public void visitEnumConstant(EnumConstantTree tree) { scan(tree.initializer().classBody()); }
Source:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (!profiles.isEmpty()) { doAuth((HttpServletRequest) req, (HttpServletResponse) rsp, chain); } chain.doFilter(req, rsp); }

Target:
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain) throws IOException, ServletException { findNegotiatingProfiles(req); if (!profiles.isEmpty()) { doAuth((HttpServletRequest) req, (HttpServletResponse) rsp, chain); } else { chain.doFilter(req, rsp); } }
Source:
private void updateTrackWith(@NonNull Track track) { trackView.setText(track.name().toUpperCase(Locale.getDefault())); trackView.setTextColor(track.color()); trackBgPaint.setColor(track.color()); }

Target:
private void updateTrackWith(@NonNull Track track) { trackView.setText(track.name().toUpperCase(Locale.getDefault())); trackView.setTextColor(track.color()); trackBgPaint.setColor(track.color()); invalidate(trackDrawableBounds); invalidate(toRect(trackLineBounds)); }
Source:
public void should_fail_if_actual_does_not_match() { byte[] actual = new byte[] { -1, 0, 1 }; AssertionError assertionError = expectAssertionError(() -> assertThat(actual).asHexString().isEqualTo("010203")); assertThat(assertionError).hasMessageContaining("Expecting:") .hasMessageContaining("<\"FF0001\">") .hasMessageContaining("to be equal to:") .hasMessageContaining("<\"010203\">") .hasMessageContaining("but was not."); assertThat(assertionError).isExactlyInstanceOf(AssertionFailedError.class); }

Target:
public void should_fail_if_actual_does_not_match() { byte[] actual = new byte[] { -1, 0, 1 }; AssertionError assertionError = expectAssertionError(() -> assertThat(actual).asHexString().isEqualTo("010203")); assertThat(assertionError) .hasMessageContainingAll("Expecting:", "<\"FF0001\">", "to be equal to:", "<\"010203\">", "but was not.") .isExactlyInstanceOf(AssertionFailedError.class); }
Source:
public boolean invoke(Object object) { org.apache.synapse.MessageContext messageContext = null; try { messageContext = createMessageContext(); MessageContext axis2MsgCtx = null; if (messageContext != null) { axis2MsgCtx = ((org.apache.synapse.core.axis2.Axis2MessageContext) messageContext).getAxis2MessageContext(); } Builder builder = null; if (axis2MsgCtx != null) { builder = BuilderUtil.getBuilderFromSelector(contentType, axis2MsgCtx); } if (builder == null) { if (log.isDebugEnabled()) { log.debug("No message builder found for type '" + contentType + "'. Falling back to SOAP."); } } OMElement documentElement = (OMElement) object; messageContext.setEnvelope(TransportUtils.createSOAPEnvelope(documentElement)); } catch (AxisFault axisFault) { log.error("Error while setting message to the message context :: " + axisFault.getMessage(), axisFault); } if (StringUtils.isEmpty(injectingSeq)) { log.error("Sequence name not specified. Sequence : " + injectingSeq); throw new SynapseException("Sequence name not specified. Sequence : " + injectingSeq); } SequenceMediator seq = (SequenceMediator) synapseEnvironment.getSynapseConfiguration().getSequence(injectingSeq); seq.setErrorHandler(onErrorSeq); if (log.isDebugEnabled()) { log.debug("injecting message to sequence : " + injectingSeq); } synapseEnvironment.injectInbound(messageContext, seq, sequential); return true; }

Target:
public boolean invoke(Object object) { org.apache.synapse.MessageContext messageContext = null; try { messageContext = (org.apache.synapse.MessageContext) createMessageContext(); MessageContext axis2MsgCtx = null; if (messageContext != null) { axis2MsgCtx = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); } Builder builder = null; if (axis2MsgCtx != null) { builder = BuilderUtil.getBuilderFromSelector(contentType, axis2MsgCtx); } if (builder == null) { if (log.isDebugEnabled()) { log.debug("No message builder found for type '" + contentType + "'. Falling back to SOAP."); } } OMElement documentElement = (OMElement) object; messageContext.setEnvelope(TransportUtils.createSOAPEnvelope(documentElement)); } catch (AxisFault axisFault) { log.error("Error while setting message to the message context : " + axisFault.getMessage(), axisFault); } if (StringUtils.isEmpty(injectingSeq)) { log.error("Sequence name not specified. Sequence : " + injectingSeq); throw new SynapseException("Sequence name not specified. Sequence : " + injectingSeq); } SequenceMediator seq = (SequenceMediator) synapseEnvironment.getSynapseConfiguration().getSequence(injectingSeq); seq.setErrorHandler(onErrorSeq); if (log.isDebugEnabled()) { log.debug("injecting message to sequence : " + injectingSeq); } synapseEnvironment.injectInbound(messageContext, seq, sequential); return true; }
Source:
private void pushUpstream(final RevCommit commit) { RemoteConfig config = SimpleConfigurePushDialog .getConfiguredRemote(repository); if (config == null) { final Display display = Display.getDefault(); display.asyncExec(new Runnable() { public void run() { try { PushBranchWizard pushWizard = null; if (repository.getBranch() != null) { Ref ref = repository.getRef(repository.getBranch()); pushWizard = new PushBranchWizard(repository, ref); } else { pushWizard = new PushBranchWizard(repository, commit.getId()); } WizardDialog wizardDialog = new WizardDialog(display .getActiveShell(), pushWizard); wizardDialog.setHelpAvailable(true); wizardDialog.open(); } catch (IOException e) { Activator.handleError( NLS.bind(UIText.CommitUI_pushFailedMessage, e), e, true); } } }); } else { PushOperationUI op = new PushOperationUI(repository, config.getName(), false); op.start(); } }

Target:
private void pushUpstream(final RevCommit commit) { RemoteConfig config = SimpleConfigurePushDialog .getConfiguredRemote(repository); if (config == null) { final Display display = Display.getDefault(); display.asyncExec(new Runnable() { public void run() { try { PushBranchWizard pushWizard = null; String fullBranch = repository.getFullBranch(); if (fullBranch != null && fullBranch.startsWith(Constants.R_HEADS)) { Ref ref = repository.getRef(repository.getBranch()); pushWizard = new PushBranchWizard(repository, ref); } else { pushWizard = new PushBranchWizard(repository, commit.getId()); } WizardDialog wizardDialog = new WizardDialog(display .getActiveShell(), pushWizard); wizardDialog.setHelpAvailable(true); wizardDialog.open(); } catch (IOException e) { Activator.handleError( NLS.bind(UIText.CommitUI_pushFailedMessage, e), e, true); } } }); } else { PushOperationUI op = new PushOperationUI(repository, config.getName(), false); op.start(); } }
Source:
public static void setRoundedCornerImage(@NonNull ImageView imageView, @DrawableRes int drawableRes) { final Context context = imageView.getContext(); final float cornerRadius = context.getResources().getDimension(R.dimen.subject_item_corner_radius); Glide.with(context) .load(drawableRes) .asBitmap() .into(new BitmapImageViewTarget(imageView) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource); circularBitmapDrawable.setCornerRadius(cornerRadius); view.setImageDrawable(circularBitmapDrawable); } }); }

Target:
public static void setRoundedCornerImage(@NonNull ImageView imageView, @DrawableRes int drawableRes) { final Context context = imageView.getContext(); final float cornerRadius = context.getResources().getDimension(R.dimen.subject_item_corner_radius); Glide.with(context) .load(drawableRes) .asBitmap() .into(new BitmapImageViewTarget(imageView) { @Override protected void setResource(Bitmap resource) { final RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource); circularBitmapDrawable.setCornerRadius(cornerRadius); view.setImageDrawable(circularBitmapDrawable); } }); }