auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void attemptLogin() { unsubscribe(); authRepository.clearLoginCache(); subscribe(); mEmailView.setError(null); mPasswordView.setError(null); String email = mEmailView.getText().toString(); String password = mPasswordView.getText().toString(); boolean cancel = false; View focusView = null; if (TextUtils.isEmpty(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); focusView = mPasswordView; cancel = true; } if (TextUtils.isEmpty(email)) { mEmailView.setError(getString(R.string.error_field_required)); focusView = mEmailView; cancel = true; } else if (!isEmailValid(email)) { mEmailView.setError(getString(R.string.error_invalid_email)); focusView = mEmailView; cancel = true; } if (cancel) { focusView.requestFocus(); } else { hideKeyboard(); showProgress(true); isLoggingIn = true; authRepository.login(email, password); } }

Target:
private void attemptLogin() { unsubscribe(); authRepository.clearLoginCache(); subscribe(); String email = emailView.getText().toString(); String password = passwordView.getText().toString(); View erroredView = validateLoginData(email, password); if (erroredView != null) { erroredView.requestFocus(); } else { hideKeyboard(); authRepository.login(email, password); } }
Source:
public void testFetchWithRefInWantUnknownRef() throws Exception { thrown.expect(PackProtocolException.class); thrown.expectMessage("Invalid ref name: refs/heads/branchC"); PacketLineIn pckIn = buildPckIn(PacketLineIn.DELIM, "want e4980cdc48cfa1301493ca94eb70523f6788b819", "want-ref refs/heads/branchC", PacketLineIn.END); ProtocolV2Parser parser = new ProtocolV2Parser( ConfigBuilder.start().allowRefInWant().done()); RevCommit one = testRepo.commit().message("1").create(); RevCommit two = testRepo.commit().message("2").create(); testRepo.update("branchA", one); testRepo.update("branchB", two); parser.parseFetchRequest(pckIn, testRepo.getRepository().getRefDatabase()); }

Target:
public void testFetchWithRefInWantUnknownRef() throws Exception { thrown.expect(PackProtocolException.class); thrown.expectMessage(containsString("refs/heads/branchC")); PacketLineIn pckIn = formatAsPacketLine(PacketLineIn.DELIM, "want e4980cdc48cfa1301493ca94eb70523f6788b819", "want-ref refs/heads/branchC", PacketLineIn.END); ProtocolV2Parser parser = new ProtocolV2Parser( ConfigBuilder.start().allowRefInWant().done()); RevCommit one = testRepo.commit().message("1").create(); RevCommit two = testRepo.commit().message("2").create(); testRepo.update("branchA", one); testRepo.update("branchB", two); parser.parseFetchRequest(pckIn, testRepo.getRepository().getRefDatabase()); }
Source:
public String evaluate(final Diagram source, final IParameterValueList2 parameterValues, final IFacetManager facetManager) throws DerivedTypedElementException { ETypedElement sfParam = null; if (parameterValues != null) { sfParam = (ETypedElement) parameterValues .getParameterValueByName("eStructuralFeature").getValue(); } String result = null; if (sfParam == null) { final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.insertAdapterFactory(new InternationalizationNotationItemProviderAdapterFactory()); try { final IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(source, IItemLabelProvider.class); if (itemLabelProvider instanceof ReflectiveItemProvider) { result = LabelQuery.getDefaultName(source); } else if (itemLabelProvider == null) { result = ModelUtils.getDefaultName(source); } else { result = itemLabelProvider.getText(source); } } finally { adapterFactory.dispose(); } } else { try { if (sfParam instanceof EAttribute && sfParam.getUpperBound() == 1) { final Object object = facetManager.getOrInvoke(source, sfParam, Object.class); final String objectLabel = getObjectLabel(object, facetManager); result = sfParam.getName() + " = " + objectLabel; } else { result = sfParam.getName(); } } catch (final Exception e) { throw new DerivedTypedElementException(e); } } return result; }

Target:
public String evaluate(final Diagram source, final IParameterValueList2 parameterValues, final IFacetManager facetManager) throws DerivedTypedElementException { final String label = LabelInternationalization.getInstance().getDiagramLabel(source); return label == null || label.length() == 0 ? NotationEditPlugin.INSTANCE.getString("_UI_Diagram_type", true) : NotationEditPlugin.INSTANCE.getString("_UI_Diagram_type", true) + " " + label; }
Source:
protected RelationshipRest createAndReturn(Context context, List<DSpaceObject> list) throws AuthorizeException, SQLException, RepositoryMethodNotImplementedException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); Relationship relationship = new Relationship(); if (list.size() == 2 && list.get(0).getType() == Constants.ITEM && list.get(1).getType() == Constants.ITEM) { Item leftItem = (Item) list.get(0); Item rightItem = (Item) list.get(1); RelationshipType relationshipType = relationshipTypeService .find(context, Integer.parseInt(req.getParameter("relationshipType"))); EPerson ePerson = context.getCurrentUser(); if (authorizeService.authorizeActionBoolean(context, leftItem, Constants.WRITE) || authorizeService.authorizeActionBoolean(context, rightItem, Constants.WRITE)) { relationship.setLeftItem(leftItem); relationship.setRightItem(rightItem); relationship.setRelationshipType(relationshipType); relationship = relationshipService.create(context, relationship); return relationshipConverter.fromModel(relationship); } else { throw new AccessDeniedException("You do not have write rights on this relationship's items"); } } else { throw new UnprocessableEntityException("The given items in the request were not valid items"); } }

Target:
protected RelationshipRest createAndReturn(Context context, List<DSpaceObject> list) throws AuthorizeException, SQLException, RepositoryMethodNotImplementedException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); Relationship relationship = new Relationship(); if (list.size() == 2 && list.get(0).getType() == Constants.ITEM && list.get(1).getType() == Constants.ITEM) { Item leftItem = (Item) list.get(0); Item rightItem = (Item) list.get(1); RelationshipType relationshipType = relationshipTypeService .find(context, Integer.parseInt(req.getParameter("relationshipType"))); relationship.setLeftItem(leftItem); relationship.setRightItem(rightItem); relationship.setRelationshipType(relationshipType); try { relationship = relationshipService.create(context, relationship); } catch (AuthorizeException e) { throw new AccessDeniedException("You do not have write rights on this relationship's items"); } return relationshipConverter.fromModel(relationship); } else { throw new UnprocessableEntityException("The given items in the request were not valid items"); } }
Source:
public TimeGraphFilterDialog(Shell parent) { super(parent); setResult(new ArrayList<>(0)); setStatusLineAboveButtons(true); setHelpAvailable(false); fExpandedElements = null; fAdditionalFilterButtonInfo = new ArrayList<>(); }

