auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void syncFromImpl(OpenshiftRequestContext context, RolesBuilder builder) { String kibIndexName = formatKibanaIndexName(context, kibanaIndexMode); String kibRoleName = formatKibanaRoleName(context); RoleBuilder kibRole = new RoleBuilder(kibRoleName) .setClusterActions(KIBANA_ROLE_CLUSTER_ACTIONS) .setActions(kibIndexName, ALL, KIBANA_ROLE_INDEX_ACTIONS) .setActions(ALL, ALL, KIBANA_ROLE_ALL_INDEX_ACTIONS) .expires(expire); builder.addRole(kibRole.build()); if (context.isOperationsUser()) { RoleBuilder opsRole = new RoleBuilder(SearchGuardRolesMapping.ADMIN_ROLE) .setClusters(OPERATIONS_ROLE_CLUSTER_ACTIONS) <START> .setActions("?operations?", ALL, OPERATIONS_ROLE_OPERATIONS_ACTIONS) <END> .setActions(ALL, ALL, OPERATIONS_ROLE_ANY_ACTIONS) .expires(expire); builder.addRole(opsRole.build()); return; } String roleName = formatUserRoleName(context.getUser()); RoleBuilder role = new RoleBuilder(roleName) .setClusters(USER_ROLE_CLUSTER_ACTIONS) .expires(expire); for (String project : context.getProjects()) { String indexName = String.format("%s?*", project.replace('.', '?')); role.setActions(indexName, ALL, PROJECT_ROLE_ACTIONS); if (StringUtils.isNotEmpty(cdmProjectPrefix)) { indexName = String.format("%s?%s?*", cdmProjectPrefix.replace('.', '?'), project.replace('.', '?')); role.setActions(indexName, ALL, PROJECT_ROLE_ACTIONS); } } builder.addRole(role.build()); }</code><technical_language>is this action required if ALL</technical_language>

Target:
protected void syncFromImpl(OpenshiftRequestContext context, RolesBuilder builder) { String kibIndexName = formatKibanaIndexName(context, kibanaIndexMode); String kibRoleName = formatKibanaRoleName(context); RoleBuilder kibRole = new RoleBuilder(kibRoleName) .setClusterActions(KIBANA_ROLE_CLUSTER_ACTIONS) .setActions(kibIndexName, ALL, KIBANA_ROLE_INDEX_ACTIONS) .expires(expire); builder.addRole(kibRole.build()); if (context.isOperationsUser()) { RoleBuilder opsRole = new RoleBuilder(SearchGuardRolesMapping.ADMIN_ROLE) .setClusters(OPERATIONS_ROLE_CLUSTER_ACTIONS) .setActions(ALL, ALL, OPERATIONS_ROLE_ANY_ACTIONS) .expires(expire); builder.addRole(opsRole.build()); return; } String roleName = formatUserRoleName(context.getUser()); RoleBuilder role = new RoleBuilder(roleName) .setClusters(USER_ROLE_CLUSTER_ACTIONS) .expires(expire); for (String project : context.getProjects()) { String indexName = String.format("%s?*", project.replace('.', '?')); role.setActions(indexName, ALL, PROJECT_ROLE_ACTIONS); if (StringUtils.isNotEmpty(cdmProjectPrefix)) { indexName = String.format("%s?%s?*", cdmProjectPrefix.replace('.', '?'), project.replace('.', '?')); role.setActions(indexName, ALL, PROJECT_ROLE_ACTIONS); } } builder.addRole(role.build()); }
Source:
<code>public AetherModuleResolver(File localRepository, Map<String, String> remoteRepositories) { if (log.isDebugEnabled()) { log.debug("Local repository: " + localRepository); <START> log.debug("Remote repository: " + remoteRepositories); <END> } if (!localRepository.exists()) { Assert.isTrue(localRepository.mkdirs(), "Unable to create directory for local repository: " + localRepository); } this.localRepository = localRepository; this.remoteRepositories = new LinkedList<>(); if (!CollectionUtils.isEmpty(remoteRepositories)) { for (Map.Entry<String, String> remoteRepo : remoteRepositories.entrySet()) { RemoteRepository remoteRepository = new RemoteRepository.Builder(remoteRepo.getKey(), DEFAULT_CONTENT_TYPE, remoteRepo.getValue()).build(); this.remoteRepositories.add(remoteRepository); } } repositorySystem = newRepositorySystem(); }</code><technical_language>technically this "Remote repositories: "</technical_language>

Target:
public AetherModuleResolver(File localRepository, Map<String, String> remoteRepositories) { Assert.notNull(localRepository, "Local repository path cannot be null"); if (log.isDebugEnabled()) { log.debug("Local repository: " + localRepository); if (!CollectionUtils.isEmpty(remoteRepositories)) { log.debug("Remote repositories: " + StringUtils.collectionToCommaDelimitedString(remoteRepositories.values())); } } if (!localRepository.exists()) { Assert.isTrue(localRepository.mkdirs(), "Unable to create directory for local repository: " + localRepository); } this.localRepository = localRepository; this.remoteRepositories = new LinkedList<>(); if (!CollectionUtils.isEmpty(remoteRepositories)) { for (Map.Entry<String, String> remoteRepo : remoteRepositories.entrySet()) { RemoteRepository remoteRepository = new RemoteRepository.Builder(remoteRepo.getKey(), DEFAULT_CONTENT_TYPE, remoteRepo.getValue()).build(); this.remoteRepositories.add(remoteRepository); } } repositorySystem = newRepositorySystem(); }
Source:
<code>public Path generateArtifact(PypiWheelArtifactCoordinates coordinates) throws IOException { <START> String packagePath = String.format("%s-%s-py2-none-any.whl", <END> coordinates.getId(), coordinates.getVersion()); Path fullPath = basedir.resolve(packagePath); ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(fullPath.toString())); createPackageFiles(zos, coordinates.getId(), coordinates.getVersion()); zos.close(); return fullPath; }</code><technical_language>@Firstmol please explain means none-any in packagePath? Sorry, I familiar Python, want coordinates for it</technical_language>

