auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDistinctFrom() { <START> assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8329'", BOOLEAN, false); <END> assertFunction("CAST(NULL AS IPADDRESS) IS DISTINCT FROM CAST(NULL AS IPADDRESS)", BOOLEAN, false); }</code><technical_language>Test a case returns true</technical_language>

Target:
public void testDistinctFrom() { assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8329'", BOOLEAN, false); assertFunction("CAST(NULL AS IPADDRESS) IS DISTINCT FROM CAST(NULL AS IPADDRESS)", BOOLEAN, false); assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8328'", BOOLEAN, true); assertFunction("IPADDRESS '2001:0db8:0000:0000:0000:ff00:0042:8329' IS DISTINCT FROM CAST(NULL AS IPADDRESS)", BOOLEAN, true); assertFunction("CAST(NULL AS IPADDRESS) IS DISTINCT FROM IPADDRESS '2001:db8::ff00:42:8328'", BOOLEAN, true); }
Source:
<code>private String findAdbExecutable() { String android_home = System.getenv("ANDROID_HOME"); <START> return android_home != null && !android_home.equals("")?android_home + "/platform-tools/adb":"adb"; <END> }</code><technical_language>I feel this liner hurt readability, please previous syntax for clarity</technical_language>

Target:
private String findAdbExecutable() { String android_home = System.getenv("ANDROID_HOME"); if (android_home == null || android_home.equals("")) { return "adb"; } return android_home + "/platform-tools/adb"; }
Source:
<code>public void areUniqueAndOrderedLong() { final int iterations = PARAMETERS.NUM_ITERATIONS_MODERATE; OrderedGuidGenerator guidGenerator = new CorfuGuidGenerator(getDefaultRuntime()); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); <START> lastValue = current; <END> assertThat(uniq).doesNotContain(current); uniq.add(current); } }</code><technical_language>lastValue is used, test missing check (i.e. order of longs)</technical_language>

Target:
public void areUniqueAndOrderedLong() { final int iterations = PARAMETERS.NUM_ITERATIONS_MODERATE; OrderedGuidGenerator guidGenerator = new CorfuGuidGenerator(getDefaultRuntime().connect()); long lastValue = 0; HashSet<Long> uniq = new HashSet<>(iterations); for (int i = 0; i < iterations; i++) { long current = guidGenerator.nextLong(); assertThat(uniq).doesNotContain(current); assertThat(current).isGreaterThan(lastValue); lastValue = current; uniq.add(current); } }
Source:
<code>public void checkSpecificAccessControl() { <START> if (!Config.isDevServer()) { <END> throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } }</code><technical_language>abt this if (!userInfo.isAdmin) { throw new UnauthorizedAccessException("Admin privilege is required access this resource."); }</technical_language>

Target:
public void checkSpecificAccessControl() { if (!userInfo.isAdmin) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } }
Source:
<code>public String searchNodesByConcept(String conceptId) throws Exception { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = buildRestHeader(messageConverters, restTemplate); VelocityEngine engine = restVelocityFactory.getVelocityEngine(); engine.init(); Template template = engine.getTemplate("velocitytemplates/searchQStore/requestNodes.vm"); VelocityContext context = new VelocityContext(); context.put("conceptId", conceptId); StringWriter writer = new StringWriter(); template.merge(context, writer); HttpEntity<String> request = new HttpEntity<String>(writer.toString(), headers); String res = ""; try { res = restTemplate.postForObject(getQStoreSearchUrl(), request, String.class); <START> logger.info("Response from QStore", res); <END> } catch (Exception e) { logger.error("QStore not accepting the xml, please check with the server logs.", e); return res; } return res; }</code><technical_language>this need logged info. clutter log files. If all, log debug</technical_language>

Target:
public String searchNodesByConcept(String conceptId) throws Exception { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = buildRestHeader(messageConverters, restTemplate); VelocityEngine engine = restVelocityFactory.getVelocityEngine(); engine.init(); Template template = engine.getTemplate("velocitytemplates/searchQStore/requestNodes.vm"); VelocityContext context = new VelocityContext(); context.put("conceptId", conceptId); StringWriter writer = new StringWriter(); template.merge(context, writer); HttpEntity<String> request = new HttpEntity<String>(writer.toString(), headers); String res = ""; try { res = restTemplate.postForObject(getQStoreSearchUrl(), request, String.class); } catch (Exception e) { logger.error("QStore not accepting the xml, please check with the server logs.", e); return res; } return res; }
Source:
<code>private void initClusterConnection() { try { properties.put(ConnectionPropertyNames.CONNECTION_NAME, CONNECTION_PREFIX + entityIdentifier); <START> properties.put(ConnectionPropertyNames.CONNECTION_TIMEOUT, Long.toString(Timeouts.INFINITE_TIMEOUT.toMillis())); <END> clusterConnection = ConnectionFactory.connect(clusterUri, properties); } catch (ConnectionException ex) { throw new RuntimeException(ex); } }</code><technical_language>connection timeout no? I missed something</technical_language>

Target:
private void initClusterConnection() { try { properties.put(ConnectionPropertyNames.CONNECTION_NAME, CONNECTION_PREFIX + entityIdentifier); properties.put(ConnectionPropertyNames.CONNECTION_TIMEOUT, Long.toString(timeouts.getConnectionTimeout().toMillis())); clusterConnection = ConnectionFactory.connect(clusterUri, properties); } catch (ConnectionException ex) { throw new RuntimeException(ex); } }
Source:
<code>private int verifyComma(String line) { boolean withComma = true; int commaAmount = 0; <START> int len = line.length(); <END> if (line.endsWith(")")) { line = line.substring(0, len - 1); line = line.trim(); len--; while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; line = line.concat(")"); len++; } } } else { while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; } } } return commaAmount; }</code><technical_language>keeping len here? unsynchronized do .trim() on, I need this variable (just line.length() need it)</technical_language>

