auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Map<String, String> getCache() { CacheState cacheState = getCacheState(); if (cacheState instanceof VersionedCache) { return ((VersionedCache) cacheState).getCache(); } else { <START> throw new IllegalStateException("Cannot get cache: " + cacheState); <END> } }</code><technical_language>Please io.druid.java.util.common.ISE for IllegalStateException, hood StringUtils.safeFormat for error message printing</technical_language>

Target:
public Map<String, String> getCache() { CacheState cacheState = getCacheState(); if (cacheState instanceof VersionedCache) { return ((VersionedCache) cacheState).getCache(); } else { throw new ISE("Cannot get cache: %s", cacheState); } }
Source:
<code><START> public void tearDown() throws IOException <END> { dummyJarFile.delete(); miniCluster.getFileSystem().delete(finalClasspath, true); miniCluster.getFileSystem().delete(intermediatePath, true); }</code><technical_language>add checks cleanup works intended. files do exist deletes called</technical_language>

Target:
public void tearDown() throws IOException { dummyJarFile.delete(); Assert.assertFalse(dummyJarFile.exists()); miniCluster.getFileSystem().delete(finalClasspath, true); Assert.assertFalse(miniCluster.getFileSystem().exists(finalClasspath)); miniCluster.getFileSystem().delete(intermediatePath, true); Assert.assertFalse(miniCluster.getFileSystem().exists(intermediatePath)); }
Source:
<code>private void addSubscriptions(String resourcePath, List<Subscription> subscriptions, Queue<String> pathsQueue, boolean withChildren) throws EventBrokerException { try { UserRegistry userRegistry = this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId()); String subscriptionsPath = getSubscriptionsPath(resourcePath); if (userRegistry.resourceExists(subscriptionsPath)) { Collection collection = (Collection) userRegistry.get(subscriptionsPath); for (String subscriptionPath : collection.getChildren()) { Resource subscriptionResource = userRegistry.get(subscriptionPath); Subscription subscription = JavaUtil.getSubscription(subscriptionResource); subscription.setTopicName(removeResourcePath(resourcePath)); if (subscriptionPath.endsWith("/")) { subscriptionPath = subscriptionsPath.substring(0, subscriptionPath.lastIndexOf("/")); } subscription.setId(subscriptionPath.substring(subscriptionPath.lastIndexOf("/") + 1)); subscriptions.add(subscription); } } if (withChildren) { Collection childResources = (Collection) userRegistry.get(resourcePath); for (String childResourcePath : childResources.getChildren()) { <START> if ((!childResourcePath.contains(EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME)) && <END> (!childResourcePath.contains(EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME))) { pathsQueue.add(childResourcePath); } } } } catch (RegistryException e) { throw new EventBrokerException("Cannot access the registry", e); } }</code><technical_language>sense flip statement</technical_language>

Target:
private void addSubscriptions(String resourcePath, List<Subscription> subscriptions, Queue<String> pathsQueue, boolean withChildren) throws EventBrokerException { try { UserRegistry userRegistry = this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId()); String subscriptionsPath = getSubscriptionsPath(resourcePath); if (userRegistry.resourceExists(subscriptionsPath)) { Collection collection = (Collection) userRegistry.get(subscriptionsPath); for (String subscriptionPath : collection.getChildren()) { Resource subscriptionResource = userRegistry.get(subscriptionPath); Subscription subscription = JavaUtil.getSubscription(subscriptionResource); subscription.setTopicName(removeResourcePath(resourcePath)); if (subscriptionPath.endsWith("/")) { subscriptionPath = subscriptionsPath.substring(0, subscriptionPath.lastIndexOf("/")); } subscription.setId(subscriptionPath.substring(subscriptionPath.lastIndexOf("/") + 1)); subscriptions.add(subscription); } } if (withChildren) { Collection childResources = (Collection) userRegistry.get(resourcePath); for (String childResourcePath : childResources.getChildren()) { if ((!EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME .contains(childResourcePath)) && (!EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME .contains(childResourcePath))) { pathsQueue.add(childResourcePath); } } } } catch (RegistryException e) { throw new EventBrokerException("Cannot access the registry", e); } }
Source:
<code>public Option<T> map(ResultSet r, int columnNumber, StatementContext ctx) throws SQLException { final ColumnMapper<?> mapper = ctx.findColumnMapperFor( GenericTypes.findGenericParameter(type, Option.class) .orElseThrow(() -> new NoSuchMapperException("No mapper for raw Option type"))) <START> .orElseThrow(() -> new NoSuchMapperException("No mapper for type " + type + " nested in Option")); <END> return (Option<T>) Option.of(mapper.map(r, columnNumber, ctx)); }</code><technical_language>want tests covering exceptions</technical_language>

Target:
public Option<T> map(ResultSet r, int columnNumber, StatementContext ctx) throws SQLException { final ColumnMapper<?> mapper = ctx.findColumnMapperFor(nestedType) .orElseThrow(() -> new NoSuchMapperException("No mapper for type " + nestedType + " nested in Option")); return (Option<T>) Option.of(mapper.map(r, columnNumber, ctx)); }
Source:
<code>public Client findClient(final WebContext context) { final String name = context.getRequestParameter(this.clientNameParameter); <START> if (name == null && defaultClient != null) { <END> return defaultClient; } CommonHelper.assertNotBlank("name", name); return findClient(name); }</code><technical_language>is this defaultClient for? related resource changes..</technical_language>

Target:
public Client findClient(final WebContext context) { final String name = context.getRequestParameter(this.clientNameParameter); CommonHelper.assertNotBlank("name", name); return findClient(name); }
Source:
<code>protected Response unwrapException(HttpRequest request, Throwable e) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } <START> catch(IllegalStateException ise) { <END> } } } if ((jaxrsResponse = executeExceptionMapper(unwrappedException)) != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException); } else { return null; } } }</code><technical_language>exception is swallowed, log message trace debug level</technical_language>

