auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY) { throw new DeveloperError("This view only supports EXACTLY for the widthMeasureSpec"); } int availableWidth = MeasureSpec.getSize(widthMeasureSpec) - getPaddingStart() - getPaddingEnd(); measureAndUpdateFirstRowContent(availableWidth); int totalHeight = getPaddingTop() + timeView.getMeasuredHeight() + getVerticalMarginsFor(timeView); measureChildWithMargins(titleView, availableWidth); totalHeight += titleView.getMeasuredHeight() + getVerticalMarginsFor(titleView); measureAndUpdateThirdRowContent(availableWidth); totalHeight += speakersView.getMeasuredHeight() + getVerticalMarginsFor(speakersView); totalHeight += getPaddingBottom(); int measuredHeight; int heightMode = MeasureSpec.getMode(heightMeasureSpec); if (heightMode == MeasureSpec.EXACTLY) { measuredHeight = MeasureSpec.getSize(heightMeasureSpec); } else if (heightMode == MeasureSpec.AT_MOST) { measuredHeight = Math.min(MeasureSpec.getSize(heightMeasureSpec), totalHeight); } else { measuredHeight = totalHeight; } setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), measuredHeight); }

Target:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY) { throw new DeveloperError("This view only supports EXACTLY for the widthMeasureSpec"); } int availableWidth = MeasureSpec.getSize(widthMeasureSpec) - getPaddingStart() - getPaddingEnd(); measureAndUpdateFirstRowContent(availableWidth); int totalHeight = getPaddingTop() + Math.max( timeView.getMeasuredHeight() + getVerticalMarginsFor(timeView), trackView.getMeasuredHeight() + getVerticalMarginsFor(trackView) ); measureChildWithMargins(titleView, availableWidth); totalHeight += titleView.getMeasuredHeight() + getVerticalMarginsFor(titleView); measureAndUpdateThirdRowContent(availableWidth); totalHeight += speakersView.getMeasuredHeight() + getVerticalMarginsFor(speakersView); totalHeight += getPaddingBottom(); int measuredHeight = getMeasuredHeightFor(heightMeasureSpec, totalHeight); setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), measuredHeight); }
Source:
public DataHandler(Context context) { IntentFilter intentFilter = new IntentFilter(MainActivity.LOAD_OVER); context.getApplicationContext().registerReceiver(this, intentFilter); Intent i = new Intent(MainActivity.START_LOAD); context.sendBroadcast(i); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); appProvider = new AppProvider(context); providers.add(appProvider); if (prefs.getBoolean("enable-contacts", true)) { contactProvider = new ContactProvider(context); providers.add(contactProvider); } else { contactProvider = null; } if (prefs.getBoolean("enable-search", true)) { providers.add(new SearchProvider(context)); } if (prefs.getBoolean("enable-phone", true)) { providers.add(new PhoneProvider(context)); } if (prefs.getBoolean("enable-toggles", true)) { providers.add(new ToggleProvider(context)); } if (prefs.getBoolean("enable-settings", true)) { providers.add(new SettingProvider(context)); } if (prefs.getBoolean("enable-alias", true)) { providers.add(new AliasProvider(context, appProvider)); } shortcutProvider = (new ShortcutProvider(context)); if (prefs.getBoolean("enable-shortcuts", true)) { providers.add(shortcutProvider); } }

Target:
public DataHandler(Context context) { IntentFilter intentFilter = new IntentFilter(MainActivity.LOAD_OVER); context.getApplicationContext().registerReceiver(this, intentFilter); Intent i = new Intent(MainActivity.START_LOAD); context.sendBroadcast(i); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); appProvider = new AppProvider(context); providers.add(appProvider); if (prefs.getBoolean("enable-contacts", true)) { contactProvider = new ContactProvider(context); providers.add(contactProvider); } else { contactProvider = null; } if (prefs.getBoolean("enable-search", true)) { providers.add(new SearchProvider(context)); } if (prefs.getBoolean("enable-phone", true)) { providers.add(new PhoneProvider(context)); } if (prefs.getBoolean("enable-toggles", true)) { providers.add(new ToggleProvider(context)); } if (prefs.getBoolean("enable-settings", true)) { providers.add(new SettingProvider(context)); } if (prefs.getBoolean("enable-alias", true)) { providers.add(new AliasProvider(context, appProvider)); } if (prefs.getBoolean("enable-shortcuts", true)) { shortcutProvider = new ShortcutProvider(context); providers.add(shortcutProvider); } else { shortcutProvider = null; } }
Source:
private void addListenersToInputButtons() { MetadataToolbarEditorView toolBar = inputMetaEditor.getToolBar(); inputToolBarButtons = toolBar.getButtons(); beforeCommandListenerForInputButtons = new IExtendedButtonListener() { public void handleEvent(ExtendedButtonEvent event) { TableViewerCreator tableViewerCreator = mapperManager.getUiManager().getCurrentSelectedInputTableView() .getTableViewerCreatorForColumns(); if (tableViewerCreator != null) { tableViewerCreator.applyActivatedCellEditor(); } } }; final List<InputTable> inputTables = mapperManager.getInputTables(); IExtendedButtonListener afterCommandListener = new IExtendedButtonListener() { public void handleEvent(ExtendedButtonEvent event) { for (InputTable inputTable : inputTables) { DataMapTableView view = mapperManager.retrieveAbstractDataMapTableView(inputTable); view.getTableViewerCreatorForColumns().getTableViewer().refresh(); } } }; for (ExtendedPushButton extendedPushButton : inputToolBarButtons) { extendedPushButton.addListener(beforeCommandListenerForInputButtons, true); extendedPushButton.addListener(afterCommandListener, false); } this.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { for (ExtendedPushButton extendedPushButton : inputToolBarButtons) { extendedPushButton.removeListener(beforeCommandListenerForInputButtons, true); } } }); }

