auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void startScheduler() { <START> ClusterService clusterService = Framework.getService(ClusterService.class); Duration duration; try { String prop = Framework.getProperty(CLUSTER_START_DURATION_PROP); if (isBlank(prop)) { duration = Duration.ZERO; } else { duration = DurationUtils.parse(prop); } } catch (DateTimeParseException e) { duration = Duration.ZERO; } if (duration.isZero() || duration.isNegative()) { duration = Duration.ofMinutes(1); } <END> Duration pollDelay = Duration.ofSeconds(1); clusterService.runAtomically("start-scheduler", duration, pollDelay, () -> { try { setupScheduler(); } catch (IOException | SchedulerException e) { throw new NuxeoException(e); } }); }</code><technical_language>time do code, WDYT adding a method ClusterService a helper retrieve duration a Framework property name? 10.10 9.10, ClusterLockHelper</technical_language>

Target:
protected void startScheduler() { ClusterService clusterService = Framework.getService(ClusterService.class); String prop = Framework.getProperty(CLUSTER_START_DURATION_PROP); Duration duration = DurationUtils.parsePositive(prop, CLUSTER_START_DURATION_DEFAULT); Duration pollDelay = Duration.ofSeconds(1); clusterService.runAtomically("start-scheduler", duration, pollDelay, () -> { try { setupScheduler(); } catch (IOException | SchedulerException e) { throw new NuxeoException(e); } }); }
Source:
<code>private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException { ColumnStatistics colStats = constructColumnStatsFromInput(); SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(Collections.singletonList(colStats)); if (work.getColStats() != null) { String dbName = colStats.getStatsDesc().getDbName(); String tblName = colStats.getStatsDesc().getTableName(); Table tbl = db.getTable(dbName, tblName); long writeId = work.getWriteId(); if (AcidUtils.isTransactionalTable(tbl)) { ValidWriteIdList writeIds; <START> if (writeId <= 0) { <END> Long tmpWriteId = ReplUtils.getMigrationCurrentTblWriteId(conf); if (tmpWriteId == null) { throw new HiveException("DDLTask : Write id is not set in the config by open txn task for migration"); } writeId = tmpWriteId; } writeIds = new ValidReaderWriteIdList(TableName.getDbTable(dbName, tblName), new long[0], new BitSet(), writeId); request.setValidWriteIdList(writeIds.toString()); request.setWriteId(writeId); } } db.setPartitionColumnStatistics(request); return 0; }</code><technical_language>Instead of this assumption of "writeId <= 0 means migration case", is if caller sets correct writeId in ColumnStatsUpdateWork itself. If is non-migration case is a bug in caller passes wrong writeId, throw incorrect exception message</technical_language>

Target:
private int persistColumnStats(Hive db) throws HiveException, MetaException, IOException { ColumnStatistics colStats = constructColumnStatsFromInput(); SetPartitionsStatsRequest request = new SetPartitionsStatsRequest(Collections.singletonList(colStats)); if (work.getColStats() != null) { String dbName = colStats.getStatsDesc().getDbName(); String tblName = colStats.getStatsDesc().getTableName(); Table tbl = db.getTable(dbName, tblName); long writeId = work.getWriteId(); if (AcidUtils.isTransactionalTable(tbl)) { ValidWriteIdList writeIds; if (work.getIsMigratingToTxn()) { Long tmpWriteId = ReplUtils.getMigrationCurrentTblWriteId(conf); if (tmpWriteId == null) { throw new HiveException("DDLTask : Write id is not set in the config by open txn task for migration"); } writeId = tmpWriteId; } writeIds = new ValidReaderWriteIdList(TableName.getDbTable(dbName, tblName), new long[0], new BitSet(), writeId); request.setValidWriteIdList(writeIds.toString()); request.setWriteId(writeId); } } db.setPartitionColumnStatistics(request); return 0; }
Source:
<code>public Optional<SelectionContext<VariableMap>> match(SelectionCriteria criteria) { Map<String, String> namedGroups = new HashMap<>(); if (userRegex.isPresent()) { Matcher userMatcher = userRegex.get().matcher(criteria.getUser()); if (!userMatcher.matches()) { return Optional.empty(); } namedGroups.putAll(getNamedGroups(userRegex.get(), criteria.getUser())); } if (sourceRegex.isPresent()) { String source = criteria.getSource().orElse(""); if (!sourceRegex.get().matcher(source).matches()) { return Optional.empty(); } namedGroups.putAll(getNamedGroups(sourceRegex.get(), source)); } if (!clientTags.isEmpty() && !criteria.getTags().containsAll(clientTags)) { return Optional.empty(); } if (queryType.isPresent()) { String contextQueryType = criteria.getQueryType().orElse(""); if (!queryType.get().equalsIgnoreCase(contextQueryType)) { return Optional.empty(); } } namedGroups.putIfAbsent("USER", criteria.getUser()); if (criteria.getSource().isPresent()) { namedGroups.putIfAbsent("SOURCE", criteria.getSource().get()); } VariableMap map = new VariableMap(namedGroups); ResourceGroupId id = group.expandTemplate(map); if (VARIABLE_PATTERN.matcher(id.toString()).find()) { List<String> variables = map.getVariables().keySet().stream() .map(Pattern::toString) <START> .map(v -> v.substring(4, v.length() - 3)).collect(Collectors.toList()); <END> throw new IllegalArgumentException(format("Unresolved variable in resource group '%s', available: %s", id, variables)); } return Optional.of(new SelectionContext<>(id, map)); }</code><technical_language>Put .collect(Collectors.toList()) a separate line</technical_language>