Target:
public TimeGraphFilterDialog(Shell parent) { super(parent); setResult(new ArrayList<>(0)); setStatusLineAboveButtons(true); setHelpAvailable(false); fExpandedElements = null; fCheckActiveProvider = null; fUncheckInactiveProvider = null; }
Source:
public synchronized void play(String path, int seekTo, String title, TranscriptModel trModel, DownloadEntry video) { setScreenOnWhilePlaying(false); isPrepared = false; if ( !isScreenLandscape()) { exitFullScreen(); } clearAllErrors(); try { player.reset(); } catch (Exception e) { logger.error(e); } if(video!=null){ this.videoEntry = video; } if (trModel != null) { this.transcript = trModel; TranscriptManager tm = new TranscriptManager(getActivity()); tm.downloadTranscriptsForVideo(trModel); } try{ PrefManager pm = new PrefManager(getActivity(), PrefManager.Pref.LOGIN); languageSubtitle = pm.getString(PrefManager.Key.TRANSCRIPT_LANGUAGE); }catch(Exception e){ logger.error(e); } requestAudioFocus(); try { showProgress(); if (path == null || path.trim().length() == 0) { showVideoNotAvailable(); } else { hideVideoNotAvailable(); } this.transcript = trModel; player.setLMSUrl(video.lmsUrl); player.setVideoTitle(title); logger.debug("playing [seek=" + seekTo + "]: " + path); boolean enableShare = videoEntry != null && !TextUtils.isEmpty(videoEntry.getYoutubeVideoUrl()) && new FacebookProvider().isLoggedIn(); player.setShareEnabled(enableShare); player.setUriAndPlay(path, seekTo); } catch (Exception e) { logger.error(e); } }

Target:
public synchronized void play(String path, int seekTo, String title, TranscriptModel trModel, DownloadEntry video) { isPrepared = false; if ( !isScreenLandscape()) { exitFullScreen(); } clearAllErrors(); try { player.reset(); } catch (Exception e) { logger.error(e); } if(video!=null){ this.videoEntry = video; } if (trModel != null) { this.transcript = trModel; TranscriptManager tm = new TranscriptManager(getActivity()); tm.downloadTranscriptsForVideo(trModel); } try{ PrefManager pm = new PrefManager(getActivity(), PrefManager.Pref.LOGIN); languageSubtitle = pm.getString(PrefManager.Key.TRANSCRIPT_LANGUAGE); }catch(Exception e){ logger.error(e); } requestAudioFocus(); try { showProgress(); if (path == null || path.trim().length() == 0) { showVideoNotAvailable(); } else { hideVideoNotAvailable(); } this.transcript = trModel; player.setLMSUrl(video.lmsUrl); player.setVideoTitle(title); logger.debug("playing [seek=" + seekTo + "]: " + path); boolean enableShare = videoEntry != null && !TextUtils.isEmpty(videoEntry.getYoutubeVideoUrl()) && new FacebookProvider().isLoggedIn(); player.setShareEnabled(enableShare); player.setUriAndPlay(path, seekTo); } catch (Exception e) { logger.error(e); } }
Source:
public TotpBean(KeycloakSession session, RealmModel realm, UserModel user, UriBuilder uriBuilder) { this.realm = realm; this.uriBuilder = uriBuilder; this.enabled = ((OTPCredentialProvider)session.getProvider(CredentialProvider.class, "keycloak-otp")).isConfiguredFor(realm, user); if (enabled) { otpCredentials = session.userCredentialManager().getStoredCredentialsByType(realm, user, OTPCredentialModel.TYPE); } else { otpCredentials = Collections.EMPTY_LIST; } this.totpSecret = HmacOTP.generateSecret(20); this.totpSecretEncoded = TotpUtils.encode(totpSecret); this.totpSecretQrCode = TotpUtils.qrCode(totpSecret, realm, user); }

Target:
public TotpBean(KeycloakSession session, RealmModel realm, UserModel user, UriBuilder uriBuilder) { this.realm = realm; this.uriBuilder = uriBuilder; this.enabled = session.userCredentialManager().isConfiguredFor(realm, user, OTPCredentialModel.TYPE); if (enabled) { otpCredentials = session.userCredentialManager().getStoredCredentialsByType(realm, user, OTPCredentialModel.TYPE); } else { otpCredentials = Collections.EMPTY_LIST; } this.totpSecret = HmacOTP.generateSecret(20); this.totpSecretEncoded = TotpUtils.encode(totpSecret); this.totpSecretQrCode = TotpUtils.qrCode(totpSecret, realm, user); }
Source:
private void updateActionAvailability() { if (getSelectedItems() == null || getSelectedItems().size() == 0) { getEnableHookCommand().setIsExecutionAllowed(false); getDisableHookCommand().setIsExecutionAllowed(false); return; } getEnableHookCommand().setIsExecutionAllowed(true); getDisableHookCommand().setIsExecutionAllowed(true); for (GlusterHookEntity hook : Linq.<GlusterHookEntity> Cast(getSelectedItems())) { if (hook.getStatus() == GlusterHookStatus.ENABLED) { getEnableHookCommand().setIsExecutionAllowed(false); } else { getDisableHookCommand().setIsExecutionAllowed(false); } } }

Target:
private void updateActionAvailability() { if (getSelectedItems() == null || getSelectedItems().size() == 0) { getEnableHookCommand().setIsExecutionAllowed(false); getDisableHookCommand().setIsExecutionAllowed(false); return; } getEnableHookCommand().setIsExecutionAllowed(true); getDisableHookCommand().setIsExecutionAllowed(true); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; if (hook.getStatus() == GlusterHookStatus.ENABLED) { getEnableHookCommand().setIsExecutionAllowed(false); } else { getDisableHookCommand().setIsExecutionAllowed(false); } if (!getEnableHookCommand().getIsExecutionAllowed() && !getDisableHookCommand().getIsExecutionAllowed()) { break; } } }
Source:
public void destroy() throws Exception { this.pool.close(); this.pool.removeAllIdleItems(); }

