auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private IProject getOrCreateProject(String name, Connection connection) { IProject project = OpenShiftResourceUtils.getProject(name, connection); if (project == null) { LOGGER.debug(NLS.bind("Project {0} doesnt exist yet in {1}, creating it.", name, connection.getHost())); <START> project = createProject(projectSpec, connection); <END> } return project; }</code><technical_language>This is OK. If default values ( = usage of requirement values in requirement annotation) project name exists, in if line 95 continue condition line 97 fails (com.openshift.restclient.OpenShiftException: Exception POST <LINK_1> response code: 422 ProjectRequest "" is invalid: metadata.name: Required value: name generateName is required). This is projectSpec is values in create project assumed is for project name</technical_language>

Target:
private IProject getOrCreateProject(String name, Connection connection) { IProject project = OpenShiftResourceUtils.getProject(name, connection); if (project == null) { LOGGER.debug(NLS.bind("Project {0} doesnt exist yet in {1}, creating it.", name, connection.getHost())); project = createProject(name, projectSpec, connection); new WaitUntil(new OpenShiftProjectExists(name, connection)); } return project; }
Source:
<code>public void run() { try { Throwable t = createThrowable(); ExceptionUtil.<Error>sneakyThrow(t); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { <START> ExceptionUtil.<Error>sneakyThrow(e); <END> } }</code><technical_language>Consider creating Exception dumpapp thread sneakyThrowing here. strange errors visible command. Also, state of class Exception more explicit parameterless getDeclaredConstructor() a fallback intentionally leaks NoSuchMethodException</technical_language>

Target:
public void run() { ExceptionUtil.<Error>sneakyThrow(mThrowable); }
Source:
<code>public void deleteResultsCollection(Collection<AsyncQuery> asyncQueryList) { log.debug("deleteResultsCollection"); Collection<AsyncQueryResultStorage> asyncQueryResultStorage = null; try { asyncQueryResultStorage = (Collection<AsyncQueryResultStorage>) DBUtil.executeInTransaction(elide, dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQueryResultStorage.class) .build(); Iterator<AsyncQuery> itr = asyncQueryList.iterator(); Object loaded = null; while (itr.hasNext()) { AsyncQuery query = itr.next(); loaded = tx.loadObject(asyncQueryCollection, query.getId(), scope); <START> Object result = loaded; <END> if (result != null) { tx.delete(result, scope); } } return loaded; }); } catch (Exception e) { log.error("Exception: {}", e); } }</code><technical_language>check if loaded != null in next line</technical_language>

Target:
public void deleteResultsCollection(Collection<AsyncQuery> asyncQueryList) { log.debug("deleteAsyncQueryResultsCollection"); }
Source:
<code><START> public Seq<Tuple2<TopicPartition, FetchResponse.PartitionData<Records>>> fetchFromLeader(FetchRequest.Builder fetchRequest) { <END> return JavaConverters.asScalaIteratorConverter(new ArrayList<Tuple2<TopicPartition, FetchResponse.PartitionData<Records>>>().iterator()).asScala().toSeq(); }</code><technical_language>do need return type Seq, a Map? do need rely keyset ordering in remaining handling logic</technical_language>

Target:
public Map<TopicPartition, FetchResponse.PartitionData<Records>> fetchFromLeader(FetchRequest.Builder fetchRequest) { return new scala.collection.mutable.HashMap<>(); }
Source:
<code>public List<Object> getArticles(HomeController context, SectionSpec section, Site site, int start) throws IOException { Map<?, ?> result = context.solrSearchService.getHomePageArticles( <START> Collections.singletonList(site.getJournalKey()), start, section.resultCount, <END> SolrSearchService.SolrSortOrder.DATE_NEWEST_FIRST); return sanitizeSolrResults(result); }</code><technical_language>Instead of altering method signatures, more readable if overloaded method signature accepts a singular site</technical_language>

Target:
public List<Object> getArticles(HomeController context, SectionSpec section, Site site, int start) throws IOException { Map<?, ?> result = context.solrSearchService.getHomePageArticles(site.getJournalKey(), start, section.resultCount, SolrSearchService.SolrSortOrder.DATE_NEWEST_FIRST); return sanitizeSolrResults(result); }
Source:
<code>private void updateWithParameters(ClusterConfig clusterConfig) { clusterConfig.setExposePorts(isExposedHostPorts()); clusterConfig.setTimeout(getTimeout()); ZooKeeperConfig zooKeeperConfig = (clusterConfig.getZookeeper() != null) ? clusterConfig.getZookeeper() : new ZooKeeperConfig(); zooKeeperConfig.setImageTag(getZooKeeperImageTag()); clusterConfig.setZookeeper(zooKeeperConfig); MesosMasterConfig masterConfig = (clusterConfig.getMaster() != null) ? clusterConfig.getMaster() : new MesosMasterConfig(); masterConfig.setImageTag(getMesosImageTag()); <START> masterConfig.setLoggingLevel(clusterConfig.getLoggingLevel()); <END> clusterConfig.setMaster(masterConfig); MarathonConfig marathonConfig = (clusterConfig.getMarathon() != null) ? clusterConfig.getMarathon() : new MarathonConfig(); marathonConfig.setImageTag(getMarathonImageTag()); clusterConfig.setMarathon(marathonConfig); List<MesosAgentConfig> agentConfigs = clusterConfig.getAgents(); List<MesosAgentConfig> updatedConfigs = new ArrayList<>(); for (int i = 0; i < getNumAgents(); i++) { MesosAgentConfig agentConfig = (agentConfigs.size() > i) ? agentConfigs.get(i) : new MesosAgentConfig(); agentConfig.setImageTag(getMesosImageTag()); agentConfig.setLoggingLevel(clusterConfig.getLoggingLevel()); updatedConfigs.add(agentConfig); } clusterConfig.setAgents(updatedConfigs); ConsulConfig consulConfig = clusterConfig.getConsul(); if (consulConfig == null && getStartConsul()) { consulConfig = new ConsulConfig(); } clusterConfig.setConsul(consulConfig); }</code><technical_language>I this is wrong: changes in MesosContainerConfig users logging level container level. this code overwrite default level cluster. This work "number of agents" - if container level cluster</technical_language>

