auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public AzureTokenManagerProvider(CBSAuthorizationType authorizationType, String fullyQualifiedNamespace, String activeDirectoryScope) { this.activeDirectoryScope = Objects.requireNonNull(activeDirectoryScope, "'activeDirectoryScope' cannot be null."); <START> this.fullyQualifiedNamespace = Objects.requireNonNull(fullyQualifiedNamespace, "'hostname' cannot be null."); <END> this.authorizationType = Objects.requireNonNull(authorizationType, "'authorizationType' cannot be null."); }</code><technical_language>suggestion this.fullyQualifiedNamespace = Objects.requireNonNull(fullyQualifiedNamespace, "'fullyQualifiedNamespace' null.");</technical_language>

Target:
public AzureTokenManagerProvider(CBSAuthorizationType authorizationType, String fullyQualifiedNamespace, String activeDirectoryScope) { this.activeDirectoryScope = Objects.requireNonNull(activeDirectoryScope, "'activeDirectoryScope' cannot be null."); this.fullyQualifiedNamespace = Objects.requireNonNull(fullyQualifiedNamespace, "'fullyQualifiedNamespace' cannot be null."); this.authorizationType = Objects.requireNonNull(authorizationType, "'authorizationType' cannot be null."); }
Source:
<code>public void setValueFromRow(Row row, Object obj, Serializer serializer) { if (calculatedField()) return; <START> if (row.isNull(col)) <END> return; Object val = PropertyMappingHelper.getCassandraColumnValue(row, col, accessor.getFieldType(), serializer); accessor.setValue(obj, val); }</code><technical_language>Spacing semantic block is required code style. I suggest insert new empty line if</technical_language>

Target:
public void setValueFromRow(Row row, Object obj, Serializer serializer) { if (calculatedField()) return; Object val = PropertyMappingHelper.getCassandraColumnValue(row, col, accessor.getFieldType(), serializer); accessor.setValue(obj, val); }
Source:
<code><START> public static Set<Annotation> getQualifiers(AnnotatedElement... elements) { <END> return Arrays.stream(elements) .filter(Objects::nonNull) .map(AnnotatedElement::getAnnotations) .flatMap(Arrays::stream) .filter(anno -> anno.annotationType().isAnnotationPresent(Qualifier.class)) .collect(toSet()); }</code><technical_language>This class is beta--I OK making this method non-static registry</technical_language>

Target:
private static Set<Annotation> getQualifiers(AnnotatedElement... elements) { return Collections.unmodifiableSet(Arrays.stream(elements) .filter(Objects::nonNull) .map(AnnotatedElement::getAnnotations) .flatMap(Arrays::stream) .filter(anno -> anno.annotationType().isAnnotationPresent(Qualifier.class)) .collect(toSet())); }
Source:
<code>private String readString() throws IOException, NoOutputException { StringBuilder line = new StringBuilder(); while (true) { String subline = processOut.readLine(); if (subline == null) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append("Pipe to subprocess seems to be broken!"); if (line.length() == 0) { errorMessage.append(" No output read.\n"); } else { errorMessage.append(" Currently read output: " + line.toString() + "\n"); } <START> errorMessage.append("Serializer Exception:\n"); <END> throw new NoOutputException(errorMessage.toString()); } if (subline.equals("end")) { break; } if (line.length() != 0) { line.append("\n"); } line.append(subline); } return line.toString(); }</code><technical_language>I expect information this string Serializer Exception: added after. moving this line caller's catch statement</technical_language>

Target:
private String readString() throws IOException, NoOutputException { StringBuilder line = new StringBuilder(); while (true) { String subline = processOut.readLine(); if (subline == null) { StringBuilder errorMessage = new StringBuilder(); errorMessage.append("Pipe to subprocess seems to be broken!"); if (line.length() == 0) { errorMessage.append(" No output read.\n"); } else { errorMessage.append(" Currently read output: " + line.toString() + "\n"); } throw new NoOutputException(errorMessage.toString()); } if (subline.equals("end")) { break; } if (line.length() != 0) { line.append("\n"); } line.append(subline); } return line.toString(); }
Source:
<code>public ServicePoolBuilder<S> withZooKeeperHostDiscovery(final ZooKeeperConnection connection) { checkNotNull(connection); return withHostDiscoverySource(new HostDiscoverySource() { @Override public HostDiscovery forService(String serviceName) { HostDiscovery hostDiscovery = new ZooKeeperHostDiscovery(connection, serviceName); <START> _closeHostDiscovery = true; <END> return hostDiscovery; } }); }</code><technical_language>I feel this is wrong do here. Users interact this builder this... java ServicePoolBuilder.create(MyService.class) .withHostDiscoverySource(overrides) .withZooKeeperHostDiscovery(zookeeper) ... .build() mutually exclusive call withZooKeeperDiscovery else setting a boolean withZooKeeperDiscovery is called closing discovery is wrong behavior. close closing</technical_language>

Target:
public ServicePoolBuilder<S> withZooKeeperHostDiscovery(final ZooKeeperConnection connection) { checkNotNull(connection); HostDiscoverySource hostDiscoverySource = new HostDiscoverySource() { @Override public HostDiscovery forService(String serviceName) { return new ZooKeeperHostDiscovery(connection, serviceName); } }; return withHostDiscoverySourceInternal(hostDiscoverySource, true); }
Source:
<code>public static List<DispoItem> cleanUpPcrTypes(List<DispoItem> items) { List<DispoItem> toModify = new ArrayList<DispoItem>(); for (DispoItem item : items) { JSONArray annotationsList = item.getAnnotationsList(); if (checkForBadReqType(annotationsList)) { try { JSONArray modifiedAnnotations = cleanAnnotationsList(annotationsList); DispoItemData modifiedItem = new DispoItemData(); modifiedItem.setAnnotationsList(modifiedAnnotations); modifiedItem.setGuid(item.getGuid()); toModify.add(modifiedItem); <START> } catch (JSONException ex) { <END> } } else { } } return toModify; }</code><technical_language>error</technical_language>

