auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<QuotaVdsGroup> getQuotaVdsGroups(int vCpu, int vCpuUsed, long mem, long memUsed) { ArrayList<QuotaVdsGroup> quotaVdsGroups = new ArrayList<QuotaVdsGroup>(); quotaVdsGroups.add(getQuotaVdsGroup(UNLIMITED_VCPU, 0, UNLIMITED_MEM, 0)); quotaVdsGroups.add(getQuotaVdsGroup(10, 2, 1000, 100)); <START> quotaVdsGroups.get(0).setVdsGroupId(new Guid()); <END> quotaVdsGroups.get(1).setVdsGroupId(new Guid()); quotaVdsGroups.add(getQuotaVdsGroup(vCpu, vCpuUsed, mem, memUsed)); return quotaVdsGroups; }</code><technical_language>s/new Guid/Guid.NewGuid/</technical_language>

Target:
private List<QuotaVdsGroup> getQuotaVdsGroups(int vCpu, int vCpuUsed, long mem, long memUsed) { ArrayList<QuotaVdsGroup> quotaVdsGroups = new ArrayList<QuotaVdsGroup>(); quotaVdsGroups.add(getQuotaVdsGroup(UNLIMITED_VCPU, 0, UNLIMITED_MEM, 0)); quotaVdsGroups.add(getQuotaVdsGroup(10, 2, 1000, 100)); quotaVdsGroups.get(0).setVdsGroupId(Guid.NewGuid()); quotaVdsGroups.get(1).setVdsGroupId(Guid.NewGuid()); quotaVdsGroups.add(getQuotaVdsGroup(vCpu, vCpuUsed, mem, memUsed)); return quotaVdsGroups; }
Source:
<code>public Account verify(String id, Credential credential) { if (!(credential instanceof PasswordCredential)) { return null; } PasswordCredential passwordCredential = (PasswordCredential) credential; KieServerInstanceAccount account = getAccount(id); String challenge = HashUtil.hash(id, new String(passwordCredential.getPassword())); if (account != null && challenge.equals(account.getHash())) { <START> log.infof("Authentication succesfully for %1$2", id); <END> return account; } log.infof("Authentication failed for %1$2", id); return null; }</code><technical_language>suggestion log.infof("Authentication succesfully for %1$s", id);</technical_language>

Target:
public Account verify(String id, Credential credential) { if (!(credential instanceof PasswordCredential)) { return null; } PasswordCredential passwordCredential = (PasswordCredential) credential; KieServerInstanceAccount account = getAccount(id); String challenge = HashUtil.hash(id, new String(passwordCredential.getPassword())); if (account != null && challenge.equals(account.getHash())) { log.infof("Authentication succesfully for %1$s", id); return account; } log.infof("Authentication failed for %1$s", id); return null; }
Source:
<code>private void addData(TreeSet<Data> data) { if (distributed) { data = filterIncomingDataForNode(data); } if (engineExtensions) { data = processDataExtensions(data); } synchronized (pendingData) { if (log.isDebugEnabled()) { log.debugf("Adding [%s] to pendingData [%s]", data, pendingData); <START> } <END> pendingData.addAll(data); } }</code><technical_language>trivial: remove isDebugEnabled wrapper</technical_language>

Target:
private void addData(TreeSet<Data> data) { if (distributed) { data = filterIncomingDataForNode(data); } if (engineExtensions) { data = processDataExtensions(data); } synchronized (pendingData) { log.debugf("Adding [%s] to pendingData [%s]", data, pendingData); pendingData.addAll(data); } }
Source:
<code>public static String makeUrlAbsolute(HttpServletRequest request, String path, boolean useClientAddress) { if (path.indexOf("://") < 0) { String server = null; int port = -1; String protocol = null; if (useClientAddress) { URL clientRequest; try { clientRequest = new URL(request.getRequestURL().toString()); } catch (MalformedURLException e) { <START> throw new RuntimeException("get request url was not a well formed url" + e); <END> } server = clientRequest.getHost(); port = clientRequest.getPort() == -1 ? clientRequest.getDefaultPort() : clientRequest.getPort(); protocol = clientRequest.getProtocol(); } else { server = request.getServerName(); port = request.getServerPort(); protocol = request.getScheme(); } StringBuilder b = new StringBuilder(); b.append(protocol); b.append("://"); b.append(server); if (port != -1 && port != 80 && protocol.equals("http") ) { b.append(":"); b.append(port); } if (port != -1 && port != 443 && protocol.equals("https") ) { b.append(":"); b.append(port); } if (!path.startsWith("/")) { b.append("/"); } b.append(path); return b.toString(); } return path; }</code><technical_language>issues here: 1. Please include appears in exception stack 2. Message needs improved e.g. "The request URL valid : " + request.getRequestURL()</technical_language>

Target:
public static String makeUrlAbsolute(HttpServletRequest request, String path, boolean useClientAddress) { if (path.indexOf("://") < 0) { String server = null; int port = -1; String protocol = null; if (useClientAddress) { URL clientRequest; try { clientRequest = new URL(request.getRequestURL().toString()); } catch (MalformedURLException e) { throw new RuntimeException("The request URL is not valid", e); } server = clientRequest.getHost(); port = clientRequest.getPort() == -1 ? clientRequest.getDefaultPort() : clientRequest.getPort(); protocol = clientRequest.getProtocol(); } else { server = request.getServerName(); port = request.getServerPort(); protocol = request.getScheme(); } StringBuilder b = new StringBuilder(); b.append(protocol); b.append("://"); b.append(server); if (port != -1 && port != 80 && protocol.equals("http") ) { b.append(":"); b.append(port); } if (port != -1 && port != 443 && protocol.equals("https") ) { b.append(":"); b.append(port); } if (!path.startsWith("/")) { b.append("/"); } b.append(path); return b.toString(); } return path; }
Source:
<code>public Flux<NumericResponse<ZRemRangeByRankCommand, Long>> zRemRangeByRank( Publisher<ZRemRangeByRankCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); return cmd <START> .zremrangebyrank(command.getKey(), command.getRange().getLowerBound().getValue().orElse(Long.MIN_VALUE), <END> command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(value -> new NumericResponse<>(command, value)); })); }</code><technical_language>starting index (unbounded) 0L -2<sup>63</sup></technical_language>

