auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double rowCount = mq.getRowCount(this); switch (joinType) { case SEMI: case ANTI: break; case RIGHT: rowCount = RelMdUtil.addEpsilon(rowCount); break; default: if (RelNodes.COMPARATOR.compare(left, right) > 0) { rowCount = RelMdUtil.addEpsilon(rowCount); } } RelOptCostFactory costFactory = planner.getCostFactory(); final double rightRowCount = right.estimateRowCount(mq); final double leftRowCount = left.estimateRowCount(mq); if (Double.isInfinite(leftRowCount) || Double.isInfinite(rightRowCount)) { return costFactory.makeInfiniteCost(); } if (isSemiJoin()) { rowCount += rightRowCount * 1.1d; return costFactory.makeCost(rowCount, 0, 0).multiplyBy(.01d); } else { rowCount += leftRowCount * 1.1d; <START> return costFactory.makeCost(rowCount, 0, 0); <END> } }</code><technical_language>a hash cost is row_cnt * 1.1</technical_language>

Target:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double rowCount = mq.getRowCount(this); switch (joinType) { case SEMI: case ANTI: break; case RIGHT: rowCount = RelMdUtil.addEpsilon(rowCount); break; default: if (RelNodes.COMPARATOR.compare(left, right) > 0) { rowCount = RelMdUtil.addEpsilon(rowCount); } } final double rightRowCount = right.estimateRowCount(mq); final double leftRowCount = left.estimateRowCount(mq); if (Double.isInfinite(leftRowCount)) { rowCount = leftRowCount; } else { rowCount += Util.nLogN(leftRowCount); } if (Double.isInfinite(rightRowCount)) { rowCount = rightRowCount; } else { rowCount += rightRowCount; } if (isSemiJoin()) { return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d); } else { return planner.getCostFactory().makeCost(rowCount, 0, 0); } }
Source:
<code>public Date getPasswordExpiresOn() { <START> return mPasswordExpiresOn != null ? (Date) mPasswordExpiresOn.clone() : null; <END> }</code><technical_language>PasswordExpiresOn != null ? (Date) mPasswordExpiresOn.clone() : null [](start = 16, length = 68) getImmutableDate function renamed #Closed</technical_language>

Target:
public Date getPasswordExpiresOn() { return Utility.getImmutableDateObject(mPasswordExpiresOn); }
Source:
<code>public void onEvent(final CacheEvent<? extends String, ? extends Ticket> event) { <START> if (LOGGER.isTraceEnabled()) { <END> LOGGER.trace("Event Type: {}, Ticket Id: {}", event.getType().name(), event.getKey()); } }</code><technical_language>if condition unnecessary event.getXyz() calls expensive</technical_language>

Target:
public void onEvent(final CacheEvent<? extends String, ? extends Ticket> event) { LOGGER.trace("Event Type: {}, Ticket Id: {}", event.getType().name(), event.getKey()); }
Source:
<code>private String getApplicationFilename() { String name = project.getBuild().getFinalName(); if (stripVersion) { int versionBeginIndex = project.getBuild().getFinalName().lastIndexOf("-" + project.getVersion()); if ( versionBeginIndex != -1) { name = project.getBuild().getFinalName().substring(0, versionBeginIndex); } } switch (project.getPackaging()) { case "ear": case "war": case "eba": case "esa": name += "." + project.getPackaging(); if (looseConfig) { name += ".xml"; } break; case "liberty-assembly": File dir = new File(project.getBasedir() + "/src/main/webapp"); if (dir.exists()) { name += ".war"; if (looseConfig) { name += ".xml"; } <START> } <END> break; default: log.debug("The project artifact can't be installed to Liberty server because " + project.getPackaging() + " is not one of the supported types"); name = null; break; } return name; }</code><technical_language>I change, fix debug message below: log.debug("The project artifact installed a Liberty server " + project.getPackaging() + " is a supported packaging type.");</technical_language>

Target:
private String getApplicationFilename() { String name = project.getBuild().getFinalName(); if (stripVersion) { int versionBeginIndex = project.getBuild().getFinalName().lastIndexOf("-" + project.getVersion()); if ( versionBeginIndex != -1) { name = project.getBuild().getFinalName().substring(0, versionBeginIndex); } } switch (project.getPackaging()) { case "ear": case "war": case "eba": case "esa": name += "." + project.getPackaging(); if (looseApplication) { name += ".xml"; } break; case "liberty-assembly": File dir = new File(project.getBasedir() + "/src/main/webapp"); if (dir.exists()) { name += ".war"; if (looseApplication) { name += ".xml"; } } break; default: log.debug("The project artifact cannot be installed to a Liberty server because " + project.getPackaging() + " is not a supported packaging type."); name = null; break; } return name; }
Source:
<code>boolean isLocal() { <START> return isFromWire(); <END> }</code><technical_language>return !isFromWire();</technical_language>

Target:
protected boolean isLocal() { return !isFromWire(); }
Source:
<code>public void validate(String mrrtTemplate) throws IOException { final Document document = Jsoup.parse(mrrtTemplate, ""); final Elements metatags = document.getElementsByTag("meta"); ValidationResult validationResult = metaTagsValidationEngine.run(metatags); final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); final Schema schema; final Validator validator; try (InputStream in = IOUtils.toInputStream(mrrtTemplate)) { schema = factory.newSchema(getSchemaFile()); validator = schema.newValidator(); validator.setErrorHandler(new ErrorHandler() { @Override public void warning(SAXParseException exception) throws SAXException { log.warn(exception.getMessage(), exception); validationResult.addError(cleanErrorMessage(exception), ""); } @Override public void error(SAXParseException exception) throws SAXException { log.error(exception.getMessage(), exception); validationResult.addError(cleanErrorMessage(exception), ""); } @Override public void fatalError(SAXParseException exception) throws SAXException { <START> log.fatal(exception.getMessage(), exception); <END> validationResult.addError(cleanErrorMessage(exception), ""); } }); validator.validate(new StreamSource(in)); validationResult.assertOk(); } catch (SAXException e) { log.error(e.getMessage(), e); throw new APIException("radiology.report.template.validation.error", null, e); } }</code><technical_language>I log "log.debug" errors collected. if a dev/admin needs more set log level debug. I this fills log</technical_language>

