auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public Contentlet fire(final String wfActionId, final Map<String, Object> properties, final User user) <END> throws DotSecurityException, DotDataException { final MapToContentletPopulator mapToContentletPopulator = MapToContentletPopulator.INSTANCE; Contentlet contentlet = new Contentlet(); contentlet = mapToContentletPopulator.populate(contentlet, properties); final boolean ALLOW_FRONT_END_SAVING = Config .getBooleanProperty("WORKFLOW_TOOL_ALLOW_FRONT_END_SAVING", false); List<Category> cats = categoryAPI.getCategoriesFromContent(contentlet, user, ALLOW_FRONT_END_SAVING); Map<Relationship, List<Contentlet>> relationships = (Map<Relationship, List<Contentlet>>) contentlet.get(RELATIONSHIP_KEY); final ContentletDependencies contentletDependencies = new ContentletDependencies.Builder() .workflowActionId(wfActionId) .respectAnonymousPermissions(ALLOW_FRONT_END_SAVING) .modUser(user).categories(cats) .relationships(relationshipAPI.getContentletRelationshipsFromMap(contentlet, relationships)) .indexPolicy(IndexPolicyProvider.getInstance().forSingleContent()) .build(); return wapi.fireContentWorkflow(contentlet, contentletDependencies); }</code><technical_language>Good I add some logging</technical_language>

Target:
public Contentlet fire(final String wfActionId, final Map<String, Object> properties, final User user) throws DotSecurityException, DotDataException { final MapToContentletPopulator mapToContentletPopulator = MapToContentletPopulator.INSTANCE; Contentlet contentlet = new Contentlet(); contentlet = mapToContentletPopulator.populate(contentlet, properties); final boolean ALLOW_FRONT_END_SAVING = Config .getBooleanProperty("WORKFLOW_TOOL_ALLOW_FRONT_END_SAVING", false); final List<Category> cats = categoryAPI.getCategoriesFromContent(contentlet, user, ALLOW_FRONT_END_SAVING); final Map<Relationship, List<Contentlet>> relationships = (Map<Relationship, List<Contentlet>>) contentlet.get(RELATIONSHIP_KEY); final ContentletDependencies contentletDependencies = new ContentletDependencies.Builder() .workflowActionId(wfActionId) .respectAnonymousPermissions(ALLOW_FRONT_END_SAVING) .modUser(user).categories(cats) .relationships(relationshipAPI.getContentletRelationshipsFromMap(contentlet, relationships)) .indexPolicy(IndexPolicyProvider.getInstance().forSingleContent()) .build(); return workflowAPI.fireContentWorkflow(contentlet, contentletDependencies); }
Source:
<code>public BaseArrayProvider( DimensionSelector dimSelector, TopNQuery query, Capabilities capabilities ) { this.dimSelector = dimSelector; this.query = query; this.capabilities = capabilities; previousStop = null; ignoreAfterThreshold = false; ignoreFirstN = 0; keepOnlyN = dimSelector.getValueCardinality(); <START> } <END></code><technical_language>Similar here, is this necessary? If suspicious</technical_language>

Target:
public BaseArrayProvider( DimensionSelector dimSelector, TopNQuery query, Capabilities capabilities ) { this.dimSelector = dimSelector; this.idLookup = dimSelector.idLookup(); this.query = query; this.capabilities = capabilities; previousStop = null; ignoreAfterThreshold = false; ignoreFirstN = 0; keepOnlyN = dimSelector.getValueCardinality(); if (keepOnlyN < 0) { throw new IAE("Cannot operate on a dimension with no dictionary"); } }
Source:
<code>public int hashCode() { <START> return className.hashCode(); <END> }</code><technical_language>methodName here, is intended</technical_language>

Target:
@Override public int hashCode() { int result = className.hashCode(); result = 31 * result + methodName.hashCode(); return result; }
Source:
<code>public Map<String, String> getFields() { Map<String, String> map = fFields; if (map == null) { <START> Builder<@NonNull String, @NonNull String> builder = ImmutableMap.<@NonNull String, @NonNull String> builder() <END> .put("Version", String.valueOf(fVersion)) .put("Header Length", String.valueOf(getHeaderLength()) + " bytes") .put("Differentiated Services Field", String.format("%s%02x", "0x", fDSCP)) .put("Explicit Congestion Notification", String.format("%s%02x", "0x", fExplicitCongestionNotification)) .put("Total Length", String.valueOf(fTotalLength) + " bytes") .put("Identification", String.format("%s%04x", "0x", fIdentification)) .put("Don't Fragment Flag", String.valueOf(fDontFragmentFlag)) .put("More Fragment Flag", String.valueOf(fMoreFragmentFlag)) .put("Fragment Offset", String.valueOf(fFragmentOffset)) .put("Time to live", String.valueOf(fTimeToLive)) .put("Protocol", IPProtocolNumberHelper.toString(fIpDatagramProtocol) + " (" + String.valueOf(fIpDatagramProtocol) + ")") .put("Checksum", String.format("%s%04x", "0x", fHeaderChecksum)) .put("Source IP Address", fSourceIpAddress.getHostAddress()) .put("Destination IP Address", fDestinationIpAddress.getHostAddress()); byte[] options = fOptions; if (options == null) { builder.put("Options", EMPTY_STRING); } else { builder.put("Options", ConversionHelper.bytesToHex(options, true)); } fFields = checkNotNull(builder.build()); return fFields; } return map; }</code><technical_language>in this case type inference work, repeat <@NonNull String, @NonNull String></technical_language>

