auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static boolean isValidCacheEntry(CachableResponse cachedResponse, MessageContext synCtx) { Map<String, Object> httpHeaders = cachedResponse.getHeaderProperties(); org.apache.axis2.context.MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); String eTagValue = null; boolean isNoCache = false; long maxAge = -1; if (httpHeaders != null) { eTagValue = getETagValue(httpHeaders); if (httpHeaders.get(HttpHeaders.CACHE_CONTROL) != null) { String cacheControlHeaderValue = String.valueOf(httpHeaders.get(HttpHeaders.CACHE_CONTROL)); List<String> cacheControlHeaders = Arrays.asList(cacheControlHeaderValue.split("\\s*,\\s*")); for (String cacheControlHeader : cacheControlHeaders) { <START> if (cacheControlHeader.equalsIgnoreCase(CachingConstants.NO_CACHE_STRING)) { <END> isNoCache = true; } if (cacheControlHeader.contains(CachingConstants.MAX_AGE_STRING)) { maxAge = Long.parseLong(cacheControlHeader.split("=")[1]); } } } } return isCachedResponseExpired(cachedResponse, maxAge) || isValidateResponseWithETag(msgCtx, eTagValue, isNoCache); }</code><technical_language>swap in equals method</technical_language>

Target:
public static boolean isValidCacheEntry(CachableResponse cachedResponse, MessageContext synCtx) { Map<String, Object> httpHeaders = cachedResponse.getHeaderProperties(); org.apache.axis2.context.MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext(); String eTagValue = null; boolean isNoCache = false; long maxAge = -1; if (httpHeaders != null) { eTagValue = getETagValue(httpHeaders); if (httpHeaders.get(HttpHeaders.CACHE_CONTROL) != null) { String cacheControlHeaderValue = String.valueOf(httpHeaders.get(HttpHeaders.CACHE_CONTROL)); List<String> cacheControlHeaders = Arrays.asList(cacheControlHeaderValue.split("\\s*,\\s*")); for (String cacheControlHeader : cacheControlHeaders) { if (CachingConstants.NO_CACHE_STRING.equalsIgnoreCase(cacheControlHeader)) { isNoCache = true; } if (cacheControlHeader.contains(CachingConstants.MAX_AGE_STRING)) { maxAge = Long.parseLong(cacheControlHeader.split("=")[1]); } } } } return isCachedResponseExpired(cachedResponse, maxAge) || isValidateResponseWithETag(msgCtx, eTagValue, isNoCache); }
Source:
<code>public NetworkAttachment mapNetworkAttachment(Map<Guid, NetworkAttachment> attachmentsById, org.ovirt.engine.api.model.NetworkAttachment model) { Mapper<org.ovirt.engine.api.model.NetworkAttachment, NetworkAttachment> networkAttachmentMapper = getMapper(org.ovirt.engine.api.model.NetworkAttachment.class, NetworkAttachment.class); <START> NetworkAttachment attachment = networkAttachmentMapper.map(model, null); <END> if (model.isSetId()) { Guid attachmentId = asGuid(model.getId()); attachment = networkAttachmentMapper.map(model, attachmentsById.get(attachmentId)); } else if (model.isSetNetwork() && (model.getNetwork().isSetName() || model.getNetwork().isSetId())) { for (Map.Entry<Guid, NetworkAttachment> backendNetworkAttachmentMapEntry : attachmentsById.entrySet()) { NetworkAttachment backendNetworkAttachment = backendNetworkAttachmentMapEntry.getValue(); String backendNetworkName = backendNetworkAttachment.getNetworkName(); String backendNetworkId = backendNetworkAttachment.getNetworkId().toString(); if (backendNetworkName.equals(model.getNetwork().getName()) || backendNetworkId.equals(model.getNetwork().getId())) { attachment = networkAttachmentMapper.map(model, backendNetworkAttachment); } } } return attachment; }</code><technical_language>I separate creation of 'from' attachment is for cases creation of 'template' one, e.g: Guid attachmentTemplate = null; if (model.isSetId()) { attachmentTemplate = attachmentsById.get(asGuid(model.getId())); } else if (...) { ... attachmentTemplate = ... } NetworkAttachment attachment = networkAttachmentMapper.map(model, attachmentTemplate);</technical_language>

Target:
public NetworkAttachment mapNetworkAttachment(Map<Guid, NetworkAttachment> attachmentsById, org.ovirt.engine.api.model.NetworkAttachment model) { Mapper<org.ovirt.engine.api.model.NetworkAttachment, NetworkAttachment> networkAttachmentMapper = getMapper(org.ovirt.engine.api.model.NetworkAttachment.class, NetworkAttachment.class); Guid attachmentId = null; if (model.isSetId()) { attachmentId = asGuid(model.getId()); } else if (model.isSetNetwork() && (model.getNetwork().isSetName() || model.getNetwork().isSetId())) { for (Map.Entry<Guid, NetworkAttachment> backendNetworkAttachmentMapEntry : attachmentsById.entrySet()) { NetworkAttachment backendNetworkAttachment = backendNetworkAttachmentMapEntry.getValue(); String backendNetworkName = backendNetworkAttachment.getNetworkName(); String backendNetworkId = backendNetworkAttachment.getNetworkId().toString(); if (backendNetworkName.equals(model.getNetwork().getName()) || backendNetworkId.equals(model.getNetwork().getId())) { attachmentId = backendNetworkAttachment.getId(); break; } } } return networkAttachmentMapper.map(model, attachmentsById.get(attachmentId)); }
Source:
<code>public static Map<String, AutoScaler> mapAutoscalerByCategory(List<AutoScaler> autoScalers) { Map<String, AutoScaler> result = autoScalers.stream().collect(Collectors.groupingBy( ProvisioningUtil::getAutoscalerCategory, Collectors.collectingAndThen(Collectors.toList(), values -> values.get(0)) )); if (result.size() != autoScalers.size()) { <START> log.warn( <END> "Probably autoscalers with duplicated categories were defined. The first instance of each duplicate category will be used."); } return result; }</code><technical_language>add check in DefaultWorkerBehaviorConfig ensure autoscalers duplicate category provided fail? This is a case of user making error in configuration</technical_language>