Target:
public static List<DispoItem> cleanUpPcrTypes(List<DispoItem> items) { List<DispoItem> toModify = new ArrayList<DispoItem>(); for (DispoItem item : items) { JSONArray annotationsList = item.getAnnotationsList(); if (checkForBadReqType(annotationsList)) { try { JSONArray modifiedAnnotations = cleanAnnotationsList(annotationsList); DispoItemData modifiedItem = new DispoItemData(); modifiedItem.setAnnotationsList(modifiedAnnotations); modifiedItem.setGuid(item.getGuid()); toModify.add(modifiedItem); } catch (JSONException ex) { throw new OseeCoreException(ex); } } else { } } return toModify; }
Source:
<code>public static void resolve( CrawlerResult moduleMap ) throws ModuleException { SymbolReferenceResolver resolver = new SymbolReferenceResolver( moduleMap ); try { resolver.resolveExternalSymbols(); } catch( SymbolNotFoundException | IllegalAccessSymbolException | DuplicateSymbolException e ) { throw new ModuleException( e ); } <START> resolver.resolveLinkedType(); <END> }</code><technical_language>rename resolver.resolveLinkedTypes()</technical_language>

Target:
public static void resolve( CrawlerResult moduleMap ) throws ModuleException { SymbolReferenceResolver resolver = new SymbolReferenceResolver( moduleMap ); try { resolver.resolveExternalSymbols(); } catch( SymbolNotFoundException | IllegalAccessSymbolException | DuplicateSymbolException e ) { throw new ModuleException( e.getMessage() ); } resolver.resolveLinkedTypes(); }
Source:
<code>public void onPostUploaded(PostStore.OnPostUploaded event) { final PostModel post = event.post; if (isAdded() && event.post != null) { SiteModel site = getSelectedSite(); if (site != null) { if (event.post.getLocalSiteId() == site.getId()) { UploadUtils.onPostUploadedSnackbarHandler(getActivity(), <START> getActivity().findViewById(R.id.coordinator), <END> event.isError(), event.post, null, site, mDispatcher); } } } }</code><technical_language>drop final PostModel post = event.post; top of this method</technical_language>

Target:
public void onPostUploaded(PostStore.OnPostUploaded event) { if (isAdded() && event.post != null) { SiteModel site = getSelectedSite(); if (site != null) { if (event.post.getLocalSiteId() == site.getId()) { UploadUtils.onPostUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), event.isError(), event.post, null, site, mDispatcher); } } } }
Source:
<code><START> public static void testModelSerialization(MultiLayerNetwork net){ <END> try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ModelSerializer.writeModel(net, baos, true); byte[] bytes = baos.toByteArray(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes); MultiLayerNetwork restored = ModelSerializer.restoreMultiLayerNetwork(bais, true); assertEquals(net.getLayerWiseConfigurations(), restored.getLayerWiseConfigurations()); assertEquals(net.params(), restored.params()); } catch (IOException e){ throw new RuntimeException(e); } }</code><technical_language>+1 for this. a more cases this, no? Feels this 100 times</technical_language>

Target:
public static MultiLayerNetwork testModelSerialization(MultiLayerNetwork net){ try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ModelSerializer.writeModel(net, baos, true); byte[] bytes = baos.toByteArray(); ByteArrayInputStream bais = new ByteArrayInputStream(bytes); MultiLayerNetwork restored = ModelSerializer.restoreMultiLayerNetwork(bais, true); assertEquals(net.getLayerWiseConfigurations(), restored.getLayerWiseConfigurations()); assertEquals(net.params(), restored.params()); return restored; } catch (IOException e){ throw new RuntimeException(e); } }
Source:
<code>public BaseLivyInterpreter(Properties property) { super(property); this.livyURL = property.getProperty("zeppelin.livy.url"); this.displayAppInfo = Boolean.parseBoolean( property.getProperty("zeppelin.livy.displayAppInfo", "true")); this.restartDeadSession = Boolean.parseBoolean( property.getProperty("zeppelin.livy.restart_dead_session", "false")); this.sessionCreationTimeout = Integer.parseInt( property.getProperty("zeppelin.livy.session.create_timeout", 120 + "")); this.pullStatusInterval = Integer.parseInt( property.getProperty("zeppelin.livy.pull_status.interval.millis", 1000 + "")); this.restTemplate = createRestTemplate(); <START> this.restTemplate.getMessageConverters().add(0, new StringHttpMessageConverter(Charset.forName("UTF-8"))); <END> if (!StringUtils.isBlank(property.getProperty("zeppelin.livy.http.headers"))) { String[] headers = property.getProperty("zeppelin.livy.http.headers").split(";"); for (String header : headers) { String[] splits = header.split(":", -1); if (splits.length != 2) { throw new RuntimeException("Invalid format of http headers: " + header + ", valid http header format is HEADER_NAME:HEADER_VALUE"); } customHeaders.put(splits[0].trim(), envSubstitute(splits[1].trim())); } } }</code><technical_language>is put this in method createRestTemplate</technical_language>

Target:
public BaseLivyInterpreter(Properties property) { super(property); this.livyURL = property.getProperty("zeppelin.livy.url"); this.displayAppInfo = Boolean.parseBoolean( property.getProperty("zeppelin.livy.displayAppInfo", "true")); this.restartDeadSession = Boolean.parseBoolean( property.getProperty("zeppelin.livy.restart_dead_session", "false")); this.sessionCreationTimeout = Integer.parseInt( property.getProperty("zeppelin.livy.session.create_timeout", 120 + "")); this.pullStatusInterval = Integer.parseInt( property.getProperty("zeppelin.livy.pull_status.interval.millis", 1000 + "")); this.restTemplate = createRestTemplate(); if (!StringUtils.isBlank(property.getProperty("zeppelin.livy.http.headers"))) { String[] headers = property.getProperty("zeppelin.livy.http.headers").split(";"); for (String header : headers) { String[] splits = header.split(":", -1); if (splits.length != 2) { throw new RuntimeException("Invalid format of http headers: " + header + ", valid http header format is HEADER_NAME:HEADER_VALUE"); } customHeaders.put(splits[0].trim(), envSubstitute(splits[1].trim())); } } }
Source:
<code>public boolean shouldChangesRequireResponseDeletion(FeedbackQuestionDetails newDetails) { assert newDetails instanceof FeedbackTextQuestionDetails; <START> return !((FeedbackTextQuestionDetails) newDetails).allowRichText && allowRichText; <END> }</code><technical_language>a shouldChangesRequireResponseDeletion is called. Do need cast operation here</technical_language>