Target:
private int verifyComma(String line) { boolean withComma = true; int commaAmount = 0; int len = line.length(); if (line.endsWith(")")) { line = line.substring(0, len - 1); line = line.trim(); len = line.length(); while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; line = line.concat(")"); len++; } } } else { while (withComma == true) { if (line.endsWith(",")) { line = line.substring(0, len - 1); len--; commaAmount++; } else { withComma = false; } } } return commaAmount; }
Source:
<code>public static Configuration getConfig(DataSource ds, Class<?>... mappers) { <START> if (ds == null) { <END> } if (ds == null) { throw new NullPointerException("Tried initializing MyBatis without a datasource"); } final TransactionFactory transactionFactory = new JdbcTransactionFactory(); final Environment environment = new Environment("development", transactionFactory, ds); final Configuration configuration = new Configuration(environment); configuration.setLazyLoadingEnabled(true); addMappers(configuration, mappers); return configuration; }</code><technical_language>Sure, out of this put another draft PR</technical_language>

Target:
public static Configuration getConfig(DataSource ds, Class<?>... mappers) { if (ds == null) { throw new NullPointerException("Tried initializing MyBatis without a datasource"); } final TransactionFactory transactionFactory = new JdbcTransactionFactory(); final Environment environment = new Environment("development", transactionFactory, ds); final Configuration configuration = new Configuration(environment); configuration.setLazyLoadingEnabled(true); addMappers(configuration, mappers); return configuration; }
Source:
<code>public boolean visit(IResourceDelta delta) throws CoreException { if (atLeastOneInterestingDelta) { return false; } <START> final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT && (delta.getKind() == IResourceDelta.REMOVED)) { atLeastOneInterestingDelta = true; return false; } if (resource.getType() == IResource.FOLDER && delta.getKind() == IResourceDelta.ADDED) { atLeastOneInterestingDelta = true; return false; } <END> if (GitResourceDeltaVisitor.isInteresting(delta)) { atLeastOneInterestingDelta = true; return false; } return true; }</code><technical_language>I this removed, including unused import of org.eclipse.core.resources.IResource. Additions deletions interesting, GitResourceDeltaVisitor.isInteresting(delta) return true for them</technical_language>

Target:
public boolean visit(IResourceDelta delta) throws CoreException { if (atLeastOneInterestingDelta) { return false; } if (GitResourceDeltaVisitor.isInteresting(delta)) { atLeastOneInterestingDelta = true; return false; } return true; }
Source:
<code><START> public void setRange(int begin, int end) <END> { this.end = end; int[] wholeRowGroup = ensureWholeRowGroupCapacity(end); if (positions == null || positions.length < end) { positions = new int[end]; } System.arraycopy(wholeRowGroup, begin, positions, 0, end - begin); int[] allZeroes = ensureAllZeroesCapacity(end); if (inputNumbers == null || inputNumbers.length < end - begin) { inputNumbers = Arrays.copyOf(allZeroes, end - begin); } else { System.arraycopy(allZeroes, 0, inputNumbers, 0, end - begin); } positionCount = end - begin; }</code><technical_language>check < end >=0: checkArgument(begin >= 0, "begin negative"); checkArgument(begin < end, "begin end");</technical_language>

Target:
public void setRange(int begin, int end) { checkArgument(begin >= 0, "begin must not be negative"); checkArgument(begin < end, "begin must be less than end"); this.end = end; int[] wholeRowGroup = ensureWholeRowGroupCapacity(end); if (positions == null || positions.length < end - begin) { positions = new int[end]; } System.arraycopy(wholeRowGroup, begin, positions, 0, end - begin); int[] allZeroes = ensureAllZeroesCapacity(end); if (inputNumbers == null || inputNumbers.length < end - begin) { inputNumbers = Arrays.copyOf(allZeroes, end - begin); } else { System.arraycopy(allZeroes, begin, inputNumbers, 0, end - begin); } positionCount = end - begin; }
Source:
<code>public Query<SegmentAnalysis> withOverriddenContext(Map<String, Object> contextOverride) { return new SegmentMetadataQuery( getDataSource(), getQuerySegmentSpec(), toInclude, merge, computeOverridenContext(contextOverride), <START> isUsingDefaultInterval() <END> ); }</code><technical_language>usingDefaultInterval more consistent other fields work</technical_language>

Target:
public Query<SegmentAnalysis> withOverriddenContext(Map<String, Object> contextOverride) { return new SegmentMetadataQuery( getDataSource(), getQuerySegmentSpec(), toInclude, merge, computeOverridenContext(contextOverride), usingDefaultInterval ); }
Source:
<code>public final String toString() { return new StringBuilder().append("Contact Id : ").append(contactId).append(",\n").append("Name : ").append(name) .append(",\n").append("HAS_PHONE_NUMBER : ").append(hasPhoneNumber).append(",\n").append("Contact Number : ") <START> .append(listToString(contactNumberList)).append(",\n").append("EmailId : ").append(listToString(emailIdList)) <END> .append(",\n").append("PhotoID : ").append(photoId).append(",\n").append("LogoID : ").append(logoId) .append("\n").toString(); }</code><technical_language>default toString List do thing</technical_language>

Target:
public final String toString() { return new StringBuilder().append("Contact Id : ").append(contactId).append(",\n").append("Name : ").append(name) .append(",\n").append("HAS_PHONE_NUMBER : ").append(hasPhoneNumber).append(",\n").append("Contact Number : ") .append(contactNumberList.toString()).append(",\n").append("EmailId : ") .append(emailIdList.toString()).append(",\n").append("PhotoID : ").append(photoId).append("," + "" + "\n").append("LogoID : ").append(logoId) .append("\n").toString(); }
Source:
<code>private static boolean doesLBHaveDrainSupport(Map<Object, Object> launchConfig) { if(launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID) != null) { String imageUuid = (String)launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID); Pair<String, String> instanceImage = getImageAndVersion(imageUuid.toLowerCase()); if (instanceImage.getLeft().isEmpty() || instanceImage.getRight().isEmpty()) { return false; } Pair<String, String> defaultImage = getImageAndVersion(LB_IMAGE_UUID.get().toLowerCase()); <START> if (!defaultImage.getLeft().equalsIgnoreCase(instanceImage.getLeft())) { <END> return false; } return isDrainProvider(instanceImage.getRight()); } return false; }</code><technical_language>equalsignorecase is redundant lowercasing images</technical_language>