Target:
public Map<String, String> getFields() { Map<String, String> map = fFields; if (map == null) { Builder<@NonNull String, @NonNull String> builder = ImmutableMap.<@NonNull String, @NonNull String> builder() .put("Version", String.valueOf(fVersion)) .put("Header Length", String.valueOf(getHeaderLength()) + " bytes") .put("Differentiated Services Field", String.format("%s%02x", "0x", fDSCP)) .put("Explicit Congestion Notification", String.format("%s%02x", "0x", fExplicitCongestionNotification)) .put("Total Length", String.valueOf(fTotalLength) + " bytes") .put("Identification", String.format("%s%04x", "0x", fIdentification)) .put("Don't Fragment Flag", String.valueOf(fDontFragmentFlag)) .put("More Fragment Flag", String.valueOf(fMoreFragmentFlag)) .put("Fragment Offset", String.valueOf(fFragmentOffset)) .put("Time to live", String.valueOf(fTimeToLive)) .put("Protocol", IPProtocolNumberHelper.toString(fIpDatagramProtocol) + " (" + String.valueOf(fIpDatagramProtocol) + ")") .put("Checksum", String.format("%s%04x", "0x", fHeaderChecksum)) .put("Source IP Address", nullToEmptyString(fSourceIpAddress.getHostAddress())) .put("Destination IP Address", nullToEmptyString(fDestinationIpAddress.getHostAddress())); byte[] options = fOptions; if (options == null) { builder.put("Options", EMPTY_STRING); } else { builder.put("Options", ConversionHelper.bytesToHex(options, true)); } fFields = checkNotNull(builder.build()); return fFields; } return map; }
Source:
<code>public QualifiedName getQualifiedName() { if (qualifiedName != null) { return qualifiedName; } ASTClassOrInterfaceDeclaration parent = this.getFirstParentOfType(ASTClassOrInterfaceDeclaration.class); ASTFormalParameters params = this.getFirstDescendantOfType(ASTFormalParameters.class); <START> int numParams = params.jjtGetNumChildren(); <END> String[] types = new String[numParams]; for (int i = 0; i < numParams; i++) { types[i] = params.jjtGetChild(i).getFirstDescendantOfType(ASTType.class).getTypeImage(); } qualifiedName = QualifiedName.makeOperationOf(parent.getQualifiedName(), parent.getImage(), types); return qualifiedName; }</code><technical_language>ASTFormalParameters a method getParameterCount() - returns jjtGetNumChildren(), easier read/comprehend</technical_language>

Target:
public QualifiedName getQualifiedName() { if (qualifiedName == null) { qualifiedName = QualifiedName.makeOperationOf(this); } return qualifiedName; }
Source:
<code>public void launchCommentCodeFeature() { Actions action = actionsFactory.createAction(seleniumWebDriver); <START> action.keyDown(CONTROL).sendKeys("/").keyUp(CONTROL).perform(); <END> }</code><technical_language>simplify: actionsFactory.createAction(seleniumWebDriver) .keyDown(CONTROL).sendKeys("/").keyUp(CONTROL).perform();</technical_language>

Target:
public void launchCommentCodeFeature() { actionsFactory .createAction(seleniumWebDriver) .keyDown(CONTROL) .sendKeys("/") .keyUp(CONTROL) .perform(); }
Source:
<code><START> public DMNElement getParentDRDElement() { <END> if( this instanceof DRGElement || (this instanceof Artifact) || (this instanceof ItemDefinition && parent != null && parent instanceof Definitions)) { return (DMNElement) this; } else if( parent != null ) { return parent.getParentDRDElement(); } else { return null; } }</code><technical_language>I is 100% correspondence "DRGElement" in original method name, DRGElement class (type), I method originally getParentDRGElement() signify is parent in DRG DRD</technical_language>

Target:
public DMNModelInstrumentedBase getParentDRDElement() { if( this instanceof DRGElement || (this instanceof Artifact) || (this instanceof ItemDefinition && parent != null && parent instanceof Definitions)) { return this; } else if( parent != null ) { return parent.getParentDRDElement(); } else { return null; } }
Source:
<code>private void growup() { if (values.length == rows * columns) { throw new IllegalStateException("This matrix can't grow up."); } <START> int min = rows * columns; <END> min = min < 0 ? Integer.MAX_VALUE : min; int capacity = Math.min(min, (cardinality * 3) / 2 + 1); double $values[] = new double[capacity]; int $rowIndices[] = new int[capacity]; System.arraycopy(values, 0, $values, 0, cardinality); System.arraycopy(rowIndices, 0, $rowIndices, 0, cardinality); values = $values; rowIndices = $rowIndices; }</code><technical_language>Probably, is wrong idenations</technical_language>

Target:
private void growup() { if (values.length == capacity()) { throw new IllegalStateException("This matrix can't grow up."); } int min = rows * columns; min = min < 0 ? Integer.MAX_VALUE : min; int capacity = Math.min(min, (cardinality * 3) / 2 + 1); double $values[] = new double[capacity]; int $rowIndices[] = new int[capacity]; System.arraycopy(values, 0, $values, 0, cardinality); System.arraycopy(rowIndices, 0, $rowIndices, 0, cardinality); values = $values; rowIndices = $rowIndices; }
Source:
<code>public void prepareRun(BatchSourceContext context) throws Exception { Job job = JobUtils.createInstance(); Configuration conf = job.getConfiguration(); ConfigHelper.setInputColumnFamily(conf, config.keyspace, config.columnFamily); ConfigHelper.setInputInitialAddress(conf, config.initialAddress); ConfigHelper.setInputPartitioner(conf, config.partitioner); ConfigHelper.setInputRpcPort(conf, (config.port == null) ? "9160" : Integer.toString(config.port)); Preconditions.checkArgument(!(Strings.isNullOrEmpty(config.username) ^ Strings.isNullOrEmpty(config.password)), "You must either set both username and password or neither username nor password. " + "Currently, they are username: " + config.username + " and password: " + config.password); if (!Strings.isNullOrEmpty(config.username)) { ConfigHelper.setInputKeyspaceUserNameAndPassword(conf, config.username, config.password); } if (!Strings.isNullOrEmpty(config.properties)) { for (String pair : config.properties.split(",")) { conf.set(CharMatcher.WHITESPACE.trimFrom(pair.split(":")[0]), CharMatcher.WHITESPACE.trimFrom(pair.split(":")[1])); } } CqlConfigHelper.setInputCql(conf, config.query); <START> context.setInput(Input.of("Cassandra", new SourceInputFormatProvider(CqlInputFormat.class, conf))); <END> }</code><technical_language>Hmm, I merged this change in PR <LINK_0> is showing in diff</technical_language>