Target:
private void updateWithParameters(ClusterConfig clusterConfig) { clusterConfig.setExposePorts(isExposedHostPorts()); clusterConfig.setTimeout(getTimeout()); ZooKeeperConfig zooKeeperConfig = (clusterConfig.getZookeeper() != null) ? clusterConfig.getZookeeper() : new ZooKeeperConfig(); zooKeeperConfig.setImageTag(getZooKeeperImageTag()); clusterConfig.setZookeeper(zooKeeperConfig); MesosMasterConfig masterConfig = (clusterConfig.getMaster() != null) ? clusterConfig.getMaster() : new MesosMasterConfig(); masterConfig.setImageTag(getMesosImageTag()); clusterConfig.setMaster(masterConfig); MarathonConfig marathonConfig = (clusterConfig.getMarathon() != null) ? clusterConfig.getMarathon() : new MarathonConfig(); marathonConfig.setImageTag(getMarathonImageTag()); clusterConfig.setMarathon(marathonConfig); List<MesosAgentConfig> agentConfigs = clusterConfig.getAgents(); List<MesosAgentConfig> updatedConfigs = new ArrayList<>(); for (int i = 0; i < getNumAgents(); i++) { MesosAgentConfig agentConfig = (agentConfigs.size() > i) ? agentConfigs.get(i) : new MesosAgentConfig(); agentConfig.setImageTag(getMesosImageTag()); updatedConfigs.add(agentConfig); } clusterConfig.setAgents(updatedConfigs); ConsulConfig consulConfig = clusterConfig.getConsul(); if (consulConfig == null && getStartConsul()) { consulConfig = new ConsulConfig(); } clusterConfig.setConsul(consulConfig); }
Source:
<code>void setApiVersion(final String apiVersion) { <START> getEventList().add(new Pair<>(EventStrings.HTTP_API_VERSION, apiVersion)); <END> }</code><technical_language>HTTP_API_VERSION [](start = 51, length = 16) http_api_version mean? :) #Pending</technical_language>

Target:
void setApiVersion(final String apiVersion) { setEvent(EventStrings.HTTP_API_VERSION, apiVersion); }
Source:
<code>public List<?> parseFields(String data) throws ParseException { <START> return Lists.newArrayList(PARSER_OUTPUT.keySet()); <END> }</code><technical_language>parseFields return values instead of keys</technical_language>

Target:
public List<?> parseFields(String data) throws ParseException { return Lists.newArrayList(PARSER_OUTPUT.values()); }
Source:
<code>public static NIC map(VmNetworkInterface entity, NIC template) { NIC model = template != null ? template : new NIC(); if (entity.getVmId() != null) { model.setVm(new VM()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new MAC()); model.getMac().setAddress(entity.getMacAddress()); } if (entity.getNetworkName() != null) { model.setNetwork(new Network()); model.getNetwork().setName(entity.getNetworkName()); } if (entity.isPortMirroring()) { PortMirroring portMirroring = new PortMirroring(); Networks networks = new Networks(); Network net = new Network(); <START> net.setName(entity.getNetworkName()); <END> portMirroring.setNetworks(networks); portMirroring.getNetworks().getNetworks().add(net); model.setPortMirroring(portMirroring); } model.setInterface(map(entity.getType())); model.setActive(entity.isActive()); return model; }</code><technical_language>set network_name instead of id ...</technical_language>

Target:
public static NIC map(VmNetworkInterface entity, NIC template) { NIC model = template != null ? template : new NIC(); if (entity.getVmId() != null) { model.setVm(new VM()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new MAC()); model.getMac().setAddress(entity.getMacAddress()); } if (entity.getNetworkName() != null) { model.setNetwork(new Network()); model.getNetwork().setName(entity.getNetworkName()); } if (entity.isPortMirroring()) { PortMirroring portMirroring = new PortMirroring(); Networks networks = new Networks(); Network net = new Network(); portMirroring.setNetworks(networks); portMirroring.getNetworks().getNetworks().add(net); model.setPortMirroring(portMirroring); } model.setInterface(map(entity.getType())); model.setActive(entity.isActive()); return model; }
Source:
<code>private Component createDefaultAnnotationLayerSelector() { IModel<List<? extends AnnotationLayer>> annotationLayerIModel = new IModel <List<? extends AnnotationLayer>>() { List<? extends AnnotationLayer> annotationLayers; @Override public List<? extends AnnotationLayer> getObject() { return annotationLayers; } @Override public void setObject(List<? extends AnnotationLayer> annotationLayers) { this.annotationLayers = annotationLayers; } @Override public void detach() <START> { <END> } }; annotationLayerIModel.setObject(annotationLayers); return new AnnotationFeatureForm.LayerSelector("defaultAnnotationLayer", annotationLayerIModel); }</code><technical_language>I do here</technical_language>

Target:
private LayerSelector createDefaultAnnotationLayerSelector() { return new LayerSelector("defaultAnnotationLayer", new PropertyModel<>(this, "annotationLayers")); }
Source:
<code>public StreamMessage(String event, String id, String data) { this.event = event; this.id = id; this.data = data; <START> if (isKind(Kind.CONTROL)) { <END> kind = Kind.CONTROL; } else if (isKind(Kind.INFORMATION)) { kind = Kind.INFORMATION; } else if (isKind(Kind.METADATA)) { kind = Kind.METADATA; } else if (isKind(Kind.DATA)) { kind = Kind.DATA; } else if (isKind(Kind.EVENT)) { kind = Kind.EVENT; } else if (isKind(Kind.ERROR)) { kind = Kind.ERROR; } else { kind = Kind.INFORMATION; } }</code><technical_language>happened Kind.valueOf(event)</technical_language>