Target:
public boolean shouldChangesRequireResponseDeletion(FeedbackQuestionDetails newDetails) { Assumption.assertTrue(newDetails instanceof FeedbackTextQuestionDetails); return !((FeedbackTextQuestionDetails) newDetails).shouldAllowRichText && shouldAllowRichText; }
Source:
<code>protected ConfigNodeComplexValue indentText(AbstractConfigNode indentation) { ArrayList<AbstractConfigNode> childrenCopy = new ArrayList<AbstractConfigNode>(children); for (int i = 0; i < childrenCopy.size(); i++) { if (childrenCopy.get(i) instanceof ConfigNodeSingleToken && Tokens.isNewline(((ConfigNodeSingleToken) childrenCopy.get(i)).token())) { childrenCopy.add(i + 1, indentation); i++; } else if (childrenCopy.get(i) instanceof ConfigNodeField) { AbstractConfigNode value = ((ConfigNodeField) childrenCopy.get(i)).value(); if (value instanceof ConfigNodeComplexValue) { childrenCopy.set(i, ((ConfigNodeField) childrenCopy.get(i)).replaceValue(((ConfigNodeComplexValue) value).indentText(indentation))); } } else if (childrenCopy.get(i) instanceof ConfigNodeComplexValue) { childrenCopy.set(i, ((ConfigNodeComplexValue) childrenCopy.get(i)).indentText(indentation)); } } if (this instanceof ConfigNodeArray) { return new ConfigNodeArray(childrenCopy); } else if (this instanceof ConfigNodeObject) { return new ConfigNodeObject(childrenCopy); } else { return new ConfigNodeConcatenation(childrenCopy); <START> } <END> }</code><technical_language>This if/then/else feels a virtual method</technical_language>

Target:
protected ConfigNodeComplexValue indentText(AbstractConfigNode indentation) { ArrayList<AbstractConfigNode> childrenCopy = new ArrayList<AbstractConfigNode>(children); for (int i = 0; i < childrenCopy.size(); i++) { AbstractConfigNode child = childrenCopy.get(i); if (child instanceof ConfigNodeSingleToken && Tokens.isNewline(((ConfigNodeSingleToken) child).token())) { childrenCopy.add(i + 1, indentation); i++; } else if (child instanceof ConfigNodeField) { AbstractConfigNode value = ((ConfigNodeField) child).value(); if (value instanceof ConfigNodeComplexValue) { childrenCopy.set(i, ((ConfigNodeField) child).replaceValue(((ConfigNodeComplexValue) value).indentText(indentation))); } } else if (child instanceof ConfigNodeComplexValue) { childrenCopy.set(i, ((ConfigNodeComplexValue) child).indentText(indentation)); } } return newNode(childrenCopy); }
Source:
<code>ReportPointHandlerImpl(final HandlerKey handlerKey, final int blockedItemsPerBatch, @Nullable final Collection<SenderTask<String>> senderTasks, @Nonnull final ValidationConfiguration validationConfig, final boolean setupMetrics, @Nullable final Consumer<Long> receivedRateSink, @Nullable final Logger blockedItemLogger, @Nullable final Logger validItemsLogger, @Nullable final Function<Histogram, Histogram> recompressor) { super(handlerKey, blockedItemsPerBatch, new ReportPointSerializer(), senderTasks, setupMetrics, receivedRateSink, blockedItemLogger); this.validationConfig = validationConfig; this.validItemsLogger = validItemsLogger; this.recompressor = recompressor; MetricsRegistry registry = setupMetrics ? Metrics.defaultRegistry() : LOCAL_REGISTRY; this.receivedPointLag = registry.newHistogram(new MetricName(handlerKey.toString() + ".received", "", "lag"), false); <START> this.pointTagCount = registry.newHistogram(new MetricName(handlerKey.toString(), "", "pointTagCount"), false); <END> this.histogramTagCount = registry.newHistogram(new MetricName(handlerKey.toString(), "", "histogramTagCount"), false); this.discardedCounterSupplier = Utils.lazySupplier(() -> Metrics.newCounter(new MetricName(handlerKey.toString(), "", "discarded"))); }</code><technical_language>rename this pointTagCount.received</technical_language>

Target:
ReportPointHandlerImpl(final HandlerKey handlerKey, final int blockedItemsPerBatch, @Nullable final Collection<SenderTask<String>> senderTasks, @Nonnull final ValidationConfiguration validationConfig, final boolean setupMetrics, @Nullable final Consumer<Long> receivedRateSink, @Nullable final Logger blockedItemLogger, @Nullable final Logger validItemsLogger, @Nullable final Function<Histogram, Histogram> recompressor) { super(handlerKey, blockedItemsPerBatch, new ReportPointSerializer(), senderTasks, setupMetrics, receivedRateSink, blockedItemLogger); this.validationConfig = validationConfig; this.validItemsLogger = validItemsLogger; this.recompressor = recompressor; MetricsRegistry registry = setupMetrics ? Metrics.defaultRegistry() : LOCAL_REGISTRY; this.receivedPointLag = registry.newHistogram(new MetricName(handlerKey.toString() + ".received", "", "lag"), false); this.receivedTagCount = registry.newHistogram(new MetricName(handlerKey.toString() + ".received", "", "tagCount"), false); this.discardedCounterSupplier = Utils.lazySupplier(() -> Metrics.newCounter(new MetricName(handlerKey.toString(), "", "discarded"))); }
Source:
<code>public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, final IOseeBranch parentBranch, boolean pend) throws OseeCoreException { final String branchName = Strings.truncate(TeamWorkFlowManager.getBranchName(teamArt), 195, true); Conditions.checkNotNull(teamArt, "Parent Team Workflow"); Conditions.checkNotNull(parentBranch, "Parent Branch"); IExceptionableRunnable runnable = new IExceptionableRunnable() { @Override public IStatus run(IProgressMonitor monitor) throws OseeCoreException { <START> teamArt.setWorkingBranchCreationInProgress(true); <END> BranchManager.createWorkingBranch(parentBranch, branchName, teamArt); teamArt.setWorkingBranchCreationInProgress(false); SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "Create Reviews upon Transition"); createNecessaryBranchEventReviews(StateEventType.CreateBranch, teamArt, new Date(), AtsUsers.getSystemUser(), transaction); transaction.execute(); for (IAtsStateItemCore item : AtsStateItemCoreManager.getStateItems()) { item.workingBranchCreated(teamArt); } return Status.OK_STATUS; } }; Job job = Jobs.startJob(new CatchAndReleaseJob("Create Branch", runnable, Activator.class, Activator.PLUGIN_ID), true); if (pend) { try { job.join(); } catch (InterruptedException ex) { throw new OseeWrappedException(ex); } } return job; }</code><technical_language>else needs acquire AtsStateItem extension point contributions? If this is class needs acces AtsStateItemCoreManager class equivalent a local field of this class. Meaning this class is responsible for lifecycle</technical_language>

