auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean checkRealmListType(VariableElement field) { if (Utils.getGenericTypeQualifiedName(field) == null) { Utils.error("No generic type supplied for field", field); return false; } TypeMirror fieldType = field.asType(); final TypeMirror elementTypeMirror = ((DeclaredType) fieldType).getTypeArguments().get(0); if (elementTypeMirror.getKind() == TypeKind.DECLARED ) { TypeElement elementTypeElement = (TypeElement) ((DeclaredType) elementTypeMirror).asElement(); if (elementTypeElement.getSuperclass().getKind() == TypeKind.NONE) { Utils.error( "Only concrete Realm classes are allowed in RealmLists. " + "Neither interfaces nor abstract classes are allowed.", field); return false; } } if (!validListValueTypes.contains(elementTypeMirror) <START> && !Utils.isRealmModel(elementTypeMirror)) { <END> final StringBuilder messageBuilder = new StringBuilder( "Element type of RealmList must be a class implementing 'RealmModel' or one of the "); for (TypeMirror type : validListValueTypes) { messageBuilder.append('\'').append(type.toString()).append("', "); } messageBuilder.setLength(messageBuilder.length() - ", ".length()); messageBuilder.append('.'); Utils.error(messageBuilder.toString(), field); return false; } return true; }</code><technical_language>this fit line above</technical_language>

Target:
private boolean checkRealmListType(VariableElement field) { if (Utils.getGenericTypeQualifiedName(field) == null) { Utils.error("No generic type supplied for field", field); return false; } TypeMirror fieldType = field.asType(); final TypeMirror elementTypeMirror = ((DeclaredType) fieldType).getTypeArguments().get(0); if (elementTypeMirror.getKind() == TypeKind.DECLARED ) { TypeElement elementTypeElement = (TypeElement) ((DeclaredType) elementTypeMirror).asElement(); if (elementTypeElement.getSuperclass().getKind() == TypeKind.NONE) { Utils.error( "Only concrete Realm classes are allowed in RealmLists. " + "Neither interfaces nor abstract classes are allowed.", field); return false; } } if (!validListValueTypes.contains(elementTypeMirror) && !Utils.isRealmModel(elementTypeMirror)) { final StringBuilder messageBuilder = new StringBuilder( "Element type of RealmList must be a class implementing 'RealmModel' or one of the "); final String separator = ", "; for (TypeMirror type : validListValueTypes) { messageBuilder.append('\'').append(type.toString()).append('\'').append(separator); } messageBuilder.setLength(messageBuilder.length() - separator.length()); messageBuilder.append('.'); Utils.error(messageBuilder.toString(), field); return false; } return true; }
Source:
<code>public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData, Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException { RepositoryResponse response = null; Gist gist = new Gist(); GitHubClient client = GistConnector.createClient(repository); AuthenticationCredentials credentials = repository .getCredentials(AuthenticationType.REPOSITORY); if (credentials != null) { client.setCredentials(credentials.getUserName(), <START> credentials.getPassword()); <END> } GistService service = new GistService(client); TaskAttribute root = taskData.getRoot(); gist.setId(taskData.getTaskId()); gist.setDescription(root.getAttribute( GistAttribute.DESCRIPTION.getMetadata().getId()).getValue()); if (taskData.isNew()) { try { gist = service.createGist(gist); } catch (IOException e) { throw new CoreException(GitHub.createWrappedStatus(e)); } response = new RepositoryResponse(ResponseKind.TASK_CREATED, gist.getId()); } else { try { String newComment = root.getAttribute( GistAttribute.COMMENT_NEW.getMetadata().getId()) .getValue(); if (newComment.length() > 0) service.createComment(taskData.getTaskId(), newComment); String author = GistAttribute.AUTHOR.getMetadata().getValue( taskData); if (isOwner(repository, author)) service.updateGist(gist); } catch (IOException e) { throw new CoreException(GitHub.createWrappedStatus(e)); } response = new RepositoryResponse(ResponseKind.TASK_UPDATED, taskData.getTaskId()); } return response; }</code><technical_language>remove it. a replacement: Gist.getOwner/setOwner()</technical_language>

Target:
public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData, Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException { RepositoryResponse response = null; Gist gist = new Gist(); GitHubClient client = GistConnector.createClient(repository); AuthenticationCredentials credentials = repository .getCredentials(AuthenticationType.REPOSITORY); if (credentials != null) { client.setCredentials(credentials.getUserName(), credentials.getPassword()); } gist.setOwner(new User().setLogin(credentials.getUserName())); GistService service = new GistService(client); TaskAttribute root = taskData.getRoot(); gist.setId(taskData.getTaskId()); gist.setDescription(root.getAttribute( GistAttribute.DESCRIPTION.getMetadata().getId()).getValue()); if (taskData.isNew()) { try { gist = service.createGist(gist); } catch (IOException e) { throw new CoreException(GitHub.createWrappedStatus(e)); } response = new RepositoryResponse(ResponseKind.TASK_CREATED, gist.getId()); } else { try { String newComment = root.getAttribute( GistAttribute.COMMENT_NEW.getMetadata().getId()) .getValue(); if (newComment.length() > 0) service.createComment(taskData.getTaskId(), newComment); String author = GistAttribute.AUTHOR.getMetadata().getValue( taskData); if (isOwner(repository, author)) service.updateGist(gist); } catch (IOException e) { throw new CoreException(GitHub.createWrappedStatus(e)); } response = new RepositoryResponse(ResponseKind.TASK_UPDATED, taskData.getTaskId()); } return response; }
Source:
<code>public void theResponseDataHasValues(final Map<String, String> settings) throws Throwable { final String correlationUid = settings.get(PlatformKeys.KEY_CORRELATION_UID); ResponseData responseData = this.responseDataRespository.findByCorrelationUid(correlationUid); final int maxtime = this.waitFailMillis; final int timeout = this.waitCheckIntervalMillis; <START> for (int delayedtime = 0; delayedtime < maxtime; delayedtime += timeout) { <END> try { Thread.sleep(timeout); } catch (final InterruptedException e) { LOGGER.error("Thread sleep interrupted ", e.getMessage()); break; } responseData = this.responseDataRespository.findByCorrelationUid(correlationUid); if (settings.get(PlatformKeys.KEY_NUMBER_OF_NOTIFICATIONS_SENT) .equals(responseData.getNumberOfNotificationsSent().toString())) { break; } } assertEquals("NumberOfNotificationsSent is not as expected", settings.get(PlatformKeys.KEY_NUMBER_OF_NOTIFICATIONS_SENT), responseData.getNumberOfNotificationsSent().toString()); assertEquals("MessageType is not as expected", settings.get(PlatformKeys.KEY_MESSAGE_TYPE), responseData.getMessageType()); }</code><technical_language>need a delay loop here. (there is a delay present in a previous step) Remove, delay loops slow tests</technical_language>

