auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void reindexPublishingSearch(Collection collection) throws IOException { info().data("collectionId", collection.getDescription().getId()).log("Reindexing search"); try { long start = System.currentTimeMillis(); List<String> uris = collection.reviewed.uris("*data.json"); for (String uri : uris) { if (isIndexedUri(uri)) { String contentUri = URIUtils.removeLastSegment(uri); reIndexPublishingSearch(contentUri); } } for (PendingDelete pendingDelete : collection.description.getPendingDeletes()) { ContentTreeNavigator.getInstance().search(pendingDelete.getRoot(), node -> { info().data("uri", node.uri).log("Deleting index from publishing search "); pool.submit(() -> { try { Indexer.getInstance().deleteContentIndex(node.type, node.uri); } catch (Exception e) { error().logException(e, "Exception reloading search index:"); } }); }); } info().data("collectionId", collection.getDescription().getId()) .data("timeTaken", (System.currentTimeMillis() - start)) .log("Redindex search completed"); } catch (Exception exception) { error().data("collectionId", collection.getDescription().getId()) .logException(exception, "An error occurred during the search reindex"); <START> <END> ExceptionUtils.printRootCauseStackTrace(exception); } }</code><technical_language>remove ExceptionUtils.printRootCauseStackTrace(exception) needed anymore logging exception stack trace</technical_language>

Target:
private static void reindexPublishingSearch(Collection collection) throws IOException { info().data("collectionId", collection.getDescription().getId()).log("Reindexing search"); try { long start = System.currentTimeMillis(); List<String> uris = collection.reviewed.uris("*data.json"); for (String uri : uris) { if (isIndexedUri(uri)) { String contentUri = URIUtils.removeLastSegment(uri); reIndexPublishingSearch(contentUri); } } for (PendingDelete pendingDelete : collection.description.getPendingDeletes()) { ContentTreeNavigator.getInstance().search(pendingDelete.getRoot(), node -> { info().data("uri", node.uri).log("Deleting index from publishing search "); pool.submit(() -> { try { Indexer.getInstance().deleteContentIndex(node.type, node.uri); } catch (Exception e) { error().logException(e, "Exception reloading search index:"); } }); }); } info().data("collectionId", collection.getDescription().getId()) .data("timeTaken", (System.currentTimeMillis() - start)) .log("Redindex search completed"); } catch (Exception exception) { error().data("collectionId", collection.getDescription().getId()) .logException(exception, "An error occurred during the search reindex"); } }
Source:
<code>public void processEvent(final CloudTrailEvent event) { List<String> keyNames = CloudtrailEventSupport.containsKeyNames(event.getEventData().getRequestParameters()); if (!CollectionUtils.isEmpty(keyNames)) { violationStore.save(new ViolationStoreDomain(event.getEventData().getAccountId(), <START> event.getEventData().getAwsRegion(), format("KeyPair must be blank, but was %s", keyNames))); <END> } }</code><technical_language>'CloudTrailEventSupport' static methods write 'getRegion(event)' 'getAccountId(event)'</technical_language>

Target:
public void processEvent(final CloudTrailEvent event) { List<String> keyNames = containsKeyNames(event.getEventData().getRequestParameters()); if (!CollectionUtils.isEmpty(keyNames)) { violationStore.save(new Violation(getAccountId(event), getRegionAsString(event), format("KeyPair must be blank, but was %s", keyNames))); } }
Source:
<code>public void start(StartContext context) { LOG.info("Querying service is starting."); executor = Executors.newSingleThreadScheduledExecutor(); executor.scheduleAtFixedRate(() -> { <START> Supplier<Node> node = new ActiveServiceSupplier<>(context.getController().getServiceContainer(), SingletonServiceActivator.SINGLETON_SERVICE_NAME); <END> if (node.get() != null) { LOG.infof("Singleton service is running on this (%s) node.", node.get()); } else { LOG.infof("Singleton service is not running on this node."); } }, 5, 5, TimeUnit.SECONDS); }</code><technical_language>This PassiveServiceSupplier, ActiveServiceSupplier</technical_language>

Target:
public void start(StartContext context) { LOG.info("Querying service is starting."); executor = Executors.newSingleThreadScheduledExecutor(); executor.scheduleAtFixedRate(() -> { Supplier<Node> node = new PassiveServiceSupplier<>(context.getController().getServiceContainer(), SingletonServiceActivator.SINGLETON_SERVICE_NAME); if (node.get() != null) { LOG.infof("Singleton service is running on this (%s) node.", node.get()); } else { LOG.infof("Singleton service is not running on this node."); } }, 5, 5, TimeUnit.SECONDS); }
Source:
<code><START> private static int queryFlagValue(boolean resolveGroups, boolean resolveGroupsRecursive) { <END> int result = 0; if (resolveGroups) { result |= Authz.QueryFlags.RESOLVE_GROUPS; } if (resolveGroupsRecursive) { result |= Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE; } return result; }</code><technical_language>I this is insane.... but..</technical_language>

Target:
private static int queryFlagValue(boolean resolveGroups, boolean resolveGroupsRecursive) { int result = 0; if (resolveGroups) { result |= Authz.QueryFlags.RESOLVE_GROUPS; } if (resolveGroupsRecursive) { result |= Authz.QueryFlags.RESOLVE_GROUPS_RECURSIVE | Authz.QueryFlags.RESOLVE_GROUPS; } return result; }
Source:
<code>public void generatePage_OnBiDimentionalArray_generatesOutput() { setUpWithJson(SAMPLE_JSON); final Feature feature = features.get(1); page = new FeatureReportPage(reportResult, configuration, feature); page.generatePage(); DocumentAssertion document = documentFrom(page.getWebPage()); Output[] outputElements = features.get(1).getElements()[0].getSteps()[7].getOutput(); <START> ArrayList<String> messages = new ArrayList<>(); <END> for (Output outputElement : outputElements) { messages.addAll(Arrays.asList(outputElement.getMessages())); } OutputAssertion output = document.getFeature().getElements()[0].getStepsSection().getSteps()[7].getOutput(); output.hasMessages(messages.toArray(new String[messages.size()])); }</code><technical_language>type generic, concrete implementations</technical_language>

