auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testTenantIdleTime() throws Exception { AutomationContext context = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); LoginLogoutClient loginLogoutClient = new LoginLogoutClient(context); String sessionCookie = loginLogoutClient.login(); AutomationContext contextUser = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, "userKey1"); LoginLogoutClient loginLogoutClientUser = new LoginLogoutClient(contextUser); loginLogoutClientUser.login(); loginLogoutClient.logout(); boolean isStatingToCleanTenant = CarbonCommandToolsUtil.findMultipleStringsInLog( context.getContextUrls().getBackEndUrl(), new String[]{"Starting to clean tenant"}, sessionCookie); Assert.assertTrue(isStatingToCleanTenant, "Not cleaned the tenant successfully"); }

Target:
public void testTenantIdleTime() throws Exception { AutomationContext context = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); LoginLogoutClient loginLogoutClient = new LoginLogoutClient(context); String sessionCookie = loginLogoutClient.login(); AutomationContext contextUser = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, "userKey1"); LoginLogoutClient loginLogoutClientUser = new LoginLogoutClient(contextUser); loginLogoutClientUser.login(); loginLogoutClient.logout(); boolean isStatingToCleanTenant = CarbonCommandToolsUtil.searchOnLogs( context.getContextUrls().getBackEndUrl(), new String[]{"Starting to clean tenant"}, sessionCookie); assertTrue(isStatingToCleanTenant, "Not cleaned the tenant successfully"); }
Source:
public static void removePmFromOutbox(PrivateMessage pm) { info("Start to remove PM from outbox folder"); mainPage.openPrivateMessages(); info("Opening outbox folder"); pmPage.clickOpenOutboxMessages(); removePm(pm); }

Target:
public static void removePmFromOutbox(PrivateMessage pm) { info("Start to remove PM from outbox folder"); mainPage.openPrivateMessages(); pmPage.clickOpenOutboxMessages(); removePm(pm); }
Source:
default Map<String, Set<DatastreamTask>> movePartitions(Map<String, Set<DatastreamTask>> currentAssignment, Map<String, Set<String>> targetAssignment, DatastreamGroupPartitionsMetadata partitionsMetadata) { return currentAssignment; }

Target:
default Map<String, Set<DatastreamTask>> movePartitions(Map<String, Set<DatastreamTask>> currentAssignment, Map<String, Set<String>> targetAssignment, DatastreamGroupPartitionsMetadata partitionsMetadata) { throw new NotImplementedException("movePartitions are not implemented"); }
Source:
public SimpleQueryableIndex( Interval dataInterval, Indexed<String> dimNames, BitmapFactory bitmapFactory, Map<String, Column> columns, SmooshedFileMapper fileMapper, Metadata metadata ) { Preconditions.checkNotNull(columns.get(Column.TIME_COLUMN_NAME)); this.dataInterval = dataInterval; ImmutableList.Builder<String> columnNamesBuilder = ImmutableList.builder(); for (String column : columns.keySet()) { if (!Column.TIME_COLUMN_NAME.equals(column)) { columnNamesBuilder.add(column); } } this.columnNames = columnNamesBuilder.build(); this.availableDimensions = dimNames; this.bitmapFactory = bitmapFactory; this.columns = columns; this.fileMapper = fileMapper; this.metadata = metadata; this.dimensionHandlers = Maps.newLinkedHashMap(); initDimensionHandlers(); removeNullorEmptyDimensions(); }

Target:
public SimpleQueryableIndex( Interval dataInterval, Indexed<String> dimNames, BitmapFactory bitmapFactory, Map<String, Column> columns, SmooshedFileMapper fileMapper, Metadata metadata ) { Preconditions.checkNotNull(columns.get(Column.TIME_COLUMN_NAME)); this.dataInterval = dataInterval; ImmutableList.Builder<String> columnNamesBuilder = ImmutableList.builder(); for (String column : columns.keySet()) { if (!Column.TIME_COLUMN_NAME.equals(column)) { columnNamesBuilder.add(column); } } this.columnNames = columnNamesBuilder.build(); this.availableDimensions = dimNames; this.bitmapFactory = bitmapFactory; this.columns = columns; this.fileMapper = fileMapper; this.metadata = metadata; this.dimensionHandlers = Maps.newLinkedHashMap(); initDimensionHandlers(); }
Source:
public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( ( obj == null ) || !( obj instanceof FileModelSource ) ) { return false; } FileModelSource other = ( FileModelSource ) obj; return getFile().equals( other.getFile() ); }

Target:
public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof FileModelSource ) ) { return false; } FileModelSource other = ( FileModelSource ) obj; return getFile().equals( other.getFile() ); }
Source:
public static MISTQuery cepStatelessTranslator(final MISTCepStatelessQuery query) { CepInput cepInput = query.getCepInput(); List<CepStatelessRule> cepStatelessRules = query.getCepStatelessRules(); MISTQueryBuilder queryBuilder = new MISTQueryBuilder("example-group"); ContinuousStream<HashMap<String, Tuple2<Object, CepValueType>>> inputMapStream = cepInputTranslator(queryBuilder, cepInput); cepStatelessRulesTranslator(inputMapStream, cepStatelessRules); return queryBuilder.build(); }

Target:
public static MISTQuery cepStatelessTranslator(final MISTCepStatelessQuery query) { final CepInput cepInput = query.getCepInput(); final List<CepStatelessRule> cepStatelessRules = query.getCepStatelessRules(); final MISTQueryBuilder queryBuilder = new MISTQueryBuilder(query.getGroupId()); final ContinuousStream<Map<String, Object>> inputMapStream = cepInputTranslator(queryBuilder, cepInput); cepStatelessRulesTranslator(inputMapStream, cepStatelessRules); return queryBuilder.build(); }
Source:
<PK, M> MessageStreamImpl<M> generateIntStreamFromOpId(int opId, Function<M, PK> parKeyFn) { String streamId = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); StreamSpec streamSpec = runner.streamFromConfig(streamId); if (!this.inStreams.containsKey(streamSpec.getId())) { this.inStreams.putIfAbsent(streamSpec.getId(), new IntermediateStreamImpl(this, streamSpec, null, null, parKeyFn)); } IntermediateStreamImpl intStream = (IntermediateStreamImpl) this.inStreams.get(streamSpec.getId()); if (!this.outStreams.containsKey(streamSpec.getId())) { this.outStreams.putIfAbsent(streamSpec.getId(), intStream); } return intStream; }