Target:
private void addListenersToInputButtons() { MetadataToolbarEditorView toolBar = inputMetaEditor.getToolBar(); inputToolBarButtons = toolBar.getButtons(); beforeCommandListenerForInputButtons = new IExtendedButtonListener() { public void handleEvent(ExtendedButtonEvent event) { TableViewerCreator tableViewerCreator = mapperManager.getUiManager().getCurrentSelectedInputTableView() .getTableViewerCreatorForColumns(); if (tableViewerCreator != null) { tableViewerCreator.applyActivatedCellEditor(); } } }; IExtendedButtonListener afterCommandListener = new IExtendedButtonListener() { public void handleEvent(ExtendedButtonEvent event) { List<InputTable> inputTablesList = mapperManager.getInputTables(); for (InputTable inputTable : inputTablesList) { DataMapTableView view = mapperManager.retrieveAbstractDataMapTableView(inputTable); view.getTableViewerCreatorForColumns().getTableViewer().refresh(); } } }; for (ExtendedPushButton extendedPushButton : inputToolBarButtons) { extendedPushButton.addListener(beforeCommandListenerForInputButtons, true); extendedPushButton.addListener(afterCommandListener, false); } this.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { for (ExtendedPushButton extendedPushButton : inputToolBarButtons) { extendedPushButton.removeListener(beforeCommandListenerForInputButtons, true); } } }); }
Source:
public TooltipImpl(Element element, TooltipOptions options) { this.$element = $(element); this.options = getOptions(options); if (options.getResources() != null){ this.style = options.getResources().css(); } else{ this.style = getDefaultResources().css(); } init(); }

Target:
public TooltipImpl(Element element, TooltipOptions options) { this(element, options, getDefaultResources()); }
Source:
private void onCheckAll() { boolean all = mCheckedCardPositions.size() < getCards().size(); if (all) { for (int i = 0; i < mCards.size(); i++) mCheckedCardPositions.add(i); } else { mCheckedCardPositions.clear(); } updateMultiselectMenu(); mActionBarTitle.setText(Integer.toString(mCheckedCardPositions.size())); mCardsAdapter.notifyDataSetChanged(); }

Target:
private void onCheckAll() { boolean all = mCheckedCardPositions.size() < getCards().size(); if (all) { for (int i = 0; i < mCards.size(); i++) { mCheckedCardPositions.add(i); } } else { mCheckedCardPositions.clear(); } updateMultiselectMenu(); mActionBarTitle.setText(Integer.toString(mCheckedCardPositions.size())); mCardsAdapter.notifyDataSetChanged(); }
Source:
public List<FolderItem> getAssetsRecursively( final Package pkg, final ActiveOptions options ) { final List<FolderItem> items = new ArrayList<>(); getItems( pkg, options ).forEach( item -> { if ( item.getType().equals( FolderItemType.FOLDER ) ) { final Set<Package> childPackages = projectService.resolvePackages( pkg ); childPackages.forEach( childPkg -> items.addAll( getAssetsRecursively( childPkg, options ) ) ); } else { items.add( item ); } } ); return items; }

Target:
public List<FolderItem> getAssetsRecursively( final Package pkg, final ActiveOptions options ) { return getItems( pkg, options ).stream().flatMap( ( FolderItem item ) -> { if ( item.getType().equals( FolderItemType.FOLDER ) ) { final Set<Package> childPackages = projectService.resolvePackages( pkg ); return childPackages.stream().flatMap( childPkg -> getAssetsRecursively( childPkg, options ).stream() ); } else { return Stream.of( item ); } } ).collect( Collectors.toList() ); }
Source:
public void InitializeSerial() { mPhysicaloid = new Physicaloid(context); Log.d(LOG_TAG, "Initialized"); }