Target:
public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, final IOseeBranch parentBranch, boolean pend) throws OseeCoreException { final String branchName = Strings.truncate(TeamWorkFlowManager.getBranchName(teamArt), 195, true); Conditions.checkNotNull(teamArt, "Parent Team Workflow"); Conditions.checkNotNull(parentBranch, "Parent Branch"); IExceptionableRunnable runnable = new IExceptionableRunnable() { @Override public IStatus run(IProgressMonitor monitor) throws OseeCoreException { teamArt.setWorkingBranchCreationInProgress(true); BranchManager.createWorkingBranch(parentBranch, branchName, teamArt); teamArt.setWorkingBranchCreationInProgress(false); performPostBranchCreationTasks(teamArt); return Status.OK_STATUS; } }; Job job = Jobs.startJob(new CatchAndReleaseJob("Create Branch", runnable, Activator.class, Activator.PLUGIN_ID), true); if (pend) { try { job.join(); } catch (InterruptedException ex) { throw new OseeWrappedException(ex); } } return job; }
Source:
<code>public void execute(RealmAnalytics analytics) { try { URL url = getUrl(analytics); logger.debug("submitting: " + url); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.connect(); logger.debug("submitted: " + connection.getResponseCode() + " " + url); connection.getResponseCode(); } catch (Exception ignored) { <START> logger.debug("ignoring: ", ignored); <END> } }</code><technical_language>suggestion logger.debug("Ignoring: ", ignored);</technical_language>

Target:
public void execute(RealmAnalytics analytics) { try { URL url = getUrl(analytics); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.connect(); connection.getResponseCode(); } catch (Exception ignored) { } }
Source:
<code>public void restarts_running_backgroundClearTask_when_lifecycleState_turns_to_MERGED() { Config config = new Config(); config.setProperty(taskPeriodSecondsPropName(), "1"); HazelcastInstance node = createHazelcastInstance(config); final AtomicInteger expirationCounter = new AtomicInteger(); <START> IMap map = node.getMap("test"); <END> map.addEntryListener(new EntryExpiredListener() { @Override public void entryExpired(EntryEvent event) { expirationCounter.incrementAndGet(); } }, true); map.put(1, 1, 3, TimeUnit.SECONDS); ((LifecycleServiceImpl) node.getLifecycleService()).fireLifecycleEvent(MERGING); ((LifecycleServiceImpl) node.getLifecycleService()).fireLifecycleEvent(MERGED); assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { int expirationCount = expirationCounter.get(); assertEquals(format("Expecting 1 expiration but found:%d", expirationCount), 1, expirationCount); } }); }</code><technical_language>Please IMap<Integer, Integer> in test class, get rid of warnings. in CacheExpirationManagerTest ICache<Integer, Integer></technical_language>

Target:
public void restarts_running_backgroundClearTask_when_lifecycleState_turns_to_MERGED() { Config config = new Config(); config.setProperty(taskPeriodSecondsPropName(), "1"); HazelcastInstance node = createHazelcastInstance(config); final AtomicInteger expirationCounter = new AtomicInteger(); IMap<Integer, Integer> map = node.getMap("test"); map.addEntryListener(new EntryExpiredListener() { @Override public void entryExpired(EntryEvent event) { expirationCounter.incrementAndGet(); } }, true); map.put(1, 1, 3, TimeUnit.SECONDS); ((LifecycleServiceImpl) node.getLifecycleService()).fireLifecycleEvent(MERGING); ((LifecycleServiceImpl) node.getLifecycleService()).fireLifecycleEvent(MERGED); assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { int expirationCount = expirationCounter.get(); assertEquals(format("Expecting 1 expiration but found:%d", expirationCount), 1, expirationCount); } }); }
Source:
<code><START> String getCommittedOffsetsString() { <END> StringBuilder sb = new StringBuilder(); sb.append("Channel ").append(this.uuid) .append(" committed: "); for (TopicPartition tp : this.consumer.assignment()) { try { sb.append("[").append(tp).append(",") .append(this.consumer.committed(tp).offset()) .append("] "); } catch (NullPointerException npe) { if (logger.isDebugEnabled()) { logger.debug("Committed {}", tp); } } } return sb.toString(); }</code><technical_language>I this private</technical_language>

Target:
private String getCommittedOffsetsString() { StringBuilder sb = new StringBuilder(); sb.append(getName()).append(" committed: "); for (TopicPartition tp : consumer.assignment()) { try { sb.append("[").append(tp).append(",") .append(consumer.committed(tp).offset()) .append("] "); } catch (NullPointerException npe) { logger.debug("Committed {}", tp); } } return sb.toString(); }
Source:
<code>public static ManagedChannel createNettyChannel(String host, BigtableOptions options, ClientInterceptor ... interceptors) throws SSLException { LOG.info("Creating new channel for %s", host); <START> LOG.debug(Throwables.getStackTraceAsString(new Throwable())); <END> ManagedChannelBuilder<?> builder = ManagedChannelBuilder .forAddress(host, options.getPort()); if (options.usePlaintextNegotiation()) { builder.usePlaintext(); } return builder .idleTimeout(Long.MAX_VALUE, TimeUnit.SECONDS) .maxInboundMessageSize(MAX_MESSAGE_SIZE) .userAgent(BigtableVersionInfo.CORE_USER_AGENT + "," + options.getUserAgent()) .intercept(interceptors) .build(); }</code><technical_language>wait... this is expensive. Please add if statement this checking log level</technical_language>