Target:
public void validate(String mrrtTemplate) throws IOException { final Document document = Jsoup.parse(mrrtTemplate, ""); final Elements metatags = document.getElementsByTag("meta"); ValidationResult validationResult = metaTagsValidationEngine.run(metatags); final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); final Schema schema; final Validator validator; try (InputStream in = IOUtils.toInputStream(mrrtTemplate)) { schema = factory.newSchema(getSchemaFile()); validator = schema.newValidator(); validator.setErrorHandler(new ErrorHandler() { @Override public void warning(SAXParseException exception) throws SAXException { log.debug(exception.getMessage(), exception); validationResult.addError(cleanErrorMessage(exception), ""); } @Override public void error(SAXParseException exception) throws SAXException { log.debug(exception.getMessage(), exception); validationResult.addError(cleanErrorMessage(exception), ""); } @Override public void fatalError(SAXParseException exception) throws SAXException { log.debug(exception.getMessage(), exception); validationResult.addError(cleanErrorMessage(exception), ""); } }); validator.validate(new StreamSource(in)); validationResult.assertOk(); } catch (SAXException e) { log.error(e.getMessage(), e); throw new APIException("radiology.report.template.validation.error", null, e); } }
Source:
<code>public void testStatementWithNamedParam() throws Exception { OutParameters ret = h.createCall(":x = CALL TO_DEGREES(:y)") .registerOutParameter("x", Types.DOUBLE) .bind("y", 100.0d) .invoke(); Double expected = Math.toDegrees(100.0d); assertThat(ret.getDouble("x")).isEqualTo(expected, Offset.offset(0.001)); assertThat(ret.getLong("x").longValue()).isEqualTo(expected.longValue()); assertThat(ret.getShort("x").shortValue()).isEqualTo(expected.shortValue()); assertThat(ret.getInt("x").intValue()).isEqualTo(expected.intValue()); assertThat(ret.getFloat("x")).isEqualTo(expected.floatValue()); try { ret.getDate("x"); fail("didn't throw exception !"); } catch (Exception e) { } try { ret.getDate("y"); fail("didn't throw exception !"); } catch (Exception e) { <START> assertThat(true).isTrue(); <END> } }</code><technical_language>ditch this assertion :)</technical_language>

Target:
public void testStatementWithNamedParam() throws Exception { OutParameters ret = h.createCall(":x = CALL TO_DEGREES(:y)") .registerOutParameter("x", Types.DOUBLE) .bind("y", 100.0d) .invoke(); Double expected = Math.toDegrees(100.0d); assertThat(ret.getDouble("x")).isEqualTo(expected, Offset.offset(0.001)); assertThat(ret.getLong("x").longValue()).isEqualTo(expected.longValue()); assertThat(ret.getShort("x").shortValue()).isEqualTo(expected.shortValue()); assertThat(ret.getInt("x").intValue()).isEqualTo(expected.intValue()); assertThat(ret.getFloat("x")).isEqualTo(expected.floatValue()); assertThatExceptionOfType(Exception.class).isThrownBy(()->{ ret.getDate("x"); }); assertThatExceptionOfType(Exception.class).isThrownBy(()->{ ret.getDate("y"); }); }
Source:
<code>private static IncludedStructuralElement computeIfAbsent(IncludedStructuralElement includedStructuralElement, SimpleMetadataViewInterface simpleMetadataView, String value) { int index = 0; <START> FOR_LOOP: for (IncludedStructuralElement child : includedStructuralElement.getChildren()) { <END> String firstSimpleMetadataValue = MetadataEditor.readSimpleMetadataValues(child, simpleMetadataView).get(0); switch (Integer.signum(firstSimpleMetadataValue.compareTo(value))) { case -1: index++; break; case 0: return child; case 1: break FOR_LOOP; default: throw new IllegalStateException("complete switch"); } } IncludedStructuralElement computed = new IncludedStructuralElement(); MetadataEditor.writeMetadataEntry(computed, simpleMetadataView, value); includedStructuralElement.getChildren().add(index, computed); return computed; }</code><technical_language>please labels</technical_language>

Target:
private static IncludedStructuralElement computeIfAbsent(IncludedStructuralElement includedStructuralElement, SimpleMetadataViewInterface simpleMetadataView, String value) { int index = 0; for (IncludedStructuralElement child : includedStructuralElement.getChildren()) { String firstSimpleMetadataValue = MetadataEditor.readSimpleMetadataValues(child, simpleMetadataView).get(0); int comparison = firstSimpleMetadataValue.compareTo(value); if (comparison <= -1) { index++; } else if (comparison == 0) { return child; } else { break; } } IncludedStructuralElement computed = new IncludedStructuralElement(); MetadataEditor.writeMetadataEntry(computed, simpleMetadataView, value); includedStructuralElement.getChildren().add(index, computed); return computed; }
Source:
<code>public com.mojang.authlib.GameProfile getByNameNoLookup(String username) { @Nullable IMixinPlayerProfileCacheEntry entry = this.usernameToProfileEntryMap.get(username.toLowerCase(Locale.ROOT)); <START> if (entry != null && new Date().getTime() >= entry.getExpirationDate().getTime()) { <END> com.mojang.authlib.GameProfile profile = entry.getGameProfile(); this.uuidToProfileEntryMap.remove(profile.getId()); this.usernameToProfileEntryMap.remove(profile.getName().toLowerCase(Locale.ROOT)); this.gameProfiles.remove(profile); entry = null; } if (entry != null) { com.mojang.authlib.GameProfile profile = entry.getGameProfile(); this.gameProfiles.remove(profile); this.gameProfiles.addFirst(profile); } this.save(); return entry == null ? null : entry.getGameProfile(); }</code><technical_language>System.currentTimeMillis(). Eliminates 1 object creation (not 1 object allocation is bad, clean)</technical_language>