Target:
public Optional<SelectionContext<VariableMap>> match(SelectionCriteria criteria) { Map<String, String> variables = new HashMap<>(); if (userRegex.isPresent()) { Matcher userMatcher = userRegex.get().matcher(criteria.getUser()); if (!userMatcher.matches()) { return Optional.empty(); } addVariableValues(userRegex.get(), criteria.getUser(), variables); } if (sourceRegex.isPresent()) { String source = criteria.getSource().orElse(""); if (!sourceRegex.get().matcher(source).matches()) { return Optional.empty(); } addVariableValues(sourceRegex.get(), source, variables); } if (!clientTags.isEmpty() && !criteria.getTags().containsAll(clientTags)) { return Optional.empty(); } if (queryType.isPresent()) { String contextQueryType = criteria.getQueryType().orElse(""); if (!queryType.get().equalsIgnoreCase(contextQueryType)) { return Optional.empty(); } } variables.putIfAbsent(USER_VARIABLE, criteria.getUser()); variables.putIfAbsent(SOURCE_VARIABLE, criteria.getSource().orElse("")); VariableMap map = new VariableMap(variables); ResourceGroupId id = group.expandTemplate(map); return Optional.of(new SelectionContext<>(id, map)); }
Source:
<code>public void getGroupObjectCommunityTest() throws Exception { CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService(); Community community = null; Group adminGroup = null; try { context.turnOffAuthorisationSystem(); community = communityService.create(null, context); adminGroup = communityService.createAdministrators(context, community); context.commit(); <START> adminGroup = context.reloadEntity(adminGroup); <END> String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( get("/api/eperson/groups/" + adminGroup.getID() + "/object") ).andExpect(status().isOk()); } finally { if (community != null) { CommunityBuilder.deleteCommunity(community.getID()); } if (adminGroup != null) { GroupBuilder.deleteGroup(adminGroup.getID()); } } }</code><technical_language>above. GroupBuilder, missing a context.restoreAuthSystemState(); question commit() reloadEntity() above</technical_language>

Target:
public void getGroupObjectCommunityTest() throws Exception { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context) .withName("Parent Community") .withAdminGroup(admin) .build(); Group adminGroup = community.getAdministrators(); context.restoreAuthSystemState(); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform( get("/api/eperson/groups/" + adminGroup.getID() + "/object") ).andExpect(status().isOk()); }
Source:
<code>public void testAnalyze() { QualifiedName table = QualifiedName.of("foo"); assertStatement("ANALYZE foo", new Analyze(table, ImmutableList.of())); assertStatement("ANALYZE foo WITH ( \"string\" = 'bar', \"long\" = 42, computed = 'ban' || 'ana', a = ARRAY[ 'v1', 'v2' ] )", new Analyze(table, ImmutableList.of( new Property(new Identifier("string"), new StringLiteral("bar")), new Property(new Identifier("long"), new LongLiteral("42")), new Property( new Identifier("computed"), <START> new FunctionCall(QualifiedName.of("concat"), ImmutableList.of(new StringLiteral("ban"), new StringLiteral("ana")))), <END> new Property(new Identifier("a"), new ArrayConstructor(ImmutableList.of(new StringLiteral("v1"), new StringLiteral("v2"))))))); assertStatement("EXPLAIN ANALYZE foo", new Explain(new Analyze(table, ImmutableList.of()), false, false, ImmutableList.of())); assertStatement("EXPLAIN ANALYZE ANALYZE foo", new Explain(new Analyze(table, ImmutableList.of()), true, false, ImmutableList.of())); }</code><technical_language>test for || is brittle. fact parser currently turns a FunctionCall for "concat" function is a legacy implementation detail change. test more stable, arithmetic expressions</technical_language>

Target:
public void testAnalyze() { QualifiedName table = QualifiedName.of("foo"); assertStatement("ANALYZE foo", new Analyze(table, ImmutableList.of())); assertStatement("ANALYZE foo WITH ( \"string\" = 'bar', \"long\" = 42, computed = concat('ban', 'ana'), a = ARRAY[ 'v1', 'v2' ] )", new Analyze(table, ImmutableList.of( new Property(new Identifier("string"), new StringLiteral("bar")), new Property(new Identifier("long"), new LongLiteral("42")), new Property( new Identifier("computed"), new FunctionCall(QualifiedName.of("concat"), ImmutableList.of(new StringLiteral("ban"), new StringLiteral("ana")))), new Property(new Identifier("a"), new ArrayConstructor(ImmutableList.of(new StringLiteral("v1"), new StringLiteral("v2"))))))); assertStatement("EXPLAIN ANALYZE foo", new Explain(new Analyze(table, ImmutableList.of()), false, false, ImmutableList.of())); assertStatement("EXPLAIN ANALYZE ANALYZE foo", new Explain(new Analyze(table, ImmutableList.of()), true, false, ImmutableList.of())); }
Source:
<code>private Duration processTimeout(Element parentElement, Node timeoutNode) { Duration timeout; try { JAXBContext context = JAXBContext.newInstance(TimeType.class.getPackage().getName()); Unmarshaller unmarshaller = context.createUnmarshaller(); JAXBElement<TimeType> jaxbElement = unmarshaller.unmarshal(timeoutNode, TimeType.class); TimeType timeType = jaxbElement.getValue(); BigInteger amount = timeType.getValue(); if (amount.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) { throw new XmlConfigurationException( String.format("Value of XML configuration element <%s> in <%s> exceeds allowed value - %s", timeoutNode.getNodeName(), parentElement.getTagName(), amount)); } <START> timeout = Duration.of(amount.longValue(), convertToJavaTimeUnit(timeType.getUnit())); <END> } catch (JAXBException e) { throw new XmlConfigurationException(e); } return timeout; }</code><technical_language>return here</technical_language>

Target:
private Duration processTimeout(Element parentElement, Node timeoutNode) { try { JAXBContext context = JAXBContext.newInstance(TimeType.class.getPackage().getName()); Unmarshaller unmarshaller = context.createUnmarshaller(); JAXBElement<TimeType> jaxbElement = unmarshaller.unmarshal(timeoutNode, TimeType.class); TimeType timeType = jaxbElement.getValue(); BigInteger amount = timeType.getValue(); if (amount.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) { throw new XmlConfigurationException( String.format("Value of XML configuration element <%s> in <%s> exceeds allowed value - %s", timeoutNode.getNodeName(), parentElement.getTagName(), amount)); } return Duration.of(amount.longValue(), convertToJavaTimeUnit(timeType.getUnit())); } catch (JAXBException e) { throw new XmlConfigurationException(e); } }
Source:
<code>public SolrClientFactoryImpl(HttpSolrClientFactory httpSolrClientFactory) { this.clientType = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty("solr.client", "HttpSolrClient")); if ("CloudSolrClient".equals(clientType)) { factory = new SolrCloudClientFactory(); isCloud = true; } else { factory = httpSolrClientFactory; <START> } <END> }</code><technical_language>question: try hide details client instead of exposing factory</technical_language>