Target:
public void prepareRun(BatchSourceContext context) throws Exception { Configuration conf = new Configuration(); conf.clear(); ConfigHelper.setInputColumnFamily(conf, config.keyspace, config.columnFamily); ConfigHelper.setInputInitialAddress(conf, config.initialAddress); ConfigHelper.setInputPartitioner(conf, config.partitioner); ConfigHelper.setInputRpcPort(conf, (config.port == null) ? "9160" : Integer.toString(config.port)); Preconditions.checkArgument(!(Strings.isNullOrEmpty(config.username) ^ Strings.isNullOrEmpty(config.password)), "You must either set both username and password or neither username nor password. " + "Currently, they are username: " + config.username + " and password: " + config.password); if (!Strings.isNullOrEmpty(config.username)) { ConfigHelper.setInputKeyspaceUserNameAndPassword(conf, config.username, config.password); } if (!Strings.isNullOrEmpty(config.properties)) { for (String pair : config.properties.split(",")) { conf.set(CharMatcher.WHITESPACE.trimFrom(pair.split(":")[0]), CharMatcher.WHITESPACE.trimFrom(pair.split(":")[1])); } } CqlConfigHelper.setInputCql(conf, config.query); context.setInput(Input.of(config.referenceName, new SourceInputFormatProvider(CqlInputFormat.class, conf))); }
Source:
<code>public Stream<BuiltInProcedures.SchemaIndexInfo> createIndex( String indexSpecification, String providerName ) throws ProcedureException { <START> String statusMessage = "index created"; <END> return createIndex( indexSpecification, providerName, statusMessage, ( schemaWrite, descriptor, provider ) -> schemaWrite.indexCreate( descriptor, Optional.of( provider ), Optional.empty() ) ); }</code><technical_language>Inline this</technical_language>

Target:
public Stream<BuiltInProcedures.SchemaIndexInfo> createIndex( String indexSpecification, String providerName ) throws ProcedureException { return createIndex( indexSpecification, providerName, "index created", ( schemaWrite, descriptor, provider ) -> schemaWrite.indexCreate( descriptor, Optional.of( provider ), Optional.empty() ) ); }
Source:
<code>public void verifyAddedDiffs(ArrayList<String> targets) { waitForElementVisibleByElement(reviewDialogIFrame); driver.switchTo().frame(reviewDialogIFrame); <START> boolean isNewArticle = driver.findElements(By.cssSelector(".ve-ui-mwSaveDialog-viewer.WikiaArticle pre")).size() > 0; <END> if (isNewArticle) { verifyNewArticleDiffs(targets); } else { verifyArticleDiffs(targets, INSERT); } waitForElementNotVisibleByElement(reviewDialogIFrame); driver.switchTo().defaultContent(); }</code><technical_language>please move CSS selector field in this class private final String .... = ".ve-ui-mwSaveDialog-viewer.WikiaArticle pre"</technical_language>

Target:
public void verifyAddedDiffs(ArrayList<String> targets) { waitForElementVisibleByElement(reviewDialogIFrame); driver.switchTo().frame(reviewDialogIFrame); if (checkIfElementOnPage(wikiaAritlceFirstPreview)) { verifyNewArticleDiffs(targets); } else { verifyArticleDiffs(targets, INSERT); } waitForElementNotVisibleByElement(reviewDialogIFrame); driver.switchTo().defaultContent(); }
Source:
<code>public void testInvokePOSTResourceBeforeAddingPOSTResource() throws Exception { String exceptionMessage = ""; try { HttpRequestUtil.doPost(new URL(API_BASE_URL + API_CONTEXT + "/" + API_VERSION_1_0_0 + API_POST_ENDPOINT_METHOD), "id=25", requestHeadersPost); } catch (Exception e) { exceptionMessage = e.getMessage(); } finally { assertTrue(exceptionMessage.contains("java.io.IOException: Server returned HTTP response code:" + <START> " 403 for URL: http://localhost:8280/testAPI1/1.0.0/customers/name/"), "Not Return IOException " + <END> "with 403 when accessing a POST resource which is not define yet"); } }</code><technical_language>hard code URL in exception</technical_language>

Target:
public void testInvokePOSTResourceBeforeAddingPOSTResource() throws APIManagerIntegrationTestException { String exceptionMessage = ""; try { HttpRequestUtil.doPost(new URL(postEndPointURL), "id=25", requestHeadersPost); } catch (Exception e) { exceptionMessage = e.getMessage(); } finally { assertTrue(exceptionMessage.contains("java.io.IOException: Server returned HTTP response code:" + " 403 for URL: " + postEndPointURL), "Not Return IOException " + "with 403 when accessing a POST resource which is not define yet"); } }
Source:
<code>public static TimeDatum createTime(Datum datum, @Nullable TimeZone tz) { switch (datum.type()) { case INT8: return new TimeDatum(datum.asInt8()); case CHAR: case VARCHAR: case TEXT: TimeMeta tm = DateTimeFormat.parseDateTime(datum.asChars(), "HH24:MI:SS.MS"); if (tz != null) { DateTimeUtil.toUTCTimezone(tm, tz); } return new TimeDatum(DateTimeUtil.toTime(tm)); case TIME: return (TimeDatum) datum; default: <START> throw new TajoRuntimeException(Errors.ResultCode.INVALID_CAST, datum.type().name(), Type.TIME.name()); <END> } }</code><technical_language>new TajoRuntimeException(new InvalidCastException(...)</technical_language>

Target:
public static TimeDatum createTime(Datum datum, @Nullable TimeZone tz) { switch (datum.type()) { case INT8: return new TimeDatum(datum.asInt8()); case CHAR: case VARCHAR: case TEXT: TimeMeta tm = DateTimeFormat.parseDateTime(datum.asChars(), "HH24:MI:SS.MS"); if (tz != null) { DateTimeUtil.toUTCTimezone(tm, tz); } return new TimeDatum(DateTimeUtil.toTime(tm)); case TIME: return (TimeDatum) datum; default: throw new TajoRuntimeException(new InvalidCastException(datum.type(), Type.TIME)); } }
Source:
<code>public String renderAttributeAsString(IAttributeType attributeType, Artifact artifact, PresentationType presentationType, final String defaultValue) throws OseeCoreException { String returnValue = defaultValue; if (presentationType.matches(RENDER_AS_HUMAN_READABLE_TEXT)) { if (artifact == null) { <START> returnValue = "Artifact not found, possibly deleted"; <END> } else { Attribute<Object> soleAttribute = artifact.getSoleAttribute(attributeType); if (soleAttribute == null) { returnValue = "Attribute not found, possibly deleted"; } else { returnValue = soleAttribute.getDisplayableString(); } } } return returnValue; }</code><technical_language>i put possibly deleted. i suggest leaving part off, or, determine that, figure out put if applicable</technical_language>

Target:
public String renderAttributeAsString(IAttributeType attributeType, Artifact artifact, PresentationType presentationType, final String defaultValue) throws OseeCoreException { String returnValue = defaultValue; if (presentationType.matches(RENDER_AS_HUMAN_READABLE_TEXT)) { if (artifact == null) { returnValue = "DELETED"; } else { Attribute<Object> soleAttribute = artifact.getSoleAttribute(attributeType); if (soleAttribute == null) { returnValue = "DELETED"; } else { returnValue = soleAttribute.getDisplayableString(); } } } return returnValue; }
Source:
<code>public Properties trackProfilePhotoSet(boolean fromCamera) { final SegmentAnalyticsEvent aEvent = new SegmentAnalyticsEvent(); aEvent.properties.putValue(Keys.NAME, Values.PROFILE_PHOTO_SET); aEvent.setAppNameContext(); aEvent.properties = addCategoryToBiEvents(aEvent.properties, <START> Values.PROFILE, fromCamera ? "camera" : "library"); <END> tracker.track(Events.PROFILE_PHOTO_SET, aEvent.properties); return aEvent.properties; }</code><technical_language>camera & library strings moved Values interface</technical_language>

Target:
public Properties trackProfilePhotoSet(boolean fromCamera) { final SegmentAnalyticsEvent aEvent = new SegmentAnalyticsEvent(); aEvent.properties.putValue(Keys.NAME, Values.PROFILE_PHOTO_SET); aEvent.setAppNameContext(); aEvent.properties = addCategoryToBiEvents(aEvent.properties, Values.PROFILE, fromCamera ? Values.CAMERA : Values.LIBRARY); tracker.track(Events.PROFILE_PHOTO_SET, aEvent.properties); return aEvent.properties; }
Source:
<code>private boolean fileOnlyContainsOurEmployeeCustomerIndicator(ConcurRequestExtractFile requestExtractFile) { if ( (requestExtractFile.getRequestDetails() == null) || (requestExtractFile.getRequestDetails().isEmpty()) ) { LOG.error("There are no Request Detail lines in the file."); return false; } else { String ourCustomerProfile = getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID); if (StringUtils.isNotEmpty(ourCustomerProfile) && ourCustomerProfileIsOnAllRequestDetailLines(requestExtractFile, ourCustomerProfile)) { return true; } else { <START> LOG.error("File contains Request Detail lines that do not match the employee customer profile group of: " + getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID)); <END> return false; } } }</code><technical_language>This parameter is stored in a variable above, simplify logging statement</technical_language>