Target:
public StreamMessage(String event, String id, String data) { this.event = event; this.id = id; this.data = data; try { this.kind = Kind.fromSpecName(event); } catch (IllegalArgumentException ex) { kind = Kind.INFORMATION; } }
Source:
<code>public boolean dispatchKeyEvent(KeyEvent event) { <START> if (event.getAction() == KeyEvent.ACTION_UP) { <END> int code = event.getKeyCode(); if(code == disableTouchKeyCode && (disableTouch || disableTouchOptionEnabled)) { disableTouch = !disableTouch; settings.setDisableTouchLastState(disableTouch); Log.d(TAG, "toggling touch screen, now disableTouch is " + disableTouch); showDisableTouchToast(); return true; } switch (code) { case KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_PAGE_DOWN: scroll(code == KeyEvent.KEYCODE_PAGE_UP, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: if (volumeButtonsScrolling) { scroll(code == KeyEvent.KEYCODE_VOLUME_UP, screenScrollingPercent, smoothScrolling); return true; } break; } } return super.dispatchKeyEvent(event); }</code><technical_language>Partially breaks scrolling volume buttons: ACTION_DOWN event is consumed app</technical_language>

Target:
public boolean dispatchKeyEvent(KeyEvent event) { int code = event.getKeyCode(); boolean triggerAction; if (code == KeyEvent.KEYCODE_PAGE_UP || code == KeyEvent.KEYCODE_PAGE_DOWN) { triggerAction = (event.getAction() == KeyEvent.ACTION_UP); } else { triggerAction = (event.getAction() == KeyEvent.ACTION_DOWN); } if (triggerAction) { if(code == disableTouchKeyCode && (disableTouch || disableTouchOptionEnabled)) { disableTouch = !disableTouch; settings.setDisableTouchLastState(disableTouch); Log.d(TAG, "toggling touch screen, now disableTouch is " + disableTouch); showDisableTouchToast(); return true; } switch (code) { case KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_PAGE_DOWN: scroll(code == KeyEvent.KEYCODE_PAGE_UP, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: if (volumeButtonsScrolling) { scroll(code == KeyEvent.KEYCODE_VOLUME_UP, screenScrollingPercent, smoothScrolling); return true; } break; } } return super.dispatchKeyEvent(event); }
Source:
<code>public ContainerDTO getContainer() { <START> return container.get(); <END> }</code><technical_language>add this (also below)</technical_language>

Target:
public ContainerDTO getContainer() { return this.container.get(); }
Source:
<code><START> public void testGetDepth() { try { attributeNode.getDepth(); fail("Exception is excepted"); } catch (UnsupportedOperationException ex) { <END> assertWithMessage("Invalid exception message") .that(ex) .hasMessageThat() .isEqualTo("Operation is not supported"); } }</code><technical_language>need approach for exception validation is for <LINK_0> usage is Rule is good, junit5 approach interesting creates nesting blocks. @strkkk , @rnveach , @nmancus1 , is more preferable of exception validation for you</technical_language>

Target:
public void testGetDepth() { final UnsupportedOperationException exception = assertThrows(UnsupportedOperationException.class, () -> { attributeNode.getDepth(); }); assertWithMessage("Invalid exception message") .that(exception) .hasMessageThat() .isEqualTo("Operation is not supported"); }
Source:
<code>public GanttCategoryDataset createDebugEventGanttChartDataset() { splitEventsIntoAListPerType(); <START> final TaskSeries allTasks = new TaskSeries("Debug Events"); <END> allTasks.add( createTaskForEventsWithName(bpAddEvents, "Breakpoint Added")); allTasks.add(createTaskForEventsWithName(bpChangeEvents, "Breakpoint Changed")); allTasks.add(createTaskForEventsWithName(bpRemoveEvents, "Breakpoint Removed")); allTasks.add(createTaskForEventsWithName(suspendBpEvents, "Suspended (breakpoint)")); allTasks.add(createTaskForEventsWithName(suspendClientEvents, "Suspended (client)")); allTasks.add(createTaskForEventsWithName(stepOutEvents, "Stepped Out")); allTasks.add( createTaskForEventsWithName(stepIntoEvents, "Stepped Into")); allTasks.add( createTaskForEventsWithName(stepOverEvents, "Stepped Over")); allTasks.add(createTaskForEventsWithName(resumeClientEvents, "Resumed (client)")); allTasks.add(createTaskForEventsWithName(inspectEvents, "Inspected Variable")); allTasks.add(createTaskForEventsWithName(defineWatchEvents, "Defined Watch")); allTasks.add(createTaskForEventsWithName(evalExpressionEvents, "Evaluated Expression")); allTasks.add(createTaskForEventsWithName(modVarValueEvents, "Modified Variable Value")); final TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(allTasks); return collection; }</code><technical_language>final variable? :-)</technical_language>

Target:
public GanttCategoryDataset createDebugEventGanttChartDataset() { splitEventsIntoAListPerType(); TaskSeries allTasks = new TaskSeries("Debug Events"); allTasks.add( createTaskForEventsWithName(bpAddEvents, "Breakpoint Added")); allTasks.add(createTaskForEventsWithName(bpChangeEvents, "Breakpoint Changed")); allTasks.add(createTaskForEventsWithName(bpRemoveEvents, "Breakpoint Removed")); allTasks.add(createTaskForEventsWithName(suspendBpEvents, "Suspended (breakpoint)")); allTasks.add(createTaskForEventsWithName(suspendClientEvents, "Suspended (client)")); allTasks.add(createTaskForEventsWithName(stepOutEvents, "Stepped Out")); allTasks.add( createTaskForEventsWithName(stepIntoEvents, "Stepped Into")); allTasks.add( createTaskForEventsWithName(stepOverEvents, "Stepped Over")); allTasks.add(createTaskForEventsWithName(resumeClientEvents, "Resumed (client)")); allTasks.add(createTaskForEventsWithName(inspectEvents, "Inspected Variable")); allTasks.add(createTaskForEventsWithName(defineWatchEvents, "Defined Watch")); allTasks.add(createTaskForEventsWithName(evalExpressionEvents, "Evaluated Expression")); allTasks.add(createTaskForEventsWithName(modVarValueEvents, "Modified Variable Value")); TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(allTasks); return collection; }
Source:
<code>private Credential authorizeAndCreateCredentials() throws IOException { GoogleClientSecrets clientSecrets = loadClientSecretFromJson(); <START> GoogleAuthorizationCodeFlow flow = buildFlow(clientSecrets); <END> if (useFreshCredentials) { flow.getCredentialDataStore().clear(); } if (flow.getCredentialDataStore().isEmpty()) { System.out.println("Please login as: " + username); } return getCredentialFromFlow(flow); }</code><technical_language>catch FileNotFoundException client_secret.json exist print informative message (something refer Gmail API setup instructions in development.md)</technical_language>

Target:
private Credential authorizeAndCreateCredentials() throws IOException { GoogleClientSecrets clientSecrets = loadClientSecretFromJson(); GoogleAuthorizationCodeFlow flow = buildFlow(clientSecrets); if (shouldUseFreshCredentials) { flow.getCredentialDataStore().delete(username); } if (flow.getCredentialDataStore().get(username) == null) { System.out.println("Please login as: " + username); } return getCredentialFromFlow(flow); }
Source:
<code>@Override public AffinityTopologyVersion topologyVersion() { assert exchangeDone() : "Should not be called before exchange is finished"; if (isDone()) return result(); <START> ExchangeContext exchCtx0 = state == ExchangeLocalState.MERGED ? mergedWith.exchCtx : exchCtx; <END> return exchCtx0.events().topologyVersion(); }</code><technical_language>state read done in a synchronized section</technical_language>

Target:
@Override public AffinityTopologyVersion topologyVersion() { assert exchangeDone() : "Should not be called before exchange is finished"; if (isDone()) return result(); final ExchangeContext exchCtx0; synchronized (mux) { if (state == ExchangeLocalState.MERGED) { assert mergedWith != null; exchCtx0 = mergedWith.exchCtx; } else exchCtx0 = exchCtx; } return exchCtx0.events().topologyVersion(); }
Source:
<code>public boolean isNegotiationAuth() { return context.get(ExtensionProperties.AAA_IS_NEGOTIATION_AUTH) != null ? (Boolean) context.get(ExtensionProperties.AAA_IS_NEGOTIATION_AUTH) <START> : false; <END> }</code><technical_language>in java thoughts of get default</technical_language>

Target:
public boolean isNegotiationAuth() { return context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES) != null ? (Extension.AAAFlags.AAA_NEGOTIATION_AUTH_FLAG & (int) context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES)) == Extension.AAAFlags.AAA_NEGOTIATION_AUTH_FLAG : false; }
Source:
<code>public void initiateCall(String configName, Map<String, String> parameters) { LOGGER.debug("initiateCall(configName = {}, params = {})", configName, parameters); Map<String, String> params = new HashMap<>(parameters); if (!configService.hasConfig(configName)) { String msg = String.format("Invalid config: '%s'", configName); statusMessageService.warn(msg, MODULE_NAME); throw new CallInitiationException(msg); } Config config = configService.getConfig(configName); String motechCallId = UUID.randomUUID().toString(); Map<String, String> completeParams = new HashMap<>(params); completeParams.put("motechCallId", motechCallId); try { String protocol = new URL(config.getOutgoingCallUriTemplate()).getProtocol(); switch (protocol) { case FILE_PROTOCOL: { generateCallFile(config, params, completeParams, motechCallId); break; } case HTTP_PROTOCOL: { generateCallHttp(config, params, completeParams, motechCallId); break; } } <START> } catch (CallInitiationException e) { <END> throw e; } catch (Exception e) { String message = String.format("Could not initiate call, unexpected exception: %s", e.toString()); statusMessageService.warn(message, MODULE_NAME); params.put("ErrorMessage", message); addCallDetailRecord(CallDetailRecord.CALL_FAILED, config, params, motechCallId); throw new CallInitiationException(message, e); } }</code><technical_language>do this catch</technical_language>