Target:
public Path generateArtifact(PypiWheelArtifactCoordinates coordinates) throws IOException { String packagePath = coordinates.toPath(); Path fullPath = basedir.resolve(packagePath); try(ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(fullPath))) { createPackageFiles(zos, coordinates.getId(), coordinates.getVersion()); } return fullPath; }
Source:
<code>public int[][] getDrops(Item item) { <START> if (this.meta >= 0x03) { <END> return new int[][]{ {Item.NETHER_WART, 0, 2+(int)(Math.random()*((4-2)+1))} }; } else { return new int[][]{ {Item.NETHER_WART, 0, 1} }; } }</code><technical_language>Change this == merge it</technical_language>

Target:
public int[][] getDrops(Item item) { if (this.meta == 0x03) { return new int[][]{ {Item.NETHER_WART, 0, 2+(int)(Math.random()*((4-2)+1))} }; } else { return new int[][]{ {Item.NETHER_WART, 0, 1} }; } }
Source:
<code>public void flushVariants(IResource resource, int depth) throws TeamException { <START> if (!gsdData.getData(resource.getProject()).shouldIncludeLocal()) { <END> store.flushBytes(resource, depth); } }</code><technical_language>style nit: braces single line</technical_language>

Target:
public void flushVariants(IResource resource, int depth) throws TeamException { if (!gsdData.getData(resource.getProject()).shouldIncludeLocal()) store.flushBytes(resource, depth); }
Source:
<code>private String extractEtagFromResults( final byte[] cachedResult ) { if (cachedResult == null) { return null; } <START> log.info("Fetching result level cache identifier for query: %s", query.getId()); <END> int etagLength = ByteBuffer.wrap(cachedResult, 0, Integer.BYTES).getInt(); return StringUtils.fromUtf8(Arrays.copyOfRange(cachedResult, Integer.BYTES, etagLength + Integer.BYTES)); }</code><technical_language>this lead noisy logs, this debug</technical_language>

Target:
private String extractEtagFromResults( final byte[] cachedResult ) { if (cachedResult == null) { return null; } log.debug("Fetching result level cache identifier for query: %s", query.getId()); int etagLength = ByteBuffer.wrap(cachedResult, 0, Integer.BYTES).getInt(); return StringUtils.fromUtf8(Arrays.copyOfRange(cachedResult, Integer.BYTES, etagLength + Integer.BYTES)); }
Source:
<code>public void fireAllEvents() { <START> if (eventThreadLocal != null) { <END> while (!eventThreadLocal.get().isEmpty()) { CacheEventWrapper cacheEventWrapper = eventThreadLocal.get().get(0); dispatchEvent(cacheEventWrapper); eventThreadLocal.get().remove(0); } } }</code><technical_language>needed new of interacting eventThreadLocal</technical_language>

Target:
public void fireAllEvents() { EventThreadLocal currentThreadLocal = eventThreadLocal; while (!currentThreadLocal.get().isEmpty()) { CacheEventWrapper cacheEventWrapper = currentThreadLocal.get().get(0); dispatchEvent(cacheEventWrapper, currentThreadLocal); currentThreadLocal.get().remove(0); } }
Source:
<code>public void testRejectUnknownType() { ThriftSessionProperties sessionProperties = new ThriftSessionProperties(() -> ImmutableMap.of( "test_session_prop", <START> new PropertyMetadata<>("unsupported_typed_prop", "custom types are not supported", VARCHAR, TestingClass.class, <END> null, false, value -> new TestingClass((String) value), object -> object == null ? null : object.getValue()))); }</code><technical_language>This is hard read. Extract a variable for PropertyMetadata put arg for a separate line</technical_language>

Target:
public void testRejectUnknownType() { ThriftSessionProperties sessionProperties = new ThriftSessionProperties(() -> ImmutableMap.of( "test_session_prop", new PropertyMetadata<>( "unsupported_typed_prop", "complex types are not supported", BIGINT, AtomicLong.class, null, false, value -> new AtomicLong(((Number) value).intValue()), object -> object == null ? null : object.toString()))); }
Source:
<code>private HttpServerFake startHttpServerFake(String statusLine) throws Exception { int port = new Random().nextInt(9 * 1024) + 1024; <START> HttpServerFake serverFake; <END> if (statusLine == null) { serverFake = new HttpServerFake(port); } else { serverFake = new HttpServerFake(port, null, statusLine); } serverFake.start(); return serverFake; }</code><technical_language>please dont remove explicit initialization</technical_language>

Target:
private HttpServerFake startHttpServerFake(String statusLine) throws Exception { int port = new Random().nextInt(9 * 1024) + 1024; HttpServerFake serverFake = null; if (statusLine == null) { serverFake = new HttpServerFake(port); } else { serverFake = new HttpServerFake(port, null, statusLine); } serverFake.start(); return serverFake; }
Source:
<code>public Set<WorkflowVersion> requestDOIForWorkflowVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Workflow to modify.", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkUser(user, workflow); WorkflowVersion workflowVersion = workflowVersionDAO.findById(workflowVersionId); if (workflowVersion == null) { LOG.error(user.getUsername() + ": could not find version: " + workflow.getPath()); <START> throw new CustomWebApplicationException("Version not found.", HttpStatus.SC_INTERNAL_SERVER_ERROR); <END> } List<Token> tokens = checkOnZenodoToken(user); Token zenodoToken = Token.extractToken(tokens, TokenType.ZENODO_ORG); if (zenodoToken == null) { LOG.error("Could not get Zenodo token for user " + user.getUsername()); throw new CustomWebApplicationException("Could not get Zenodo token for user " + user.getUsername(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } final String zenodoAccessToken = zenodoToken.getContent(); registerZenodoDOIForWorkflow(zenodoAccessToken, workflow, workflowVersion); Workflow result = workflowDAO.findById(workflowId); checkEntry(result); elasticManager.handleIndexUpdate(result, ElasticMode.UPDATE); return result.getWorkflowVersions(); }</code><technical_language>I this is a bad request; means id of a non-existing version invoking this API</technical_language>