Target:
public void InitializeSerial() { mPhysicaloid = new Physicaloid(context); BaudRate(this.baudRate); Log.d(LOG_TAG, "Initialized"); }
Source:
public void testReviewsWithSameChangeId() throws Exception { String branchName = "test_side_branch"; createBranchIfNonExistent(branchName); ReviewHarness reviewHarness2 = reviewHarness.duplicate(); reviewHarness2.init("HEAD:refs/for/" + branchName, PrivilegeLevel.USER, "otherTestFile.txt", true); reviewHarness.retrieve(); assertEquals(reviewHarness.getReview().getKey(), reviewHarness2.getReview().getKey()); assertThat(reviewHarness.getReview().getId(), is(not(reviewHarness2.getReview().getId()))); assertThat(reviewHarness.getReview().getSets().size(), is(1)); assertThat(reviewHarness.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail = retrievePatchSetDetail(reviewHarness, "1"); assertThat(detail.getPatches().size(), is(2)); assertThat(detail.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail.getPatches().get(1).getFileName(), is("testFile1.txt")); assertThat(reviewHarness2.getReview().getSets().size(), is(1)); assertThat(reviewHarness2.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail2 = retrievePatchSetDetail(reviewHarness2, "1"); assertThat(detail2.getPatches().size(), is(2)); assertThat(detail2.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail2.getPatches().get(1).getFileName(), is("otherTestFile.txt")); }

Target:
public void testReviewsWithSameChangeId() throws Exception { String branchName = "test_side_branch"; createBranchIfNonExistent(branchName); ReviewHarness reviewHarness2 = reviewHarness.duplicate(); reviewHarness2.init("HEAD:refs/for/" + branchName, PrivilegeLevel.USER, "otherTestFile.txt", true); reviewHarness.retrieve(); reviewHarness2.retrieve(); assertEquals(reviewHarness.getReview().getKey(), reviewHarness2.getReview().getKey()); assertThat(reviewHarness.getReview().getId(), is(not(reviewHarness2.getReview().getId()))); assertThat(reviewHarness.getReview().getSets().size(), is(1)); assertThat(reviewHarness.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail = retrievePatchSetDetail(reviewHarness, "1"); assertThat(detail.getPatches().size(), is(2)); assertThat(detail.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail.getPatches().get(1).getFileName(), is("testFile1.txt")); assertThat(reviewHarness2.getReview().getSets().size(), is(1)); assertThat(reviewHarness2.getReview().getSets().get(0).getId(), is("1")); PatchSetDetail detail2 = retrievePatchSetDetail(reviewHarness2, "1"); assertThat(detail2.getPatches().size(), is(2)); assertThat(detail2.getPatches().get(0).getFileName(), is("/COMMIT_MSG")); assertThat(detail2.getPatches().get(1).getFileName(), is("otherTestFile.txt")); }
Source:
private JSONObject getTopology(StartAction startAction, Map<Integer, ExtensibleGroupTag> hostGroups, JoinCoordinator joinCoordinator) { JSONObject topo = null; int sitesperhost = m_catalogContext.getDeployment().getCluster().getSitesperhost(); int kfactor = m_catalogContext.getDeployment().getCluster().getKfactor(); if (startAction == StartAction.JOIN) { assert(joinCoordinator != null); topo = joinCoordinator.getTopology(); } else { final Set<Integer> liveHostIds = m_messenger.getLiveHostIds(); Preconditions.checkArgument(hostGroups.keySet().equals(liveHostIds)); int hostcount = liveHostIds.size(); ClusterConfig clusterConfig = new ClusterConfig(hostcount, sitesperhost, kfactor); if (!startAction.doesRejoin() && !clusterConfig.validate()) { VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null); } try { final Multimap<Integer, Long> replicas = m_cartographer.getReplicasForPartitions(m_cartographer.getPartitions()); final Map<Integer, Long> masters = m_cartographer.getHSIdsForSinglePartitionMasters(); replicas.removeAll(MpInitiator.MP_INIT_PID); masters.remove(MpInitiator.MP_INIT_PID); topo = clusterConfig.getTopology(hostGroups, replicas, masters); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to calculate topology", false, e); } if (!startAction.doesRejoin()) { topo = registerClusterConfig(topo); } } return topo; }

Target:
private JSONObject getTopology(StartAction startAction, Map<Integer, ExtensibleGroupTag> hostGroups, JoinCoordinator joinCoordinator) { JSONObject topo = null; int sitesperhost = m_catalogContext.getDeployment().getCluster().getSitesperhost(); int kfactor = m_catalogContext.getDeployment().getCluster().getKfactor(); if (startAction == StartAction.JOIN) { assert(joinCoordinator != null); topo = joinCoordinator.getTopology(); } else { final Set<Integer> liveHostIds = m_messenger.getLiveHostIds(); Preconditions.checkArgument(hostGroups.keySet().equals(liveHostIds)); int hostcount = liveHostIds.size(); ClusterConfig clusterConfig = new ClusterConfig(hostcount, sitesperhost, kfactor); if (!startAction.doesRejoin() && !clusterConfig.validate()) { VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null); } try { final Multimap<Integer, Long> replicas = m_cartographer.getReplicasForPartitions(m_cartographer.getPartitions()); final Map<Integer, Long> masters = m_cartographer.getHSIdsForSinglePartitionMasters(); replicas.removeAll(MpInitiator.MP_INIT_PID); masters.remove(MpInitiator.MP_INIT_PID); topo = clusterConfig.getTopology(hostGroups, replicas, masters, Lists.newArrayList()); m_messenger.registerGroupTags(hostGroups); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to calculate topology", false, e); } if (!startAction.doesRejoin()) { topo = registerClusterConfig(topo); } } return topo; }
Source:
public String toUri() { return UriComponentsBuilder .newInstance() .scheme(getProtocol()) .host(getHostname()) .port(getPort()) .toUriString(); }

Target:
public String toUri() { return new HttpHost(hostname, port, protocol).toURI(); }
Source:
public Iterable<Edge> getEdges(final Vertex otherVertex, Direction direction, String[] labels, FetchHints fetchHints, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction); return getGraph().getEdges(getEdgeIdsWithOtherVertexId(otherVertex.getId(), direction, labels, authorizations), fetchHints, authorizations); }

Target:
public Iterable<Edge> getEdges(final Vertex otherVertex, Direction direction, String[] labels, FetchHints fetchHints, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction, labels); return getGraph().getEdges(getEdgeIdsWithOtherVertexId(otherVertex.getId(), direction, labels, authorizations), fetchHints, authorizations); }
Source:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { if(volumeEntity == null) { return; } boolean isNewSessionAvailable = true; boolean isRemoveSessionCommandAvailable = false; boolean isStartSessionCommandAvailable = false; boolean isStopSessionCommandAvailable = false; boolean sessionOptionsCommandAvailable = true; boolean isViewSessionDetailsCommandAvailable = false; if (getSelectedItems() != null) { isStopSessionCommandAvailable = true; isViewSessionDetailsCommandAvailable = true; isStartSessionCommandAvailable = true; isRemoveSessionCommandAvailable = true; } getNewSessionCommand().setIsAvailable(isNewSessionAvailable); getRemoveSessionCommand().setIsAvailable(isRemoveSessionCommandAvailable); getStartSessionCommand().setIsAvailable(isStartSessionCommandAvailable); getStopSessionCommand().setIsAvailable(isStopSessionCommandAvailable); getSessionOptionsCommand().setIsAvailable(sessionOptionsCommandAvailable); getViewSessionDetailsCommand().setIsAvailable(isViewSessionDetailsCommandAvailable); }

Target:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { if(volumeEntity == null) { return; } getNewSessionCommand().setIsAvailable(true); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsAvailable(false); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); }
Source:
private RequestContext BuildDummyRequestContextForOperationTest(OperationEnum operation) { RequestContext rc = new RequestContext(); rc.setRequest(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); switch (operation) { case get: rc.setLimit(1); } return rc; }

Target:
private RequestContext BuildDummyRequestContextForOperationTest(OperationEnum operation) { RequestContext rc = new RequestContext(); rc.setRequest(new MockHttpServletRequest()); switch (operation) { case get: case getSubresource: rc.setLimit(1); break; case getWithUUID: case getSubresourceWithUUID: case postCreate: case postSubresource: } return rc; }
Source:
public Authenticator getAuthenticator(String name) { for (AuthenticatorSpi implementation : implementations) { for (Authenticator authenticator : implementation.getAuthenticators()) { if (StringUtils.equals(authenticator.getName(), name)) { return authenticator; } } } log.warn( "There is no instance to manage authenticator \"" + name + "\", will return null." ); return null; }

Target:
public Authenticator getAuthenticator(String name) { Authenticator authenticator = instances.get(name); if (authenticator != null) { return authenticator; } log.warn( "There is no authenticator for name \"" + name + "\", will " + "return null." ); return null; }
Source:
public IOContainer(DriverType driver) { if ( driver == DriverType.DATASTAX ) { boolean stringMetricsDropped = configuration.getBooleanProperty(CoreConfig.STRING_METRICS_DROPPED); List<String> tenantIdsKept = configuration.getListProperty(CoreConfig.TENANTIDS_TO_KEEP); metadataIO = new DMetadataIO(); shardStateIO = new DShardStateIO(); locatorIO = new DLocatorIO(); excessEnumIO = new DExcessEnumIO(); enumReaderIO = new DEnumIO(); basicMetricsRW = new DBasicMetricsRW(stringMetricsDropped, tenantIdsKept); preAggregatedMetricsRW = new DPreaggregatedMetricsRW(); } else { metadataIO = new AMetadataIO(); shardStateIO = new AShardStateIO(); locatorIO = new ALocatorIO(); excessEnumIO = new AExcessEnumIO(); enumReaderIO = new AEnumIO(); basicMetricsRW = new ABasicMetricsRW(); preAggregatedMetricsRW = new APreaggregatedMetricsRW(); } }

Target:
private IOContainer(DriverType driver) { if ( driver == DriverType.DATASTAX ) { boolean stringMetricsDropped = configuration.getBooleanProperty(CoreConfig.STRING_METRICS_DROPPED); List<String> tenantIdsKept = configuration.getListProperty(CoreConfig.TENANTIDS_TO_KEEP); metadataIO = new DMetadataIO(); shardStateIO = new DShardStateIO(); locatorIO = new DLocatorIO(); excessEnumIO = new DExcessEnumIO(); enumReaderIO = new DEnumIO(); basicMetricsRW = new DBasicMetricsRW(stringMetricsDropped, tenantIdsKept); preAggregatedMetricsRW = new DPreaggregatedMetricsRW(); } else { metadataIO = new AMetadataIO(); shardStateIO = new AShardStateIO(); locatorIO = new ALocatorIO(); excessEnumIO = new AExcessEnumIO(); enumReaderIO = new AEnumIO(); basicMetricsRW = new ABasicMetricsRW(); preAggregatedMetricsRW = new APreaggregatedMetricsRW(); } }
Source:
private void addDirectory( String path, File dir, List<DiagnosticsReportSource> sources ) { String currentLevel = path + "/" + dir.getName(); if ( fs.isDirectory( dir ) ) { File[] files = fs.listFiles( dir ); if ( files != null ) { for ( File file : files ) { addDirectory( currentLevel, file, sources ); } } } else { sources.add( DiagnosticsReportSources.newDiagnosticsFile( currentLevel, fs, dir ) ); } }

Target:
private void addDirectory( String path, File dir, List<DiagnosticsReportSource> sources ) { String currentLevel = path + File.separator + dir.getName(); if ( fs.isDirectory( dir ) ) { File[] files = fs.listFiles( dir ); if ( files != null ) { for ( File file : files ) { addDirectory( currentLevel, file, sources ); } } } else { sources.add( DiagnosticsReportSources.newDiagnosticsFile( currentLevel, fs, dir ) ); } }
Source:
public BridgeAPI bridgeAPI() { logger.error("bridgeAPI({}) called. Should NEVER occur."); return null; }

Target:
public BridgeAPI bridgeAPI() { logger.debug( "bridgeAPI({}) called. Should NEVER occur as it seems to be a lack of protocol-specific implementation of this bridge API."); return null; }
Source:
public AbstractRefreshManager(ModelProvider<? extends GridController> modelProvider, EventBus eventBus, ClientStorage clientStorage) { this.modelProvider = modelProvider; this.clientStorage = clientStorage; this.eventBus = eventBus; this.refreshPanel = createRefreshPanel(); listenOnManualRefresh(); eventBus.addHandler(UiCommonInitEvent.getType(), new UiCommonInitHandler() { @Override public void onUiCommonInit(UiCommonInitEvent event) { updateController(); } }); updateController(); getModelTimer().setRefreshRate(readRefreshRate()); eventBus.addHandler(ApplicationFocusChangeEvent.getType(), new ApplicationFocusChangeHandler() { @Override public void onApplicationFocusChange(ApplicationFocusChangeEvent event) { onWindowFocusChange(event.isInFocus()); } }); }

Target:
public AbstractRefreshManager(ModelProvider<? extends GridController> modelProvider, EventBus eventBus, ClientStorage clientStorage) { this.modelProvider = modelProvider; this.clientStorage = clientStorage; this.eventBus = eventBus; this.refreshPanel = createRefreshPanel(); listenOnManualRefresh(); eventBus.addHandler(UiCommonInitEvent.getType(), new UiCommonInitHandler() { @Override public void onUiCommonInit(UiCommonInitEvent event) { updateController(); } }); updateController(); eventBus.addHandler(ApplicationFocusChangeEvent.getType(), new ApplicationFocusChangeHandler() { @Override public void onApplicationFocusChange(ApplicationFocusChangeEvent event) { onWindowFocusChange(event.isInFocus()); } }); }
Source:
private void processNextPeriodicMeterReadsForInterval(final List<PeriodicMeterReadsGas> periodicMeterReads, final List<DataObject> bufferedObjects, final DateTime bufferedDateTime, final List<GetResult> results) throws ProtocolAdapterException { final AmrProfileStatusCode amrProfileStatusCode = this.readAmrProfileStatusCode(bufferedObjects .get(BUFFER_INDEX_AMR_STATUS)); final DataObject gasValue = bufferedObjects.get(BUFFER_INDEX_MBUS_VALUE_INT); LOGGER.debug("gasValue: {}", this.dlmsHelperService.getDebugInfo(gasValue)); final DataObject gasCaptureTime = bufferedObjects.get(BUFFER_INDEX_MBUS_CAPTURETIME_INT); LOGGER.debug("gasCaptureTime: {}", this.dlmsHelperService.getDebugInfo(gasCaptureTime)); final CosemDateTime cosemDateTime = this.dlmsHelperService.fromDateTimeValue((byte[]) gasCaptureTime.value()); final Date captureTime; if (cosemDateTime.isDateTimeSpecified()) { captureTime = cosemDateTime.asDateTime().toDate(); } else { throw new ProtocolAdapterException("Unexpected null/unspecified value for Gas Capture Time"); } final PeriodicMeterReadsGas nextPeriodicMeterReads = new PeriodicMeterReadsGas(bufferedDateTime.toDate(), this.dlmsHelperService.getScaledMeterValue(gasValue, results.get(RESULT_INDEX_SCALER_UNIT).resultData(), "gasValue"), captureTime, amrProfileStatusCode); periodicMeterReads.add(nextPeriodicMeterReads); }

Target:
private void processNextPeriodicMeterReadsForInterval(final List<PeriodicMeterReadsGas> periodicMeterReads, final List<DataObject> bufferedObjects, final DateTime bufferedDateTime, final List<GetResult> results) throws ProtocolAdapterException { final AmrProfileStatusCode amrProfileStatusCode = this.readAmrProfileStatusCode(bufferedObjects .get(BUFFER_INDEX_AMR_STATUS)); final DataObject gasValue = bufferedObjects.get(BUFFER_INDEX_MBUS_VALUE_INT); LOGGER.debug("gasValue: {}", this.dlmsHelperService.getDebugInfo(gasValue)); final CosemDateTime cosemDateTime = this.dlmsHelperService.readDateTime( bufferedObjects.get(BUFFER_INDEX_MBUS_CAPTURETIME_INT), "Clock from mbus interval extended register"); final Date captureTime; if (cosemDateTime.isDateTimeSpecified()) { captureTime = cosemDateTime.asDateTime().toDate(); } else { throw new ProtocolAdapterException("Unexpected null/unspecified value for Gas Capture Time"); } final PeriodicMeterReadsGas nextPeriodicMeterReads = new PeriodicMeterReadsGas(bufferedDateTime.toDate(), this.dlmsHelperService.getScaledMeterValue(gasValue, results.get(RESULT_INDEX_SCALER_UNIT).resultData(), "gasValue"), captureTime, amrProfileStatusCode); periodicMeterReads.add(nextPeriodicMeterReads); }
Source:
public SolrQuery propertyIsEqualTo(String propertyName, String literal, boolean isCaseSensitive) { if (!isCaseSensitive) { throw new UnsupportedOperationException("Case insensitive exact searches are not supported."); } verifyInputData(propertyName, literal); String mappedPropertyName = getMappedPropertyName(propertyName, AttributeFormat.STRING, true); if (literal.isEmpty()) { return new SolrQuery("-" + mappedPropertyName + ":[\"\" TO *]"); } if (Metacard.ID.equals(propertyName)) { isIdQuery = true; ids.add(literal); } String searchPhrase = QUOTE + escapeSpecialCharacters(literal) + QUOTE; if (searchPhrase.contains(SOLR_WILDCARD_CHAR) || searchPhrase.contains(SOLR_SINGLE_WILDCARD_CHAR)) { return new SolrQuery(wildcardSolrQuery(searchPhrase, propertyName, true)); } else if (Metacard.ANY_TEXT.equals(propertyName)) { String solrQuery = resolver .anyTextFields() .map(field -> field + ":" + searchPhrase) .collect(Collectors.joining(" ")); return new SolrQuery("(" + solrQuery + ")"); } else { return new SolrQuery(mappedPropertyName + ":" + searchPhrase); } }

Target:
public SolrQuery propertyIsEqualTo(String propertyName, String literal, boolean isCaseSensitive) { if (!isCaseSensitive) { throw new UnsupportedOperationException("Case insensitive exact searches are not supported."); } verifyInputData(propertyName, literal); String mappedPropertyName = getMappedPropertyName(propertyName, AttributeFormat.STRING, true); if (literal.isEmpty()) { return new SolrQuery("-" + mappedPropertyName + ":[\"\" TO *]"); } if (Metacard.ID.equals(propertyName)) { isIdQuery = true; ids.add(literal); } String searchPhrase = QUOTE + escapeSpecialCharacters(literal) + QUOTE; if (!(searchPhrase.contains(SOLR_WILDCARD_CHAR) || searchPhrase.contains(SOLR_SINGLE_WILDCARD_CHAR)) && Metacard.ANY_TEXT.equals(propertyName)) { return new SolrQuery(wildcardSolrQuery(searchPhrase, propertyName, true, true)); } else if (searchPhrase.contains(SOLR_WILDCARD_CHAR) || searchPhrase.contains(SOLR_SINGLE_WILDCARD_CHAR) || Metacard.ANY_TEXT.equals(propertyName)) { return new SolrQuery(wildcardSolrQuery(searchPhrase, propertyName, true, false)); } else { return new SolrQuery(mappedPropertyName + ":" + searchPhrase); } }
Source:
protected String doInBackground() { LOGGER.info("loading " + name ); AtomCache cache = new AtomCache(config.getPdbFilePath(),config.getCacheFilePath()); Structure s = null; try { if ( showBiolAssembly) { s= StructureIO.getBiologicalAssembly(name); int atomCount = StructureTools.getNrAtoms(s); if ( atomCount > 200000){ LOGGER.error("Structure very large. Reducing display to C alpha atoms only"); s = BioAssemblyTools.getReducedStructure(s); } } else { s = cache.getStructure(name); } LOGGER.info("done loading structure..."); StructureAlignmentJmol jmol = new StructureAlignmentJmol(); jmol.setStructure(s); jmol.evalString("set antialiasDisplay on; select all;spacefill off; wireframe off; backbone off; cartoon;color cartoon chain; select ligand;wireframe 0.16;spacefill 0.5; select all; color cartoon structure;"); jmol.evalString("save STATE state_1"); } catch (Exception e){ e.printStackTrace(); JOptionPane.showMessageDialog(null, "Error while loading " + name + ":" + e.getMessage()); s = new StructureImpl(); } hideProgressBar(); return "Done."; }

Target:
protected String doInBackground() { LOGGER.info("loading " + name ); AtomCache cache = new AtomCache(config.getPdbFilePath(),config.getCacheFilePath()); Structure s = null; try { if ( showBiolAssembly) { s= StructureIO.getBiologicalAssembly(name); int atomCount = StructureTools.getNrAtoms(s); if ( atomCount > 200000){ LOGGER.warn("Structure very large. Reducing display to C alpha atoms only"); s = BioAssemblyTools.getReducedStructure(s); } } else { s = cache.getStructure(name); } LOGGER.info("done loading structure..."); StructureAlignmentJmol jmol = new StructureAlignmentJmol(); jmol.setStructure(s); jmol.evalString("set antialiasDisplay on; select all;spacefill off; wireframe off; backbone off; cartoon;color cartoon chain; select ligand;wireframe 0.16;spacefill 0.5; select all; color cartoon structure;"); jmol.evalString("save STATE state_1"); } catch (Exception e){ e.printStackTrace(); JOptionPane.showMessageDialog(null, "Error while loading " + name + ":" + e.getMessage()); s = new StructureImpl(); } hideProgressBar(); return "Done."; }
Source:
private InputTransformer getInputTransformer(InputStream inputStream) { XMLStreamReader xmlStreamReader = null; try { xmlStreamReader = xmlInputFactory.createXMLStreamReader(inputStream); Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (bundle == null) { return defaultInputTransformer; } BundleContext bundleContext = bundle.getBundleContext(); Collection<ServiceReference<InputTransformer>> serviceReferences = bundleContext .getServiceReferences(InputTransformer.class, null); while (xmlStreamReader.hasNext()) { int next = xmlStreamReader.next(); if (next == XMLStreamConstants.START_ELEMENT) { String namespaceUri = xmlStreamReader.getNamespaceURI(); for (ServiceReference<InputTransformer> serviceReference : serviceReferences) { if (StringUtils.equals(namespaceUri, (String) serviceReference.getProperty("schema"))) { return bundleContext.getService(serviceReference); } } } } } catch (XMLStreamException | InvalidSyntaxException e) { LOGGER.error("Failed to parse transformer namespace", e); } finally { try { if (xmlStreamReader != null) { xmlStreamReader.close(); } } catch (XMLStreamException e) { LOGGER.error("failed to close namespace reader", e); } } return null; }

Target:
private InputTransformer getInputTransformer(InputStream inputStream) { XMLStreamReader xmlStreamReader = null; try { xmlStreamReader = xmlInputFactory.createXMLStreamReader(inputStream); while (xmlStreamReader.hasNext()) { int next = xmlStreamReader.next(); if (next == XMLStreamConstants.START_ELEMENT) { String namespaceUri = xmlStreamReader.getNamespaceURI(); InputTransformer transformerReference = lookupTransformerReference( namespaceUri); if (transformerReference != null) return transformerReference; } } } catch (XMLStreamException | InvalidSyntaxException e) { LOGGER.error("Failed to parse transformer namespace", e); } finally { try { if (xmlStreamReader != null) { xmlStreamReader.close(); } } catch (XMLStreamException e) { LOGGER.error("failed to close namespace reader", e); } } return null; }
Source:
public DnsConfigurationWidget() { setDnsConfigurationEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); WidgetIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); setDnsConfigurationEditor.setLabel(constants.setDnsConfigurationLabel()); }

Target:
public DnsConfigurationWidget() { setDnsConfigurationEditor = new EntityModelCheckBoxEditor(Align.RIGHT); initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); WidgetIdHandler.idHandler.generateAndSetIds(this); driver.initialize(this); }
Source:
private void waitForLinkOpenedInNewTab(WebElement link) { int tabs = driver.getWindowHandles().size(); link.click(); new WebDriverWait(driver, TIMEOUT_PAGE_REGISTRATION) .until((Predicate<WebDriver>) input -> driver.getWindowHandles().size() > tabs); }

Target:
private void waitForLinkOpenedInNewTab(WebElement link) { int initialTabsNumber = driver.getWindowHandles().size(); link.click(); new WebDriverWait(driver, TIMEOUT_PAGE_REGISTRATION) .until((Predicate<WebDriver>) input -> getTabsCount() > initialTabsNumber); }
Source:
private ActionBarWrapper() { }

Target:
private ActionBarWrapper() { onView(TITLE_MATCHER) .check(matches(isDisplayed())); onView(NAVIGATE_UP_MATCHER) .check(matches(isDisplayed())); }
Source:
public AsyncResult<Void> waitUntilAvailable(UUID requestId) { log.error("received waitUntilAvailable on a lock believed to be a targeted sweep lock", SafeArg.of("requestId", requestId)); throw new NotSupportedException(); }

Target:
public AsyncResult<Void> waitUntilAvailable(UUID requestId) { log.error("received waitUntilAvailable on a lock believed to be a targeted sweep lock", SafeArg.of("requestId", requestId)); throw new UnsupportedOperationException("received waitUntilAvailable on a lock believed to be a targeted " + "sweep lock."); }
Source:
public void verifyHostnameThrowsSSLPeerUnverifiedExceptionWhenHostDoesNotMatch() throws Exception { System.setProperty("javax.net.ssl.trustStore", this.getClass().getResource("/ssl/trusted/cacerts.jks").getPath()); System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); Properties properties = new Properties(); properties.setProperty(GeneralOption.HOST.getKey(), "127.0.0.1"); properties.setProperty(GeneralOption.PORT.getKey(), Integer.toString(trustedService.httpsPort())); properties.setProperty(GeneralOption.USE_HTTPS.getKey(), "true"); properties.setProperty(GeneralOption.VERIFY_SSL.getKey(), "true"); ConnectorDetails connectorDetails = new ConnectorDetails(ConfigurationBuilder.initFromProperties(properties)); HttpHelper httpHelper = new HttpHelper(); HttpHost httpHost = httpHelper.buildHttpHost(connectorDetails); CloseableHttpClient closeableHttpClient = httpHelper.buildClient(httpHost, connectorDetails); when(closeableHttpClient).execute(httpHost, new HttpGet("/hello")); then(caughtException()).isInstanceOf(SSLPeerUnverifiedException.class); }