Target:
private boolean fileOnlyContainsOurEmployeeCustomerIndicator(ConcurRequestExtractFile requestExtractFile) { if ( (requestExtractFile.getRequestDetails() == null) || (requestExtractFile.getRequestDetails().isEmpty()) ) { LOG.error("fileOnlyContainsOurEmployeeCustomerIndicator: There are no Request Detail lines in the file."); return false; } else { String ourCustomerProfile = getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID); if (StringUtils.isNotEmpty(ourCustomerProfile) && ourCustomerProfileIsOnAllRequestDetailLines(requestExtractFile, ourCustomerProfile)) { return true; } else { LOG.error("fileOnlyContainsOurEmployeeCustomerIndicator: File contains Request Detail lines that do not match the employee customer profile group of: " + getConcurBatchUtilityService().getConcurParameterValue(ConcurParameterConstants.CONCUR_CUSTOMER_PROFILE_GROUP_ID)); return false; } } }
Source:
<code>public void testSetManagedMemoryWeight() { final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); final DataStream<Integer> source = env.fromElements(1, 2, 3).name("source"); source.getTransformation().declareManagedMemoryUseCase(ManagedMemoryUseCase.BATCH_OP, 123); source.print().name("sink"); final StreamGraph streamGraph = env.getStreamGraph(); for (StreamNode streamNode : streamGraph.getStreamNodes()) { if (streamNode.getOperatorName().contains("source")) { assertThat(streamNode.getManagedMemoryUseCaseWeights().get(ManagedMemoryUseCase.BATCH_OP), is(123)); } else { <START> assertThat(streamNode.getManagedMemoryUseCaseWeights().size(), is(0)); <END> } } }</code><technical_language>Then, expected a reference instead of a specific value</technical_language>

Target:
public void testSetManagedMemoryWeight() { final int weight = 123; final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); final DataStream<Integer> source = env.fromElements(1, 2, 3).name("source"); source.getTransformation().declareManagedMemoryUseCase(ManagedMemoryUseCase.BATCH_OP, weight); source.print().name("sink"); final StreamGraph streamGraph = env.getStreamGraph(); for (StreamNode streamNode : streamGraph.getStreamNodes()) { if (streamNode.getOperatorName().contains("source")) { assertThat(streamNode.getManagedMemoryUseCaseWeights().get(ManagedMemoryUseCase.BATCH_OP), is(weight)); } else { assertThat(streamNode.getManagedMemoryUseCaseWeights().size(), is(0)); } } }
Source:
<code>public <T> T create(final Class<T> service) { Utils.validateServiceInterface(service); if (validateEagerly) { eagerlyValidateMethods(service); } return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service }, new InvocationHandler() { private final Platform platform = Platform.get(); private final Object[] emptyArgs = new Object[0]; @Override public Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable { if (method.getDeclaringClass() == Object.class) { return method.invoke(this, args); } if (platform.isDefaultMethod(method)) { return platform.invokeDefaultMethod(method, service, proxy, args); <START> } else if (Modifier.isStatic(method.getModifiers())) { <END> return method.invoke(null, args); } return loadServiceMethod(method).invoke(args != null ? args : emptyArgs); } }); }</code><technical_language>Is this line reachable in test cases? I assume dispatched this</technical_language>

Target:
public <T> T create(final Class<T> service) { Utils.validateServiceInterface(service); if (validateEagerly) { eagerlyValidateMethods(service); } return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service }, new InvocationHandler() { private final Platform platform = Platform.get(); private final Object[] emptyArgs = new Object[0]; @Override public Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable { if (method.getDeclaringClass() == Object.class) { return method.invoke(this, args); } if (platform.isDefaultMethod(method)) { return platform.invokeDefaultMethod(method, service, proxy, args); } return loadServiceMethod(method).invoke(args != null ? args : emptyArgs); } }); }
Source:
<code>private void updateAuditLog(AuditLogType auditLogType) { <START> addCustomValue("DiskId", getImageId().toString()); <END> addCustomValue("UserName", getUserName()); AuditLogDirector.log(this, auditLogType); }</code><technical_language>this disk alias, user understand id.</technical_language>