Target:
public Set<WorkflowVersion> requestDOIForWorkflowVersion(@ApiParam(hidden = true) @Auth User user, @ApiParam(value = "Workflow to modify.", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkUser(user, workflow); WorkflowVersion workflowVersion = workflowVersionDAO.findById(workflowVersionId); if (workflowVersion == null) { LOG.error(user.getUsername() + ": could not find version: " + workflow.getPath()); throw new CustomWebApplicationException("Version not found.", HttpStatus.SC_BAD_REQUEST); } List<Token> tokens = checkOnZenodoToken(user); Token zenodoToken = Token.extractToken(tokens, TokenType.ZENODO_ORG); if (zenodoToken == null) { LOG.error("Could not get Zenodo token for user " + user.getUsername()); throw new CustomWebApplicationException("Could not get Zenodo token for user " + user.getUsername(), HttpStatus.SC_BAD_REQUEST); } final String zenodoAccessToken = zenodoToken.getContent(); registerZenodoDOIForWorkflow(zenodoAccessToken, workflow, workflowVersion); Workflow result = workflowDAO.findById(workflowId); checkEntry(result); elasticManager.handleIndexUpdate(result, ElasticMode.UPDATE); return result.getWorkflowVersions(); }
Source:
<code>public static TDigest deserialize(Slice serialized) { <START> SliceInput input = new BasicSliceInput(serialized); <END> byte format = input.readByte(); checkArgument(format == FORMAT_TAG, "Invalid format"); double min = input.readDouble(); double max = input.readDouble(); double compression = input.readDouble(); double totalWeight = input.readDouble(); int centroidCount = input.readInt(); double[] means = new double[centroidCount]; for (int i = 0; i < centroidCount; i++) { means[i] = input.readDouble(); } double[] weights = new double[centroidCount]; for (int i = 0; i < centroidCount; i++) { weights[i] = input.readDouble(); } return new TDigest( compression, min, max, totalWeight, centroidCount, means, weights, false, false); }</code><technical_language>serialized.getInput()</technical_language>

Target:
public static TDigest deserialize(Slice serialized) { SliceInput input = serialized.getInput(); byte format = input.readByte(); checkArgument(format == FORMAT_TAG, "Invalid format"); double min = input.readDouble(); double max = input.readDouble(); double compression = input.readDouble(); double totalWeight = input.readDouble(); int centroidCount = input.readInt(); double[] means = new double[centroidCount]; for (int i = 0; i < centroidCount; i++) { means[i] = input.readDouble(); } double[] weights = new double[centroidCount]; for (int i = 0; i < centroidCount; i++) { weights[i] = input.readDouble(); } return new TDigest( compression, min, max, totalWeight, centroidCount, means, weights, false, false); }
Source:
<code>public void close() throws IOException { connected = false; <START> connection.disconnect(); <END> }</code><technical_language>is connection is null. Add if (connection != null) {</technical_language>

Target:
public void close() throws IOException { connected = false; if (connection != null) { connection.disconnect(); } }
Source:
<code>private void showPushToApplicationSettings() { PushToApplicationsManager manager = frame.getPushToApplicationsManager(); <START> PushToApplication selectedApplication = manager.getApplicationByName(pushToApplicationComboBox.getValue().getApplicationName()); <END> PushToApplicationSettings settings = manager.getSettings(selectedApplication); DialogPane dialogPane = new DialogPane(); dialogPane.setContent(settings.getJFXSettingPane(pushToApplicationComboBox.getValue().getApplicationName())); dialogService.showCustomDialogAndWait(Localization.lang("App settings"), dialogPane, ButtonType.OK, ButtonType.CANCEL).ifPresent(btn -> { if (btn == ButtonType.OK) { settings.storeSettings(); } }); }</code><technical_language>selectedApplication = pushToApplicationComboBox.getValue() suffice</technical_language>

Target:
private void showPushToApplicationSettings() { PushToApplicationsManager manager = frame.getPushToApplicationsManager(); PushToApplication selectedApplication = pushToApplicationComboBox.getValue(); PushToApplicationSettings settings = manager.getSettings(selectedApplication); DialogPane dialogPane = new DialogPane(); dialogPane.setContent(settings.getSettingsPane()); dialogService.showCustomDialogAndWait(Localization.lang("Application settings"), dialogPane, ButtonType.OK, ButtonType.CANCEL).ifPresent(btn -> { if (btn == ButtonType.OK) { settings.storeSettings(); } }); }
Source:
<code>public Object execute(Object context, API api) { String functionName = null; try { engineBindings.setJSFunctionProvider(new JsFunctionsImpl(api)); functionName = api.getRequestLookup().getRequest().isGet() ? FUNCTION_ON_GET : FUNCTION_ON_POST; if (functionName.equals(FUNCTION_ON_GET) && isOnGetFound) { return engine.invokeFunction(functionName, context); } else if (functionName.equals(FUNCTION_ON_POST) && isOnPostFound) { return engine.invokeFunction(functionName, context); } else { return null; } } catch (ScriptException e) { throw new UUFException( "An error occurred when executing the '" + functionName + "' function in JavaScript file '" + absolutePath + "' with context '" + context + "'.", e); <START> } catch (NoSuchMethodException e) { <END> throw new UUFException( "Cannot find the '" + functionName + "' function in the JavaScript file '" + absolutePath + "'.", e); } finally { engineBindings.removeJSFunctionProvider(); } }</code><technical_language>This happen check for existence of onGet, onPost functions, remove this catch-block</technical_language>

Target:
public Object execute(Object context, API api) { String functionName = null; try { engineBindings.setJSFunctionProvider(new JsFunctionsImpl(api)); if (api.getRequestLookup().getRequest().isGetRequest()) { functionName = FUNCTION_ON_GET; return hasOnGetFunction ? engine.invokeFunction(FUNCTION_ON_GET, context) : null; } else { functionName = FUNCTION_ON_POST; return hasOnPostFunction ? engine.invokeFunction(FUNCTION_ON_POST, context) : null; } } catch (ScriptException e) { throw new UUFException( "An error occurred when executing the '" + functionName + "' function in JavaScript file '" + absolutePath + "' with context '" + context + "'.", e); } catch (NoSuchMethodException e) { throw new UUFException( "Cannot find the '" + functionName + "' function in the JavaScript file '" + absolutePath + "'.", e); } finally { engineBindings.removeJSFunctionProvider(); } }
Source:
<code>public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { pointer = null; if (walker.isSubtree()) { return walker.isRecursive(); } ObjectId objectId = walker.getObjectId(0); ObjectLoader object = walker.getObjectReader().open(objectId); if (object.isLarge()) { return false; } ObjectStream stream = object.openStream(); <START> byte[] buffer = new byte[VERSION_LINES[0].length]; <END> int read = stream.read(buffer); if (!validVersionLine(read, buffer)) { return false; } int line = 2; buffer = object.getCachedBytes(); IntList lineMap = RawParseUtils.lineMap(buffer, 0, buffer.length); int lineMapSize = lineMap.size() - 1; Integer size = null; LongObjectId oid = null; for (; line < lineMapSize; line++) { int lineStart = lineMap.get(line); if (size == null) { int match = RawParseUtils.match(buffer, lineStart, SIZE); if (match > 0) { int len = lineMap.get(line + 1) - match - 1; byte[] value = new byte[len]; System.arraycopy(buffer, match, value, 0, len); size = new Integer( RawParseUtils.parseBase10(value, 0, null)); } } if (oid == null) { int match = RawParseUtils.match(buffer, lineStart, OID); if (match > 0) { int len = lineMap.get(line + 1) - match - 1; byte[] value = new byte[len]; System.arraycopy(buffer, match, value, 0, len); oid = LongObjectId.fromString(value, 0); } } if (size != null && oid != null) { pointer = new LfsPointer(oid, size.intValue()); return true; } } return false; }</code><technical_language>Parsing LFS pointer file is implemented in LfsPointer.parseLfsPointer(InputStream)</technical_language>

Target:
public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { pointer = null; if (walker.isSubtree()) { return walker.isRecursive(); } ObjectId objectId = walker.getObjectId(0); ObjectLoader object = walker.getObjectReader().open(objectId); if (object.getSize() > 1024) { return false; } pointer = LfsPointer.parseLfsPointer(object.openStream()); return pointer != null; }
Source:
<code>public void addChangeMarker(int lineStart, int lineEnd, EditedRegionType type) { DivElement element = null; switch (type) { case INSERTION: { element = Elements.createDivElement(resources.changeMarkersCSS().markerInsertion()); break; } case MODIFICATION: { element = Elements.createDivElement(resources.changeMarkersCSS().markerModification()); break; } case DELETION: { element = Elements.createDivElement(resources.changeMarkersCSS().markerDeletion()); break; } <START> } <END> hasGutter.addGutterItem(lineStart, lineEnd, VCS_CHANGE_MARKERS_GUTTER, element); }</code><technical_language>add default switch</technical_language>

Target:
public void addChangeMarker(int lineStart, int lineEnd, EditedRegionType type) { DivElement element; GitResources.Css css = resources.changeMarkersCSS(); switch (type) { case INSERTION: { element = Elements.createDivElement(css.marker(), css.insertion()); break; } case MODIFICATION: { element = Elements.createDivElement(css.marker(), css.modification()); break; } case DELETION: { element = Elements.createDivElement(css.marker(), css.deletion()); break; } default: { return; } } hasGutter.addGutterItem(lineStart, lineEnd, VCS_CHANGE_MARKERS_GUTTER, element); }
Source:
<code>public void getPreviousPageNumber_returnsThePreviousPageNumber() { assertThat(new NewPagination(Optional.of(11), Optional.of(100), 100).getPreviousPageNumber(), equalTo(1)); <START> assertThat(new NewPagination(Optional.of(11), Optional.of(100), 100).getPreviousPageNumber(), equalTo(1)); <END> assertThat(new NewPagination(Optional.of(102), Optional.of(100), 120).getPreviousPageNumber(), equalTo(2)); }</code><technical_language>This test appears duplicated</technical_language>

Target:
public void getPreviousPageNumber_returnsThePreviousPageNumber() { assertThat(new NewPagination(Optional.of(11), Optional.of(100), 100).getPreviousPageNumber(), equalTo(1)); assertThat(new NewPagination(Optional.of(102), Optional.of(100), 120).getPreviousPageNumber(), equalTo(2)); }
Source:
<code>protected static int determineMaxResponseContentLength(Message message) { Integer maxResponseContentLength = null; if (message.get(MAX_RESPONSE_CONTENT_LENGTH) != null) { Object obj = message.get(MAX_RESPONSE_CONTENT_LENGTH); try { maxResponseContentLength = Integer.parseInt(obj.toString()); } catch (NumberFormatException e) { LOG.log(Level.WARNING, "INVALID_TIMEOUT_FORMAT", new Object[] { MAX_RESPONSE_CONTENT_LENGTH, obj.toString() }); } } <START> if (maxResponseContentLength == null) { maxResponseContentLength = SystemPropertyAction.getInteger(MAX_RESPONSE_CONTENT_LENGTH, <END> DEFAULT_MAX_RESPONSE_CONTENT_LENGTH); } return maxResponseContentLength; }</code><technical_language>I system property is necessary, determineConnection/ReceiveTimeout check it, message</technical_language>

Target:
protected static int determineMaxResponseContentLength(Message message) { Integer maxResponseContentLength = null; if (message.get(MAX_RESPONSE_CONTENT_LENGTH) != null) { Object obj = message.get(MAX_RESPONSE_CONTENT_LENGTH); try { maxResponseContentLength = Integer.parseInt(obj.toString()); } catch (NumberFormatException e) { LOG.log(Level.WARNING, "INVALID_TIMEOUT_FORMAT", new Object[] { MAX_RESPONSE_CONTENT_LENGTH, obj.toString() }); } } if (maxResponseContentLength == null) { maxResponseContentLength = DEFAULT_MAX_RESPONSE_CONTENT_LENGTH; } return maxResponseContentLength; }
Source:
<code>public List<VCFContigHeaderLine> getContigLines() { List<VCFContigHeaderLine> contigLines = new ArrayList<>(contigMetaData.size()); contigLines.addAll(contigMetaData.values()); <START> return Collections.unmodifiableList(contigLines); <END> }</code><technical_language>If this method return Collection<> avoid copying return Collections.unmodifiableCollection(contigMetadata.values()). If not, avoid two-step new ... addAll() passing contigMetaData.values() ArrayList constructor. In general, writing APIs return Collection API tied implementation</technical_language>

Target:
public List<VCFContigHeaderLine> getContigLines() { return Collections.unmodifiableList(new ArrayList<>(contigMetaData.values())); }
Source:
<code>public void activate(ComponentContext context) throws LoginException { <START> log.info("activate"); <END> bctx = context.getBundleContext(); refreshCache(); log.info("Activation successful!"); }</code><technical_language>trace</technical_language>

Target:
public void activate(ComponentContext context) throws LoginException { log.trace("activate"); bctx = context.getBundleContext(); refreshCache(); log.trace("Activation successful!"); }
Source:
<code>private HashCode getPartitionHash(PartitionContext partitionContext) { Hasher hasher = Hashing.md5().newHasher(); boolean empty = true; if (_partitionKeys.isEmpty()) { Object value = partitionContext.get(); if (value != null) { hasher.putUnencodedChars(value.toString()); empty = false; } } for (String partitionKey : _partitionKeys) { Object value = partitionContext.get(partitionKey); if (value != null) { <START> hasher.putUnencodedChars(partitionKey); <END> hasher.putUnencodedChars(value.toString()); empty = false; } } if (empty) { return null; } return hasher.hash(); }</code><technical_language>Current Ostrich this class implementing puUnencodedChars work new versions of Guava. backport that</technical_language>

Target:
private HashCode getPartitionHash(PartitionContext partitionContext) { Hasher hasher = Hashing.md5().newHasher(); boolean empty = true; if (_partitionKeys.isEmpty()) { Object value = partitionContext.get(); if (value != null) { putUnencodedChars(hasher, value.toString()); empty = false; } } for (String partitionKey : _partitionKeys) { Object value = partitionContext.get(partitionKey); if (value != null) { putUnencodedChars(hasher, partitionKey); putUnencodedChars(hasher, value.toString()); empty = false; } } if (empty) { return null; } return hasher.hash(); }
Source:
<code>private Aggregator(final Builder builder) { _name = builder._name; _sampling = builder._sampling; if (!_sampling.isPresent()) { _alignSampling = Optional.empty(); } else { _alignSampling = builder._alignSampling; } _otherArgs = builder._otherArgs; <START> _alignEndTime = builder._alignEndTime; <END> _alignStartTime = builder._alignStartTime; }</code><technical_language>is a reason KairosDb model requires this, do translation @Nullable Optional in constructor</technical_language>

Target:
private Aggregator(final Builder builder) { _name = builder._name; _sampling = Optional.ofNullable(builder._sampling); if (!_sampling.isPresent()) { _alignSampling = Optional.empty(); } else { _alignSampling = Optional.ofNullable(builder._alignSampling); } _otherArgs = builder._otherArgs; _alignEndTime = Optional.ofNullable(builder._alignEndTime); _alignStartTime = Optional.ofNullable(builder._alignStartTime); }
Source:
<code><START> public String getSecureVaultValue(SecretResolver secretResolver, OMElement propertyElement) { <END> String value = null; OMAttribute attribute; if (propertyElement != null) { attribute = propertyElement.getAttribute( new QName(BPMNConstants.SECURE_VAULT_NS, "secretAlias") ); if (attribute != null) { value = secretResolver.resolve(attribute.getAttributeValue()); } } return value; }</code><technical_language>set access modifier private here? Usage this class</technical_language>

Target:
private String getSecureVaultValue(SecretResolver secretResolver, OMElement propertyElement) { String value = null; OMAttribute attribute; if (propertyElement != null) { attribute = propertyElement.getAttribute( new QName(BPMNConstants.SECURE_VAULT_NS, "secretAlias") ); if (attribute != null) { value = secretResolver.resolve(attribute.getAttributeValue()); } } return value; }
Source:
<code>public void uninstall() { super.uninstall(); <START> textViewer.getTextWidget().removeLineBackgroundListener(fLineBackgroundListener); <END> }</code><technical_language>remove textInputListener (which means need store a field)</technical_language>

Target:
public void uninstall() { super.uninstall(); textViewer.getTextWidget().removeLineBackgroundListener(fLineBackgroundListener); textViewer.removeTextInputListener(textInputListener); }
Source:
<code>private void scheduleInitializationCheckAndCallback() { executorService.schedule(() -> { <START> if (isClosed.get()) { <END> return; } if (isInitializedInternal()) { runCallback(); } else { scheduleInitializationCheckAndCallback(); } }, 1_000, TimeUnit.MILLISECONDS); }</code><technical_language>I prefer coded defensively caught exceptions top level follow task is scheduled. run risk of deadlock</technical_language>

Target:
private void scheduleInitializationCheckAndCallback() { executorService.schedule(() -> { if (status != State.INITIALIZING) { return; } if (isInitializedInternal()) { runCallback(); } else { scheduleInitializationCheckAndCallback(); } }, 1_000, TimeUnit.MILLISECONDS); }
Source:
<code>public int getVersion() throws SQLException { try { return queue.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { return db.getVersion(); } }).get(); } catch (InterruptedException e) { <START> logger.log(Level.SEVERE,"Failed to get database version",e); <END> throw new SQLException(e); } catch (ExecutionException e) { throw new SQLException(e); } }</code><technical_language>Log for catch blocks neither</technical_language>