Target:
public void initiateCall(String configName, Map<String, String> parameters) { LOGGER.debug("initiateCall(configName = {}, params = {})", configName, parameters); Map<String, String> params = new HashMap<>(parameters); if (!configService.hasConfig(configName)) { String msg = String.format("Invalid config: '%s'", configName); statusMessageService.warn(msg, MODULE_NAME); throw new CallInitiationException(msg); } Config config = configService.getConfig(configName); String motechCallId = UUID.randomUUID().toString(); Map<String, String> completeParams = new HashMap<>(params); completeParams.put("motechCallId", motechCallId); String protocol; try { protocol = new URL(config.getOutgoingCallUriTemplate()).getProtocol(); } catch (MalformedURLException e) { String msg = String.format("Invalid URI template: '%s'", config.getOutgoingCallUriTemplate()); statusMessageService.warn(msg, MODULE_NAME); throw new CallInitiationException(msg, e); } switch (protocol) { case FILE_PROTOCOL: { generateCallFile(config, params, completeParams, motechCallId); break; } case HTTP_PROTOCOL: { executeHttpCall(config, params, completeParams, motechCallId); break; } } }
Source:
<code>protected List<ActionRequest> createRequests(final Transfer<Asn> transfer, final Optional<RpslObject> precedingAsBlock, final AsBlockRange originalAsBlockRange, final Optional<RpslObject> followingAsBlock) { final List<ActionRequest> requests = Lists.newArrayList(); final String blockTemplate; if (transfer.isIncoming()) { blockTemplate = RIPE_AS_BLOCK_TEMPLATE; } else { blockTemplate = NON_RIPE_AS_BLOCK_TEMPLATE; } final long begin, end; begin = end = transfer.getResource().asBigInteger().longValue(); final RpslObject newAsBlock = createAsBlock(begin, end, blockTemplate); <START> requests.add(new ActionRequest(newAsBlock, Action.CREATE)); <END> return requests; }</code><technical_language>Collections.singletonList</technical_language>