Target:
public void generatePage_OnBiDimentionalArray_generatesOutput() { setUpWithJson(SAMPLE_JSON); final Feature feature = features.get(1); page = new FeatureReportPage(reportResult, configuration, feature); page.generatePage(); DocumentAssertion document = documentFrom(page.getWebPage()); Output[] outputElements = features.get(1).getElements()[0].getSteps()[7].getOutput(); OutputAssertion output = document.getFeature().getElements()[0].getStepsSection().getSteps()[7].getOutput(); output.hasMessages(getMessages(outputElements)); }
Source:
<code>public static QueryableTable getTable(String name) { return new AbstractQueryableTable(Object[].class) { @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("TYPE", SqlTypeName.VARCHAR) .add("CODEVALUE", SqlTypeName.VARCHAR) .build(); } @Override public Queryable<String[]> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { if (name == null) { return Linq4j.asEnumerable(new String[][]{}).asQueryable(); } return Linq4j.asEnumerable(new String[][]{ new String[]{"HASHCODE", "" + name.hashCode()}, new String[]{"BASE64", <START> Base64.encodeBase64String(name.getBytes(Charset.defaultCharset()))} <END> }).asQueryable(); } }; }</code><technical_language>Please refrain defaultCharset in tests</technical_language>

Target:
public static QueryableTable getTable(String name) { return new AbstractQueryableTable(Object[].class) { @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("TYPE", SqlTypeName.VARCHAR) .add("CODEVALUE", SqlTypeName.VARCHAR) .build(); } @Override public Queryable<String[]> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { if (name == null) { return Linq4j.<String[]>emptyEnumerable().asQueryable(); } return Linq4j.asEnumerable(new String[][]{ new String[]{"HASHCODE", "" + name.hashCode()}, new String[]{"BASE64", Base64.getEncoder().encodeToString(name.getBytes(StandardCharsets.UTF_8))} }).asQueryable(); } }; }
Source:
<code>private boolean occurrenceHasBeenInReviewForMoreThanAWeek(DiseaseOccurrence occ, DateTime modelRunPrepDateTime) { LocalDate createdDate = occ.getCreatedDate().toLocalDate(); LocalDate comparisonDate = createdDate.plusWeeks(1); LocalDate modelRunPrepDate = modelRunPrepDateTime.toLocalDate(); <START> return (comparisonDate.isEqual(modelRunPrepDate) || comparisonDate.isBefore(modelRunPrepDate)); <END> }</code><technical_language>return (!comparisonDate.isAfter(modelRunPrepDate)); ? you</technical_language>

Target:
private boolean occurrenceHasBeenInReviewForMoreThanAWeek(DiseaseOccurrence occ, DateTime modelRunPrepDateTime) { LocalDate createdDate = occ.getCreatedDate().toLocalDate(); LocalDate comparisonDate = createdDate.plusWeeks(1); LocalDate modelRunPrepDate = modelRunPrepDateTime.toLocalDate(); return !comparisonDate.isAfter(modelRunPrepDate); }
Source:
<code>public void initialize() { try { logger.debug("Initializing NTP handler for '{}'.", getThing().getUID().toString()); Configuration config = getThing().getConfiguration(); hostname = (String) config.get(PROPERTY_NTP_SERVER); refreshInterval = (BigDecimal) config.get(PROPERTY_REFRESH_INTERVAL); refreshNtp = (BigDecimal) config.get(PROPERTY_REFRESH_NTP); refreshNtpCount = 0; try { timeZone = TimeZone.getTimeZone((String) config.get(PROPERTY_TIMEZONE)); } catch (Exception e) { timeZone = TimeZone.getDefault(); logger.debug("{} using default TZ: {}", getThing().getUID().toString(), timeZone); } try { String localeString = (String) config.get(PROPERTY_LOCALE); locale = new Locale(localeString); } catch (Exception e) { locale = Locale.getDefault(); logger.debug("{} using default locale: {}", getThing().getUID().toString(), locale); } dateTimeChannelUID = new ChannelUID(getThing().getUID(), CHANNEL_DATE_TIME); <START> updateStatus(ThingStatus.OFFLINE); <END> logger.debug( "Initialized NTP handler '{}' with configuration: host '{}', refresh interval {}, timezone {}, locale {}.", getThing().getUID().toString(), hostname, refreshInterval, timeZone, locale); startAutomaticRefresh(); } catch (Exception ex) { String msg = "Error occured while initializing NTP handler: " + ex.getMessage(); logger.error(msg, ex); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, msg); } }</code><technical_language>do need OFFLINE is enough automatic refresh determines is ONLINE OFFLINE afterwards</technical_language>

Target:
public void initialize() { try { logger.debug("Initializing NTP handler for '{}'.", getThing().getUID().toString()); Configuration config = getThing().getConfiguration(); hostname = (String) config.get(PROPERTY_NTP_SERVER); refreshInterval = (BigDecimal) config.get(PROPERTY_REFRESH_INTERVAL); refreshNtp = (BigDecimal) config.get(PROPERTY_REFRESH_NTP); refreshNtpCount = 0; try { timeZone = TimeZone.getTimeZone((String) config.get(PROPERTY_TIMEZONE)); } catch (Exception e) { timeZone = TimeZone.getDefault(); logger.debug("{} using default TZ: {}", getThing().getUID().toString(), timeZone); } try { String localeString = (String) config.get(PROPERTY_LOCALE); locale = new Locale(localeString); } catch (Exception e) { locale = Locale.getDefault(); logger.debug("{} using default locale: {}", getThing().getUID().toString(), locale); } dateTimeChannelUID = new ChannelUID(getThing().getUID(), CHANNEL_DATE_TIME); logger.debug( "Initialized NTP handler '{}' with configuration: host '{}', refresh interval {}, timezone {}, locale {}.", getThing().getUID().toString(), hostname, refreshInterval, timeZone, locale); startAutomaticRefresh(); } catch (Exception ex) { String msg = "Error occured while initializing NTP handler: " + ex.getMessage(); logger.error(msg, ex); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, msg); } }
Source:
<code>public void testUpdateOfNestedRepeatedAttributeName() { coll2 = getCollection(NestedRepeatedAttributeName.class, String.class); Calendar cal = Calendar.getInstance(); cal.set(0, 0, 0, 0, 0, 10); <START> Date d_1 = cal.getTime(); <END> cal.set(0, 0, 0, 0, 0, 20); Date d_2 = cal.getTime(); NestedRepeatedAttributeName nested = new NestedRepeatedAttributeName(); nested.inner.timestamp = d_1; nested.timestamp = 30000; coll2.insert(nested); coll2.updateById(nested._id, DBUpdate.set("inner.timestamp", d_2)); NestedRepeatedAttributeName updated = coll2.findOneById(nested._id); assertThat(updated, notNullValue()); assertThat(updated.inner.timestamp, equalTo(d_2)); assertThat(updated.timestamp, equalTo(nested.timestamp)); }</code><technical_language>_ is kind of uncommon in Java naming. call d1 d2</technical_language>