Target:
public int getVersion() throws SQLException { try { return queue.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { return db.getVersion(); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE,"Failed to get database version",e); throw new SQLException(e); } catch (ExecutionException e) { logger.log(Level.SEVERE,"Failed to get database version",e); throw new SQLException(e); } }
Source:
<code>public static void deletePaths(final Path... paths) { for (final Path p : paths) { boolean deleted; try { deleted = Files.deleteIfExists(p); } catch (IOException e) { deleted = false; <START> } <END> if (!deleted) System.err.println("Could not delete file " + p); } }</code><technical_language>duplicated...do need implementations</technical_language>

Target:
public static void deletePaths(final Path... paths) { deletePaths(Arrays.asList(paths)); }
Source:
<code>public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(); configs.put(String.format(SYSTEM_CONFIG_KEY, streamId), getSystemName()); getPhysicalName().ifPresent(physicalName -> configs.put(String.format(PHYSICAL_NAME_CONFIG_KEY, streamId), physicalName)); <START> getStreamConfigs().forEach((key, value) -> <END> configs.put(String.format(STREAM_CONFIGS_CONFIG_KEY, streamId, key), value)); return Collections.unmodifiableMap(configs); }</code><technical_language>Minor: inline this, getStreamConfigs is private anyways</technical_language>