Target:
public SolrClientFactoryImpl(HttpSolrClientFactory httpSolrClientFactory) { this.clientType = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty("solr.client", "HttpSolrClient")); if ("CloudSolrClient".equals(clientType)) { factory = new SolrCloudClientFactory(); } else { factory = httpSolrClientFactory; } }
Source:
<code>public synchronized void assignFromSubscribed(Collection<TopicPartition> assignments) { if (!this.partitionsAutoAssigned()) throw new IllegalArgumentException("Attempt to dynamically assign partitions while manual assignment in use"); <START> Map<TopicPartition, TopicPartitionState> assignedPartitionStates = partitionToStateMap(assignments); <END> assignmentId++; this.assignment.set(assignedPartitionStates); }</code><technical_language>Nit: this declared final</technical_language>

Target:
public synchronized void assignFromSubscribed(Collection<TopicPartition> assignments) { if (!this.hasAutoAssignedPartitions()) throw new IllegalArgumentException("Attempt to dynamically assign partitions while manual assignment in use"); Map<TopicPartition, TopicPartitionState> assignedPartitionStates = new HashMap<>(assignments.size()); for (TopicPartition tp : assignments) { TopicPartitionState state = this.assignment.stateValue(tp); if (state == null) state = new TopicPartitionState(); assignedPartitionStates.put(tp, state); } assignmentId++; this.assignment.set(assignedPartitionStates); }
Source:
<code>public void workbenchSelectionChanged(ISelection selection) { Object o = SelectionUtils.getSelectedObject(selection); if (o instanceof TextSelection) { String text = ((TextSelection) o).getText(); m_sourceGraphControl.setSourceText(text); <START> } else if (o == null) { <END> m_sourceGraphControl.setSourceText(""); } }</code><technical_language>test "else" case needed -- if a TextSelection text set emprty string</technical_language>

Target:
public void workbenchSelectionChanged(ISelection selection) { Object o = SelectionUtils.getSelectedObject(selection); if (o instanceof TextSelection) { String text = ((TextSelection) o).getText(); m_sourceGraphControl.setSourceText(text); } else { m_sourceGraphControl.setSourceText(""); } }
Source:
<code>static void checkGetter(Method getter) { checkNotNull(getter); checkArgument(GETTER_PREFIX_PATTERN.matcher(getter.getName()) .find() && getter.getParameterTypes().length == 0, "Method `%s` is not a getter.", getter); checkArgument(!getter.getName().startsWith(IS) || <START> boolean.class.isAssignableFrom(getter.getReturnType()), <END> "Getter with an `is` prefix should have `boolean` return type."); checkArgument(getAnnotatedVersion(getter).isPresent(), "Entity column getter should be annotated with `%s`.", Column.class.getName()); int modifiers = getter.getModifiers(); checkArgument(isPublic(modifiers) && !isStatic(modifiers), "Entity column getter should be public instance method."); Class<?> returnType = getter.getReturnType(); Class<?> wrapped = wrap(returnType); checkArgument(Serializable.class.isAssignableFrom(wrapped), "Cannot create column of non-serializable type %s by method %s.", returnType, getter); }</code><technical_language>work Boolean too</technical_language>

Target:
static void checkGetter(Method getter) { checkNotNull(getter); checkArgument(GETTER_PREFIX_PATTERN.matcher(getter.getName()) .find() && getter.getParameterTypes().length == 0, "Method `%s` is not a getter.", getter); Class<?> returnType = getter.getReturnType(); checkArgument(!getter.getName().startsWith(IS_PREFIX) || boolean.class.isAssignableFrom(returnType) || Boolean.class.isAssignableFrom(returnType), "Getter with an `is` prefix should have `boolean` or `Boolean` return type."); checkArgument(getAnnotatedVersion(getter).isPresent(), "Entity column getter should be annotated with `%s`.", Column.class.getName()); int modifiers = getter.getModifiers(); checkArgument(isPublic(modifiers) && !isStatic(modifiers), "Entity column getter should be public instance method."); Class<?> wrapped = wrap(returnType); checkArgument(Serializable.class.isAssignableFrom(wrapped), "Cannot create column of non-serializable type %s by method %s.", returnType, getter); }
Source:
<code>private void assureVectorSize() { int requiredVectorLength = min(nextBatchSize, MAX_BATCH_SIZE); if (nullVector.length < requiredVectorLength) { nullVector = new boolean[requiredVectorLength]; dataVector = new long[requiredVectorLength]; inDictionaryVector = new boolean[requiredVectorLength]; <START> systemMemoryContext.setBytes(requiredVectorLength * 10); <END> } }</code><technical_language>ditto -- constants in airlift SizeOf</technical_language>

Target:
private void assureVectorSize() { int requiredVectorLength = min(nextBatchSize, MAX_BATCH_SIZE); if (nullVector.length < requiredVectorLength) { nullVector = new boolean[requiredVectorLength]; dataVector = new long[requiredVectorLength]; inDictionaryVector = new boolean[requiredVectorLength]; systemMemoryContext.setBytes(getRetainedSizeInBytes()); } }
Source:
<code>public FenceExecutor(VDS vds, FencingPolicy fencingPolicy) { <START> this(vds); <END> this.fencingPolicy = fencingPolicy; }</code><technical_language>Please change to: this.vds = vds;</technical_language>