Target:
private static boolean doesLBHaveDrainSupport(Map<Object, Object> launchConfig) { if(launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID) == null) { return false; } String imageUuid = (String)launchConfig.get(InstanceConstants.FIELD_IMAGE_UUID); Pair<String, String> instanceImage = getImageAndVersion(imageUuid.toLowerCase()); if (instanceImage.getLeft().isEmpty() || instanceImage.getRight().isEmpty()) { return false; } Pair<String, String> defaultImage = getImageAndVersion(LB_IMAGE_UUID.get().toLowerCase()); if (!defaultImage.getLeft().equals(instanceImage.getLeft())) { return false; } return isDrainProvider(instanceImage.getRight()); }
Source:
<code>public Blob findOrCreateByPath(String tenantId, String path) { if (Strings.isEmpty(path)) { throw new IllegalArgumentException("An empty path was provided!"); } <START> String cacheKey = tenantId + "-" + ensureRelativePath(path); <END> return blobByPathCache.get(cacheKey, ignored -> fetchOrCreateByPath(tenantId, path)); }</code><technical_language>redundant code</technical_language>

Target:
public Blob findOrCreateByPath(String tenantId, String path) { if (Strings.isEmpty(path)) { throw new IllegalArgumentException("An empty path was provided!"); } return blobByPathCache.get(determinePathCacheKey(tenantId, path), ignored -> fetchOrCreateByPath(tenantId, path)); }
Source:
<code>public List<String> getIndices() { return this.cacheManager.getCacheNames() <START> .stream() <END> .collect(toList()); }</code><technical_language>stream collect list return new ArrayList<>(cacheManager.getCacheNames());</technical_language>

Target:
public List<String> getIndices() { return new ArrayList<>(this.cacheManager.getCacheNames()); }
Source:
<code>private String getVmEditedName() { <START> if (!getVmNamesMap().containsKey(getEditedVmId())) { <END> getVmNamesMap().put(getEditedVmId(), getEntity().getVm().getName()); } return getVmNamesMap().get(getEditedVmId()); }</code><technical_language>needed verify</technical_language>

Target:
private String getVmEditedName() { if (!vmNamesMap.containsKey(editedVmId)) { vmNamesMap.put(editedVmId, getEntity().getVm().getName()); } return vmNamesMap.get(editedVmId); }
Source:
<code>public Envelope apply(Request webRequest) throws BadRequestException { String bboxParam = webRequest.queryParams("bbox"); if (bboxParam == null) { return null; } Envelope bbox = null; try { String[] bboxCoords = bboxParam.split(","); if (bboxCoords.length != 4) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } Double minLon = Double.valueOf(bboxCoords[0]); Double minLat = Double.valueOf(bboxCoords[2]); Double maxLon = Double.valueOf(bboxCoords[1]); Double maxLat = Double.valueOf(bboxCoords[3]); if (minLon > 180.0 || minLon < -180.00 || maxLon > 180.0 || maxLon < -180.00) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } if (minLat > 90.0 || minLat < -90.00 || maxLat > 90.0 || maxLat < -90.00) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } <START> bbox = new Envelope(minLon, minLat, maxLon, maxLat); <END> } catch (NumberFormatException nfe) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } return bbox; }</code><technical_language>is a double error in cancel out. bbox is parsed (minLon, maxLon, minLat, maxLat) while (minLon, minLat, MaxLon, MaxLat). In constructor for Envelope exact reverse is true</technical_language>

Target:
public Envelope apply(Request webRequest) throws BadRequestException { String bboxParam = webRequest.queryParams("bbox"); if (bboxParam == null) { return null; } Envelope bbox = null; try { String[] bboxCoords = bboxParam.split(","); if (bboxCoords.length != 4) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } Double minLon = Double.valueOf(bboxCoords[0]); Double minLat = Double.valueOf(bboxCoords[1]); Double maxLon = Double.valueOf(bboxCoords[2]); Double maxLat = Double.valueOf(bboxCoords[3]); if (minLon > 180.0 || minLon < -180.00 || maxLon > 180.0 || maxLon < -180.00) { throw new BadRequestException(400, INVALID_BBOX_BOUNDS_MESSAGE); } if (minLat > 90.0 || minLat < -90.00 || maxLat > 90.0 || maxLat < -90.00) { throw new BadRequestException(400, INVALID_BBOX_BOUNDS_MESSAGE); } bbox = new Envelope(minLon, maxLon, minLat, maxLat); } catch (NumberFormatException nfe) { throw new BadRequestException(400, INVALID_BBOX_ERROR_MESSAGE); } return bbox; }
Source:
<code>public void insertExcessEnumMetric(Locator locator) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_EXCESS_ENUMS_NAME); try { AstyanaxIO.getKeyspace().prepareColumnMutation(CassandraModel.CF_METRICS_EXCESS_ENUMS, locator, 0L) .putEmptyColumn(null).execute(); } catch (ConnectionException e) { Instrumentation.markWriteError(e); Instrumentation.markExcessEnumWriteError(); <START> LOG.error("Error writing ExcessEnum Metric", e); <END> throw new IOException(e); } finally { ctx.stop(); } }</code><technical_language>please print Locator LOG.errror() message</technical_language>