Target:
public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(); configs.put(String.format(SYSTEM_CONFIG_KEY, streamId), getSystemName()); this.physicalNameOptional.ifPresent(physicalName -> configs.put(String.format(PHYSICAL_NAME_CONFIG_KEY, streamId), physicalName)); this.streamConfigs.forEach((key, value) -> configs.put(String.format(STREAM_CONFIGS_CONFIG_KEY, streamId, key), value)); return Collections.unmodifiableMap(configs); }
Source:
<code>public CompletionStage<?> loadNextBatch() throws Exception { if (allLoaded()) { return CompletableFuture.failedFuture(new IllegalStateException("BatchIterator already loaded")); } int availableThreads = this.availableThreads.getAsInt(); List<BatchIterator<T>> itToLoad = getIteratorsToLoad(iterators); List<CompletableFuture<CompletableFuture>> nestedFutures = new ArrayList<>(); if (availableThreads < itToLoad.size()) { Iterable<List<BatchIterator<T>>> iteratorsPerThread = Iterables.partition( itToLoad, itToLoad.size() / availableThreads); for (List<BatchIterator<T>> batchIterators: iteratorsPerThread) { CompletableFuture<CompletableFuture> future = supplyAsync(() -> { ArrayList<CompletableFuture<?>> futures = new ArrayList<>(batchIterators.size()); for (BatchIterator<T> batchIterator: batchIterators) { try { futures.add(batchIterator.loadNextBatch().toCompletableFuture()); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])); }, executor); nestedFutures.add(future); } } else { for (BatchIterator<T> iterator: itToLoad) { nestedFutures.add(supplyAsync(() -> { try { return iterator.loadNextBatch().toCompletableFuture(); } catch (Throwable t) { <START> return CompletableFuture.failedFuture(t); <END> } }, executor)); } } return CompletableFutures.allAsList(nestedFutures) .thenCompose(innerFutures -> CompletableFuture.allOf(innerFutures.toArray(new CompletableFuture[0]))); }</code><technical_language>I guess this case is of downsides of checked exception. supplyAsync handle exception correctly :(</technical_language>

Target:
public CompletionStage<?> loadNextBatch() throws Exception { if (allLoaded()) { throw new IllegalStateException("BatchIterator already loaded"); } int availableThreads = this.availableThreads.getAsInt(); List<BatchIterator<T>> itToLoad = getIteratorsToLoad(iterators); List<CompletableFuture<CompletableFuture>> nestedFutures = new ArrayList<>(); if (availableThreads < itToLoad.size()) { Iterable<List<BatchIterator<T>>> iteratorsPerThread = Iterables.partition( itToLoad, itToLoad.size() / availableThreads); for (List<BatchIterator<T>> batchIterators: iteratorsPerThread) { CompletableFuture<CompletableFuture> future = supplyAsync(() -> { ArrayList<CompletableFuture<?>> futures = new ArrayList<>(batchIterators.size()); for (BatchIterator<T> batchIterator: batchIterators) { try { futures.add(batchIterator.loadNextBatch().toCompletableFuture()); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])); }, executor); nestedFutures.add(future); } } else { for (BatchIterator<T> iterator: itToLoad) { nestedFutures.add(supplyAsync(() -> { try { return iterator.loadNextBatch().toCompletableFuture(); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } }, executor)); } } return CompletableFutures.allAsList(nestedFutures) .thenCompose(innerFutures -> CompletableFuture.allOf(innerFutures.toArray(new CompletableFuture[0]))); }
Source:
<code>public static Optional<OAuthScope> fromString(String value){ try{ return Optional.of(OAuthScope.valueOf(value)); }catch (ArrayIndexOutOfBoundsException ex){ <START> return Optional.absent(); <END> } }</code><technical_language>a log message here</technical_language>