Target:
public void destroy() throws Exception { this.pool.close(); }
Source:
public void containersChanged(Set<TaskContainerDelta> containers) { for (TaskContainerDelta delta : containers) { IRepositoryElement reviewRepoElement = delta.getElement(); if (!(reviewRepoElement instanceof ITask)) { return; } ITask review = (ITask) reviewRepoElement; AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(review.getConnectorKind()); if (review != null && connector instanceof ReviewsConnector) { try { String reviewUrl = review.getUrl(); switch (delta.getKind()) { case REMOVED: break; case DELETED: deleteMappingsTo(reviewUrl); break; case ADDED: case CONTENT: TaskData taskData = taskDataManager.getTaskData(review); if (taskData == null) { continue; } TaskAttribute attr = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); if (attr == null) { continue; } String reviewDescription = attr.getValue(); updateMapping(reviewUrl, reviewDescription); break; default: StatusHandler.log(new Status(IStatus.ERROR, ReviewsCoreConstants.PLUGIN_ID, "Unknown change")); } } catch (CoreException e) { StatusHandler.log( new Status(IStatus.ERROR, ReviewsCoreConstants.PLUGIN_ID, "Error getting taskData.", e)); } } } }

Target:
public void containersChanged(Set<TaskContainerDelta> containers) { for (TaskContainerDelta delta : containers) { IRepositoryElement reviewRepoElement = delta.getElement(); if (!(reviewRepoElement instanceof ITask)) { return; } ITask review = (ITask) reviewRepoElement; AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(review.getConnectorKind()); if (review != null && connector instanceof ReviewsConnector) { try { String reviewUrl = review.getUrl(); switch (delta.getKind()) { case DELETED: deleteMappingsTo(reviewUrl); break; case ADDED: case CONTENT: TaskData taskData = taskDataManager.getTaskData(review); if (taskData == null) { continue; } TaskAttribute attr = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION); if (attr == null) { continue; } String reviewDescription = attr.getValue(); updateMapping(reviewUrl, reviewDescription); break; } } catch (CoreException e) { StatusHandler.log( new Status(IStatus.ERROR, ReviewsCoreConstants.PLUGIN_ID, "Error getting taskData.", e)); } } } }
Source:
public ServiceCall<AnalysisResults> analyze(AnalyzeOptions parameters) { RequestBuilder builder = RequestBuilder.post("/v1/analyze"); builder.query("version", versionDate); if (parameters != null) { builder.bodyJson(GsonSingleton.getGson().toJsonTree(parameters).getAsJsonObject()); } else { builder.bodyJson(new JsonObject()); } return createServiceCall(builder.build(), ResponseConverterUtils.getObject(AnalysisResults.class)); }

Target:
public ServiceCall<AnalysisResults> analyze(AnalyzeOptions parameters) { RequestBuilder builder = RequestBuilder.post("/v1/analyze"); builder.query(VERSION, versionDate); if (parameters != null) { builder.bodyJson(GsonSingleton.getGson().toJsonTree(parameters).getAsJsonObject()); } else { builder.bodyJson(new JsonObject()); } return createServiceCall(builder.build(), ResponseConverterUtils.getObject(AnalysisResults.class)); }
Source:
protected void sendDispositionHeader(OutputStream out) throws IOException { super.sendDispositionHeader(out); out.write(EncodingUtil.getAsciiBytes(FILE_NAME)); out.write(QUOTE_BYTES); out.write(EncodingUtil.getBytes(filename, getCharSet())); out.write(QUOTE_BYTES); }

Target:
protected void sendDispositionHeader(OutputStream out) throws IOException { super.sendDispositionHeader(out); if (filename != null) { out.write(EncodingUtil.getAsciiBytes(FILE_NAME)); out.write(QUOTE_BYTES); out.write(EncodingUtil.getBytes(filename, getCharSet())); out.write(QUOTE_BYTES); } }
Source:
public static UpdateCalibrationResponse createFromPutBatchResponse(final Map<String, Optional<Boolean>> putBatchResponse) { final UpdateCalibrationResponse updateCalibrationResponse = UpdateCalibrationResponse.createEmpty(); for (final Map.Entry<String, Optional<Boolean>> item : putBatchResponse.entrySet()) { if (!item.getValue().isPresent()) { updateCalibrationResponse.addFailedConditionItem(item.getKey()); } else if (item.getValue().get()) { updateCalibrationResponse.addSuccessItem(item.getKey()); } else { updateCalibrationResponse.addUnprocessedItem(item.getKey()); } } return updateCalibrationResponse; }

Target:
public static UpdateCalibrationResponse createFromPutBatchResponse(final Map<String, Optional<Boolean>> putBatchResponse) { final UpdateCalibrationResponse updateCalibrationResponse = new UpdateCalibrationResponse(); for (final Map.Entry<String, Optional<Boolean>> item : putBatchResponse.entrySet()) { if (!item.getValue().isPresent()) { updateCalibrationResponse.addFailedConditionItem(item.getKey()); } else if (item.getValue().get()) { updateCalibrationResponse.addSuccessItem(item.getKey()); } else { updateCalibrationResponse.addUnprocessedItem(item.getKey()); } } return updateCalibrationResponse; }
Source:
public DataContainer toContainer() { return DataContainer.createNew().set(Queries.CONTENT_VERSION, this.getContentVersion()) .set(DataQuery.of("materialcost"), this.getMaterialCost()) .set(DataQuery.of("levelcost"), this.getLevelCost()); }

Target:
public DataContainer toContainer() { return DataContainer.createNew().set(Queries.CONTENT_VERSION, this.getContentVersion()) .set(DataQueries.MATERIALCOST, this.getMaterialCost()) .set(DataQueries.LEVELCOST, this.getLevelCost()); }
Source:
public void createsCommit() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_CREATED, "{\"sha\":\"0abcd89jcabitest\"}" ) ).start(); final Commits commits = new RtCommits( new ApacheRequest(container.home()), repo() ); final JsonObject author = Json.createObjectBuilder() .add("name", "Scott").add("email", "scott@gmail.com") .add("date", "2011-06-17T14:53:35-07:00").build(); final JsonObject input = Json.createObjectBuilder() .add("message", "initial version") .add("author", author).build(); try { MatcherAssert.assertThat( commits.create(input), Matchers.instanceOf(Commit.class) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); } finally { container.stop(); } }