Target:
public static Map<String, AutoScaler> mapAutoscalerByCategory(List<AutoScaler> autoScalers) { return autoScalers.stream().collect(Collectors.groupingBy( ProvisioningUtil::getAutoscalerCategory, Collectors.collectingAndThen(Collectors.toList(), values -> values.get(0)) )); }
Source:
<code>private static Collection<EClassifierType> searchEClassifierType(IQueryEnvironment queryEnvironment, TypeName targetTypeName) { Collection<EClassifier> found = Sets.newLinkedHashSet(); if (targetTypeName.getPackagePrefix().some()) { String typeName = targetTypeName.getClassifierName(); String name = targetTypeName.getPackagePrefix().get(); <START> found = queryEnvironment.getEPackageProvider().getType(name, typeName); <END> } else { found.add(queryEnvironment.getEPackageProvider().getType(targetTypeName.getClassifierName())); } Collection<EClassifierType> types = Sets.newLinkedHashSet(); for (EClassifier eClassifier : found) { types.add(new EClassifierType(queryEnvironment, eClassifier)); } return types; }</code><technical_language>is some compilation error here. some pending change in AQL</technical_language>

Target:
private static Collection<EClassifierType> searchEClassifierType(IQueryEnvironment queryEnvironment, TypeName targetTypeName) { Collection<EClassifier> found = Sets.newLinkedHashSet(); if (targetTypeName.getPackagePrefix().some()) { String typeName = targetTypeName.getClassifierName(); String name = targetTypeName.getPackagePrefix().get(); found.addAll(queryEnvironment.getEPackageProvider().getTypes(name, typeName)); } else { found.add(queryEnvironment.getEPackageProvider().getType(targetTypeName.getClassifierName())); } Collection<EClassifierType> types = Sets.newLinkedHashSet(); for (EClassifier eClassifier : found) { types.add(new EClassifierType(queryEnvironment, eClassifier)); } return types; }
Source:
<code>public String getSemanticObjectLabel(Object object) { ISemanticObjectLabelProvider <START> itemStyledLabelProvider = <END> (ISemanticObjectLabelProvider)adapterFactory .adapt(object, ISemanticObjectLabelProvider.class); String result; if (itemStyledLabelProvider != null) { result = itemStyledLabelProvider.getSemanticObjectLabel(object); } else if (object == null) { result = ""; } else { result = getText(object); } return result; }</code><technical_language>please update name of this variable</technical_language>

Target:
public String getSemanticObjectLabel(Object object) { ISemanticObjectLabelProvider itemLabelProvider = (ISemanticObjectLabelProvider)adapterFactory .adapt(object, ISemanticObjectLabelProvider.class); String result; if (itemLabelProvider != null) { result = itemLabelProvider.getSemanticObjectLabel(object); } else if (object == null) { result = ""; } else { result = getText(object); } return result; }
Source:
<code>private Editable smileyConvert(Editable input){ <START> if (containSmiley(input, ":)")) { <END> return convert(input,":)", "\uD83D\uDE42"); } else if (containSmiley(input, ":-)")) { return convert(input,":-)", "\uD83D\uDE42"); } else if (containSmiley(input, ":(")) { return convert(input,":(", "\uD83D\uDE41"); } else if (containSmiley(input, ":-(")) { return convert(input,":-(", "\uD83D\uDE41"); } else if (containSmiley(input, ":'(")) { return convert(input,":'(", "\uD83D\uDE22"); } else return input; }</code><technical_language>Please a hash map store emoticon-emoji pairs. potentially allocate (toString) scan (contains+indexOf) text twice. result of indexOf check for string do replace. Remember, a restricted environment. matter modern smartphones 16 cores 4 GB of RAM: batteries fundamentally crap, energy is precious</technical_language>

Target:
private Editable smileyConvert(Editable input){ for (String key:emojiMap.keySet()) { input = convert(input, key, emojiMap.get(key)); } return input; }
Source:
<code>public void test_CreateJobTemplate() throws IOException { try { CreateJobTemplate.createJobTemplate(PROJECT_ID, LOCATION, TEMPLATE_ID); <START> } catch (GoogleJsonResponseException gjre) { } <END> String output = bout.toString(); assertThat(output, containsString(TEMPLATE_NAME)); bout.reset(); }</code><technical_language><LINK_0></technical_language>

Target:
public void test_CreateJobTemplate() throws IOException { CreateJobTemplate.createJobTemplate(PROJECT_ID, LOCATION, TEMPLATE_ID); String output = bout.toString(); assertThat(output, containsString(TEMPLATE_NAME)); bout.reset(); }
Source:
<code>public void controller(@FragmentParam("patient") Patient patient, @FragmentParam("complete") Boolean complete, FragmentModel model, @SpringBean CoreContext emr) { Map<String, Object> calculations = new HashMap<String, Object>(); EncounterService encounterService = Context.getEncounterService(); <START> EncounterType encounterType = encounterService.getEncounterTypeByUuid("3ee036d8-7c13-4393-b5d6-036f2fe45126"); <END> Encounter lastMchEncounter = EmrUtils.lastEncounter(patient, encounterType); Obs lmpObs = EmrUtils.firstObsInEncounter(lastMchEncounter, Dictionary.getConcept(Dictionary.LAST_MONTHLY_PERIOD)); if (lmpObs != null) { int daysDiff = Days.daysBetween(new DateTime(lmpObs.getValueDate()), new DateTime(new Date())).getDays(); calculations.put("gestation", Math.ceil(daysDiff / 7)); } calculations.put("onPmtct", "TODO"); calculations.put("onArv", "TODO"); model.addAttribute("calculations", calculations); Concept medSet = emr.getRegimenManager().getMasterSetConcept("TB"); RegimenChangeHistory history = RegimenChangeHistory.forPatient(patient, medSet); model.addAttribute("regimenHistory", history); }</code><technical_language>This UUID defined a constant in Metadata</technical_language>