Target:
protected List<ActionRequest> createRequests(final Transfer<Asn> transfer, final Optional<RpslObject> precedingAsBlock, final AsBlockRange originalAsBlockRange, final Optional<RpslObject> followingAsBlock) { final String blockTemplate; if (transfer.isIncoming()) { blockTemplate = RIPE_AS_BLOCK_TEMPLATE; } else { blockTemplate = NON_RIPE_AS_BLOCK_TEMPLATE; } final long asn = transfer.getResource().asBigInteger().longValue(); final RpslObject newAsBlock = createAsBlock(asn, asn, blockTemplate); return Collections.singletonList(new ActionRequest(newAsBlock, Action.CREATE)); }
Source:
<code>public void partClosed(IWorkbenchPartReference partRef) { IWorkbenchPart part = partRef.getPart(false); if (part instanceof MultiPageEditorPart) { MultiPageEditorPart mulitPageEditorPart = (MultiPageEditorPart) part; if (activePart instanceof IEditorPart) { IEditorPart[] editorsForActivePart = mulitPageEditorPart .findEditors(((IEditorPart) activePart).getEditorInput()); if (editorsForActivePart != null && editorsForActivePart.length > 0) { clearActivePart(); } } } if (activePart != null && part == activePart) { <START> clearActivePart(); <END> } }</code><technical_language>In case of Multipage editor this called twice. Is this intended</technical_language>

Target:
public void partClosed(IWorkbenchPartReference partRef) { IWorkbenchPart part = partRef.getPart(false); if (part instanceof MultiPageEditorPart && activePart instanceof IEditorPart) { MultiPageEditorPart mulitPageEditorPart = (MultiPageEditorPart) part; IEditorPart[] editorsForActivePart = mulitPageEditorPart .findEditors(((IEditorPart) activePart).getEditorInput()); if (editorsForActivePart != null && editorsForActivePart.length > 0) { clearActivePart(); return; } } if (activePart != null && part == activePart) { clearActivePart(); } }
Source:
<code>private CompletionStage<RestResponse> getAllCachesConfigurationTemplates(RestRequest request) { NettyRestResponse.Builder responseBuilder = checkCacheManager(request); if (responseBuilder.getHttpStatus() == NOT_FOUND) return completedFuture(responseBuilder.build()); try { Set<String> cacheConfigurationNames = Security.doAs(request.getSubject(), (PrivilegedAction<Set<String>>) <START> () -> cacheManager.getCacheConfigurationNames()); <END> List<NamedCacheConfiguration> configurations = cacheConfigurationNames.stream() .filter(n -> !internalCacheRegistry.isInternalCache(n)) .filter(n -> { Configuration cacheConfiguration = Security.doAs(request.getSubject(), (PrivilegedAction<Configuration>) () -> cacheManager.getCacheConfiguration(n)); return cacheConfiguration.isTemplate(); }) .distinct() .map(n -> { Configuration cacheConfiguration = Security.doAs(request.getSubject(), (PrivilegedAction<Configuration>) () -> cacheManager.getCacheConfiguration(n)); String json = jsonWriter.toJSON(cacheConfiguration); return new NamedCacheConfiguration(n, json); }) .sorted(Comparator.comparing(c -> c.name)) .collect(Collectors.toList()); byte[] bytes = objectMapper.writeValueAsBytes(configurations); responseBuilder.contentType(APPLICATION_JSON).entity(bytes); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return completedFuture(responseBuilder.build()); }</code><technical_language>suggestion cacheManager::getCacheConfigurationNames);</technical_language>

Target:
private CompletionStage<RestResponse> getAllCachesConfigurationTemplates(RestRequest request) { NettyRestResponse.Builder responseBuilder = checkCacheManager(request); if (responseBuilder.getHttpStatus() == NOT_FOUND) return completedFuture(responseBuilder.build()); EmbeddedCacheManager subjectCacheManager = cacheManager.withSubject(request.getSubject()); try { Set<String> cacheConfigurationNames = subjectCacheManager.getCacheConfigurationNames(); List<NamedCacheConfiguration> configurations = cacheConfigurationNames.stream() .filter(n -> !internalCacheRegistry.isInternalCache(n)) .filter(n -> SecurityActions.getCacheConfigurationFromManager(subjectCacheManager, n).isTemplate()) .distinct() .map(n -> { Configuration config = SecurityActions.getCacheConfigurationFromManager(subjectCacheManager, n); return new NamedCacheConfiguration(n, jsonWriter.toJSON(config)); }) .sorted(Comparator.comparing(c -> c.name)) .collect(Collectors.toList()); byte[] bytes = objectMapper.writeValueAsBytes(configurations); responseBuilder.contentType(APPLICATION_JSON).entity(bytes); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return completedFuture(responseBuilder.build()); }
Source:
<code>static void warnOrAssert(Logger logger, String message, Object... args) { if (ASSERT) { FormattingTuple detailMessage = MessageFormatter.arrayFormat(message, args); Throwable throwable = detailMessage.getThrowable(); throw throwable == null ? new AssertionError(detailMessage.getMessage()) : new AssertionError(detailMessage.getMessage(), throwable); } else { try { <START> LOGGER.invokeExact(logger, message, args); <END> } catch (Throwable throwable) { throw new AssertionError(); } } }</code><technical_language>ah, I get now, preparing for this invocation..</technical_language>

Target:
static void warnOrAssert(Logger logger, String message, Object... args) { if (ASSERT) { FormattingTuple detailMessage = MessageFormatter.arrayFormat(message, args); Throwable throwable = detailMessage.getThrowable(); throw throwable == null ? new AssertionError(detailMessage.getMessage()) : new AssertionError(detailMessage.getMessage(), throwable); } else { try { WARN.invokeExact(logger, message, args); } catch (Throwable throwable) { throw new AssertionError(); } } }
Source:
<code>@Test public void array() throws Exception { List<Object> root = new ArrayList<>(); root.add("s"); <START> root.add(1.5); <END> root.add(true); root.add(null); JsonReader reader = new ObjectJsonReader(root); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.BEGIN_ARRAY); reader.beginArray(); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.STRING); assertThat(reader.nextString()).isEqualTo("s"); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.NUMBER); assertThat(reader.nextDouble()).isEqualTo(1.5d); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.BOOLEAN); assertThat(reader.nextBoolean()).isEqualTo(true); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.NULL); assertThat(reader.nextNull()).isNull(); assertThat(reader.hasNext()).isFalse(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.END_ARRAY); reader.endArray(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.END_DOCUMENT); }</code><technical_language>nit: missing d. other tests</technical_language>