Target:
public final void createsCommit() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_CREATED, "{\"sha\":\"0abcd89jcabitest\"}" ) ).start(); final Commits commits = new RtCommits( new ApacheRequest(container.home()), repo() ); final JsonObject author = Json.createObjectBuilder() .add("name", "Scott").add("email", "scott@gmail.com") .add("date", "2011-06-17T14:53:35-07:00").build(); final JsonObject input = Json.createObjectBuilder() .add("message", "initial version") .add("author", author).build(); try { final Commit newCommit = commits.create(input); MatcherAssert.assertThat( newCommit, Matchers.instanceOf(Commit.class) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); MatcherAssert.assertThat( newCommit.sha(), Matchers.equalTo("0abcd89jcabitest") ); } finally { container.stop(); } }
Source:
public static FxSwap ofForwardPoints( CurrencyAmount amount, FxRate nearRate, double decimalForwardPoints, LocalDate nearDate, LocalDate farDate) { Currency currency1 = amount.getCurrency(); ArgChecker.isTrue( nearRate.getPair().contains(currency1), Messages.format("Amount and FX rate have a currency in common: and {}", amount, nearDate)); FxRate farRate = FxRate.of(nearRate.getPair(), nearRate.fxRate(nearRate.getPair()) + decimalForwardPoints); FxSingle nearLeg = FxSingle.of(amount, nearRate, nearDate); FxSingle farLeg = FxSingle.of(amount.negated(), farRate, farDate); return of(nearLeg, farLeg); }

Target:
public static FxSwap ofForwardPoints( CurrencyAmount amount, FxRate nearRate, double decimalForwardPoints, LocalDate nearDate, LocalDate farDate) { Currency currency1 = amount.getCurrency(); ArgChecker.isTrue( nearRate.getPair().contains(currency1), Messages.format("Amount and FX rate have no currency in common: and {}", amount, nearRate)); FxRate farRate = FxRate.of(nearRate.getPair(), nearRate.fxRate(nearRate.getPair()) + decimalForwardPoints); FxSingle nearLeg = FxSingle.of(amount, nearRate, nearDate); FxSingle farLeg = FxSingle.of(amount.negated(), farRate, farDate); return of(nearLeg, farLeg); }
Source:
public InstructorAttributes getCopy() { return builder(courseId, name, email) .withGoogleId(googleId).withKey(key).withRole(role).withDisplayedName(displayedName) .withPrivileges(privileges).withIsDisplayedToStudents(isDisplayedToStudents).withIsArchived(isArchived) .build(); }

Target:
public InstructorAttributes getCopy() { return builder(googleId, courseId, name, email) .withKey(key).withRole(role).withDisplayedName(displayedName) .withPrivileges(privileges).withIsDisplayedToStudents(isDisplayedToStudents).withIsArchived(isArchived) .build(); }
Source:
private String restoreAsync( SolrClient client, String collection, String backupLocation, String backupName) throws IOException, SolrServerException { if (canRestore(client, collection)) { CollectionAdminRequest.Restore restore = CollectionAdminRequest.AsyncCollectionAdminRequest.restoreCollection( collection, backupName) .setLocation(backupLocation); String requestId = restore.processAsync(client); LOGGER.debug("Restore request Id: {}", requestId); return requestId; } else { LOGGER.info("Unable to restore: {}, collection already exists", collection); return null; } }

Target:
private String restoreAsync( SolrClient client, String collection, String backupLocation, String backupName) throws IOException, SolrServerException { if (canRestore(client, collection)) { CollectionAdminRequest.Restore restore = CollectionAdminRequest.AsyncCollectionAdminRequest.restoreCollection( collection, backupName) .setLocation(backupLocation); String requestId = restore.processAsync(client); LOGGER.debug("Restore request Id: {}", requestId); return requestId; } else { printErrorMessage( String.format("Unable to restore %s, collection already exists.", collection)); LOGGER.debug("Unable to restore: {}, collection already exists", collection); return null; } }
Source:
public int getPluginId() { return 90303; }

Target:
public int getPluginId() { return 90002; }
Source:
public static CsvFile of(CharSource source, boolean headerRow) { ArgChecker.notNull(source, "source"); List<ImmutableList<String>> lines; try { lines = parse(source); } catch (IOException e) { throw new UncheckedIOException(e); } if (headerRow) { if (lines.isEmpty()) { throw new IllegalArgumentException("Could not read header row from empty CSV file"); } ImmutableList<String> headers = lines.remove(0); ImmutableList<String> searchHeaders = headers.stream() .map(h -> h.toLowerCase()) .collect(Builder<String>::new, Builder<String>::add, (b1, b2) -> b1.addAll(b2.build())) .build(); ImmutableList<ImmutableList<String>> dataLines = ImmutableList.copyOf(lines); return new CsvFile(headers, searchHeaders, dataLines); } else { return new CsvFile(ImmutableList.copyOf(lines)); } }