Target:
public FenceExecutor(VDS vds, FencingPolicy fencingPolicy) { if (! vds.getId().equals(Guid.Empty)) { VDS dbVds = DbFacade.getInstance().getVdsDao().get(vds.getId()); if (vds.getVdsGroupId() == null) { vds.setVdsGroupId(dbVds.getVdsGroupId()); } if (vds.getPmProxyPreferences() == null) { vds.setPmProxyPreferences(dbVds.getPmProxyPreferences()); } } this._vds = vds; this.fencingPolicy = fencingPolicy; this.proxyLocator = new FenceProxyLocator(_vds, fencingPolicy); this.architectureHelper = new VdsArchitectureHelper(); }
Source:
<code>private static void createDatabase() { final String dbUser = getDbUsername(); try (Connection connection = getConnection(getDbRootUri(), dbUser, getDbPassword())) { <START> connection.createStatement().execute("CREATE DATABASE " + PostgresTestDocker.DB_NAME + " WITH owner=" + dbUser + " TEMPLATE postgres"); <END> connection.createStatement().execute("GRANT ALL PRIVILEGES ON DATABASE " + PostgresTestDocker.DB_NAME + " TO " + dbUser); } catch (SQLException e) { throw new PostgresTestDockerException(e); } }</code><technical_language>DB_NAME</technical_language>

Target:
private static void createDatabase() { final String dbUser = getDbUsername(); try (Connection connection = getConnection(getDbRootUri(), dbUser, getDbPassword())) { connection.createStatement().execute(format("CREATE DATABASE %s WITH owner=%s TEMPLATE postgres", DB_NAME, dbUser)); connection.createStatement().execute(format("GRANT ALL PRIVILEGES ON DATABASE %s TO %s", DB_NAME, dbUser)); } catch (SQLException e) { throw new PostgresTestDockerException(e); } }
Source:
<code>public DiagnosticReport getResourceById(@IdParam IdDt theId) { System.out.println("DiagnosticReport : getResourceByID"); <START> DiagnosticReport result = diagnosticReportResource.getByUniqueId(theId); <END> return result; }</code><technical_language>Sysouts ;)</technical_language>

Target:
public DiagnosticReport getResourceById(@IdParam IdDt theId) { DiagnosticReport result = diagnosticReportResource.getByUniqueId(theId); return result; }
Source:
<code>public void createBucket(String volumeName, String bucketName) throws IOException { createBucket(volumeName, bucketName, <START> BucketArgs.newBuilder().setAcls(getAclList()).build()); <END> }</code><technical_language>This creator acls added final list list added passin bucketArgs a non-empty acl list. {code} List<OzoneAcl> listOfAcls = getAclList(); //ACLs BucketArgs if(bucketArgs.getAcls() != null) { listOfAcls.addAll(bucketArgs.getAcls()); } {code} list of acls merged properly List#addAll, fixed in HDDS-1927. file a separate JIRA for RpcClient#createBucket issue</technical_language>

Target:
public void createBucket(String volumeName, String bucketName) throws IOException { createBucket(volumeName, bucketName, BucketArgs.newBuilder().build()); }
Source:
<code>protected synchronized void modified(Map<String, Object> properties) { if (properties != null) { String enabled = (String) properties.get("enabled"); if ("false".equalsIgnoreCase(enabled)) { this.enabled = false; } else { this.enabled = true; } } if (enabled) { Executors.newSingleThreadExecutor().submit(new Runnable() { @Override public void run() { <START> while (lastUpdate > new Date().getTime() - 2000L) { <END> try { Thread.sleep(100L); } catch (InterruptedException e) { } } logger.debug("Enabling channel item provider."); initialized = true; getAll(); addRegistryChangeListeners(); } }); } else { logger.debug("Disabling channel item provider."); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.removed(this, item); } } removeRegistryChangeListeners(); } }</code><technical_language>I assume nanoTime here, (and TimeUnit.SECONDS.toNanos(2))</technical_language>

Target:
protected synchronized void modified(Map<String, Object> properties) { if (properties != null) { String enabled = (String) properties.get("enabled"); if ("false".equalsIgnoreCase(enabled)) { this.enabled = false; } else { this.enabled = true; } } if (enabled) { Executors.newSingleThreadExecutor().submit(new Runnable() { @Override public void run() { while (lastUpdate > System.nanoTime() - TimeUnit.SECONDS.toNanos(2)) { try { Thread.sleep(100L); } catch (InterruptedException e) { } } logger.debug("Enabling channel item provider."); initialized = true; getAll(); addRegistryChangeListeners(); } }); } else { logger.debug("Disabling channel item provider."); for (ProviderChangeListener<Item> listener : listeners) { for (Item item : getAll()) { listener.removed(this, item); } } removeRegistryChangeListeners(); } }
Source:
<code>public void testIndeterminate() { <START> assertOperator(INDETERMINATE, "cast(null as boolean)", BOOLEAN, true); <END> assertOperator(INDETERMINATE, "true", BOOLEAN, false); assertOperator(INDETERMINATE, "false", BOOLEAN, false); assertOperator(INDETERMINATE, "true AND false", BOOLEAN, false); assertOperator(INDETERMINATE, "true OR false", BOOLEAN, false); }</code><technical_language>nit: cast(... BOOLEAN) (sometimes uppercase)</technical_language>

Target:
public void testIndeterminate() { assertOperator(INDETERMINATE, "cast(null AS BOOLEAN)", BOOLEAN, true); assertOperator(INDETERMINATE, "true", BOOLEAN, false); assertOperator(INDETERMINATE, "false", BOOLEAN, false); assertOperator(INDETERMINATE, "true AND false", BOOLEAN, false); assertOperator(INDETERMINATE, "true OR false", BOOLEAN, false); }
Source:
<code>public static ResourceSet loadResourceSetWithProxies(URI resourceURI, BasicCommandStack commandStack) { <START> final ResourceSet resourceSet = createResourceSet(commandStack); <END> return loadResourceWithProxies(resourceURI, resourceSet); }</code><technical_language>call new method null parameter</technical_language>