Target:
public void verifyHostnameThrowsSSLPeerUnverifiedExceptionWhenHostDoesNotMatch() throws Exception { setSystemTrustStore(); ConnectorDetails connectorDetails = buildConnectorDetails("127.0.0.1", trustedService.httpsPort(), "true", "true"); HttpHelper httpHelper = new HttpHelper(); HttpHost httpHost = httpHelper.buildHttpHost(connectorDetails); CloseableHttpClient closeableHttpClient = httpHelper.buildClient(httpHost, connectorDetails); when(closeableHttpClient).execute(httpHost, new HttpGet("/hello")); then(caughtException()).isInstanceOf(SSLPeerUnverifiedException.class); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { SharedPreferences adminPreferences = this.getSharedPreferences( AdminPreferencesActivity.ADMIN_PREFERENCES, 0); String pw = adminPreferences.getString( AdminKeys.KEY_ADMIN_PW, ""); switch (item.getItemId()) { case R.id.menu_configure_qr_code: if ("".equalsIgnoreCase(pw)) { startActivity(new Intent(this, ScanQRCodeActivity.class)); } else { showDialog(QR_PASSWORD_DIALOG); } return true; case R.id.menu_about: startActivity(new Intent(this, AboutActivity.class)); return true; case R.id.menu_general_preferences: startActivity(new Intent(this, PreferencesActivity.class)); return true; case R.id.menu_admin_preferences: if ("".equalsIgnoreCase(pw)) { startActivity(new Intent(this, AdminPreferencesActivity.class)); } else { showDialog(PASSWORD_DIALOG); } return true; } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_configure_qr_code: analytics.logEvent("ScanQRCode", "MainMenu"); if (adminPasswordProvider.isAdminPasswordSet()) { DialogUtils.showIfNotShowing(AdminPasswordDialog.create(adminPasswordProvider, AdminPasswordDialog.Action.SCAN_QR_CODE), getSupportFragmentManager()); } else { startActivity(new Intent(this, ScanQRCodeActivity.class)); } return true; case R.id.menu_about: startActivity(new Intent(this, AboutActivity.class)); return true; case R.id.menu_general_preferences: startActivity(new Intent(this, PreferencesActivity.class)); return true; case R.id.menu_admin_preferences: if (adminPasswordProvider.isAdminPasswordSet()) { DialogUtils.showIfNotShowing(AdminPasswordDialog.create(adminPasswordProvider, AdminPasswordDialog.Action.ADMIN_SETTINGS), getSupportFragmentManager()); } else { startActivity(new Intent(this, AdminPreferencesActivity.class)); } return true; } return super.onOptionsItemSelected(item); }
Source:
public void createResourceGroup() { String resourceGroupName = Configuration.getGlobalConfiguration().get(AZURE_RESOURCEGROUP_NAME); boolean resourceGroupNameSet = !CoreUtils.isNullOrEmpty(resourceGroupName); if (!resourceGroupNameSet) { resourceGroupName = TEST_RESOURCE_GROUP; } if (resourceGroupNameSet && azure.resourceGroups().checkExistence(resourceGroupName)) { System.out.println("Fetching Resource Group: " + resourceGroupName); resourceGroup = azure.resourceGroups() .getByName(resourceGroupName); } else { System.out.println("Creating Resource Group: " + resourceGroupName); resourceGroup = azure.resourceGroups() .define(resourceGroupName) .withRegion(location) .create(); } }