Target:
public static Optional<OAuthScope> fromString(String value){ try{ return Optional.of(OAuthScope.valueOf(value)); }catch (ArrayIndexOutOfBoundsException ex){ LOGGER.error("error=invalid-oauth-scope-value value={}", value); return Optional.absent(); } }
Source:
<code>private void shiftReadSetToNeighors() { ReadHeadSet unflippedSet = getVertexValue().getUnflippedReadIds(); KmerFactory kmerFactory = new KmerFactory(Kmer.getKmerLength()); for (ReadHeadInfo info : unflippedSet) { VKmer destForward = kmerFactory.getSubKmerFromChain(-info.getOffset() + 1, Kmer.getKmerLength(), info.getThisReadSequence()); if (destForward == null) { continue; } VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(-info.getOffset() + destReverse.getKmerLetterLength()); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(info.getOffset() - 1); sendReadInfo(destForward, flipped, info); } } ReadHeadSet flippedSet = getVertexValue().getFlippedReadIds(); for (ReadHeadInfo info : flippedSet) { VKmer destForward = kmerFactory.getSubKmerFromChain(info.getOffset() - (Kmer.getKmerLength() - 1) + 1, <START> Kmer.getKmerLength(), info.getThisReadSequence()); <END> VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(info.getOffset() + 1); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(-(info.getOffset() + 1 - Kmer.getKmerLength() + 1)); sendReadInfo(destForward, flipped, info); } } }</code><technical_language>Nevermind-- I right. This is flippedReadIds set started out --> destintation node flipped wrt read. I okay</technical_language>