Target:
public static ResourceSet loadResourceSetWithProxies(URI resourceURI, BasicCommandStack commandStack) { try { loadResourceSetWithProxies(resourceURI, commandStack, null); } catch (final IOException ex) { Activator.getDefault().getReportService().report( new StatusReport(new Status(IStatus.ERROR, Activator.PLUGIN_ID, ex.getMessage(), ex))); } return null; }
Source:
<code>protected void handlePost(HttpServletRequest req, HttpServletResponse resp, Session session) throws ServletException, IOException { try { String body = HttpRequestUtils.getBody(req); Project project = objectMapper.readValue(body, Project.class); String projectId = projectService.createProject(project, session.getUser()); <START> sendResponse(resp, HttpServletResponse.SC_CREATED, projectId); <END> return; } catch(Exception e) { log.error("Error while handling POST request for projects. Got Exception: " + e); sendErrorResponse(resp, HttpServletResponse.SC_BAD_REQUEST, "BAD request to create project"); return; } }</code><technical_language>add a "Location" header in response? like: resp.setHeader("Location", "/projects/" + projectId); Also, in current specification POST requests return data in response body</technical_language>

Target:
protected void handlePost(HttpServletRequest req, HttpServletResponse resp, Session session) throws ServletException, IOException { if (ALL_PROJECT_URI.equals(req.getRequestURI())) { try { String body = HttpRequestUtils.getBody(req); Project project = objectMapper.readValue(body, Project.class); String projectId = projectService.createProject(project, session.getUser()); resp.setHeader("Location", "/projects/" + projectId); sendResponse(resp, HttpServletResponse.SC_CREATED, ""); return; } catch (Exception e) { log.error("Error while handling POST request for projects. Got Exception: " + e); sendErrorResponse(resp, HttpServletResponse.SC_BAD_REQUEST, "BAD request to create project"); return; } } else { log.error("Invalid route for projects endpoint: " + req.getRequestURI()); sendErrorResponse(resp, HttpServletResponse.SC_NOT_FOUND, "Unsupported projects API " + "endpoint"); return; } }
Source:
<code>protected RemoteOperationResult doInBackground(Object... params) { RemoteOperationResult result; if (params != null && params.length == 2) { String url = (String) params[0]; OwnCloudCredentials credentials = (OwnCloudCredentials) params[1]; Uri uri = Uri.parse(url); OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true); client.setCredentials(credentials); String REMOTE_PATH = "/"; <START> boolean SUCCESS_IF_ABSENT = false; <END> ExistenceCheckRemoteOperation existenceCheckRemoteOperation = new ExistenceCheckRemoteOperation( REMOTE_PATH, SUCCESS_IF_ABSENT, true ); result = existenceCheckRemoteOperation.execute(client); String targetUrlAfterPermanentRedirection = null; if (existenceCheckRemoteOperation.wasRedirected()) { RedirectionPath redirectionPath = existenceCheckRemoteOperation.getRedirectionPath(); targetUrlAfterPermanentRedirection = redirectionPath.getLastPermanentLocation(); } if (result.isSuccess()) { GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation(); if (targetUrlAfterPermanentRedirection != null) { client = OwnCloudClientFactory.createOwnCloudClient( Uri.parse(AccountUtils.trimWebdavSuffix( targetUrlAfterPermanentRedirection )), mContext, true ); client.setCredentials(credentials); } result = remoteUserNameOperation.execute(client); } result.setLastPermanentLocation(targetUrlAfterPermanentRedirection); } else { result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR); } return result; }</code><technical_language>need capital letters for this variables now, do we</technical_language>

Target:
protected RemoteOperationResult doInBackground(Object... params) { RemoteOperationResult result; if (params != null && params.length == 2) { String url = (String) params[0]; OwnCloudCredentials credentials = (OwnCloudCredentials) params[1]; Uri uri = Uri.parse(url); OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true); client.setCredentials(credentials); String remotePath = OCFile.ROOT_PATH; boolean successIfAbsent = false; ExistenceCheckRemoteOperation existenceCheckRemoteOperation = new ExistenceCheckRemoteOperation( remotePath, successIfAbsent, true ); result = existenceCheckRemoteOperation.execute(client); String targetUrlAfterPermanentRedirection = null; if (existenceCheckRemoteOperation.wasRedirected()) { RedirectionPath redirectionPath = existenceCheckRemoteOperation.getRedirectionPath(); targetUrlAfterPermanentRedirection = redirectionPath.getLastPermanentLocation(); } if (result.isSuccess()) { GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation(); if (targetUrlAfterPermanentRedirection != null) { client = OwnCloudClientFactory.createOwnCloudClient( Uri.parse(AccountUtils.trimWebdavSuffix( targetUrlAfterPermanentRedirection )), mContext, true ); client.setCredentials(credentials); } result = remoteUserNameOperation.execute(client); } result.setLastPermanentLocation(targetUrlAfterPermanentRedirection); } else { result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR); } return result; }
Source:
<code>private void updateToDeleteCompleted(Stack stack, String terminatedName, String statusReason) { try { transactionService.required(() -> { stack.setName(terminatedName); stack.setTerminated(clock.getCurrentTimeMillis()); stackService.save(stack); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.DELETE_COMPLETED, statusReason); if (stack.getType().equals(StackType.WORKLOAD)) { <START> grpcUmsClient.notifyResourceDeleted(stack.getResourceCrn(), MDCUtils.getRequestId()); <END> } }); } catch (TransactionService.TransactionExecutionException e) { throw e.getCause(); } }</code><technical_language>want include external call in transaction</technical_language>

Target:
private void updateToDeleteCompleted(Stack stack, String terminatedName, String statusReason) { try { transactionService.required(() -> { stack.setName(terminatedName); stack.setTerminated(clock.getCurrentTimeMillis()); stackService.save(stack); stackUpdater.updateStackStatus(stack.getId(), DetailedStackStatus.DELETE_COMPLETED, statusReason); }); if (stack.getType().equals(StackType.WORKLOAD)) { grpcUmsClient.notifyResourceDeleted(stack.getResourceCrn(), MDCUtils.getRequestId()); } } catch (TransactionService.TransactionExecutionException e) { throw e.getCause(); } }
Source:
<code>public void testNotAuthorizedException() throws Exception { NotAuthorizedException originalException = new NotAuthorizedException(message, Response.status(Status.UNAUTHORIZED).build()); RemoteException exception = (RemoteException) encodeAndDecode(originalException); assertThat(exception.getCause()).isNull(); assertThat(exception.getStatus()).isEqualTo(Status.UNAUTHORIZED.getStatusCode()); assertThat(exception.getError().errorCode()).isEqualTo(NotAuthorizedException.class.getName()); <START> assertThat(exception.getError().errorName()).isEqualTo("hello"); <END> assertThat(exception.getMessage()) .isEqualTo("RemoteException: javax.ws.rs.NotAuthorizedException (" + message + ")"); }</code><technical_language>isEqualTo(message) is a bit clearer</technical_language>