Target:
<PK, M> MessageStreamImpl<M> generateIntStreamFromOpId(int opId, Function<M, PK> parKeyFn) { String opNameWithId = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); String streamId = String.format("%s-%s-%s", config.get(JobConfig.JOB_NAME()), config.get(JobConfig.JOB_ID(), "1"), opNameWithId); StreamSpec streamSpec = runner.streamFromConfig(streamId); this.inStreams.putIfAbsent(streamSpec.getId(), new IntermediateStreamImpl(this, streamSpec, null, null, parKeyFn)); IntermediateStreamImpl intStream = (IntermediateStreamImpl) this.inStreams.get(streamSpec.getId()); this.outStreams.putIfAbsent(streamSpec.getId(), intStream); return intStream; }
Source:
public BindAccountMetadataToDeleteToHeaders() { FN = new Function<String, String>() { @Override public String apply(String element) { String inLowercase = element.toLowerCase(); return (!inLowercase.startsWith(ACCOUNT_METADATA_PREFIX)) ? ACCOUNT_METADATA_PREFIX + inLowercase: inLowercase; } @Override public String toString() { return "prefix: " + ACCOUNT_METADATA_PREFIX; } }; FN2 = new Function<String, String>() { @Override public String apply(String element) { return ""; } }; }

Target:
public BindAccountMetadataToDeleteToHeaders() { transformHeaders = new Function<String, String>() { @Override public String apply(String element) { String inLowercase = element.toLowerCase(); return (!inLowercase.startsWith(ACCOUNT_METADATA_PREFIX)) ? ACCOUNT_METADATA_PREFIX.toLowerCase() + inLowercase : inLowercase; } @Override public String toString() { return "prefix: " + ACCOUNT_METADATA_PREFIX; } }; transformValues = new Function<String, String>() { @Override public String apply(String element) { return ""; } }; }
Source:
public Map<String, Object> introspect(String token) { TokenIntrospectionSuccessResponse response = Optional.of(this.requestEntityConverter.convert(token)) .map(this::makeRequest) .map(this::adaptToNimbusResponse) .map(this::parseNimbusResponse) .map(this::castToNimbusSuccess) .filter(TokenIntrospectionSuccessResponse::isActive) .orElseThrow(() -> new OAuth2IntrospectionException("Provided token [" + token + "] isn't active")); return convertClaimsSet(response); }

Target:
public Map<String, Object> introspect(String token) { TokenIntrospectionSuccessResponse response = Optional.of(token) .map(this.requestEntityConverter::convert) .map(this::makeRequest) .map(this::adaptToNimbusResponse) .map(this::parseNimbusResponse) .map(this::castToNimbusSuccess) .filter(TokenIntrospectionSuccessResponse::isActive) .orElseThrow(() -> new OAuth2IntrospectionException("Provided token [" + token + "] isn't active")); return convertClaimsSet(response); }
Source:
public CreateWorkflowResponse mergeSegments(@Nonnull String endpoint) throws TimeoutException { OrchestratorMsg req = new OrchestratorMsg(new MergeSegmentsRequest(endpoint)); CompletableFuture<OrchestratorResponse> resp = sendMessageWithFuture(CorfuMsgType .ORCHESTRATOR_REQUEST .payloadMsg(req)); return (CreateWorkflowResponse) CFUtils.getUninterruptibly(resp, TimeoutException.class).getResponse(); }

Target:
public CreateWorkflowResponse mergeSegments(@Nonnull String endpoint) throws TimeoutException { OrchestratorMsg req = new OrchestratorMsg(new RestoreRedundancyMergeSegmentsRequest(endpoint)); CompletableFuture<OrchestratorResponse> resp = sendMessageWithFuture(CorfuMsgType .ORCHESTRATOR_REQUEST .payloadMsg(req)); return (CreateWorkflowResponse) CFUtils.getUninterruptibly(resp, TimeoutException.class).getResponse(); }
Source:
public static double calculateDistance(final Locatable from, final Locatable to) { if (!from.getContig().equals(to.getContig())) { return Double.POSITIVE_INFINITY; } else { final double toMidpoint = (to.getStart() + to.getEnd())/2; final double fromMidpoint = (from.getStart() + from.getEnd())/2; return Math.abs(toMidpoint - fromMidpoint); } }

Target:
protected static double calculateDistance(final Locatable from, final Locatable to) { if (!from.getContig().equals(to.getContig())) { return Double.POSITIVE_INFINITY; } else { final double toMidpoint = (to.getStart() + to.getEnd())/2; final double fromMidpoint = (from.getStart() + from.getEnd())/2; return Math.abs(toMidpoint - fromMidpoint); } }
Source:
public CancelStatus cancelStatus() { if (CANCELLED.equals(status)) { return CancelStatus.CANCELLED; } if (SUBMITTED.equals(status)) { return CancelStatus.SUBMITTED; } return CancelStatus.ERROR; }

Target:
public CancelStatus cancelStatus() { switch(status) { case CANCELLED: return CancelStatus.CANCELLED; case SUBMITTED: return CancelStatus.SUBMITTED; default: return CancelStatus.ERROR; } }
Source:
public CommentAttributes(String courseId, String giverEmail, CommentParticipantType recipientType, Set<String> recipients, Date createdAt, Text commentText) { this.courseId = courseId; this.giverEmail = giverEmail; this.recipientType = recipientType == null ? CommentParticipantType.PERSON : recipientType; this.recipients = recipients; this.commentText = commentText == null ? null : new Text(Sanitizer.sanitizeForRichText(commentText.getValue())); this.createdAt = createdAt; this.lastEditorEmail = giverEmail; this.lastEditedAt = createdAt; }