Target:
public void controller(@FragmentParam("patient") Patient patient, @FragmentParam("complete") Boolean complete, FragmentModel model, @SpringBean CoreContext emr) { Map<String, Object> calculations = new HashMap<String, Object>(); EncounterService encounterService = Context.getEncounterService(); EncounterType encounterType = encounterService.getEncounterTypeByUuid(Metadata.MCH_ENROLLMENT); Encounter lastMchEncounter = EmrUtils.lastEncounter(patient, encounterType); Obs lmpObs = EmrUtils.firstObsInEncounter(lastMchEncounter, Dictionary.getConcept(Dictionary.LAST_MONTHLY_PERIOD)); if (lmpObs != null) { Weeks weeks = Weeks.weeksBetween(new DateTime(lmpObs.getValueDate()), new DateTime(new Date())); calculations.put("gestation", weeks.getWeeks()); } calculations.put("onPmtct", "TODO"); calculations.put("onArv", "TODO"); model.addAttribute("calculations", calculations); Concept medSet = emr.getRegimenManager().getMasterSetConcept("TB"); RegimenChangeHistory history = RegimenChangeHistory.forPatient(patient, medSet); model.addAttribute("regimenHistory", history); }
Source:
<code>private List<JSONObject> removeStreetDuplicates(List<JSONObject> results, String lang) { List<JSONObject> filteredItems = Lists.newArrayListWithCapacity(results.size()); final HashSet<String> keys = Sets.newHashSet(); for(JSONObject result : results) { final JSONObject properties = result.getJSONObject(Tags.KEY_PROPERTIES); if(properties.has(Tags.KEY_OSM_KEY) && "highway".equals(properties.getString(Tags.KEY_OSM_KEY))) { if(properties.has(OSMTags.KEY_POSTCODE) && properties.has(OSMTags.KEY_NAME)) { String postcode = properties.getString(OSMTags.KEY_POSTCODE); String name = properties.getString(OSMTags.KEY_NAME); String key = postcode + ":" + name; if(keys.contains(key)) { continue; <START> } else if (lang.equals("nl")) { <END> try { String letterlessPostcode = Utils.stripNonDigits(postcode); int postcodeNumbers = Integer.parseInt(letterlessPostcode); boolean foundMatch = false; for (String keyString : keys) { String letterlessKey = Utils.stripNonDigits(keyString); String keyName = keyString.split(":")[1]; if (postcodeNumbers == Integer.parseInt(letterlessKey) && keyName.equals(name)) { foundMatch = true; break; } } if (foundMatch) { continue; } } catch (NumberFormatException e) } keys.add(key); } } filteredItems.add(result); } return filteredItems; }</code><technical_language>I this land in a separate PR</technical_language>

Target:
private List<JSONObject> removeStreetDuplicates(List<JSONObject> results, String lang) { List<JSONObject> filteredItems = Lists.newArrayListWithCapacity(results.size()); final HashSet<String> keys = Sets.newHashSet(); for(JSONObject result : results) { final JSONObject properties = result.getJSONObject(Tags.KEY_PROPERTIES); if(properties.has(Tags.KEY_OSM_KEY) && "highway".equals(properties.getString(Tags.KEY_OSM_KEY))) { if(properties.has(OSMTags.KEY_POSTCODE) && properties.has(OSMTags.KEY_NAME)) { String postcode = properties.getString(OSMTags.KEY_POSTCODE); String name = properties.getString(OSMTags.KEY_NAME); String key = postcode + ":" + name; if(keys.contains(key)) { continue; } keys.add(key); } } filteredItems.add(result); } return filteredItems; }
Source:
<code>private boolean leaveWithoutApplyingDaeChangesDialog(String perspectiveName, Shell shell) { return MessageDialog.openQuestion(shell, "Confirm Leaving " + perspectiveName + " Perspective", "You have unapplied changes in the \"Experiment Setup\" tab, are you sure you want to leave " <START> + "the " + perspectiveName + " perspective? \n\nThese changes are highlighted for you to find."); <END> }</code><technical_language>I say: "You unapplied changes in Experiment Setup tab, want leave <perspectiveName> perspective? changes remain applied" want discard changes leaving perspective? Currently remain in place for navigare back</technical_language>

Target:
private boolean leaveWithoutApplyingDaeChangesDialog(String perspectiveName, Shell shell) { return MessageDialog.openQuestion(shell, "Confirm Leaving " + perspectiveName + " Perspective", "You have unapplied changes in the \"Experiment Setup\" tab, are you sure you want to leave " + "the perspective? \n\nThese changes will remain but will not be applied."); }
Source:
<code>public Optional<FactoryDto> createFactoryFromDevfile( String devfileLocation, @Nullable Function<String, String> fileUrlProvider) throws BadRequestException, ServerException { if (devfileLocation == null) { return Optional.empty(); } final String devfileYamlContent = urlFetcher.fetch(devfileLocation); if (isNullOrEmpty(devfileYamlContent)) { return Optional.empty(); } try { Devfile devfile = devfileManager.parse(devfileYamlContent, false); WorkspaceConfigImpl wsConfig = devfileManager.createWorkspaceConfig( devfile, <START> local -> <END> fileUrlProvider != null ? urlFetcher.fetch(fileUrlProvider.apply(local)) : null); return Optional.of( newDto(FactoryDto.class) .withV(CURRENT_VERSION) .withWorkspace(DtoConverter.asDto(wsConfig))); } catch (DevfileFormatException | DevfileRecipeFormatException e) { throw new BadRequestException(e.getMessage()); } catch (IOException x) { throw new ServerException(x.getLocalizedMessage(), x); } }</code><technical_language>I local in factory module. Consider renaming it</technical_language>