Target:
public void testUpdateOfNestedRepeatedAttributeName() { coll2 = getCollection(NestedRepeatedAttributeName.class, String.class); Date d1 = new Date(10000L); Date d2 = new Date(20000L); NestedRepeatedAttributeName original = new NestedRepeatedAttributeName(); original.inner.timestamp = d1; original.timestamp = 30000; coll2.insert(original); coll2.updateById(original._id, DBUpdate.set("inner.timestamp", d2)); NestedRepeatedAttributeName updated = coll2.findOneById(original._id); assertThat(updated, notNullValue()); assertThat(updated.inner.timestamp, equalTo(d2)); assertThat(updated.timestamp, equalTo(original.timestamp)); }
Source:
<code>public GetRecordsCache createRecordsFetcher(GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, String shardId) { if(dataFetchingStrategy.equals(DataFetchingStrategy.DEFAULT)) { return new BlockingGetRecordsCache(maxRecords, getRecordsRetrievalStrategy, idleMillisBetweenCalls); } else { return new PrefetchGetRecordsCache(maxSize, maxByteSize, maxRecordsCount, maxRecords, getRecordsRetrievalStrategy, Executors.newFixedThreadPool(1, new ThreadFactoryBuilder() .setDaemon(true) <START> .setNameFormat("prefetch-get-records-cache-" + shardId + "-%d") <END> .build()), idleMillisBetweenCalls); } }</code><technical_language>want shorten name a bit, long. I recommend %04d</technical_language>

Target:
public GetRecordsCache createRecordsFetcher(GetRecordsRetrievalStrategy getRecordsRetrievalStrategy, String shardId) { if(dataFetchingStrategy.equals(DataFetchingStrategy.DEFAULT)) { return new BlockingGetRecordsCache(maxRecords, getRecordsRetrievalStrategy, idleMillisBetweenCalls); } else { return new PrefetchGetRecordsCache(maxPendingProcessRecordsInput, maxByteSize, maxRecordsCount, maxRecords, getRecordsRetrievalStrategy, Executors.newFixedThreadPool(1, new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat("prefetch-cache-" + shardId + "-%04d") .build()), idleMillisBetweenCalls); } }
Source:
<code>protected void doNotify(ClientApplicationEvent event) throws Exception { <START> restTemplate.postForEntity(buildUrl(event), createEvent(event), Void.class); <END> }</code><technical_language>Please add a correct content-type request. Depending order of MessageConverters requests end in xml. If need a hint please a LetsChatNotifier</technical_language>

Target:
protected void doNotify(ClientApplicationEvent event) throws Exception { restTemplate.exchange(buildUrl(event), HttpMethod.POST, createEvent(event), Void.class); }
Source:
<code>protected int getOverProvisioningFactor() { <START> return Integer.valueOf(Framework.getProperty(WORKMANAGER_OVERPROVISIONING_PROP, DEFAULT_WORKMANAGER_OVERPROVISIONING)); <END> }</code><technical_language>Integer.parseInt</technical_language>

Target:
protected int getOverProvisioningFactor() { return Integer.parseInt( Framework.getProperty(WORKMANAGER_OVERPROVISIONING_PROP, DEFAULT_WORKMANAGER_OVERPROVISIONING)); }
Source:
<code>public void scenario1() throws Exception { logger.info("Running scenario1"); final String objA = getRandomPid(); <START> final HttpPut method = new HttpPut(serverAddress + "/" + objA); <END> final FileEntity acl = new FileEntity(new File(classLoader.getResource("acls/01/acl.ttl").getFile())); setAuth(method, "fedoraAdmin"); method.setHeader("Content-type", "text/turtle"); method.setEntity(acl); final HttpResponse response = client.execute(method); final String content = EntityUtils.toString(response.getEntity()); final int status = response.getStatusLine().getStatusCode(); assertEquals("Didn't get a CREATED response! Got content:\n" + content, CREATED.getStatusCode(), status); }</code><technical_language>Please use: super.putObjMethod()</technical_language>

Target:
public void scenario1() throws Exception { logger.info("Running scenario1"); final String objA = getRandomPid(); final HttpPut method = super.putObjMethod("rest/" + objA); final FileEntity acl = new FileEntity(new File(classLoader.getResource("acls/01/acl.ttl").getFile())); setAuth(method, "fedoraAdmin"); method.setHeader("Content-type", "text/turtle"); method.setEntity(acl); try (final CloseableHttpResponse response = super.execute(method)) { assertEquals(CREATED.getStatusCode(), super.getStatus(response)); } }
Source:
<code>public Builder cronSchedule(String cron) { this.type = ScalingPolicyType.SCHEDULE; <START> this.args = Maps.newHashMap(); <END> args.put("cron", cron); return this; }</code><technical_language>reason move this declaration of variable above? enforce either/or nature of cron vs. at, or..? way, ImmutableMap a HashMap</technical_language>