Target:
private void updateAuditLog(AuditLogType auditLogType) { addCustomValue("DiskAlias", getImage().getDiskAlias()); AuditLogDirector.log(this, auditLogType); }
Source:
<code>public final Map<String, Object> getGeocodedData(final String ip) { InetAddress ipAddress = null; Map<String, Object> geoData = getDefaultMap(); try { ipAddress = InetAddress.getByName(ip); } catch (UnknownHostException hEx) { <START> return geoData; <END> } CityResponse response = null; try { response = databaseReader.city(ipAddress); } catch (IOException iEx) { return geoData; } catch (GeoIp2Exception gEx) { return geoData; } if (response == null) return geoData; Continent continent = response.getContinent(); if (continent != null && continent.getName() != null) geoData.put(CONTINENT, continent.getName()); Country country = response.getCountry(); if (country != null && country.getIsoCode() != null) { geoData.put(COUNTRY_CODE, country.getIsoCode()); geoData.put(COUNTRY, country.getName()); } City city = response.getCity(); if (city != null && city.getName() != null) geoData.put(CITY, city.getName()); Postal postal = response.getPostal(); if (postal != null && postal.getCode() != null) geoData.put(POSTAL_CODE, postal.getCode()); Location location = response.getLocation(); if (location != null) { geoData.put(LATITUDE, location.getLatitude()); geoData.put(LONGITUDE, location.getLongitude()); if (location.getTimeZone() != null) geoData.put(TIME_ZONE, location.getTimeZone()); } return geoData; }</code><technical_language>here, warn logging maybe? for exceptions below. Dunno</technical_language>

Target:
public final Map<String, Object> getGeocodedData(final String ip) { InetAddress ipAddress = null; Map<String, Object> geoData = getDefaultMap(); try { ipAddress = InetAddress.getByName(ip); } catch (UnknownHostException hEx) { Log.warn(hEx); return geoData; } CityResponse response = null; try { response = databaseReader.city(ipAddress); } catch (IOException iEx) { Log.warn(iEx); return geoData; } catch (GeoIp2Exception gEx) { Log.warn(gEx); return geoData; } if (response == null) return geoData; Continent continent = response.getContinent(); if (continent != null && continent.getName() != null) geoData.put(CONTINENT, continent.getName()); Country country = response.getCountry(); if (country != null && country.getIsoCode() != null) { geoData.put(COUNTRY_CODE, country.getIsoCode()); geoData.put(COUNTRY, country.getName()); } List<Subdivision> subdivisions = response.getSubdivisions(); if (subdivisions != null && subdivisions.size() > 0) { geoData.put(SUB_DIVISION, subdivisions.get(0).getName()); } City city = response.getCity(); if (city != null && city.getName() != null) geoData.put(CITY, city.getName()); Postal postal = response.getPostal(); if (postal != null && postal.getCode() != null) geoData.put(POSTAL_CODE, postal.getCode()); Location location = response.getLocation(); if (location != null) { geoData.put(LATITUDE, location.getLatitude()); geoData.put(LONGITUDE, location.getLongitude()); if (location.getTimeZone() != null) geoData.put(TIME_ZONE, location.getTimeZone()); } return geoData; }
Source:
<code><START> public synchronized ArrayList getStorageDelay() { <END> return storageDelay; }</code><technical_language>synchronized getters Lists</technical_language>

Target:
public ArrayList getStorageDelay() { return storageDelay; }
Source:
<code>protected boolean amendDiskRequested() { <START> boolean isBaseSnapshotDisk = getNewDisk().isDiskSnapshot() && ((DiskImage) getNewDisk()).getImage().getVolumeFormat() == VolumeFormat.RAW; <END> if (getNewDisk().getDiskStorageType() == DiskStorageType.IMAGE && !isBaseSnapshotDisk) { QcowCompat qcowCompat = ((DiskImage) getNewDisk()).getQcowCompat(); return getDiskImages(getOldDisk().getId()).stream().anyMatch(disk -> disk.isQcowFormat() && disk.getQcowCompat() != qcowCompat); } return false; }</code><technical_language>Please extract a method call verified this is image disk</technical_language>

Target:
protected boolean amendDiskRequested() { if (getNewDisk().getDiskStorageType() == DiskStorageType.IMAGE && !isBaseSnapshotDisk()) { QcowCompat qcowCompat = ((DiskImage) getNewDisk()).getQcowCompat(); return getDiskImages(getOldDisk().getId()).stream().anyMatch(disk -> disk.isQcowFormat() && disk.getQcowCompat() != qcowCompat); } return false; }
Source:
<code>private void writeSome(AccumuloClient c, String table, long count) throws Exception { <START> int iterations = 5; <END> long[] attempts = new long[iterations]; for (int attempt = 0; attempt < iterations; attempt++) { long now = System.currentTimeMillis(); try (BatchWriter bw = c.createBatchWriter(table)) { for (int i = 1; i < count + 1; i++) { Mutation m = new Mutation("" + i); m.put("", "", ""); bw.addMutation(m); if (i % (Math.max(1, count / 100)) == 0) { bw.flush(); } } } attempts[attempt] = System.currentTimeMillis() - now; } Arrays.sort(attempts); log.info("Attempt durations: {}", Arrays.toString(attempts)); }</code><technical_language>@Manno15 iterations, attempts, for loop removed? this loop existed write multiple times get median time</technical_language>

Target:
private void writeSome(AccumuloClient c, String table, long count) throws Exception { try (BatchWriter bw = c.createBatchWriter(table)) { for (int i = 1; i < count + 1; i++) { Mutation m = new Mutation("" + i); m.put("", "", ""); bw.addMutation(m); if (i % (Math.max(1, count / 100)) == 0) { bw.flush(); } } } }
Source:
<code>private static List<PathElement> parsePath(String path) { SubfieldPathTokenizer tokenizer = new SubfieldPathTokenizer(path); List<PathElement> elements = new ArrayList<>(); <START> while (tokenizer.hasNext()) { <END> elements.add(tokenizer.next()); } return elements; }</code><technical_language>suggestion tokenizer.forEachRemaining(elements::add);</technical_language>