Target:
public Optional<FactoryDto> createFactoryFromDevfile( String devfileLocation, @Nullable Function<String, String> fileUrlProvider) throws BadRequestException, ServerException { if (devfileLocation == null) { return Optional.empty(); } final String devfileYamlContent = urlFetcher.fetchSafely(devfileLocation); if (isNullOrEmpty(devfileYamlContent)) { return Optional.empty(); } try { Devfile devfile = devfileManager.parse(devfileYamlContent, false); WorkspaceConfigImpl wsConfig = devfileManager.createWorkspaceConfig( devfile, filename -> fileUrlProvider != null ? urlFetcher.fetch(fileUrlProvider.apply(filename)) : null); return Optional.of( newDto(FactoryDto.class) .withV(CURRENT_VERSION) .withWorkspace(DtoConverter.asDto(wsConfig))); } catch (DevfileException e) { throw new BadRequestException(e.getMessage()); } catch (IOException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
Source:
<code>public static String getNhinServiceName(List<String> serviceNames) { for (String name : serviceNames) { try { if (StringUtils.isNotBlank(NhincConstants.NHIN_SERVICE_NAMES.fromValueString(name).toString())) { return NhincConstants.NHIN_SERVICE_NAMES.fromValueString(name).getUDDIServiceName(); } <START> } catch(IllegalArgumentException e) { <END> } } return null; }</code><technical_language>![CRITICAL](<LINK_0> 'Severity: CRITICAL') log rethrow this exception. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public static String getNhinServiceName(List<String> serviceNames) { for (String name : serviceNames) { try { if (StringUtils.isNotBlank(NhincConstants.NHIN_SERVICE_NAMES.fromValueString(name).toString())) { return NhincConstants.NHIN_SERVICE_NAMES.fromValueString(name).getUDDIServiceName(); } } catch(IllegalArgumentException e) { LOG.debug(e.getMessage()); } } return null; }
Source:
<code>protected String cleanQuery(String query) { query = query.trim(); <START> return query.endsWith(";") ? query.substring(0, query.length() - 1) : query; <END> }</code><technical_language>do handle multiple semi-colons? is overkill? Also, is problem semicolons a set of characters end</technical_language>

Target:
protected String cleanQuery(String query) { query = query.trim(); int idx = query.length() - 1; char currChar = query.charAt(idx); while (idx > 0 && currChar == ';' || Character.isWhitespace(currChar)) { idx--; currChar = query.charAt(idx); } if (idx == 0) { return ""; } return query.substring(0, idx + 1); }
Source:
<code>private boolean canCastFrom(SqlCallBinding callBinding, boolean throwOnFailure, RelDataType inType, RelDataType outType) { <START> if (!SqlTypeUtil.canCastFrom(outType, inType, true)) { <END> if (throwOnFailure) { throw callBinding.newError( RESOURCE.cannotCastValue(inType.toString(), outType.toString())); } return false; } return true; }</code><technical_language>Please invert if condition put shorter branches top in cases that. is heavily nested code: if (canCastFrom){ return true; } if (!throwOnFailure) { return false; } throw ..</technical_language>

Target:
private boolean canCastFrom(SqlCallBinding callBinding, boolean throwOnFailure, RelDataType inType, RelDataType outType) { if (SqlTypeUtil.canCastFrom(outType, inType, true)) { return true; } if (throwOnFailure) { throw callBinding.newError( RESOURCE.cannotCastValue(inType.toString(), outType.toString())); } return false; }
Source:
<code>public void removeLocationUpdates(PendingIntent callbackIntent) { intentToRequest.remove(callbackIntent); <START> if (intentToRequest.isEmpty()) { <END> locationEngine.setRequest(null); } }</code><technical_language>check listenerToRequest is null setting engine's request null? check intentToRequest is null in L65? feels slightly wrong stop receiving location updates in engine if listeners pending requests (and vice versa)</technical_language>

Target:
public void removeLocationUpdates(PendingIntent callbackIntent) { intentToRequest.remove(callbackIntent); checkAllListenersAndPendingIntents(); }
Source:
<code>public boolean isSecretSocketSupported() { return this.newerThanEquals(SPARK_2_3_1) || (this.newerThanEquals(SparkVersion.fromVersionString("2.2.2")) && this.olderThan(SparkVersion.fromVersionString("2.3.0"))) || (this.newerThanEquals(SparkVersion.fromVersionString("2.1.3")) && <START> this.olderThan(SparkVersion.fromVersionString("2.2.0"))); <END> }</code><technical_language>I this works, if if evaluated in order, is a bit error prone. worthwhile add a newerThanEqualsPatchVersion for 2.2.[2+] type of check</technical_language>

Target:
public boolean isSecretSocketSupported() { return this.newerThanEquals(SparkVersion.SPARK_2_4_0) || this.newerThanEqualsPatchVersion(SPARK_2_3_1) || this.newerThanEqualsPatchVersion(SparkVersion.fromVersionString("2.2.2")) || this.newerThanEqualsPatchVersion(SparkVersion.fromVersionString("2.1.3")); }
Source:
<code>public Map<String, Object> apply(final Map<String, CustomAttribute> intercomCustomAttributes) { if (intercomCustomAttributes == null) { return null; } final Map<String, Object> customAttributes = new HashMap<>(); intercomCustomAttributes.entrySet().stream().forEach(entry -> { final String key = entry.getKey(); final CustomAttribute value = entry.getValue(); if (value == null || value.getValue() == null) { customAttributes.put(key, null); } else if (value.getValueClass().equals(Boolean.class)) { <START> customAttributes.put(key, (new Boolean(value.booleanValue()))); <END> } else if (value.getValueClass().equals(Integer.class)) { customAttributes.put(key, (new Integer(value.integerValue()))); } else if (value.getValueClass().equals(Double.class)) { customAttributes.put(key, (value.doubleValue())); } else if (value.getValueClass().equals(Long.class)) { customAttributes.put(key, (value.longValue())); } else if (value.getValueClass().equals(Float.class)) { customAttributes.put(key, (value.floatValue())); } else if (value.getValueClass().equals(String.class)) { customAttributes.put(key, (value.textValue())); } else { logger.warn("Unsupported custom attribute class : {}", value.getValueClass().getSimpleName()); } }); return customAttributes; }</code><technical_language>Do need do explicit creation of new Boolean</technical_language>

Target:
public Map<String, Object> apply(final Map<String, CustomAttribute> intercomCustomAttributes) { if (intercomCustomAttributes == null) { return null; } final Map<String, Object> customAttributes = new HashMap<>(); intercomCustomAttributes.entrySet().stream().forEach(entry -> { final String key = entry.getKey(); final CustomAttribute value = entry.getValue(); if (value == null || value.getValue() == null) { customAttributes.put(key, null); } else if (value.getValueClass().equals(Boolean.class)) { customAttributes.put(key, (value.booleanValue())); } else if (value.getValueClass().equals(Integer.class)) { customAttributes.put(key, (value.integerValue())); } else if (value.getValueClass().equals(Double.class)) { customAttributes.put(key, (value.doubleValue())); } else if (value.getValueClass().equals(Long.class)) { customAttributes.put(key, (value.longValue())); } else if (value.getValueClass().equals(Float.class)) { customAttributes.put(key, (value.floatValue())); } else if (value.getValueClass().equals(String.class)) { customAttributes.put(key, (value.textValue())); } else { logger.warn("Unsupported custom attribute class : {}", value.getValueClass().getSimpleName()); } }); return customAttributes; }
Source:
<code>protected synchronized boolean enterClosedState() { if (!state.equals(Closed)) { try { enterState(null, Closed); <START> } catch (IllegalStateException ignored) { <END> } return true; } else { return false; } }</code><technical_language>If I understand correctly, this throw exception a bug in code. Is IllegalStateException thrown sooner</technical_language>

Target:
protected synchronized boolean enterClosedState() { if (!state.equals(Closed)) { enterState(null, Closed); return true; } else { return false; } }
Source:
<code>public HttpRequestBase formatRequest() { URIBuilder uriBuilder = getRepository().getURIBuilder(fAuthIsRequired); URI uri = null; try { <START> String file = URLEncoder.encode(gettargetFile(), "UTF-8"); <END> String path = new StringBuilder(uriBuilder.getPath()).append("/projects/") .append(getProject_Name()) .append("/branches/") .append(getBranch_id()) .append("/files/") .append(gettargetFile()) .append("/content") .toString(); uriBuilder.setPath(path); uri = new URI(URIUtil.toUnencodedString(uriBuilder.build())); } catch (URISyntaxException | UnsupportedEncodingException e) { EGerritCorePlugin.logError("URI syntax exception", e); } return new HttpGet(uri); }</code><technical_language>Apparently, need pass</technical_language>

Target:
public HttpRequestBase formatRequest() { URIBuilder uriBuilder = getRepository().getURIBuilder(fAuthIsRequired); URI uri = null; try { String file = URLEncoder.encode(gettargetFile(), "UTF-8"); String project = URLEncoder.encode(getProject_Name(), "UTF-8"); String path = new StringBuilder(uriBuilder.getPath()).append("/projects/") .append(project) .append("/branches/") .append(getBranch_id()) .append("/files/") .append(file) .append("/content") .toString(); uriBuilder.setPath(path); uri = new URI(URIUtil.toUnencodedString(uriBuilder.build())); } catch (URISyntaxException | UnsupportedEncodingException e) { EGerritCorePlugin.logError("URI syntax exception", e); } return new HttpGet(uri); }
Source:
<code>public boolean containsKey(Object key){ <START> return cache.containsKey(key); <END> }</code><technical_language>in cache, need if this loaded also. is a persistedCache, is persistedCache a subset of ache do need both</technical_language>

Target:
public boolean containsKey(Object key){ if(cache != null) return cache.containsKey(key); else return false; }
Source:
<code>public void testEquals() { int size1 = 12345; LongObjectId id1 = LongObjectIdTestUtils.hash("test").toObjectId(); LargeObjectPointer pointer1 = new LargeObjectPointer(id1, size1); assertTrue("pointer should equal itself", pointer1.equals(pointer1)); LargeObjectPointer pointer2 = new LargeObjectPointer(id1, size1); assertEquals("objects should be equals", pointer1, pointer2); LongObjectId id2 = LongObjectIdTestUtils.hash("other").toObjectId(); pointer2 = new LargeObjectPointer(id2, size1); assertNotEquals("objects with different id should be not equal", pointer1, pointer2); pointer2 = new LargeObjectPointer(id1, 54321); assertNotEquals("objects with <START> size id should <END> be not equal", pointer1, pointer2); }</code><technical_language>s/size id/different size/</technical_language>

Target:
public void testEquals() { int size1 = 12345; LongObjectId id1 = LongObjectIdTestUtils.hash("test").toObjectId(); LargeObjectPointer pointer1 = new LargeObjectPointer(id1, size1); assertTrue("pointer should equal itself", pointer1.equals(pointer1)); LargeObjectPointer pointer2 = new LargeObjectPointer(id1, size1); assertEquals("objects should be equals", pointer1, pointer2); LongObjectId id2 = LongObjectIdTestUtils.hash("other").toObjectId(); pointer2 = new LargeObjectPointer(id2, size1); assertNotEquals("objects with different id should be not equal", pointer1, pointer2); pointer2 = new LargeObjectPointer(id1, 54321); assertNotEquals("objects with different size should be not equal", pointer1, pointer2); }
Source:
<code>public synchronized void resetMemoryRevokingRequested() { <START> MemoryRevokingRequestedFuture<?> currentFuture = memoryRevokingRequestedFuture; <END> if (!currentFuture.isDone()) { return; } memoryRevokingRequestedFuture.setFuture(SettableFuture.create()); }</code><technical_language>need for local variable? field is effectively final now</technical_language>

Target:
public synchronized void resetMemoryRevokingRequested() { memoryRevokingRequested = false; }
Source:
<code>private boolean isGrantedPersonalPermission(Authentication authentication, Permission permission, boolean isCheckAllowedGrant) { UserInfo principal = (UserInfo) authentication.getPrincipal(); <START> JCUser actualUser = userDao.get(principal.getId()); <END> if (actualUser == null) { LOGGER.warn("{} : User #{} not found", this.getClass().getCanonicalName(), principal.getId()); return !isCheckAllowedGrant; } List<Group> groups = actualUser.getGroups(); for (Group group : groups) { ObjectIdentity groupIdentity = aclUtil.createIdentity(group.getId(), "GROUP"); Sid groupSid = sidFactory.create(group); List<AccessControlEntry> groupAces; try { groupAces = ExtendedMutableAcl.castAndCreate( mutableAclService.readAclById(groupIdentity)).getEntries(); } catch (NotFoundException nfe) { groupAces = new ArrayList<>(); } if (isGrantedForSid(groupSid, groupAces, permission, isCheckAllowedGrant)) { return true; } } return false; }</code><technical_language>need service here, you</technical_language>

Target:
private boolean isGrantedPersonalPermission(Authentication authentication, Permission permission, boolean isCheckAllowedGrant) { JCUser jcUser = securityService.getFullUserInfoFrom(authentication); if (jcUser == null) return false; List<Group> groups = jcUser.getGroups(); for (Group group : groups) { ObjectIdentity groupIdentity = aclUtil.createIdentity(group.getId(), "GROUP"); Sid groupSid = sidFactory.create(group); List<AccessControlEntry> groupAces; try { groupAces = ExtendedMutableAcl.castAndCreate( mutableAclService.readAclById(groupIdentity)).getEntries(); } catch (NotFoundException nfe) { groupAces = new ArrayList<>(); } if (isGrantedForSid(groupSid, groupAces, permission, isCheckAllowedGrant)) { return true; } } return false; }
Source:
<code>public MailConfig(JsonObject config) { hostname = config.getString("hostname", DEFAULT_HOST); port = config.getInteger("port", DEFAULT_PORT); String starttlsOption = config.getString("starttls"); if (starttlsOption != null) { starttls = StarttlsOption.valueOf(starttlsOption.toUpperCase(Locale.ENGLISH)); } String loginOption = config.getString("login"); if (loginOption != null) { login = LoginOption.valueOf(loginOption.toUpperCase(Locale.ENGLISH)); } username = config.getString("username"); password = config.getString("password"); Boolean sslOption = config.getBoolean("ssl"); <START> if (sslOption != null) { <END> ssl = sslOption; } }</code><technical_language>config.getBoolean("ssl", false)</technical_language>

Target:
public MailConfig(JsonObject config) { hostname = config.getString("hostname", DEFAULT_HOST); port = config.getInteger("port", DEFAULT_PORT); String starttlsOption = config.getString("starttls"); if (starttlsOption != null) { starttls = StarttlsOption.valueOf(starttlsOption.toUpperCase(Locale.ENGLISH)); } String loginOption = config.getString("login"); if (loginOption != null) { login = LoginOption.valueOf(loginOption.toUpperCase(Locale.ENGLISH)); } username = config.getString("username"); password = config.getString("password"); ssl = config.getBoolean("ssl", false); }
Source:
<code>private void sendGarbage() { GarbageBatch garbageBatch = null; <START> try { <END> while ((garbageBatch = garbageSendingDeque.poll()) != null) { garbageBatch.sendToLogUnits(); } } catch (Exception e) { log.error("Caught exception in the write processor.", e); if (garbageBatch != null) { garbageSendingDeque.addFirst(garbageBatch); } } }</code><technical_language>clear this</technical_language>

Target:
private void sendGarbage() { GarbageBatch garbageBatch = null; try { while ((garbageBatch = garbageSendingDeque.poll()) != null) { sendGarbageBatch(garbageBatch); } } catch (Exception e) { log.error("GarbageInformer: Caught exception in the write processor.", e); if (garbageBatch != null) { garbageSendingDeque.addFirst(garbageBatch); } } }
Source:
<code><START> public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity entityLiving) { <END> Random rand = new Random(); int num = rand.nextInt(10); ItemStack crumbs = new ItemStack(MSItems.BREADCRUMBS, num); if(entityLiving instanceof PlayerEntity && !entityLiving.world.isRemote) { PlayerEntity entityplayer = (PlayerEntity)entityLiving; entityplayer.addItemStackToInventory(crumbs); } return super.onItemUseFinish(stack, worldIn, entityLiving); }</code><technical_language>In some other cases, this is for functionality item eaten similarily. Is case here? if so, baguettes edible</technical_language>

Target:
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity entityLiving) { if(entityLiving instanceof PlayerEntity && !entityLiving.world.isRemote) { Random rand = new Random(); int num = rand.nextInt(10); ItemStack crumbs = new ItemStack(MSItems.BREADCRUMBS, num); PlayerEntity entityplayer = (PlayerEntity)entityLiving; entityplayer.addItemStackToInventory(crumbs); } return super.onItemUseFinish(stack, worldIn, entityLiving); }
Source:
<code>static String getBackupFilenameFromStat(Stat stat) { long mtime = stat.getMtime(); String timestamp = LocalDateTime.ofEpochSecond(mtime / 1000, 0, zoneOffset).format(TIMESTAMP_FORMATTER); String fileName = stat.getVersion() + SEP + timestamp; <START> return fileName; <END> }</code><technical_language>fileName is unnecessary, return stat.getVersion() + SEP + timestamp</technical_language>

