auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<ExpressionTree> expressions() { <START> return ImmutableList.copyOf(Iterables.filter(elements, input -> input != null ? !input.is(Kind.HEREDOC_STRING_CHARACTERS) : false)); <END> }</code><technical_language>@vilchik-elena do need check for null elements</technical_language>

Target:
public List<ExpressionTree> expressions() { return ImmutableList.copyOf(Iterables.filter(elements, input -> !input.is(Kind.HEREDOC_STRING_CHARACTERS))); }
Source:
<code><START> public String getResourceAsString(String resourceName) { <END> byte[] data = getResource(resourceName); if (data != null) { return new String(data); } return null; }</code><technical_language>this method explicit encoding resource decoded as. ( utf-8? ) system default? I worry internationalization issues this method. force utf-8 (unless for some reason want do that?)</technical_language>

Target:
public String getResourceAsString(String resourceName) { byte[] data = getResource(resourceName); if (data != null) { try { return new String(data, "UTF-8"); } catch(Exception e) { log.error("getResourceAsString threw", e); } } return null; }
Source:
<code>public void loadFromLocalStorage(VmConsoles consoles) { String vmId = guidToStringNullSafe(consoles.getVm().getId()); String poolId = guidToStringNullSafe(consoles.getVm().getVmPoolId()); ConsoleContext context = consoles.getConsoleContext(); <START> KeyMaker poolKeyMaker = new KeyMaker(poolId, true, context); <END> loadConsolesWithKeymaker(consoles, poolKeyMaker); if (consoles instanceof VmConsolesImpl) { KeyMaker vmKeyMaker = new KeyMaker(vmId, false, context); loadConsolesWithKeymaker(consoles, vmKeyMaker); } }</code><technical_language>please add a check if poolId is null</technical_language>

Target:
public void loadFromLocalStorage(VmConsoles consoles) { String vmId = guidToStringNullSafe(consoles.getVm().getId()); String poolId = guidToStringNullSafe(consoles.getVm().getVmPoolId()); ConsoleContext context = consoles.getConsoleContext(); if (poolId != null) { KeyMaker poolKeyMaker = new KeyMaker(poolId, true, context); loadConsolesWithKeymaker(consoles, poolKeyMaker); } if (consoles instanceof VmConsolesImpl) { KeyMaker vmKeyMaker = new KeyMaker(vmId, false, context); loadConsolesWithKeymaker(consoles, vmKeyMaker); } }
Source:
<code>public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("/WEB-INF/static/").setCachePeriod(3600*24*7); registry.addResourceHandler("/robots.txt").addResourceLocations("/WEB-INF/").setCachePeriod(0); <START> registry.addResourceHandler("/files/judgments/**").addResourceLocations(ResourceUtils.FILE_URL_PREFIX + judgmentsContentPath).setCachePeriod(3600*24); <END> }</code><technical_language>I give smaller cache (for example 10minutes). Consecutive reading of file rare done in short time period</technical_language>

Target:
public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("/WEB-INF/static/").setCachePeriod(3600*24*7); registry.addResourceHandler("/robots.txt").addResourceLocations("/WEB-INF/").setCachePeriod(0); registry.addResourceHandler("/files/judgments/**").addResourceLocations(ResourceUtils.FILE_URL_PREFIX + judgmentsContentPath).setCachePeriod(600); }
Source:
<code>JwkDefinition getDefinitionLoadIfNecessary(String keyId) { JwkDefinition result = this.getDefinition(keyId); if (result != null) { return result; } this.jwkDefinitions.clear(); <START> for(URL jwkSetUrl : jwkSetUrls) { <END> this.jwkDefinitions.putAll(loadJwkDefinitions(jwkSetUrl)); } return this.getDefinition(keyId); }</code><technical_language>iteration of fetching loading JwkSet(s) map result in a race condition. If is 2 more JwkSet's I this done in atomic operation. do think</technical_language>

Target:
JwkDefinitionHolder getDefinitionLoadIfNecessary(String keyId) { JwkDefinitionHolder result = this.getDefinition(keyId); if (result != null) { return result; } synchronized (this.jwkDefinitions) { this.jwkDefinitions.clear(); for (URL jwkSetUrl : jwkSetUrls) { this.jwkDefinitions.putAll(loadJwkDefinitions(jwkSetUrl)); } return this.getDefinition(keyId); } }
Source:
<code>public ParseHttpResponse intercept(Chain chain) throws IOException { ParseHttpRequest request = chain.getRequest(); ParseHttpResponse response = chain.proceed(request); if (GZIP_ENCODING.equalsIgnoreCase(response.getHeader(CONTENT_ENCODING_HEADER))) { Map<String, String > newHeaders = new HashMap<>(response.getAllHeaders()); newHeaders.remove(CONTENT_ENCODING_HEADER); response = new ParseHttpResponse.Builder() .setTotalSize(response.getTotalSize()) .setContentType(response.getContentType()) .setHeaders(newHeaders) .setReasonPhase(response.getReasonPhrase()) .setStatusCode(response.getStatusCode()) .setContent(new GZIPInputStream(response.getContent())) <START> .build(); <END> } return response; }</code><technical_language>add new ParseHttpResponse.Builder(ParseHttpResponse)</technical_language>