Target:
public static ManagedChannel createNettyChannel(String host, BigtableOptions options, ClientInterceptor ... interceptors) throws SSLException { LOG.info("Creating new channel for %s", host); if (LOG.getLog().isDebugEnabled()) { LOG.debug(Throwables.getStackTraceAsString(new Throwable())); } ManagedChannelBuilder<?> builder = ManagedChannelBuilder .forAddress(host, options.getPort()); if (options.usePlaintextNegotiation()) { builder.usePlaintext(); } return builder .idleTimeout(Long.MAX_VALUE, TimeUnit.SECONDS) .maxInboundMessageSize(MAX_MESSAGE_SIZE) .userAgent(BigtableVersionInfo.CORE_USER_AGENT + "," + options.getUserAgent()) .intercept(interceptors) .build(); }
Source:
<code>public static VariableType mapFromPhenotype(PhenotypicType phenotypicType, String propertyName){ VariableType variableType = null; if (PhenotypicType.STUDY == phenotypicType || PhenotypicType.DATASET == phenotypicType) { variableType = VariableType.STUDY_DETAIL; } else if (PhenotypicType.TRIAL_ENVIRONMENT == phenotypicType) { variableType = VariableType.ENVIRONMENT_DETAIL; } else if (PhenotypicType.GERMPLASM == phenotypicType) { variableType = VariableType.GERMPLASM_DESCRIPTOR; } else if (PhenotypicType.TRIAL_DESIGN == phenotypicType) { variableType = VariableType.EXPERIMENTAL_DESIGN; } else if (PhenotypicType.VARIATE == phenotypicType) { <START> boolean isSelectionMethod = "Inventory amount".equals(propertyName) || <END> "Selections".equals(propertyName) || "Breeding method".equals(propertyName); variableType = isSelectionMethod ? VariableType.SELECTION_METHOD : VariableType.TRAIT; } return variableType; }</code><technical_language>"Inventory amount" extracted a constant</technical_language>

Target:
public static VariableType mapFromPhenotype(PhenotypicType phenotypicType, String propertyName){ VariableType variableType = null; if (PhenotypicType.STUDY == phenotypicType || PhenotypicType.DATASET == phenotypicType) { variableType = VariableType.STUDY_DETAIL; } else if (PhenotypicType.TRIAL_ENVIRONMENT == phenotypicType) { variableType = VariableType.ENVIRONMENT_DETAIL; } else if (PhenotypicType.GERMPLASM == phenotypicType) { variableType = VariableType.GERMPLASM_DESCRIPTOR; } else if (PhenotypicType.TRIAL_DESIGN == phenotypicType) { variableType = VariableType.EXPERIMENTAL_DESIGN; } else if (PhenotypicType.VARIATE == phenotypicType) { boolean isSelectionMethod = INVENTORY_AMOUNT.equals(propertyName) || SELECTIONS.equals(propertyName) || BREEDING_METHOD.equals(propertyName); variableType = isSelectionMethod ? VariableType.SELECTION_METHOD : VariableType.TRAIT; } return variableType; }
Source:
<code>public void testGetGlusterGeoRepSessionUnSetConfig() { GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig(); dao.saveConfig(sessionConfig); List<GlusterGeoRepSessionConfiguration> unsetSessionConfig = dao.getGlusterGeoRepSessionUnSetConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID); <START> assertEquals(1, unsetSessionConfig.size()); <END> assertEquals("use_meta_volume", unsetSessionConfig.get(0).getKey()); }</code><technical_language>this 1, need changed a new master config is added</technical_language>

Target:
public void testGetGlusterGeoRepSessionUnSetConfig() { GlusterGeoRepSessionConfiguration sessionConfig = getGlusterGeoRepSessionConfig(); dao.saveConfig(sessionConfig); List<GlusterGeoRepSessionConfiguration> unsetSessionConfig = dao.getGlusterGeoRepSessionUnSetConfig(FixturesTool.GLUSTER_GEOREP_SESSION_ID); assertEquals("use_meta_volume", unsetSessionConfig.get(0).getKey()); }
Source:
<code>private void setDefaultCategoryIcons(List<CategoryDTO> categories) { Platform.runLater(() -> { try { StringBuilder cssBuilder = new StringBuilder(); for (CategoryDTO category : categories) { cssBuilder.append( "#" + ApplicationSidebarToggleGroupSkin.getToggleButtonId(category.getId()) + "{\n"); URI categoryIcon = category.getIcon(); <START> if (categoryIcon == null) { cssBuilder .append("-fx-background-image: url('/org/phoenicis/javafx/views/common/phoenicis.png');\n"); } else { cssBuilder.append("-fx-background-image: url('" + categoryIcon + "');\n"); } <END> cssBuilder.append("}\n"); } String css = cssBuilder.toString(); Path temp = Files.createTempFile("defaultCategoryIcons", ".css").toAbsolutePath(); File tempFile = temp.toFile(); tempFile.deleteOnExit(); Files.write(temp, css.getBytes()); String defaultCategoryIconsCss = temp.toUri().toString(); this.themeManager.setDefaultCategoryIconsCss(defaultCategoryIconsCss); } catch (IOException e) { LOGGER.warn("Could not set default category icons.", e); } }); }</code><technical_language>formatting strange here. change like: java final String categoryIconPath = Optional.ofNullable(category.getIcon()) .map(categoryIcon -> categoryIcon.toString()) .orElse("/org/phoenicis/javafx/views/common/phoenicis.png"); cssBuilder.append(String.format("-fx-background-image: url('%s');\n", categoryIconPath));</technical_language>