Target:
public static CsvFile of(CharSource source, boolean headerRow) { ArgChecker.notNull(source, "source"); List<ImmutableList<String>> lines; try { lines = parse(source); } catch (IOException ex) { throw new UncheckedIOException(ex); } if (headerRow) { if (lines.isEmpty()) { throw new IllegalArgumentException("Could not read header row from empty CSV file"); } ImmutableList<String> headers = lines.remove(0); ImmutableList<ImmutableList<String>> dataLines = ImmutableList.copyOf(lines); return new CsvFile(headers, dataLines); } else { return new CsvFile(ImmutableList.copyOf(lines)); } }
Source:
private void clearAllNotifications() { int numChildren = mStackScroller.getChildCount(); final ArrayList<View> viewsToHide = new ArrayList<View>(numChildren); for (int i = 0; i < numChildren; i++) { final View child = mStackScroller.getChildAt(i); if (child instanceof ExpandableNotificationRow) { if (mStackScroller.canChildBeDismissed(child)) { if (child.getVisibility() == View.VISIBLE) { viewsToHide.add(child); } } ExpandableNotificationRow row = (ExpandableNotificationRow) child; List<ExpandableNotificationRow> children = row.getNotificationChildren(); if (row.areChildrenExpanded() && children != null) { for (ExpandableNotificationRow childRow : children) { if (childRow.getVisibility() == View.VISIBLE) { viewsToHide.add(childRow); } } } } } if (viewsToHide.isEmpty()) { animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); return; } addPostCollapseAction(new Runnable() { @Override public void run() { mStackScroller.setDismissAllInProgress(false); try { mBarService.onClearAllNotifications(mCurrentUserId); } catch (Exception ex) { } for (View v : viewsToHide) { if (!(v instanceof ExpandableNotificationRow)) { continue; } StatusBarNotification sbn = ((ExpandableNotificationRow)v).getStatusBarNotification(); if (!sbn.isClearable()) { mStackScroller.snapView(v, false ); } } } }); performDismissAllAnimations(viewsToHide); }

Target:
private void clearAllNotifications() { int numChildren = mStackScroller.getChildCount(); final ArrayList<View> viewsToHide = new ArrayList<View>(numChildren); for (int i = 0; i < numChildren; i++) { final View child = mStackScroller.getChildAt(i); if (child instanceof ExpandableNotificationRow) { if (mStackScroller.canChildBeDismissed(child)) { if (child.getVisibility() == View.VISIBLE) { viewsToHide.add(child); } } ExpandableNotificationRow row = (ExpandableNotificationRow) child; List<ExpandableNotificationRow> children = row.getNotificationChildren(); if (row.areChildrenExpanded() && children != null) { for (ExpandableNotificationRow childRow : children) { if (childRow.getVisibility() == View.VISIBLE) { viewsToHide.add(childRow); } } } } } if (viewsToHide.isEmpty()) { animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); return; } addPostCollapseAction(new Runnable() { @Override public void run() { mStackScroller.setDismissAllInProgress(false); try { mBarService.onClearAllNotifications(mCurrentUserId); } catch (Exception ex) { } } }); performDismissAllAnimations(viewsToHide); }
Source:
private List<ElasticsearchEdge> getElasticsearchEdges(SearchHits hits, FetchHints fetchHints, Authorizations authorizations) { return StreamUtils.stream(hits) .map(hit -> { String inVertexId = null; String outVertexId = null; String label = null; if (fetchHints.equals(FetchHints.EDGE_REFS)) { inVertexId = hit.getField(Elasticsearch5SearchIndex.IN_VERTEX_ID_FIELD_NAME).getValue(); outVertexId = hit.getField(Elasticsearch5SearchIndex.OUT_VERTEX_ID_FIELD_NAME).getValue(); label = hit.getField(Elasticsearch5SearchIndex.EDGE_LABEL_FIELD_NAME).getValue(); } String elementId = hit.getField(Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME).getValue(); return new ElasticsearchEdge( getGraph(), elementId, label, inVertexId, outVertexId, fetchHints, authorizations ); }).collect(Collectors.toList()); }

Target:
private List<ElasticsearchEdge> getElasticsearchEdges(SearchHits hits, FetchHints fetchHints, Authorizations authorizations) { return stream(hits) .map(hit -> { String inVertexId = hit.getField(Elasticsearch5SearchIndex.IN_VERTEX_ID_FIELD_NAME).getValue(); String outVertexId = hit.getField(Elasticsearch5SearchIndex.OUT_VERTEX_ID_FIELD_NAME).getValue(); String label = hit.getField(Elasticsearch5SearchIndex.EDGE_LABEL_FIELD_NAME).getValue(); String elementId = hit.getField(Elasticsearch5SearchIndex.ELEMENT_ID_FIELD_NAME).getValue(); return new ElasticsearchEdge( getGraph(), elementId, label, inVertexId, outVertexId, fetchHints, authorizations ); }).collect(Collectors.toList()); }
Source:
public void testNoSetting() throws IOException, InterruptedException { Process start = processBuilder.start(); start.waitFor(); assertEquals( "http.proxyHost: null, http.proxyPort: null, https.proxyHost: null, https.proxyPort: null", getOutput(start)); }

Target:
public void testNoSetting() throws Exception { Process start = processBuilder.start(); start.waitFor(); assertEquals( "http.proxyHost: null, http.proxyPort: null, https.proxyHost: null, https.proxyPort: null", getOutput(start)); }
Source:
public void initialize() { if(Config.<Boolean>getValue(ConfigValues.BackupCheckPeriodInHours)) { log.info("Start initializing {}", getClass().getSimpleName()); Integer backupCheckPeriodInHours = Config.<Integer> getValue(ConfigValues.BackupCheckPeriodInHours); if (backupCheckPeriodInHours > 0) { SchedulerUtilQuartzImpl.getInstance().scheduleAFixedDelayJob(this, "backupCheck", new Class[]{}, new Object[]{}, backupCheckPeriodInHours, backupCheckPeriodInHours, TimeUnit.HOURS); log.info("Finished initializing {}", getClass().getSimpleName()); } } }

Target:
public void initialize() { log.info("Start initializing {}", getClass().getSimpleName()); Integer backupCheckPeriodInHours = Config.<Integer>getValue(ConfigValues.BackupCheckPeriodInHours); if (backupCheckPeriodInHours > 0) { SchedulerUtilQuartzImpl.getInstance().scheduleAFixedDelayJob(this, "backupCheck", new Class[] { }, new Object[] { }, backupCheckPeriodInHours, backupCheckPeriodInHours, TimeUnit.HOURS); log.info("Finished initializing {}", getClass().getSimpleName()); } }
Source:
public ValidationResult isSparsifySupported() { if (disk.getDiskStorageType() == DiskStorageType.IMAGE) { StorageDomain diskStorageDomain = Injector.get(StorageDomainDao.class) .get(((DiskImage) disk).getStorageIds().get(0)); if (diskStorageDomain.getStorageType().isFileDomain()) { return ValidationResult.VALID; } else if (diskStorageDomain.getStorageType().isBlockDomain()) { if (disk.isWipeAfterDelete() && !diskStorageDomain.getSupportsDiscardZeroesData()) { return new ValidationResult(EngineMessage .ACTION_TYPE_FAILED_DISK_SPARSIFY_NOT_SUPPORTED_BY_UNDERLYING_STORAGE_WHEN_WAD_IS_ENABLED, getStorageDomainNameVarReplacement(diskStorageDomain), getDiskAliasVarReplacement()); } return ValidationResult.VALID; } return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPARSIFY_NOT_SUPPORTED_BY_STORAGE_TYPE, getDiskAliasVarReplacement(), getStorageDomainNameVarReplacement(diskStorageDomain), ReplacementUtils.createSetVariableString("storageType", diskStorageDomain.getStorageType())); } return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPARSIFY_NOT_SUPPORTED_BY_DISK_STORAGE_TYPE, getDiskAliasVarReplacement(), ReplacementUtils.createSetVariableString("diskStorageType", disk.getDiskStorageType())); }