Target:
@Test public void array() throws Exception { List<Object> root = new ArrayList<>(); root.add("s"); root.add(1.5d); root.add(true); root.add(null); JsonReader reader = new ObjectJsonReader(root); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.BEGIN_ARRAY); reader.beginArray(); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.STRING); assertThat(reader.nextString()).isEqualTo("s"); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.NUMBER); assertThat(reader.nextDouble()).isEqualTo(1.5d); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.BOOLEAN); assertThat(reader.nextBoolean()).isEqualTo(true); assertThat(reader.hasNext()).isTrue(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.NULL); assertThat(reader.nextNull()).isNull(); assertThat(reader.hasNext()).isFalse(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.END_ARRAY); reader.endArray(); assertThat(reader.peek()).isEqualTo(JsonReader.Token.END_DOCUMENT); }
Source:
<code>public void printStuff() { System.out.println(); for (Map<Object, Integer> dim : dimensionMap.values()) { System.out.println("DIMENSION " + dim + "\n============"); <START> Map<Object, Integer> valueMap = dim; <END> List<Comparable> valList = new ArrayList<>(); for (Integer val : valueMap.values()) { valList.add((Comparable) val); } Collections.sort(valList); for (Comparable val : valList) { System.out.println(" VAL: " + val + " CNT: " + val); } System.out.println(); } }</code><technical_language>Unnecessary variable, iteration variable called valueMap itself</technical_language>

Target:
public void printStuff() { System.out.println(); dimensionMap.forEach((key, valueMap) -> new TreeMap<>(valueMap).forEach((val, cnt) -> System.out.println(" VAL: " + val + " CNT: " + cnt))); }
Source:
<code>public Optional<Response> handle(HandlerInput handlerInput, IntentRequest intentRequest) { try { JsonNode node = MAPPER.readTree(getWeatherData().getEntity().getContent()); final String temperature = node.path("main").path("temp").asText(); final String humidity = node.path("main").path("humidity").asText(); final String windSpeed = node.path("wind").path("speed").asText(); <START> final String speechOutput = String.format("Weather in %s is with temperature %s kelvin and %s percent humidity. Wind speed is about %s miles per hour", <END> SkillData.CITY_INFORMATION.getCity().getName(), temperature, humidity, windSpeed); return handlerInput.getResponseBuilder() .withSpeech(speechOutput) .build(); } catch (IOException ex) { throw new RuntimeException("Could not parse Weather data response", ex); } }</code><technical_language>I I temperature for purposes of a forecast expressed in kelvin</technical_language>