Target:
public void createResourceGroup() { String resourceGroupName = Configuration.getGlobalConfiguration().get(AZURE_RESOURCEGROUP_NAME, TEST_RESOURCE_GROUP); if (azure.resourceGroups().checkExistence(resourceGroupName)) { System.out.println("Fetching Resource Group: " + resourceGroupName); resourceGroup = azure.resourceGroups() .getByName(resourceGroupName); } else { System.out.println("Creating Resource Group: " + resourceGroupName); resourceGroup = azure.resourceGroups() .define(resourceGroupName) .withRegion(location) .create(); } }
Source:
synchronized Currency getDefaultCurrency() { if (this.campaign == null) { return this.backupCurrency; } DateTime date = this.campaign.getDateTime(); if (this.lastChecked == null || this.lastChecked.isBefore(date)) { this.lastChecked = date; this.defaultCurrency = this.backupCurrency; Map<String, Currency> possibleCurrencies = new HashMap<>(); int year = date.getYear(); for (Currency currency : this.currencies) { if ((year >= currency.getStartYear()) && (year <= currency.getEndYear())) { if (currency.getIsDefault()) { return defaultCurrency = currency; } possibleCurrencies.put(currency.getCode(), currency); } } for (Contract contract : this.campaign.getActiveContracts()) { if (contract instanceof AtBContract) { Currency currency = possibleCurrencies.getOrDefault( Faction.getFaction(((AtBContract)contract).getEmployerCode()).getCurrencyCode(), null); if (currency != null) { return defaultCurrency = currency; } } } PlanetarySystem psystem = this.campaign.getCurrentSystem(); if (psystem != null) { Set<Faction> factions = psystem.getFactionSet(date); for (Faction faction : factions) { Currency currency = possibleCurrencies.getOrDefault(faction.getCurrencyCode(), null); if (currency != null) { return defaultCurrency = currency; } } } } return defaultCurrency; }