Target:
public void testNotAuthorizedException() throws Exception { NotAuthorizedException originalException = new NotAuthorizedException(message, Response.status(Status.UNAUTHORIZED).build()); RemoteException exception = (RemoteException) encodeAndDecode(originalException); assertThat(exception.getCause()).isNull(); assertThat(exception.getStatus()).isEqualTo(Status.UNAUTHORIZED.getStatusCode()); assertThat(exception.getError().errorCode()).isEqualTo(NotAuthorizedException.class.getName()); assertThat(exception.getError().errorName()).isEqualTo(message); assertThat(exception.getMessage()) .isEqualTo("RemoteException: javax.ws.rs.NotAuthorizedException (" + message + ")"); }
Source:
<code>public synchronized void initInternal(Configuration conf) throws Exception { super.initInternal(conf); Path rootPath = new Path(fsWorkingPath, ROOT_NAME); myriadPathRoot = new Path(rootPath, RM_MYRIAD_ROOT); updateFileMethod = getUpdateFileMethod(); if (updateFileMethod == null) { throw new RuntimeException("Could not find valid updateFile Method"); } <START> startInternal(); <END> }</code><technical_language>this added</technical_language>

Target:
public synchronized void initInternal(Configuration conf) throws Exception { super.initInternal(conf); Path rootPath = new Path(fsWorkingPath, ROOT_NAME); myriadPathRoot = new Path(rootPath, RM_MYRIAD_ROOT); updateFileMethod = getUpdateFileMethod(); if (updateFileMethod == null) { throw new RuntimeException("Could not find valid updateFile Method"); } }
Source:
<code><START> public Attribute<?> getDestAttribute() throws OseeCoreException { <END> Attribute<?> destAttribute = null; Collection<Attribute<Object>> localAttributes = getDestArtifact().getAttributes(getAttributeType()); for (Attribute<Object> localAttribute : localAttributes) { if (localAttribute.getId() == attrId) { destAttribute = localAttribute; } } if (destAttribute == null) { throw new AttributeDoesNotExist("Attribute %d could not be found on artifact %d on branch %s", attrId, getArtId(), destBranch.getUuid()); } return destAttribute; }</code><technical_language>artifact.getAttributeById(attrUuid, includeDeleted)</technical_language>

Target:
public Attribute<?> getDestAttribute() throws OseeCoreException { Attribute<?> destAttribute = getDestArtifact().getAttributeById(attrId, false); if (destAttribute == null) { throw new AttributeDoesNotExist("Attribute %d could not be found on artifact %d on branch %s", attrId, getArtId(), destBranch.getUuid()); } return destAttribute; }
Source:
<code>public final void setWorkDirectory(GeneralCommandLine commandLine) { String workDirectory = getWorkDirectory(); <START> commandLine.withWorkDirectory(workDirectory == null || workDirectory.isEmpty() ? myModule.getProject().getBasePath() : workDirectory); <END> }</code><technical_language>Please, com.intellij.openapi.util.text.StringUtil.isEmpty check if a string is null empty</technical_language>

Target:
public final void setWorkDirectory(GeneralCommandLine commandLine) { String workDirectory = getWorkDirectory(); commandLine.withWorkDirectory(StringUtil.isEmpty(workDirectory) ? myModule.getProject().getBasePath() : workDirectory); }
Source:
<code>public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { throw new CatalogTransformerException("Cannot transform null metacard."); } String preview = "No preview text available."; if (metacard.getAttribute(Extracted.EXTRACTED_TEXT) != null && metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue() != null) { preview = metacard .getAttribute(Extracted.EXTRACTED_TEXT) .getValue() .toString() <START> .replaceAll("<", "&lt;") <END> .replaceAll(">", "&gt;") .replaceAll("[\n|\r]", "<br>"); preview = String.format("<head><meta charset=\"utf-8\"/>%s</head>", preview); } return new BinaryContentImpl(IOUtils.toInputStream(preview)); }</code><technical_language>Do a standard library/method sanitize strings this</technical_language>

Target:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { throw new CatalogTransformerException("Cannot transform null metacard."); } String preview = "No preview text available."; if (metacard.getAttribute(Extracted.EXTRACTED_TEXT) != null && metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue() != null) { preview = StringEscapeUtils.escapeHtml4( metacard.getAttribute(Extracted.EXTRACTED_TEXT).getValue().toString()) .replaceAll("[\n|\r]", "<br>"); preview = String.format("<head><meta charset=\"utf-8\"/>%s</head>", preview); } return new BinaryContentImpl(IOUtils.toInputStream(preview)); }
Source:
<code>public Map<String, String> getFieldMapInfoData() { final Map<String, String> result = new HashMap<>(); final List<FieldMapInfo> fieldMapInfoList = this.userFieldmap.getFieldMapInfo(); String size = "0"; String datasetId = null; String environmentId = null; final String fieldMapInfoJson; <START> Map<String, Boolean> validateFieldMap = new HashMap<>(); <END> for (final FieldMapInfo fieldMapInfo : fieldMapInfoList) { final List<FieldMapDatasetInfo> datasetList = fieldMapInfo.getDatasetsWithFieldMap(); this.validateFieldMapDataSetInfo(datasetList, validateFieldMap); if (datasetList != null && !datasetList.isEmpty()) { final List<FieldMapTrialInstanceInfo> trials = datasetList.get(0).getTrialInstancesWithFieldMap(); if (trials != null && !trials.isEmpty()) { size = String.valueOf(trials.size()); if (trials.size() == 1) { datasetId = datasetList.get(0).getDatasetId().toString(); environmentId = trials.get(0).getInstanceId().toString(); } } } } fieldMapInfoJson = this.convertFieldMapInfoToJson(fieldMapInfoList); result.put("fieldMapInfo", fieldMapInfoJson); result.put("size", size); result.put("hasInvalidValues", String.valueOf(validateFieldMap.get("hasInvalidValues"))); if (datasetId != null) { result.put("datasetId", datasetId); } if (environmentId != null) { result.put("environmentId", environmentId); } return result; }</code><technical_language>discussed, need a map a simple boolean flag</technical_language>