Target:
public CommentAttributes(String courseId, String giverEmail, CommentParticipantType recipientType, Set<String> recipients, Date createdAt, Text commentText) { this.courseId = courseId; this.giverEmail = giverEmail; this.recipientType = recipientType == null ? CommentParticipantType.PERSON : recipientType; this.recipients = recipients; this.commentText = commentText; this.createdAt = createdAt; this.lastEditorEmail = giverEmail; this.lastEditedAt = createdAt; }
Source:
public void testSimpleScript1() throws Exception { String value = "javaValue"; String key = "processValue"; cacheManager.getCache("test_cache").put(key, value); CompletableFuture exec = scriptingManager.runScript("testExecWithoutProp.js"); while (!exec.isDone()) { Thread.sleep(1000); } assertEquals(value + ":additionFromJavascript", cacheManager.getCache("test_cache").get(key)); }

Target:
public void testSimpleScript1() throws Exception { String value = "javaValue"; String key = "processValue"; cacheManager.getCache("test_cache").put(key, value); CompletableFuture exec = scriptingManager.runScript("testExecWithoutProp.js"); exec.get(1000, TimeUnit.MILLISECONDS); assertEquals(value + ":additionFromJavascript", cacheManager.getCache("test_cache").get(key)); }
Source:
public final Response getTermById(@PathParam("term_id") final String term_id) { if (null == term_id) { return new SegueErrorResponse(Status.BAD_REQUEST, "Please specify a term_id.").toResponse(); } Content c = null; try { c = this.contentManager.getContentDOById(this.contentIndex, term_id); if (null == c) { SegueErrorResponse error = new SegueErrorResponse(Status.NOT_FOUND, "No glossary term found with id: " + term_id); log.debug(error.getErrorMessage()); return error.toResponse(); } } catch (NumberFormatException e) { return new SegueErrorResponse(Status.BAD_REQUEST, "Unable to convert one of the integer parameters provided into numbers. " + "Params provided were: limit" + DEFAULT_RESULTS_LIMIT + " and startIndex 0", e).toResponse(); } catch (ContentManagerException e) { return new SegueErrorResponse(Status.INTERNAL_SERVER_ERROR, "Content acquisition error.", e).toResponse(); } return Response.ok(c).build(); }

Target:
public final Response getTermById(@PathParam("term_id") final String term_id) { if (null == term_id) { return new SegueErrorResponse(Status.BAD_REQUEST, "Please specify a term_id.").toResponse(); } Content c = null; try { c = this.contentManager.getContentDOById(this.contentIndex, term_id); if (null == c) { SegueErrorResponse error = new SegueErrorResponse(Status.NOT_FOUND, "No glossary term found with id: " + term_id); log.debug(error.getErrorMessage()); return error.toResponse(); } } catch (ContentManagerException e) { return new SegueErrorResponse(Status.INTERNAL_SERVER_ERROR, "Content acquisition error.", e).toResponse(); } EntityTag etag = new EntityTag(this.contentManager.getCurrentContentSHA().hashCode() + ""); return Response.ok(c).tag(etag).build(); }
Source:
public static List<AbstractProject> getProjectsFromString(String projects, Item context) { List<AbstractProject> dependencyJobs = new ArrayList<AbstractProject>(); if (projects == null) { return null; } else { StringTokenizer tokens = new StringTokenizer(Util.fixNull(projects), ","); while (tokens.hasMoreTokens()) { String projectName = tokens.nextToken().trim(); if (!projectName.equals("")) { Item item = Jenkins.getInstance().getItem(projectName, context, Item.class); if ((item != null) && (item instanceof AbstractProject)) { dependencyJobs.add((AbstractProject)item); logger.debug("project dependency job added : {}", (AbstractProject)item); } } } } return dependencyJobs; }

Target:
public static List<AbstractProject> getProjectsFromString(String projects, Item context) { List<AbstractProject> dependencyJobs = new ArrayList<AbstractProject>(); if ((projects == null) || projects.equals("")) { return null; } else { StringTokenizer tokens = new StringTokenizer(Util.fixNull(projects), ","); while (tokens.hasMoreTokens()) { String projectName = tokens.nextToken().trim(); if (!projectName.equals("")) { Item item = Jenkins.getInstance().getItem(projectName, context, Item.class); if ((item != null) && (item instanceof AbstractProject)) { dependencyJobs.add((AbstractProject)item); logger.debug("project dependency job added : {}", (AbstractProject)item); } } } } return dependencyJobs; }
Source:
public List<IDockerContainerListener> getContainerListeners() { final IDockerContainerListener[] listeners = new IDockerContainerListener[this.containerListeners .size()]; for (int i = 0; i < containerListeners.getListeners().length; i++) { listeners[i] = (IDockerContainerListener) containerListeners .getListeners()[i]; } return Arrays.asList(listeners); }

Target:
public List<IDockerContainerListener> getContainerListeners() { final IDockerContainerListener[] result = new IDockerContainerListener[this.containerListeners .size()]; final Object[] listeners = containerListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { result[i] = (IDockerContainerListener) listeners[i]; } return Arrays.asList(result); }
Source:
public EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils) { EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils); instance.setNonSecurePort(this.nonSecurePort); instance.setInstanceId(getDefaultInstanceId(this.env)); if (this.managementPort != this.nonSecurePort && this.managementPort != 0) { if (StringUtils.hasText(this.hostname)) { instance.setHostname(this.hostname); } if (StringUtils.hasText(statusPageUrlPath)) { instance.setStatusPageUrlPath(statusPageUrlPath); } if (StringUtils.hasText(healthCheckUrlPath)) { instance.setHealthCheckUrlPath(healthCheckUrlPath); } String scheme = instance.getSecurePortEnabled() ? "https" : "http"; instance.setStatusPageUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getStatusPageUrlPath()); instance.setHealthCheckUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getHealthCheckUrlPath()); } return instance; }