Target:
synchronized Currency getDefaultCurrency() { if (this.campaign == null) { return this.backupCurrency; } DateTime date = this.campaign.getDateTime(); PlanetarySystem currentSystem = this.campaign.getCurrentSystem(); if (this.lastChecked == null || this.lastChecked.isBefore(date) || !Objects.equals(this.lastSystem, currentSystem)) { this.lastChecked = date; this.lastSystem = currentSystem; this.defaultCurrency = this.backupCurrency; Map<String, Currency> possibleCurrencies = new HashMap<>(); int year = date.getYear(); for (Currency currency : this.currencies) { if ((year >= currency.getStartYear()) && (year <= currency.getEndYear())) { if (currency.getIsDefault()) { return defaultCurrency = currency; } possibleCurrencies.put(currency.getCode(), currency); } } for (Contract contract : this.campaign.getActiveContracts()) { if (contract instanceof AtBContract) { Currency currency = possibleCurrencies.getOrDefault( Faction.getFaction(((AtBContract)contract).getEmployerCode()).getCurrencyCode(), null); if (currency != null) { return defaultCurrency = currency; } } } if (currentSystem != null) { Set<Faction> factions = currentSystem.getFactionSet(date); for (Faction faction : factions) { Currency currency = possibleCurrencies.getOrDefault(faction.getCurrencyCode(), null); if (currency != null) { return defaultCurrency = currency; } } } } return defaultCurrency; }
Source:
public Response listPersistedReports(UriInfo uriInfo) { final QueryParameters queryParameters = QueryParametersBuilder.buildFrom(uriInfo); final List<ReportCatalogEntry> persistedReports = reportStoreService.getPage(queryParameters.getOffset(), queryParameters.getLimit()); if (persistedReports.isEmpty()) { return Response.noContent().build(); } final Map<String, Object> formatMap = reportStoreService.getFormatMap(); final JSONArray jsonArray = new JSONArray(); for (ReportCatalogEntry eachEntry : persistedReports) { final JSONObject jsonObject = new JSONObject(eachEntry); final List<ReportFormat> formats = (List<ReportFormat>)formatMap.get(eachEntry.getReportId()); if (formats != null && !formats.isEmpty()) { jsonObject.put("formats", new JSONArray(formats)); } else { final String format = eachEntry.getLocation().substring(eachEntry.getLocation().lastIndexOf(".") + 1); jsonObject.put("formats", new JSONArray("[" + format.toUpperCase() +"]")); } jsonArray.put(jsonObject); } return Response.ok() .header("Content-Range", ResponseUtils.getContentRange(jsonArray.length(), queryParameters.getOffset(), reportStoreService.countAll())) .entity(jsonArray.toString()) .type(MediaType.APPLICATION_JSON_TYPE) .build(); }