Target:
public Flux<NumericResponse<ZRemRangeByRankCommand, Long>> zRemRangeByRank( Publisher<ZRemRangeByRankCommand> commands) { return connection.execute(cmd -> Flux.from(commands).concatMap(command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getRange(), "Range must not be null!"); return cmd .zremrangebyrank(command.getKey(), command.getRange().getLowerBound().getValue().orElse(0L), command.getRange().getUpperBound().getValue().orElse(Long.MAX_VALUE)) .map(value -> new NumericResponse<>(command, value)); })); }
Source:
<code>public boolean readFromBarFolder(final BusinessArchive businessArchive, final File barFolder) throws IOException { final File file = new File(barFolder, ACTOR_MAPPING_FILE); if (file.exists()) { final byte[] content = IOUtil.getContent(file); try { businessArchive.setActorMapping(new ActorMappingConverter().deserializeFromXML(content)); } catch (JAXBException | org.xml.sax.SAXException e) { return false; } } <START> return true; <END> }</code><technical_language>return true file exists</technical_language>

Target:
public boolean readFromBarFolder(final BusinessArchive businessArchive, final File barFolder) throws IOException { final File file = new File(barFolder, ACTOR_MAPPING_FILE); if (file.exists()) { final byte[] content = IOUtil.getContent(file); try { businessArchive.setActorMapping(new ActorMappingMarshaller().deserializeFromXML(content)); } catch (XmlMarshallException e) { return false; } return true; } return false; }
Source:
<code>private static DatasetAPIClient getInstance() throws ZebedeeException { if (INSTANCE == null) { synchronized (DatasetAPIClientSupplier.class) { if (INSTANCE == null) { info().log("creating new instance of datasetAPIClient"); try { <START> ReaderConfiguration cgf = ReaderConfiguration.get(); <END> INSTANCE = new DatasetAPIClient(cgf.getDatasetAPIHost(), cgf.getDatasetAPIAuthToken(), cgf.getServiceAuthToken()); } catch (Exception e) { ZebedeeException ex = new InternalServerError("error initalising dataset api client", e); throw error().logException(ex, "error instantiating datasetAPIClient instabce"); } } } } return INSTANCE; }</code><technical_language>typo in cgf</technical_language>

Target:
private static DatasetAPIClient getInstance() throws ZebedeeException { if (INSTANCE == null) { synchronized (DatasetAPIClientSupplier.class) { if (INSTANCE == null) { info().log("creating new instance of datasetAPIClient"); try { ReaderConfiguration cfg = ReaderConfiguration.get(); INSTANCE = new DatasetAPIClient(cfg.getDatasetAPIHost(), cfg.getDatasetAPIAuthToken(), cfg.getServiceAuthToken()); } catch (Exception e) { ZebedeeException ex = new InternalServerError("error initalising dataset api client", e); throw error().logException(ex, "error instantiating datasetAPIClient instabce"); } } } } return INSTANCE; }
Source:
<code>public void logChange(final String storeName, final Bytes key, final byte[] value, final long timestamp) { throwUnsupportedOperationExceptionIfStandby("logChange"); <START> streamTask.recordCollector().send( <END> storeToChangelogTopic.get(storeName), key, value, null, taskId().partition, timestamp, BYTES_KEY_SERIALIZER, BYTEARRAY_VALUE_SERIALIZER); }</code><technical_language>refactor interfaces transitToActive transitToStandby that: * transitToActive: takes streamTask (in future suggest pass in record-collector removing schedule refactored request-commit) cache parameters, check current state manager's taskType is active. * transitToStandby: takes parameter, reset streamTask cache, check current state manager's taskType is active</technical_language>

Target:
public void logChange(final String storeName, final Bytes key, final byte[] value, final long timestamp) { throwUnsupportedOperationExceptionIfStandby("logChange"); collector.send( storeToChangelogTopic.get(storeName), key, value, null, taskId().partition, timestamp, BYTES_KEY_SERIALIZER, BYTEARRAY_VALUE_SERIALIZER); }
Source:
<code>public void detectUnusedBinding(Collection<Binding<?>> bindings) { ArrayList<Binding> unusedBindings = new ArrayList<Binding>(); for (Binding<?> binding : bindings) { if (binding.necessary() && !binding.dependedOn()) { unusedBindings.add(binding); } } if (unusedBindings.size() > 0) { StringBuilder builder = new StringBuilder(); builder.append("You have these unused @Provider methods! "); builder.append("Set library=true in your module to disable this check.\n"); <START> for (Binding<?> binding : unusedBindings) { <END> builder.append(binding).append("\n"); } throw new IllegalStateException(builder.toString()); } }</code><technical_language>I assume safely cast ProviderMethodBinding</technical_language>

Target:
public void detectUnusedBinding(Collection<Binding<?>> bindings) { ArrayList<Binding> unusedBindings = new ArrayList<Binding>(); for (Binding<?> binding : bindings) { if (!binding.library() && !binding.dependedOn()) { unusedBindings.add(binding); } } if (unusedBindings.size() > 0) { StringBuilder builder = new StringBuilder(); builder.append("You have these unused @Provider methods! "); builder.append("Set library=true in your module to disable this check.\n"); for (Binding<?> binding : unusedBindings) { AbstractProviderMethodBinding<?> providerBinding = (AbstractProviderMethodBinding<?>) binding; builder.append(providerBinding.getModuleName()) .append(".") .append(providerBinding.getMethodName()) .append("()\n"); } throw new IllegalStateException(builder.toString()); } }
Source:
<code>public void headerBinding() { HeadersExchange headersExchange = new HeadersExchange("h"); String headerKey = "headerKey"; <START> BindingBuilder.HeadersExchangeMapConfigurer toConfigurer = BindingBuilder. <END> bind(queue).to(headersExchange); Binding binding = toConfigurer.where(headerKey).exists(); assertNotNull(binding); assertEquals(headersExchange.getName(), binding.getExchange()); assertEquals(Binding.DestinationType.QUEUE, binding.getDestinationType()); assertEquals(queue.getName(), binding.getDestination()); assertEquals("", binding.getRoutingKey()); }</code><technical_language>is this toConfigurer needed a variable</technical_language>