Target:
public EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils) { RelaxedPropertyResolver relaxedPropertyResolver = new RelaxedPropertyResolver(env, "eureka.instance."); EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils); instance.setNonSecurePort(this.nonSecurePort); instance.setInstanceId(getDefaultInstanceId(this.env)); if (this.managementPort != this.nonSecurePort && this.managementPort != 0) { if (StringUtils.hasText(this.hostname)) { instance.setHostname(this.hostname); } String statusPageUrlPath = relaxedPropertyResolver.getProperty("statusPageUrlPath"); String healthCheckUrlPath = relaxedPropertyResolver.getProperty("healthCheckUrlPath"); if (StringUtils.hasText(statusPageUrlPath)) { instance.setStatusPageUrlPath(statusPageUrlPath); } if (StringUtils.hasText(healthCheckUrlPath)) { instance.setHealthCheckUrlPath(healthCheckUrlPath); } String scheme = instance.getSecurePortEnabled() ? "https" : "http"; instance.setStatusPageUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getStatusPageUrlPath()); instance.setHealthCheckUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getHealthCheckUrlPath()); } return instance; }
Source:
public String queryToRetrieveData() { StringBuilder builder = new StringBuilder(); if (query != null) { builder.append(query.trim()); if (builder.charAt(builder.length() - 1) == ';') { builder.deleteCharAt(builder.length() - 1); } } else { builder.append("SELECT ").append(columnsExpression).append(" FROM ").append(tableName); if (whereCondition != null) { builder.append(" WHERE ").append(whereCondition); } if (groupByClause != null) { builder.append(" GROUP BY ").append(groupByClause); if (havingCondition != null) { builder.append(" HAVING ").append(havingCondition); } } if (orderByExpr != null) { builder.append(" ORDER BY ").append(orderByExpr); } } if (limitSupported) { builder.append(" LIMIT ? , ? "); } else { builder.append(" OFFSET ? ROWS FETCH NEXT ? ROWS FETCH NEXT ? ROWS ONLY "); } builder.append(";"); String queryStr = builder.toString(); LOG.debug("built query {}", queryStr); return queryStr; }

Target:
public String queryToRetrieveData() { StringBuilder builder = new StringBuilder(); if (query != null) { builder.append(query.trim()); if (builder.charAt(builder.length() - 1) == ';') { builder.deleteCharAt(builder.length() - 1); } } else { builder.append("SELECT ").append(columnsExpression).append(" FROM ").append(tableName); if (whereCondition != null) { builder.append(" WHERE ").append(whereCondition); } if (groupByClause != null) { builder.append(" GROUP BY ").append(groupByClause); if (havingCondition != null) { builder.append(" HAVING ").append(havingCondition); } } if (orderByExpr != null) { builder.append(" ORDER BY ").append(orderByExpr); } } if (mysqlSyntax) { builder.append(" LIMIT ").append(fetchSize).append(" OFFSET ?"); } else { builder.append(" OFFSET ? ROWS FETCH NEXT ").append(fetchSize).append(" ROWS ONLY"); } builder.append(";"); String queryStr = builder.toString(); LOG.debug("built query {}", queryStr); return queryStr; }
Source:
public void setPasswordAndHashedPassword(String password) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); String salt = BCrypt.gensalt(ApplicationConstants.DEFAULT_BCRYPT_ROUND); String hashedPassword = BCrypt.hashpw(password, salt); editor.putString(ApplicationConstants.UserKeys.PASSWORD, password); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); editor.commit(); }

Target:
public void setPasswordAndHashedPassword(String password) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); String salt = BCrypt.gensalt(ApplicationConstants.DEFAULT_BCRYPT_ROUND); String hashedPassword = BCrypt.hashpw(password, salt); editor.putString(ApplicationConstants.UserKeys.PASSWORD, password); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); editor.apply(); }
Source:
private String makeFilename(String suffix) { return StringUtils.safeFormat("%s.%s", filenameBase, suffix); }

Target:
private String makeFilename(String suffix) { return StringUtils.format("%s.%s", filenameBase, suffix); }
Source:
public KafkaEightSimpleConsumerFirehoseFactory( @JsonProperty("brokerList") String brokerList, @JsonProperty("partitionIdList") String partitionIdList, @JsonProperty("clientId") String clientId, @JsonProperty("feed") String feed, @JsonProperty("parser") ByteBufferInputRowParser parser, @JsonProperty("offsetPosition") String offsetPosition, @JsonProperty("queueBufferLength") int queueBufferLength) { log.info("brokerList:" + brokerList); this.brokerList = brokerList; log.info("partitionIdList:" + partitionIdList); this.partitionIdList = partitionIdList; log.info("clientId:" + clientId); this.clientId = clientId; log.info("feed:" + feed); this.feed = feed; this.parser = (parser == null) ? null : parser; log.info("queueBufferLength:" + queueBufferLength); this.queueBufferLength = queueBufferLength; log.info("offsetPosition:" + offsetPosition); this.offsetPosition = offsetPosition; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { log.info("no md5 algorithm"); } }