Target:
protected Response unwrapException(HttpRequest request, Throwable e) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { return response; } } } if ((jaxrsResponse = executeExceptionMapper(unwrappedException)) != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException); } else { return null; } } }
Source:
<code>public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { <START> if(tab == EsteemedInnovation.tab) { <END> for (Types component : Types.values()) { items.add(new ItemStack(MiscellaneousModule.COMPONENT, 1, component.getMetadata())); } } }</code><technical_language>ItemMetalNugget</technical_language>

Target:
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (isInCreativeTab(tab)) { for (Types component : Types.values()) { items.add(new ItemStack(MiscellaneousModule.COMPONENT, 1, component.getMetadata())); } } }
Source:
<code>protected String getPartName(String key, int partNumber, int totalParts) { <START> int base = (int)Math.log10(totalParts) + 1; <END> String format = String.format("%%s%%s%%0%dd", base); return String.format(format, key, PART_SEPARATOR, partNumber); }</code><technical_language>[minor] Is this intended result (int) Math.ceil(Math.log10(totalParts))? If so, this is (mathematically) a bit more obvious</technical_language>

Target:
protected String getPartName(String key, int partNumber, int totalParts) { int base = (int) Math.log10(totalParts) + 1; return String.format("%s%s%0" + base + "d", key, PART_SEPARATOR, partNumber); }
Source:
<code>protected void setPluginConfigurationAttributes(Map attributes) { SCMConfigurations scmConfigurations = SCMMetadataStore.getInstance().getConfigurationMetadata(pluginConfiguration.getId()); <START> for (SCMConfiguration scmConfiguration : scmConfigurations.list()) { <END> String key = scmConfiguration.getKey(); if (attributes.containsKey(key)) { if (configuration.getProperty(key) == null) { configuration.addNewConfiguration(scmConfiguration.getKey(), scmConfiguration.getOption(Property.SECURE)); } configuration.getProperty(key).setConfigurationValue(new ConfigurationValue((String) attributes.get(key))); configuration.getProperty(key).handleSecureValueConfiguration(scmConfiguration.getOption(Property.SECURE)); } } }</code><technical_language>scmConfigurations list null. Is handled. reason? handled earlier, in places (for instance, [metadata == null](<LINK_0></technical_language>

Target:
protected void setPluginConfigurationAttributes(Map attributes) { SCMConfigurations scmConfigurations = SCMMetadataStore.getInstance().getConfigurationMetadata(pluginConfiguration.getId()); if (scmConfigurations == null) { throw new RuntimeException("metadata unavailable for plugin: " + pluginConfiguration.getId()); } for (SCMConfiguration scmConfiguration : scmConfigurations.list()) { String key = scmConfiguration.getKey(); if (attributes.containsKey(key)) { if (configuration.getProperty(key) == null) { configuration.addNewConfiguration(scmConfiguration.getKey(), scmConfiguration.getOption(Property.SECURE)); } configuration.getProperty(key).setConfigurationValue(new ConfigurationValue((String) attributes.get(key))); configuration.getProperty(key).handleSecureValueConfiguration(scmConfiguration.getOption(Property.SECURE)); } } }
Source:
<code>public void handleDataChange(String dataPath, Object data) { if (logger.isDebugEnabled()) { logger.debug("Data change callback: paths changed: " + dataPath); } try { updateNotificationTime(System.nanoTime()); if (dataPath != null && dataPath.startsWith(_path)) { <START> NotificationContext changeContext = new NotificationContext(_manager); <END> changeContext.setType(NotificationContext.Type.CALLBACK); changeContext.setPathChanged(dataPath); changeContext.setChangeType(_changeType); enqueueTask(changeContext); } } catch (Exception e) { String msg = "exception in handling data-change. path: " + dataPath + ", listener: " + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }</code><technical_language>format</technical_language>

Target:
public void handleDataChange(String dataPath, Object data) { if (logger.isDebugEnabled()) { logger.debug("Data change callback: paths changed: {}", dataPath); } try { updateNotificationTime(System.nanoTime()); if (dataPath != null && dataPath.startsWith(_path)) { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.CALLBACK); changeContext.setPathChanged(dataPath); changeContext.setChangeType(_changeType); enqueueTask(changeContext); } } catch (Exception e) { String msg = "exception in handling data-change. path: " + dataPath + ", listener: " + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }
Source:
<code><START> public void testReopenSession() throws Exception { <END> final ProjectDiagram projectDiagram = mock(ProjectDiagram.class); tested.reopenSession(projectDiagram); verify(sessionEditorPresenter, times(1)).destroy(); verify(sessionEditorPresenter, times(1)).open(eq(projectDiagram), any(SessionPresenter.SessionPresenterCallback.class)); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testReopenSession() { final ProjectDiagram projectDiagram = mock(ProjectDiagram.class); tested.reopenSession(projectDiagram); verify(sessionEditorPresenter, times(1)).destroy(); verify(sessionEditorPresenter, times(1)).open(eq(projectDiagram), any(SessionPresenter.SessionPresenterCallback.class)); }
Source:
<code>public Scan addFamily(byte[] family) { <START> throw new IllegalStateException("ImmutableScan does not allow access to addFamily"); <END> }</code><technical_language>UnsupportedOperationException IllegalStateException</technical_language>

Target:
public Scan addFamily(byte[] family) { throw new UnsupportedOperationException("ImmutableScan does not allow access to addFamily"); }
Source:
<code>private boolean isEnabled(Object element) { if (element instanceof ICommand) { ICommand command = (ICommand) element; String val = command.getArguments().get(COMMAND_ENABLED); if(val != null) { boolean enabled = <START> Boolean.parseBoolean(val); <END> return enabled; } } else if (element instanceof ILaunchConfiguration) { try { return ExternalToolsUtil.isBuilderEnabled((ILaunchConfiguration) element); } catch (CoreException e) { } } else if (element instanceof ErrorConfig) { return false; } return true; }</code><technical_language>need enabled variable nay more. return parsed boolean value</technical_language>

Target:
private boolean isEnabled(Object element) { if (element instanceof ICommand) { ICommand command = (ICommand) element; String val = command.getArguments().get(COMMAND_ENABLED); if(val != null) { return Boolean.parseBoolean(val); } } else if (element instanceof ILaunchConfiguration) { try { return ExternalToolsUtil.isBuilderEnabled((ILaunchConfiguration) element); } catch (CoreException e) { } } else if (element instanceof ErrorConfig) { return false; } return true; }
Source:
<code>public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { boolean inExposedModelControllerDomains = isInExposedModelControllerDomains(name); if (inExposedModelControllerDomains) { <START> throw new RuntimeOperationsException(JmxLogger.ROOT_LOGGER.addNotificationListenerNotAllowed(name)); <END> } mbs.addNotificationListener(name, listener, new BlockingNotificationFilter(filter), handback); }</code><technical_language>Is this class needed? looked 100% ServerInterceptorFactory/AccessAuditContext extended record request a remote jmx one. checks done in ModelControllerMBeanHelper.xxxNotificationListener()</technical_language>

Target:
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { boolean inExposedModelControllerDomains = isInExposedModelControllerDomains(name); if (inExposedModelControllerDomains) { throw new RuntimeOperationsException(JmxLogger.ROOT_LOGGER.addNotificationListenerNotAllowed(name)); } BlockingNotificationFilter blockingFilter = new BlockingNotificationFilter(filter); associations.put(new Association(name, listener, filter, handback), blockingFilter); mbs.addNotificationListener(name, listener, new BlockingNotificationFilter(filter), handback); }
Source:
<code>public ListEventsForSubjectTableFactory(boolean showMoreLink) { <START> imageIconPaths.put("NOT_SCHEDULED", "icon icon-clock2"); <END> imageIconPaths.put("SCHEDULED", "icon icon-clock"); imageIconPaths.put("DATA_ENTRY_STARTED", "icon icon-pencil-squared orange"); imageIconPaths.put("COMPLETED", "icon icon-checkbox-checked green"); imageIconPaths.put("STOPPED", "icon icon-stop-circle red"); imageIconPaths.put("SKIPPED", "icon icon-redo"); imageIconPaths.put("SIGNED", "icon icon-icon-sign"); crfColumnImageIconPaths.put(0, "icon icon-file-excel red"); crfColumnImageIconPaths.put(1, "icon icon-doc"); crfColumnImageIconPaths.put(2, "icon icon-pencil-squared orange"); crfColumnImageIconPaths.put(3, "icon icon-pencil-squared orange"); crfColumnImageIconPaths.put(4, "icon icon-icon-doubleDataEntry orange"); crfColumnImageIconPaths.put(5, "icon icon-checkbox-checked green"); crfColumnImageIconPaths.put(6, "icon icon-checkbox-checked green"); crfColumnImageIconPaths.put(7, "icon icon-lock"); this.showMoreLink = showMoreLink; }</code><technical_language>reference enum values here</technical_language>

Target:
public ListEventsForSubjectTableFactory(boolean showMoreLink) { imageIconPaths.put(StudyEventWorkflowStatusEnum.NOT_SCHEDULED.toString(), "icon icon-clock2"); imageIconPaths.put(StudyEventWorkflowStatusEnum.SCHEDULED.toString(), "icon icon-clock"); imageIconPaths.put(StudyEventWorkflowStatusEnum.DATA_ENTRY_STARTED.toString(), "icon icon-pencil-squared orange"); imageIconPaths.put(StudyEventWorkflowStatusEnum.COMPLETED.toString(), "icon icon-checkbox-checked green"); imageIconPaths.put(StudyEventWorkflowStatusEnum.STOPPED.toString(), "icon icon-stop-circle red"); imageIconPaths.put(StudyEventWorkflowStatusEnum.SKIPPED.toString(), "icon icon-redo"); imageIconPaths.put(StudyEventWorkflowStatusEnum.SIGNED.toString(), "icon icon-icon-sign"); crfColumnImageIconPaths.put(0, "icon icon-file-excel red"); crfColumnImageIconPaths.put(1, "icon icon-doc"); crfColumnImageIconPaths.put(2, "icon icon-pencil-squared orange"); crfColumnImageIconPaths.put(3, "icon icon-pencil-squared orange"); crfColumnImageIconPaths.put(4, "icon icon-icon-doubleDataEntry orange"); crfColumnImageIconPaths.put(5, "icon icon-checkbox-checked green"); crfColumnImageIconPaths.put(6, "icon icon-checkbox-checked green"); crfColumnImageIconPaths.put(7, "icon icon-lock"); this.showMoreLink = showMoreLink; }
Source:
<code>public int emitBatches() { Database database = oma.getDatabase(mixing.getDescriptor(SQLReplicationTask.class).getRealm()); AtomicInteger numberOfBatches = new AtomicInteger(maxBatches); AtomicInteger scheduledTasks = new AtomicInteger(0); <START> emitter.computeBatches(SQLReplicationTask.class, qry -> enhanceQuery(qry, true), batchSize, batch -> { <END> distributedTasks.submitFIFOTask(ReplicationTaskExecutor.class, batch); scheduledTasks.addAndGet(batchSize); markTasksAsScheduled(database, batch); return numberOfBatches.decrementAndGet() > 0; }); return scheduledTasks.get(); }</code><technical_language>qry -> query</technical_language>

Target:
public int emitBatches() { Database database = oma.getDatabase(mixing.getDescriptor(SQLReplicationTask.class).getRealm()); AtomicInteger numberOfBatches = new AtomicInteger(maxBatches); AtomicInteger scheduledTasks = new AtomicInteger(0); emitter.computeBatches(SQLReplicationTask.class, query -> filterOnExecutableTasks(query, true), batchSize, batch -> { distributedTasks.submitFIFOTask(ReplicationTaskExecutor.class, batch); scheduledTasks.addAndGet(batchSize); markTasksAsScheduled(database, batch); return numberOfBatches.decrementAndGet() > 0; }); return scheduledTasks.get(); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final VolumeFromImage that = (VolumeFromImage) o; <START> return name.equals(that.name); <END> }</code><technical_language>This check fields. super.equals() check parent class's fields and, if returns true, check this class's additions ((volumeSize)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!super.equals(o)) return false; final VolumeFromImage that = (VolumeFromImage) o; return this.volumeSize == that.volumeSize; }
Source:
<code>public void grantSystemPermissions(String userId) { try { AbstractPermissionsDomain<? extends AbstractPermissions> systemDomain = permissionsManager.getDomain(SystemDomain.DOMAIN_ID); permissionsManager.storePermission( systemDomain.newInstance(userId, null, systemDomain.getAllowedActions())); } catch (ServerException | NotFoundException | ConflictException e) { <START> LOG.warn( <END> format("System permissions creation failed for user %s", userId), e.getLocalizedMessage()); } }</code><technical_language>put exception argument LOG.warn method for formatting</technical_language>

Target:
public void grantSystemPermissions(String userId) { try { AbstractPermissionsDomain<? extends AbstractPermissions> systemDomain = permissionsManager.getDomain(SystemDomain.DOMAIN_ID); permissionsManager.storePermission( systemDomain.newInstance(userId, null, systemDomain.getAllowedActions())); } catch (ServerException | NotFoundException | ConflictException e) { LOG.warn(format("System permissions creation failed for user %s", userId), e); } }
Source:
<code>public void addParserConfig(String description, String path) { <START> String rulePath = createPageArea("rule", new Runnable() { <END> @Override public void run() { addButton.click(); } }); Rule rule = new Rule(getPage(), rulePath); rule.description.set(description); rule.path.set(path); }</code><technical_language>replace lambda: createPageArea("rule", () -> addButton.click());</technical_language>

Target:
public void addParserConfig(String description, String path) { String rulePath = createPageArea("rule", () -> addButton.click()); Rule rule = new Rule(getPage(), rulePath); rule.description.set(description); rule.path.set(path); }
Source:
<code>public String getValue(String value, Attribute attr) { <START> ObjectMapper mapper = new ObjectMapper(); <END> try { return mapper.writeValueAsString(value); } catch (JsonProcessingException e) { log.warn("Error converting to JSON", value, e); return null; } }</code><technical_language>ObjectMapper is fully thread safe, a single static variable this transformer class (also do configure differently method usage)</technical_language>

Target:
public String getValue(String value, Attribute attr) { try { return mapper.writeValueAsString(value); } catch (JsonProcessingException e) { log.warn("Error converting to JSON", value, e); return null; } }
Source:
<code>protected void saveOffsets() { if (tailer != null) { tailer.commit(); Span span = Tracing.getTracer().getCurrentSpan(); <START> span.addAnnotation("Checkpoint positions" + Instant.now().toString()); <END> } }</code><technical_language>need for .toString() (also in next method)</technical_language>

Target:
protected void saveOffsets() { if (tailer != null) { tailer.commit(); Span span = Tracing.getTracer().getCurrentSpan(); span.addAnnotation("Checkpoint positions at " + Instant.now()); } }
Source:
<code>public OptimalAssignment calculate(ClusterModel clusterModel) { OptimalAssignment optimalAssignment = new OptimalAssignment(); Map<String, Set<AssignableReplica>> replicasByResource = clusterModel.getAssignableReplicaMap(); List<AssignableNode> nodes = new ArrayList<>(clusterModel.getAssignableNodes().values()); for (String resource : replicasByResource.keySet()) { for (AssignableReplica replica : replicasByResource.get(resource)) { Optional<AssignableNode> maybeBestNode = getNodeWithHighestPoints(replica, nodes, clusterModel.getContext(), optimalAssignment); if (optimalAssignment.hasAnyFailure()) { LOG.error("Unable to find any available candidate node for partition {}; Fail reasons: {}", replica.getPartitionName(), optimalAssignment.getFailures()); <START> return optimalAssignment; <END> } maybeBestNode.ifPresent(node -> clusterModel.assign(replica.getResourceName(), replica.getPartitionName(), replica.getReplicaState(), node.getInstanceName())); } } return optimalAssignment.convertFrom(clusterModel); }</code><technical_language>easier throw exception directly. In this case, a new assignment anyway</technical_language>

Target:
public OptimalAssignment calculate(ClusterModel clusterModel) throws HelixRebalanceException { OptimalAssignment optimalAssignment = new OptimalAssignment(); Map<String, Set<AssignableReplica>> replicasByResource = clusterModel.getAssignableReplicaMap(); List<AssignableNode> nodes = new ArrayList<>(clusterModel.getAssignableNodes().values()); for (String resource : replicasByResource.keySet()) { for (AssignableReplica replica : replicasByResource.get(resource)) { Optional<AssignableNode> maybeBestNode = getNodeWithHighestPoints(replica, nodes, clusterModel.getContext(), optimalAssignment); if (optimalAssignment.hasAnyFailure()) { String errorMessage = String.format( "Unable to find any available candidate node for partition %s; Fail reasons: %s", replica.getPartitionName(), optimalAssignment.getFailures()); throw new HelixRebalanceException(errorMessage, HelixRebalanceException.Type.FAILED_TO_CALCULATE); } maybeBestNode.ifPresent(node -> clusterModel.assign(replica.getResourceName(), replica.getPartitionName(), replica.getReplicaState(), node.getInstanceName())); } } return optimalAssignment.convertFrom(clusterModel); }
Source:
<code>private IkeSessionStateMachine makeAndStartIkeSession(IkeSessionParams ikeParams) throws Exception { IkeSessionStateMachine ikeSession = new IkeSessionStateMachine( mLooper.getLooper(), mSpyContext, mIpSecManager, ikeParams, mChildSessionParams, mSpyUserCbExecutor, mMockIkeSessionCallback, mMockChildSessionCallback, mMockEapAuthenticatorFactory); ikeSession.setDbg(true); <START> assertFalse(mSecureRandom instanceof DeterministicSecureRandom); <END> mLooper.dispatchAll(); ikeSession.mLocalAddress = LOCAL_ADDRESS; assertEquals(REMOTE_ADDRESS, ikeSession.mRemoteAddress); mSpyIkeUdp4Socket = spy(IkeUdp4Socket.getInstance(mMockDefaultNetwork, ikeSession)); mSpyIkeUdp6Socket = spy(IkeUdp6Socket.getInstance(mMockDefaultNetwork, ikeSession)); mSpyIkeUdpEncapSocket = spy( IkeUdpEncapSocket.getIkeUdpEncapSocket( mMockDefaultNetwork, mIpSecManager, ikeSession)); doNothing().when(mSpyIkeUdp4Socket).sendIkePacket(any(), any()); doNothing().when(mSpyIkeUdp6Socket).sendIkePacket(any(), any()); doNothing().when(mSpyIkeUdpEncapSocket).sendIkePacket(any(), any()); mSpyCurrentIkeSocket = mSpyIkeUdp4Socket; ikeSession.mIkeSocket = mSpyCurrentIkeSocket; return ikeSession; }</code><technical_language>mSecureRandom removed? Also, need a assert DeterministicSecureRandom created this test run</technical_language>

Target:
private IkeSessionStateMachine makeAndStartIkeSession(IkeSessionParams ikeParams) throws Exception { IkeSessionStateMachine ikeSession = new IkeSessionStateMachine( mLooper.getLooper(), mSpyContext, mIpSecManager, ikeParams, mChildSessionParams, mSpyUserCbExecutor, mMockIkeSessionCallback, mMockChildSessionCallback, mMockEapAuthenticatorFactory); ikeSession.setDbg(true); mLooper.dispatchAll(); ikeSession.mLocalAddress = LOCAL_ADDRESS; assertEquals(REMOTE_ADDRESS, ikeSession.mRemoteAddress); mSpyIkeUdp4Socket = spy(IkeUdp4Socket.getInstance(mMockDefaultNetwork, ikeSession)); mSpyIkeUdp6Socket = spy(IkeUdp6Socket.getInstance(mMockDefaultNetwork, ikeSession)); mSpyIkeUdpEncapSocket = spy( IkeUdpEncapSocket.getIkeUdpEncapSocket( mMockDefaultNetwork, mIpSecManager, ikeSession)); doNothing().when(mSpyIkeUdp4Socket).sendIkePacket(any(), any()); doNothing().when(mSpyIkeUdp6Socket).sendIkePacket(any(), any()); doNothing().when(mSpyIkeUdpEncapSocket).sendIkePacket(any(), any()); mSpyCurrentIkeSocket = mSpyIkeUdp4Socket; ikeSession.mIkeSocket = mSpyCurrentIkeSocket; return ikeSession; }
Source:
<code>public ContentDto getContent(Long versionId) { try { final ContentVersion contentVersion = versioningManager.getVersion(versionId); final Content content = versioningManager.getContent(contentVersion); final ContentDto contentDto = contentService.getDtoBuilder().convert(content); return contentDto; } catch (ApsSystemException e) { <START> e.printStackTrace(); <END> } return null; }</code><technical_language>substitute this console output a right log</technical_language>

Target:
public ContentDto getContent(Long versionId) { try { final ContentVersion contentVersion = versioningManager.getVersion(versionId); final Content content = versioningManager.getContent(contentVersion); final ContentDto contentDto = contentService.getDtoBuilder().convert(content); return contentDto; } catch (ApsSystemException e) { logger.error("Error reading the content from version ", versionId, e); } return null; }
Source:
<code>public void testCloudWithAPI() throws Exception { final String OUTPUT = TEST_OUTPUT_GCS_FOLDER + "CountReadsITCase-testCloudWithAPI-output.txt"; String[] ARGS = { "--apiKey=" + API_KEY, "--project=" + TEST_PROJECT, "--output=" + OUTPUT, "--numWorkers=2", "--runner=BlockingDataflowPipelineRunner", "--stagingLocation=" + TEST_STAGING_GCS_FOLDER, "--references=1:550000:560000", "--readGroupSetId=" + TEST_READGROUPSET }; <START> final long EXPECTED = 685; <END> GenomicsOptions popts = PipelineOptionsFactory.create().as(GenomicsOptions.class); popts.setApiKey(API_KEY); GcsUtil gcsUtil = new GcsUtil.GcsUtilFactory().create(popts); touchOutput(gcsUtil, OUTPUT); CountReads.main(ARGS); BufferedReader reader = new BufferedReader(Channels.newReader(gcsUtil.open(GcsPath.fromUri(OUTPUT)), "UTF-8")); long got = Long.parseLong(reader.readLine()); Assert.assertEquals(EXPECTED, got); }</code><technical_language>This good! Consider moving this constant (and line 96) GCS path ReadGroupSetId constants match</technical_language>

Target:
public void testCloudWithAPI() throws Exception { final String OUTPUT = TEST_OUTPUT_GCS_FOLDER + "CountReadsITCase-testCloudWithAPI-output.txt"; String[] ARGS = { "--apiKey=" + API_KEY, "--project=" + TEST_PROJECT, "--output=" + OUTPUT, "--numWorkers=2", "--runner=BlockingDataflowPipelineRunner", "--stagingLocation=" + TEST_STAGING_GCS_FOLDER, "--references=" + TEST_CONTIG, "--readGroupSetId=" + TEST_READGROUPSET }; GenomicsOptions popts = PipelineOptionsFactory.create().as(GenomicsOptions.class); popts.setApiKey(API_KEY); GcsUtil gcsUtil = new GcsUtil.GcsUtilFactory().create(popts); touchOutput(gcsUtil, OUTPUT); CountReads.main(ARGS); BufferedReader reader = new BufferedReader(Channels.newReader(gcsUtil.open(GcsPath.fromUri(OUTPUT)), "UTF-8")); long got = Long.parseLong(reader.readLine()); Assert.assertEquals(TEST_EXPECTED, got); }
Source:
<code>public static JobConf configureCompression(Configuration config, HiveCompressionCodec compression) { JobConf result; if (config instanceof FileSystemFactory) { checkArgument(config instanceof JobConf, "config is not an instance of JobConf: %s", config.getClass()); <START> checkArgument(config.get(IS_NOT_A_COPY) == null, "config is not a copy"); <END> config.set(IS_NOT_A_COPY, Boolean.TRUE.toString()); result = (JobConf) config; } else { result = new JobConf(false); copy(config, result); } setCompressionProperties(result, compression); return result; }</code><technical_language>i understand this. is_not_a_copy flag, error message mean</technical_language>

Target:
public static JobConf configureCompression(Configuration config, HiveCompressionCodec compression) { JobConf result; if (config instanceof FileSystemFactory) { checkArgument(config instanceof JobConf, "config is not an instance of JobConf: %s", config.getClass()); result = (JobConf) config; } else { result = new JobConf(false); copy(config, result); } setCompressionProperties(result, compression); return result; }
Source:
<code>public byte[] convertFromJson(String jsonValue) { return convertFromString(ValueType.readJson(jsonValue, String.class)); <END> <START> }</code><technical_language>I understand: before, get SafeIllegalArgumentExceptions if this a string, get a plain RuntimeException wraps IOException. Is understanding correct, is this behaviour OK</technical_language>

Target:
public byte[] convertFromJson(String jsonValue) { return convertFromString(jsonValue); }
Source:
<code>private float[] calculateRubricAverage(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); float[][] percentageFrequency = calculateRubricStats(responses, question); float[] average = new float[fqd.numOfRubricSubQuestions]; for(int i=0; i<fqd.numOfRubricSubQuestions ; i++){ int[] rubricChoiceWeight = getChoiceAssginedWeight(fqd.rubricChoices); if(rubricChoiceWeight != null){ for(int j=0; j<fqd.numOfRubricChoices ; j++){ average[i] += rubricChoiceWeight[j] * percentageFrequency[i][j]; } }else{ for(int j=0; j<fqd.numOfRubricChoices ; j++){ average[i] += (fqd.numOfRubricChoices - j) * percentageFrequency[i][j]; } <START> } <END> } return average; }</code><technical_language>collapse this block just: java average[i] += (rubricChoiceWeight == null ? ... : ...) * ...;</technical_language>

Target:
private float[] calculateRubricAverage(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); float[][] percentageFrequency = calculateRubricStats(responses, question); float[] average = new float[fqd.numOfRubricSubQuestions]; for(int i = 0; i < fqd.numOfRubricSubQuestions; i++){ for(int j = 0; j < fqd.numOfRubricChoices; j++){ average[i] += (fqd.numOfRubricChoices - j) * percentageFrequency[i][j]; } } return average; }
Source:
<code>public void compare() { if (clockHasNotMovedForwards()) { return; } <START> if (hasTooMuchTimeElapsedSincePreviousRequest()) { <END> events.tooMuchTimeSincePreviousRequest(minElapsedTime); return; } if (requestsTookTooLongToComplete()) { events.requestsTookTooLong(minElapsedTime, maxElapsedTime); return; } long skew = getSkew(); events.clockSkew(server, skew); }</code><technical_language>i if get rid of checks (hasTooMuchTimeElapsedSincePreviousRequest requestsTookTooLongToComplete ). if a lot of time elapsed, request a while return, i interested in knowing if clock skew; want period skew occurred long request took</technical_language>

Target:
public void compare() { if (clockHasMovedBackwards()) { return; } long skew = getSkew(); events.clockSkew(server, skew, minElapsedTime, lastRequestDuration); }
Source:
<code>public void canClickALine() throws Exception { SWTBotTableItem line = table.getTableItem("Index:2"); bot.button("Clear").click(); line.click(); assertTextContains("MouseDown [3]: MouseEvent{Table ", listeners); assertTextContains("Selection [13]: SelectionEvent{Table ", listeners); <START> assertEquals(1, table.selectionCount()); <END> }</code><technical_language>assert selection text for TreeItem</technical_language>

Target:
public void canClickALine() throws Exception { String ITEM_TEXT = "Index:2"; SWTBotTableItem line = table.getTableItem(ITEM_TEXT); bot.button("Clear").click(); line.click(); assertTextContains("MouseDown [3]: MouseEvent{Table ", listeners); assertTextContains("Selection [13]: SelectionEvent{Table ", listeners); assertEquals(1, table.selectionCount()); assertEquals(ITEM_TEXT, table.selection().get(0).get(0)); }
Source:
<code>public RemoteOperation buildOperation() { if (mGrantType != OAuth2GrantType.AUTHORIZATION_CODE && mGrantType != OAuth2GrantType.REFRESH_TOKEN) { throw new UnsupportedOperationException( "Unsupported grant type. Only " + OAuth2GrantType.AUTHORIZATION_CODE.getValue() + " and " + OAuth2GrantType.REFRESH_TOKEN + " are supported" ); } OAuth2ClientConfiguration clientConfiguration = mOAuth2Provider.getClientConfiguration(); switch(mRequest) { case CREATE_ACCESS_TOKEN: return new OAuth2GetAccessTokenOperation( mGrantType.getValue(), mCode, clientConfiguration.getClientId(), clientConfiguration.getClientSecret(), clientConfiguration.getRedirectUri(), mOAuth2Provider.getAccessTokenEndpointPath() ); case REFRESH_ACCESS_TOKEN: return new OAuth2GetRefreshedAccessTokenOperation( <START> mGrantType.getValue(), <END> clientConfiguration.getClientId(), clientConfiguration.getClientSecret(), mRefreshToken, mOAuth2Provider.getAccessTokenEndpointPath() ); default: throw new UnsupportedOperationException( "Unsupported request" ); } }</code><technical_language>Bad indentation, I change</technical_language>

Target:
public RemoteOperation buildOperation() { if (mGrantType != OAuth2GrantType.AUTHORIZATION_CODE && mGrantType != OAuth2GrantType.REFRESH_TOKEN) { throw new UnsupportedOperationException( "Unsupported grant type. Only " + OAuth2GrantType.AUTHORIZATION_CODE.getValue() + " and " + OAuth2GrantType.REFRESH_TOKEN + " are supported" ); } OAuth2ClientConfiguration clientConfiguration = mOAuth2Provider.getClientConfiguration(); switch(mRequest) { case CREATE_ACCESS_TOKEN: return new OAuth2GetAccessTokenOperation( mGrantType.getValue(), mCode, clientConfiguration.getClientId(), clientConfiguration.getClientSecret(), clientConfiguration.getRedirectUri(), mOAuth2Provider.getAccessTokenEndpointPath() ); case REFRESH_ACCESS_TOKEN: return new OAuth2RefreshAccessTokenOperation( clientConfiguration.getClientId(), clientConfiguration.getClientSecret(), mRefreshToken, mOAuth2Provider.getAccessTokenEndpointPath() ); default: throw new UnsupportedOperationException( "Unsupported request" ); } }
Source:
<code>private RadioGroupItem createRadioItemToModifyPluginField(PluginDescriptor plugin, PluginDescriptor.Field pluginField) { String formItemPrefixName = plugin.getPluginName() + pluginField.getName(); <START> LinkedHashMap<String, String> radioOptions = new LinkedHashMap<>(); <END> radioOptions.put(EDIT_RADIO_OPTION_NAME, "In-line editing"); radioOptions.put(UPLOAD_RADIO_OPTION_NAME, "Upload new file"); RadioGroupItem editOrUploadFormItem = new RadioGroupItem(formItemPrefixName + EDIT_OR_UPLOAD_FORM_ITEM_SUFFIX, pluginField.getName()); editOrUploadFormItem.setValueMap(radioOptions); editOrUploadFormItem.setVertical(false); editOrUploadFormItem.setDefaultValue(EDIT_RADIO_OPTION_NAME); editOrUploadFormItem.addChangedHandler(changedEvent -> { String radioValue = changedEvent.getValue().toString(); List<FormItem> formItemsForPlugin = this.nodeSourceWindow.getFormItemsOfPlugin(plugin.getPluginName()); if (radioValue.equals(EDIT_RADIO_OPTION_NAME)) { enableEditInLine(formItemPrefixName, formItemsForPlugin); } else if (radioValue.equals(UPLOAD_RADIO_OPTION_NAME)) { enableUploadNewFile(formItemPrefixName, formItemsForPlugin); } }); return editOrUploadFormItem; }</code><technical_language>I guess is a reason 'LinkedHashMap' instead of 'Map'</technical_language>

Target:
private RadioGroupItem createRadioItemToModifyPluginField(PluginDescriptor plugin, PluginDescriptor.Field pluginField) { String formItemPrefixName = plugin.getPluginName() + pluginField.getName(); LinkedHashMap<String, String> radioOptions = new LinkedHashMap<>(); radioOptions.put(EDIT_RADIO_OPTION_NAME, "In-line editing"); radioOptions.put(UPLOAD_RADIO_OPTION_NAME, "Upload new file"); RadioGroupItem editOrUploadFormItem = new RadioGroupItem(formItemPrefixName + EDIT_OR_UPLOAD_FORM_ITEM_SUFFIX, pluginField.getName()); editOrUploadFormItem.setValueMap(radioOptions); editOrUploadFormItem.setVertical(false); editOrUploadFormItem.setDefaultValue(EDIT_RADIO_OPTION_NAME); editOrUploadFormItem.addChangedHandler(changedEvent -> { String radioValue = changedEvent.getValue().toString(); List<FormItem> formItemsForPlugin = this.nodeSourceWindow.getFormItemsOfPlugin(plugin.getPluginName()); if (radioValue.equals(EDIT_RADIO_OPTION_NAME)) { enableOrDisableEditInLine(formItemPrefixName, formItemsForPlugin); } else if (radioValue.equals(UPLOAD_RADIO_OPTION_NAME)) { enableOrDisableUploadNewFile(formItemPrefixName, formItemsForPlugin); } }); return editOrUploadFormItem; }
Source:
<code>public static long[] encodeDateTime( int keyId, long epochSecond, long nanoOfSecond, String zoneId ) { int idBits = StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS; short zoneNumber = TimeZoneMapping.TIME_ZONE_STRING_TO_SHORT.get( zoneId ); long keyAndType = keyId | (((long) (PropertyType.TEMPORAL.intValue()) << idBits)); long temporalTypeBits = TemporalType.TEMPORAL_DATE_TIME.temporalType << (idBits + 4); <START> long[] data = new long[3]; <END> data[0] = keyAndType | temporalTypeBits | (nanoOfSecond << 33); data[1] = epochSecond; data[2] = zoneNumber; return data; }</code><technical_language>this 3 relation in calculateNumberOfBlocksUsedForTemporal? If so, if not, introducing constants is a good idea aids readers of this code</technical_language>

Target:
public static long[] encodeDateTime( int keyId, long epochSecond, long nanoOfSecond, String zoneId ) { int idBits = StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS; short zoneNumber = TimeZoneMapping.map( zoneId ); long keyAndType = keyId | (((long) (PropertyType.TEMPORAL.intValue()) << idBits)); long temporalTypeBits = TemporalType.TEMPORAL_DATE_TIME.temporalType << (idBits + 4); long[] data = new long[BLOCKS_DATETIME]; data[0] = keyAndType | temporalTypeBits | (nanoOfSecond << 33); data[1] = epochSecond; data[2] = zoneNumber; return data; }
Source:
<code>public void addLostEvents(TmfTimeRange tr, int lostEvents) { if (tr.getStartTime().getValue() < 0 || tr.getEndTime().getValue() < 0) { return; } final Pair<Integer, TmfTimeRange> infos = new Pair<Integer, TmfTimeRange>(lostEvents, tr); <START> final Pair<Integer, Integer> pair = new Pair<Integer, Integer>(0, 0); <END> lostEventsRangeBars.add(pair); lostEventInfos.add(infos); setMaxAggregateValue(lostEvents); }</code><technical_language>is a potentially unlimited number of lost event pairs. data model limited bucket size</technical_language>

Target:
public void addLostEvents(TmfTimeRange tr, int lostEvents) { if (tr.getStartTime().getValue() < 0 || tr.getEndTime().getValue() < 0) { return; } boolean found = false; for (int i = 0; i < lostEventInfos.size() && found == true; i++) { Pair<Integer, TmfTimeRange> info = lostEventInfos.get(i); if (isFullyOverlapped(info.getSecond(), tr)) { long start = Math.min(tr.getStartTime().getValue(), info.getSecond().getStartTime().getValue()); long end = Math.max(tr.getEndTime().getValue(), info.getSecond().getEndTime().getValue()); TmfTimeRange timeRange = new TmfTimeRange( new TmfTimestamp(start, ITmfTimestamp.NANOSECOND_SCALE), new TmfTimestamp(end, ITmfTimestamp.NANOSECOND_SCALE)); int nbLostEvents = lostEvents + info.getFirst(); info = new Pair<Integer, TmfTimeRange>(nbLostEvents, timeRange); found = true; } } if (!found) { final Pair<Integer, TmfTimeRange> infos = new Pair<Integer, TmfTimeRange>(lostEvents, tr); lostEventInfos.add(infos); } }
Source:
<code>public void testSensorDefinition() { <START> org.fest.assertions.Assertions.assertThat(sensor.toString()).isEqualTo("JaCoCoOverallSensor"); <END> }</code><technical_language>assertThat is part of static import. need fully qualified name (line 40)</technical_language>

Target:
public void testSensorDefinition() { assertThat(sensor.toString()).isEqualTo("JaCoCoOverallSensor"); }
Source:
<code>public List<WebElement> getHeadings() { <START> return getWrappedElement().findElements(By.cssSelector("th")); <END> }</code><technical_language>in separate PR i</technical_language>

Target:
public List<WebElement> getHeadings() { return getWrappedElement().findElements(By.xpath(". }
Source:
<code>public DataTransactionResult offerToStore(ValueContainer<?> container, E value) { for (ValueProcessor<E, V> processor : this.processors) { if (processor.supports(container)) { final DataTransactionResult result = processor.offerToStore(container, value); if (!result.getType().equals(DataTransactionResult.Type.FAILURE)) { return result; } } } for (ValueProcessor<E, V> processor : this.processors) { if (processor.supports(container)) { final Optional<V> currentValueOptional = processor.getApiValueFromContainer(container); if (currentValueOptional.isPresent()) { V currentValue = currentValueOptional.get(); <START> Value<E> rejectedValue; <END> if (currentValue instanceof Value<?>) { rejectedValue = (Value<E>) currentValue; } else { rejectedValue = ((ImmutableValue<E>) currentValue).asMutable(); } rejectedValue.set(value); return DataTransactionResult.failResult(rejectedValue.asImmutable()); } } } return DataTransactionResult.failNoData(); }</code><technical_language>Leaving argument of getApiValueFromContainer returning for moment, if this way, this ImmutableValue. If ImmutableValue, converted a ImmutableValue for reason. Minimise conversions please</technical_language>

Target:
public DataTransactionResult offerToStore(ValueContainer<?> container, E value) { for (ValueProcessor<E, V> processor : this.processors) { if (processor.supports(container)) { final DataTransactionResult result = processor.offerToStore(container, value); if (!result.getType().equals(DataTransactionResult.Type.FAILURE)) { return result; } } } for (ValueProcessor<E, V> processor : this.processors) { if (processor.supports(container)) { final Optional<V> currentValueOptional = processor.getApiValueFromContainer(container); if (currentValueOptional.isPresent()) { V currentValue = currentValueOptional.get(); ImmutableValue<?> rejectedValue; if (currentValue instanceof Value<?>) { Value<E> mutableCurrentValue = (Value<E>) currentValue; mutableCurrentValue.set(value); rejectedValue = mutableCurrentValue.asImmutable(); } else { ImmutableValue<E> immutableCurrentValue = (ImmutableValue<E>) currentValue; rejectedValue = immutableCurrentValue.with(value); } return DataTransactionResult.failResult(rejectedValue); } } } return DataTransactionResult.failNoData(); }
Source:
<code>private static String fixedCodeBlocks(final String txt) { return txt <START> .replace("<code>`\r\n", MarkdownTxtmark.PRE_CODE) <END> .replace("<code>`\n", MarkdownTxtmark.PRE_CODE) .replace("<code>`", MarkdownTxtmark.PRE_CODE) .replace("\r\n</code>`", MarkdownTxtmark.END_CODE_PRE) .replace("\n</code>`", MarkdownTxtmark.END_CODE_PRE) .replace("</code>`", MarkdownTxtmark.END_CODE_PRE); }</code><technical_language>@danff a regexp match 3 cases for pre code, another for end code pre</technical_language>

Target:
private static String fixedCodeBlocks(final String txt) { return MarkdownTxtmark.CODE_BLOCK_END.matcher( MarkdownTxtmark.CODE_BLOCK_START .matcher(txt) .replaceAll("<pre><code>") ).replaceAll("</code></pre>"); }
Source:
<code>public void validateInputTask(T task) { <START> task.setJobStartTime(OffsetDateTime.now()); <END> }</code><technical_language>for compatibility issues, system time zone more dangerous. for use-case (as treasure-data ... this plugin is github.com/treasure-data/), I set default ZoneOffset.UTC. : * Check system time zone in beginning of transaction. If is UTC, dump a warn log default time zone changed. * Explain change in README and/or CHANGELOG explicitly. * set based UTC (or configurable)</technical_language>

Target:
public void validateInputTask(T task) { task.setJobStartTime(OffsetDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)); }
Source:
<code>private Set<AccountGroup.Id> getIncludedGroups(Set<AccountGroup.Id> seedGroups) { Set<AccountGroup.Id> includedGroups = new HashSet<AccountGroup.Id> (seedGroups); Queue<AccountGroup.Id> groupQueue = new LinkedList<AccountGroup.Id> (seedGroups); while (groupQueue.size() > 0) { AccountGroup.Id id = groupQueue.remove(); for (final AccountGroup.Id groupId : includedGroupCache.getByIncludedGroup(id)) { if (!includedGroups.contains(groupId)) { includedGroups.add(groupId); groupQueue.add(groupId); } } } <START> return includedGroups; <END> }</code><technical_language>I this needs wrapped in Collections.unmodifiableSet()</technical_language>

Target:
private Set<AccountGroup.Id> getIncludedGroups(Set<AccountGroup.Id> seedGroups) { Set<AccountGroup.Id> includedGroups = new HashSet<AccountGroup.Id> (seedGroups); Queue<AccountGroup.Id> groupQueue = new LinkedList<AccountGroup.Id> (seedGroups); while (groupQueue.size() > 0) { AccountGroup.Id id = groupQueue.remove(); for (final AccountGroup.Id groupId : includedGroupCache.getByIncludedGroup(id)) { if (includedGroups.add(groupId)) { groupQueue.add(groupId); } } } return Collections.unmodifiableSet(includedGroups); }
Source:
<code>public void close() { <START> executorService.shutdown(); <END> }</code><technical_language>Is shutdownNow more (which interrupt running tasks)</technical_language>

Target:
public void close() { executorService.shutdownNow(); }