Target:
public void insertExcessEnumMetric(Locator locator) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_EXCESS_ENUMS_NAME); try { AstyanaxIO.getKeyspace().prepareColumnMutation(CassandraModel.CF_METRICS_EXCESS_ENUMS, locator, 0L) .putEmptyColumn(null).execute(); } catch (ConnectionException e) { Instrumentation.markWriteError(e); Instrumentation.markExcessEnumWriteError(); LOG.error("Error writing ExcessEnum Metric " + locator, e); throw new IOException(e); } finally { ctx.stop(); } }
Source:
<code>public void saveSettings(@RequestBody SettingsDto settings) { String taskPossibleErrors = settings.getTaskPossibleErrors(); OutputStream os = new ByteArrayOutputStream(); try { settings.getTaskRetriesProps().store(os, "TaskRetries"); } catch (IOException e) { throw new MotechException("Error parsing task retries", e); } if (settings.isValid()) { settingsFacade.setProperty(TASK_POSSIBLE_ERRORS, taskPossibleErrors); <START> settingsFacade.saveRawConfig(TASK_PROPERTIES_FILE_NAME, new String(os.toString())); <END> } else { throw new IllegalArgumentException("Settings are not valid"); } }</code><technical_language>close stream, try resource</technical_language>

Target:
public void saveSettings(@RequestBody SettingsDto settings) { String taskPossibleErrors = settings.getTaskPossibleErrors(); try(OutputStream os = new ByteArrayOutputStream()) { settings.getTaskRetriesProps().store(os, "TaskRetries"); if (settings.isValid()) { settingsFacade.setProperty(TASK_POSSIBLE_ERRORS, taskPossibleErrors); settingsFacade.saveRawConfig(TASK_PROPERTIES_FILE_NAME, new String(os.toString())); } else { throw new IllegalArgumentException("Settings are not valid"); } } catch (IOException e) { throw new MotechException("Error parsing task retries", e); } }
Source:
<code>public void testBouncyCastleProviderIsUsableThroughJceApi() throws Exception { BouncyCastleProvider bcProvider = null; try { bcProvider = new BouncyCastleProvider(); useBouncyCastleProviderThroughJceApi(bcProvider); } catch (Exception e) { <START> e.printStackTrace(); <END> if (e instanceof SecurityException && e.getMessage().contains("JCE cannot authenticate the provider")) { String bcLocation = (bcProvider == null) ? "" : "(" + bcProvider.getClass().getProtectionDomain().getCodeSource().getLocation() + ")"; throw new Exception("Packaging with BouncyCastleProvider" + bcLocation + " is probably not properly signed for JCE usage, see server log for details.", e); } else { throw e; } } }</code><technical_language>remove</technical_language>

Target:
public void testBouncyCastleProviderIsUsableThroughJceApi() throws Exception { BouncyCastleProvider bcProvider = null; try { bcProvider = new BouncyCastleProvider(); useBouncyCastleProviderThroughJceApi(bcProvider); } catch (Exception e) { if (e instanceof SecurityException && e.getMessage().contains("JCE cannot authenticate the provider")) { String bcLocation = (bcProvider == null) ? "" : "(" + bcProvider.getClass().getProtectionDomain().getCodeSource().getLocation() + ")"; throw new Exception("Packaging with BouncyCastleProvider" + bcLocation + " is probably not properly signed for JCE usage, see server log for details.", e); } else { throw e; } } }
Source:
<code><START> protected boolean matchesSafely(ValidationResult item) { <END> final List<String> vr = item.getVariableReplacements(); return variableReplacements.length == vr.size() && vr.containsAll(Arrays.asList(variableReplacements)); }</code><technical_language>verify null of replacements accessing</technical_language>

Target:
protected boolean matchesSafely(ValidationResult item) { List<String> replacements = item.getVariableReplacements(); final List<String> vr = replacements == null ? Collections.<String>emptyList() : replacements; return variableReplacements.length == vr.size() && vr.containsAll(Arrays.asList(variableReplacements)); }
Source:
<code>public List<CaseFileData> index(String name, Object variable) { List<CaseFileData> indexed = new ArrayList<CaseFileData>(); CaseFileDataLog caseVariable = new CaseFileDataLog(); caseVariable.setItemName(name); <START> caseVariable.setItemValue(variable == null ? "" : variable.toString()); <END> indexed.add(caseVariable); return indexed; }</code><technical_language>for StringTaskVariableIndexer here? <LINK_0></technical_language>

Target:
public List<CaseFileData> index(String name, Object variable) { List<CaseFileData> indexed = new ArrayList<CaseFileData>(); CaseFileDataLog caseVariable = new CaseFileDataLog(); caseVariable.setItemName(name); caseVariable.setItemValue(variable == null ? "" : variable.toString()); caseVariable.setItemType(variable == null ? "" : variable.getClass().getName()); indexed.add(caseVariable); return indexed; }
Source:
<code>public Deallocator allocate(final PublisherPackSlice slice) throws PublisherException { if (loadedSlices.contains(slice)) throw new IllegalStateException("Slice " + slice + " already allocated"); <START> size.addAndGet(slice.getSize()); <END> synchronized (this) { for (PublisherPackSlice s : loadedSlices) { if (size.get() <= capacity) break; try { s.store(); } catch (IOException e) { throw new PublisherException( "Error deallocating pack slice " + slice, e); } } } loadedSlices.add(slice); return new Deallocator() { public void deallocate() throws PublisherException { if (!loadedSlices.remove(slice)) throw new PublisherException("Slice " + slice + " already deallocated"); size.addAndGet(-slice.getSize()); } }; }</code><technical_language>check <= capacity short-circuit block below</technical_language>