Target:
public void headerBinding() { HeadersExchange headersExchange = new HeadersExchange("h"); String headerKey = "headerKey"; Binding binding = BindingBuilder.bind(queue).to(headersExchange).where(headerKey).exists(); assertNotNull(binding); assertEquals(headersExchange.getName(), binding.getExchange()); assertEquals(Binding.DestinationType.QUEUE, binding.getDestinationType()); assertEquals(queue.getName(), binding.getDestination()); assertEquals("", binding.getRoutingKey()); }
Source:
<code>void testValidSheets() throws IOException { DataImporter dimp = new RawDataSpreadsheetImporter(); File file1 = createValidTestSpreadsheet("/tmp/valid1.xlsx"); Map<Integer,String> errors = dimp.validate(file1); for (Integer i: errors.keySet()) { <START> System.out.printf("Unexpected error, row %d: %s", i, errors.get(i)); <END> } assertEquals(0, errors.size()); }</code><technical_language>In this case print out errors, supposed a valid test sheet, assert errors is empty enough. If empty I prints out error map</technical_language>

Target:
public void testValidSheets() throws IOException { DataImporter dimp = new RawDataSpreadsheetImporter(); File file1 = createValidTestSpreadsheet("/tmp/valid1.xlsx"); Map<Integer,String> errors = dimp.validate(file1); assertEquals(0, errors.size()); }
Source:
<code>private RcsFeatureManager getRcsFeatureManager(int subId) { Phone phone = PhoneGlobals.getPhone(subId); if (phone == null) { throw new ServiceSpecificException(ImsException.CODE_ERROR_INVALID_SUBSCRIPTION, "Invalid subscription Id: " + subId); } ImsPhone imsPhone = (ImsPhone) phone.getImsPhone(); if (imsPhone == null) { throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION, "Cannot find ImsPhone instance: " + subId); } RcsFeatureManager rcsFeatureManager = imsPhone.getRcsManager(); if (rcsFeatureManager == null) { throw new <START> ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION, <END> "Cannot find RcsFeatureManager instance: " + subId); } return rcsFeatureManager; }</code><technical_language>This a CODE_ERROR_SERVICE_UNAVAILABLE code set RcsManager yet</technical_language>

Target:
private RcsFeatureManager getRcsFeatureManager(int subId) { Phone phone = PhoneGlobals.getPhone(subId); if (phone == null) { throw new ServiceSpecificException(ImsException.CODE_ERROR_INVALID_SUBSCRIPTION, "Invalid subscription Id: " + subId); } ImsPhone imsPhone = (ImsPhone) phone.getImsPhone(); if (imsPhone == null) { throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION, "Cannot find ImsPhone instance: " + subId); } RcsFeatureManager rcsFeatureManager = imsPhone.getRcsManager(); if (rcsFeatureManager == null) { throw new ServiceSpecificException(ImsException.CODE_ERROR_SERVICE_UNAVAILABLE, "Cannot find RcsFeatureManager instance: " + subId); } return rcsFeatureManager; }
Source:
<code>private CloudNetwork convertToCloudNetwork(Network network) { Set<CloudSubnet> subnets = new HashSet<>(); for (Entry<String, Subnet> subnet : network.subnets().entrySet()) { CloudSubnet cloudSubnet = new CloudSubnet(subnet.getKey(), subnet.getKey(), null, subnet.getValue().addressPrefix()); <START> azureCloudSubnetParametersService.addPrivateEndpointNetworkPolicies(cloudSubnet, subnet.getValue().inner().privateEndpointNetworkPolicies()); <END> subnets.add(cloudSubnet); } Map<String, Object> properties = new HashMap<>(); properties.put("addressSpaces", network.addressSpaces()); properties.put("dnsServerIPs", network.dnsServerIPs()); properties.put("resourceGroupName", network.resourceGroupName()); return new CloudNetwork(network.name(), network.id(), subnets, properties); }</code><technical_language>additional log line nice</technical_language>

Target:
private CloudNetwork convertToCloudNetwork(Network network) { Set<CloudSubnet> subnets = new HashSet<>(); for (Entry<String, Subnet> subnet : network.subnets().entrySet()) { CloudSubnet cloudSubnet = new CloudSubnet(subnet.getKey(), subnet.getKey(), null, subnet.getValue().addressPrefix()); azureCloudSubnetParametersService.addPrivateEndpointNetworkPolicies(cloudSubnet, subnet.getValue().inner().privateEndpointNetworkPolicies()); subnets.add(cloudSubnet); LOGGER.debug("Mapping azure subnet '{}' to cloudSubnet: {}", subnet.getKey(), cloudSubnet); } Map<String, Object> properties = new HashMap<>(); properties.put("addressSpaces", network.addressSpaces()); properties.put("dnsServerIPs", network.dnsServerIPs()); properties.put("resourceGroupName", network.resourceGroupName()); return new CloudNetwork(network.name(), network.id(), subnets, properties); }
Source:
<code>public Response add(ClusterFeature feature) { validateParameters(feature); org.ovirt.engine.core.common.businessentities.AdditionalFeature featureEntity = <START> ClusterFeaturesMapper.map(feature, <END> null); org.ovirt.engine.core.common.businessentities.Cluster cluster = BackendClusterFeatureHelper.getClusterEntity(this, asGuid(clusterId)); SupportedAdditionalClusterFeature supportedFeature = new SupportedAdditionalClusterFeature(); supportedFeature.setFeature(featureEntity); supportedFeature.setEnabled(true); supportedFeature.setClusterId(asGuid(clusterId)); cluster.getAddtionalFeaturesSupported().add(supportedFeature); return BackendClusterFeatureHelper.updateClusterEntity(this, cluster); }</code><technical_language>"map"</technical_language>