Target:
public ParseHttpResponse intercept(Chain chain) throws IOException { ParseHttpRequest request = chain.getRequest(); ParseHttpResponse response = chain.proceed(request); if (GZIP_ENCODING.equalsIgnoreCase(response.getHeader(CONTENT_ENCODING_HEADER))) { Map<String, String > newHeaders = new HashMap<>(response.getAllHeaders()); newHeaders.remove(CONTENT_ENCODING_HEADER); newHeaders.put(CONTENT_LENGTH_HEADER, "-1"); response = new ParseHttpResponse.Builder() .setTotalSize(-1) .setContentType(response.getContentType()) .setHeaders(newHeaders) .setReasonPhase(response.getReasonPhrase()) .setStatusCode(response.getStatusCode()) .setContent(new GZIPInputStream(response.getContent())) .build(); } return response; }
Source:
<code><START> public void should_increase_development_cards_when_user_buys_a_new_one() { <END> playPreparationStage() .THROW_DICE(1) .nextRandomDevelopmentCards(asList(KNIGHT, KNIGHT, ROAD_BUILDING, KNIGHT, YEAR_OF_PLENTY, YEAR_OF_PLENTY)) .startTrackDevCardsQuantity() .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChanged(1, 0, 0, 0, 0) .getGameDetails(2).gameUser(2).devCardsQuantityChanged(0, 0, 0, 0, 0) .getGameDetails(3).gameUser(3).devCardsQuantityChanged(0, 0, 0, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChanged(1, 0, 0, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChanged(0, 0, 1, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChanged(1, 0, 0, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChanged(0, 0, 0, 0, 1) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChanged(0, 0, 0, 0, 1); }</code><technical_language>is test case, if I return bought card (like happened today), this test case pass 'should_return_bought_card_in_response' fail. wise versa, if I return bought card increase user's dev cards, current test case fail 'should_return_bought_card_in_response' pass. I combine test cases test things. check in a single test case done in PreparationStageTest, I bad idea</technical_language>

Target:
public void should_increase_development_cards_when_user_buys_a_new_one() { playPreparationStage() .THROW_DICE(1) .nextRandomDevelopmentCards(asList(KNIGHT, KNIGHT, ROAD_BUILDING, KNIGHT, YEAR_OF_PLENTY, YEAR_OF_PLENTY)) .startTrackDevCardsQuantity() .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChangedBy(1, 0, 0, 0, 0) .getGameDetails(2).gameUser(2).devCardsQuantityChangedBy(0, 0, 0, 0, 0) .getGameDetails(3).gameUser(3).devCardsQuantityChangedBy(0, 0, 0, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChangedBy(1, 0, 0, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChangedBy(0, 0, 1, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChangedBy(1, 0, 0, 0, 0) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChangedBy(0, 0, 0, 0, 1) .BUY_CARD(1) .getGameDetails(1).gameUser(1).devCardsQuantityChangedBy(0, 0, 0, 0, 1); }
Source:
<code>public void testCreateProjectWithProperties() throws IOException { final String newProjectName = "newProject"; ProjectInput in = new ProjectInput(); in.description = "Test description"; in.submit_type = SubmitType.CHERRY_PICK; in.use_contributor_agreements = InheritableBoolean.TRUE; in.use_signed_off_by = InheritableBoolean.TRUE; in.use_content_merge = InheritableBoolean.TRUE; in.require_change_id = InheritableBoolean.TRUE; RestResponse r = session.put("/projects/" + newProjectName, in); @SuppressWarnings("serial") ProjectInfo p = (new Gson()).fromJson(r.getReader(), new TypeToken<ProjectInfo>() {}.getType()); <START> assertEquals(newProjectName, p.name); <END> Project project = projectCache.get(new Project.NameKey(newProjectName)).getProject(); assertEquals(in.description, project.getDescription()); assertEquals(in.submit_type, project.getSubmitType()); assertEquals(in.use_contributor_agreements, project.getUseContributorAgreements()); assertEquals(in.use_signed_off_by, project.getUseSignedOffBy()); assertEquals(in.use_content_merge, project.getUseContentMerge()); assertEquals(in.require_change_id, project.getRequireChangeID()); }</code><technical_language>other properties ProjectInfo returned project creation request? checked</technical_language>

Target:
public void testCreateProjectWithProperties() throws IOException { final String newProjectName = "newProject"; ProjectInput in = new ProjectInput(); in.description = "Test description"; in.submit_type = SubmitType.CHERRY_PICK; in.use_contributor_agreements = InheritableBoolean.TRUE; in.use_signed_off_by = InheritableBoolean.TRUE; in.use_content_merge = InheritableBoolean.TRUE; in.require_change_id = InheritableBoolean.TRUE; RestResponse r = session.put("/projects/" + newProjectName, in); @SuppressWarnings("serial") ProjectInfo p = (new Gson()).fromJson(r.getReader(), new TypeToken<ProjectInfo>() {}.getType()); assertEquals(newProjectName, p.name); Project project = projectCache.get(new Project.NameKey(newProjectName)).getProject(); assertProjectInfo(project, p); assertEquals(in.description, project.getDescription()); assertEquals(in.submit_type, project.getSubmitType()); assertEquals(in.use_contributor_agreements, project.getUseContributorAgreements()); assertEquals(in.use_signed_off_by, project.getUseSignedOffBy()); assertEquals(in.use_content_merge, project.getUseContentMerge()); assertEquals(in.require_change_id, project.getRequireChangeID()); }
Source:
<code>public void testDeepCopy() throws Exception { ZestRequest req = new ZestRequest (); req.setUrl(new URL("<LINK_0>{{token1}}")); req.setHeaders("Set-Cookie: test={{token2}}"); req.setData("test={{token3}}&user=12{{token3}}34"); req.addCookie(new ZestCookie("{{token}}.{{token3}}", "12{{token3}}34", "56{{token2}}78", "/{{token1}}A/{{token2}}B", new Date(), true)); ZestRequest req2 = req.deepCopy(); assertTrue(req.getHeaders().equals(req2.getHeaders())); assertTrue(req.getData().equals(req2.getData())); ZestCookie cookie = req.getZestCookies().get(0); ZestCookie cookie2 = req2.getZestCookies().get(0); <START> assertTrue("cookies should not be reference equals", !cookie.equals(cookie2)); <END> assertTrue(cookie.getDomain().equals(cookie2.getDomain())); assertTrue(cookie.getName().equals(cookie2.getName())); assertTrue(cookie.getValue().equals(cookie2.getValue())); assertTrue(cookie.getPath().equals(cookie2.getPath())); assertTrue(cookie.getExpiryDate().equals(cookie2.getExpiryDate())); assertTrue(cookie.isSecure() == cookie2.isSecure()); }</code><technical_language>!=, start fail (while shouldn't) ZestCookie properly implements equals</technical_language>

Target:
public void testDeepCopy() throws Exception { ZestRequest req = new ZestRequest (); req.setUrl(new URL("<LINK_0>{{token1}}")); req.setHeaders("Set-Cookie: test={{token2}}"); req.setData("test={{token3}}&user=12{{token3}}34"); req.addCookie(new ZestCookie("{{token}}.{{token3}}", "12{{token3}}34", "56{{token2}}78", "/{{token1}}A/{{token2}}B", new Date(), true)); ZestRequest req2 = req.deepCopy(); assertTrue(req.getHeaders().equals(req2.getHeaders())); assertTrue(req.getData().equals(req2.getData())); ZestCookie cookie = req.getZestCookies().get(0); ZestCookie cookie2 = req2.getZestCookies().get(0); assertTrue("cookies should not be reference equals", cookie != cookie2); assertTrue(cookie.getDomain().equals(cookie2.getDomain())); assertTrue(cookie.getName().equals(cookie2.getName())); assertTrue(cookie.getValue().equals(cookie2.getValue())); assertTrue(cookie.getPath().equals(cookie2.getPath())); assertTrue(cookie.getExpiryDate().equals(cookie2.getExpiryDate())); assertTrue(cookie.isSecure() == cookie2.isSecure()); }
Source:
<code>protected GoogleComputeEngineApi create(Properties props, Iterable<Module> modules) { GoogleComputeEngineApi api = super.create(props, modules); URI imageUri = api.getImageApiForProject("google") .list(new ListOptions.Builder().filter("name eq gcel.*")) .concat() .filter(new Predicate<Image>() { @Override public boolean apply(Image input) { if (input.getDeprecated().isPresent()) { <START> if (input.getDeprecated().get().getState().isPresent()) { <END> if (!input.getDeprecated().get().getState().get().equals("DEPRECATED")) { return false; } } } return true; } }) .first() .get() .getSelfLink(); instance = InstanceTemplate.builder() .forMachineType(getDefaultMachineTypeUrl(userProject.get())) .addNetworkInterface(getNetworkUrl(userProject.get(), INSTANCE_NETWORK_NAME), Instance.NetworkInterface.AccessConfig.Type.ONE_TO_ONE_NAT) .addMetadata("mykey", "myvalue") .description("a description") .addDisk(InstanceTemplate.PersistentDisk.Mode.READ_WRITE, getDiskUrl(userProject.get(), DISK_NAME)) .image(imageUri); return api; }</code><technical_language>Combine two? I.e. // filter out images deprecation state "DEPRECATED" if (input.getDeprecated().isPresent() && input.getDeprecated().get().getState().isPresent()) { return !input.getDeprecated().get().getState().get().equals("DEPRECATED"); } return true;</technical_language>

Target:
protected GoogleComputeEngineApi create(Properties props, Iterable<Module> modules) { GoogleComputeEngineApi api = super.create(props, modules); URI imageUri = api.getImageApiForProject("google") .list(new ListOptions.Builder().filter("name eq gcel.*")) .concat() .filter(new Predicate<Image>() { @Override public boolean apply(Image input) { if (input.getDeprecated().isPresent() && input.getDeprecated().get().getState().isPresent()) { return input.getDeprecated().get().getState().get().equals("DEPRECATED"); } return true; } }) .first() .get() .getSelfLink(); instance = InstanceTemplate.builder() .forMachineType(getDefaultMachineTypeUrl(userProject.get())) .addNetworkInterface(getNetworkUrl(userProject.get(), INSTANCE_NETWORK_NAME), Instance.NetworkInterface.AccessConfig.Type.ONE_TO_ONE_NAT) .addMetadata("mykey", "myvalue") .description("a description") .addDisk(InstanceTemplate.PersistentDisk.Mode.READ_WRITE, getDiskUrl(userProject.get(), DISK_NAME)) .image(imageUri); return api; }
Source:
<code>public AppiumDriver(URL remoteAddress, String sessionId) { this.setSessionId(sessionId); AppiumCommandExecutor executor = new AppiumCommandExecutor(MobileCommand.commandRepository, remoteAddress); <START> executor.setCommandCodec(new AppiumW3CHttpCommandCodec()); <END> executor.setResponseCodec(Dialect.W3C.getResponseCodec()); executor.configureW3CMode(); this.setCommandExecutor(executor); init(executor); }</code><technical_language>do this is a w3c sessions</technical_language>

Target:
public AppiumDriver(URL remoteAddress, String sessionId) { this.setSessionId(sessionId); AppiumCommandExecutor executor = new AppiumCommandExecutor(MobileCommand.commandRepository, remoteAddress); executor.configureW3CMode(); executor.setResponseCodec(Dialect.W3C.getResponseCodec()); this.setCommandExecutor(executor); init(executor); }
Source:
<code>private AbstractPlanNode handleDistinctWithGroupby(AbstractPlanNode root) { if (! m_parsedSelect.hasDistinctWithGroupBy()) { return root; } <START> assert(m_parsedSelect.hasBeenRewritten() || m_parsedSelect.isGrouped()); <END> if (m_parsedSelect.displayColumnsContainAllGroupByColumns()) { return root; } assert(m_parsedSelect.hasComplexAgg()); AggregatePlanNode distinctAggNode = new HashAggregatePlanNode(); distinctAggNode.setOutputSchema(m_parsedSelect.getDistinctProjectionSchema()); for (ParsedColInfo col : m_parsedSelect.distinctGroupByColumns()) { distinctAggNode.addGroupByExpression(col.expression); } distinctAggNode.addAndLinkChild(root); root = distinctAggNode; return root; }</code><technical_language>This is place m_isRewritten flag. clear need it. I check m_parsedSelect.hasDistinctWithGroupBy() fail above. statement a GB clause rewritten. Is this case</technical_language>

Target:
private AbstractPlanNode handleDistinctWithGroupby(AbstractPlanNode root) { if (! m_parsedSelect.hasDistinctWithGroupBy()) { return root; } assert(m_parsedSelect.isGrouped()); if (m_parsedSelect.displayColumnsContainAllGroupByColumns()) { return root; } assert(m_parsedSelect.hasComplexAgg()); AggregatePlanNode distinctAggNode = new HashAggregatePlanNode(); distinctAggNode.setOutputSchema(m_parsedSelect.getDistinctProjectionSchema()); for (ParsedColInfo col : m_parsedSelect.distinctGroupByColumns()) { distinctAggNode.addGroupByExpression(col.m_expression); } distinctAggNode.addAndLinkChild(root); root = distinctAggNode; return root; }
Source:
<code><START> public void process( EventData<?> eventData ) <END> { }</code><technical_language>So, I guess update a dropwizard Metrics instance for event rate? simple</technical_language>

Target:
public void process( EventData<?> eventData ) { if ( metricsConfig != null && metricsManager != null ) { String name = getName( metricsConfig.getNodePrefix(), TRANSFER_HONEYCOMB_EVENT, getDefaultName( IndyEventPostProcessor.class, "process" ), METER ); Meter meter = metricsManager.getMeter( name ); meter.mark(); } }
Source:
<code>public boolean isTestingData() { boolean isTestingAccount = false; <START> if(email.endsWith(".tmt")){ <END> isTestingAccount = true; } return isTestingAccount; }</code><technical_language>Put a space if (</technical_language>

Target:
public boolean isTestingData() { return email.endsWith(".tmt"); }
Source:
<code>String getFileName(final Diagram diagram) { <START> Metadata metadata = diagram.getMetadata(); <END> final Optional<Path> path = Optional.ofNullable(metadata.getPath()); return path.map(Path::getFileName).orElse(translationService.format(DMNDocumentationFactory_NoFileName)); }</code><technical_language>final</technical_language>

Target:
String getFileName(final Diagram diagram) { final Metadata metadata = diagram.getMetadata(); final Optional<Path> path = Optional.ofNullable(metadata.getPath()); return path.map(Path::getFileName).orElse(translationService.format(DMNDocumentationFactory_NoFileName)); }
Source:
<code>public XmlConfiguration(URL url, final ClassLoader classLoader, final Map<String, ClassLoader> cacheClassLoaders) throws ClassNotFoundException, SAXException, InstantiationException, IllegalAccessException, IOException { if(url == null) { <START> throw new NullPointerException("The resource specified by the URL does not exist"); <END> } this.xml = url; this.classLoader = classLoader; this.cacheClassLoaders = new HashMap<String, ClassLoader>(cacheClassLoaders); parseConfiguration(); }</code><technical_language>correct message. message be: "Url null". while it, I null in parameters is error also</technical_language>

Target:
public XmlConfiguration(URL url, final ClassLoader classLoader, final Map<String, ClassLoader> cacheClassLoaders) throws ClassNotFoundException, SAXException, InstantiationException, IllegalAccessException, IOException { if(url == null) { throw new NullPointerException("The url can not be null"); } if(classLoader == null) { throw new NullPointerException("The classLoader can not be null"); } if(cacheClassLoaders == null) { throw new NullPointerException("The cacheClassLoaders map can not be null"); } this.xml = url; this.classLoader = classLoader; this.cacheClassLoaders = new HashMap<String, ClassLoader>(cacheClassLoaders); parseConfiguration(); }
Source:
<code>public static int compareSoftwareVersions(String firstVersion, String secondVersion) throws IOException { int GREATER_THAN = 1; int EQUAL = 0; int LESS_THAN = -1; if (firstVersion == null) { return LESS_THAN; } if (secondVersion == null) { return GREATER_THAN; } String[] firstParts = firstVersion.split("\\."); String[] secondParts = secondVersion.split("\\."); int firstMajor = firstParts.length >= 1 ? Integer.parseInt(firstParts[0]) : 0; int firstMinor = firstParts.length >= 2 ? Integer.parseInt(firstParts[1]) : 0; int secondMajor = secondParts.length >= 1 ? Integer.parseInt(secondParts[0]) : 0; int secondMinor = secondParts.length >= 2 ? Integer.parseInt(secondParts[1]) : 0; if (firstMajor == secondMajor && firstMinor == secondMinor) { return EQUAL; } else if (firstMajor > secondMajor) { return GREATER_THAN; } else if (firstMajor < secondMajor) { return LESS_THAN; } else if (firstMinor > secondMinor) { return GREATER_THAN; } else if (firstMinor < secondMinor) { return LESS_THAN; } <START> return EQUAL; <END> }</code><technical_language>I this is dead code: line 250 firstMajor == secondMajor firstMinor != secondMinor, is possibility of reaching this line</technical_language>

Target:
public static int compareSoftwareVersions(String firstVersion, String secondVersion) throws IOException { int GREATER_THAN = 1; int EQUAL = 0; int LESS_THAN = -1; if (firstVersion == null) { return LESS_THAN; } if (secondVersion == null) { return GREATER_THAN; } String[] firstParts = firstVersion.split("\\."); String[] secondParts = secondVersion.split("\\."); int firstMajor = firstParts.length >= 1 ? Integer.parseInt(firstParts[0]) : 0; int firstMinor = firstParts.length >= 2 ? Integer.parseInt(firstParts[1]) : 0; int secondMajor = secondParts.length >= 1 ? Integer.parseInt(secondParts[0]) : 0; int secondMinor = secondParts.length >= 2 ? Integer.parseInt(secondParts[1]) : 0; if (firstMajor == secondMajor && firstMinor == secondMinor) { return EQUAL; } else if (firstMajor > secondMajor) { return GREATER_THAN; } else if (firstMajor < secondMajor) { return LESS_THAN; } else if (firstMinor > secondMinor) { return GREATER_THAN; } else { return LESS_THAN; } }
Source:
<code><START> public PerReplicaThrottleStage(boolean enableEmitThrottledMsg) { <END> isEmitThrottledMsg = enableEmitThrottledMsg; }</code><technical_language>Is this for testing? protected</technical_language>

Target:
protected PerReplicaThrottleStage(boolean enableEmitThrottledMsg) { isEmitThrottledMsg = enableEmitThrottledMsg; }
Source:
<code>String serialize(final String uniqueUserId) throws AuthenticationException { final String methodName = ":serialize"; if (StringExtensions.isNullOrBlank(uniqueUserId)) { throw new IllegalArgumentException("uniqueUserId"); } if (mBrokerProxy.canSwitchToBroker(mAuthority) != BrokerProxy.SwitchToBroker.CANNOT_SWITCH_TO_BROKER) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the family refresh token cache item because broker is enabled."); } final TokenCacheAccessor tokenCacheAccessor = new TokenCacheAccessor(mTokenCacheStore, this.getAuthority(), Telemetry.registerNewRequest()); final TokenCacheItem tokenItem; try { tokenItem = tokenCacheAccessor.getFRTItem(AuthenticationConstants.MS_FAMILY_ID, uniqueUserId); } catch (final MalformedURLException e) { throw new AuthenticationException(ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL, e.getMessage(), e); } if (tokenItem == null) { Logger.i(TAG + methodName, "Cannot find the family token cache item for this userID", ""); throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the FID because no family token cache item is found."); } if (!StringExtensions.isNullOrBlank(tokenItem.getFamilyClientId())) { return SSOStateSerializer.serialize(tokenItem); } else { <START> throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "tokenItem does not contain family refresh token"); <END> } }</code><technical_language>This good me. A minor nit, change condition around. !IsNull a double negative me. if (isNull) throw UsageAuthenticationException; // need for else return SSOStateSerializer.serialize(tokenItem);</technical_language>

Target:
String serialize(final String uniqueUserId) throws AuthenticationException { final String methodName = ":serialize"; if (StringExtensions.isNullOrBlank(uniqueUserId)) { throw new IllegalArgumentException("uniqueUserId"); } if (mBrokerProxy.canSwitchToBroker(mAuthority) != BrokerProxy.SwitchToBroker.CANNOT_SWITCH_TO_BROKER) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the family refresh token cache item because broker is enabled."); } final TokenCacheAccessor tokenCacheAccessor = new TokenCacheAccessor(mTokenCacheStore, this.getAuthority(), Telemetry.registerNewRequest()); final TokenCacheItem tokenItem; try { tokenItem = tokenCacheAccessor.getFRTItem(AuthenticationConstants.MS_FAMILY_ID, uniqueUserId); } catch (final MalformedURLException e) { throw new AuthenticationException(ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL, e.getMessage(), e); } if (tokenItem == null) { Logger.i(TAG + methodName, "Cannot find the family token cache item for this userID", ""); throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the FID because no family token cache item is found."); } if (StringExtensions.isNullOrBlank(tokenItem.getFamilyClientId())) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "tokenItem does not contain family refresh token"); } return SSOStateSerializer.serialize(tokenItem); }
Source:
<code>public List<ItemFormMetadata> findAllByCrfVersion(int crf_version_id) { <START> String query = "select distinct * from item_form_metadata ifm where ifm.crf_version_id = " + crf_version_id; <END> org.hibernate.Query q = getCurrentSession().createSQLQuery(query).addEntity(ItemFormMetadata.class); return (List<ItemFormMetadata>) q.list(); }</code><technical_language>Please positional parameters</technical_language>

Target:
public List<ItemFormMetadata> findAllByCrfVersion(int crf_version_id) { org.hibernate.Query q = getCurrentSession().createSQLQuery(findAllByCrfVersionQuery).addEntity(ItemFormMetadata.class); q.setInteger("crfversionid", crf_version_id); return (List<ItemFormMetadata>) q.list(); }
Source:
<code>public double getInterestRate(Double time) { double discountFactor = getDiscountFactor(time); <START> return -Math.log(discountFactor) / time; <END> }</code><technical_language>Needs handling for time \sim 0. implement formula calling discountFactor(time)</technical_language>

Target:
public double getInterestRate(Double time) { final double rate = _baseCurve.getYValue(time) + _sign * _fixedCurve.getYValue(time); return _compoundingPeriodsPerYear * Math.log(1.0d + rate / _compoundingPeriodsPerYear); }
Source:
<code>private II getPatientIdFromRequest(PRPAIN201305UV02 request) { II livingSubjectId = null; if (request != null && request.getControlActProcess() != null && request.getControlActProcess().getQueryByParameter() != null && request.getControlActProcess().getQueryByParameter().getValue() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() .getLivingSubjectId() != null) { List<PRPAMT201306UV02LivingSubjectId> ids = request.getControlActProcess().getQueryByParameter().getValue() .getParameterList().getLivingSubjectId(); if (ids.size() == 1) { livingSubjectId = getLivingSubjectId(ids.get(0)); } else if (ids.size() > 1) { <START> String root = request.getControlActProcess().getAuthorOrPerformer().get(0).getAssignedDevice() <END> .getValue().getId().get(0).getRoot(); for (PRPAMT201306UV02LivingSubjectId id : ids) { II oII = getLivingSubjectId(id); if (oII != null && oII.getRoot() != null && oII.getRoot().equals(root)) { livingSubjectId = oII; break; } } } } else { LOG.error("PatientId doesn't exist in the received PRPAIN201305UV02 message"); } return livingSubjectId; }</code><technical_language>null checks for getAuthorOrPerformer subsequent calls. throw null pointer index out of bounds. checks done elsewhere? want exception thrown in auditing message processing fail</technical_language>

Target:
private II getPatientIdFromRequest(PRPAIN201305UV02 request) { II livingSubjectId = null; if (request != null && request.getControlActProcess() != null && request.getControlActProcess().getQueryByParameter() != null && request.getControlActProcess().getQueryByParameter().getValue() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() != null && request.getControlActProcess().getQueryByParameter().getValue().getParameterList() .getLivingSubjectId() != null) { List<PRPAMT201306UV02LivingSubjectId> ids = request.getControlActProcess().getQueryByParameter().getValue() .getParameterList().getLivingSubjectId(); if (ids.size() == 1) { livingSubjectId = getLivingSubjectId(ids.get(0)); } else if (ids.size() > 1) { livingSubjectId = getLivingSubjectIdFromAuthorOrPerformerValue(request, ids); } } else { LOG.error("PatientId doesn't exist in the received PRPAIN201305UV02 message"); } return livingSubjectId; }
Source:
<code>protected JSONObject search(@NonNull Query query) throws AlgoliaException { String cacheKey = null; String jsonStr = null; if (isCacheEnabled) { cacheKey = String.format("%s", query.getQueryString()); jsonStr = searchCache.get(cacheKey); } try { if (jsonStr == null) { jsonStr = new String(searchRaw(query), "UTF-8"); if (isCacheEnabled) { <START> searchCache.put(cacheKey, jsonStr); <END> } } return BaseAPIClient._getJSONObject(jsonStr); } catch (UnsupportedEncodingException | JSONException e) { throw new AlgoliaException(e.getMessage()); } }</code><technical_language>I store response in cache parses correctly</technical_language>

Target:
protected JSONObject search(@NonNull Query query) throws AlgoliaException { String cacheKey = null; byte[] rawResponse = null; if (isCacheEnabled) { cacheKey = String.format("%s", query.getQueryString()); rawResponse = searchCache.get(cacheKey); } try { if (rawResponse == null) { rawResponse = searchRaw(query); if (isCacheEnabled) { searchCache.put(cacheKey, rawResponse); } } return BaseAPIClient._getJSONObject(rawResponse); } catch (UnsupportedEncodingException | JSONException e) { throw new AlgoliaException(e.getMessage()); } }
Source:
<code>public boolean isFileValid() { <START> String fileExstenstion = fileUpload.getFilename().substring(fileUpload.getFilename().lastIndexOf(".") + 1); <END> if (isValidation && !allowedFiles.contains(fileExstenstion)) { return false; } return true; }</code><technical_language>Extension\* If want update this</technical_language>

Target:
public boolean isFileValid() { String fileExtension = fileUpload.getFilename().substring(fileUpload.getFilename().lastIndexOf(".") + 1); if (isValidation && !allowedFiles.contains(fileExtension)) { return false; } return true; }
Source:
<code>public List<Buffer> requestInflightBuffers(long checkpointId) throws IOException { synchronized (receivedBuffers) { checkState(checkpointId > lastRequestedCheckpointId, "Need to request the next checkpointId"); final List<Buffer> inflightBuffers = new ArrayList<>(receivedBuffers.size()); for (Buffer buffer : receivedBuffers) { <START> if (!buffer.isBuffer() && parseCheckpointBarrierOrNull(buffer) != null) { <END> break; } inflightBuffers.add(buffer.retainBuffer()); } lastRequestedCheckpointId = checkpointId; return inflightBuffers; } }</code><technical_language>Some optimizations (not if worth it): 1. buffer.isBuffer is needed done parseCheckpointBarrierOrNull 1. check receivedCheckpointId > checkpointId</technical_language>

Target:
public List<Buffer> requestInflightBuffers(long checkpointId) throws IOException { synchronized (receivedBuffers) { checkState(checkpointId > lastRequestedCheckpointId, "Need to request the next checkpointId"); final List<Buffer> inflightBuffers = new ArrayList<>(receivedBuffers.size()); for (Buffer buffer : receivedBuffers) { CheckpointBarrier checkpointBarrier = parseCheckpointBarrierOrNull(buffer); if (checkpointBarrier != null && checkpointBarrier.getId() >= checkpointId) { break; } if (buffer.isBuffer()) { inflightBuffers.add(buffer.retainBuffer()); } } lastRequestedCheckpointId = checkpointId; return inflightBuffers; } }
Source:
<code>public String getAsText() { Focus val = (Focus) getValue(); if (val == null) return null; <START> return val.getStringValue(); <END> }</code><technical_language>this java return ImOption.apply((Focus) getValue()).map(f -> f.getStringValue()).getOrNull();</technical_language>

Target:
public String getAsText() { return ImOption.apply((Focus) getValue()).map(f -> f.getStringValue()).getOrNull(); }
Source:
<code>public void connectsToAnotherGithubServer() throws Exception { <START> final RtGithub github = new RtGithub(URI.create("http://localhost:12345")); <END> MatcherAssert.assertThat( github.entry().uri().toString(), Matchers.equalTo( "http://localhost:12345/" ) ); }</code><technical_language>@perfa inline this variable</technical_language>

Target:
public void connectsToAnotherGithubServer() throws Exception { MatcherAssert.assertThat( new RtGithub(URI.create("http://localhost:12345")) .entry().uri().toString(), Matchers.equalTo( "http://localhost:12345/" ) ); }
Source:
<code>public void testDeleteRecordV2() throws IOException, MessageFormatException { ByteBuffer deleteRecord = ByteBuffer.allocate(MessageFormatRecord.Delete_Format_V2.getDeleteRecordSize()); short accountId = Utils.getRandomShort(TestUtils.RANDOM); short containerId = Utils.getRandomShort(TestUtils.RANDOM); <START> int deletionTimeSecs = TestUtils.RANDOM.nextInt(); <END> MessageFormatRecord.Delete_Format_V2.serializeDeleteRecord(deleteRecord, accountId, containerId, deletionTimeSecs); deleteRecord.flip(); DeleteRecord deserializeDeleteRecord = MessageFormatRecord.deserializeDeleteRecord(new ByteBufferInputStream(deleteRecord)); Assert.assertEquals("Delete record version mismatch ", deserializeDeleteRecord.getVersion(), MessageFormatRecord.Delete_Version_V2); Assert.assertEquals("AccountId mismatch ", accountId, deserializeDeleteRecord.getAccountId()); Assert.assertEquals("ContainerId mismatch ", containerId, deserializeDeleteRecord.getContainerId()); Assert.assertEquals("DeletionTime mismatch ", deletionTimeSecs, deserializeDeleteRecord.getDeletionTimeInSecs()); deleteRecord.flip(); deleteRecord.put(10, (byte) 4); try { MessageFormatRecord.deserializeDeleteRecord(new ByteBufferInputStream(deleteRecord)); Assert.assertEquals(true, false); } catch (MessageFormatException e) { Assert.assertEquals(e.getErrorCode(), MessageFormatErrorCodes.Data_Corrupt); } }</code><technical_language>do current time + delta</technical_language>

Target:
public void testDeleteRecordV2() throws IOException, MessageFormatException { ByteBuffer deleteRecord = ByteBuffer.allocate(MessageFormatRecord.Delete_Format_V2.getDeleteRecordSize()); short accountId = Utils.getRandomShort(TestUtils.RANDOM); short containerId = Utils.getRandomShort(TestUtils.RANDOM); long deletionTimeMs = SystemTime.getInstance().milliseconds() + TestUtils.RANDOM.nextInt(); MessageFormatRecord.Delete_Format_V2.serializeDeleteRecord(deleteRecord, new DeleteRecord(accountId, containerId, deletionTimeMs)); deleteRecord.flip(); DeleteRecord deserializeDeleteRecord = MessageFormatRecord.deserializeDeleteRecord(new ByteBufferInputStream(deleteRecord)); Assert.assertEquals("AccountId mismatch ", accountId, deserializeDeleteRecord.getAccountId()); Assert.assertEquals("ContainerId mismatch ", containerId, deserializeDeleteRecord.getContainerId()); Assert.assertEquals("DeletionTime mismatch ", deletionTimeMs, deserializeDeleteRecord.getDeletionTimeInMs()); deleteRecord.flip(); byte toCorrupt = deleteRecord.get(10); deleteRecord.put(10, (byte) (toCorrupt + 1)); try { MessageFormatRecord.deserializeDeleteRecord(new ByteBufferInputStream(deleteRecord)); fail("Deserialization of a corrupt delete record V2 should have failed "); } catch (MessageFormatException e) { Assert.assertEquals(e.getErrorCode(), MessageFormatErrorCodes.Data_Corrupt); } }
Source:
<code>protected String getAccessTokenIdFromRequest(final HttpServletRequest request) { var accessToken = request.getParameter(OAuth20Constants.ACCESS_TOKEN); if (StringUtils.isBlank(accessToken)) { val authHeader = request.getHeader(HttpConstants.AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(authHeader) && authHeader.toLowerCase() .startsWith(OAuth20Constants.TOKEN_TYPE_BEARER.toLowerCase() + ' ')) { accessToken = authHeader.substring(OAuth20Constants.TOKEN_TYPE_BEARER.length() + 1); } } LOGGER.debug("[{}]: [{}]", OAuth20Constants.ACCESS_TOKEN, accessToken); <START> return OAuth20Utils.getAccessTokenId(accessToken, getOAuthConfigurationContext().getOAuthAccessTokenIdExtractor()); <END> }</code><technical_language>above. Simply call extractor, pushing functionality utils</technical_language>

Target:
protected String getAccessTokenIdFromRequest(final HttpServletRequest request) { var accessToken = request.getParameter(OAuth20Constants.ACCESS_TOKEN); if (StringUtils.isBlank(accessToken)) { val authHeader = request.getHeader(HttpConstants.AUTHORIZATION_HEADER); if (StringUtils.isNotBlank(authHeader) && authHeader.toLowerCase() .startsWith(OAuth20Constants.TOKEN_TYPE_BEARER.toLowerCase() + ' ')) { accessToken = authHeader.substring(OAuth20Constants.TOKEN_TYPE_BEARER.length() + 1); } } LOGGER.debug("[{}]: [{}]", OAuth20Constants.ACCESS_TOKEN, accessToken); return getOAuthConfigurationContext().getAccessTokenIdExtractor().extractId(accessToken); }
Source:
<code>private RelationshipMetadataValue constructMetadataValue(Context context, String key) { try { String[] splittedKey = key.split("\\."); RelationshipMetadataValue metadataValue = new RelationshipMetadataValue(); String metadataSchema = splittedKey.length > 0 ? splittedKey[0] : null; String metadataElement = splittedKey.length > 1 ? splittedKey[1] : null; String metadataQualifier = splittedKey.length > 2 ? splittedKey[2] : null; MetadataField metadataField = metadataFieldService .findByElement(context, metadataSchema, metadataElement, metadataQualifier); if (metadataField == null) { log.error( "A MetadataValue was attempted to construct with MetadataField for paremeters: metadataschema: " + metadataSchema + ", metadataelement:" + metadataElement + <START> ", metadataqualifier: " + metadataQualifier); <END> return null; } metadataValue.setMetadataField(metadataField); metadataValue.setLanguage(Item.ANY); return metadataValue; } catch (SQLException e) { log.error(e.getMessage(), e); } return null; }</code><technical_language>log4j v2, format this log statement string concatenation, this: log.error("A MetadataValue attempted construct MetadataField for parameters: metadataschema: {}, metadataelement: {}, metadataqualifier: {}", metadataSchema, metadataElement, metadataQualifier);</technical_language>

Target:
private RelationshipMetadataValue constructMetadataValue(Context context, String key) { String[] splittedKey = key.split("\\."); RelationshipMetadataValue metadataValue = new RelationshipMetadataValue(); String metadataSchema = splittedKey.length > 0 ? splittedKey[0] : null; String metadataElement = splittedKey.length > 1 ? splittedKey[1] : null; String metadataQualifier = splittedKey.length > 2 ? splittedKey[2] : null; MetadataField metadataField = null; try { metadataField = metadataFieldService .findByElement(context, metadataSchema, metadataElement, metadataQualifier); } catch (SQLException e) { log.error("Could not find element with MetadataSchema: " + metadataSchema + ", MetadataElement: " + metadataElement + " and MetadataQualifier: " + metadataQualifier, e); return null; } if (metadataField == null) { log.error("A MetadataValue was attempted to construct with MetadataField for parameters: " + "metadataschema: {}, metadataelement: {}, metadataqualifier: {}", metadataSchema, metadataElement, metadataQualifier); return null; } metadataValue.setMetadataField(metadataField); metadataValue.setLanguage(Item.ANY); return metadataValue; }
Source:
<code>private void setVolumeOptions(GlusterVolumeEntity volume) { List<String> errors = new ArrayList<String>(); for (GlusterVolumeOptionEntity option : volume.getOptions()) { option.setVolumeId(volume.getId()); <START> <END> VdcReturnValueBase setOptionReturnValue = runBllAction( VdcActionType.SetGlusterVolumeOption, new GlusterVolumeOptionParameters(option), createCommandContext(volume, option)); if (!getSucceeded()) { errors.addAll(setOptionReturnValue.getCanDoActionMessages()); errors.addAll(setOptionReturnValue.getExecuteFailedMessages()); } } if (!errors.isEmpty()) { handleVdsErrors(AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED, errors); } }</code><technical_language>runBllAction introduced in earlier patch, i fill sequence of this method is clear: perform runBllAction() current command status is updated. I referring return of command clearer understand</technical_language>

Target:
private void setVolumeOptions(GlusterVolumeEntity volume) { List<String> errors = new ArrayList<String>(); for (GlusterVolumeOptionEntity option : volume.getOptions()) { option.setVolumeId(volume.getId()); VdcReturnValueBase setOptionReturnValue = getBackend().runInternalAction( VdcActionType.SetGlusterVolumeOption, new GlusterVolumeOptionParameters(option), createCommandContext(volume, option)); if (!setOptionReturnValue.getSucceeded()) { setSucceeded(false); errors.addAll(setOptionReturnValue.getCanDoActionMessages()); errors.addAll(setOptionReturnValue.getExecuteFailedMessages()); } } if (!errors.isEmpty()) { handleVdsErrors(AuditLogType.GLUSTER_VOLUME_OPTION_SET_FAILED, errors); } }
Source:
<code>static URL getLookupsUpdateURL(HostAndPort druidNode) throws MalformedURLException { return new URL( "http", druidNode.getHostText(), druidNode.getPortOrDefault(-1), <START> ListenerResource.BASE_PATH + "/" + LOOKUP_LISTEN_ANNOUNCE_KEY + "/" + "updates" <END> ); }</code><technical_language>(optional) this a static string</technical_language>

Target:
static URL getLookupsUpdateURL(HostAndPort druidNode) throws MalformedURLException { return new URL( "http", druidNode.getHostText(), druidNode.getPortOrDefault(-1), LOOKUP_UPDATE_REQUEST_PATH ); }
Source:
<code><START> void process() { <END> sendCommandsToDelegate(); getDelegate().prepare(); }</code><technical_language>Is a reason process mapper level prepare engine/backend level</technical_language>

Target:
void process() { sendCommandsToDelegate(); getDelegate().process(); }
Source:
<code>private static InstallableComponent[] createComponents(@NotNull FirstRunWizardMode reason, boolean createAvd) { AndroidSdk androidSdk = new AndroidSdk(); ArrayList<InstallableComponent> components = <START> new ArrayList<InstallableComponent>(); <END> components.add(androidSdk); if (Haxm.canRun() && reason == FirstRunWizardMode.NEW_INSTALL) { components.add(new Haxm(KEY_CUSTOM_INSTALL)); } if (createAvd) { components.add(new AndroidVirtualDevice()); } return components.toArray(new InstallableComponent[components.size()]); }</code><technical_language>Lists.newArrayList() (or newArrayListWithCapacity())</technical_language>

Target:
private static InstallableComponent[] createComponents(@NotNull FirstRunWizardMode reason, boolean createAvd) { AndroidSdk androidSdk = new AndroidSdk(); List<InstallableComponent> components = Lists.newArrayList(); components.add(androidSdk); if (Haxm.canRun() && reason == FirstRunWizardMode.NEW_INSTALL) { components.add(new Haxm(KEY_CUSTOM_INSTALL)); } if (createAvd) { components.add(new AndroidVirtualDevice()); } return components.toArray(new InstallableComponent[components.size()]); }
Source:
<code>private Map<String, Integer> getLoadStatus() { Map<String, Integer> status = null; try { <START> StatusResponseHolder response = makeRequest(HttpMethod.GET, getCoordinatorURL() + "loadstatus"); <END> status = jsonMapper.readValue( response.getContent(), new TypeReference<Map<String, Integer>>() { } ); } catch (Exception e) { Throwables.propagate(e); } return status; }</code><technical_language>this is touched, URL building methods instead of string building</technical_language>

Target:
private Map<String, Integer> getLoadStatus() { Map<String, Integer> status = null; try { StatusResponseHolder response = makeRequest(HttpMethod.GET, getLoadStatusURL()); status = jsonMapper.readValue( response.getContent(), new TypeReference<Map<String, Integer>>() { } ); } catch (Exception e) { Throwables.propagate(e); } return status; }
Source:
<code>public String getEncodedParameter(String name) { <START> Matcher matcher = Pattern.compile(Pattern.quote(name) + "=([^&]+)").matcher(queryString); <END> if (matcher.find()) { return matcher.group(1); } else { return Util.urlEncoder(getParameter(name)); } }</code><technical_language>nit: gonna point out this stop matching parameter # avoid including fragment value, querystrings passed fragments</technical_language>

Target:
public String getEncodedParameter(String name) { Matcher matcher = Pattern.compile(Pattern.quote(name) + "=([^&#]+)").matcher(queryString); if (matcher.find()) { return matcher.group(1); } else { return Util.urlEncoder(getParameter(name)); } }
Source:
<code>public Collection<Specification<Boolean>> collectSpecifications(URL[] classpath, List<TestResult> testClasses, Collection<TestCase> failures) { int nbFailingTestExecution = 0; int nbPassedTestExecution = 0; SpecificationTestCasesListener<Boolean> listener = new SpecificationTestCasesListener<>(runtimeValues); AngelicExecution.enable(); CompoundResult firstResult = TestSuiteExecution.runTestCases(failures, classLoader, listener, config); nbFailingTestExecution += listener.numberOfFailedTests(); nbPassedTestExecution += listener.numberOfTests() - listener.numberOfFailedTests(); AngelicExecution.flip(); CompoundResult secondResult = TestSuiteExecution.runTestCases(failures, classLoader, listener, config); nbFailingTestExecution += listener.numberOfFailedTests(); nbPassedTestExecution += listener.numberOfTests() - listener.numberOfFailedTests(); AngelicExecution.disable(); if (determineViability(firstResult, secondResult)) { TestSuiteExecution.runTestResult(testClasses, classLoader, listener, config); } <START> return listener.specifications(); <END> }</code><technical_language>remove variable declaration also</technical_language>

Target:
public Collection<Specification<Boolean>> collectSpecifications(URL[] classpath, List<TestResult> testClasses, Collection<TestCase> failures) { SpecificationTestCasesListener<Boolean> listener = new SpecificationTestCasesListener<>(runtimeValues); AngelicExecution.enable(); CompoundResult firstResult = TestSuiteExecution.runTestCases(failures, classLoader, listener, config); AngelicExecution.flip(); CompoundResult secondResult = TestSuiteExecution.runTestCases(failures, classLoader, listener, config); AngelicExecution.disable(); if (determineViability(firstResult, secondResult)) { TestSuiteExecution.runTestResult(testClasses, classLoader, listener, config); } return listener.specifications(); }
Source:
<code>public void checkAccess(final Path path, <START> AccessMode... modes) { <END> checkNotNull("path", path); checkNotNull("modes", modes); checkFileNotExistThenThrow(path, false); if (path.toFile() != null) { for (final AccessMode mode : modes) { checkNotNull("mode", mode); switch (mode) { case READ: if (!path.toFile().canRead()) { throw new AccessDeniedException(path.toString()); } break; case EXECUTE: if (!path.toFile().canExecute()) { throw new AccessDeniedException(path.toString()); } break; case WRITE: if (!path.toFile().canWrite()) { throw new AccessDeniedException(path.toString()); } break; } } } }</code><technical_language>please final due consistency rest of parameters</technical_language>

Target:
public void checkAccess(final Path path, AccessMode... modes) throws UnsupportedOperationException, NoSuchFileException, AccessDeniedException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("modes", modes); checkFileNotExistThenThrow(path, false); if (path.toFile() != null) { for (final AccessMode mode : modes) { checkNotNull("mode", mode); switch (mode) { case READ: if (!path.toFile().canRead()) { throw new AccessDeniedException(path.toString()); } break; case EXECUTE: if (!path.toFile().canExecute()) { throw new AccessDeniedException(path.toString()); } break; case WRITE: if (!path.toFile().canWrite()) { throw new AccessDeniedException(path.toString()); } break; } } } }