Target:
public void theResponseDataHasValues(final Map<String, String> settings) throws Throwable { final String correlationUid = settings.get(PlatformKeys.KEY_CORRELATION_UID); final ResponseData responseData = this.responseDataRespository.findByCorrelationUid(correlationUid); assertEquals(PlatformKeys.KEY_NUMBER_OF_NOTIFICATIONS_SENT, settings.get(PlatformKeys.KEY_NUMBER_OF_NOTIFICATIONS_SENT), responseData.getNumberOfNotificationsSent().toString()); assertEquals(PlatformKeys.KEY_MESSAGE_TYPE, settings.get(PlatformKeys.KEY_MESSAGE_TYPE), responseData.getMessageType()); }
Source:
<code>public APIResult validateExtensionJob(final String extensionName, final String jobName, final String configPath, final String doAsUser) { String extensionType = ExtensionHandler.getExtensionType(extensionName, getExtensionJobDetail(extensionName)); InputStream configStream = getServletInputStream(configPath); if (ExtensionType.TRUSTED.name().equalsIgnoreCase(extensionType)) { <START> ClientResponse clientResponse = new ResourceBuilder() <END> .path(ExtensionOperations.VALIDATE.path, extensionName) .addQueryParam(DO_AS_OPT, doAsUser) .call(ExtensionOperations.VALIDATE, configStream); return getResponse(APIResult.class, clientResponse); } else { validateExtensionAndGetEntities(extensionName, jobName, configStream); return new APIResult(APIResult.Status.SUCCEEDED, "Validated successfully"); } }</code><technical_language>update ExtensionManager return exception if validate is called custom extensions</technical_language>

Target:
public APIResult validateExtensionJob(final String extensionName, final String jobName, final String configPath, final String doAsUser) { String extensionType = ExtensionHandler.getExtensionType(extensionName, getExtensionDetailJson(extensionName)); InputStream configStream = getServletInputStream(configPath); if (ExtensionType.TRUSTED.name().equalsIgnoreCase(extensionType)) { ClientResponse clientResponse = new ResourceBuilder() .path(ExtensionOperations.VALIDATE.path, extensionName) .addQueryParam(DO_AS_OPT, doAsUser) .call(ExtensionOperations.VALIDATE, configStream); return getResponse(APIResult.class, clientResponse); } else { validateExtensionAndGetEntities(extensionName, jobName, configStream); return new APIResult(APIResult.Status.SUCCEEDED, "Validated successfully"); } }
Source:
<code>protected void collectStatsImpl(Connection c, long clientHandle, OpsSelector selector, ParameterSet params) throws Exception { JSONObject obj = new JSONObject(); obj.put("selector", "SYSTEMINFORMATION"); String err = null; if (selector == OpsSelector.SYSTEMINFORMATION) { err = parseParamsForSystemInformation(params, obj); } else { err = "SystemInformationAgent received non-SYSTEMINFORMATION selector: " + selector.name(); } if (err != null) { sendErrorResponse(c, ClientResponse.GRACEFUL_FAILURE, err, clientHandle); return; } String subselector = obj.getString("subselector"); PendingOpsRequest psr = new PendingOpsRequest( selector, subselector, c, clientHandle, System.currentTimeMillis(), obj); if (subselector.equalsIgnoreCase("DEPLOYMENT")) { collectSystemInformationDeployment(psr); return; } if (subselector.equalsIgnoreCase("LICENSE")) { <START> collectSystemInformationLicense(psr); <END> return; } distributeOpsWork(psr, obj); }</code><technical_language>Is License guaranteed global (i.e. hosts)? I concerned mix licenses set of permit features used</technical_language>

Target:
protected void collectStatsImpl(Connection c, long clientHandle, OpsSelector selector, ParameterSet params) throws Exception { JSONObject obj = new JSONObject(); obj.put("selector", "SYSTEMINFORMATION"); String err = null; if (selector == OpsSelector.SYSTEMINFORMATION) { err = parseParamsForSystemInformation(params, obj); } else { err = "SystemInformationAgent received non-SYSTEMINFORMATION selector: " + selector.name(); } if (err != null) { sendErrorResponse(c, ClientResponse.GRACEFUL_FAILURE, err, clientHandle); return; } String subselector = obj.getString("subselector"); PendingOpsRequest psr = new PendingOpsRequest( selector, subselector, c, clientHandle, System.currentTimeMillis(), obj); if ("DEPLOYMENT".equalsIgnoreCase(subselector) || "LICENSE".equalsIgnoreCase(subselector)) { collectSystemInformation(psr, subselector); return; } distributeOpsWork(psr, obj); }
Source:
<code>public IgniteStandardMXBeanTest() throws NotCompliantMBeanException { <START> TestInterfaceImpl testInterfaceImpl = new TestInterfaceImpl(); <END> igniteStandardMXBean = new IgniteStandardMXBean(testInterfaceImpl, TestInterface.class); parameterInfo = new MBeanParameterInfo(NAME, TYPE, PARAMETER_INFO_DESCRIPTION); }</code><technical_language>Abbreviation for variable name: Interface -> Itf. abbreviation rules. empty line added code line (almost always)</technical_language>