Target:
private void shiftReadSetToNeighors() { ReadHeadSet unflippedSet = getVertexValue().getUnflippedReadIds(); KmerFactory kmerFactory = new KmerFactory(Kmer.getKmerLength()); for (ReadHeadInfo info : unflippedSet) { if (info.getOffset() > 0) { throw new IllegalStateException("the info's offset should be negative, now:" + info.getOffset()); } VKmer destForward = kmerFactory.getSubKmerFromChain(-info.getOffset() + 1, Kmer.getKmerLength(), info.getThisReadSequence()); if (destForward == null) { continue; } VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(-info.getOffset() + destReverse.getKmerLetterLength()); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(info.getOffset() - 1); sendReadInfo(destForward, flipped, info); } } ReadHeadSet flippedSet = getVertexValue().getFlippedReadIds(); for (ReadHeadInfo info : flippedSet) { if (info.getOffset() < Kmer.getKmerLength() - 1) { throw new IllegalStateException("the info's offset should be >= than the kmerlength-1, now:" + info.getOffset()); } VKmer destForward = kmerFactory.getSubKmerFromChain(info.getOffset() - (Kmer.getKmerLength() - 1) + 1, Kmer.getKmerLength(), info.getThisReadSequence()); if (destForward == null) { continue; } VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(info.getOffset() + 1); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(-(info.getOffset() + 1 - Kmer.getKmerLength() + 1)); sendReadInfo(destForward, flipped, info); } } }
Source:
<code>public void testHeaderValue() throws Exception { setRequestHeader("Front-End-Https", "on"); _rule.setHeader("Front-End-Https"); _rule.setHeaderValue("on"); _rule.setScheme("https"); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); <START> _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme("other").asImmutable()); <END> setRequestHeader("Front-End-Https", "off"); _rule.matchAndApply("/", _request, _response); assertEquals("other", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme((String)null).asImmutable()); setRequestHeader("Front-End-Https", "any"); _rule.setHeaderValue(null); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); }</code><technical_language>Is asImmutable() needed here</technical_language>

Target:
public void testHeaderValue() throws Exception { setRequestHeader("Front-End-Https", "on"); _rule.setHeader("Front-End-Https"); _rule.setHeaderValue("on"); _rule.setScheme("https"); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme("other")); setRequestHeader("Front-End-Https", "off"); _rule.matchAndApply("/", _request, _response); assertEquals("other", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme((String)null)); setRequestHeader("Front-End-Https", "any"); _rule.setHeaderValue(null); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); }
Source:
<code>public List<? extends Symbol> outputs() { if (output == null) { <START> return super.outputs(); <END> } return List.of(output); }</code><technical_language>+1 for extending DMLProjection</technical_language>

Target:
public List<? extends Symbol> outputs() { return List.of(outputs); }
Source:
<code>public StandardRetryPolicy(int maxRetries) { <START> if (maxRetries > 5) { <END> this.maxRetries = 5; } else{ this.maxRetries = maxRetries; } }</code><technical_language>this. maxRetries = Math.min(5, maxRetries);</technical_language>

Target:
public StandardRetryPolicy(int maxRetries) { this.maxRetries = Math.min(6, maxRetries); }
Source:
<code>public synchronized String registerProcessorAndGetId(final ProcessorData data) { String processorId = data.getProcessorId(); if (ephemeralPath == null) { ephemeralPath = zkClient.createEphemeralSequential(keyBuilder.getProcessorsPath() + "/", data.toString()); LOG.info("Created ephemeral path: for processor: in zookeeper.", ephemeralPath, data); ProcessorNode processorNode = new ProcessorNode(data, ephemeralPath); if (shouldStopProcessor(processorNode)) { LOG.info("Processor: is duplicate. Deleting zookeeper node at path: {}.", processorId, ephemeralPath); zkClient.delete(ephemeralPath); throw new SamzaException(String.format("Processor: %s is duplicate in the group. Registration failed.", processorId)); } } else { LOG.info("Ephemeral path: exists for processor: in zookeeper.", ephemeralPath, data); } <START> return ephemeralPath; <END> }</code><technical_language>method determines if processorNode is a duplicate of of existing nodes. action duplicate is stopping processors. please update doc</technical_language>