Target:
public Deallocator allocate(final PublisherPackSlice slice) throws PublisherException { if (loadedSlices.contains(slice)) throw new IllegalStateException("Slice " + slice + " already allocated"); size.addAndGet(slice.getSize()); if (size.get() > capacity) { synchronized (this) { for (PublisherPackSlice s : loadedSlices) { if (size.get() <= capacity) break; try { s.store(); } catch (IOException e) { throw new PublisherException( "Error deallocating pack slice " + slice, e); } } } } loadedSlices.add(slice); return new Deallocator() { public void deallocate() throws PublisherException { if (!loadedSlices.remove(slice)) throw new PublisherException("Slice " + slice + " already deallocated"); size.addAndGet(-slice.getSize()); } }; }
Source:
<code>private void raiseIssueForVariable(SubscriptionContext ctx, Name variable) { <START> if (variable.symbol() != null) { <END> Symbol variableSymbol = variable.symbol(); if (variableIssuesRaised.containsKey(variableSymbol)) { variableIssuesRaised.get(variableSymbol).secondary(variable, REPEATED_VAR_MESSAGE); } else { variableIssuesRaised.put(variableSymbol, ctx.addIssue(variable, String.format(MESSAGE, VRBL_ISSUE_TYPE))); } } }</code><technical_language>Nitpick: I assign variableSymbol access twice</technical_language>

Target:
private void raiseIssueForVariable(SubscriptionContext ctx, Name variable) { Symbol variableSymbol = variable.symbol(); if (variableSymbol != null) { PreciseIssue existingIssue = variableIssuesRaised.get(variableSymbol); if (existingIssue != null) { existingIssue.secondary(variable, REPEATED_VAR_MESSAGE); } else { variableIssuesRaised.put(variableSymbol, ctx.addIssue(variable, MESSAGE)); } } }
Source:
<code>public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) { Exception exception = null; frontendMetrics.securityServicePostProcessRequestRate.mark(); long startTimeMs = System.currentTimeMillis(); if (!isOpen) { exception = new RestServiceException("SecurityService is closed", RestServiceErrorCode.ServiceUnavailable); } else if (restRequest == null || callback == null) { throw new IllegalArgumentException("RestRequest or Callback is null"); } <START> if (restRequest.getRestMethod() == RestMethod.DELETE || restRequest.getRestMethod().equals(RestMethod.PUT)) { <END> try { accountAndContainerNamePreconditionCheck(restRequest); } catch (Exception e) { exception = e; } } frontendMetrics.securityServicePostProcessRequestTimeInMs.update(System.currentTimeMillis() - startTimeMs); callback.onCompletion(null, exception); }</code><technical_language>minor: == enum (or change == RestMethod.DELETE .equals(RestMethod.DELETE) for consistency)</technical_language>

Target:
public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) { Exception exception = null; frontendMetrics.securityServicePostProcessRequestRate.mark(); long startTimeMs = System.currentTimeMillis(); if (!isOpen) { exception = new RestServiceException("SecurityService is closed", RestServiceErrorCode.ServiceUnavailable); } else if (restRequest == null || callback == null) { throw new IllegalArgumentException("RestRequest or Callback is null"); } if (restRequest.getRestMethod() == RestMethod.DELETE || restRequest.getRestMethod() == RestMethod.PUT) { try { accountAndContainerNamePreconditionCheck(restRequest); } catch (Exception e) { exception = e; } } frontendMetrics.securityServicePostProcessRequestTimeInMs.update(System.currentTimeMillis() - startTimeMs); callback.onCompletion(null, exception); }
Source:
<code>public void awaitUpToDate( long oldestAcceptableTxId, Duration timeout ) throws TransactionFailureException { if ( oldestAcceptableTxId <= BASE_TX_ID ) { return; } if ( !availabilityGuard.isAvailable() ) { throw new TransactionFailureException( Status.General.DatabaseUnavailable, "Database had become unavailable while waiting for requested version %d.", oldestAcceptableTxId ); } try { transactionIdStore().awaitClosedTransactionId( oldestAcceptableTxId, timeout.toMillis() ); <START> } <END> catch ( InterruptedException | TimeoutException e ) { throw new TransactionFailureException( Status.Transaction.InstanceStateChanged, e, "Database not up to the requested version: %d. Latest database version is %d", oldestAcceptableTxId, transactionIdStore().getLastClosedTransactionId() ); } }</code><technical_language>I interruption status of thread restored here, if interrupted</technical_language>

Target:
public void awaitUpToDate( long oldestAcceptableTxId, Duration timeout ) throws TransactionFailureException { if ( oldestAcceptableTxId <= BASE_TX_ID ) { return; } if ( !availabilityGuard.isAvailable() ) { throw new TransactionFailureException( Status.General.DatabaseUnavailable, "Database unavailable" ); } try { transactionIdStore().awaitClosedTransactionId( oldestAcceptableTxId, timeout.toMillis() ); } catch ( InterruptedException | TimeoutException e ) { if ( e instanceof InterruptedException ) { Thread.currentThread().interrupt(); } throw new TransactionFailureException( Status.Transaction.InstanceStateChanged, e, "Database not up to the requested version: %d. Latest database version is %d", oldestAcceptableTxId, transactionIdStore().getLastClosedTransactionId() ); } }
Source:
<code>public void testTaskJobLauncherCLRSuccessFail() { String[] enabledArgs = new String[] { "--spring.cloud.task.batch.failOnJobFailure=true", <START> "--spring.batch.job.enabled=false"}; END> boolean isExceptionThrown = false; try { this.applicationContext = SpringApplication .run(new Class[] { TaskJobLauncherCommandLineRunnerTests.JobWithFailureConfiguration.class}, enabledArgs); } catch (IllegalStateException exception) { isExceptionThrown = true; } assertThat(isExceptionThrown).isTrue(); }</code><technical_language>need for this change Boot 1 Boot 2</technical_language>