Target:
public IgniteStandardMXBeanTest() throws NotCompliantMBeanException { TestInterfaceImpl testItfImpl = new TestInterfaceImpl(); igniteStandardMXBean = new IgniteStandardMXBean(testItfImpl, TestInterface.class); paramInfo = new MBeanParameterInfo(NAME, TYPE, PARAMETER_INFO_DESCRIPTION); }
Source:
<code>private void createReplLoadCompleteAckTask() { if ((work.isIncrementalLoad() && !work.incrementalLoadTasksBuilder().hasMoreWork() && !work.hasBootstrapLoadTasks()) || (!work.isIncrementalLoad() && !work.hasBootstrapLoadTasks())) { ReplLoadCompleteAckWork replLoadCompleteAckWork = new ReplLoadCompleteAckWork(work.dumpDirectory); Task<ReplLoadCompleteAckWork> loadCompleteAckWorkTask = TaskFactory.get(replLoadCompleteAckWork, conf); if (this.childTasks.isEmpty()) { this.childTasks.add(loadCompleteAckWorkTask); <START> } else { <END> DAGTraversal.traverse(this.childTasks, new AddDependencyToLeaves(Collections.singletonList(loadCompleteAckWorkTask))); } } }</code><technical_language>childTask null sometime</technical_language>

Target:
private void createReplLoadCompleteAckTask() { if ((work.isIncrementalLoad() && !work.incrementalLoadTasksBuilder().hasMoreWork() && !work.hasBootstrapLoadTasks() && !work.getPathsToCopyIterator().hasNext()) || (!work.isIncrementalLoad() && !work.hasBootstrapLoadTasks() && !work.getPathsToCopyIterator().hasNext())) { ReplLoadCompleteAckWork replLoadCompleteAckWork = new ReplLoadCompleteAckWork(work.dumpDirectory); Task<ReplLoadCompleteAckWork> loadCompleteAckWorkTask = TaskFactory.get(replLoadCompleteAckWork, conf); if (this.childTasks.isEmpty()) { this.childTasks.add(loadCompleteAckWorkTask); } else { DAGTraversal.traverse(this.childTasks, new AddDependencyToLeaves(Collections.singletonList(loadCompleteAckWorkTask))); } } }
Source:
<code>private void setFirstTitle() { <START> if((tabs.size()>0)&&activity != null) { <END> String tabNumber = tabs.get(0); if (tabNumber.startsWith(TAB_NUMBER_KIOSK + "\t")) { String kiosk[] = tabNumber.split("\t"); if (kiosk.length == 2) { try { setTitle(kiosk[1]); } catch (Exception e) { } } } else if (tabNumber.startsWith(TAB_NUMBER_CHANNEL + "\t")) { String channelInfo[] = tabNumber.split("\t"); if(channelInfo.length==4) { setTitle(channelInfo[2]); } } else { switch (tabNumber) { case TAB_NUMBER_BLANK: setTitle(getString(R.string.app_name)); break; case TAB_NUMBER_SUBSCIRPTIONS: setTitle(getString(R.string.tab_subscriptions)); break; case TAB_NUMBER_FEED: setTitle(getString(R.string.fragment_whats_new)); break; case TAB_NUMBER_BOOKMARKS: setTitle(getString(R.string.tab_bookmarks)); break; case TAB_NUMBER_HISTORY: setTitle(getString(R.string.title_activity_history)); break; } } } }</code><technical_language>this more readable: (tabs.size() > 0 && activity != null)</technical_language>

Target:
private void setFirstTitle() { if((tabs.size() > 0) && activity != null) { String tabInformation = tabs.get(0); if (tabInformation.startsWith(TAB_NUMBER_KIOSK + "\t")) { String kiosk[] = tabInformation.split("\t"); if (kiosk.length == 3) { setTitle(kiosk[1]); } } else if (tabInformation.startsWith(TAB_NUMBER_CHANNEL + "\t")) { String channelInfo[] = tabInformation.split("\t"); if(channelInfo.length==4) { setTitle(channelInfo[2]); } } else { switch (tabInformation) { case TAB_NUMBER_BLANK: setTitle(getString(R.string.app_name)); break; case TAB_NUMBER_SUBSCIRPTIONS: setTitle(getString(R.string.tab_subscriptions)); break; case TAB_NUMBER_FEED: setTitle(getString(R.string.fragment_whats_new)); break; case TAB_NUMBER_BOOKMARKS: setTitle(getString(R.string.tab_bookmarks)); break; case TAB_NUMBER_HISTORY: setTitle(getString(R.string.title_activity_history)); break; } } } }
Source:
<code>protected Void doInBackground(Void... arg0) { if (!Utils.isNetworkAvailable(contextWeakReference.get())) { ToastUtil.showError(contextWeakReference.get(), R.string.error_internet_connection); userLoggedIn = false; return null; } SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(contextWeakReference.get()); String token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); Log.d(TAG, token); new ServerAuthenticator(username, password, token, CatrobatWebClient.INSTANCE.getClient(), FlavoredConstants.BASE_URL_HTTPS, (statusCode, errorMessage) -> { Log.e(TAG, "StatusCode: " + statusCode + errorMessage); message = errorMessage; <START> userLoggedIn = false; <END> }).performCatrobatLogin(sharedPreferences.edit()); return null; }</code><technical_language>this default false set in success true</technical_language>