Target:
private static List<PathElement> parsePath(String path) { SubfieldPathTokenizer tokenizer = new SubfieldPathTokenizer(path); List<PathElement> elements = new ArrayList<>(); tokenizer.forEachRemaining(elements::add); return elements; }
Source:
<code>private void initialize() { viewModel = new ParseTexResultViewModel(texParserResult); <START> referenceListView.itemsProperty().setValue(viewModel.getReferenceList()); <END> EasyBind.subscribe(referenceListView.getSelectionModel().selectedItemProperty(), reference -> { if (reference != null) { viewModel.getCitationList().setAll(reference.getCitationList()); } }); referenceListView.getSelectionModel().selectFirst(); new ViewModelListCellFactory<ReferenceWrapper>() .withText(ReferenceWrapper::getDisplayText) .install(referenceListView); citationListView.setItems(viewModel.getCitationList()); new ViewModelListCellFactory<Citation>() .withGraphic(this::citationToGraphic) .install(citationListView); }</code><technical_language>I guess referenceListView.setItems(...) is a bit shorter ;-)</technical_language>

Target:
private void initialize() { viewModel = new ParseTexResultViewModel(texParserResult); referenceListView.setItems(viewModel.getReferenceList()); EasyBind.subscribe(referenceListView.getSelectionModel().selectedItemProperty(), viewModel::activeReferenceChanged); referenceListView.getSelectionModel().selectFirst(); new ViewModelListCellFactory<ReferenceViewModel>() .withText(ReferenceViewModel::getDisplayText) .install(referenceListView); citationListView.setItems(viewModel.getCitationListByReference()); new ViewModelListCellFactory<Citation>() .withGraphic(this::citationToGraphic) .install(citationListView); }
Source:
<code>public RetrofitApiServiceImpl(File cacheFolder, Gson gson, PlatformIdentifier platformId, String baseUrl) { mGson = gson; mPlatformIdentifier = platformId; Retrofit restAdapter = new Retrofit.Builder() .baseUrl(baseUrl) .client(getOkHttpClient(cacheFolder)) .addConverterFactory(GsonConverterFactory.create(mGson)) .build(); this.version = RetrofitApiTransport.BACKEND_VERSION; if (version == 0) { mApiServiceV0 = restAdapter.create(RetrofitApiServiceV0.class); mApiServiceV1 = null; mApiServiceV2 = null; } else if (version == 1) { mApiServiceV0 = null; mApiServiceV1 = restAdapter.create(RetrofitApiServiceV1.class); <START> ; <END> mApiServiceV2 = null; } else if (version == 2) { mApiServiceV0 = null; mApiServiceV1 = null; mApiServiceV2 = restAdapter.create(RetrofitApiServiceV2.class); } else { mApiServiceV0 = null; mApiServiceV1 = null; mApiServiceV2 = null; throw new IllegalArgumentException("Sorry, only available beackend versions are 0, 1, 2"); } }</code><technical_language>double ;</technical_language>

Target:
public RetrofitApiServiceImpl(File cacheFolder, Gson gson, PlatformIdentifier platformId, String baseUrl) { mGson = gson; mPlatformIdentifier = platformId; Retrofit restAdapter = new Retrofit.Builder() .baseUrl(baseUrl) .client(getOkHttpClient(cacheFolder)) .addConverterFactory(GsonConverterFactory.create(mGson)) .build(); this.version = RetrofitApiTransport.BACKEND_VERSION; if (version == 0) { mApiServiceV0 = restAdapter.create(RetrofitApiServiceV0.class); mApiServiceV1 = null; mApiServiceV2 = null; } else if (version == 1) { mApiServiceV0 = null; mApiServiceV1 = restAdapter.create(RetrofitApiServiceV1.class); mApiServiceV2 = null; } else if (version == 2) { mApiServiceV0 = null; mApiServiceV1 = null; mApiServiceV2 = restAdapter.create(RetrofitApiServiceV2.class); } else { mApiServiceV0 = null; mApiServiceV1 = null; mApiServiceV2 = null; throw new IllegalArgumentException("Sorry, only available beackend versions are 0, 1, 2"); } }
Source:
<code>private static OptionalLong fromMetastoreDistinctValuesCount(OptionalLong distinctValuesCount, OptionalLong nullsCount) { if (distinctValuesCount.isPresent() && nullsCount.isPresent()) { if (distinctValuesCount.getAsLong() > 0 && nullsCount.getAsLong() > 0) { return OptionalLong.of(distinctValuesCount.getAsLong() - 1); } return distinctValuesCount; } <START> return OptionalLong.empty(); <END> }</code><technical_language>distinctValuesCount.isPresent() && !nullsCount.isPresent() return absent NDV, while previously returned NDV a error. is return error nothing</technical_language>

Target:
private static OptionalLong fromMetastoreDistinctValuesCount(OptionalLong distinctValuesCount, OptionalLong nullsCount) { if (distinctValuesCount.isPresent() && nullsCount.isPresent() && distinctValuesCount.getAsLong() > 0 && nullsCount.getAsLong() > 0) { return OptionalLong.of(distinctValuesCount.getAsLong() - 1); } return distinctValuesCount; }
Source:
<code>public static void main(String args[]) { if (args.length != 3) { System.out.println("Usage: LogChopper zxid_to_chop_to txn_log_to_chop chopped_filename"); System.out.println(" this program will read the txn_log_to_chop file and copy all the transactions"); System.out.println(" from it up to (and including) the given zxid into chopped_filename."); System.exit(1); } long zxid = Long.decode(args[0]); String txnLog = args[1]; String choppedLog = args[2]; <START> int rc = 2; <END> try ( InputStream is = new BufferedInputStream(new FileInputStream(txnLog)); OutputStream os = new BufferedOutputStream(new FileOutputStream(choppedLog)) ) { if (chop(is, os, zxid)) { rc = 0; } } catch (Exception e) { System.out.println("Got exception: " + e.getMessage()); } System.exit(rc); }</code><technical_language>added ExitCode enum, for exit code</technical_language>