Target:
public com.mojang.authlib.GameProfile getByNameNoLookup(String username) { @Nullable IMixinPlayerProfileCacheEntry entry = this.usernameToProfileEntryMap.get(username.toLowerCase(Locale.ROOT)); if (entry != null && System.currentTimeMillis() >= entry.getExpirationDate().getTime()) { com.mojang.authlib.GameProfile profile = entry.getGameProfile(); this.uuidToProfileEntryMap.remove(profile.getId()); this.usernameToProfileEntryMap.remove(profile.getName().toLowerCase(Locale.ROOT)); this.gameProfiles.remove(profile); entry = null; } if (entry != null) { com.mojang.authlib.GameProfile profile = entry.getGameProfile(); this.gameProfiles.remove(profile); this.gameProfiles.addFirst(profile); } this.save(); return entry == null ? null : entry.getGameProfile(); }
Source:
<code>public void testConvertJsonToCSV() { String csvStr = "[/key][\"value\"]"; String jsonStr = "{\"key\":\"value\"}"; AsyncQuery queryObj = new AsyncQuery(); ElideResponse response = new ElideResponse(200, "ResponseBody"); String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; queryObj.setId(id); queryObj.setQuery(query); queryObj.setQueryType(QueryType.JSONAPI_V1_0); <START> when(elide.get(anyString(), any(), any(), anyString())).thenReturn(response); <END> AsyncQueryThread queryThread = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, "v1", resultStorageEngine); String jsonToCSV = queryThread.convertJsonToCSV(jsonStr); assertEquals(jsonToCSV, csvStr); }</code><technical_language>If intention is test convertJsonToCSV method. create a mock queryThread object test it. remove L-87 L97</technical_language>

Target:
public void testConvertJsonToCSV() throws Exception { String csvStr = "key\n\"value\"\n"; String jsonStr = "{\"key\":\"value\"}"; AsyncQuery queryObj = new AsyncQuery(); AsyncQueryThread queryThread = new AsyncQueryThread(queryObj, user, elide, runner, asyncQueryDao, "v1", resultStorageEngine, BASE_URL_ENDPOINT); assertEquals(queryThread.convertJsonToCSV(jsonStr), csvStr); }
Source:
<code>public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setPost(false) .setDescription("Search for organizations") .setResponseExample(getClass().getResource("search-example.json")) .setInternal(true) .setSince("6.2") <START> .setChangelog(new Change("6.4", "Paging has been added to the response")) <END> .setHandler(this); action.createParam(PARAM_ORGANIZATIONS) .setDescription("Comma-separated list of organization keys") .setExampleValue(String.join(",", "my-org-1", "foocorp")) .setRequired(false) .setSince("6.3"); action.addPagingParams(25); }</code><technical_language>suggestion: Paging fields added</technical_language>

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION) .setPost(false) .setDescription("Search for organizations") .setResponseExample(getClass().getResource("search-example.json")) .setInternal(true) .setSince("6.2") .setChangelog(new Change("6.4", "Paging fields have been added to the response")) .setHandler(this); action.createParam(PARAM_ORGANIZATIONS) .setDescription("Comma-separated list of organization keys") .setExampleValue(String.join(",", "my-org-1", "foocorp")) .setRequired(false) .setSince("6.3"); action.addPagingParams(25); }
Source:
<code>public JSONObject serialize() { JSONObject data = new JSONObject(); try { if (this.id != null) { data.put("_id", this.getId()); } if (this.version != -1) { data.put("_version", this.version); } data.put("body", this.getContent()); this.kuzzle.addHeaders(data, getHeaders()); } catch (JSONException e) { <START> e.printStackTrace(); <END> } return data; }</code><technical_language>throw a RuntimeException developer handle</technical_language>

Target:
public JSONObject serialize() { JSONObject data = new JSONObject(); try { if (this.id != null) { data.put("_id", this.getId()); } if (this.version != -1) { data.put("_version", this.version); } data.put("body", this.getContent()); this.kuzzle.addHeaders(data, getHeaders()); } catch (JSONException e) { throw new RuntimeException(e); } return data; }
Source:
<code>public void shouldSendPullRequestOnTick() throws Throwable { txPuller.start(); long lastAppliedTxId = 99L; when( txApplier.lastQueuedTxId() ).thenReturn( lastAppliedTxId ); timerService.invoke( TX_PULLER_TIMEOUT ); <START> scheduler.runJob(); <END> verify( catchUpClient ).makeBlockingRequest( any( MemberId.class ), any( TxPullRequest.class ), any( CatchUpResponseCallback.class ) ); }</code><technical_language>lines repeated - worth a method</technical_language>

Target:
public void shouldSendPullRequestOnTick() throws Throwable { txPuller.start(); long lastAppliedTxId = 99L; when( txApplier.lastQueuedTxId() ).thenReturn( lastAppliedTxId ); timerService.invoke( TX_PULLER_TIMER ); verify( catchUpClient ).makeBlockingRequest( any( MemberId.class ), any( TxPullRequest.class ), any( CatchUpResponseCallback.class ) ); }
Source:
<code>public static HttpPipeline buildHttpPipeline( TokenCredential credential, AzureProfile profile, String[] scopes, HttpLogOptions httpLogOptions, Configuration configuration, RetryPolicy retryPolicy, List<HttpPipelinePolicy> additionalPolicies, HttpClient httpClient) { List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(httpLogOptions, configuration)); policies.add(new RequestIdPolicy()); policies.add(new ReturnRequestIdHeaderPolicy(ReturnRequestIdHeaderPolicy.Option.COPY_CLIENT_REQUEST_ID)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); if (credential != null) { policies.add(new AuthenticationPolicy(credential, profile.getEnvironment(), scopes)); } if (additionalPolicies != null && !additionalPolicies.isEmpty()) { <START> policies.addAll(additionalPolicies); <END> } HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); }</code><technical_language>Is (automatically set provider, auth done)? provide a function user needs (hence report bug)</technical_language>