Target:
public Map<String, String> getFieldMapInfoData() { final Map<String, String> result = new HashMap<>(); final List<FieldMapInfo> fieldMapInfoList = this.userFieldmap.getFieldMapInfo(); String size = "0"; String datasetId = null; String environmentId = null; final String fieldMapInfoJson; boolean hasInvalidValues = false; for (final FieldMapInfo fieldMapInfo : fieldMapInfoList) { final List<FieldMapDatasetInfo> datasetList = fieldMapInfo.getDatasetsWithFieldMap(); if (!hasInvalidValues) { hasInvalidValues = this.validateFieldMapDataSetInfo(datasetList); } if (datasetList != null && !datasetList.isEmpty()) { final List<FieldMapTrialInstanceInfo> trials = datasetList.get(0).getTrialInstancesWithFieldMap(); if (trials != null && !trials.isEmpty()) { size = String.valueOf(trials.size()); if (trials.size() == 1) { datasetId = datasetList.get(0).getDatasetId().toString(); environmentId = trials.get(0).getInstanceId().toString(); } } } } fieldMapInfoJson = this.convertFieldMapInfoToJson(fieldMapInfoList); result.put("fieldMapInfo", fieldMapInfoJson); result.put("size", size); result.put("hasInvalidValues", String.valueOf(hasInvalidValues)); if (datasetId != null) { result.put("datasetId", datasetId); } if (environmentId != null) { result.put("environmentId", environmentId); } return result; }
Source:
<code>public void retrieve_collection_fields_if_required() { <START> requestSampleCustomer(new int[] {Customer.NICKNAMES_FIELD_NUMBER - 1}, new StreamObserver<QueryResponse>() { <END> @Override public void onNext(QueryResponse value) { final List<Any> messages = value.getMessagesList(); assertFalse(messages.isEmpty()); final Customer sampleCustomer = getSampleCustomer(); final Customer customer = AnyPacker.unpack(messages.get(0)); assertEquals(customer.getNicknamesList(), sampleCustomer.getNicknamesList()); assertFalse(customer.hasName()); assertFalse(customer.hasId()); } @Override public void onError(Throwable t) { } @Override public void onCompleted() { } }); }</code><technical_language>Please check, StreamObserver methods invoked all. Right is observer is invoked for some reason, test _should_ fail, not</technical_language>

Target:
public void retrieve_collection_fields_if_required() { requestSampleCustomer(new int[] {Customer.NICKNAMES_FIELD_NUMBER - 1}, new MemoizeQueryResponseObserver() { @Override public void onNext(QueryResponse value) { super.onNext(value); final List<Any> messages = value.getMessagesList(); assertFalse(messages.isEmpty()); final Customer sampleCustomer = getSampleCustomer(); final Customer customer = AnyPacker.unpack(messages.get(0)); assertEquals(customer.getNicknamesList(), sampleCustomer.getNicknamesList()); assertFalse(customer.hasName()); assertFalse(customer.hasId()); } }); }
Source:
<code>public int getLevelSize(final int levelNumber) { if (levelNumber >= getNumIndexLevels()) { <START> throw new SAMException("Level number is too big (" + levelNumber + ")."); <END> } if (levelNumber == getNumIndexLevels()-1) { return GenomicIndexUtil.MAX_BINS - GenomicIndexUtil.LEVEL_STARTS[levelNumber] - 1; } else { return GenomicIndexUtil.LEVEL_STARTS[levelNumber + 1] - GenomicIndexUtil.LEVEL_STARTS[levelNumber]; } }</code><technical_language>this is duplicated worth extracting a method assertLevelIsValid method</technical_language>

Target:
public int getLevelSize(final int levelNumber) { assertLevelIsValid(levelNumber); if (levelNumber == getNumIndexLevels()-1) { return GenomicIndexUtil.MAX_BINS - GenomicIndexUtil.LEVEL_STARTS[levelNumber] - 1; } else { return GenomicIndexUtil.LEVEL_STARTS[levelNumber + 1] - GenomicIndexUtil.LEVEL_STARTS[levelNumber]; } }
Source:
<code>public NamedTimeEvent(ITimeGraphEntry entry, long time, long duration, int value, @NonNull String label) { super(entry, time, duration, value); <START> fLabel = label; <END> }</code><technical_language>wish intern this</technical_language>

Target:
public NamedTimeEvent(ITimeGraphEntry entry, long time, long duration, int value, @NonNull String label) { super(entry, time, duration, value); fLabel = label.intern(); }
Source:
<code>public static String getThemePageLibClass(Theme theme) { switch (theme.getFunnelName()) { <START> case "light": <END> return "pagelib_theme_light"; case "dark": return "pagelib_theme_dark"; case "black": return "pagelib_theme_black"; case "sepia": return "pagelib_theme_sepia"; default: return "pagelib_theme_light"; } }</code><technical_language>is remove case "light" is a default case</technical_language>

Target:
public static String getThemePageLibClass(Theme theme) { switch (theme.getFunnelName()) { case "dark": return "pagelib_theme_dark"; case "black": return "pagelib_theme_black"; case "sepia": return "pagelib_theme_sepia"; default: return "pagelib_theme_light"; } }
Source:
<code>public String formatPdpPayeeName(String lastName, String firstName, String middleInitial) { String fullName = lastName + KFSConstants.COMMA + KFSConstants.BLANK_SPACE + firstName; if (StringUtils.isNotBlank(middleInitial)) { fullName = fullName + KFSConstants.BLANK_SPACE + middleInitial + KFSConstants.DELIMITER; } <START> int payeeNameFieldSize = (getDataDictionaryService().getAttributeMaxLength(PaymentGroup.class, PdpConstants.PaymentDetail.PAYEE_NAME)).intValue(); <END> if (fullName.length() > payeeNameFieldSize) { fullName = StringUtils.substring(fullName, 0, payeeNameFieldSize); fullName = removeLastPayeeNameCharacterWhenComma(fullName, payeeNameFieldSize); } return fullName; }</code><technical_language>sense Integer for this variable int in if statement. line reads extra parenthesis</technical_language>