Target:
protected Void doInBackground(Void... arg0) { Context context = contextWeakReference.get(); if (context == null) { return null; } if (!Utils.isNetworkAvailable(context)) { ToastUtil.showError(context, R.string.error_internet_connection); userLoggedIn = false; return null; } SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); String token = sharedPreferences.getString(Constants.TOKEN, Constants.NO_TOKEN); Log.d(TAG, token); ServerAuthenticator authenticator = new ServerAuthenticator(username, password, token, CatrobatWebClient.INSTANCE.getClient(), FlavoredConstants.BASE_URL_HTTPS, sharedPreferences.edit(), new ServerAuthenticator.TaskListener() { @Override public void onError(int statusCode, String errorMessage) { Log.e(TAG, "StatusCode: " + statusCode + errorMessage); message = errorMessage; userLoggedIn = false; } @Override public void onSuccess() { userLoggedIn = true; } }); authenticator.performCatrobatLogin(); return null; }
Source:
<code>public List<FieldChange> cleanup(BibEntry entry) { List<FieldChange> changes = new ArrayList<>(); for (Map.Entry<Field, Field> alias : EntryConverter.FIELD_ALIASES_TEX_TO_LTX.entrySet()) { Field oldField = alias.getKey(); Field newField = alias.getValue(); entry.getField(oldField).ifPresent(oldValue -> { if (!oldValue.isEmpty() && (!entry.getField(newField).isPresent())) { entry.setField(newField, oldValue).ifPresent(changes::add); entry.clearField(oldField).ifPresent(changes::add); } }); } if (StringUtil.isBlank(entry.getField(StandardField.DATE))) { entry.getFieldOrAlias(StandardField.DATE).ifPresent(newDate -> { entry.setField(StandardField.DATE, newDate).ifPresent(changes::add); entry.clearField(StandardField.YEAR).ifPresent(changes::add); entry.clearField(StandardField.MONTH).ifPresent(changes::add); }); } else { entry.getFieldOrAlias(StandardField.DATE).ifPresent(newDate -> { <START> entry.clearField(StandardField.YEAR).ifPresent(changes::add); <END> entry.clearField(StandardField.MONTH).ifPresent(changes::add); }); } return changes; }</code><technical_language>I a check information in date field coincides in year & month. For example, if date = {2004-05} year = {2005} year field deleted</technical_language>

Target:
public List<FieldChange> cleanup(BibEntry entry) { List<FieldChange> changes = new ArrayList<>(); for (Map.Entry<Field, Field> alias : EntryConverter.FIELD_ALIASES_TEX_TO_LTX.entrySet()) { Field oldField = alias.getKey(); Field newField = alias.getValue(); entry.getField(oldField).ifPresent(oldValue -> { if (!oldValue.isEmpty() && (!entry.getField(newField).isPresent())) { entry.setField(newField, oldValue).ifPresent(changes::add); entry.clearField(oldField).ifPresent(changes::add); } }); } if (StringUtil.isBlank(entry.getField(StandardField.DATE))) { entry.getFieldOrAlias(StandardField.DATE).ifPresent(newDate -> { entry.setField(StandardField.DATE, newDate).ifPresent(changes::add); entry.clearField(StandardField.YEAR).ifPresent(changes::add); entry.clearField(StandardField.MONTH).ifPresent(changes::add); }); } else { entry.getFieldOrAlias(StandardField.DATE).ifPresent(date -> { Optional<Date> newDate = Date.parse(date); Optional<Date> checkDate = Date.parse(entry.getFieldOrAlias(StandardField.YEAR), entry.getFieldOrAlias(StandardField.MONTH), Optional.empty()); if (checkDate.equals(newDate)) { entry.clearField(StandardField.YEAR).ifPresent(changes::add); entry.clearField(StandardField.MONTH).ifPresent(changes::add); } }); } return changes; }
Source:
<code>private void refillCache() { try { logger.info("Starting filling Owner Id to Subscription Name cache"); long start = System.currentTimeMillis(); Multimap<OwnerId, SubscriptionName> cache = ArrayListMultimap.create(); topicService.getAllTopics().stream() .flatMap(topic -> subscriptionRepository.listSubscriptions(topic.getName()).stream()) .forEach(subscription -> cache.put(subscription.getOwner(), subscription.getQualifiedName())); this.cache = Multimaps.synchronizedMultimap(cache); long end = System.currentTimeMillis(); <START> logger.info("Cache filled. Took {}ms", end - start); <END> } catch (Exception e) { logger.error("Error while filling cache", e); } }</code><technical_language>nitpicking: this log msg "Starting filling Owner Id....". question is "What cache?". I logger name (class name), nice full statement well</technical_language>

Target:
private void refillCache() { try { logger.info("Starting filling SubscriptionOwnerCache"); long start = System.currentTimeMillis(); Multimap<OwnerId, SubscriptionName> cache = ArrayListMultimap.create(); topicService.getAllTopics().stream() .flatMap(topic -> subscriptionRepository.listSubscriptions(topic.getName()).stream()) .forEach(subscription -> cache.put(subscription.getOwner(), subscription.getQualifiedName())); this.cache = Multimaps.synchronizedMultimap(cache); long end = System.currentTimeMillis(); logger.info("SubscriptionOwnerCache filled. Took {}ms", end - start); } catch (Exception e) { logger.error("Error while filling SubscriptionOwnerCache", e); } }
Source:
<code>public final ModelNode getCurrentOperationParameter(final String parameterName, boolean nullable) { if (isLegalParameterName(parameterName)) { assert activeStep != null; ModelNode operation = activeStep.operation; assert operation != null; if (!operation.has(parameterName) && nullable) { return null; } else { return operation.get(parameterName); } } else { <START> throw new IllegalArgumentException(ControllerLogger.ROOT_LOGGER.invalidParameterName(parameterName)); <END> } }</code><technical_language>ControllerLogger.ROOT_LOGGER.invalidParameterName return IllegalArgumentException throw returns wrapping</technical_language>

Target:
public final ModelNode getCurrentOperationParameter(final String parameterName, boolean nullable) { if (isLegalParameterName(parameterName)) { assert activeStep != null; ModelNode operation = activeStep.operation; assert operation != null; if (!operation.has(parameterName) && nullable) { return null; } else { return operation.get(parameterName); } } else { throw ControllerLogger.ROOT_LOGGER.invalidParameterName(parameterName); } }
Source:
<code>public void requestHandleWithNonHealthCheckRequestTest() throws IOException { <START> testNonHealthCheckRequest(HttpMethod.POST, "POST"); <END> testNonHealthCheckRequest(HttpMethod.GET, "GET"); testNonHealthCheckRequest(HttpMethod.GET, MockBlobStorageService.ECHO_REST_METHOD); testNonHealthCheckRequest(HttpMethod.DELETE, "DELETE"); }</code><technical_language>understand this. MockBlobStorageService.ECHO_REST_METHOD for everything</technical_language>