Target:
private void setDefaultCategoryIcons(List<CategoryDTO> categories) { Platform.runLater(() -> { try { StringBuilder cssBuilder = new StringBuilder(); for (CategoryDTO category : categories) { cssBuilder.append( "#" + ApplicationSidebarToggleGroupSkin.getToggleButtonId(category.getId()) + "{\n"); final String categoryIconPath = Optional.ofNullable(category.getIcon()) .map(categoryIcon -> categoryIcon.toString()) .orElse("/org/phoenicis/javafx/views/common/phoenicis.png"); cssBuilder.append(String.format("-fx-background-image: url('%s');\n", categoryIconPath)); cssBuilder.append("}\n"); } String css = cssBuilder.toString(); Path temp = Files.createTempFile("defaultCategoryIcons", ".css").toAbsolutePath(); File tempFile = temp.toFile(); tempFile.deleteOnExit(); Files.write(temp, css.getBytes()); String defaultCategoryIconsCss = temp.toUri().toString(); this.themeManager.setDefaultCategoryIconsCss(defaultCategoryIconsCss); } catch (IOException e) { LOGGER.warn("Could not set default category icons.", e); } }); }
Source:
<code>public void onCreate() { super.onCreate(); log.info("WalletApplication.onCreate()"); config = new Configuration(PreferenceManager.getDefaultSharedPreferences(this), getResources()); walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF); if (walletFileExists()) { if (config.getEnsureWipe()) { walletFile.delete(); <START> config.clear(false); <END> File blockChainFile = new File(getDir("blockstore", Context.MODE_PRIVATE), Constants.Files.BLOCKCHAIN_FILENAME); if (blockChainFile.exists()) { blockChainFile.delete(); } } fullInitialization(); } }</code><technical_language>is issue this config.clear(false) here: If a user wipe wallet, onboarding process create recover a wallet. app is restarted, this section of code delete wallet file. wallet file recreated onboarding process, ensureWipe is true. here, wallet file is deleted ensureWipe = false. in app loading process, wallet file backup file is restore wallet this requires a blockchain reset. 2019-12-03 13:48:28.485 14725-14725/hashengineering.dash.wallet.beta E/WalletApplication: [main] problem loading wallet java.io.FileNotFoundException: /data/user/0/hashengineering.dash.wallet.beta/files/wallet-protobuf (No file directory) config.clear(false); end of onboarding process, clear this state. wipe() method is called, wallet file is deleted. app is restarted. onCreate() is executed, walletFile exist, config.clear(false); is called clear state of ensureWipe. this block of code need delete file is in wipe() config.clear() end of onboarding. blockchain file is deleted in wipe()</technical_language>

Target:
public void onCreate() { super.onCreate(); log.info("WalletApplication.onCreate()"); config = new Configuration(PreferenceManager.getDefaultSharedPreferences(this), getResources()); walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF); if (walletFileExists()) { if (config.getEnsureWipe()) { walletFile.delete(); config.clear(false); } fullInitialization(); } }
Source:
<code>public void validSample() { <START> Matcher m = Dimensions.DIMENSIONS_PATTERN.matcher("100x200"); <END> Assert.assertTrue(m.matches()); Assert.assertEquals("100", m.group(1)); Assert.assertEquals("200", m.group(2)); }</code><technical_language>in this test, object Dimensions verify pattern, rest of class logic</technical_language>

Target:
public void validSample() { WebDriverConfiguration mockedConfiguration = getMockedConfiguration("100x200"); Dimensions dimensions = new Dimensions(mockedConfiguration); Assert.assertEquals(100, dimensions.getWidth()); Assert.assertEquals(200, dimensions.getHeight()); }
Source:
<code>public static AbstractTask getTaskByUrl(String taskUrl) { if (!Strings.isNullOrEmpty(taskUrl)) { Collection<AbstractTask> tasks = TasksUiPlugin.getTaskList().getAllTasks(); List<AbstractTask> sortedTasks = sortTasksByRepositoryUrl(tasks); AbstractRepositoryConnector connector = null; TaskRepository repository = null; for (AbstractTask task : sortedTasks) { if (taskUrl.equals(task.getUrl())) { return task; } else { String repositoryUrl = task.getRepositoryUrl(); <START> if (repository == null || (repositoryUrl != null && !repositoryUrl.equals(repository.getUrl()))) { <END> connector = TasksUi.getRepositoryManager().getRepositoryConnector(task.getConnectorKind()); repository = getRepository(task); } if (connector != null) { URL url = connector.getBrowserUrl(repository, task); if (url != null && taskUrl.equals(url.toString())) { return task; } } } } } return null; }</code><technical_language>I if url is null, want return task, a guard ifs</technical_language>

Target:
public static AbstractTask getTaskByUrl(String taskUrl) { if (!Strings.isNullOrEmpty(taskUrl)) { Collection<AbstractTask> tasks = TasksUiPlugin.getTaskList().getAllTasks(); List<AbstractTask> sortedTasks = sortTasksByRepositoryUrl(tasks); AbstractRepositoryConnector connector = null; TaskRepository repository = null; for (AbstractTask task : sortedTasks) { if (taskUrl.equals(task.getUrl())) { return task; } else { String repositoryUrl = task.getRepositoryUrl(); if (repositoryUrl != null) { if (repository == null || !repositoryUrl.equals(repository.getUrl())) { connector = TasksUi.getRepositoryManager().getRepositoryConnector(task.getConnectorKind()); repository = getRepository(task); } if (connector != null) { URL url = connector.getBrowserUrl(repository, task); if (url != null && taskUrl.equals(url.toString())) { return task; } } } } } } return null; }
Source:
<code>public ConnectorAwareSplitSource( ConnectorId connectorId, ConnectorTransactionHandle transactionHandle, ConnectorSplitSource source, SplitSchedulingStrategy splitSchedulingStrategy) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.transactionHandle = requireNonNull(transactionHandle, "transactionHandle is null"); this.source = requireNonNull(source, "source is null"); <START> this.splitSchedulingStrategy = requireNonNull(splitSchedulingStrategy, "pipelineExecutionFlow is null"); <END> }</code><technical_language>message is wrong</technical_language>

Target:
public ConnectorAwareSplitSource( ConnectorId connectorId, ConnectorTransactionHandle transactionHandle, ConnectorSplitSource source, SplitSchedulingStrategy splitSchedulingStrategy) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.transactionHandle = requireNonNull(transactionHandle, "transactionHandle is null"); this.source = requireNonNull(source, "source is null"); this.splitSchedulingStrategy = requireNonNull(splitSchedulingStrategy, "splitSchedulingStrategy is null"); }
Source:
<code>@NonNull public PreparedDeleteObject<T> prepare() { if (deleteResolver == null) { deleteResolver = DefaultDeleteResolver.INSTANCE; } <START> Checks.checkNotNull(mapFunc, "Please specify map function"); <END> return new PreparedDeleteObject<>( storIOSQLiteDb, object, mapFunc, deleteResolver ); }</code><technical_language>Static import</technical_language>