Target:
public KafkaEightSimpleConsumerFirehoseFactory( @JsonProperty("brokerList") String brokerList, @JsonProperty("partitionIdList") String partitionIdList, @JsonProperty("clientId") String clientId, @JsonProperty("feed") String feed, @JsonProperty("parser") ByteBufferInputRowParser parser, @JsonProperty("offsetPosition") String offsetPosition, @JsonProperty("queueBufferLength") int queueBufferLength) { this.brokerList = brokerList; this.partitionIdList = partitionIdList; this.clientId = clientId; this.feed = feed; this.parser = (parser == null) ? null : parser; this.queueBufferLength = queueBufferLength; this.offsetPosition = offsetPosition; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { log.info("no md5 algorithm"); } }
Source:
public void showLocationDisabledDialog(){ Boolean isGPSDataCollectionEnabledSetting = new GPSFeaturePreferenceService(application).getIsGPSDataCollectionEnabledSetting(); if(isGPSDataCollectionEnabledSetting) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(application); alertDialog.setTitle(formWebViewActivity.getString(R.string.title_enable_gps_location)); alertDialog.setMessage(formWebViewActivity.getString(R.string.gps_location_off_message)); alertDialog.setPositiveButton(formWebViewActivity.getString(R.string.btn_location_setting), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); application.startActivity(intent); } }); alertDialog.show(); } }

Target:
public void showLocationDisabledDialog(){ Boolean isGPSDataCollectionSettingEnabled = new GPSFeaturePreferenceService(application).isGPSDataCollectionSettingEnabled(); if(isGPSDataCollectionSettingEnabled) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(application); alertDialog.setTitle(formWebViewActivity.getString(R.string.title_enable_gps_location)); alertDialog.setMessage(formWebViewActivity.getString(R.string.hint_gps_location_off)); alertDialog.setPositiveButton(formWebViewActivity.getString(R.string.general_location_setting), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); application.startActivity(intent); } }); alertDialog.show(); } }
Source:
public ShardResponse(Version version) { this.allOn4_1 = version.onOrAfter(Version.V_4_2_0); }

Target:
public ShardResponse(Version version) { this.allOn4_2 = version.onOrAfter(Version.V_4_2_0); }
Source:
public Object lookupByName(String name) { Object service = null; ServiceReference<?> sr = bundleContext.getServiceReference(name); if (sr != null) { serviceReferenceQueue.add(sr); service = bundleContext.getService(sr); } else { try { ServiceReference<?>[] refs = bundleContext.getServiceReferences((String)null, "(" + Constants.SERVICE_PID + "=" + name + ")"); if (refs != null && refs.length > 0) { sr = refs[0]; serviceReferenceQueue.add(sr); service = bundleContext.getService(sr); } } catch (InvalidSyntaxException ex) { LOG.error("Invalid filter to lookup bean", ex); } } return service; }

Target:
public Object lookupByName(String name) { Object service = null; ServiceReference<?> sr = bundleContext.getServiceReference(name); if (sr == null) { String filterExpression = "(" + Constants.SERVICE_PID + "=" + name + ")"; try { ServiceReference<?>[] refs = bundleContext.getServiceReferences((String)null, filterExpression); if (refs != null && refs.length > 0) { sr = refs[0]; } } catch (InvalidSyntaxException ex) { if (LOG.isDebugEnabled()) { LOG.debug("Invalid OSGi service reference filter, skipped lookup by service.pid. Filter expression: " + filterExpression, ex); } } } if (sr != null) { serviceReferenceQueue.add(sr); service = bundleContext.getService(sr); } return service; }
Source:
public void canSerializeDatesWithLargeTimestampsConcurrently() { JsonProvider provider = new JsonProvider(config, new ProductCachedSerializationModule(productCurator)); ObjectMapper mapper = provider.locateMapper(Object.class, MediaType.APPLICATION_JSON_TYPE); ExecutorService ex = Executors.newFixedThreadPool(1000); for (int i = 0; i < 500000; i++) { ex.execute(() -> { try { mapper.writeValueAsString(new Date(getRandomTimestampWithMilliSeconds())); } catch (JsonProcessingException e) { e.printStackTrace(); failed.set(true); } }); } if (failed.get()) { fail("A JsonProcessingException should not have been thrown " + "during concurrent Date serialization."); } }

Target:
public void canSerializeDatesWithLargeTimestampsConcurrently() { JsonProvider provider = new JsonProvider(config, new ProductCachedSerializationModule(productCurator)); ObjectMapper mapper = provider.locateMapper(Object.class, MediaType.APPLICATION_JSON_TYPE); final AtomicBoolean processingFailure = new AtomicBoolean(false); final AtomicBoolean comparisonFailure = new AtomicBoolean(false); ExecutorService ex = Executors.newFixedThreadPool(1000); for (int i = 0; i < 5000000; i++) { ex.execute(() -> { Date randomDate = new Date(getRandomTimestampWithMilliSeconds()); SimpleDateFormat iso8601WithoutMilliseconds = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); iso8601WithoutMilliseconds.setTimeZone(TimeZone.getTimeZone("UTC")); String expectedDate = "\"" + iso8601WithoutMilliseconds.format(randomDate) + "\""; try { String receivedDate = mapper.writeValueAsString(randomDate); try { assertEquals("The date was not serialized properly.", expectedDate, receivedDate); } catch (ComparisonFailure cf) { cf.printStackTrace(); comparisonFailure.set(true); } } catch (JsonProcessingException e) { e.printStackTrace(); processingFailure.set(true); } }); } if (processingFailure.get()) { fail("A JsonProcessingException was thrown during concurrent Date serialization."); } if (comparisonFailure.get()) { fail("A date was not serialized properly during concurrent Date serialization."); } }
Source:
public void shouldNotCallSupplierUntilNecessary() { assertThat(iterate(2, (i) -> {throw new RuntimeException("The supplier function should not be called since the next value is not needed in order to get head.");}).head()).isEqualTo(2); }