Target:
public void requestHandleWithNonHealthCheckRequestTest() throws IOException { testNonHealthCheckRequest(HttpMethod.POST, "POST"); testNonHealthCheckRequest(HttpMethod.GET, "GET"); testNonHealthCheckRequest(HttpMethod.DELETE, "DELETE"); }
Source:
<code><START> public static void scheduleOnDemandPipeline(String clusterName, long delay) { <END> if (clusterName == null) { LOG.error("Failed to issue a pipeline run. ClusterName is null."); } GenericHelixController controller = GenericHelixController.getController(clusterName); if (controller != null) { controller.scheduleOnDemandRebalance(delay); } else { LOG.error("Failed to issue a pipeline. Controller for cluster does not exist.", clusterName); } }</code><technical_language>validate parameters, cluster name</technical_language>

Target:
public static void scheduleOnDemandPipeline(String clusterName, long delay) { if (clusterName == null) { LOG.error("Failed to issue a pipeline run. ClusterName is null."); return; } if (delay < 0L) { LOG.error("Failed to issue a pipeline run. Delay is invalid."); return; } GenericHelixController controller = GenericHelixController.getController(clusterName); if (controller != null) { controller.scheduleOnDemandRebalance(delay); } else { LOG.error("Failed to issue a pipeline. Controller for cluster does not exist.", clusterName); } }
Source:
<code>private boolean shouldTriggerMasterToAssignPartitions() { ClusterServiceImpl clusterService = node.getClusterService(); <START> return partitionStateManager.isInitialized() && clusterService.isJoined() && node.getNodeExtension().isStartCompleted(); <END> }</code><technical_language>this !partitionStateManager.isInitialized() && ...</technical_language>

Target:
private boolean shouldTriggerMasterToAssignPartitions() { ClusterServiceImpl clusterService = node.getClusterService(); return !partitionStateManager.isInitialized() && clusterService.isJoined() && node.getNodeExtension().isStartCompleted(); }
Source:
<code>protected boolean startUnitOfWork() { if (unitOfWork != null) { try { unitOfWork.begin(); return true; } catch (IllegalStateException e) { log.debug("Already have an open unit of work, " + <START> "will close and start a new one"); <END> return false; } } return false; }</code><technical_language>Do close start a new one? this simply read "Already open unit of work."</technical_language>

Target:
protected boolean startUnitOfWork() { if (unitOfWork != null) { try { unitOfWork.begin(); return true; } catch (IllegalStateException e) { log.debug("Already have an open unit of work"); return false; } } return false; }
Source:
<code>protected void cleanup() { follow = false; if(getProcess() != null) { IOUtils.closeQuietly(getProcess().getInputStream()); IOUtils.closeQuietly(getProcess().getErrorStream()); } <START> cacheFlush.accept(this.container); <END> }</code><technical_language>this is a synchronized call cache.remove. Class PodLogs is in OpenShiftBinaryPodLogRetrieval sees cache call synchronized(cache) { cache.remove(container); }</technical_language>

Target:
protected void cleanup() { follow = false; if(getProcess() != null) { IOUtils.closeQuietly(getProcess().getInputStream()); IOUtils.closeQuietly(getProcess().getErrorStream()); } synchronized (cache) { cache.remove(this.container); } }
Source:
<code>private CostAssertionBuilder assertCostFragmentedPlan( PlanNode node, Map<String, PlanCostEstimate> costs, Map<String, PlanNodeStatsEstimate> stats, Map<String, Type> types) { Map<Symbol, Type> symbolTypes = types.entrySet().stream() .collect(ImmutableMap.toImmutableMap(entry -> new Symbol(entry.getKey()), Map.Entry::getValue)); TypeProvider typeProvider = TypeProvider.copyOf(symbolTypes); StatsProvider statsProvider = new CachingStatsProvider(statsCalculator(stats), session, typeProvider); CostProvider costProvider = new TestingCostProvider(costs, costCalculatorUsingExchanges, statsProvider, session, typeProvider); IterativeOptimizer optimizer = new IterativeOptimizer(new RuleStatsRecorder(), statsCalculator(stats), costCalculatorUsingExchanges, new TranslateExpressions(metadata, new SqlParser()).rules()); <START> PlanNode plan = optimizer.optimize(node, session, typeProvider, new SymbolAllocator(symbolTypes), new PlanNodeIdAllocator(), WarningCollector.NOOP); <END> SubPlan subPlan = fragment(new Plan(plan, typeProvider, StatsAndCosts.create(node, statsProvider, costProvider))); return new CostAssertionBuilder(subPlan.getFragment().getStatsAndCosts().getCosts().getOrDefault(node.getId(), PlanCostEstimate.unknown())); }</code><technical_language>need do this fragmenting</technical_language>