Target:
public Builder cronSchedule(String cron) { this.type = ScalingPolicyType.SCHEDULE; this.args = ImmutableMap.of("cron", cron); return this; }
Source:
<code>private int determineCurGroupSize(int remaining) { <START> <END> int modified = totalModInstanceCount.get() - remaining; int lastGroupSize = maxActiveGroups.get(maxActiveGroups.size() - 1); LOG.debug("Variable Batch Update progress: instances have been modified, " + "{} instances remain unmodified, and overall instances to be modified.", modified, remaining, totalModInstanceCount.get()); if (rollingForward) { int sum = 0; for (Integer groupSize : maxActiveGroups) { sum += groupSize; if (sum > modified) { return groupSize; } } return lastGroupSize; } else { int curGroupSize = remaining; for (Integer groupSize : maxActiveGroups) { if (curGroupSize <= groupSize) { return curGroupSize; } curGroupSize -= groupSize; } curGroupSize = curGroupSize % lastGroupSize; if (curGroupSize == 0) { return lastGroupSize; } else { return curGroupSize; } } }</code><technical_language>nit: remove extra newline</technical_language>

Target:
private int determineCurGroupSize(int remaining) { int modified = totalModInstanceCount.get() - remaining; int finalGroupSize = Iterables.getLast(groupSizes); LOG.debug("Variable Batch Update progress: instances have been modified, " + "{} instances remain unmodified, and overall instances to be modified.", modified, remaining, totalModInstanceCount.get()); if (rollingForward) { int sum = 0; for (Integer groupSize : groupSizes) { sum += groupSize; if (sum > modified) { return groupSize; } } return finalGroupSize; } else { int curGroupSize = remaining; for (Integer groupSize : groupSizes) { if (curGroupSize <= groupSize) { return curGroupSize; } curGroupSize -= groupSize; } curGroupSize = curGroupSize % finalGroupSize; if (curGroupSize == 0) { return finalGroupSize; } else { return curGroupSize; } } }
Source:
<code>private String getShortBranchName(Ref headRef) { <START> Ref target = headRef.getTarget(); if (target.getName().equals(headRef.getName())) { ObjectId objectId = target.getObjectId(); if (objectId != null) { return objectId.getName(); } } return Repository.shortenRefName(target.getName()); <END> }</code><technical_language>objectId == null case possible. simplify making code match intent more directly: if (headRef.isSymbolic()) { return Repository.shortenRefName(headRef.getTarget().getName()); } // detached HEAD ObjectId id = headRef.getObjectId(); if (id == null) { throw new AssertionError( String.format("HEAD is a symref ObjectIdRef: %s", headRef)); } return id.getName();</technical_language>

Target:
private String getShortBranchName(Ref headRef) { if (headRef.isSymbolic()) { return Repository.shortenRefName(headRef.getTarget().getName()); } ObjectId id = headRef.getObjectId(); assert (id != null); return id.getName(); }
Source:
<code>private <P, R> JsonElement response(String endpointId, RequestHandler<P, R> handler, JsonObject params, Class<P> paramClass, Class<R> resultClass) { <START> R result; <END> if(paramClass != null) { final P param = DtoFactory.getInstance().createDtoFromJson(params.toString(), paramClass); result = handler.handleRequest(endpointId, param); } else { result = handler.handleRequest(endpointId); } LOG.debug("Dispatch response: " + result); if(result instanceof Void) return new JsonObject(); else if(result instanceof String) { JsonObject response = new JsonObject(); response.addProperty("text", (String)result); return response; } else if(result instanceof Collection) { JsonArray valueArray = new JsonArray(); ((Collection)result).stream().filter(r -> r instanceof JsonSerializable).forEach(r -> { String resultString = DtoFactory.getInstance().toJson(r); valueArray.add(new JsonParser().parse(resultString).getAsJsonObject()); }); return valueArray; } final String resultString = DtoFactory.getInstance().toJson(result); return new JsonParser().parse(resultString).getAsJsonObject(); }</code><technical_language>R is anymore final</technical_language>

Target:
private <P, R> JsonElement response(String endpointId, RequestHandler<P, R> handler, JsonObject params, Class<P> paramClass, Class<R> resultClass) { final R result; if (paramClass != null) { final P param = DtoFactory.getInstance().createDtoFromJson(params.toString(), paramClass); result = handler.handleRequest(endpointId, param); } else { result = handler.handleRequest(endpointId); } LOG.debug("Dispatch response: ", result); if (result instanceof Void) return new JsonObject(); else if (result instanceof String) { JsonObject response = new JsonObject(); response.addProperty("text", (String)result); return response; } else if (result instanceof Collection) { JsonArray valueArray = new JsonArray(); ((Collection)result).stream().filter(r -> r instanceof JsonSerializable).forEach(r -> { String resultString = DtoFactory.getInstance().toJson(r); valueArray.add(new JsonParser().parse(resultString).getAsJsonObject()); }); return valueArray; } final String resultString = DtoFactory.getInstance().toJson(result); return new JsonParser().parse(resultString).getAsJsonObject(); }
Source:
<code><START> public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<T> handler) { <END> this.handler = handler; return asSuggestBox().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { handler.onValueChange(new ValueChangeEvent<T>(getValue()) { }); } }); }</code><technical_language>ValueChangeEvent<String> want fire a ValueChangeEvent<T> represent change in T value, translate String T. ListModelListBox GWT's ValueListBox, translates index. indices, need some sort of Map<String,T>. I do implementing setAcceptableValues() in this base class, in implementation construct map renderer.render() for map keys. renderer for ListModelSuggestBox cast. a ValueChangeHandler<T> is passed here, I add a ValueChangeHandler<String> SuggestBox calls handler(map.get(value))</technical_language>

Target:
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<T> handler) { return asSuggestBox().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { T value = wrap(event.getValue()); if (value != null) { handler.onValueChange(new ValueChangeEvent<T>(wrap(event.getValue())) { }); } } }); }
Source:
<code>private void parseArgv(String[] argv) { boolean gui = false; for(String arg : argv) { if(arg.equals("--gui") || arg.equals("-g")) { gui = true; } else if(arg.equals("--nogui") || arg.equals("-G")) { gui = false; } } if (gui) { <START> createGui(); <END> } }</code><technical_language>remove this? -p= is a lot easier remember type -Dcom.carolinarollergirls.scoreboard.jetty.JettyServletScoreBoardController.port=. adding -l --localhost for property</technical_language>