Target:
static String getBackupFilenameFromStat(Stat stat) { long mtimeInMs = stat.getMtime(); String timestamp = LocalDateTime.ofEpochSecond(mtimeInMs / 1000, 0, zoneOffset).format(TIMESTAMP_FORMATTER); return stat.getVersion() + SEP + timestamp; }
Source:
<code>private void createProblemAttributes(Composite parent) { new Label(parent, SWT.NONE).setText(MarkerMessages.propertiesDialog_severityLabel); Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout(layout); Label severityImage = new Label(composite, SWT.NONE); severityImage.setImage(Util.getImage(marker.getAttribute(IMarker.SEVERITY, -1))); Text severityLabel = new Text(composite, <START> SWT.NONE); <END> severityLabel.setBackground(severityLabel.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); int severity = marker.getAttribute(IMarker.SEVERITY, -1); if (severity == IMarker.SEVERITY_ERROR) { severityLabel.setText(MarkerMessages.propertiesDialog_errorLabel); } else if (severity == IMarker.SEVERITY_WARNING) { severityLabel.setText(MarkerMessages.propertiesDialog_warningLabel); } else if (severity == IMarker.SEVERITY_INFO) { severityLabel.setText(MarkerMessages.propertiesDialog_infoLabel); } else { severityLabel.setText(MarkerMessages.propertiesDialog_noseverityLabel); } }</code><technical_language>READ_ONLY</technical_language>