Target:
private CostAssertionBuilder assertCostFragmentedPlan( PlanNode node, Map<String, PlanCostEstimate> costs, Map<String, PlanNodeStatsEstimate> stats, Map<String, Type> types) { Map<Symbol, Type> symbolTypes = types.entrySet().stream() .collect(ImmutableMap.toImmutableMap(entry -> new Symbol(entry.getKey()), Map.Entry::getValue)); TypeProvider typeProvider = TypeProvider.copyOf(symbolTypes); StatsProvider statsProvider = new CachingStatsProvider(statsCalculator(stats), session, typeProvider); CostProvider costProvider = new TestingCostProvider(costs, costCalculatorUsingExchanges, statsProvider, session, typeProvider); PlanNode plan = translateExpression(node, statsCalculator(stats), typeProvider); SubPlan subPlan = fragment(new Plan(plan, typeProvider, StatsAndCosts.create(node, statsProvider, costProvider))); return new CostAssertionBuilder(subPlan.getFragment().getStatsAndCosts().getCosts().getOrDefault(node.getId(), PlanCostEstimate.unknown())); }
Source:
<code>protected void executeCommand() { <START> boolean result = true; <END> VdsValidator validator; setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); log.infoFormat("SSH Soft Fencing will not be executed on host {0}({1}) since it doesn't exist anymore.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } validator = new VdsValidator(getVds()); if (validator.shouldVdsBeFenced()) { result = executeSshSoftFencingCommand(getVds().getHostName(), getVds().getVdsGroupCompatibilityVersion().toString()); if (result) { ResourceManager.getInstance().GetVdsManager(getVds().getId()).finishSshSoftFencingExecution(getVds()); } getReturnValue().setSucceeded(result); } else { setCommandShouldBeLogged(false); log.infoFormat("SSH Soft Fencing will not be executed on host {0}({1}) since it's status is ok.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); } }</code><technical_language>set result false first, this function</technical_language>

Target:
protected void executeCommand() { VdsValidator validator; setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); log.infoFormat("SSH Soft Fencing will not be executed on host {0}({1}) since it doesn't exist anymore.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } validator = new VdsValidator(getVds()); if (validator.shouldVdsBeFenced()) { boolean result = executeSshSoftFencingCommand(getVds().getHostName(), getVds().getVdsGroupCompatibilityVersion().toString()); if (result) { ResourceManager.getInstance().GetVdsManager(getVds().getId()).finishSshSoftFencingExecution(getVds()); } getReturnValue().setSucceeded(result); } else { setCommandShouldBeLogged(false); log.infoFormat("SSH Soft Fencing will not be executed on host {0}({1}) since it's status is ok.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); } }
Source:
<code>protected HttpResponse post(String url, Map<String, String> payloads) throws IOException { try { HttpPost postRequest = new HttpPost(url); postRequest.setHeader("Accept", ACCEPT_CONTENT_TYPE); StringEntity entity = new StringEntity(OBJECT_MAPPER.writeValueAsString(payloads), ContentType.APPLICATION_JSON); postRequest.setEntity(entity); LOG.info("Executing request: {}, headers: {}, entity: {}", postRequest.getRequestLine(), postRequest.getAllHeaders(), postRequest.getEntity()); return _httpClient.execute(postRequest); } catch (ConnectTimeoutException e) { <START> LOG.error( "Failed to perform customized health check due to ConnectTimeoutException for endpoint {}.", url, e); throw e; <END> } catch (IOException e) { LOG.error("Failed to perform customized health check. Is participant endpoint available?", url, e); throw e; } }</code><technical_language>purpose of logging throwing exception? checking calling stack, I is necessary. ConnectTimeoutException extends IOException is caught. upper method getHealthStatusFromRest catches this exception logs. If log throw here, error messages confusing redundant. Eg, in test write, error log in test output if set logging level print errors. is confusing</technical_language>

Target:
protected HttpResponse post(String url, Map<String, String> payloads) throws IOException { try { HttpPost postRequest = new HttpPost(url); postRequest.setHeader("Accept", ACCEPT_CONTENT_TYPE); StringEntity entity = new StringEntity(OBJECT_MAPPER.writeValueAsString(payloads), ContentType.APPLICATION_JSON); postRequest.setEntity(entity); LOG.info("Executing request: {}, headers: {}, entity: {}", postRequest.getRequestLine(), postRequest.getAllHeaders(), postRequest.getEntity()); return _httpClient.execute(postRequest); } catch (IOException e) { LOG.error("Failed to perform customized health check. Is participant endpoint available?", url, e); throw e; } }
Source:
<code>private void cacheBlock(String bpid, long blockId) { FsVolumeImpl volume; String blockFileName; long length, genstamp; Executor volumeExecutor; try (AutoCloseableLock lock = datasetWriteLock.acquire()) { ReplicaInfo info = volumeMap.get(bpid, blockId); boolean success = false; try { if (info == null) { LOG.warn("Failed to cache block with id " + blockId + ", pool " + bpid + ": ReplicaInfo not found."); return; } if (info.getState() != ReplicaState.FINALIZED) { LOG.warn("Failed to cache block with id " + blockId + ", pool " + bpid + ": replica is not finalized; it is in state " + info.getState()); return; } try { volume = (FsVolumeImpl)info.getVolume(); if (volume == null) { LOG.warn("Failed to cache block with id " + blockId + ", pool " + bpid + ": volume not found."); return; } } catch (ClassCastException e) { LOG.warn("Failed to cache block with id " + blockId + ": volume was not an instance of FsVolumeImpl."); return; } if (volume.isRAMStorage()) { LOG.warn("Caching not supported on block with id " + blockId + <START> " since the volume is backed by RAM_DISK or NVDIMM."); <END> return; } success = true; } finally { if (!success) { cacheManager.numBlocksFailedToCache.incrementAndGet(); } } blockFileName = info.getBlockURI().toString(); length = info.getVisibleLength(); genstamp = info.getGenerationStamp(); volumeExecutor = volume.getCacheExecutor(); } cacheManager.cacheBlock(blockId, bpid, blockFileName, length, genstamp, volumeExecutor); }</code><technical_language>nit: clear volume is. LOG.warn("Caching supported block id volume " + "is backed is RAM.", blockId, volume);</technical_language>

Target:
private void cacheBlock(String bpid, long blockId) { FsVolumeImpl volume; String blockFileName; long length, genstamp; Executor volumeExecutor; try (AutoCloseableLock lock = datasetWriteLock.acquire()) { ReplicaInfo info = volumeMap.get(bpid, blockId); boolean success = false; try { if (info == null) { LOG.warn("Failed to cache block with id " + blockId + ", pool " + bpid + ": ReplicaInfo not found."); return; } if (info.getState() != ReplicaState.FINALIZED) { LOG.warn("Failed to cache block with id " + blockId + ", pool " + bpid + ": replica is not finalized; it is in state " + info.getState()); return; } try { volume = (FsVolumeImpl)info.getVolume(); if (volume == null) { LOG.warn("Failed to cache block with id " + blockId + ", pool " + bpid + ": volume not found."); return; } } catch (ClassCastException e) { LOG.warn("Failed to cache block with id " + blockId + ": volume was not an instance of FsVolumeImpl."); return; } if (volume.isRAMStorage()) { LOG.warn("Caching not supported on block with id since the " + "volume is backed by which is RAM.", blockId, volume); return; } success = true; } finally { if (!success) { cacheManager.numBlocksFailedToCache.incrementAndGet(); } } blockFileName = info.getBlockURI().toString(); length = info.getVisibleLength(); genstamp = info.getGenerationStamp(); volumeExecutor = volume.getCacheExecutor(); } cacheManager.cacheBlock(blockId, bpid, blockFileName, length, genstamp, volumeExecutor); }
Source:
<code>public boolean hasEthernet(Context context) { if (TEST_RADIOS) { return SystemProperties.get(TEST_RADIOS_PROP).contains("ethernet"); } final ConnectivityManager conn = ConnectivityManager.from(context); final boolean hasEthernet = conn.isNetworkSupported(TYPE_ETHERNET); final long ethernetBytes; if (mStatsSession != null) { try { ethernetBytes = mStatsSession.getSummaryForNetwork( NetworkTemplate.buildTemplateEthernet(), Long.MIN_VALUE, Long.MAX_VALUE) .getTotalBytes(); } catch (RemoteException e) { throw new RuntimeException(e); } } else { ethernetBytes = 0; } <START> return hasEthernet && (mStatsSession == null || ethernetBytes > 0); <END> }</code><technical_language>fix this moving mStatsService.openSession() code onCreate() this method is invoked. (that a mStatsSession in this method.) matches lifecycle, close session in onDestroy()</technical_language>

Target:
public boolean hasEthernet(Context context) { if (TEST_RADIOS) { return SystemProperties.get(TEST_RADIOS_PROP).contains("ethernet"); } final ConnectivityManager conn = ConnectivityManager.from(context); final boolean hasEthernet = conn.isNetworkSupported(TYPE_ETHERNET); final long ethernetBytes; if (mStatsSession != null) { try { ethernetBytes = mStatsSession.getSummaryForNetwork( NetworkTemplate.buildTemplateEthernet(), Long.MIN_VALUE, Long.MAX_VALUE) .getTotalBytes(); } catch (RemoteException e) { throw new RuntimeException(e); } } else { ethernetBytes = 0; } return hasEthernet && ethernetBytes > 0; }
Source:
<code>public Set<String> getDependentFields() { final Set<String> dependentFields = super.getDependentFields(); <START> dependentFields.addAll(field.getDependentFields()); <END> return dependentFields; }</code><technical_language>create a new set, update super set. super set (and should, I think) immutable</technical_language>

Target:
public Set<String> getDependentFields() { if (dependentFields == null) { dependentFields = Sets.newHashSet(super.getDependentFields()); dependentFields.addAll(field.getDependentFields()); } return dependentFields; }
Source:
<code><START> public Optional<DispatchCatchingUp<I>> getDispatchOp() { <END> return Optional.ofNullable(dispatchOp); }</code><technical_language>Is this method used</technical_language>

Target:
DispatchCatchingUp<I> getDispatchOp() { return checkNotNull(dispatchOp); }
Source:
<code><START> public void onJsonProcessFinish(String object) <END> { System.out.println(object); }</code><technical_language>this function return something, print console</technical_language>

Target:
public String onJsonProcessFinish(String object) { System.out.println(object); return object; }
Source:
<code>protected CodecConfig genConfig(RendererConfiguration renderer) { CodecConfig config = new CodecConfig(); if (codecOverride.isSelected()) { LOGGER.debug("Using GUI codec overrides"); config.videoCodec = codecVideo.getText(); config.audioCodec = codecAudio.getText(); config.container = codecContainer.getText(); } else if (renderer.isTranscodeToWMV()) { LOGGER.debug("Using XBox WMV codecs"); config.videoCodec = "wmv2"; config.audioCodec = "wma"; config.container = "asf"; } else if (renderer.isTranscodeToMPEGPSAC3() || renderer.isTranscodeToMPEGTSAC3()) { String type = renderer.isTranscodeToMPEGPSAC3() ? "ps" : "ts"; LOGGER.debug("Using DLNA standard codecs with " + type + " container"); config.videoCodec = "mp2v"; config.audioCodec = "mp2a"; config.container = type; } else { <START> throw new RuntimeException("Unknown encoding profile"); <END> } LOGGER.debug("Using " + config.videoCodec + ", " + config.audioCodec + ", " + config.container); if (sampleRateOverride.isSelected()) { config.sampleRate = Integer.valueOf(sampleRate.getText()); } if (audioSyncEnabled.isSelected()) { config.extraTrans.add("audio-sync"); } return config; }</code><technical_language>Check for WMV, MPEGTSAC3; if of those, default profile: MPEGPSAC3. wrong validating value, but, if needed, done in RendererConfiguration, here</technical_language>

Target:
protected CodecConfig genConfig(RendererConfiguration renderer) { CodecConfig config = new CodecConfig(); if (renderer.isTranscodeToWMV()) { LOGGER.debug("Using XBox WMV codecs"); config.videoCodec = "wmv2"; config.audioCodec = "wma"; config.container = "asf"; } else if (renderer.isTranscodeToMPEGTSAC3()) { LOGGER.debug("Using DLNA standard codecs with ts container"); config.videoCodec = "mp2v"; config.audioCodec = "mp2a"; config.container = "ts"; } else { LOGGER.debug("Using DLNA standard codecs with ps (default) container"); config.videoCodec = "mp2v"; config.audioCodec = "mp2a"; config.container = "ps"; } LOGGER.trace("Using " + config.videoCodec + ", " + config.audioCodec + ", " + config.container); if (sampleRateOverride.isSelected()) { config.sampleRate = Integer.valueOf(sampleRate.getText()); } if (audioSyncEnabled.isSelected()) { config.extraTrans.put("audio-sync", ""); } return config; }
Source:
<code>public static void putObject_test13() throws Exception { if (!mintEnv) { System.out.println("Test: putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_C. "); } long startTime = System.currentTimeMillis(); KeyGenerator keyGen = KeyGenerator.getInstance("AES"); keyGen.init(256); ServerSideEncryption sse = ServerSideEncryption.withCustomerKey(keyGen.generateKey()); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * MB)) { client.putObject(bucketName, objectName, is, 1 * MB, sse); } client.removeObject(bucketName, objectName); mintSuccessLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse)", <START> "size: 13 MB", startTime); <END> } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse)", "size: 13 MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }</code><technical_language>Size is 1 MB, please update</technical_language>