Target:
public Response add(ClusterFeature feature) { validateParameters(feature); org.ovirt.engine.core.common.businessentities.AdditionalFeature featureEntity = map(feature, null); org.ovirt.engine.core.common.businessentities.Cluster cluster = BackendClusterFeatureHelper.getClusterEntity(this, asGuid(clusterId)); SupportedAdditionalClusterFeature supportedFeature = new SupportedAdditionalClusterFeature(); supportedFeature.setFeature(featureEntity); supportedFeature.setEnabled(true); supportedFeature.setClusterId(asGuid(clusterId)); cluster.getAddtionalFeaturesSupported().add(supportedFeature); ManagementNetworkOnClusterOperationParameters param = new ManagementNetworkOnClusterOperationParameters(cluster); return performAction(ActionType.UpdateCluster, param); }
Source:
<code><START> List<File> findStoredFiles() { <END> lock.lock(); try { List<File> files = new ArrayList<>(); if (storeDirectory != null) { File dir = new File(storeDirectory); if (dir.exists() && dir.isDirectory()) { File[] values = dir.listFiles(); if (values != null) { files.addAll(Arrays.asList(values)); } } } queuedFiles.addAll(files); return files; } finally { lock.unlock(); } }</code><technical_language>I this called multiple times in current design, bad happen. Potentially this return files in queued files set</technical_language>

Target:
List<File> findStoredFiles() { lock.lock(); try { List<File> files = new ArrayList<>(); if (storeDirectory != null) { File dir = new File(storeDirectory); if (dir.exists() && dir.isDirectory()) { File[] values = dir.listFiles(); if (values != null) { for (File value : values) { if (value.isFile() && !queuedFiles.contains(value)) { files.add(value); } } } } } queuedFiles.addAll(files); return files; } finally { lock.unlock(); } }
Source:
<code>public void run() { if (tokenVerifier != null) { if (mcb.isClosed()) { for (final AccessTokenConfiguration tokenConfig : configuration.getAccessTokenConfigurations()) { try { final AccessToken accessToken = accessTokens.get(tokenConfig.getTokenId()); if (accessToken != null && olderThanMinute(accessToken)) { String token = accessToken.getToken(); if (!tokenVerifier.isTokenValid(token)) { invalidTokenIds.add(accessToken); LOG.warn("Invalid Token scheduled for refresh : " + tokenConfig.getTokenId()); } else { LOG.debug("Token for " + tokenConfig.getTokenId() + " still valid."); } mcb.onSuccess(); } } catch (final Throwable t) { LOG.warn("Unexpected problem during token verify run! TokenId : {}", tokenConfig.getTokenId(), t); mcb.onError(); } } } else { LOG.debug("{} is open, skip check.", mcb.getName()); } } else { <START> LOG.debug("No TokenVerifier configured, skip check."); <END> } }</code><technical_language>"skipping"</technical_language>

Target:
public void run() { if (tokenVerifier != null) { if (mcb.isClosed()) { for (final AccessTokenConfiguration tokenConfig : configuration.getAccessTokenConfigurations()) { try { final AccessToken accessToken = accessTokens.get(tokenConfig.getTokenId()); if (accessToken != null && olderThanMinute(accessToken)) { String token = accessToken.getToken(); if (!tokenVerifier.isTokenValid(token)) { invalidTokenIds.add(accessToken); LOG.warn("Invalid Token scheduled for refresh : " + tokenConfig.getTokenId()); } else { LOG.debug("Token for " + tokenConfig.getTokenId() + " still valid."); } mcb.onSuccess(); } } catch (final Throwable t) { LOG.warn("Unexpected problem during token verify run! TokenId : {}", tokenConfig.getTokenId(), t); mcb.onError(); } } } else { LOG.debug("{} is open, skipping check.", mcb.getName()); } } else { LOG.debug("No TokenVerifier configured, skipping check."); } }
Source:
<code>public DefaultMultilineCommentAutoEditStrategy(ICProject project) { if (project == null) { Map<String, ?> options = CCorePlugin.getOptions(); Map<String, String> formatterPrefs = new HashMap<>(options.size()); for (String key : options.keySet()) { Object value = options.get(key); if (value instanceof String) { formatterPrefs.put(key, (String) value); } } <START> DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(formatterPrefs); <END> fFormatBlocks = preferences.format_block_comment; } else { Map<String, String> options = project.getOptions(true); DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); fFormatBlocks = preferences.format_block_comment; } }</code><technical_language>CCorePlugin.getOptions()? returns a HashMap<String, String></technical_language>