Target:
private void createProblemAttributes(Composite parent) { new Label(parent, SWT.NONE).setText(MarkerMessages.propertiesDialog_severityLabel); Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginWidth = 0; layout.marginHeight = 0; composite.setLayout(layout); Label severityImage = new Label(composite, SWT.NONE); severityImage.setImage(Util.getImage(marker.getAttribute(IMarker.SEVERITY, -1))); Text severityLabel = createReadOnlyText(composite); int severity = marker.getAttribute(IMarker.SEVERITY, -1); if (severity == IMarker.SEVERITY_ERROR) { severityLabel.setText(MarkerMessages.propertiesDialog_errorLabel); } else if (severity == IMarker.SEVERITY_WARNING) { severityLabel.setText(MarkerMessages.propertiesDialog_warningLabel); } else if (severity == IMarker.SEVERITY_INFO) { severityLabel.setText(MarkerMessages.propertiesDialog_infoLabel); } else { severityLabel.setText(MarkerMessages.propertiesDialog_noseverityLabel); } }
Source:
<code>public User permanentlyDeleteUser(User user) { checkHasId(user); <START> deleteUser(user.getId()); <END> return permanentlyDeleteUser(user.getId()); }</code><technical_language>issue here, double delete user</technical_language>

Target:
public User permanentlyDeleteUser(User user) { checkHasId(user); return permanentlyDeleteUser(user.getId()); }
Source:
<code>public int getStreams() { <START> return streams; <END> }</code><technical_language>note: want coerce empty null people set null properties. I add a static method for this called emptyToNull</technical_language>