Target:
public static void putObject_test13() throws Exception { if (!mintEnv) { System.out.println("Test: putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_C. "); } long startTime = System.currentTimeMillis(); KeyGenerator keyGen = KeyGenerator.getInstance("AES"); keyGen.init(256); ServerSideEncryption sse = ServerSideEncryption.withCustomerKey(keyGen.generateKey()); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * MB)) { client.putObject(bucketName, objectName, is, 1 * MB, sse); } client.removeObject(bucketName, objectName); mintSuccessLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_C.", "size: 1 MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_C.", "size: 1 MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
<code>public void setBadAttachmentsTest() throws Exception { MutableDocumentRevision rev_1Mut = new MutableDocumentRevision(); rev_1Mut.body = bodyOne; BasicDocumentRevision rev_1 = datastore.createDocumentFromRevision(rev_1Mut); Attachment att1 = new UnsavedFileAttachment(TestUtils.loadFixture("fixture/attachment_1.txt"), "text/plain"); Attachment att2 = new UnsavedFileAttachment(TestUtils.loadFixture("fixture/nonexistentfile"), "text/plain"); Attachment att3 = new UnsavedFileAttachment(TestUtils.loadFixture("fixture/attachment_2.txt"), "text/plain"); BasicDocumentRevision newRevision = null; try { MutableDocumentRevision rev1_mut = rev_1.mutableCopy(); rev1_mut.attachments.put(att1.name, att1); rev1_mut.attachments.put(att2.name, att2); rev1_mut.attachments.put(att3.name, att3); newRevision = datastore.updateDocumentFromRevision(rev1_mut); Assert.fail("FileNotFoundException not thrown"); <START> } catch (AttachmentException fnfe) { <END> datastore.runOnDbQueue(new SQLQueueCallable<Object>() { @Override public Object call(SQLDatabase db) throws Exception { Cursor c1 = db.rawQuery("select sequence from attachments;", null); Assert.assertEquals("Attachments table not empty", c1.getCount(), 0); Cursor c2 = db.rawQuery("select sequence from revs;", null); Assert.assertEquals("Revs table not empty", c2.getCount(), 1); return null; } }).get(); } }</code><technical_language>Rename variable</technical_language>