Target:
public Optional<Response> handle(HandlerInput handlerInput, IntentRequest intentRequest) { Map<String, String> requestParams = new HashMap<String, String>() { { put("id", CITY_ID); put("appid", API_KEY); } }; try (CloseableHttpResponse response = HttpUtils.doGet(requestParams, WEATHER_ENDPOINT)) { JsonNode node = MAPPER.readTree(response.getEntity().getContent()); final String temperature = String.valueOf(node.path("main").path("temp").doubleValue() - 273.15); final String humidity = node.path("main").path("humidity").asText(); final String windSpeed = node.path("wind").path("speed").asText(); final String speechOutput = String.format("Weather in %s is with temperature %s celsius and %s percent humidity. Wind speed is about %s miles per hour", SkillData.CITY_INFORMATION.getCity().getName(), temperature, humidity, windSpeed); return handlerInput.getResponseBuilder() .withSpeech(speechOutput) .build(); } catch (IOException ex) { throw new RuntimeException("Could not parse Weather data response", ex); } }
Source:
<code>public void testOrderByWithAggregation() { assertQuery("" + "SELECT x, sum(cast(x AS double))\n" + "FROM (VALUES '1.0') t(x)\n" + "GROUP BY x\n" + "ORDER BY sum(cast(t.x AS double))", "VALUES ('1.0', 1.0)"); Session legacyOrderBy = Session.builder(getSession()) .setSystemProperty(LEGACY_ORDER_BY, "true") .build(); <START> queryTemplate("select count(*) %output% from (select substr(name,1,1) letter from nation) x group by %groupBy% order by %orderBy%") <END> .replaceAll( parameter("output").of("", ", letter", ", letter as y"), parameter("groupBy").of("x.letter", "letter"), parameter("orderBy").of("x.letter", "letter")) .forEach(query -> { assertQueryOrdered(query); assertQueryOrdered(legacyOrderBy, query); }); }</code><technical_language>(i'm biased.. author of for-based code here)</technical_language>

Target:
public void testOrderByWithAggregation() { assertQuery("" + "SELECT x, sum(cast(x AS double))\n" + "FROM (VALUES '1.0') t(x)\n" + "GROUP BY x\n" + "ORDER BY sum(cast(t.x AS double))", "VALUES ('1.0', 1.0)"); Session legacyOrderBy = Session.builder(getSession()) .setSystemProperty(LEGACY_ORDER_BY, "true") .build(); queryTemplate("SELECT count(*) %output% FROM (SELECT substr(name,1,1) letter FROM nation) x GROUP BY %groupBy% ORDER BY %orderBy%") .replaceAll( parameter("output").of("", ", letter", ", letter AS y"), parameter("groupBy").of("x.letter", "letter"), parameter("orderBy").of("x.letter", "letter")) .forEach(query -> { assertQueryOrdered(query); assertQueryOrdered(legacyOrderBy, query); }); }
Source:
<code>public static Map<String, String> getCommonLabels(String clusterId) { Map<String, String> commonLabels = new HashMap<>(); commonLabels.put(Constants.LABEL_TYPE_KEY, Constants.LABEL_TYPE_NATIVE_TYPE); commonLabels.put(Constants.LABEL_APP_KEY, clusterId); <START> return Collections.unmodifiableMap(commonLabels); <END> }</code><technical_language>returning unmodifiable map? returned map is a new instance generated in this method. other reference for returned this method. Returning a modifiable map save converting a modifiable map in getTaskManagerLabels getConfigMapLabels</technical_language>

Target:
public static Map<String, String> getCommonLabels(String clusterId) { final Map<String, String> commonLabels = new HashMap<>(); commonLabels.put(Constants.LABEL_TYPE_KEY, Constants.LABEL_TYPE_NATIVE_TYPE); commonLabels.put(Constants.LABEL_APP_KEY, clusterId); return commonLabels; }
Source:
<code>public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) { _logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions); _kafkaPositionTracker.ifPresent(tracker -> tracker.onPartitionsRevoked(topicPartitions)); if (!_shutdown && !topicPartitions.isEmpty()) { try { maybeCommitOffsets(_consumer, true); } catch (Exception e) { _logger.warn("Caught exception while trying to commit offsets in onPartitionsRevoked with partitions {}.", topicPartitions, e); } } <START> Set<TopicPartition> newAssignment = new HashSet<>(_consumerAssignment); <END> newAssignment.removeAll(topicPartitions); updateConsumerAssignment(newAssignment); _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); }</code><technical_language>i context here. explain changing _consumer.assignment internal datastructure for assigment. Do scenarios _consumer.assignment is returning right partitions assigned consumer</technical_language>

Target:
public void onPartitionsRevoked(Collection<TopicPartition> topicPartitions) { _logger.info("Partition ownership revoked for {}, checkpointing.", topicPartitions); _kafkaPositionTracker.ifPresent(tracker -> tracker.onPartitionsRevoked(topicPartitions)); if (!_shutdown && !topicPartitions.isEmpty()) { try { maybeCommitOffsets(_consumer, true); } catch (Exception e) { _logger.warn("Caught exception while trying to commit offsets in onPartitionsRevoked with partitions {}.", topicPartitions, e); } } updateConsumerAssignment(_consumer.assignment()); _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); }
Source:
<code>public void write(Channel channel, NettyResponseFuture<?> future) throws IOException { final InputStream is = inputStream; if (future.isStreamConsumed()) { if (is.markSupported()) is.reset(); else { LOGGER.warn("Stream has already been consumed and cannot be reset"); return; } } else { future.setStreamConsumed(true); } channel.write(new ChunkedStream(is), channel.newProgressivePromise()).addListener( new WriteProgressListener(future, false, getContentLength()) { @Override public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(is); super.operationComplete(cf); } @Override protected boolean abortOnThrowable(Channel channel, Throwable cause) { if (cause instanceof IOException && StackTraceInspector.recoverOnChunkedUploadFailed(cause)) return false; <START> return super.abortOnThrowable(channel, cause); <END> } }); channel.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT, channel.voidPromise()); }</code><technical_language>merge single boolean op</technical_language>

Target:
public void write(Channel channel, NettyResponseFuture<?> future) throws IOException { final InputStream is = inputStream; if (future.isStreamConsumed()) { if (is.markSupported()) is.reset(); else { LOGGER.warn("Stream has already been consumed and cannot be reset"); return; } } else { future.setStreamConsumed(true); } channel.write(new ChunkedStream(is), channel.newProgressivePromise()).addListener( new WriteProgressListener(future, false, getContentLength()) { @Override public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(is); super.operationComplete(cf); } @Override protected boolean abortOnThrowable(Channel channel, Throwable cause) { return StackTraceInspector.recoverOnChunkedUploadFailed(cause) || super.abortOnThrowable(channel, cause); } }); channel.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT, channel.voidPromise()); }
Source:
<code>public PairSupplier<Q, E> create(Iterable<Q> queries, Iterable<E> endpoints) { <START> LinkedList<Pair<Q, E>> tempList = new LinkedList<>(); <END> Iterator<E> endpointIt = endpoints.iterator(); checkState(endpointIt.hasNext(), "Empty EndpointProvider"); if (queries == null) { while (endpointIt.hasNext()) { tempList.add(Pair.of(null, endpointIt.next())); } } else { Iterator<Q> queryIt = queries.iterator(); E currentEndpoint; Q currentQuery; while (endpointIt.hasNext() || queryIt.hasNext()) { if (!endpointIt.hasNext()) { endpointIt = endpoints.iterator(); } if (!queryIt.hasNext()) { queryIt = queries.iterator(); } currentEndpoint = endpointIt.next(); currentQuery = queryIt.next(); tempList.add(Pair.of(currentQuery, currentEndpoint)); } } return new PairSupplierImpl<>(ImmutableList.copyOf(tempList)); }</code><technical_language>replaced ArrayList</technical_language>