Target:
public DefaultMultilineCommentAutoEditStrategy(ICProject project) { fProject = project; }
Source:
<code>public static Mono<RxDocumentServiceRequest> populateAuthorizationHeader(RxDocumentServiceRequest request, SimpleTokenCache simpleTokenCache) { if (request == null) { return Mono.error(new IllegalArgumentException("request")); } if (simpleTokenCache == null) { return Mono.error(new IllegalArgumentException("simpleTokenCache")); } return simpleTokenCache.getToken() .map(accessToken -> { <START> String authorization = String.format(AAD_AUTH_TOKEN_FORMAT, <END> AAD_AUTH_SCHEMA_TYPE_SEGMENT, AAD_AUTH_SCHEMA_TYPE_VALUE, AAD_AUTH_VERSION_SEGMENT, AAD_AUTH_VERSION_VALUE, AAD_AUTH_SIGNATURE_SEGMENT, accessToken.getToken()); try { authorization = URLEncoder.encode(authorization, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Failed to encode authorization token.", e); } request.getHeaders().put(HttpConstants.HttpHeaders.AUTHORIZATION, authorization); return request; }); }</code><technical_language>String.format() do regex is CPU intensive. if please String concat/StringBuilder hot path: <LINK_0></technical_language>

Target:
if (request == null || request.getHeaders() == null) { throw new IllegalArgumentException("request"); } if (simpleTokenCache == null) { throw new IllegalArgumentException("simpleTokenCache"); } return getAuthorizationToken(simpleTokenCache) .map(authorization -> { request.getHeaders().put(HttpConstants.HttpHeaders.AUTHORIZATION, authorization); return request; }); }
Source:
<code>public void simple() throws Exception { <START> final XsltTransformTest.SavingBillBoard board = <END> new XsltTransformTest.SavingBillBoard(); new XsltTransform( StringUtils.join( "<?xml version=\"1.0\"?>", "<xsl:stylesheet xmlns:xsl=\"<LINK_0>\" version=\"1.0\">", "<xsl:template match=\"/body\">", "<test><xsl:value-of select=\"value\"/></test>", "</xsl:template>", "</xsl:stylesheet>" ), board ).announce("<body><value>Text</value></body>"); MatcherAssert .assertThat(board.getData(), Matchers.equalTo("<test>Text</test>")); }</code><technical_language>hm.. Mockito?</technical_language>

Target:
public void simple() throws Exception { final Billboard board = Mockito.mock(Billboard.class); new XsltTransform( StringUtils.join( "<?xml version=\"1.0\"?>", "<xsl:stylesheet xmlns:xsl=\"<LINK_0>\" version=\"1.0\">", "<xsl:template match=\"/body\">", "<test><xsl:value-of select=\"value\"/></test>", "</xsl:template>", "</xsl:stylesheet>" ), board ).announce("<body><value>Text</value></body>"); Mockito.verify(board).announce(Mockito.eq("<test>Text</test>")); }
Source:
<code>public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) { DisplayDevice display = context.get(DisplayDevice.class); boolean isHeadless = display.isHeadless(); ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create(); for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) { if (!ComponentSystem.class.isAssignableFrom(type)) { logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName()); continue; } Name moduleId = environment.getModuleProviding(type); RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class); if (registerInfo.value().isValidFor(netMode, isHeadless)) { if(registerInfo.requiresOptional().length != 0){ for(String s : registerInfo.requiresOptional()){ if(environment.get(new Name(s))!=null)systemsByModule.put(moduleId, type); <START> } <END> } else { systemsByModule.put(moduleId, type); } } } for (Module module : environment.getModulesOrderedByDependencies()) { for (Class<?> system : systemsByModule.get(module.getId())) { String id = module.getId() + ":" + system.getSimpleName(); logger.debug("Registering system {}", id); try { ComponentSystem newSystem = (ComponentSystem) system.newInstance(); InjectionHelper.share(newSystem); register(newSystem, id); logger.debug("Loaded system {}", id); } catch (RuntimeException | IllegalAccessException | InstantiationException | NoClassDefFoundError e) { logger.error("Failed to load system {}", id, e); } } } }</code><technical_language>woudln't sense system register if dependencies present? (Also I if this is a good concept in general, some people want i object)</technical_language>

Target:
public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) { DisplayDevice display = context.get(DisplayDevice.class); boolean isHeadless = display.isHeadless(); ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create(); for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) { if (!ComponentSystem.class.isAssignableFrom(type)) { logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName()); continue; } Name moduleId = environment.getModuleProviding(type); RegisterSystem registerInfo = type.getAnnotation(RegisterSystem.class); if (registerInfo.value().isValidFor(netMode, isHeadless) && areOptionalRequirementsContained(registerInfo,environment)) { systemsByModule.put(moduleId, type); } } for (Module module : environment.getModulesOrderedByDependencies()) { for (Class<?> system : systemsByModule.get(module.getId())) { String id = module.getId() + ":" + system.getSimpleName(); logger.debug("Registering system {}", id); try { ComponentSystem newSystem = (ComponentSystem) system.newInstance(); InjectionHelper.share(newSystem); register(newSystem, id); logger.debug("Loaded system {}", id); } catch (RuntimeException | IllegalAccessException | InstantiationException | NoClassDefFoundError e) { logger.error("Failed to load system {}", id, e); } } } }
Source:
<code>private void closeAggregationBuilder() { outputIterator = null; if (aggregationBuilder != null) { aggregationBuilder.recordHashCollisions(hashCollisionsCounter); aggregationBuilder.close(); aggregationBuilder = null; } localUserMemoryContext.setBytes(0); <START> localRevocableMemoryContext.setBytes(0); <END> }</code><technical_language>close</technical_language>

Target:
private void closeAggregationBuilder() { outputIterator = null; if (aggregationBuilder != null) { aggregationBuilder.recordHashCollisions(hashCollisionsCounter); aggregationBuilder.close(); aggregationBuilder = null; } operatorContext.localUserMemoryContext().setBytes(0); operatorContext.localRevocableMemoryContext().setBytes(0); }
Source:
<code>private boolean isAuthorized(String email, String password) { String liferayParameterURL = "/api/jsonws/user/get-user-id-by-email-address?companyId=%s&emailAddress=%s"; String url = sw360PortalServerURL + String.format(liferayParameterURL, sw360LiferayCompanyId, email); RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); String encodedPassword; try { encodedPassword = URLDecoder.decode(password, "US-ASCII"); } catch (UnsupportedEncodingException e) { return false; } RestTemplate restTemplate = restTemplateBuilder.basicAuthorization(email, encodedPassword).build(); ResponseEntity<String> response = restTemplate.postForEntity(url, null, String.class); <START> return (parseInteger(response.getBody()) > 0); <END> }</code><technical_language>if User userId=0</technical_language>

Target:
private boolean isAuthorized(String email, String password) { String liferayParameterURL = "/api/jsonws/user/get-user-id-by-email-address?companyId=%s&emailAddress=%s"; String url = sw360PortalServerURL + String.format(liferayParameterURL, sw360LiferayCompanyId, email); RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); String encodedPassword; try { encodedPassword = URLDecoder.decode(password, "US-ASCII"); } catch (UnsupportedEncodingException e) { return false; } RestTemplate restTemplate = restTemplateBuilder.basicAuthorization(email, encodedPassword).build(); ResponseEntity<String> response = restTemplate.postForEntity(url, null, String.class); try { Integer.parseInt(response.getBody()); } catch (NumberFormatException e) { return false; } return true; }
Source:
<code>public void fetchPurchaseRequest() { new FirebaseCollection<>(Constants.PURCHASE_REQUEST + "/" + userId, PurchaseRequest.class).getAll(new DataCallback<List<PurchaseRequest>>() { @Override public void onSuccess(List<PurchaseRequest> data) { for (PurchaseRequest purchaseRequest : data) { if (!purchaseRequest.getReceiver().equals(userId)) <START> purchaseList.add(purchaseRequest); <END> } purchaseRequestHistoryAdapter.notifyDataSetChanged(); } @Override public void onError(String errorMessage) { } }); }</code><technical_language>NITPICK: indent this in readable</technical_language>