Target:
public void shouldNotCallSupplierUntilNecessary() { assertThat(iterate(2, (i) -> {throw new RuntimeException();}).head()).isEqualTo(2); }
Source:
public void setPreparedStatementParams(PreparedStatement preparedStatement, Schema.Type type, int index, Object val) throws SQLException { if (val == null) { preparedStatement.setNull(index, getSqlType(type)); return; } switch (type) { case BOOLEAN: preparedStatement.setBoolean(index, (Boolean) val); break; case BYTE: preparedStatement.setByte(index, (Byte) val); break; case SHORT: preparedStatement.setShort(index, (Short) val); break; case INTEGER: preparedStatement.setInt(index, (Integer) val); break; case LONG: preparedStatement.setLong(index, (Long) val); break; case FLOAT: preparedStatement.setFloat(index, (Float) val); break; case DOUBLE: preparedStatement.setDouble(index, (Double) val); break; case STRING: String stringValue = (String) val; if (StringUtils.isEmpty(stringValue)) preparedStatement.setString(index, EMPTY_STRING_PLACEHOLDER); else preparedStatement.setString(index, stringValue); break; case BINARY: preparedStatement.setBytes(index, (byte[]) val); break; case BLOB: preparedStatement.setBinaryStream(index, (InputStream) val); break; case NESTED: case ARRAY: preparedStatement.setObject(index, val); break; } }

Target:
public void setPreparedStatementParams(PreparedStatement preparedStatement, Schema.Type type, int index, Object val) throws SQLException { if (type == Schema.Type.STRING && StringUtils.isEmpty((String) val)) { preparedStatement.setString(index, EMPTY_STRING_PLACEHOLDER); } else super.setPreparedStatementParams(preparedStatement, type, index, val); }
Source:
public void start(FeaturesRunner runner) { RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); streamType = defaultProperty(STREAM_PROPERTY, STREAM_CHRONICLE); try { switch (streamType) { case STREAM_CHRONICLE: initChronicle(harness); break; case STREAM_KAFKA: initKafka(harness); break; default: throw new UnsupportedOperationException(streamType + " stream type is not supported"); } } catch (IOException e) { throw new RuntimeServiceException("Unable to configure the stream implementation", e); } }