Target:
public static HttpPipeline buildHttpPipeline( TokenCredential credential, AzureProfile profile, String[] scopes, HttpLogOptions httpLogOptions, Configuration configuration, RetryPolicy retryPolicy, List<HttpPipelinePolicy> additionalPolicies, HttpClient httpClient) { List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new UserAgentPolicy(httpLogOptions, configuration)); policies.add(new RequestIdPolicy()); policies.add(new ReturnRequestIdHeaderPolicy(ReturnRequestIdHeaderPolicy.Option.COPY_CLIENT_REQUEST_ID)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); if (credential != null) { policies.add(new AuthenticationPolicy(credential, profile.getEnvironment(), scopes)); } policies.add(new ProviderRegistrationPolicy()); if (additionalPolicies != null && !additionalPolicies.isEmpty()) { policies.addAll(additionalPolicies); } HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); }
Source:
<code>public void encode(Point geometry, AttributesImpl atts, GMLWriter handler, String gmlId) throws Exception { atts = cloneWithGmlId(atts, gmlId); handler.startElement(point, atts); handler.startElement(pos, null); Coordinate coordinate = geometry.getCoordinate(); <START> handler.position(coordinate.x, coordinate.y, coordinate.z, coordinate.getM()); <END> handler.endElement(pos); handler.endElement(point); }</code><technical_language>Please coordiante.getZ(), direct field access marked deprecated (especially coordinate a Z value. I remember if coordinate.getZ() return NaN if geometry dimension is 2, exception. Checking [CoordinateXY](<LINK_0> ... getZ() returns NULL_ORDINATE, getOrdinate( 2 ) throws exception</technical_language>

Target:
public void encode(Point geometry, AttributesImpl atts, GMLWriter handler, String gmlId) throws Exception { atts = cloneWithGmlId(atts, gmlId); handler.startElement(point, atts); handler.startElement(pos, null); handler.position(geometry.getCoordinateSequence()); handler.endElement(pos); handler.endElement(point); }
Source:
<code>public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { Cards cards = new CardsImpl(); Card card = controller.getLibrary().getFromTop(game); if (card != null) { cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); if (card.isLand()) { <START> game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source); <END> game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source); } } return true; } return false; }</code><technical_language>BoostSourceEffect removed</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { Cards cards = new CardsImpl(); Card card = controller.getLibrary().getFromTop(game); if (card != null) { cards.add(card); controller.revealCards(sourceObject.getIdName(), cards, game); if (card.isLand()) { game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source); } } return true; } return false; }
Source:
<code><START> public static void registerCustomUnits(SimpleUnitFormat format) { <END> format.label(Units.DEGREE_MINUTE_SECOND, "DMS"); format.alias(Units.DEGREE_MINUTE_SECOND, "degree minute second"); format.label(Units.SEXAGESIMAL_DMS, "D.MS"); format.alias(Units.SEXAGESIMAL_DMS, "sexagesimal DMS"); format.alias(Units.SEXAGESIMAL_DMS, "DDD.MMSSsss"); format.alias(Units.SEXAGESIMAL_DMS, "sexagesimal degree DDD.MMSSsss"); format.label(Units.PPM, "ppm"); }</code><technical_language>This is other key fix, provided @dispiste, is configure built-in SimpleUnitFormat instances common labels alias. Subsequent lists add this list (for pixel Kelvin) do change approach</technical_language>

Target:
static void registerCustomUnits(SimpleUnitFormat format) { format.label(Units.DEGREE_MINUTE_SECOND, "DMS"); format.alias(Units.DEGREE_MINUTE_SECOND, "degree minute second"); format.label(Units.SEXAGESIMAL_DMS, "D.MS"); format.alias(Units.SEXAGESIMAL_DMS, "sexagesimal DMS"); format.alias(Units.SEXAGESIMAL_DMS, "DDD.MMSSsss"); format.alias(Units.SEXAGESIMAL_DMS, "sexagesimal degree DDD.MMSSsss"); format.label(Units.PPM, "ppm"); format.label(NonSI.DEGREE_ANGLE, "°"); format.label(Units.PIXEL, "pixel"); format.label(USCustomary.GRADE, "grad"); format.alias(USCustomary.GRADE, "grade"); }
Source:
<code>public void testIngressTimestamp() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setEnableIngressTimestamp(true)); conn.connect(defUser, defPass); subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO); sendJmsMessage(getName()); ClientStompFrame frame = conn.receiveFrame(10000); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); Assert.assertEquals(getQueuePrefix() + getQueueName(), frame.getHeader(Stomp.Headers.Send.DESTINATION)); <START> Assert.assertNotNull(frame.getHeader(Stomp.Headers.Message.INGRESS_TIMESTAMP)); <END> Assert.assertEquals(getName(), frame.getBody()); conn.disconnect(); }</code><technical_language>other protocols, validating is set expected good</technical_language>

Target:
public void testIngressTimestamp() throws Exception { server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setEnableIngressTime(true)); conn.connect(defUser, defPass); subscribe(conn, null, Stomp.Headers.Subscribe.AckModeValues.AUTO); long before = System.currentTimeMillis(); sendJmsMessage(getName()); long after = System.currentTimeMillis(); ClientStompFrame frame = conn.receiveFrame(10000); Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand()); Assert.assertEquals(getQueuePrefix() + getQueueName(), frame.getHeader(Stomp.Headers.Send.DESTINATION)); String ingressTimeHeaderValue = frame.getHeader(Stomp.Headers.Message.INGRESS_TIME); Assert.assertNotNull(ingressTimeHeaderValue); long ingressTime = Long.parseLong(ingressTimeHeaderValue); assertTrue("Ingress time should be set in expected range", before <= ingressTime && after >= ingressTime); conn.disconnect(); }
Source:
<code>public String getName() { <START> return subscriptionName; <END> }</code><technical_language>a distinction subscriptionName, is actual locator in GCE logical name is in UI suggesting pub/sub subscriptions use. Is a reason change here</technical_language>

Target:
public String getName() { return name; }
Source:
<code>protected <T extends Variant> Set<T> getVariantsByType(PushApplication application, Class<T> type) { Set<T> variants = new HashSet<>(); application.getVariants().forEach(variant -> { if (variant.getClass().equals(type)) { variants.add((T) variant); } <START> }); <END> return variants; }</code><technical_language>Collectors here: java Objects.requireNonNull(type, "type"); return application.getVariants().stream() .filter(variant -> variant.getClass().equals(type)) .map(variant -> (T) variant) .collect(Collectors.toSet());</technical_language>