Target:
private void parseArgv(String[] argv) { boolean gui = false; for(String arg : argv) { if(arg.equals("--gui") || arg.equals("-g")) { gui = true; } else if(arg.equals("--nogui") || arg.equals("-G")) { gui = false; } else if(arg.startsWith("--port=") || arg.startsWith("-p=")) { port = Integer.parseInt(arg.split("=")[1]); } else if(arg.startsWith("--host") || arg.startsWith("-h=")) { host = arg.split("=")[1]; } } if (gui) { createGui(); } }
Source:
<code>StatDetails(List<LatencyStat> latencies) { <START> this.latencies = latencies; <END> }</code><technical_language>requireNotNull instead of marking Nullable</technical_language>

Target:
StatDetails(List<LatencyStat> latencies) { this.latencies = requireNonNull(latencies); }
Source:
<code>public static BitSize detect() { BitSize bitSize = BitSize.B32; String osArch = System.getProperty("os.arch"); <START> if (osArch.equals("i686_64") || osArch.equals("x86_64") || osArch.equals("amd64") || osArch.equals("ppc64le") ) <END> bitSize = BitSize.B64; return bitSize; }</code><technical_language>suggestion if (osArch.equals("i686_64") || osArch.equals("x86_64") || osArch.equals("amd64") || osArch.equals("ppc64le") || osArch.equals("aarch64")) solve problems :) This occurs AArch64 Java</technical_language>

Target:
public static BitSize detect() { BitSize bitSize = BitSize.B32; String osArch = System.getProperty("os.arch"); if (osArch.equals("i686_64") || osArch.equals("x86_64") || osArch.equals("amd64") || osArch.equals("ppc64le") || osArch.equals("aarch64")) bitSize = BitSize.B64; return bitSize; }
Source:
<code>public CustomerToken getCustomerToken() { final CustomerToken customerToken = customerTokenRef.get(); if (customerToken != null) { <START> return new CustomerToken(customerToken); <END> } else { return null; } }</code><technical_language>do need a new CustomerToken instead of passing ref directly? read</technical_language>

Target:
public CustomerToken getCustomerToken() { return customerTokenRef.get(); }
Source:
<code>EvalResult evaluate(LDUser user, FeatureStore featureStore) { if (user == null || user.getKey() == null) { return null; } <START> Set<FeatureRequestEvent> prereqEvents = new HashSet<>(); <END> Set<String> visited = new HashSet<>(); return evaluate(user, featureStore, prereqEvents, visited); }</code><technical_language>a set sense, FeatureRequestEvents reasonable equals / hashcode implementations</technical_language>

Target:
EvalResult evaluate(LDUser user, FeatureStore featureStore) { if (user == null || user.getKey() == null) { return null; } List<FeatureRequestEvent> prereqEvents = new ArrayList<>(); Set<String> visited = new HashSet<>(); return evaluate(user, featureStore, prereqEvents, visited); }
Source:
<code>public void run() { if (isSynchronizedWithZooKeeper.get() || ! zkClient.isConnected() || ! started.get()) { return; } if (checkVersion.getAndSet(false)) { try { <START> Stat stat = zkClient.getZookeeper().exists(path, null); <END> synchronized (lastStatusVersionMonitor) { if (stat != null && zkClient.getZookeeper().getSessionId() == stat.getEphemeralOwner()) { zkClient.getZookeeper().delete(path, lastStatusVersion); } } } catch (InterruptedException e) { LOG.info("Interruppted"); checkVersion.set(true); } catch (KeeperException e) { LOG.info("exception "+ e.getMessage()); checkVersion.set(true); } } LOG.info("We are out-of-sync, have a zookeeper connection, and are started, trying reclaim: " + path + this); tryClaim(); }</code><technical_language>final</technical_language>

Target:
public void run() { if (isSynchronizedWithZooKeeper.get() || ! zkClient.isConnected() || ! started.get()) { return; } if (checkVersion.getAndSet(false)) { try { synchronized (lastStatusVersionMonitor) { final Stat stat = zkClient.getZookeeper().exists(path, null); if (stat != null && zkClient.getZookeeper().getSessionId() == stat.getEphemeralOwner()) { zkClient.getZookeeper().delete(path, lastStatusVersion); } } } catch (InterruptedException e) { LOG.info("Interrupted"); checkVersion.set(true); } catch (KeeperException e) { LOG.info("exception "+ e.getMessage()); checkVersion.set(true); } } LOG.info("We are out-of-sync, have a zookeeper connection, and are started, trying reclaim: " + path + this); tryClaim(); }
Source:
<code>private static IRecipe addQuartzRecipes(int meta, Item req, Block block, Block stairs, Block slab) { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(block), "QQ", "QQ", <START> Character.valueOf('Q'), LibOreDict.QUARTZ[meta])); <END> GameRegistry.addRecipe(new ItemStack(block, 2, 2), "Q", "Q", 'Q', block); GameRegistry.addRecipe(new ItemStack(block, 1, 1), "Q", "Q", 'Q', slab); addStairsAndSlabs(block, 0, stairs, slab); if(req != null) { if(req == Items.coal) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, meta), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", 'C', new ItemStack(req, 1, 1))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, meta), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", 'C', req)); return BotaniaAPI.getLatestAddedRecipe(); } return null; }</code><technical_language>Whats point of Character.valueOf() leave 'Q' else</technical_language>