Target:
public void testTaskJobLauncherCLRSuccessFail() { String[] enabledArgs = new String[] { "--spring.cloud.task.batch.failOnJobFailure=true"}; validateForFail(DEFAULT_ERROR_MESSAGE, TaskJobLauncherCommandLineRunnerTests.JobWithFailureConfiguration.class, enabledArgs); }
Source:
<code>protected long executeTimers() { assert (Thread.currentThread() == worker); changed = false; if (timers.isEmpty()) { return 0L; } long current = clock(); for (Entry<TimerInfo, Long> entry : timers.entries()) { final TimerInfo timerInfo = entry.getKey(); if (timerInfo.cancelled) { timers.remove(entry.getValue(), timerInfo); continue; } final Long key = entry.getValue(); if (key > current) { return key - current; } timers.remove(key, timerInfo); timerInfo.sink.timerEvent(timerInfo.id); } for (Entry<TimerInfo, Long> entry : timers.entries()) { final Long key = entry.getValue(); <START> if (timers.getValues(key).isEmpty()) { <END> timers.remove(key); } } if (changed) { return executeTimers(); } return 0L; }</code><technical_language>if (!timers.hasValues(key) { timers.remove(key); } possible</technical_language>

Target:
protected long executeTimers() { assert (Thread.currentThread() == worker); changed = false; if (timers.isEmpty()) { return 0L; } long current = clock(); for (Entry<TimerInfo, Long> entry : timers.entries()) { final TimerInfo timerInfo = entry.getKey(); if (timerInfo.cancelled) { timers.remove(entry.getValue(), timerInfo); continue; } final Long key = entry.getValue(); if (key > current) { return key - current; } timers.remove(key, timerInfo); timerInfo.sink.timerEvent(timerInfo.id); } for (Entry<TimerInfo, Long> entry : timers.entries()) { final Long key = entry.getValue(); if (!timers.hasValues(key)) { timers.remove(key); } } if (changed) { return executeTimers(); } return 0L; }
Source:
<code>private void createSelector(Type type, @Nonnull Block projector, @Nonnull ChestMenu menu) { double currentOffset = DoubleHandler.fixDouble(Double.parseDouble(BlockStorage.getLocationInfo( projector.getLocation(), type.parameter))); <START> menu.addItem(type.slot, new CustomItem(type.button.getAsItemStack(), "&7" + type.coordinate + " Offset (" + type.direction + ") &e" + currentOffset, "", "&eLeft Click: &7" + type.direction + Math.abs(type.smallChange), "&eRight Click: &7" + type.direction + Math.abs(type.smallChange))); <END> menu.addMenuClickHandler(type.slot, (pl, slot, item, action) -> { double storedOffset = DoubleHandler.fixDouble(Double.parseDouble(BlockStorage.getLocationInfo(projector.getLocation(), type.parameter))); double offset = action.isRightClicked() ? type.largeChange : type.smallChange; if ((type.coordinate == 'X' || type.coordinate == 'Z') && offset + storedOffset > maxDistance.getValue()) { offset = maxDistance.getValue() - storedOffset; } ArmorStand hologram = getArmorStand(projector, true); if (type.coordinate == 'X') { hologram.teleport(hologram.getLocation().add(offset, 0, 0)); } else if (type.coordinate == 'Y') { hologram.teleport(hologram.getLocation().add(0, offset, 0)); } else { hologram.teleport(hologram.getLocation().add(0, 0, offset)); } BlockStorage.addBlockInfo(projector, type.parameter, String.valueOf(storedOffset + offset)); openEditor(pl, projector); return false; }); }</code><technical_language>This needs a bit refactoring</technical_language>

Target:
private void createSelector(Type type, @Nonnull Block projector, @Nonnull ChestMenu menu) { double currentOffset = DoubleHandler.fixDouble(Double.parseDouble(BlockStorage.getLocationInfo( projector.getLocation(), type.parameter))); menu.addItem(type.slot, new CustomItem(type.button.getAsItemStack(), "&7" + type.coordinate + " Offset (" + type.direction + ") &e" + currentOffset, "", "&eLeft Click: &7" + type.direction + Math.abs(type.smallChange), "&eRight Click: &7" + type.direction + Math.abs(type.largeChange))); menu.addMenuClickHandler(type.slot, (pl, slot, item, action) -> { double storedOffset = DoubleHandler.fixDouble(Double.parseDouble(BlockStorage.getLocationInfo(projector.getLocation(), type.parameter))); double offset = action.isRightClicked() ? type.largeChange : type.smallChange; if ((type.coordinate == 'X' || type.coordinate == 'Z') && offset + storedOffset > maxDistance.getValue()) { offset = maxDistance.getValue() - storedOffset; } ArmorStand hologram = getArmorStand(projector, true); if (type.coordinate == 'X') { hologram.teleport(hologram.getLocation().add(offset, 0, 0)); } else if (type.coordinate == 'Y') { hologram.teleport(hologram.getLocation().add(0, offset, 0)); } else { hologram.teleport(hologram.getLocation().add(0, 0, offset)); } BlockStorage.addBlockInfo(projector, type.parameter, String.valueOf(storedOffset + offset)); openEditor(pl, projector); return false; }); }
Source:
<code>public CgroupOOMDetector(URI dockerDaemonUri, DockerConnector dockerConnector) { this.dockerDaemonUri = dockerDaemonUri; this.dockerConnector = dockerConnector; <START> oomDetectors = new ConcurrentHashMap<>(); <END> executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("CgroupOOMDetector-%d").setDaemon(true).build()); }</code><technical_language>this</technical_language>

Target:
public CgroupOOMDetector(URI dockerDaemonUri, DockerConnector dockerConnector) { this.dockerDaemonUri = dockerDaemonUri; this.dockerConnector = dockerConnector; this.oomDetectors = new ConcurrentHashMap<>(); this.executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("CgroupOOMDetector-%d") .setDaemon(true) .build()); }
Source:
<code>private String getParamJson(final String msg) { <START> Map<String, Object> param = Maps.newLinkedHashMap(); <END> param.put("msgtype", "text"); param.put("text", Collections.singletonMap("content", msg)); return GsonFactory.getGson().toJson(param); }</code><technical_language><p><b>Note for Java 7 later:</b> this method is unnecessary treated deprecated. Instead, {@code LinkedHashMap} constructor directly, advantage of new <a href="<LINK_0>">"diamond" syntax</a></technical_language>