Target:
protected <T extends Variant> Set<T> getVariantsByType(PushApplication application, Class<T> type) { Objects.requireNonNull(type, "type"); return application.getVariants().stream() .filter(variant -> variant.getClass().equals(type)) .map(variant -> (T) variant) .collect(Collectors.toSet()); }
Source:
<code>public List<Response> bulk(List<?> objects, boolean allOrNothing) { assertNotEmpty(objects, "objects"); InputStream responseStream = null; HttpConnection connection; try { final String allOrNothingVal = allOrNothing ? "\"all_or_nothing\": true, " : ""; final URI uri = buildUri(getDBUri()).path("_bulk_docs").build(); final String json = String.format("{%s%s%s}", allOrNothingVal, "\"docs\": ", getGson ().toJson(objects)); connection = couchDbClient.post(uri, json, HttpConnection.class); responseStream = connection.responseAsInputStream(); List<Response> bulkResponses = getResponseList(responseStream, getGson(), new TypeToken<List<Response>>() { }.getType()); for(Response response : bulkResponses) { response.setStatusCode(connection.getConnection().getResponseCode()); <START> response.setReason(connection.getConnection().getResponseMessage()); <END> } return bulkResponses; } catch (IOException e) { throw new CouchDbException("Error retrieving response input stream.", e); } finally { close(responseStream); } }</code><technical_language>I this is done for current List<Response>, some point in future more sense a return type hold HTTP status code, a getter unpack list of individual responses</technical_language>

Target:
public List<Response> bulk(List<?> objects, boolean allOrNothing) { assertNotEmpty(objects, "objects"); InputStream responseStream = null; HttpConnection connection; try { final String allOrNothingVal = allOrNothing ? "\"all_or_nothing\": true, " : ""; final URI uri = buildUri(getDBUri()).path("_bulk_docs").build(); final String json = String.format("{%s%s%s}", allOrNothingVal, "\"docs\": ", getGson ().toJson(objects)); connection = Http.POST(uri, "application/json"); if (json != null && !json.isEmpty()) { connection.setRequestBody(json); } couchDbClient.execute(connection); responseStream = connection.responseAsInputStream(); List<Response> bulkResponses = getResponseList(responseStream, getGson(), new TypeToken<List<Response>>() { }.getType()); for(Response response : bulkResponses) { response.setStatusCode(connection.getConnection().getResponseCode()); response.setReason(connection.getConnection().getResponseMessage()); } return bulkResponses; } catch (IOException e) { throw new CouchDbException("Error retrieving response input stream.", e); } finally { close(responseStream); } }
Source:
<code>protected void doReset() { allCommandsRetrieved = false; <START> idToCommand = <END> null; if (currentSnapshot instanceof ExpressionContext) { ((ExpressionContext) currentSnapshot).eclipseContext.dispose(); } currentSnapshot = null; }</code><technical_language>I clear map. some field null leads in code NPE's sooner later</technical_language>

Target:
protected void doReset() { allCommandsRetrieved = false; idToCommand.clear(); if (currentSnapshot instanceof ExpressionContext) { ((ExpressionContext) currentSnapshot).eclipseContext.dispose(); } currentSnapshot = null; }
Source:
<code><START> public String getSQLiteVersion() { <END> try { return this.submit(new SQLQueueCallable<String>() { @Override public String call(SQLDatabase db) throws Exception { Cursor cursor = db.rawQuery("SELECT sqlite_version() AS sqlite_version", null); String sqliteVersion = ""; while(cursor.moveToNext()){ sqliteVersion += cursor.getString(0); } return sqliteVersion; } }).get(); } catch (InterruptedException e) { logger.log(Level.WARNING, "Could not determine SQLite version", e); } catch (ExecutionException e) { logger.log(Level.WARNING, "Could not determine SQLite version", e); } return "unknown"; }</code><technical_language>prefer this run opening database (avoiding need queue it) storing version a constant for later. include in thread name for instance</technical_language>

Target:
public synchronized String getSQLiteVersion() { if (this.sqliteVersion == null) { try { this.sqliteVersion = this.submit(new SQLQueueCallable<String>() { @Override public String call(SQLDatabase db) throws Exception { Cursor cursor = db.rawQuery("SELECT sqlite_version()", null); String sqliteVersion = ""; while (cursor.moveToNext()) { sqliteVersion += cursor.getString(0); } return sqliteVersion; } }).get(); return sqliteVersion; } catch (InterruptedException e) { logger.log(Level.WARNING, "Could not determine SQLite version", e); } catch (ExecutionException e) { logger.log(Level.WARNING, "Could not determine SQLite version", e); } this.sqliteVersion = "unknown"; } return this.sqliteVersion; }
Source:
<code>public String toString() { String[] queryParams = toQueryParams(); <START> Arrays.sort(queryParams); <END> return String.join("&", queryParams); }</code><technical_language>sort</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); String[] queryParams = toQueryParams(); for (int a = 0;a<queryParams.length;a++) { sb.append(a < queryParams.length - 1 ? queryParams[a] + "&" : queryParams[a]); } return sb.toString(); }
Source:
<code>public static void main(String[] args) throws ConfigurationException, Exception { options = new YarnAdminOptions(); JCommander jcommand = new JCommander(options, args); if (options.displayHelp()) { jcommand.usage(); System.exit(-1); } Logging.init("ClusterAdmin", options.getFluoConf(), "STDOUT", false); File configFile = new File(options.getFluoConf() + "/fluo.properties"); config = new FluoConfiguration(configFile); curator = CuratorUtil.getCurator(config); curator.start(); YarnConfiguration yarnConfig = new YarnConfiguration(); yarnConfig.addResource(new Path(options.getHadoopPrefix() + "/etc/hadoop/core-site.xml")); yarnConfig.addResource(new Path(options.getHadoopPrefix() + "/etc/hadoop/yarn-site.xml")); twillRunner = new YarnTwillRunnerService(yarnConfig, config.getZookeepers()+"/twill"); twillRunner.startAndWait(); Thread.sleep(1000); switch (options.getCommand().toLowerCase()) { case "start": start(); break; case "stop": stop(); break; case "kill": kill(); break; case "status": status(); break; default: log.error("Unknown command: " + options.getCommand()); break; } <START> twillRunner.stop(); <END> curator.close(); }</code><technical_language>good do this clean in finally try w/ resources. main thread is exiting, this matter if stop methods shutting a daemon thread process alive. If this is case, matter.. process exit</technical_language>