Target:
private static IRecipe addQuartzRecipes(int meta, Item req, Block block, Block stairs, Block slab) { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(block), "QQ", "QQ", 'Q', LibOreDict.QUARTZ[meta])); GameRegistry.addRecipe(new ItemStack(block, 2, 2), "Q", "Q", 'Q', block); GameRegistry.addRecipe(new ItemStack(block, 1, 1), "Q", "Q", 'Q', slab); addStairsAndSlabs(block, 0, stairs, slab); if(req != null) { if(req == Items.coal) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, meta), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", 'C', new ItemStack(req, 1, 1))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.quartz, 8, meta), "QQQ", "QCQ", "QQQ", 'Q', "gemQuartz", 'C', req)); return BotaniaAPI.getLatestAddedRecipe(); } return null; }
Source:
<code>public void cleanupLeaverTransactions(List<Address> members) { try { <START> if (remoteTransactions == null) <END> return; if (trace) log.tracef("Checking for transactions originated on leavers. Current cache members are %s, remote transactions: %d", members, remoteTransactions.size()); HashSet<Address> membersSet = new HashSet<>(members); List<GlobalTransaction> toKill = new ArrayList<>(); for (Map.Entry<GlobalTransaction, RemoteTransaction> e : remoteTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); if (trace) log.tracef("Checking transaction %s", gt); if (!membersSet.contains(gt.getAddress())) { toKill.add(gt); } } if (toKill.isEmpty()) { if (trace) log.tracef("No remote transactions pertain to originator(s) who have left the cluster."); } else { log.debugf("The originating node left the cluster for %d remote transactions", toKill.size()); for (GlobalTransaction gtx : toKill) { if (partitionHandlingManager.canRollbackTransactionAfterOriginatorLeave(gtx)) { log.debugf("Rolling back transaction %s because originator %s left the cluster", gtx, gtx.getAddress()); killTransaction(gtx); } else { log.debugf("Keeping transaction %s after the originator %s left the cluster.", gtx, gtx.getAddress()); } } if (trace) log.tracef("Completed cleaning transactions originating on leavers. Remote transactions remaining: %d", remoteTransactions.size()); } } catch (Throwable t) { log.unableToRollbackGlobalTx(null, t); } }</code><technical_language>move try block? I leave (to avoid noise this commit)</technical_language>

Target:
public void cleanupLeaverTransactions(List<Address> members) { if (remoteTransactions == null) return; try { if (trace) log.tracef("Checking for transactions originated on leavers. Current cache members are %s, remote transactions: %d", members, remoteTransactions.size()); HashSet<Address> membersSet = new HashSet<>(members); List<GlobalTransaction> toKill = new ArrayList<>(); for (Map.Entry<GlobalTransaction, RemoteTransaction> e : remoteTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); if (trace) log.tracef("Checking transaction %s", gt); if (!membersSet.contains(gt.getAddress())) { toKill.add(gt); } } if (toKill.isEmpty()) { if (trace) log.tracef("No remote transactions pertain to originator(s) who have left the cluster."); } else { log.debugf("The originating node left the cluster for %d remote transactions", toKill.size()); for (GlobalTransaction gtx : toKill) { if (partitionHandlingManager.canRollbackTransactionAfterOriginatorLeave(gtx)) { log.debugf("Rolling back transaction %s because originator %s left the cluster", gtx, gtx.getAddress()); killTransaction(gtx); } else { log.debugf("Keeping transaction %s after the originator %s left the cluster.", gtx, gtx.getAddress()); } } if (trace) log.tracef("Completed cleaning transactions originating on leavers. Remote transactions remaining: %d", remoteTransactions.size()); } } catch (Throwable t) { log.unableToRollbackGlobalTx(null, t); } }
Source:
<code>private boolean isFileEncrypted(AbstractFile file) throws ReadContentInputStreamException, IOException, TskCoreException { boolean possiblyEncrypted = false; if (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.LOCAL_DIR) && (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK) || slackFilesAllowed)) { if (!file.getKnown().equals(TskData.FileKnown.KNOWN)) { long contentSize = file.getSize(); if (contentSize >= minimumFileSize) { if (!fileSizeMultipleEnforced || (contentSize % FILE_SIZE_MODULUS) == 0) { String mimeType = fileTypeDetector.getMIMEType(file); if (mimeType.equals("application/octet-stream")) { possiblyEncrypted = true; } } } } } if (possiblyEncrypted) { try { calculatedEntropy = calculateEntropy(file); if (calculatedEntropy >= minimumEntropy) { return true; } } catch (ReadContentInputStreamException ex) { <START> throw new ReadContentInputStreamException("Unable to calculate the entropy.", ex); <END> } catch (IOException ex) { throw new IOException("Unable to calculate the entropy.", ex); } } return false; }</code><technical_language>This error message this exception. Also, wrapping a ReadContentInputStreamException in a ReadContentInputStreamException IOException in IOException of code decomposed methods. similar below. I catches necessary</technical_language>

Target:
private boolean isFileEncrypted(AbstractFile file) throws ReadContentInputStreamException, IOException, TskCoreException { boolean possiblyEncrypted = false; if (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.LOCAL_DIR) && (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK) || slackFilesAllowed)) { if (!file.getKnown().equals(TskData.FileKnown.KNOWN)) { long contentSize = file.getSize(); if (contentSize >= minimumFileSize) { if (!fileSizeMultipleEnforced || (contentSize % FILE_SIZE_MODULUS) == 0) { String mimeType = fileTypeDetector.getMIMEType(file); if (mimeType.equals("application/octet-stream")) { possiblyEncrypted = true; } } } } } if (possiblyEncrypted) { calculatedEntropy = calculateEntropy(file); if (calculatedEntropy >= minimumEntropy) { return true; } } return false; }
Source:
<code>protected String composeRequestUrl(Args args) throws ClientServicesException { StringBuilder b = new StringBuilder(256); String url = ""; if(!(UrlUtil.isAbsoluteUrl(args.getServiceUrl()))){ url = getUrlPath(args); if (url.charAt(url.length() - 1) == '/') { url = url.substring(0, url.length() - 1); } b.append(url); addUrlParts(b, args); }else{ <START> b.append(args.getServiceUrl()); <END> } addUrlParameters(b, args); return b.toString(); }</code><technical_language>args.getServiceUrl() -- care of urls end "/"</technical_language>

Target:
protected String composeRequestUrl(Args args) throws ClientServicesException { StringBuilder b = new StringBuilder(256); if(!(UrlUtil.isAbsoluteUrl(args.getServiceUrl()))){ String url = getUrlPath(args); if (url.charAt(url.length() - 1) == '/') { url = url.substring(0, url.length() - 1); } b.append(url); addUrlParts(b, args); }else{ b.append(args.getServiceUrl()); } addUrlParameters(b, args); return b.toString(); }
Source:
<code>public String[] getKeys() { List<String> names = new ArrayList<>(); for (Ban.Profile ban: Sponge.getServiceManager().provideUnchecked(BanService.class).getProfileBans()) { <START> names.add(ban.getProfile().getName().get()); <END> } return names.toArray(new String[names.size()]); }</code><technical_language>check isPresent() adding</technical_language>