Target:
public static void main(String args[]) { ExitCode rc = ExitCode.INVALID_INVOCATION; if (args.length != 3) { System.out.println("Usage: LogChopper zxid_to_chop_to txn_log_to_chop chopped_filename"); System.out.println(" this program will read the txn_log_to_chop file and copy all the transactions"); System.out.println(" from it up to (and including) the given zxid into chopped_filename."); System.exit(rc.getValue()); } String txnLog = args[1]; String choppedLog = args[2]; try ( InputStream is = new BufferedInputStream(new FileInputStream(txnLog)); OutputStream os = new BufferedOutputStream(new FileOutputStream(choppedLog)) ) { long zxid = Long.decode(args[0]); if (chop(is, os, zxid)) { rc = ExitCode.EXECUTION_FINISHED; } } catch (Exception e) { System.out.println("Got exception: " + e.getMessage()); } System.exit(rc.getValue()); }
Source:
<code><START> public String format(List<Ref> refsToMerge, Ref target) { <END> StringBuilder sb = new StringBuilder(); sb.append("Merge "); List<String> branches = new ArrayList<String>(); List<String> remoteBranches = new ArrayList<String>(); List<String> tags = new ArrayList<String>(); List<String> commits = new ArrayList<String>(); for (Ref ref : refsToMerge) { if (ref.getName().startsWith(Constants.R_HEADS)) { branches.add("'" + getShortName(ref.getName()) + "'"); } else if (ref.getName().startsWith(Constants.R_REMOTES)) { remoteBranches.add("'" + getShortName(ref.getName()) + "'"); } else if (ref.getName().startsWith(Constants.R_TAGS)) { tags.add("'" + getShortName(ref.getName()) + "'"); } else { commits.add("'" + ref.getName() + "'"); } } List<String> listings = new ArrayList<String>(); if (!branches.isEmpty()) { listings.add(joinNames(branches, "branch", "branches")); } if (!remoteBranches.isEmpty()) { listings.add(joinNames(remoteBranches, "remote branch", "remote branches")); } if (!tags.isEmpty()) { listings.add(joinNames(tags, "tag", "tags")); } if (!commits.isEmpty()) { listings.add(joinNames(commits, "commit", "commits")); } sb.append(join(listings, ", ")); String targetShortName = getShortName(target.getName()); if (!targetShortName.equals("master")) { sb.append(" into " + targetShortName); } return sb.toString(); }</code><technical_language>C Git takes in URIish a pull include URL command line performing merge. If merging a remote tracking branch, I if infer URL configuration file. IIRC git gui generates a merge a local tracking branch</technical_language>

Target:
public String format(List<Ref> refsToMerge, Ref target) { StringBuilder sb = new StringBuilder(); sb.append("Merge "); List<String> branches = new ArrayList<String>(); List<String> remoteBranches = new ArrayList<String>(); List<String> tags = new ArrayList<String>(); List<String> commits = new ArrayList<String>(); List<String> others = new ArrayList<String>(); for (Ref ref : refsToMerge) { if (ref.getName().startsWith(Constants.R_HEADS)) branches.add("'" + getShortName(ref.getName()) + "'"); else if (ref.getName().startsWith(Constants.R_REMOTES)) remoteBranches.add("'" + getShortName(ref.getName()) + "'"); else if (ref.getName().startsWith(Constants.R_TAGS)) tags.add("'" + getShortName(ref.getName()) + "'"); else if (ref.getName().equals(ref.getObjectId().getName())) commits.add("'" + ref.getName() + "'"); else others.add(ref.getName()); } List<String> listings = new ArrayList<String>(); if (!branches.isEmpty()) listings.add(joinNames(branches, "branch", "branches")); if (!remoteBranches.isEmpty()) listings.add(joinNames(remoteBranches, "remote branch", "remote branches")); if (!tags.isEmpty()) listings.add(joinNames(tags, "tag", "tags")); if (!commits.isEmpty()) listings.add(joinNames(commits, "commit", "commits")); if (!others.isEmpty()) listings.add(StringUtils.join(others, ", ", " and ")); sb.append(StringUtils.join(listings, ", ")); if (!target.getName().equals(Constants.R_HEADS + Constants.MASTER)) { String targetShortName = getShortName(target.getName()); sb.append(" into " + targetShortName); } return sb.toString(); }
Source:
<code>protected boolean isStereotypedElement(final View view) { boolean result = false; <START> if (view.getElement() instanceof Element && !((Element) view.getElement()).getAppliedStereotypes().isEmpty()) { <END> result = true; } return result; }</code><technical_language>do return of condition</technical_language>

Target:
protected boolean isStereotypedElement(final View view) { return (view.getElement() instanceof Element && !((Element) view.getElement()).getAppliedStereotypes().isEmpty()); }
Source:
<code>protected boolean download(final DownloadableFile downloadableFile) throws Exception { File toDownload = downloadableFile.getLocalFile(); <START> LOG.info("download of " + toDownload + " started at " + new Date()); <END> String url = downloadableFile.url(urlGenerator); final HttpRequestBase request = new HttpGet(url); request.setConfig(RequestConfig.custom().setConnectTimeout(HTTP_TIMEOUT_IN_MILLISECONDS).build()); try (CloseableHttpClient httpClient = httpClientBuilder.build(); CloseableHttpResponse response = httpClient.execute(request)) { LOG.info("got server response at " + new Date()); handleInvalidResponse(response, url); response.getEntity().writeTo(new FileOutputStream(downloadableFile.getLocalFile())); LOG.info("piped the stream to " + downloadableFile + " at " + new Date()); } return true; }</code><technical_language>Capitalize this properly? Also, if a logger, rely timestamp in logger, instead of printing Date</technical_language>