Target:
public void fetchPurchaseRequest() { new FirebaseCollection<>(Constants.PURCHASE_REQUEST + "/" + userId, PurchaseRequest.class) .getAll(new DataCallback<List<PurchaseRequest>>() { @Override public void onSuccess(List<PurchaseRequest> data) { for (PurchaseRequest purchaseRequest : data) { if (!purchaseRequest.getReceiver().equals(userId)) addRequest(purchaseRequest); } purchaseRequestHistoryAdapter.notifyDataSetChanged(); } @Override public void onError(String errorMessage) { } }); }
Source:
<code>private static void validateMigrationStates( Resource resource) throws InvalidReferenceException { if (resource == null) throw new ArgumentNullException("resource"); List<Migration> migrations = resource.getMigrations(); List<State> states = resource.getStates(); for (Migration m : migrations ) { boolean migrationToStateValid = false; boolean migrationFromStateValid = false; if (!m.getToState().isPresent()) { migrationToStateValid = true; } if (!m.getFromState().isPresent()) { migrationFromStateValid = true; } for (State s : states ) { if (m.getToState().equals(s.getStateId()) || m.getToState().equals(s.getLabel())) { migrationToStateValid = true; } <START> if (m.getFromState().equals(s.getStateId()) || m.getFromState().equals(s.getLabel())) <END> { migrationFromStateValid = true; } if (migrationFromStateValid && migrationToStateValid) { break; } } if (!migrationFromStateValid) { throw new InvalidReferenceException ( STATE, m.getFromState().get(), m.getApplicableTypes().toString(), m.getMigrationId().toString() ); } else if (!migrationToStateValid) { throw new InvalidReferenceException ( STATE, m.getToState().get(), m.getApplicableTypes().toString(), m.getMigrationId().toString() ); } } }</code><technical_language>@gilleycro getFromState() returns Optional<String> s.getStateId() is a UUID s.getLabel() is a String.. I this is case Aris caught in change, good correct in PR certain. Need aware getFromState().get().equals(s.getStateId()) work - need toString() s.getStateId() for comparison work. other is checking isPresent() migration terminal (from / to) redundantly checking Optional.empty()'s state values</technical_language>

Target:
private static void validateMigrationStates( Resource resource) throws MigrationNotPossibleException, InvalidReferenceException { if (resource == null) throw new ArgumentNullException("resource"); List<Migration> migrations = resource.getMigrations(); List<State> states = resource.getStates(); for (Migration m : migrations) { if (!m.getFromState().isPresent() && !m.getToState().isPresent()) { throw new MigrationNotPossibleException(); } boolean fromIsValid = !m.getFromState().isPresent(); boolean toIsValid = !m.getToState().isPresent(); for (State s : states) { fromIsValid |= WildebeestApiImpl.stateEquals(m.getFromState(), s); toIsValid |= WildebeestApiImpl.stateEquals(m.getToState(), s); if (fromIsValid && toIsValid) { break; } } if (!fromIsValid && !toIsValid) { throw InvalidReferenceException.twoReferences( EntityType.State, m.getFromState().get(), EntityType.State, m.getToState().get(), EntityType.Migration, m.getMigrationId().toString()); } if (!fromIsValid) { throw InvalidReferenceException.oneReference( EntityType.State, m.getFromState().get(), EntityType.Migration, m.getMigrationId().toString()); } else if (!toIsValid) { throw InvalidReferenceException.oneReference( EntityType.State, m.getToState().get(), EntityType.Migration, m.getMigrationId().toString()); } } }
Source:
<code>protected void removeTlsCertificateProvider(TlsCertificateProvider tlsCertificateProvider) { removeLinkedTrustManager(tlsCertificateProvider.getHostName(), <START> mappingFromTlsCertificateProvider.get(tlsCertificateProvider)); <END> }</code><technical_language>get remove</technical_language>

Target:
protected void removeTlsCertificateProvider(TlsCertificateProvider tlsCertificateProvider) { removeLinkedTrustManager(tlsCertificateProvider.getHostName(), mappingFromTlsCertificateProvider.remove(tlsCertificateProvider)); }
Source:
<code>private void setEntities(WeightedTable<EntitySnapshot> entities) { checkNotNull(entities).forEach(Preconditions::checkNotNull); <START> this.entities = entities; <END> }</code><technical_language>defensively clone WeightedTable</technical_language>

Target:
private void setEntities(WeightedTable<EntitySnapshot> entities) { checkNotNull(entities); this.entities.clear(); this.entities.addAll(entities); }
Source:
<code>private JsonNode findNodeByName(ArrayNode parentNode, String searchName, String parentNodeName) throws DevfileFormatException { return StreamSupport.stream(parentNode.spliterator(), false) .filter(node -> node.path("name").asText().equals(searchName)) .findFirst() .orElseThrow( () -> <START> new DevfileFormatException( <END> format( "Cannot apply override: object with name '%s' not found in array of %s.", searchName, parentNodeName))); }</code><technical_language>if DevfileFormatException is right - wrong devfile - this method apply overrides</technical_language>

Target:
private JsonNode findNodeByName(ArrayNode parentNode, String searchName, String parentNodeName) throws OverrideParameterException { return StreamSupport.stream(parentNode.spliterator(), false) .filter(node -> node.path("name").asText().equals(searchName)) .findFirst() .orElseThrow( () -> new OverrideParameterException( format( "Cannot apply override: object with name '%s' not found in array of %s.", searchName, parentNodeName))); }
Source:
<code>private void manageToolbarSizes() { int width = getOffsetWidth(); if (width == 0) return; texToolbarButton_.setText(width < 520 ? "" : "Format"); runButton_.setText(((width < 480) || isShinyFile()) ? "" : "Run"); compilePdfButton_.setText(width < 450 ? "" : "Compile PDF"); previewHTMLButton_.setText(width < 450 ? "" : previewCommandText_); knitDocumentButton_.setText(width < 450 ? "" : knitCommandText_); if (editor_.getFileType().isRd() || editor_.getFileType().isJS() || editor_.getFileType().isSql()) { String preview = editor_.getFileType().getPreviewButtonText(); srcOnSaveLabel_.setText(width < 450 ? preview : preview + " on Save"); } else if (hasCustomSource()) { <START> srcOnSaveLabel_.setText(width < 450 ? "Function" : "Function on Save"); <END> } else { srcOnSaveLabel_.setText(width < 450 ? "Source" : "Source on Save"); } sourceButton_.setText(width < 400 ? "" : sourceCommandText_); }</code><technical_language>This text odd -- Source Save</technical_language>