Target:
public String[] getKeys() { List<String> names = new ArrayList<>(); for (Ban.Profile ban: Sponge.getServiceManager().provideUnchecked(BanService.class).getProfileBans()) { if (ban.getProfile().getName().isPresent()) { names.add(ban.getProfile().getName().get()); } } return names.toArray(new String[names.size()]); }
Source:
<code>public boolean supports(PortalEvent event) { boolean postEvent = false; for (Class<?> cls : supportedEventTypes) { <START> postEvent |= cls.isAssignableFrom(event.getClass()); <END> } if (postEvent && filterFNames != null) { PortletExecutionEvent execEvent = (PortletExecutionEvent)event; boolean foundFName = false; for (String fname : filterFNames) { if (fname != null && fname.equalsIgnoreCase(execEvent.getFname())) { foundFName = true; } } postEvent = fnameFilterType == FNameFilterType.Whitelist ? foundFName : !foundFName; } return postEvent; }</code><technical_language>IMHO I this more clear efficient if a if (condition) { postEvent=true; break; } care if condition is true, a private class return boolean</technical_language>

Target:
public boolean supports(PortalEvent event) { boolean postEvent = false; for (Class<?> cls : supportedEventTypes) { if (cls.isAssignableFrom(event.getClass())) { postEvent = true; break; } } if (postEvent && filterFNames != null) { PortletExecutionEvent execEvent = (PortletExecutionEvent)event; boolean foundFName = false; for (String fname : filterFNames) { if (fname != null && fname.equalsIgnoreCase(execEvent.getFname())) { foundFName = true; break; } } postEvent = fnameFilterType == FNameFilterType.Whitelist ? foundFName : !foundFName; } return postEvent; }
Source:
<code>void addToCache(String blobKey, short lifeVersion, BlobState blobState) { if (isVcr) { if (blobState == BlobState.TTL_UPDATED) { if (recentBlobCache.containsKey(blobKey)) { lifeVersion = (lifeVersion > recentBlobCache.get(blobKey).getLifeVersion()) ? lifeVersion <START> : recentBlobCache.get(blobKey).getLifeVersion(); <END> } } recentBlobCache.put(blobKey, new BlobLifeState(blobState, lifeVersion, recentBlobCache.get(blobKey))); } }</code><technical_language>this Math.max(lifeVersion, recentBlobCache.get(blobKey).getLifeVersion())</technical_language>

Target:
void addToCache(String blobKey, short lifeVersion, BlobState blobState) { if (isVcr) { if (blobState == BlobState.TTL_UPDATED) { if (recentBlobCache.containsKey(blobKey)) { lifeVersion = (short) Math.max(lifeVersion, recentBlobCache.get(blobKey).getLifeVersion()); } } recentBlobCache.put(blobKey, new BlobLifeState(blobState, lifeVersion, recentBlobCache.get(blobKey))); } }
Source:
<code>private CacheParams(String cacheKey, Optional<Integer> timeToLive) { this.cacheKey = Preconditions.checkNotNull(cacheKey); <START> this.timeToLive = timeToLive; <END> }</code><technical_language>style-conscious, Preconditions.checkNotNull good timeToLive well. move Optional.fromNullable this line change constructor argument Optional<Integer> Integer</technical_language>

Target:
private CacheParams(String cacheKey, Optional<Integer> timeToLive) { this.cacheKey = Preconditions.checkNotNull(cacheKey); this.timeToLive = Preconditions.checkNotNull(timeToLive); }
Source:
<code>public void evaluate_shouldReturnAvalidCCCNumber() throws Exception{ MohUniquePatientNumberRule mohUniquePatientNumberRule = new MohUniquePatientNumberRule(); PatientService patientService = Context.getPatientService(); Patient patient1 = patientService.getPatient(6); AdministrationService ams = Context.getAdministrationService(); PatientIdentifierType cccnotype = new PatientIdentifierType(); cccnotype.setName("CCC Number"); cccnotype.setDescription("A unique number generated by clinics"); patientService.savePatientIdentifierType(cccnotype); GlobalProperty globalProperty = new GlobalProperty(); <START> globalProperty.setProperty("mflgenerator.mfl"); <END> globalProperty.setDescription("A unique patient Number generated by Clinics"); globalProperty.setPropertyValue("CCC Number"); ams.saveGlobalProperty(globalProperty); PatientIdentifierType pit = MohCacheUtils.getPatientIdentifierType(ams.getGlobalProperty("mflgenerator.mfl")); Location location = Context.getLocationService().getLocation(1); PatientIdentifier pi = new PatientIdentifier("11740-00001", pit, location); patient1.addIdentifier(pi); patientService.savePatient(patient1); Context.flushSession(); Result result1 = mohUniquePatientNumberRule.evaluate(null, patient1.getId(), null); Result expectedResult1 = new Result("11740-00001"); Assert.assertEquals("The two identifiers are not equal",expectedResult1.toString(),result1.toString()); }</code><technical_language>I global property want reference is cccgenerator.CCC ... check CCC Generator Module sure</technical_language>