Target:
public void start(FeaturesRunner runner) { RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); streamType = defaultProperty(STREAM_PROPERTY, STREAM_CHRONICLE); try { String msg = "Deploying Nuxeo Stream using " + StringUtils.capitalize(streamType.toLowerCase()); System.out.println(getClass().getSimpleName() + ": " + msg); log.info(msg); switch (streamType) { case STREAM_CHRONICLE: break; case STREAM_KAFKA: initKafka(harness); break; default: throw new UnsupportedOperationException(streamType + " stream type is not supported"); } } catch (Exception e) { throw new RuntimeServiceException("Unable to configure the stream implementation", e); } }
Source:
private Function<PollingContext<KeyVaultCertificate>, Mono<PollResponse<KeyVaultCertificate>>> createRecoverPollOperation(String keyName) { return pollingContext -> withContext(context -> service.getCertificatePoller(vaultUrl, keyName, "", API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(keyResponse -> { if (keyResponse.getStatusCode() == 404) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, keyResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }

Target:
private Function<PollingContext<KeyVaultCertificate>, Mono<PollResponse<KeyVaultCertificate>>> createRecoverPollOperation(String keyName) { return pollingContext -> withContext(context -> service.getCertificatePoller(vaultUrl, keyName, "", API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(certificateResponse -> { if (certificateResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, certificateResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }
Source:
public CompletableFuture<?> asyncClose() { CompletableFuture<Void> counter = new CompletableFuture<>(); asyncClose(new SyncCloseCallback(), counter); explicitLacFlushPolicy.stopExplicitLacFlush(); return counter; }

Target:
public CompletableFuture<Void> asyncClose() { CompletableFuture<Void> result = new CompletableFuture<>(); SyncCloseCallback callback = new SyncCloseCallback(result); asyncClose(callback, null); explicitLacFlushPolicy.stopExplicitLacFlush(); return result; }
Source:
public ResponseEntity <User> getUserByID(@PathVariable String userID){ if (userService.getUserByID(userID) == null) return new ResponseEntity<User>(HttpStatus.INTERNAL_SERVER_ERROR); else return new ResponseEntity<User>(userService.getUserByID(userID), HttpStatus.OK); }

Target:
public @ResponseBody User getUserByID(@PathVariable String userID) throws InvalidUserIDException{ return userService.getUserByID(userID); }
Source:
public void validate() { Attribute<Long> reaperWakeUpInterval = attributes.attribute(REAPER_WAKE_UP_INTERVAL); Attribute<Long> completedTxTimeout = attributes.attribute(COMPLETED_TX_TIMEOUT); if (reaperWakeUpInterval.get()< 0) throw log.invalidReaperWakeUpInterval(reaperWakeUpInterval.get()); if (completedTxTimeout.get() < 0) throw log.invalidCompletedTxTimeout(completedTxTimeout.get()); CacheMode cacheMode = clustering().cacheMode(); if(attributes.attribute(TRANSACTION_PROTOCOL).get() == TransactionProtocol.TOTAL_ORDER) { if(transactionMode() != TransactionMode.TRANSACTIONAL) { throw log.invalidTxModeForTotalOrder(transactionMode()); } if(!cacheMode.isReplicated() && !cacheMode.isDistributed()) { throw log.invalidCacheModeForTotalOrder(clustering().cacheMode().friendlyCacheModeString()); } if (lockingMode() != LockingMode.OPTIMISTIC) { throw log.invalidLockingModeForTotalOrder(lockingMode()); } } if (!attributes.attribute(NOTIFICATIONS).get()) { log.transactionNotificationsDisabled(); } if (attributes.attribute(TRANSACTION_MODE).get() == TransactionMode.TRANSACTIONAL && !cacheMode.isSynchronous()) { CacheMode syncCacheMod = cacheMode.toSync(); log.unsupportedAsyncCacheMode(cacheMode, syncCacheMod); clustering().cacheMode(syncCacheMod); } recovery.validate(); }

Target:
public void validate() { Attribute<Long> reaperWakeUpInterval = attributes.attribute(REAPER_WAKE_UP_INTERVAL); Attribute<Long> completedTxTimeout = attributes.attribute(COMPLETED_TX_TIMEOUT); if (reaperWakeUpInterval.get()< 0) throw log.invalidReaperWakeUpInterval(reaperWakeUpInterval.get()); if (completedTxTimeout.get() < 0) throw log.invalidCompletedTxTimeout(completedTxTimeout.get()); CacheMode cacheMode = clustering().cacheMode(); if(attributes.attribute(TRANSACTION_PROTOCOL).get() == TransactionProtocol.TOTAL_ORDER) { if(transactionMode() != TransactionMode.TRANSACTIONAL) { throw log.invalidTxModeForTotalOrder(transactionMode()); } if(!cacheMode.isReplicated() && !cacheMode.isDistributed()) { throw log.invalidCacheModeForTotalOrder(clustering().cacheMode().friendlyCacheModeString()); } if (lockingMode() != LockingMode.OPTIMISTIC) { throw log.invalidLockingModeForTotalOrder(lockingMode()); } } if (!attributes.attribute(NOTIFICATIONS).get()) { log.transactionNotificationsDisabled(); } if (attributes.attribute(TRANSACTION_MODE).get() == TransactionMode.TRANSACTIONAL && !cacheMode.isSynchronous()) { throw log.unsupportedAsyncCacheMode(cacheMode); } recovery.validate(); }
Source:
protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { if (commentNode != null) { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { if (TransactionUtil.getEditingDomain(commentNode) == domain) { DeleteCommand command = new DeleteCommand(commentNode); try { GMFUnsafe.write(domain, command); } catch (Exception e) { Activator.log.error(e); } } } }); } }

Target:
protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { if (null != commentNode) { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { if (TransactionUtil.getEditingDomain(commentNode) == domain) { DeleteCommand command = new DeleteCommand(commentNode); try { GMFUnsafe.write(domain, command); } catch (Exception e) { Activator.log.error(e); } } } }); } }
Source:
Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putString(KEY_ID, id); bundle.putString(KEY_PARENT_ID, parentId); bundle.putString(KEY_DISPLAY_NAME, displayName); bundle.putParcelable(KEY_DISPLAY_ICON, ParcelUtils.toParcelable(displayIcon)); bundle.putBundle(KEY_EXTRAS, bundle); bundle.putStringArrayList(KEY_ATTENDEES, attendees); bundle.putStringArrayList(KEY_SUB_CONVERSATION_IDS, subConversationIds); bundle.putInt(KEY_LOADED_MESSAGE_SIZE, loadedMessageSize); bundle.putLong(KEY_NEWEST_MESSAGE_TIMESTAMP, newestMsgTimestmap); bundle.putLong(KEY_OLDEST_MESSAGE_TIMESTAMP, oldestMsgTimestmap); return bundle; }}

Target:
Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putString(KEY_ID, id); bundle.putString(KEY_PARENT_ID, parentId); bundle.putString(KEY_DISPLAY_NAME, displayName); bundle.putParcelable(KEY_DISPLAY_ICON, ParcelUtils.toParcelable(displayIcon)); bundle.putBundle(KEY_EXTRAS, bundle); bundle.putStringArrayList(KEY_ATTENDEES, attendees); bundle.putStringArrayList(KEY_SUB_CONVERSATION_IDS, subConversationIds); bundle.putInt(KEY_LOADED_MESSAGE_SIZE, loadedMessageSize); bundle.putLong(KEY_NEWEST_MESSAGE_TIMESTAMP, newestMsgTimestmap); bundle.putLong(KEY_OLDEST_MESSAGE_TIMESTAMP, oldestMsgTimestmap); return bundle; }
Source:
public SpnegoResult(HttpHeader header, URI uri, String value) { this.header = header; this.uri = uri; this.value = value; }

Target:
public SpnegoResult(HttpHeader header, URI uri, String value) { this.header = requireNonNull(header, "header is null"); this.uri = requireNonNull(uri, "uri is null"); this.value = requireNonNull(value, "value is null"); }
Source:
public Email addUserEmail(User user, ContactType contactType, String address, Boolean defaultAddress) { Email email = emailDAO.create(user.getContactInfo(), contactType, defaultAddress, address); if (user.getRole() == Role.STUDENT) { studentDAO.fireUpdate(user.getId()); } else { staffMemberDAO.fireUpdate(user.getId()); } return email; }

Target:
public Email addUserEmail(User user, ContactType contactType, String address, Boolean defaultAddress) { address = StringUtils.trim(address); if (StringUtils.isBlank(address)) { throw new IllegalArgumentException("Email cannot be blank."); } Email email = emailDAO.create(user.getContactInfo(), contactType, defaultAddress, address); if (user.getRole() == Role.STUDENT) { studentDAO.fireUpdate(user.getId()); } else { staffMemberDAO.fireUpdate(user.getId()); } return email; }
Source:
private void localize(final ApplicationConstants constants) { startedTimeEditor.setLabel(constants.rebalanceStartTime()); volumeEditor.setLabel(constants.rebalanceVolumeName()); clusterEditor.setLabel(constants.rebalanceClusterVolume()); statusTimeEditor.setLabel(constants.rebalanceStatusTime()); statusLabel.setText(constants.rebalanceComplete()); statusLabel.setVisible(false); }

Target:
private void localize(final ApplicationConstants constants) { startedTimeEditor.setLabel(constants.rebalanceStartTime()); volumeEditor.setLabel(constants.rebalanceVolumeName()); clusterEditor.setLabel(constants.rebalanceClusterVolume()); statusTimeEditor.setLabel(constants.rebalanceStatusTime()); statusLabel.setText(constants.rebalanceComplete()); }
Source:
public static void fhirResourceCreate(String fhirStoreName, String resourceType) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1beta1/%s/fhir/%s", client.getRootUrl(), fhirStoreName, resourceType); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); StringEntity requestEntity = new StringEntity( "{\"resourceType\": \"" + resourceType + "\", \"language\": \"en\"}"); HttpUriRequest request = RequestBuilder .post() .setUri(uriBuilder.build()) .setEntity(requestEntity) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_CREATED) { System.err.print(String.format( "Exception creating FHIR resource: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.print("FHIR resource created: "); responseEntity.writeTo(System.out); }

Target:
public static void fhirResourceCreate(String fhirStoreName, String resourceType) throws IOException, URISyntaxException { CloudHealthcare client = createClient(); HttpClient httpClient = HttpClients.createDefault(); String uri = String.format( "%sv1/%s/fhir/%s", client.getRootUrl(), fhirStoreName, resourceType); URIBuilder uriBuilder = new URIBuilder(uri) .setParameter("access_token", getAccessToken()); StringEntity requestEntity = new StringEntity( "{\"resourceType\": \"" + resourceType + "\", \"language\": \"en\"}"); HttpUriRequest request = RequestBuilder .post() .setUri(uriBuilder.build()) .setEntity(requestEntity) .addHeader("Content-Type", "application/fhir+json") .addHeader("Accept-Charset", "utf-8") .addHeader("Accept", "application/fhir+json; charset=utf-8") .build(); HttpResponse response = httpClient.execute(request); HttpEntity responseEntity = response.getEntity(); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_CREATED) { System.err.print(String.format( "Exception creating FHIR resource: %s\n", response.getStatusLine().toString())); responseEntity.writeTo(System.err); throw new RuntimeException(); } System.out.print("FHIR resource created: "); responseEntity.writeTo(System.out); }
Source:
public ValidationResult validate(Template subject) { ValidationResultBuilder resultBuilder = ValidationResult.builder(); if (Objects.isNull(subject)) { resultBuilder.error("Template request cannot be null in the instance group request."); } else { resultBuilder.ifError(() -> subject.getRootVolumeSize() != null && subject.getRootVolumeSize() < 1, "Root volume size cannot be smaller than 1 gigabyte."); } return resultBuilder.build(); }

Target:
public ValidationResult validate(Template subject) { ValidationResultBuilder resultBuilder = ValidationResult.builder(); if (Objects.isNull(subject)) { resultBuilder.error("Template cannot be null in the instance group request."); } else { resultBuilder.ifError(() -> subject.getRootVolumeSize() != null && subject.getRootVolumeSize() < 1, "Root volume size cannot be smaller than 1 gigabyte."); } return resultBuilder.build(); }
Source:
public void stop() { try { server.stop(); } catch (Exception e) { LOGGER.error("Failed to stop the Jetty server"); } }

Target:
public void stop() { try { server.stop(); } catch (Exception e) { LOGGER.error("Failed to stop the Jetty server.", e); } }
Source:
private void setAzkabanExecutionOptions(ExecutionParameters executionParameters, ExecutableFlow executableFlow) throws CloudFlowException { try { executableFlow.setFlowDefinitionId(Integer.parseInt(executionParameters.getFlowId())); } catch (NumberFormatException e) { throw new CloudFlowValidationException(String.format("Parameter '%s' must be an integer.", Constants.FLOW_ID_KEY)); } executableFlow.setFlowVersion(executionParameters.getFlowVersion()); executableFlow.setDescription(executionParameters.getDescription()); if (!executionParameters.getExperimentId().isEmpty()) { try { executableFlow.setExperimentId(Integer.parseInt(executionParameters.getExperimentId())); } catch (NumberFormatException e) { throw new CloudFlowValidationException(String.format("Parameter '%s' must be an integer.", Constants.EXPERIMENT_ID_KEY)); } } executableFlow.setSubmitUser(executionParameters.getSubmitUser()); ExecutionOptions executionOptions = new ExecutionOptions(); executionOptions.setFailureAction(ExecutionOptions.FailureAction.valueOf( executionParameters.getFailureAction().toString())); executionOptions.setNotifyOnFirstFailure(executionParameters.isNotifyOnFirstFailure()); executionOptions.setNotifyOnLastFailure(executionParameters.isNotifyFailureOnExecutionComplete()); executionOptions.setConcurrentOption(executionParameters.getConcurrentOption().getName()); setRuntimeProperties(executionParameters, executionOptions); executableFlow.setExecutionOptions(executionOptions); }

Target:
private void setAzkabanExecutionOptions(ExecutionParameters executionParameters, ExecutableFlow executableFlow) { try { executableFlow.setFlowDefinitionId(Integer.parseInt(executionParameters.getFlowId())); } catch (NumberFormatException e) { throw new CloudFlowValidationException("Flow id must be an integer."); } if(executionParameters.getFlowVersion() <= 0) { throw new CloudFlowValidationException("Flow version must be a positive number."); } executableFlow.setFlowVersion(executionParameters.getFlowVersion()); executableFlow.setDescription(executionParameters.getDescription()); if (!executionParameters.getExperimentId().isEmpty()) { try { executableFlow.setExperimentId(Integer.parseInt(executionParameters.getExperimentId())); } catch (NumberFormatException e) { throw new CloudFlowValidationException("Experiment id must be an integer."); } } executableFlow.setSubmitUser(executionParameters.getSubmitUser()); ExecutionOptions executionOptions = new ExecutionOptions(); executionOptions.setFailureAction(ExecutionOptions.FailureAction.valueOf( executionParameters.getFailureAction().toString())); executionOptions.setNotifyOnFirstFailure(executionParameters.isNotifyOnFirstFailure()); executionOptions.setNotifyOnLastFailure(executionParameters.isNotifyFailureOnExecutionComplete()); executionOptions.setConcurrentOption(executionParameters.getConcurrentOption().getName()); setRuntimeProperties(executionParameters, executionOptions); executableFlow.setExecutionOptions(executionOptions); }
Source:
public T getValueOrElse(T defaultValue) { return (isSuccess() ? value : defaultValue); }

Target:
public T getValueOrElse(T defaultValue) { ArgChecker.notNull(defaultValue, "defaultValue"); return (isSuccess() ? value : defaultValue); }