Target:
private void manageToolbarSizes() { int width = getOffsetWidth(); if (width == 0) return; texToolbarButton_.setText(width < 520 ? "" : "Format"); runButton_.setText(((width < 480) || isShinyFile()) ? "" : "Run"); compilePdfButton_.setText(width < 450 ? "" : "Compile PDF"); previewHTMLButton_.setText(width < 450 ? "" : previewCommandText_); knitDocumentButton_.setText(width < 450 ? "" : knitCommandText_); if (editor_.getFileType().isRd() || editor_.getFileType().isJS() || editor_.getFileType().isSql() || editor_.getFileType().canPreviewFromR()) { String preview = editor_.getFileType().getPreviewButtonText(); srcOnSaveLabel_.setText(width < 450 ? preview : preview + " on Save"); } else { srcOnSaveLabel_.setText(width < 450 ? "Source" : "Source on Save"); } sourceButton_.setText(width < 400 ? "" : sourceCommandText_); }
Source:
<code>private String verifyURL() { new PushButton(VERIFY_BUTTON).click(); Text labeledText = new LabeledText(REMOTE_CATALOG_SHELL); String text = labeledText.getText(); if (text.equals(EMPTY_CATALOG_MESSAGE)) { <START> throw new IllegalArgumentException(EMPTY_CATALOG_EXCEPTION); <END> } return text; }</code><technical_language>Do throw exception in a method. want url is valid not</technical_language>

Target:
protected String verifyURL() { new PushButton(VERIFY_BUTTON).click(); new WaitWhile(new JobIsRunning(), TimePeriod.NORMAL); Text labeledText = new LabeledText(REMOTE_CATALOG_SHELL); String text = labeledText.getText(); return text; }
Source:
<code>private static List<OutputInfo> outputInfoList(List<OutputStats> outputStatsList) { List<OutputInfo> outputInfoList = new ArrayList<OutputInfo>(); if (outputStatsList == null) { return outputInfoList; } <START> for (OutputStats inputStats : outputStatsList) { <END> outputInfoList.add(new PigOutputInfo(inputStats)); } return outputInfoList; }</code><technical_language>thanks for renaming vars reflect _output_ stats :) missed var here-- inputStats outputStats</technical_language>

Target:
private static List<OutputInfo> outputInfoList(List<OutputStats> outputStatsList) { List<OutputInfo> outputInfoList = new ArrayList<OutputInfo>(); if (outputStatsList == null) { return outputInfoList; } for (OutputStats outputStats : outputStatsList) { outputInfoList.add(new PigOutputInfo(outputStats)); } return outputInfoList; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.save_credentials_layout); <START> if (!getIntent().getBooleanExtra(ExtraConstants.EXTRA_SMARTLOCK_ENABLED, true)) { <END> finish(RESULT_OK, getIntent()); return; } if (!FirebaseAuthWrapperFactory.getFirebaseAuthWrapper(mActivityHelper.getAppName()) .isPlayServicesAvailable(this)) { finish(RESULT_FIRST_USER, getIntent()); return; } mName = getIntent().getStringExtra(ExtraConstants.EXTRA_NAME); mEmail = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL); mPassword = getIntent().getStringExtra(ExtraConstants.EXTRA_PASSWORD); mProvider = getIntent().getStringExtra(ExtraConstants.EXTRA_PROVIDER); mProfilePictureUri = getIntent() .getStringExtra(ExtraConstants.EXTRA_PROFILE_PICTURE_URI); mCredentialsApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .build(); mCredentialsApiClient.connect(); }</code><technical_language>I cleaner start this activity if smartlock is enabled, a entry points need updating. Thoughts</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.save_credentials_layout); if (!FirebaseAuthWrapperFactory.getFirebaseAuthWrapper(mActivityHelper.getAppName()) .isPlayServicesAvailable(this)) { finish(RESULT_FIRST_USER, getIntent()); return; } mName = getIntent().getStringExtra(ExtraConstants.EXTRA_NAME); mEmail = getIntent().getStringExtra(ExtraConstants.EXTRA_EMAIL); mPassword = getIntent().getStringExtra(ExtraConstants.EXTRA_PASSWORD); mProvider = getIntent().getStringExtra(ExtraConstants.EXTRA_PROVIDER); mProfilePictureUri = getIntent() .getStringExtra(ExtraConstants.EXTRA_PROFILE_PICTURE_URI); mCredentialsApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Auth.CREDENTIALS_API) .build(); mCredentialsApiClient.connect(); }
Source:
<code>private void createExtensionDirectory(String coordinate, File atLocation) { <START> if (atLocation.exists()) { <END> log.info("Directory [%s] already exists, skipping creating a directory", atLocation.getAbsolutePath()); return; } if (!atLocation.mkdir()) { throw new RuntimeException( String.format( "Unable to create directory at [%s] for coordinate [%s]", atLocation.getAbsolutePath(), coordinate ) ); } }</code><technical_language>suggest checking if is a directory</technical_language>