Target:
public void evaluate_shouldReturnAvalidCCCNumber() throws Exception{ MohUniquePatientNumberRule mohUniquePatientNumberRule = new MohUniquePatientNumberRule(); PatientService patientService = Context.getPatientService(); Patient patient1 = patientService.getPatient(8); AdministrationService ams = Context.getAdministrationService(); PatientIdentifierType cccnotype = new PatientIdentifierType(); cccnotype.setName("CCC Number"); cccnotype.setDescription("A unique number generated by clinics"); patientService.savePatientIdentifierType(cccnotype); GlobalProperty globalProperty = new GlobalProperty(); globalProperty.setProperty("cccgenerator.CCC"); globalProperty.setDescription("A unique patient Number generated by Clinics"); globalProperty.setPropertyValue("CCC Number"); ams.saveGlobalProperty(globalProperty); Context.flushSession(); String savedProperty = ams.getGlobalProperty("cccgenerator.CCC"); PatientIdentifierType pit = MohCacheUtils.getPatientIdentifierType(Context.getAdministrationService().getGlobalProperty("cccgenerator.CCC")); Location location = Context.getLocationService().getLocation(1); PatientIdentifier pi = new PatientIdentifier("11740-00001", pit, location); patient1.addIdentifier(pi); patientService.savePatient(patient1); Context.flushSession(); Result result1 = mohUniquePatientNumberRule.evaluate(null, patient1.getId(), null); Result expectedResult1 = new Result("11740-00001"); Assert.assertEquals("The two identifiers are not equal",expectedResult1,result1); }
Source:
<code>public ActiveDirectoryUnixAuthenticationProvider(ActiveDirectorySecurityRealm realm) { if (realm.domain==null) throw new IllegalArgumentException("Active Directory domain name is required but it is not set"); this.domainNames = realm.domain.split(","); this.site = realm.site; this.bindName = realm.bindName; this.server = realm.server; this.bindPassword = Secret.toString(realm.bindPassword); this.groupLookupStrategy = realm.getGroupLookupStrategy(); this.descriptor = realm.getDescriptor(); this.cache = realm.cache; if (cache == null) { this.cache = new CacheConfiguration(0, 0); } if (cache.getUserCache() == null || cache.getGroupCache() == null) { this.cache = new CacheConfiguration(cache.getSize(), cache.getTtl()); } this.userCache = cache.getUserCache(); this.groupCache = cache.getGroupCache(); this.ldapConnectTimeout = realm.ldapConnectTimeout; this.ldapReadTimeout = realm.ldapReadTimeout; if (ldapConnectTimeout == null || ldapConnectTimeout.isEmpty()) { <START> System.setProperty("com.sun.jndi.ldap.connect.timeout", Long.toString(DEFAULT_LDAP_CONNECTION_TIMEOUT)); <END> } else { System.setProperty("com.sun.jndi.ldap.connect.timeout", ldapConnectTimeout); } if (ldapReadTimeout == null || ldapReadTimeout.isEmpty()) { System.setProperty("com.sun.jndi.ldap.read.timeout", Long.toString(DEFAULT_LDAP_READ_TIMEOUT)); } else { System.setProperty("com.sun.jndi.ldap.read.timeout", ldapReadTimeout); } }</code><technical_language>Nope - setting system property. This passed in context create</technical_language>

Target:
public ActiveDirectoryUnixAuthenticationProvider(ActiveDirectorySecurityRealm realm) { if (realm.domain==null) throw new IllegalArgumentException("Active Directory domain name is required but it is not set"); this.domainNames = realm.domain.split(","); this.site = realm.site; this.bindName = realm.bindName; this.server = realm.server; this.bindPassword = Secret.toString(realm.bindPassword); this.groupLookupStrategy = realm.getGroupLookupStrategy(); this.descriptor = realm.getDescriptor(); this.cache = realm.cache; if (cache == null) { this.cache = new CacheConfiguration(0, 0); } if (cache.getUserCache() == null || cache.getGroupCache() == null) { this.cache = new CacheConfiguration(cache.getSize(), cache.getTtl()); } this.userCache = cache.getUserCache(); this.groupCache = cache.getGroupCache(); Map<String, String> extraEnvVarsMap = ActiveDirectorySecurityRealm.EnvironmentProperty.toMap(realm.environmentProperties); props.put(LDAP_READ_TIMEOUT, System.getProperty(LDAP_READ_TIMEOUT, DEFAULT_LDAP_READ_TIMEOUT)); props.putAll(extraEnvVarsMap); }
Source:
<code>public static String toSlug(String input, boolean urlEncodeNonNormalizableCharacter) { if(input == null || input.isEmpty()) return ""; <START> String nonLatinPattern = urlEncodeNonNormalizableCharacter ? "[^\\P{M}]" : "[^\\w-]"; <END> Pattern NONLATIN = Pattern.compile(nonLatinPattern); Pattern WHITESPACE = Pattern.compile("[\\s]"); String nowhitespace = WHITESPACE.matcher(input).replaceAll("-"); String normalized = Normalizer.normalize(nowhitespace, Form.NFD); String slug = NONLATIN.matcher(normalized).replaceAll(""); if (urlEncodeNonNormalizableCharacter) { try { slug = URLEncoder.encode(slug, "UTF-8"); } catch (UnsupportedEncodingException e) { } } return slug.toLowerCase(Locale.ENGLISH); }</code><technical_language>Sorry, necessary? get</technical_language>

Target:
public static String toSlug(String input, boolean urlEncodeNonNormalizableCharacter) { if(input == null || input.isEmpty()) return ""; String nonLatinPattern = urlEncodeNonNormalizableCharacter ? "[^\\P{M}]" : "[^\\w-]"; Pattern NONLATIN = Pattern.compile(nonLatinPattern); Pattern WHITESPACE = Pattern.compile("[\\s]"); String nowhitespace = WHITESPACE.matcher(input).replaceAll("-"); String normalized = Normalizer.normalize(nowhitespace, Form.NFD); String slug = NONLATIN.matcher(normalized).replaceAll(""); if (urlEncodeNonNormalizableCharacter) { try { slug = URLEncoder.encode(slug, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } } return slug.toLowerCase(Locale.ENGLISH); }
Source:
<code>public Collection<CallStackSeries> getCallStackSeries() { Collection<CallStackSeries> callstacks = fCallStacks; if (callstacks == null) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return <START> Objects.requireNonNull(Collections.emptyList()); <END> } callstacks = Collections.singleton(new CallStackSeries(ss, PATTERNS, 0, "", getHostId(), new CallStackSeries.AttributeValueThreadResolver(1))); fCallStacks = callstacks; } return callstacks; }</code><technical_language>required, annotated</technical_language>

Target:
public Collection<CallStackSeries> getCallStackSeries() { Collection<CallStackSeries> callstacks = fCallStacks; if (callstacks == null) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } callstacks = Collections.singleton(new CallStackSeries(ss, PATTERNS, 0, "", getHostId(), new CallStackSeries.AttributeValueThreadResolver(1))); fCallStacks = callstacks; } return callstacks; }