Target:
public Response listPersistedReports(UriInfo uriInfo) { final QueryParameters queryParameters = QueryParametersBuilder.buildFrom(uriInfo); final List<ReportCatalogEntry> persistedReports = reportStoreService.getPage(queryParameters.getOffset(), queryParameters.getLimit()); if (persistedReports.isEmpty()) { return Response.noContent().build(); } final Map<String, Object> formatMap = reportStoreService.getFormatMap(); final JSONArray jsonArray = new JSONArray(); for (ReportCatalogEntry eachEntry : persistedReports) { final JSONObject jsonObject = new JSONObject(eachEntry); final List<ReportFormat> formats = (List<ReportFormat>)formatMap.get(eachEntry.getReportId()); if (formats != null && !formats.isEmpty()) { jsonObject.put("formats", new JSONArray(formats)); } else { final String format = eachEntry.getLocation().substring(eachEntry.getLocation().lastIndexOf(".") + 1); final JSONArray formatsArray = new JSONArray(); formatsArray.put(format.toUpperCase()); jsonObject.put("formats", formatsArray); } jsonArray.put(jsonObject); } return Response.ok() .header("Content-Range", ResponseUtils.getContentRange(jsonArray.length(), queryParameters.getOffset(), reportStoreService.countAll())) .entity(jsonArray.toString()) .type(MediaType.APPLICATION_JSON_TYPE) .build(); }
Source:
public void process(JSONRequestContext requestContext) { CurriculumDAO curriculumDAO = DAOFactory.getInstance().getCurriculumDAO(); Long curriculumId = requestContext.getLong("curriculumId"); Curriculum curriculum = curriculumDAO.findById(curriculumId); curriculumDAO.archive(curriculum); }