Target:
@NonNull public PreparedDeleteObject<T> prepare() { if (deleteResolver == null) { deleteResolver = DefaultDeleteResolver.INSTANCE; } checkNotNull(mapFunc, "Please specify map function"); return new PreparedDeleteObject<>( storIOSQLiteDb, object, mapFunc, deleteResolver ); }
Source:
<code>protected void handleToNonVisibleButton(Event e) { if (visibleViewer.getControl().isFocusControl() && getVisible().size() <= 1) { handleStatusUdpate(IStatus.INFO, MarkerMessages.MarkerPreferences_AtLeastOneVisibleColumn); return; } IStructuredSelection selection = visibleViewer.getStructuredSelection(); @SuppressWarnings("unchecked") List<T> selVCols = selection.toList(); getVisible().removeAll(selVCols); getNonVisible().addAll(selVCols); updateVisibility(selVCols, false); updateIndices(getVisible()); updateIndices(getNonVisible()); nonVisibleViewer.refresh(); nonVisibleViewer.setSelection(selection); visibleViewer.refresh(); <START> handleVisibleSelection(visibleViewer.getStructuredSelection()); <END> handleNonVisibleSelection(nonVisibleViewer.getStructuredSelection()); }</code><technical_language>Adjust method call structuredSelection</technical_language>

Target:
protected void handleToNonVisibleButton(Event e) { if (visibleViewer.getControl().isFocusControl() && getVisible().size() <= 1) { handleStatusUdpate(IStatus.INFO, MarkerMessages.MarkerPreferences_AtLeastOneVisibleColumn); return; } IStructuredSelection structuredSelection = visibleViewer.getStructuredSelection(); @SuppressWarnings("unchecked") List<T> selVCols = structuredSelection.toList(); getVisible().removeAll(selVCols); getNonVisible().addAll(selVCols); updateVisibility(selVCols, false); updateIndices(getVisible()); updateIndices(getNonVisible()); nonVisibleViewer.refresh(); nonVisibleViewer.setSelection(structuredSelection); visibleViewer.refresh(); handleVisibleSelection(structuredSelection); handleNonVisibleSelection(structuredSelection); }
Source:
<code>public static VpnProfile decode(String key, byte[] value) { try { if (key == null) { return null; } String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1); if (values.length < 14 || values.length > 17) { return null; } VpnProfile profile = new VpnProfile(key); profile.name = values[0]; profile.type = Integer.parseInt(values[1]); if (profile.type < 0 || profile.type > TYPE_MAX) { return null; } profile.server = values[2]; profile.username = values[3]; profile.password = values[4]; profile.dnsServers = values[5]; profile.searchDomains = values[6]; profile.routes = values[7]; profile.mppe = Boolean.parseBoolean(values[8]); profile.l2tpSecret = values[9]; profile.ipsecIdentifier = values[10]; profile.ipsecSecret = values[11]; profile.ipsecUserCert = values[12]; profile.ipsecCaCert = values[13]; profile.ipsecServerCert = (values.length > 14) ? values[14] : ""; String <START> host = <END> (values.length > 15) ? values[15] : ""; String port = (values.length > 16) ? values[16] : ""; profile.proxy = new ProxyInfo(host, port.isEmpty() ? 0 : Integer.parseInt(port), null); profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty(); return profile; } catch (Exception e) { } return null; }</code><technical_language>I understand support setting exclusion list PAC file URL in UI, I encoded decoded. Importantly, if is set this programmatically surprising fields decoded</technical_language>

Target:
public static VpnProfile decode(String key, byte[] value) { try { if (key == null) { return null; } String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1); if (values.length < 14 || values.length > 19) { return null; } VpnProfile profile = new VpnProfile(key); profile.name = values[0]; profile.type = Integer.parseInt(values[1]); if (profile.type < 0 || profile.type > TYPE_MAX) { return null; } profile.server = values[2]; profile.username = values[3]; profile.password = values[4]; profile.dnsServers = values[5]; profile.searchDomains = values[6]; profile.routes = values[7]; profile.mppe = Boolean.parseBoolean(values[8]); profile.l2tpSecret = values[9]; profile.ipsecIdentifier = values[10]; profile.ipsecSecret = values[11]; profile.ipsecUserCert = values[12]; profile.ipsecCaCert = values[13]; profile.ipsecServerCert = (values.length > 14) ? values[14] : ""; String host = (values.length > 15) ? values[15] : ""; String port = (values.length > 16) ? values[16] : ""; String exclList = (values.length > 17) ? values[17] : ""; String pacFileUrl = (values.length > 18) ? values[18] : ""; if (pacFileUrl.isEmpty()) { profile.proxy = new ProxyInfo(host, port.isEmpty() ? 0 : Integer.parseInt(port), exclList); } else { profile.proxy = new ProxyInfo(pacFileUrl); } profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty(); return profile; } catch (Exception e) { } return null; }
Source:
<code>public void waitUntilReceived() { <START> await().atMost(Duration.ONE_MINUTE).until(() -> { <END> for (String metric : expectedMetrics.keySet()) { if (assertedMetrics.get(metric) == null || !assertedMetrics.get(metric)) { LOGGER.debug("mismatch metric {}", metric); return false; } } LOGGER.info("Asserted metrics"); return true; }); }</code><technical_language>do default minute everywhere? get higher multiplier for travis, wait minute for test fail (x 100) while developing</technical_language>

Target:
public void waitUntilReceived() { await().atMost(adjust(TEN_SECONDS)).until(() -> { for (String metric : expectedMetrics.keySet()) { if (assertedMetrics.get(metric) == null || !assertedMetrics.get(metric)) { LOGGER.debug("mismatch metric {}", metric); return false; } } LOGGER.info("Asserted metrics"); return true; }); }
Source:
<code>public UnitFlagDrawMode nextDrawMode() { <START> final var values = UnitsDrawer.UnitFlagDrawMode.values(); <END> return values[(ordinal() + 1) % values.length]; }</code><technical_language>Is necessary put full enum name here? If surprised consider values() a static method of enum</technical_language>