Target:
private void createExtensionDirectory(String coordinate, File atLocation) { if (atLocation.isDirectory()) { log.info("Directory [%s] already exists, skipping creating a directory", atLocation.getAbsolutePath()); return; } if (!atLocation.mkdir()) { throw new ISE( String.format( "Unable to create directory at [%s] for coordinate [%s]", atLocation.getAbsolutePath(), coordinate ) ); } }
Source:
<code>public Subscriber<? super T> call(final Subscriber<? super Boolean> child) { final SingleDelayedProducer<Boolean> producer = new SingleDelayedProducer<Boolean>(child); Subscriber<T> s = new Subscriber<T>() { boolean done; @Override public void onNext(T t) { Boolean result; try { result = predicate.call(t); } catch (Throwable e) { Exceptions.throwOrReport(e, this, t); return; } if (!result && !done) { done = true; producer.setValue(false); unsubscribe(); } } @Override public void onError(Throwable e) { if (!done) { done = true; child.onError(e); <START> } <END> } @Override public void onCompleted() { if (!done) { done = true; producer.setValue(true); } } }; child.add(s); child.setProducer(producer); return s; }</code><technical_language>Call RxJavaHooks.onError exception is lost</technical_language>

Target:
public Subscriber<? super T> call(final Subscriber<? super Boolean> child) { final SingleDelayedProducer<Boolean> producer = new SingleDelayedProducer<Boolean>(child); Subscriber<T> s = new Subscriber<T>() { boolean done; @Override public void onNext(T t) { if (done) { return; } Boolean result; try { result = predicate.call(t); } catch (Throwable e) { Exceptions.throwOrReport(e, this, t); return; } if (!result) { done = true; producer.setValue(false); unsubscribe(); } } @Override public void onError(Throwable e) { if (!done) { done = true; child.onError(e); } else { RxJavaHooks.onError(e); } } @Override public void onCompleted() { if (!done) { done = true; producer.setValue(true); } } }; child.add(s); child.setProducer(producer); return s; }
Source:
<code>public void extraSweepersGiveUpAfterFailingToAcquireEnoughTimes() throws InterruptedException { int shards = 8; int sweepers = 2; int threads = shards / sweepers + 1; LockService stickyLockService = createStickyLockService(); createAndInitializeSweepersAndWaitForOneBackgroundIteration(sweepers, shards, threads, stickyLockService); <START> ArgumentCaptor<LockRequest> captor = ArgumentCaptor.forClass(LockRequest.class); <END> verify(stickyLockService, atLeast(2 * shards - shards / sweepers + 2 * shards)) .lock(eq(LockClient.ANONYMOUS.getClientId()), any(LockRequest.class)); verify(stickyLockService, atMost(2 * shards - 1 + 2 * shards)) .lock(eq(LockClient.ANONYMOUS.getClientId()), captor.capture()); Set<String> requestedLockIds = captor.getAllValues().stream() .map(LockRequest::getLocks) .map(list -> list.get(0)) .map(LockWithMode::getLockDescriptor) .map(LockDescriptor::getLockIdAsString) .collect(Collectors.toSet()); Set<String> expectedLockIds = IntStream.range(0, shards).boxed() .map(ShardAndStrategy::conservative) .map(ShardAndStrategy::toText) .collect(Collectors.toSet()); assertThat(requestedLockIds).hasSameElementsAs(expectedLockIds); }</code><technical_language>bounds correct generally, assuming sweepers a variable (they correct in this instance sweepers = 2, in case expect 2 * shards - shards / 2). More generally I get, shards / sweepers is integer, a minimum of shards * (sweepers + 1) / 2 a maximum of shards * sweepers - (sweepers * (sweepers - 1)) / 2</technical_language>

Target:
public void extraSweepersGiveUpAfterFailingToAcquireEnoughTimes() throws InterruptedException { int shards = 16; int sweepers = 4; int threads = shards / (sweepers / 2); TimelockService stickyLockService = createStickyLockService(); createAndInitializeSweepersAndWaitForOneBackgroundIteration(sweepers, shards, threads, stickyLockService); ArgumentCaptor<LockRequest> captor = ArgumentCaptor.forClass(LockRequest.class); verify(stickyLockService, atLeast(shards * (shards / threads + 1) / 2 + shards * (threads * sweepers - shards))) .lock(any(LockRequest.class)); verify(stickyLockService, atMost(shards * ((threads + 1) * sweepers - shards) - sweepers * (sweepers - 1) / 2)) .lock(captor.capture()); Set<String> requestedLockIds = captor.getAllValues().stream() .map(LockRequest::getLockDescriptors) .map(Iterables::getOnlyElement) .map(LockDescriptor::getLockIdAsString) .collect(Collectors.toSet()); Set<String> expectedLockIds = IntStream.range(0, shards).boxed() .map(ShardAndStrategy::conservative) .map(ShardAndStrategy::toText) .collect(Collectors.toSet()); assertThat(requestedLockIds).hasSameElementsAs(expectedLockIds); }
Source:
<code>protected Builder() { super(B2Api.class); id("b2") .name("Backblaze B2 API") .identityName("Access Key ID") <START> .credentialName("Secret Access Key") <END> .documentation(URI.create("<LINK_0>")) .defaultEndpoint("<LINK_1>") .defaultProperties(B2ApiMetadata.defaultProperties()) .view(typeToken(BlobStoreContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>of( B2HttpApiModule.class)); }</code><technical_language>In naming, "Account Id" "Application Key"</technical_language>

Target:
protected Builder() { super(B2Api.class); id("b2") .name("Backblaze B2 API") .identityName("Account Id") .credentialName("Application Key") .documentation(URI.create("<LINK_0>")) .defaultEndpoint("<LINK_1>") .defaultProperties(B2ApiMetadata.defaultProperties()) .view(typeToken(BlobStoreContext.class)) .defaultModules(ImmutableSet.<Class<? extends Module>>of( B2HttpApiModule.class)); }
Source:
<code>public void boxedLong() { @Indexed(index = INDEX_NAME) class IndexedEntity { Long id; @DocumentId public Long getId() { return id; } } doTestBridge( IndexedEntity.class, id -> { IndexedEntity entity = new IndexedEntity(); entity.id = id; return entity; }, <START> 73l, <END> "73" ); }</code><technical_language>Please "L" "l" for Long constants; I a bit confused thought a "1" first. add a checkstyle rule for that</technical_language>

Target:
public void boxedLong() { @Indexed(index = INDEX_NAME) class IndexedEntity { Long id; @DocumentId public Long getId() { return id; } } doTestBridge( IndexedEntity.class, id -> { IndexedEntity entity = new IndexedEntity(); entity.id = id; return entity; }, 73L, "73" ); }