Target:
public static void main(String[] args) throws ConfigurationException, Exception { options = new YarnAdminOptions(); JCommander jcommand = new JCommander(options, args); if (options.displayHelp()) { jcommand.usage(); System.exit(-1); } Logging.init("ClusterAdmin", options.getFluoConf(), "STDOUT", false); File configFile = new File(options.getFluoConf() + "/fluo.properties"); config = new FluoConfiguration(configFile); try { curator = CuratorUtil.getCurator(config); curator.start(); YarnConfiguration yarnConfig = new YarnConfiguration(); yarnConfig.addResource(new Path(options.getHadoopPrefix() + "/etc/hadoop/core-site.xml")); yarnConfig.addResource(new Path(options.getHadoopPrefix() + "/etc/hadoop/yarn-site.xml")); try { twillRunner = new YarnTwillRunnerService(yarnConfig, config.getZookeepers() + ZookeeperConstants.TWILL); twillRunner.startAndWait(); Thread.sleep(1000); switch (options.getCommand().toLowerCase()) { case "start": start(); break; case "stop": stop(); break; case "kill": kill(); break; case "status": status(); break; default: log.error("Unknown command: " + options.getCommand()); break; } } finally { if (twillRunner != null) { twillRunner.stop(); } } } finally { if (curator != null) { curator.close(); } } }
Source:
<code>public boolean awaitStart(long timeoutMs) throws InterruptedException { <START> return containerController.awaitStart(timeoutMs); END> }</code><technical_language>In this impl, JobCoordinator is responsible for life cycle of containerController. If add awaitStart(0 JC, is reason StreamProcessor needs containerController anymore. this cleaner</technical_language>

Target:
public boolean awaitStart(long timeoutMs) throws InterruptedException { return jobCoordinator.awaitStart(timeoutMs); }
Source:
<code>void testLocalGameButton() { <START> final ScreenController<FxmlManager> mock = mock(ScreenController.class); <END> final GameSelectionControls aboutInformation = new GameSelectionControls(); aboutInformation.connect(mock); aboutInformation.showLocalGameMenu(); verify(mock).switchScreen(FxmlManager.MAP_SELECTION); }</code><technical_language>nit: do of making mock more descriptive, ie: rename like: screenControllerMock</technical_language>

Target:
void testLocalGameButton() { final ScreenController<FxmlManager> screenControllerMock = mock(ScreenController.class); final GameSelectionControls aboutInformation = new GameSelectionControls(); aboutInformation.connect(screenControllerMock); aboutInformation.showLocalGameMenu(); verify(screenControllerMock).switchScreen(FxmlManager.MAP_SELECTION); }
Source:
<code>public void expandLineItemsDiscount() throws Exception { final RelativeCartDiscountValue relativeCartDiscountValue = RelativeCartDiscountValue.of(15000); withDiscountedLineItem(client(), relativeCartDiscountValue, (cart) -> { final CartQuery query = CartQuery.of() .withPredicates(m -> m.id().is(cart.getId())) .withExpansionPaths(m -> m.lineItems().discountedPricePerQuantity().discountedPrice().includedDiscounts().discount()); assertEventually(() -> { final Cart loadedCart = client().executeBlocking(query).head().get(); final Reference<CartDiscount> cartDiscountReference = loadedCart.getLineItems().get(0).getDiscountedPricePerQuantity().get(0).getDiscountedPrice().getIncludedDiscounts().get(0).getDiscount(); assertThat(cartDiscountReference.getObj()).isNotNull(); final CartDiscount lineItemDiscount = cartDiscountReference.getObj(); <START> assertThat(lineItemDiscount).isNotNull(); <END> final CartDiscountValue customLineItemDiscountValue = lineItemDiscount.getValue(); assertThat(customLineItemDiscountValue).isEqualTo(relativeCartDiscountValue); }); }); }</code><technical_language>I omit this check, assertThat(cartDiscountReference.getObj()).isNotNull();</technical_language>

Target:
public void expandLineItemsDiscount() throws Exception { final RelativeCartDiscountValue relativeCartDiscountValue = RelativeCartDiscountValue.of(15000); withCartHavingCartDiscountedLineItem(client(), relativeCartDiscountValue, (cart) -> { final CartQuery query = CartQuery.of() .withPredicates(m -> m.id().is(cart.getId())) .withExpansionPaths(m -> m.lineItems().discountedPricePerQuantity().discountedPrice().includedDiscounts().discount()); final Cart loadedCart = client().executeBlocking(query).head().get(); final Reference<CartDiscount> cartDiscountReference = loadedCart.getLineItems().get(0).getDiscountedPricePerQuantity().get(0).getDiscountedPrice().getIncludedDiscounts().get(0).getDiscount(); assertThat(cartDiscountReference.getObj()).isNotNull(); final CartDiscount lineItemDiscount = cartDiscountReference.getObj(); final CartDiscountValue customLineItemDiscountValue = lineItemDiscount.getValue(); assertThat(customLineItemDiscountValue).isEqualTo(relativeCartDiscountValue); return loadedCart; }); }
Source:
<code>public JobCoordinator getJobCoordinator(Config config) { MetricsRegistry metricsRegistry = new MetricsRegistryMap(); String jobCoordinatorZkBasePath = getJobCoordinationZkPath(config); ZkUtils zkUtils = getZkUtils(config, metricsRegistry, jobCoordinatorZkBasePath); <START> MapConfig mapConfig = new MapConfig(config, ImmutableMap.of(ZkConfig.CONFIG_COORDINATOR_ZK_BASE_PATH, jobCoordinatorZkBasePath)); <END> LOG.debug("Creating ZkJobCoordinator with config: {}.", mapConfig); return new ZkJobCoordinator(mapConfig, metricsRegistry, zkUtils); }</code><technical_language>assuming this constructor is combining maps? If so, get jobCoordinatorZkBasePath config? Do need add again</technical_language>

Target:
public JobCoordinator getJobCoordinator(Config config) { MetricsRegistry metricsRegistry = new MetricsRegistryMap(); String jobCoordinatorZkBasePath = getJobCoordinationZkPath(config); ZkUtils zkUtils = getZkUtils(config, metricsRegistry, jobCoordinatorZkBasePath); LOG.debug("Creating ZkJobCoordinator with config: {}.", config); return new ZkJobCoordinator(config, metricsRegistry, zkUtils); }
Source:
<code>private void displayFormDeletedNotification(String id, String name) { final int notificationId = formId(id); <START> String text = String.format("Form \"%s\" has been deleted", name); <END> String title = "Form deleted"; NotificationHelper.displayNonOnGoingErrorNotification(this, notificationId, text, title); }</code><technical_language>@valllllll2000 extract strings</technical_language>

Target:
private void displayFormDeletedNotification(String id, String name) { final int notificationId = formId(id); String text = String.format(getString(R.string.data_sync_error_form_deleted_text), name); String title = getString(R.string.data_sync_error_form_deleted_title); NotificationHelper.displayNonOnGoingErrorNotification(this, notificationId, text, title); }
Source:
<code>protected void scanFile(XmlFile file) { if (!"pom.xml".equals(file.getInputFile().filename())) { return; } try { Node groupId = (Node) groupIdExpression.evaluate(file.getNamespaceUnawareDocument(), XPathConstants.NODE); String content = groupId.getTextContent(); if (!getPattern().matcher(content).matches()) { reportIssue(groupId.getFirstChild(), "Update this \"groupId\" to match the provided regular expression: '" + regex + "'"); } } catch (NullPointerException e) { } catch (XPathExpressionException e) { <START> throw new AnalysisException("Unable to evaluate XPath expression", e); <END> } }</code><technical_language>caught, right</technical_language>

Target:
protected void scanFile(XmlFile file) { if (!"pom.xml".equalsIgnoreCase(file.getInputFile().filename())) { return; } NodeList groupIds = evaluate(groupIdExpression, file.getNamespaceUnawareDocument()); if (groupIds.getLength() != 1) { return; } Node groupId = groupIds.item(0); if (!getPattern().matcher(groupId.getTextContent()).matches()) { reportIssue(groupId, "Update this \"groupId\" to match the provided regular expression: '" + regex + "'"); } }
Source:
<code>private BlackboardArtifact.Type getShellBagArtifact() throws TskCoreException { if (shellBagArtifactType == null) { try { shellBagArtifactType = tskCase.getBlackboard().getOrAddArtifactType(SHELLBAG_ARTIFACT_NAME, Bundle.Shellbag_Artifact_Display_Name()); } catch (BlackboardException ex) { String msg = String.format("Failed to get shell bag artifact type", SHELLBAG_ARTIFACT_NAME); logger.log(Level.SEVERE, msg, ex); <START> throw new TskCoreException(msg, ex); <END> } } return shellBagArtifactType; }</code><technical_language>Do need log exception here? I expect calling code handle it</technical_language>

Target:
private BlackboardArtifact.Type getShellBagArtifact() throws TskCoreException { if (shellBagArtifactType == null) { try { shellBagArtifactType = tskCase.getBlackboard().getOrAddArtifactType(SHELLBAG_ARTIFACT_NAME, Bundle.Shellbag_Artifact_Display_Name()); } catch (BlackboardException ex) { throw new TskCoreException(String.format("Failed to get shell bag artifact type", SHELLBAG_ARTIFACT_NAME), ex); } } return shellBagArtifactType; }
Source:
<code><START> public void getSentMessage_shouldGetMessageById() { <END> SentMessage sm = sentMessageService.getSentMessage(11); Assert.assertNotNull(sm); Assert.assertEquals(11, (int)sm.getMessageId()); Assert.assertEquals(21, (int)sm.getSenderId()); Assert.assertEquals(31, (int)sm.getReceiverId()); }</code><technical_language>![Codacy](<LINK_0> Issue found: [Method names underscores](<LINK_1></technical_language>

Target:
public void getSentMessage_shouldGetMessageById() { SentMessage sm = sentMessageService.getSentMessage(11); Assert.assertNotNull(sm); Assert.assertEquals(11, (int)sm.getMessageId()); Assert.assertEquals(21, (int)sm.getSender().getUserId()); Assert.assertEquals(31, (int)sm.getReceiver().getUserId()); }
Source:
<code>private void start() { <START> this.des = new DefaultExecutorService(cache); <END> }</code><technical_language>This constructed a private SecurityAction, requires EXEC permissions (see CI failure)</technical_language>

Target:
public void start() { this.des = SecurityActions.getDefaultExecutorService(cache); }
Source:
<code>public void onConnect(IClient client, RequestFunction function, AMFDataList params) { WMSProperties properties = client.getProperties(); String rtmpUrl = properties.getPropertyStr(Constants.CLIENT_PROPERTY_CONNECT_URL); String IP = client.getIp(); logger.debug("Geting url: " + rtmpUrl+ " from client "+ IP); try { HashMap<String, String> queryParameters = Utils.getRtmpUrlParameters(rtmpUrl, client.getQueryStr()); onClientConnect(properties, queryParameters); } catch (Exception e) { logger.error("Entry authentication failed with url [" + rtmpUrl + "]: " + e.getMessage()); client.rejectConnection(); sendClientOnStatusError((IClient)client, "NetStream.Play.Failed","Unable to authenticate url; [" + rtmpUrl + "]: " + e.getMessage()); <START> EntriesDataProvider.addRejectedStream(e.getMessage(), client); <END> } }</code><technical_language>please rename EntriesDataProvider DiagnosticsProvider</technical_language>

Target:
public void onConnect(IClient client, RequestFunction function, AMFDataList params) { WMSProperties properties = client.getProperties(); String rtmpUrl = properties.getPropertyStr(Constants.CLIENT_PROPERTY_CONNECT_URL); String IP = client.getIp(); logger.debug("Geting url: " + rtmpUrl+ " from client "+ IP); try { HashMap<String, String> queryParameters = Utils.getRtmpUrlParameters(rtmpUrl, client.getQueryStr()); onClientConnect(properties, queryParameters); } catch (Exception e) { logger.error("Entry authentication failed with url [" + rtmpUrl + "]: " + e.getMessage()); client.rejectConnection(); sendClientOnStatusError((IClient)client, "NetStream.Play.Failed","Unable to authenticate url; [" + rtmpUrl + "]: " + e.getMessage()); DiagnosticsProvider.addRejectedStream(e.getMessage(), client); } }
Source:
<code>public String toString() { return "MockConnection{" + "localEndpoint=" + localEndpoint <START> + ", remoteNodeEngine=" + remoteNodeEngine <END> + ", alive=" + isAlive() + '}'; }</code><technical_language>remoteEndpoint</technical_language>

Target:
public String toString() { return "MockConnection{" + "localEndpoint=" + localEndpoint + ", remoteEndpoint=" + remoteEndpoint + ", alive=" + isAlive() + '}'; }
Source:
<code>public void testFailed() throws Exception { Path manyMaps = new Path("file://" + root.getRoot().getAbsolutePath() + "/manyMaps"); <START> fs.create(new Path(manyMaps, SortedLogState.FAILED.getMarker())).close(); <END> RecoveryLogReader reader = new RecoveryLogReader(fs, manyMaps); IntWritable key = new IntWritable(); BytesWritable value = new BytesWritable(); for (int i = 0; i < 1000; i++) { if (i == 10) continue; assertTrue(reader.next(key, value)); assertEquals(i, key.get()); } reader.close(); }</code><technical_language>other test this file</technical_language>

Target:
public void testFailed() throws Exception { Path manyMaps = new Path("file://" + root.getRoot().getAbsolutePath() + "/manyMaps"); fs.create(new Path(manyMaps, SortedLogState.FAILED.getMarker())).close(); RecoveryLogReader reader = new RecoveryLogReader(fs, manyMaps); IntWritable key = new IntWritable(); BytesWritable value = new BytesWritable(); for (int i = 0; i < 1000; i++) { if (i == 10) continue; assertTrue(reader.next(key, value)); assertEquals(i, key.get()); } reader.close(); assertTrue(fs.delete(new Path(manyMaps, SortedLogState.FAILED.getMarker()))); }
Source:
<code>private void checkOpenGL() { boolean[] requiredCapabilities = { GLContext.getCapabilities().OpenGL11, GLContext.getCapabilities().OpenGL12, GLContext.getCapabilities().OpenGL14, GLContext.getCapabilities().OpenGL15, GLContext.getCapabilities().GL_ARB_framebuffer_object, GLContext.getCapabilities().GL_ARB_texture_float, GLContext.getCapabilities().GL_ARB_half_float_pixel, GLContext.getCapabilities().GL_ARB_shader_objects}; <START> requiredCapabilities[3] = false; <END> String[] capabilityNames = {"OpenGL11", "OpenGL12", "OpenGL14", "OpenGL15", "GL_ARB_framebuffer_object", "GL_ARB_texture_float", "GL_ARB_half_float_pixel", "GL_ARB_shader_objects"}; boolean canRunTheGame = true; String missingCapabilitiesMessage = ""; for (int index = 0; index < requiredCapabilities.length; index++) { if (!requiredCapabilities[index]) { missingCapabilitiesMessage += " - " + capabilityNames[index] + "\n"; canRunTheGame = false; } } if (!canRunTheGame) { String completeErrorMessage = completeErrorMessage(missingCapabilitiesMessage); logger.error(completeErrorMessage); JOptionPane.showMessageDialog(null, completeErrorMessage, "Required OpenGL version(s) or extension(s) not supported", JOptionPane.ERROR_MESSAGE); System.exit(1); } }</code><technical_language>I guess this line in there</technical_language>

Target:
private void checkOpenGL() { boolean[] requiredCapabilities = { GLContext.getCapabilities().OpenGL12, GLContext.getCapabilities().OpenGL14, GLContext.getCapabilities().OpenGL15, GLContext.getCapabilities().GL_ARB_framebuffer_object, GLContext.getCapabilities().GL_ARB_texture_float, GLContext.getCapabilities().GL_ARB_half_float_pixel, GLContext.getCapabilities().GL_ARB_shader_objects}; String[] capabilityNames = {"OpenGL12", "OpenGL14", "OpenGL15", "GL_ARB_framebuffer_object", "GL_ARB_texture_float", "GL_ARB_half_float_pixel", "GL_ARB_shader_objects"}; boolean canRunTheGame = true; String missingCapabilitiesMessage = ""; for (int index = 0; index < requiredCapabilities.length; index++) { if (!requiredCapabilities[index]) { missingCapabilitiesMessage += " - " + capabilityNames[index] + "\n"; canRunTheGame = false; } } if (!canRunTheGame) { String completeErrorMessage = completeErrorMessage(missingCapabilitiesMessage); throw new IllegalStateException(completeErrorMessage); } }
Source:
<code><START> private List<String> getUpdateableStacks(String envCrn) { <END> StackViewV4Responses stackViewV4Responses = stackV4Endpoint.list(0L, envCrn, false); return stackViewV4Responses.getResponses().stream(). filter(stack -> !SKIPPED_STATES.contains(stack.getCluster().getStatus())) .map(stack -> stack.getName()) .collect(Collectors.toList()); }</code><technical_language>if is some error calling CB here, handled. Is purpose leave handler handle it</technical_language>

Target:
private List<String> getUpdateableStacks(String envCrn) { StackViewV4Responses stackViewV4Responses = stackV4Endpoint.list(0L, envCrn, false); return stackViewV4Responses.getResponses().stream(). filter(stack -> !SKIPPED_STATES.contains(stack.getCluster().getStatus())) .map(stack -> stack.getCrn()) .collect(Collectors.toList()); }