Target:
public ValidationResult isSparsifySupported() { if (disk.getDiskStorageType() != DiskStorageType.IMAGE) { return new ValidationResult( EngineMessage.ACTION_TYPE_FAILED_DISK_SPARSIFY_NOT_SUPPORTED_BY_DISK_STORAGE_TYPE, getDiskAliasVarReplacement(), ReplacementUtils.createSetVariableString("diskStorageType", disk.getDiskStorageType())); } StorageDomain diskStorageDomain = Injector.get(StorageDomainDao.class) .get(((DiskImage) disk).getStorageIds().get(0)); if (diskStorageDomain.getStorageType().isFileDomain()) { return ValidationResult.VALID; } if (diskStorageDomain.getStorageType().isBlockDomain()) { if (disk.isWipeAfterDelete() && !diskStorageDomain.getSupportsDiscardZeroesData()) { return new ValidationResult(EngineMessage .ACTION_TYPE_FAILED_DISK_SPARSIFY_NOT_SUPPORTED_BY_UNDERLYING_STORAGE_WHEN_WAD_IS_ENABLED, getStorageDomainNameVarReplacement(diskStorageDomain), getDiskAliasVarReplacement()); } return ValidationResult.VALID; } return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPARSIFY_NOT_SUPPORTED_BY_STORAGE_TYPE, getDiskAliasVarReplacement(), getStorageDomainNameVarReplacement(diskStorageDomain), ReplacementUtils.createSetVariableString("storageType", diskStorageDomain.getStorageType())); }
Source:
public void testFailFastHeaderTooLong() { EmbeddedChannel fastFailCh = new EmbeddedChannel(new HAProxyMessageDecoder(true)); String headerPart1 = "PROXY TCP4 192.168.0.1 192.168.0.11 56324 " + "000000000000000000000000000000000000000000000000000000000000000000000443"; exceptionRule.expect(HAProxyProtocolException.class); exceptionRule.expectMessage("over " + headerPart1.length()); fastFailCh.writeInbound(copiedBuffer(headerPart1, CharsetUtil.US_ASCII)); }

Target:
public void testFailFastHeaderTooLong() { EmbeddedChannel fastFailCh = new EmbeddedChannel(new HAProxyMessageDecoder(true)); try { String headerPart1 = "PROXY TCP4 192.168.0.1 192.168.0.11 56324 " + "000000000000000000000000000000000000000000000000000000000000000000000443"; exceptionRule.expect(HAProxyProtocolException.class); exceptionRule.expectMessage("over " + headerPart1.length()); assertFalse(fastFailCh.writeInbound(copiedBuffer(headerPart1, CharsetUtil.US_ASCII))); } finally { assertFalse(fastFailCh.finishAndReleaseAll()); } }
Source:
public @Nullable Integer resolve(ITmfEvent event) { try { return resolve(event, false, new NullProgressMonitor()); } catch (InterruptedException e) { return null; } }

Target:
public @Nullable Integer resolve(ITmfEvent event) { try { return resolve(event, false, NULL_MONITOR); } catch (InterruptedException e) { return null; } }
Source:
public PreparedStatement lookupStatement(GenericStatement statement) throws StandardException{ GenericStorablePreparedStatement ps = getDataDictionary().getDataDictionaryCache().statementCacheFind(statement); if (ps==null) { String sqlText = statement.getSource().toUpperCase(); if ((sqlText.startsWith("CREATE") || sqlText.startsWith("DECLARE")) && sqlText.contains("IF NOT EXISTS")){ return null; } ps = new GenericStorablePreparedStatement(statement); getDataDictionary().getDataDictionaryCache().statementCacheAdd(statement,ps); } synchronized(ps){ if(ps.upToDate()){ GeneratedClass ac=ps.getActivationClass(); int currentClasses=getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion(); if(ac.getClassLoaderVersion()!=currentClasses){ ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST,this); } } } return ps; }

Target:
public PreparedStatement lookupStatement(GenericStatement statement) throws StandardException{ GenericStorablePreparedStatement ps = getDataDictionary().getDataDictionaryCache().statementCacheFind(statement); if (ps==null) { ps = new GenericStorablePreparedStatement(statement); getDataDictionary().getDataDictionaryCache().statementCacheAdd(statement,ps); } synchronized(ps){ if(ps.upToDate()){ GeneratedClass ac=ps.getActivationClass(); int currentClasses=getLanguageConnectionFactory().getClassFactory().getClassLoaderVersion(); if(ac.getClassLoaderVersion()!=currentClasses){ ps.makeInvalid(DependencyManager.INTERNAL_RECOMPILE_REQUEST,this); } } } return ps; }
Source:
public void dispose() { phone.mCM.unregisterForSIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unSetOnIccRefresh(this); this.removeCallbacksAndMessages(null); this.recordsLoadedRegistrants = null; this.mCphsInfo = null; this.efMWIS = null; this.efCPHS_MWI =null; this.mEfCff = null; this.mEfCfis = null; this.spnState = null; this.adnCache = null; this.mVmConfig = null; this.spdiNetworks = null; this.phone = null; }

Target:
public void dispose() { phone.mCM.unregisterForSIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unSetOnIccRefresh(this); }
Source:
protected AbstractIndexedFastaSequenceFile(final Path path) throws FileNotFoundException { this(path, new FastaSequenceIndex((findRequiredFastaIndexFile(path)))); }