Target:
private String getParamJson(final String msg) { return GsonFactory.getGson().toJson(ImmutableMap.of("msgtype", "text", "text", Collections.singletonMap("content", msg))); }
Source:
<code>public void triggerRecovery() { <START> doTriggerRecovery(null, System.getProperty(NarayanaLRAClient.LRA_COORDINATOR_HOST_KEY), <END> Integer.parseInt(System.getProperty(NarayanaLRAClient.LRA_COORDINATOR_PORT_KEY))); }</code><technical_language>code more legible please. is check default for LRA_COORDINATOR_PORT_KEY</technical_language>

Target:
public void triggerRecovery() { recoverLRAs( System.getProperty(NarayanaLRAClient.LRA_COORDINATOR_HOST_KEY, "localhost"), Integer.parseInt(System.getProperty(NarayanaLRAClient.LRA_COORDINATOR_PORT_KEY, "8080"))); }
Source:
<code>protected GitModelObjectContainer(GitModelObject parent, RevCommit commit, int direction) throws IOException { super(parent); kind = direction; if (commit != null) { baseCommit = commit; RevCommit[] parents = baseCommit.getParents(); if (parents != null && parents.length > 0) <START> remoteCommit = new ObjectWalk(getRepository()) <END> .parseCommit(baseCommit.getParent(0)); else { remoteCommit = null; } } else { baseCommit = null; remoteCommit = null; } }</code><technical_language>RevWalk sufficient here</technical_language>

Target:
protected GitModelObjectContainer(GitModelObject parent, RevCommit commit, int direction) throws IOException { super(parent); kind = direction; if (commit != null) { baseCommit = commit; RevCommit[] parents = baseCommit.getParents(); if (parents != null && parents.length > 0) remoteCommit = new RevWalk(getRepository()) .parseCommit(getParentRevCommit()); else { remoteCommit = null; } } else { baseCommit = null; remoteCommit = null; } }
Source:
<code>public final Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner, Map copyCache) { if ( original == null && target == null ) { return null; } if ( original == LazyPropertyInitializer.UNFETCHED_PROPERTY ) { return target; } if ( target == LazyPropertyInitializer.UNFETCHED_PROPERTY ) { return getReplacement( (T) original, null, session ); <START> } <END> return getReplacement( (T) original, (T) target, session ); }</code><technical_language>want a other replace() method below, calls getReplacement, executing this code. a bug? a dumb suggestion, move this code caller(s) of replace()? type benefit this code, types extending AbstractStandardBasicType. I simple, remove need for type implementations refer LazyPropertyInitializer, is SPI type..</technical_language>

Target:
public final Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner, Map copyCache) { if ( original == null && target == null ) { return null; } return getReplacement( (T) original, (T) target, session ); }
Source:
<code>private static void installDefaultExceptionHandler() { sOriginalUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); <START> Thread.setDefaultUncaughtExceptionHandler((t, e) -> { <END> sendAnalyticsException(e, true); sOriginalUncaughtExceptionHandler.uncaughtException(t, e); }); }</code><technical_language>variable names abbreviations misspellings... optimize for readability writability</technical_language>