Target:
public Integer getStreams() { return streams; }
Source:
<code>public final void read() throws IOException { final SocketChannel channel = (SocketChannel)key.channel(); final ByteBuffer buffer = buffer(); final int read = channel.read(buffer); if (read > 0) { this.read(read); } else if (read == -1) { try { channel.close(); } finally { disconnected(); unregistered(key); } <START> } else if (buffer.remaining() > 0) { <END> logger.error("{} read bytes into byte buffer {}", this, read, buffer); } else { suspendReadIfResumed(); } }</code><technical_language>This condition for read = 0 it? for readability group a single else sub-conditions</technical_language>

Target:
public final void read() throws IOException { final SocketChannel channel = (SocketChannel)key.channel(); final ByteBuffer buffer = buffer(); final int read = channel.read(buffer); if (read > 0) { this.read(read); } else if (read == -1) { try { channel.close(); } finally { disconnected(); unregistered(key); } } else { if (buffer.remaining() > 0) { logger.error("{} read bytes into byte buffer {}", this, read, buffer); } else { suspendReadIfResumed(); } } }
Source:
<code>private MapBlock( int startOffset, int positionCount, @Nullable boolean[] mapIsNull, int[] offsets, Block keyBlock, Block valueBlock, @Nullable int[] hashTables, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode) { super(keyType, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode); if (hashTables != null && hashTables.length < keyBlock.getPositionCount() * HASH_MULTIPLIER) { throw new IllegalArgumentException(format("keyBlock/valueBlock size does not match hash table size: %s %s", keyBlock.getPositionCount(), hashTables.length)); } this.startOffset = startOffset; this.positionCount = positionCount; this.mapIsNull = mapIsNull; this.offsets = offsets; this.keyBlock = keyBlock; this.valueBlock = valueBlock; this.hashTables = hashTables; this.sizeInBytes = -1; this.retainedSizeInBytes = INSTANCE_SIZE + keyBlock.getRetainedSizeInBytes() + valueBlock.getRetainedSizeInBytes() + sizeOf(offsets) + sizeOf(mapIsNull) <START> + sizeOfIntArray(offsets[positionCount] * HASH_MULTIPLIER); END> }</code><technical_language>please include rationale</technical_language>

Target:
private MapBlock( int startOffset, int positionCount, @Nullable boolean[] mapIsNull, int[] offsets, Block keyBlock, Block valueBlock, @Nullable int[] hashTables, Type keyType, MethodHandle keyBlockNativeEquals, MethodHandle keyNativeHashCode, MethodHandle keyBlockHashCode) { super(keyType, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode); if (hashTables != null && hashTables.length < keyBlock.getPositionCount() * HASH_MULTIPLIER) { throw new IllegalArgumentException(format("keyBlock/valueBlock size does not match hash table size: %s %s", keyBlock.getPositionCount(), hashTables.length)); } this.startOffset = startOffset; this.positionCount = positionCount; this.mapIsNull = mapIsNull; this.offsets = offsets; this.keyBlock = keyBlock; this.valueBlock = valueBlock; this.hashTables = hashTables; this.sizeInBytes = -1; this.retainedSizeInBytes = INSTANCE_SIZE + keyBlock.getRetainedSizeInBytes() + valueBlock.getRetainedSizeInBytes() + sizeOf(offsets) + sizeOf(mapIsNull) + sizeOfIntArray(keyBlock.getPositionCount() * HASH_MULTIPLIER); }
Source:
<code>boolean displayVersion(CommandSender sender) { <START> final PluginManager pm = Bukkit.getServer().getPluginManager(); <END> List<String> hooks = plugin.getDescription().getSoftDepend(); String tardisversion = plugin.getPM().getPlugin("TARDIS").getDescription().getVersion(); String chunkversion = plugin.getPM().getPlugin("TARDISChunkGenerator").getDescription().getVersion(); String cb = Bukkit.getVersion(); String bv = Bukkit.getBukkitVersion(); sender.sendMessage(plugin.getPluginName() + "Server version: " + ChatColor.AQUA + bv + " " + cb); sender.sendMessage(plugin.getPluginName() + "TARDIS version: " + ChatColor.AQUA + tardisversion); sender.sendMessage(plugin.getPluginName() + "TARDISChunkGenerator version: " + ChatColor.AQUA + chunkversion); for (Plugin hook : pm.getPlugins()) { final PluginDescriptionFile desc = hook.getDescription(); String name = desc.getName(); String version = desc.getVersion(); if(hooks.contains(name) && !name.equals("TARDISChunkGenerator")) { sender.sendMessage(plugin.getPluginName() + name + " version: " + ChatColor.AQUA + version); } } return true; }</code><technical_language>yup</technical_language>

Target:
boolean displayVersion(CommandSender sender) { String pluginName = plugin.getPluginName(); List<String> hooks = plugin.getDescription().getSoftDepend(); String tardisversion = plugin.getDescription().getVersion(); String chunkversion = plugin.getPM().getPlugin("TARDISChunkGenerator").getDescription().getVersion(); String cb = Bukkit.getVersion(); String bv = Bukkit.getBukkitVersion(); sender.sendMessage(pluginName + "Server version: " + ChatColor.AQUA + bv + " " + cb); sender.sendMessage(pluginName + "TARDIS version: " + ChatColor.AQUA + tardisversion); sender.sendMessage(pluginName + "TARDISChunkGenerator version: " + ChatColor.AQUA + chunkversion); for (Plugin hook : plugin.getPM().getPlugins()) { PluginDescriptionFile desc = hook.getDescription(); String name = desc.getName(); String version = desc.getVersion(); if(hooks.contains(name)) { sender.sendMessage(pluginName + name + " version: " + ChatColor.AQUA + version); } } return true; }
Source:
<code>private void handleVmDeviceChange() { List<String> vmsToUpdate = new ArrayList<String>(); <START> for (java.util.Map.Entry<VmDynamic, VmStatistics> vm_helper : _runningVms.values()) { <END> VmDynamic vm = vm_helper.getKey(); String dbHash = _vmDict.get(vm.getId()).getHash(); if ((dbHash == null && vm.getHash() != null) || !dbHash.equals(vm.getHash())) { vmsToUpdate.add(vm.getId().toString()); vm.setHash(vm.getHash()); AddVmDynamicToList(vm); } } if (vmsToUpdate.size() > 0) { updateVmDevices(vmsToUpdate); } }</code><technical_language>* need for java.util.prefix required * user proper java naming convention vm_helper --> vmHelper</technical_language>