Target:
protected AbstractIndexedFastaSequenceFile(final Path path) throws FileNotFoundException { this(path, new FastaSequenceIndex(findRequiredFastaIndexFile(path))); }
Source:
public VViewModelProperties inherit() { final VDefaultViewModelProperties properties = VViewFactory.eINSTANCE.createDefaultViewModelProperties(); properties.getInheritableProperties().addAll(getInheritableProperties().entrySet()); return properties; }

Target:
public VViewModelProperties inherit() { final VDefaultViewModelProperties properties = VViewFactory.eINSTANCE.createDefaultViewModelProperties(); for (final Entry<String, Object> entry : getInheritableProperties().entrySet()) { properties.getInheritableProperties().put(entry.getKey(), entry.getValue()); } return properties; }
Source:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof ByteBuf) { CodecOutputList out = CodecOutputList.newInstance(); try { ByteBuf data = (ByteBuf) msg; first = cumulation == null; if (first) { cumulation = data; } else { cumulation = cumulator.cumulate(ctx.alloc(), cumulation, data); } callDecode(ctx, cumulation, out); } catch (DecoderException e) { throw e; } catch (Exception e) { throw new DecoderException(e); } finally { if (cumulation != null && !cumulation.isReadable()) { numReads = 0; cumulation.release(); cumulation = null; } else if (++ numReads >= discardAfterReads) { numReads = 0; discardSomeReadBytes(); } int size = out.size(); if (size == 0) { decodeWasNull = true; } else if (size == 1) { ctx.fireChannelRead(out.get(0)); } else { ArrayList<Object> ret = new ArrayList<Object>(size); for (int i = 0; i < size; i++) { ret.add(out.get(i)); } ctx.fireChannelRead(ret); } out.recycle(); } } else { ctx.fireChannelRead(msg); } }

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof ByteBuf) { CodecOutputList out = CodecOutputList.newInstance(); try { ByteBuf data = (ByteBuf) msg; first = cumulation == null; if (first) { cumulation = data; } else { cumulation = cumulator.cumulate(ctx.alloc(), cumulation, data); } callDecode(ctx, cumulation, out); } catch (DecoderException e) { throw e; } catch (Exception e) { throw new DecoderException(e); } finally { if (cumulation != null && !cumulation.isReadable()) { numReads = 0; cumulation.release(); cumulation = null; } else if (++ numReads >= discardAfterReads) { numReads = 0; discardSomeReadBytes(); } int size = out.size(); firedChannelRead |= out.insertSinceRecycled(); fireChannelRead(ctx, out, size); out.recycle(); } } else { ctx.fireChannelRead(msg); } }
Source:
public void forEach(Consumer<E> consumer) { for (Entry<Provider<E>, Collection<E>> entry : elementMap.entrySet()) { entry.getValue().forEach(consumer); } }

Target:
protected void forEach(Consumer<E> consumer) { for (Entry<Provider<E>, Collection<E>> entry : elementMap.entrySet()) { entry.getValue().forEach(consumer); } }
Source:
public void testListTablesWithEmptyElement() throws IOException { try (Admin admin = getConnection().getAdmin()) { sharedTestEnv.createTable(sharedTestEnv.newTestTableName()); Exception actualError = null; try {; assertTrue(admin.listTables((Pattern) null).length > 0); } catch (Exception e) { actualError = e; } assertNull(actualError); try { admin.listTables((String) null); } catch (Exception e) { actualError = e; } assertNotNull(actualError); assertTrue(actualError instanceof NullPointerException); actualError = null; try { assertEquals(0, admin.listTables("").length); } catch (Exception e) { actualError = e; } assertNull(actualError); } }

Target:
public void testListTablesWithEmptyElement() throws IOException { try (Admin admin = getConnection().getAdmin()) { sharedTestEnv.createTable(sharedTestEnv.newTestTableName()); assertTrue(admin.listTables((Pattern) null).length > 0); Exception actualError = null; try { admin.listTables((String) null); } catch (Exception e) { actualError = e; } assertNotNull(actualError); assertTrue(actualError instanceof NullPointerException); assertEquals(0, admin.listTables("").length); } }
Source:
private void checkAndHandleIfGivenMBusAlreadyCoupled(final SmartMeter mbusDevice) throws FunctionalException { if (mbusDevice.getGatewayDevice() != null) { LOGGER.info("The given M-bus device is coupled to gateway on channel {}", mbusDevice.getDeviceIdentification(), mbusDevice.getGatewayDevice().getDeviceIdentification(), mbusDevice.getChannel()); throw new FunctionalException(FunctionalExceptionType.GIVEN_MBUS_DEVICE_ALREADY_COUPLED, ComponentType.DOMAIN_SMART_METERING, new ChannelAlreadyOccupiedException(mbusDevice.getChannel())); } }

Target:
private void checkAndHandleIfGivenMBusAlreadyCoupled(final SmartMeter mbusDevice) throws FunctionalException { if (mbusDevice.getGatewayDevice() != null) { LOGGER.info("The given M-bus device is already coupled to gateway on channel {}", mbusDevice.getDeviceIdentification(), mbusDevice.getGatewayDevice().getDeviceIdentification(), mbusDevice.getChannel()); throw new FunctionalException(FunctionalExceptionType.GIVEN_MBUS_DEVICE_ALREADY_COUPLED, ComponentType.DOMAIN_SMART_METERING, new OsgpException(ComponentType.DOMAIN_SMART_METERING, mbusDevice.getDeviceIdentification() + " is already coupled to gateway " + mbusDevice.getGatewayDevice().getDeviceIdentification())); } }
Source:
public boolean isSupported() { String mimeType = file.getMIMEType(); if (StringUtils.isEmpty(mimeType)) { FileTypeDetector fileTypeDetector = null; try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { logger.log(Level.WARNING, "Unable to create file type detector for determining MIME type."); return false; } mimeType = fileTypeDetector.getMIMEType(file); if (!StringUtils.isEmpty(mimeType)) file.setMIMEType(mimeType); } return PLAIN_TEXT_MIME_TYPE.equals(mimeType); }