Target:
protected synchronized boolean download(final DownloadableFile downloadableFile) throws Exception { File toDownload = downloadableFile.getLocalFile(); LOG.info("Downloading " + toDownload); String url = downloadableFile.url(urlGenerator); final HttpRequestBase request = new HttpGet(url); request.setConfig(RequestConfig.custom().setConnectTimeout(HTTP_TIMEOUT_IN_MILLISECONDS).build()); try (CloseableHttpClient httpClient = httpClientBuilder.build(); CloseableHttpResponse response = httpClient.execute(request)) { LOG.info("Got server response"); if (response.getEntity() == null) { LOG.error("Unable to read file from the server response"); return false; } handleInvalidResponse(response, url); try (BufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(downloadableFile.getLocalFile()))) { response.getEntity().writeTo(outStream); LOG.info("Piped the stream to " + downloadableFile); } } return true; }
Source:
<code>protected void appendName(ActivityPartition activitypartition, Collection<String> displayValue, StringBuilder sb) { Element represents = activitypartition.getRepresents(); ConnectableElement element = null; if ((activitypartition.getRepresents() instanceof ConnectableElement)) { element = (ConnectableElement) activitypartition.getRepresents(); } String activitypartitionName = UMLLabelInternationalization.getInstance().getLabel(activitypartition); if (element == null) { if (represents != null) { <START> activitypartitionName = ((NamedElement) represents).getName() <END> ; } appendString(sb, activitypartitionName, UNAMED); return; } else { if (displayValue.contains(SHOW_REPRESENT_NAME)) { appendString(sb,UMLLabelInternationalization.getInstance().getLabel( element), UNAMED); } else if (!displayValue.contains(SHOW_REPRESENT_TYPE)) { appendString(sb, activitypartitionName, UNAMED); } } }</code><technical_language>I assume represents a ConnectableElement, is a NamedElement? represents theoretically a non-NamedElement is Element. I this "obsession" ConnectableElement? partitions represents "anything", bother case ConnectableElement. I lifelines in interactions, represents ConnectableElements. partitions is more flexible, represents actors, classes on, lifelines needs represents a property typed actor, class on. I strongly suggest *only* consider represents is a NamedElement not</technical_language>

Target:
protected void appendName(ActivityPartition activitypartition, Collection<String> displayValue, StringBuilder sb) { Element represents = activitypartition.getRepresents(); String activitypartitionName = UMLLabelInternationalization.getInstance().getLabel(activitypartition); if (represents != null) { try { activitypartitionName = ((NamedElement) represents).getName() ; } catch (ClassCastException e) { } } appendString(sb, activitypartitionName, UNAMED); return; }
Source:
<code>void loadUrlDelayed(String url, int delayMs, Command onCompleted) { if (timer_ != null && timer_.isRunning()) timer_.cancel(); onCompleted_ = onCompleted; url_ = url; <START> timer_ = new FrameLoadTimer(); <END> timer_.schedule(delayMs); }</code><technical_language>Minor, avoid creating new timer_s if detect a non-null one? delegate responsibility of construction ChunkOutputFrame class, a final member</technical_language>

Target:
void loadUrlDelayed(String url, int delayMs, Command onCompleted) { if (timer_.isRunning()) timer_.cancel(); onCompleted_ = onCompleted; url_ = url; timer_.schedule(delayMs); }
Source:
<code>private AtomicLong getOrCreateCounter(final String tag, final Map<String, AtomicLong> counterMap) { if (counterMap.containsKey(tag)) { return counterMap.get(tag); } else { <START> final AtomicLong counter = new AtomicLong(0L); <END> counterMap.put(tag, counter); return counter; } }</code><technical_language>is threads execute this block, if a thread execute Map.put write original is null</technical_language>

Target:
private AtomicLong getOrCreateCounter(final String tag, final Map<String, AtomicLong> counterMap) { if (!counterMap.containsKey(tag)) { synchronized (counterMap) { if (!counterMap.containsKey(tag)) { counterMap.put(tag, new AtomicLong(0L)); } } } return counterMap.get(tag); }
Source:
<code>public static UserSqlSandbox getStaticStorage(String username) { <START> PrototypeFactory factory = new PrototypeFactory(new ClassNameHasher()); <END> return new UserSqlSandbox(username); }</code><technical_language>used, out</technical_language>

Target:
public static UserSqlSandbox getStaticStorage(String username) { return new UserSqlSandbox(username); }
Source:
<code>public String getActionProviders(HttpServletRequest request, HttpServletResponse response) throws SecurityServiceException { HttpSession session = httpSessionFactory.getOrCreateSession(request); Object token = ((SecurityTokenHolder) session.getAttribute(SecurityConstants.SECURITY_TOKEN_KEY)) .getPrincipals(); <START> SessionToken sessionToken = new SessionToken(token, session.getId(), "127.0.0.1"); <END> Subject subject = securityManager.getSubject(sessionToken); Map<String, Object> subjectMap = new HashMap<>(); subjectMap.put("http_request", request); subjectMap.put("http_response", response); subjectMap.put(SecurityConstants.SECURITY_SUBJECT, subject); List<Map<String, String>> actionPropertiesList = new ArrayList<>(); for (ActionProvider actionProvider : logoutActionProviders) { Map<String, String> actionProperties = new HashMap<>(); Action action = actionProvider.getAction(subjectMap); if (action != null) { String displayName = SubjectUtils.getName(subject, "", true); actionProperties.put("title", action.getTitle()); actionProperties.put("auth", displayName); actionProperties.put("description", action.getDescription()); actionProperties.put("url", action.getUrl().toString()); actionPropertiesList.add(actionProperties); } } return GSON.toJson(actionPropertiesList); }</code><technical_language>this is in WebSSOFilter</technical_language>

Target:
public String getActionProviders(HttpServletRequest request, HttpServletResponse response) throws SecurityServiceException { HttpSession session = httpSessionFactory.getOrCreateSession(request); Object token = ((SecurityTokenHolder) session.getAttribute(SecurityConstants.SECURITY_TOKEN_KEY)) .getPrincipals(); SessionToken sessionToken = new SessionToken(session.getId(), token, "127.0.0.1"); Subject subject = securityManager.getSubject(sessionToken); Map<String, Object> subjectMap = new HashMap<>(); subjectMap.put("http_request", request); subjectMap.put("http_response", response); subjectMap.put(SecurityConstants.SECURITY_SUBJECT, subject); List<Map<String, String>> actionPropertiesList = new ArrayList<>(); for (ActionProvider actionProvider : logoutActionProviders) { Map<String, String> actionProperties = new HashMap<>(); Action action = actionProvider.getAction(subjectMap); if (action != null) { String displayName = SubjectUtils.getName(subject, "", true); actionProperties.put("title", action.getTitle()); actionProperties.put("auth", displayName); actionProperties.put("description", action.getDescription()); actionProperties.put("url", action.getUrl().toString()); actionPropertiesList.add(actionProperties); } } return GSON.toJson(actionPropertiesList); }