Target:
public String formatPdpPayeeName(String lastName, String firstName, String middleInitial) { String fullName = lastName + KFSConstants.COMMA + KFSConstants.BLANK_SPACE + firstName; if (StringUtils.isNotBlank(middleInitial)) { fullName = fullName + KFSConstants.BLANK_SPACE + middleInitial + KFSConstants.DELIMITER; } Integer payeeNameFieldSize = getDataDictionaryService().getAttributeMaxLength(PaymentGroup.class, PdpConstants.PaymentDetail.PAYEE_NAME); if (fullName.length() > payeeNameFieldSize.intValue()) { fullName = StringUtils.substring(fullName, 0, payeeNameFieldSize); fullName = removeLastPayeeNameCharacterWhenComma(fullName, payeeNameFieldSize); } return fullName; }
Source:
<code>public void engineInitialize() { createInternalAAAConfigurations(); createKerberosLdapAAAConfigurations(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn("The directory '{}' cotaning configuration files does not exist.", directory.getAbsolutePath()); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { try { load(file); } catch (Exception ex) { <START> log.error("Could not load extension based on configuration file '{}'. Please check the configuration file is valid.", file.getAbsolutePath()); <END> } } } } } } for (ExtensionProxy extension : getLoadedExtensions()) { if ( EngineLocalConfig.getInstance().getBoolean( ( ENGINE_EXTENSION_ENABLED + extension.getContext() .<String> get(Base.ContextKeys.INSTANCE_NAME) ), Boolean.parseBoolean( extension.getContext().<Properties> get( Base.ContextKeys.CONFIGURATION ).getProperty(Base.ConfigKeys.ENABLED, "true") ) ) ) { initialize(extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME)); } } dump(); }</code><technical_language>please display ex.getMessage(), please dump debug stack trace</technical_language>

Target:
public void engineInitialize() { createInternalAAAConfigurations(); createKerberosLdapAAAConfigurations(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn("The directory '{}' cotaning configuration files does not exist.", directory.getAbsolutePath()); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { try { load(file); } catch (Exception ex) { log.error("Could not load extension based on configuration file '{}'. Please check the configuration file is valid. Exception message is: {}", file.getAbsolutePath(), ex.getMessage()); log.debug("", ex); } } } } } } for (ExtensionProxy extension : getLoadedExtensions()) { if ( EngineLocalConfig.getInstance().getBoolean( ( ENGINE_EXTENSION_ENABLED + extension.getContext() .<String> get(Base.ContextKeys.INSTANCE_NAME) ), Boolean.parseBoolean( extension.getContext().<Properties> get( Base.ContextKeys.CONFIGURATION ).getProperty(Base.ConfigKeys.ENABLED, "true") ) ) ) { initialize(extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME)); } } dump(); }
Source:
<code>public void handle(HttpExchange arg0) throws IOException { String path = arg0.getRequestURI().getPath(); LOG.debug("'{}'", path); StaticResource resource; try { resource = provider.getResource(path).get(); <START> if (resource.isValid()) { <END> writeResponse(arg0, 200, resource.getData(), resource.getMimeType()); return; } else { LOG.debug("'{}' Not Found", path); writeResponse(arg0, 404, "not found".getBytes(), null); } } catch (Exception e) { LOG.debug("'{}' Not Found", path); writeResponse(arg0, 404, "not found".getBytes(), null); } }</code><technical_language>Optional more check case respected</technical_language>

Target:
public void handle(HttpExchange arg0) throws IOException { String path = arg0.getRequestURI().getPath(); LOG.debug("'{}'", path); Optional<StaticResource> resource; try { resource = provider.getResource(path).get(); if (resource.isPresent()) { writeResponse(arg0, 200, resource.get().getData(), resource.get().getMimeType()); return; } else { LOG.debug("'{}' Not Found", path); writeResponse(arg0, 404, "not found".getBytes(), null); } } catch (Exception e) { LOG.debug("'{}' Not Found", path); writeResponse(arg0, 404, "not found".getBytes(), null); } }
Source:
<code>protected static ImmutableList<Ds3Request> splitGetPhysicalPlacementForObjects( final Ds3Request ds3Request) { if (!stripPath(ds3Request.getName()).equals(GET_PHYSICAL_PLACEMENT_FOR_OBJECTS)) { throw new IllegalArgumentException("The Ds3Request is not the expected " + GET_PHYSICAL_PLACEMENT_FOR_OBJECTS + ": " + ds3Request.getName()); } final ImmutableList.Builder<Ds3Request> builder = ImmutableList.builder(); builder.add(removeOptionalParam( ds3Request, "FullDetails", 200, <START> "PhysicalPlacementApiBean", <END> null)); builder.add(makeRequiredParam( ds3Request, NAMESPACE_FULL_DETAILS, "FullDetails", 200, "BlobApiBeansContainer", null)); return builder.build(); }</code><technical_language>This a constant is in other places</technical_language>

Target:
protected static ImmutableList<Ds3Request> splitGetPhysicalPlacementForObjects( final Ds3Request ds3Request) throws ResponseTypeNotFoundException { if (!stripPath(ds3Request.getName()).equals(GET_PHYSICAL_PLACEMENT_FOR_OBJECTS)) { throw new IllegalArgumentException("The Ds3Request is not the expected " + GET_PHYSICAL_PLACEMENT_FOR_OBJECTS + ": " + ds3Request.getName()); } final ImmutableList.Builder<Ds3Request> builder = ImmutableList.builder(); builder.add(removeOptionalParam( ds3Request, FULL_DETAILS_PARAM, 200, PHYSICAL_PLACEMENT_API_BEAN_PARAM)); builder.add(makeRequiredParam( ds3Request, NAMESPACE_FULL_DETAILS, FULL_DETAILS_PARAM, 200, BLOB_API_BEANS_CONTAINER_PARAM)); return builder.build(); }