Target:
public PairSupplier<Q, E> create(Iterable<Q> queries, Iterable<E> endpoints) { ArrayList<Pair<Q, E>> tempList = new ArrayList<>(); Iterator<E> endpointIt = endpoints.iterator(); checkState(endpointIt.hasNext(), "Empty EndpointProvider"); if (queries == null) { while (endpointIt.hasNext()) { tempList.add(Pair.of(null, endpointIt.next())); } } else { Iterator<Q> queryIt = queries.iterator(); E currentEndpoint; Q currentQuery; while (endpointIt.hasNext() || queryIt.hasNext()) { if (!endpointIt.hasNext()) { endpointIt = endpoints.iterator(); } if (!queryIt.hasNext()) { queryIt = queries.iterator(); } currentEndpoint = endpointIt.next(); currentQuery = queryIt.next(); tempList.add(Pair.of(currentQuery, currentEndpoint)); } } return new PairSupplierImpl<>(ImmutableList.copyOf(tempList)); }
Source:
<code>private ExtensionScript getExtScript() { if (extScript == null) { extScript = (ExtensionScript) Control .getSingleton() .getExtensionLoader() <START> .getExtension(ExtensionScript.NAME); <END> } return extScript; }</code><technical_language>ExtensionScript.class, require casting (explicitly least)</technical_language>

Target:
private ExtensionScript getExtScript() { if (extScript == null) { extScript = Control .getSingleton() .getExtensionLoader() .getExtension(ExtensionScript.class); } return extScript; }
Source:
<code><START> private void saveProgramUrl(String programUrl) { <END> SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences( context); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(context.getResources().getString(R.string.program_configuration_url), programUrl); editor.commit(); }</code><technical_language>avoid duplicate code here? (PreferenceManager.getDefaultSharedPreferences)</technical_language>

Target:
private void saveProgramUrl(String programUrl) { savePreference(context, R.string.program_configuration_url, programUrl); }
Source:
<code>public Optional<Table> getTable(String databaseName, String tableName) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getTable", stats.getGetTable().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Table table = client.getTable(databaseName, tableName); if (table.getTableType().equals(TableType.VIRTUAL_VIEW.name()) && !isPrestoView(table)) { throw new HiveViewNotSupportedException(new SchemaTableName(databaseName, tableName)); } return Optional.of(table); } })); } catch (NoSuchObjectException e) { <START> return Optional.empty(); <END> } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }</code><technical_language>need move above</technical_language>

Target:
public Optional<Table> getTable(String databaseName, String tableName) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getTable", stats.getGetTable().wrap(() -> wrapMetastoreCallable((HiveMetastoreClient client, ThriftHiveMetastoreStats stat) -> stat.getGetTable().wrapCall(() -> { Table table = client.getTable(databaseName, tableName); if (table.getTableType().equals(TableType.VIRTUAL_VIEW.name()) && !isPrestoView(table)) { throw new HiveViewNotSupportedException(new SchemaTableName(databaseName, tableName)); } return Optional.of(table); })))); } catch (NoSuchObjectException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }
Source:
<code>public ScannerForMSBuild setUseDotNetCore(boolean useDotnetCore) { <START> if (useDotnetCore && scannerVersion != null) { <END> checkState(scannerVersion.isGreaterThanOrEquals(DOT_NET_CORE_INTRODUCTION_VERSION), "Version of ScannerForMSBuild should be higher than or equals to %s to be able to use .Net Core.", DOT_NET_CORE_INTRODUCTION_VERSION); } this.useDotnetCore = useDotnetCore; return this; }</code><technical_language>method setScannerVersion(String) called setUseDotNetCore(boolean). lead unexpected behavior (.net core enabled scanner). I suggest move check method named... check() :-)</technical_language>

Target:
public ScannerForMSBuild setUseDotNetCore(boolean useDotnetCore) { this.useDotnetCore = useDotnetCore; return this; }
Source:
<code>public Set<Product> getProductsByUuidCached(Set<String> productUuids) { if (productUuids.size() == 0) { return new HashSet<>(); } Set<Product> products = new HashSet<>(); Set<String> productsNotInCache = new HashSet<>(); for (String uuid :productUuids) { <START> if (currentSession().getSessionFactory().getCache().contains(this.entityType(), uuid)) { <END> products.add(currentSession().get(Product.class, uuid)); } else { productsNotInCache.add(uuid); } } if (productsNotInCache.size() > 0) { log.debug("Loading objects that were not already in the cache: " + productsNotInCache.size()); Session session = this.currentSession(); java.util.List entities = session.byMultipleIds(this.entityType()) .enableSessionCheck(true) .multiLoad(new ArrayList(productsNotInCache)); products.addAll(entities); } for (Product product : products) { product.getAttributes().size(); product.getDependentProductIds().size(); for (ProductContent pc : product.getProductContent()) { pc.getContent().getModifiedProductIds().size(); } } return products; }</code><technical_language>Missing space colon (somehow snuck linter)</technical_language>

Target:
public Set<Product> getProductsByUuidCached(Set<String> productUuids) { if (productUuids.size() == 0) { return new HashSet<>(); } Set<Product> products = new HashSet<>(); Set<String> productsNotInCache = new HashSet<>(); Cache cache = currentSession().getSessionFactory().getCache(); for (String uuid : productUuids) { if (cache.contains(this.entityType(), uuid)) { products.add(currentSession().get(Product.class, uuid)); } else { productsNotInCache.add(uuid); } } if (productsNotInCache.size() > 0) { log.debug("Loading objects that were not already in the cache: " + productsNotInCache.size()); Session session = this.currentSession(); java.util.List entities = session.byMultipleIds(this.entityType()) .enableSessionCheck(true) .multiLoad(productsNotInCache.toArray(new String[productsNotInCache.size()])); products.addAll(entities); } for (Product product : products) { product.getAttributes().size(); product.getDependentProductIds().size(); for (ProductContent pc : product.getProductContent()) { pc.getContent().getModifiedProductIds().size(); } } return products; }