Target:
public void setBadAttachmentsTest() throws Exception { MutableDocumentRevision rev_1Mut = new MutableDocumentRevision(); rev_1Mut.body = bodyOne; BasicDocumentRevision rev_1 = datastore.createDocumentFromRevision(rev_1Mut); Attachment att1 = new UnsavedFileAttachment(TestUtils.loadFixture("fixture/attachment_1.txt"), "text/plain"); Attachment att2 = new UnsavedFileAttachment(TestUtils.loadFixture("fixture/nonexistentfile"), "text/plain"); Attachment att3 = new UnsavedFileAttachment(TestUtils.loadFixture("fixture/attachment_2.txt"), "text/plain"); BasicDocumentRevision newRevision = null; try { MutableDocumentRevision rev1_mut = rev_1.mutableCopy(); rev1_mut.attachments.put(att1.name, att1); rev1_mut.attachments.put(att2.name, att2); rev1_mut.attachments.put(att3.name, att3); newRevision = datastore.updateDocumentFromRevision(rev1_mut); Assert.fail("FileNotFoundException not thrown"); } catch (AttachmentException ae) { datastore.runOnDbQueue(new SQLQueueCallable<Object>() { @Override public Object call(SQLDatabase db) throws Exception { Cursor c1 = db.rawQuery("select sequence from attachments;", null); Assert.assertEquals("Attachments table not empty", c1.getCount(), 0); Cursor c2 = db.rawQuery("select sequence from revs;", null); Assert.assertEquals("Revs table not empty", c2.getCount(), 1); return null; } }).get(); } }
Source:
<code>public void initialize() { this.projectInfo = this.libraryPlaces.getProjectInfo(); this.view.init(this); this.buildExecutor.init(this.view); this.view.setTitle(libraryPlaces.getProjectInfo().getProject().getProjectName()); this.view.setContributorsCount(this.contributorsListScreen.getContributorsCount()); this.resolveAssetsCount(); this.showAssets(); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { <START> <END> } @Override public void onSuccess(Boolean result) { view.enableImportButton(); } }); }</code><technical_language>want disable some view components in event of a failure!</technical_language>

Target:
public void initialize() { this.workspaceProject = this.libraryPlaces.getActiveWorkspaceContext(); this.view.init(this); this.buildExecutor.init(this.view); this.view.setTitle(libraryPlaces.getActiveWorkspaceContext().getMainModule().getModuleName()); this.resolveContributorsCount(); this.resolveAssetsCount(); this.showAssets(); this.view.setEditContributorsVisible(this.canEditContributors()); this.view.setAddAssetVisible(this.userCanUpdateProject()); this.view.setImportAssetVisible(this.userCanUpdateProject()); this.view.setImportAssetVisible(this.userCanUpdateProject()); this.view.setBuildEnabled(this.userCanBuildProject()); this.view.setDeployEnabled(this.userCanBuildProject()); this.view.setDeleteProjectVisible(this.userCanDeleteRepository()); newFileUploader.acceptContext(new Callback<Boolean, Void>() { @Override public void onFailure(Void reason) { view.setImportAssetVisible(false); } @Override public void onSuccess(Boolean result) { view.setImportAssetVisible(result); } }); }
Source:
<code>public static void main(String[] args) { if (args.length < 2) { System.out.println("Please specify your access key and a voice call flow ID"); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0]); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); try { System.out.println("Requesting a Voice Call Flow"); <START> VoiceCallFlow voiceCallFlow = messageBirdClient <END> .viewVoiceCallFlow(args[1]); System.out.println("Voice call flow retrieved "); } catch (GeneralException | UnauthorizedException exception) { exception.printStackTrace(); } }</code><technical_language>VoiceCallFlow imported, need NotFoundException import</technical_language>

Target:
public static void main(String[] args) { if (args.length < 2) { System.out.println("Please specify your access key and a voice call flow ID"); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0]); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); try { System.out.println("Requesting a Voice Call Flow"); VoiceCallFlowResponse voiceCallFlowResponse = messageBirdClient .viewVoiceCallFlow(args[1]); System.out.println("Voice call flow retrieved "); } catch (GeneralException | UnauthorizedException | NotFoundException exception) { exception.printStackTrace(); } }