Target:
public boolean isSupported() { String mimeType = file.getMIMEType(); if (StringUtils.isEmpty(mimeType)) { FileTypeDetector fileTypeDetector = null; try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { logger.log(Level.SEVERE, "Unable to create file type detector for determining MIME type."); return false; } mimeType = fileTypeDetector.getMIMEType(file); } return PLAIN_TEXT_MIME_TYPE.equals(mimeType); }
Source:
public void close() { typeToRepositoryMap.clear(); }

Target:
public void close() throws Exception { typeToRepositoryMap.clear(); storage.close(); }
Source:
public void setJobOverrideProperty(final Project project, final Flow flow, final Props prop, final String jobName, final String source, final User modifier) throws ProjectManagerException { final Props oldProps; if (Double.compare(flow.getAzkabanFlowVersion(), Constants.AZKABAN_FLOW_VERSION_2_0) == 0) { final int flowVersion = this.projectLoader.getLatestFlowVersion(flow.getProjectId(), flow .getVersion(), source); final File flowFile = this.projectLoader.getUploadedFlowFile(flow.getProjectId(), flow .getVersion(), flowVersion, source); final String path = flow.getId() + Constants.PATH_DELIMITER + jobName; oldProps = FlowLoaderUtils.getPropsFromYamlFile(path, flowFile); FlowLoaderUtils.setPropsInYamlFile(path, flowFile, prop); this.projectLoader .uploadFlowFile(flow.getProjectId(), flow.getVersion(), flowVersion + 1, flowFile); if (flowFile != null && flowFile.exists()) { flowFile.delete(); } } else { prop.setSource(jobName + ".jor"); oldProps = this.projectLoader.fetchProjectProperty(project, prop.getSource()); if (oldProps == null) { this.projectLoader.uploadProjectProperty(project, prop); } else { this.projectLoader.updateProjectProperty(project, prop); } } final String diffMessage = PropsUtils.getPropertyDiff(oldProps, prop); this.projectLoader.postEvent(project, EventType.PROPERTY_OVERRIDE, modifier.getUserId(), diffMessage); return; }

Target:
public void setJobOverrideProperty(final Project project, final Flow flow, final Props prop, final String jobName, final String source, final User modifier) throws ProjectManagerException { File tempDir = null; Props oldProps = null; if (FlowLoaderUtils.isAzkabanFlowVersion20(flow.getAzkabanFlowVersion())) { try { tempDir = Files.createTempDir(); final int flowVersion = this.projectLoader.getLatestFlowVersion(flow.getProjectId(), flow .getVersion(), source); final File flowFile = this.projectLoader.getUploadedFlowFile(flow.getProjectId(), flow .getVersion(), source, flowVersion, tempDir); final String path = flow.getId() + Constants.PATH_DELIMITER + jobName; oldProps = FlowLoaderUtils.getPropsFromYamlFile(path, flowFile); FlowLoaderUtils.setPropsInYamlFile(path, flowFile, prop); this.projectLoader .uploadFlowFile(flow.getProjectId(), flow.getVersion(), flowFile, flowVersion + 1); } catch (final Exception e) { this.logger.error("Failed to set job override property. " + e); } finally { FlowLoaderUtils.cleanUpDir(tempDir); } } else { prop.setSource(jobName + Constants.JOB_OVERRIDE_SUFFIX); oldProps = this.projectLoader.fetchProjectProperty(project, prop.getSource()); if (oldProps == null) { this.projectLoader.uploadProjectProperty(project, prop); } else { this.projectLoader.updateProjectProperty(project, prop); } } final String diffMessage = PropsUtils.getPropertyDiff(oldProps, prop); this.projectLoader.postEvent(project, EventType.PROPERTY_OVERRIDE, modifier.getUserId(), diffMessage); return; }
Source:
public String toString() { return super.getNodeId() + ":" + super.getPort() + " topology: " + topologyId; }

Target:
public String toString() { return String.format("%s:%s topologyId:%s", super.getNodeId(), super.getPort(), topologyId); }
Source:
public Person mapFromCursor(@NonNull Cursor cursor) { final Person person = Person.newPerson( cursor.getLong(cursor.getColumnIndexOrThrow(UsersTable.COLUMN_ID)), cursor.getString(cursor.getColumnIndexOrThrow(UsersTable.COLUMN_NICK)) ); List<Car> cars = new ArrayList<Car>(); while (cursor.moveToNext()) { cars.add(Car.newCar( cursor.getLong(cursor.getColumnIndexOrThrow(CarsTable.COLUMN_ID)), person.getId(), cursor.getString(cursor.getColumnIndexOrThrow(CarsTable.COLUMN_MODEL)) )); } person.setCars(cars); return person; }

Target:
public Person mapFromCursor(@NonNull Cursor cursor) { final StorIOSQLite storIOSQLite = storIOSQLiteFromPerformGet.get(); final String personUuid = cursor.getString(cursor.getColumnIndexOrThrow(PersonsTable.COLUMN_UUID)); final String personName = cursor.getString(cursor.getColumnIndexOrThrow(PersonsTable.COLUMN_NAME)); final List<Car> personCars = storIOSQLite .get() .listOfObjects(Car.class) .withQuery(Query.builder() .table(CarsTable.TABLE_NAME) .where(CarsTable.COLUMN_PERSON_UUID + "=?") .whereArgs(personUuid) .build()) .prepare() .executeAsBlocking(); return new Person.Builder(personName).uuid(personUuid).cars(personCars).build(); }
Source:
private static ModClusterServiceMBean getService(OperationContext context) throws OperationFailedException { PathAddress proxyAddress = LegacyMetricOperationsRegistration.translateProxyPath(context, context.getCurrentAddress()); ServiceName serviceName = ProxyConfigurationResourceDefinition.Capability.SERVICE.getServiceName(proxyAddress); return new ActiveServiceSupplier<ModClusterServiceMBean>(context.getServiceRegistry(false), serviceName).get(); }

Target:
private static ModClusterServiceMBean getService(OperationContext context) throws OperationFailedException { PathAddress proxyAddress = LegacyMetricOperationsRegistration.translateProxyPath(context, context.getCurrentAddress()); ServiceName serviceName = ProxyConfigurationResourceDefinition.Capability.SERVICE.getServiceName(proxyAddress); return new ActiveServiceSupplier<ModClusterServiceMBean>(context.getServiceRegistry(true), serviceName).get(); }