Target:
public synchronized String registerProcessorAndGetId(final ProcessorData data) { String processorId = data.getProcessorId(); if (ephemeralPath == null) { ephemeralPath = zkClient.createEphemeralSequential(keyBuilder.getProcessorsPath() + "/", data.toString()); LOG.info("Created ephemeral path: for processor: in zookeeper.", ephemeralPath, data); ProcessorNode processorNode = new ProcessorNode(data, ephemeralPath); if (!isValidRegisteredProcessor(processorNode)) { LOG.info("Processor: is duplicate. Deleting zookeeper node at path: {}.", processorId, ephemeralPath); zkClient.delete(ephemeralPath); throw new SamzaException(String.format("Processor: %s is duplicate in the group. Registration failed.", processorId)); } } else { LOG.info("Ephemeral path: exists for processor: in zookeeper.", ephemeralPath, data); } return ephemeralPath; }
Source:
<code>synchronized short allocate( PageSwapper swapper ) { SwapperMapping[] swapperMappings = this.swapperMappings; synchronized ( free ) { if ( !free.isEmpty() ) { <START> short id = Numbers.safeCastIntToShort( free.iterator().next() ); <END> free.remove( id ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; } } short id = safeCastLongToShort( swapperMappings.length ); if ( id + 1 > MAX_SWAPPER_ID ) { throw new IllegalStateException( "All swapper ids are allocated: " + MAX_SWAPPER_ID ); } swapperMappings = Arrays.copyOf( swapperMappings, id + 1 ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; }</code><technical_language>this in a static import</technical_language>

Target:
synchronized short allocate( PageSwapper swapper ) { SwapperMapping[] swapperMappings = this.swapperMappings; synchronized ( free ) { if ( !free.isEmpty() ) { short id = safeCastIntToShort( free.iterator().next() ); free.remove( id ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; } } short id = safeCastIntToShort( swapperMappings.length ); if ( id + 1 > MAX_SWAPPER_ID ) { throw new IllegalStateException( "All swapper ids are allocated: " + MAX_SWAPPER_ID ); } swapperMappings = Arrays.copyOf( swapperMappings, id + 1 ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; }
Source:
<code>public BlobDownloadHeaders() { <START> objectReplicationPolicies = null; <END> }</code><technical_language>objectReplicationSourceProperties? another variable hold destination policy header if get info of a destination blob</technical_language>

Target:
public BlobDownloadHeaders() { objectReplicationSourcePolicies = null; }
Source:
<code>private void compute(ControlFlowGraph cfg, Set<Symbol> localVariables) { Map<Symbol, VariableDefinition> initialState = new HashMap<>(); <START> localVariables.forEach(variable -> { <END> if (variable.usages().stream().anyMatch(u -> u.kind() == Usage.Kind.PARAMETER)) { initialState.put(variable, VariableDefinition.DEFINED); return; } initialState.put(variable, VariableDefinition.UNDEFINED); }); Set<CfgBlock> blocks = cfg.blocks(); blocks.forEach(block -> definedVariablesPerBlock.put(block, DefinedVariables.build(block, initialState))); Deque<CfgBlock> workList = new ArrayDeque<>(blocks); while (!workList.isEmpty()) { CfgBlock currentBlock = workList.pop(); DefinedVariables definedVariables = this.definedVariablesPerBlock.get(currentBlock); boolean outHasChanged = definedVariables.propagate(this.definedVariablesPerBlock); if (outHasChanged) { currentBlock.successors().forEach(workList::push); } } }</code><technical_language>a simple for loop</technical_language>

Target:
private void compute(ControlFlowGraph cfg, Set<Symbol> localVariables) { Map<Symbol, VariableDefinition> initialState = new HashMap<>(); for (Symbol variable : localVariables) { boolean isParameter = variable.usages().stream().anyMatch(u -> u.kind() == Usage.Kind.PARAMETER); initialState.put(variable, isParameter ? VariableDefinition.DEFINED : VariableDefinition.UNDEFINED); } Set<CfgBlock> blocks = cfg.blocks(); blocks.forEach(block -> definedVariablesPerBlock.put(block, DefinedVariables.build(block, initialState))); Deque<CfgBlock> workList = new ArrayDeque<>(blocks); while (!workList.isEmpty()) { CfgBlock currentBlock = workList.pop(); DefinedVariables definedVariables = this.definedVariablesPerBlock.get(currentBlock); boolean outHasChanged = definedVariables.propagate(this.definedVariablesPerBlock); if (outHasChanged) { currentBlock.successors().forEach(workList::push); } } }
Source:
<code>public String getConfig(String configKey) { <START> ConfigKey<String> config = ConfigKeys.newStringConfigKey(configKey); <END> return mgmt().getConfig().getConfig(config); }</code><technical_language>Worth including entitlements check, return values passwords retrieved brooklyn.properties. For example, like: if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ALL_SERVER_INFO, null)) { throw WebResourceUtils.unauthorized("User '%s' is authorized for this operation", Entitlements.getEntitlementContext().user()); }</technical_language>

Target:
public String getConfig(String configKey) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ALL_SERVER_INFO, null)) { throw WebResourceUtils.unauthorized("User '%s' is not authorized for this operation", Entitlements.getEntitlementContext().user()); } ConfigKey<String> config = ConfigKeys.newStringConfigKey(configKey); return mgmt().getConfig().getConfig(config); }
Source:
<code>private String generateCoOwnersEmailsLine(String courseId) { List<InstructorAttributes> instructors = instructorsLogic.getInstructorsForCourse(courseId); <START> StringBuffer coOwnersEmailsList = new StringBuffer(); <END> for (InstructorAttributes instructor : instructors) { if (!instructor.hasCoownerPrivileges()) { continue; } coOwnersEmailsList.append(instructor.getName() + "(" + instructor.getEmail() + "), "); } return coOwnersEmailsList.length() == 0 ? "(No contactable instructors found)" : coOwnersEmailsList.substring(0, coOwnersEmailsList.length() - 2); }</code><technical_language>StringBuilder is more efficient concurrency access is required</technical_language>

Target:
private String generateCoOwnersEmailsLine(String courseId) { List<InstructorAttributes> coOwners = instructorsLogic.getCoOwnersForCourse(courseId); if (coOwners.isEmpty()) { return "(No contactable instructors found)"; } StringBuilder coOwnersEmailsLine = new StringBuilder(); for (InstructorAttributes coOwner : coOwners) { coOwnersEmailsLine .append(coOwner.getName()) .append('(') .append(coOwner.getEmail()) .append("), "); } return coOwnersEmailsLine.substring(0, coOwnersEmailsLine.length() - 2); }