Target:
public void process(JSONRequestContext requestContext) { CurriculumDAO curriculumDAO = DAOFactory.getInstance().getCurriculumDAO(); Long curriculumId = requestContext.getLong("curriculumId"); Curriculum curriculum = curriculumId != null ? curriculumDAO.findById(curriculumId) : null; if (curriculum != null) curriculumDAO.archive(curriculum); else throw new SmvcRuntimeException(StatusCode.UNDEFINED, "Given curriculum was not found."); }
Source:
public String toString() { return StringUtils.nonStrictFormat( "QueryInterruptedException{msg=%s, code=%s, class=%s, host=%s}", getMessage(), errorCode, errorClass, host ); }

Target:
public String toString() { return StringUtils.format( "QueryInterruptedException{msg=%s, code=%s, class=%s, host=%s}", getMessage(), errorCode, errorClass, host ); }
Source:
public UserDetails myUserDetailsService() { ExtendedInMemoryUserDetailsManager extendedInMemoryUserDetailsManager = new ExtendedInMemoryUserDetailsManager(); List<GrantedAuthority> salaboyAuthorities = new ArrayList<>(); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); extendedInMemoryUserDetailsManager.createUser(new User("salaboy", "password", salaboyAuthorities)); List<GrantedAuthority> adminAuthorities = new ArrayList<>(); adminAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_ADMIN")); extendedInMemoryUserDetailsManager.createUser(new User("admin", "password", adminAuthorities)); List<GrantedAuthority> garthAuthorities = new ArrayList<>(); garthAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); garthAuthorities.add(new SimpleGrantedAuthority("GROUP_doctor")); extendedInMemoryUserDetailsManager.createUser(new User("garth", "password", garthAuthorities)); return (UserDetails) extendedInMemoryUserDetailsManager; }

Target:
public UserDetailsService myUserDetailsService() { ExtendedInMemoryUserDetailsManager extendedInMemoryUserDetailsManager = new ExtendedInMemoryUserDetailsManager(); List<GrantedAuthority> salaboyAuthorities = new ArrayList<>(); salaboyAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); salaboyAuthorities.add(new SimpleGrantedAuthority("GROUP_activitiTeam")); extendedInMemoryUserDetailsManager.createUser(new User("salaboy", "password", salaboyAuthorities)); List<GrantedAuthority> adminAuthorities = new ArrayList<>(); adminAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_ADMIN")); extendedInMemoryUserDetailsManager.createUser(new User("admin", "password", adminAuthorities)); List<GrantedAuthority> garthAuthorities = new ArrayList<>(); garthAuthorities.add(new SimpleGrantedAuthority("ROLE_ACTIVITI_USER")); garthAuthorities.add(new SimpleGrantedAuthority("GROUP_doctor")); extendedInMemoryUserDetailsManager.createUser(new User("garth", "password", garthAuthorities)); return extendedInMemoryUserDetailsManager; }
Source:
public boolean initializeApplication() { boolean isOk = initializeApplicationHelper(); if (isOk) { if (record.convertedFromOldFormat()) { updateAppRecord(); } } return isOk; }

Target:
public boolean initializeApplication() { boolean appReady = initializeApplicationHelper(); if (appReady) { if (record.wasConvertedByDbUpgrader()) { updateAppRecord(); } } return appReady; }