Target:
public UnitFlagDrawMode nextDrawMode() { final var values = values(); return values[(ordinal() + 1) % values.length]; }
Source:
<code>private Maybe<Image> getImage(Element element) { Elements imageElements = element.getFirstChildElement("images").getChildElements("image"); if (imageElements.size() > 0) { String image = imageElements.get(0).getValue(); Matcher genericImageUrlMatcher = GENERIC_PATTERN.matcher(image); if(genericImageUrlMatcher.matches()) { Image imageObj = new Image("http://" + image); imageObj.setType(ImageType.GENERIC); return Maybe.just(imageObj); } <START> if (!image.contains("api-images.channel5.com/images/default")) { <END> Image imageObj = new Image("http://" + image); return Maybe.just(imageObj); } } return Maybe.nothing(); }</code><technical_language>suppress default images for c5? this incorporated new set of changes</technical_language>

Target:
private Maybe<Image> getImage(Element element) { Elements imageElements = element.getFirstChildElement("images").getChildElements("image"); if (imageElements.size() > 0) { String image = imageElements.get(0).getValue(); if(!image.contains("http://")) { image = "http://" + image; } Image imageObj = new Image(image); if (image.contains("api-images.channel5.com/images/default")) { imageObj.setType(ImageType.GENERIC_IMAGE_CONTENT_PLAYER); } return Maybe.just(imageObj); } return Maybe.nothing(); }
Source:
<code>public WebSocketsProxyConnectionHandler(String connectionId, String amqpHostname, ProxyConfiguration proxyConfiguration) { super(connectionId, amqpHostname); this.amqpHostname = Objects.requireNonNull(amqpHostname, "'amqpHostname' cannot be null."); <START> this.proxyConfiguration = Objects.requireNonNull(proxyConfiguration, "'proxyConfiguration' is required."); <END> }</code><technical_language>error message consistent. 'proxyConfiguration' null</technical_language>

Target:
public WebSocketsProxyConnectionHandler(String connectionId, String amqpHostname, ProxyConfiguration proxyConfiguration) { super(connectionId, amqpHostname); this.amqpHostname = Objects.requireNonNull(amqpHostname, "'amqpHostname' cannot be null."); this.proxyConfiguration = Objects.requireNonNull(proxyConfiguration, "'proxyConfiguration' cannot be null."); }
Source:
<code>private boolean overcatch(CatchTree catchTree, VisitorState state) { <START> String caughtException = catchTree.getParameter().getType().toString(); <END> if (caughtException.equals("Throwable") || caughtException.equals("Exception")) { return true; } return false; }</code><technical_language>I do string matching here, brittle. symbol table types helper do real type matching: Types types = state.getTypes(); Symtab symtab = state.getSymtab(); Type paramType = ASTHelpers.getType(catchTree.getParameter().getType()); return (types.isSameType(paramType, symtab.throwableType) || types.isSameType(paramType, symtab.exceptionType));</technical_language>

Target:
private boolean overcatch(CatchTree catchTree, VisitorState state) { Types types = state.getTypes(); Symtab symtab = state.getSymtab(); Type paramType = ASTHelpers.getType(catchTree.getParameter().getType()); return (types.isSameType(paramType, symtab.throwableType) || types.isSameType(paramType, symtab.exceptionType)); }
Source:
<code>public YearMonthDay getNextPossibleSummaryDate() { YearMonthDay currentDate = new YearMonthDay(); HourMinuteSecond now = new HourMinuteSecond(); Summary lastSummary = getLastSummary(); if (lastSummary != null) { SortedSet<YearMonthDay> datesEvenToday = getAllLessonDatesUntil(currentDate); SortedSet<YearMonthDay> possibleDates = datesEvenToday.tailSet(lastSummary.getSummaryDateYearMonthDay()); possibleDates.remove(lastSummary.getSummaryDateYearMonthDay()); if (!possibleDates.isEmpty()) { YearMonthDay nextPossibleDate = possibleDates.first(); return isTimeValidToInsertSummary(now, nextPossibleDate) ? nextPossibleDate : null; } } else { SortedSet<YearMonthDay> validLessonDates = getAllValidLessonDatesWithoutInstancesDates(getLessonStartDay(), getLessonEndDay()); <START> YearMonthDay nextValidDate = validLessonDates.size() > 0 ? validLessonDates.first() : null; <END> YearMonthDay nextPossibleDate = hasAnyLessonInstances() ? getFirstLessonInstance().getDay() : nextValidDate; return isTimeValidToInsertSummary(now, nextPossibleDate) ? nextPossibleDate : null; } return null; }</code><technical_language>This code run if lesson instances</technical_language>

Target:
public YearMonthDay getNextPossibleSummaryDate() { YearMonthDay currentDate = new YearMonthDay(); HourMinuteSecond now = new HourMinuteSecond(); Summary lastSummary = getLastSummary(); if (lastSummary != null) { SortedSet<YearMonthDay> datesEvenToday = getAllLessonDatesUntil(currentDate); SortedSet<YearMonthDay> possibleDates = datesEvenToday.tailSet(lastSummary.getSummaryDateYearMonthDay()); possibleDates.remove(lastSummary.getSummaryDateYearMonthDay()); if (!possibleDates.isEmpty()) { YearMonthDay nextPossibleDate = possibleDates.first(); return isTimeValidToInsertSummary(now, nextPossibleDate) ? nextPossibleDate : null; } } else { YearMonthDay nextPossibleDate; if (hasAnyLessonInstances()) { nextPossibleDate = getFirstLessonInstance().getDay(); } else { SortedSet<YearMonthDay> validLessonDates = getAllValidLessonDatesWithoutInstancesDates(getLessonStartDay(), getLessonEndDay()); nextPossibleDate = validLessonDates.size() > 0 ? validLessonDates.first() : null; } return isTimeValidToInsertSummary(now, nextPossibleDate) ? nextPossibleDate : null; } return null; }