Target:
synchronized private static void installDefaultExceptionHandler() { sOriginalUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> { sendAnalyticsException(throwable, true); sOriginalUncaughtExceptionHandler.uncaughtException(thread, throwable); }); }
Source:
<code>protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { CallStackAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallStackAnalysis.class, CallStackAnalysis.ID); if (fModule == null) { return null; } fModule.schedule(); <START> Job job = new Job("CallStack analysis") { END> @Override protected IStatus run(IProgressMonitor monitor) { fModule.waitForCompletion(monitor); if(monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.schedule(); return fModule; }</code><technical_language>externalize</technical_language>

Target:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { CallStackAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallStackAnalysis.class, CallStackAnalysis.ID); if (fModule == null) { return null; } fModule.schedule(); Job job = new Job(Messages.CallStackTableViewer_) { @Override protected IStatus run(IProgressMonitor monitor) { fModule.waitForCompletion(monitor); if(monitor.isCanceled()) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.schedule(); return fModule; }
Source:
<code>private WorkflowRun runProject() throws Exception { <START> return j.assertBuildStatusSuccess(project.scheduleBuild2(0)); <END> }</code><technical_language>suggestion return j.buildAndAssertSuccess(project); is short inlined anyway</technical_language>

Target:
private WorkflowRun runProject() throws Exception { return j.buildAndAssertSuccess(project); }
Source:
<code>public Set<LayoutOptionData> getSupportedOptions(final ILayoutConfigurationStore config) { LayoutMetaDataService layoutDataService = LayoutMetaDataService.getInstance(); <START> Set<LayoutOptionData> optionData = new HashSet<LayoutOptionData>(); <END> Set<LayoutOptionData.Target> optionTargets = config.getOptionTargets(); if (optionTargets.contains(LayoutOptionData.Target.PARENTS)) { LayoutAlgorithmData algoData = getAlgorithm(config); if (algoData != null) { optionData.addAll(layoutDataService.getOptionData(algoData, LayoutOptionData.Target.PARENTS)); } } ILayoutConfigurationStore parentConfig = config.getParent(); if (parentConfig != null) { LayoutAlgorithmData algoData = getAlgorithm(parentConfig); if (algoData != null) { for (LayoutOptionData.Target target : optionTargets) { if (target != LayoutOptionData.Target.PARENTS) { optionData.addAll(layoutDataService.getOptionData(algoData, target)); } } } } return optionData; }</code><technical_language>a LinkedHashSet here. relevant for Layout view sorts entries, safe</technical_language>

Target:
public Set<LayoutOptionData> getSupportedOptions(final ILayoutConfigurationStore config) { LayoutMetaDataService layoutDataService = LayoutMetaDataService.getInstance(); Set<LayoutOptionData> optionData = new LinkedHashSet<LayoutOptionData>(); Set<LayoutOptionData.Target> optionTargets = config.getOptionTargets(); if (optionTargets.contains(LayoutOptionData.Target.PARENTS)) { LayoutAlgorithmData algoData = getAlgorithm(config); if (algoData != null) { optionData.addAll(layoutDataService.getOptionData(algoData, LayoutOptionData.Target.PARENTS)); } } ILayoutConfigurationStore parentConfig = config.getParent(); if (parentConfig != null) { LayoutAlgorithmData algoData = getAlgorithm(parentConfig); if (algoData != null) { for (LayoutOptionData.Target target : optionTargets) { if (target != LayoutOptionData.Target.PARENTS) { optionData.addAll(layoutDataService.getOptionData(algoData, target)); } } } } return optionData; }
Source:
<code>public void shouldEnrollSubject() throws IOException { try { fakeNow(newDateTime(2015, 8, 1, 0, 0, 0)); Subject subject = createSubjectWithRequireData("1"); InputStream inputStream = getClass().getResourceAsStream("/enrollSimple.csv"); raveImportService.importCsv(new InputStreamReader(inputStream), "/enrollSimple.csv"); inputStream.close(); SubjectEnrollments subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); ebodacEnrollmentService.unenrollSubject(subjectEnrollments.getSubject().getSubjectId()); ebodacEnrollmentService.enrollSubject(subject.getSubjectId()); subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); <START> assertEquals(3, subjectEnrollments.getEnrollments().size()); <END> } finally { stopFakingTime(); } }</code><technical_language>check status</technical_language>

Target:
public void shouldEnrollSubject() throws IOException { try { fakeNow(newDateTime(2015, 8, 1, 0, 0, 0)); Subject subject = createSubjectWithRequireData("1"); InputStream inputStream = getClass().getResourceAsStream("/enrollSimple.csv"); raveImportService.importCsv(new InputStreamReader(inputStream), "/enrollSimple.csv"); inputStream.close(); SubjectEnrollments subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); ebodacEnrollmentService.unenrollSubject(subjectEnrollments.getSubject().getSubjectId()); subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); for(Enrollment enrollment : subjectEnrollments.getEnrollments()) { assertEquals(EnrollmentStatus.UNENROLLED, enrollment.getStatus()); } ebodacEnrollmentService.enrollSubject(subject.getSubjectId()); subjectEnrollments = subjectEnrollmentsDataService.findEnrollmentBySubjectId(subject.getSubjectId()); assertEquals(3, subjectEnrollments.getEnrollments().size()); for(Enrollment enrollment : subjectEnrollments.getEnrollments()) { assertEquals(EnrollmentStatus.ENROLLED, enrollment.getStatus()); } } finally { stopFakingTime(); } }
Source:
<code>public Set<SecurityGroup> listSecurityGroupsForNode(String nodeId) { logger.debug(">> getting security groups for node %s...", nodeId); final ResourceGroupAndName resourceGroupAndName = ResourceGroupAndName.fromSlashEncoded(nodeId); VirtualMachine vm = api.getVirtualMachineApi(resourceGroupAndName.resourceGroup()).get( resourceGroupAndName.name()); if (vm == null) { throw new IllegalArgumentException("Node " + nodeId + " was not found"); } List<NetworkInterface> networkInterfacesIdReferences = vm.properties().networkProfile().networkInterfaces(); List<NetworkSecurityGroup> networkGroups = new ArrayList<NetworkSecurityGroup>(); <START> for (NetworkInterface networkInterfaceCardIdReference : networkInterfacesIdReferences) { <END> String nicName = extractName(networkInterfaceCardIdReference.id()); String nicResourceGroup = extractResourceGroup(networkInterfaceCardIdReference.id()); NetworkInterfaceCard card = api.getNetworkInterfaceCardApi(nicResourceGroup).get(nicName); if (card != null && card.properties().networkSecurityGroup() != null) { String secGroupName = card.properties().networkSecurityGroup().name(); String sgResourceGroup = card.properties().networkSecurityGroup().resourceGroup(); NetworkSecurityGroup group = api.getNetworkSecurityGroupApi(sgResourceGroup).get(secGroupName); networkGroups.add(group); } } return ImmutableSet.copyOf(transform(filter(networkGroups, notNull()), securityGroupConverter)); }</code><technical_language>networkInterfaceCardIdReference is networkInterface</technical_language>

Target:
public Set<SecurityGroup> listSecurityGroupsForNode(String nodeId) { logger.debug(">> getting security groups for node %s...", nodeId); final ResourceGroupAndName resourceGroupAndName = ResourceGroupAndName.fromSlashEncoded(nodeId); VirtualMachine vm = api.getVirtualMachineApi(resourceGroupAndName.resourceGroup()).get( resourceGroupAndName.name()); if (vm == null) { throw new IllegalArgumentException("Node " + nodeId + " was not found"); } List<NetworkInterface> networkInterfaces = vm.properties().networkProfile().networkInterfaces(); List<NetworkSecurityGroup> networkGroups = new ArrayList<NetworkSecurityGroup>(); for (NetworkInterface networkInterfaceCardIdReference : networkInterfaces) { String nicName = extractName(networkInterfaceCardIdReference.id()); String nicResourceGroup = extractResourceGroup(networkInterfaceCardIdReference.id()); NetworkInterfaceCard card = api.getNetworkInterfaceCardApi(nicResourceGroup).get(nicName); if (card != null && card.properties().networkSecurityGroup() != null) { String secGroupName = card.properties().networkSecurityGroup().name(); String sgResourceGroup = card.properties().networkSecurityGroup().resourceGroup(); NetworkSecurityGroup group = api.getNetworkSecurityGroupApi(sgResourceGroup).get(secGroupName); networkGroups.add(group); } } return ImmutableSet.copyOf(transform(filter(networkGroups, notNull()), securityGroupConverter)); }
Source:
<code>private String getBrokerURL() { return String.format( <START> "%s/druid/v2/", <END> router ); }</code><technical_language>this is confusing, is called router is routerUrl</technical_language>

Target:
private String getBrokerURL() { return String.format( "%s/druid/v2/", routerUrl ); }