Target:
private void handleVmDeviceChange() { List<String> vmsToUpdate = new ArrayList<String>(); for (Map.Entry<VmDynamic, VmStatistics> vmHelper : _runningVms.values()) { VmDynamic vmDynamic = vmHelper.getKey(); if (vmDynamic != null) { VM vm = _vmDict.get(vmDynamic.getId()); if (vm != null) { String dbHash = vm.getHash(); if ((dbHash == null && vmDynamic.getHash() != null) || !dbHash.equals(vmDynamic.getHash())) { vmsToUpdate.add(vmDynamic.getId().toString()); if (_vmDynamicToSave.containsKey(vm.getId())) { _vmDynamicToSave.get(vm.getId()).setHash(vmDynamic.getHash()); } else { vmDynamic.setHash(vmDynamic.getHash()); AddVmDynamicToList(vmDynamic); } } } } } if (vmsToUpdate.size() > 0) { updateVmDevices(vmsToUpdate); } }
Source:
<code>public List<NodeTopologyEntity> getNodeTopologyEntities() { <START> final OnmsCriteria criteria = new OnmsCriteria(OnmsNode.class); <END> criteria.createAlias("ipInterfaces","iface", OnmsCriteria.LEFT_JOIN); criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); criteria.resultsOfType(OnmsNode.class); final HibernateCallback<List<OnmsNode>> callback = new HibernateCallback<List<OnmsNode>>() { @Override public List<OnmsNode> doInHibernate(final Session session) throws HibernateException, SQLException { final Criteria attachedCrit = criteria.getDetachedCriteria().getExecutableCriteria(session); if (criteria.getFirstResult() != null) attachedCrit.setFirstResult(criteria.getFirstResult()); if (criteria.getMaxResults() != null) attachedCrit.setMaxResults(criteria.getMaxResults()); return (List<OnmsNode>)attachedCrit.list(); } }; return getHibernateTemplate().execute(callback).stream().map(NodeTopologyEntity::create).collect(Collectors.toList()); }</code><technical_language>want test slower this join is compared reading table</technical_language>

Target:
public List<NodeTopologyEntity> getNodeTopologyEntities() { return (List<NodeTopologyEntity>)getHibernateTemplate().find( "select new org.opennms.netmgt.enlinkd.model.NodeTopologyEntity(n.id, n.type, n.sysObjectId, n.label, n.location) from org.opennms.netmgt.model.OnmsNode n"); }
Source:
<code>private Map<TopicPartition, Long> checkpointableOffsets() { <START> if (state() == State.RESTORING) { <END> return Collections.emptyMap(); } final Map<TopicPartition, Long> checkpointableOffsets = new HashMap<>(recordCollector.offsets()); for (final Map.Entry<TopicPartition, Long> entry : consumedOffsets.entrySet()) { checkpointableOffsets.putIfAbsent(entry.getKey(), entry.getValue()); } return checkpointableOffsets; }</code><technical_language>return emptyMap if SUSPENDED well</technical_language>

Target:
private Map<TopicPartition, Long> checkpointableOffsets() { final Map<TopicPartition, Long> checkpointableOffsets = new HashMap<>(recordCollector.offsets()); for (final Map.Entry<TopicPartition, Long> entry : consumedOffsets.entrySet()) { checkpointableOffsets.putIfAbsent(entry.getKey(), entry.getValue()); } return checkpointableOffsets; }
Source:
<code>public FormValidation doSendTestMail( @QueryParameter String smtpHost, @QueryParameter String adminAddress, @QueryParameter boolean authentication, @QueryParameter String username, @QueryParameter Secret password, @QueryParameter boolean useSsl, @QueryParameter boolean useTls, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException { try { <START> Jenkins.get().checkPermission(Jenkins.ADMINISTER); <END> if (!authentication) { username = null; password = null; } MimeMessage msg = new MimeMessage(createSession(smtpHost, smtpPort, useSsl, useTls, username, password)); msg.setSubject(Messages.Mailer_TestMail_Subject(testEmailCount.incrementAndGet()), charset); msg.setText(Messages.Mailer_TestMail_Content(testEmailCount.get(), Jenkins.get().getDisplayName()), charset); msg.setFrom(stringToAddress(adminAddress, charset)); if (StringUtils.isNotBlank(replyToAddress)) { msg.setReplyTo(new Address[]{stringToAddress(replyToAddress, charset)}); } msg.setSentDate(new Date()); msg.setRecipient(Message.RecipientType.TO, stringToAddress(sendTestMailTo, charset)); Transport.send(msg); return FormValidation.ok(Messages.Mailer_EmailSentSuccessfully()); } catch (MessagingException e) { return FormValidation.errorWithMarkup("<p>"+Messages.Mailer_FailedToSendEmail()+"</p><pre>"+Util.escape(Functions.printThrowable(e))+"</pre>"); } }</code><technical_language>this MANAGE? button do this action is displayed MANAGE changes in jelly file</technical_language>

Target:
public FormValidation doSendTestMail( @QueryParameter String smtpHost, @QueryParameter String adminAddress, @QueryParameter boolean authentication, @QueryParameter String username, @QueryParameter Secret password, @QueryParameter boolean useSsl, @QueryParameter boolean useTls, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException { try { Jenkins.get().checkPermission(DescriptorImpl.getJenkinsManageOrAdmin()); if (!authentication) { username = null; password = null; } MimeMessage msg = new MimeMessage(createSession(smtpHost, smtpPort, useSsl, useTls, username, password)); msg.setSubject(Messages.Mailer_TestMail_Subject(testEmailCount.incrementAndGet()), charset); msg.setText(Messages.Mailer_TestMail_Content(testEmailCount.get(), Jenkins.get().getDisplayName()), charset); msg.setFrom(stringToAddress(adminAddress, charset)); if (StringUtils.isNotBlank(replyToAddress)) { msg.setReplyTo(new Address[]{stringToAddress(replyToAddress, charset)}); } msg.setSentDate(new Date()); msg.setRecipient(Message.RecipientType.TO, stringToAddress(sendTestMailTo, charset)); Transport.send(msg); return FormValidation.ok(Messages.Mailer_EmailSentSuccessfully()); } catch (MessagingException e) { return FormValidation.errorWithMarkup("<p>"+Messages.Mailer_FailedToSendEmail()+"</p><pre>"+Util.escape(Functions.printThrowable(e))+"</pre>"); } }