auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { CreateAllSnapshotsFromVmCommand createAllSnapshotsFromVmCommand = (CreateAllSnapshotsFromVmCommand) command; <START> if (!createAllSnapshotsFromVmCommand.finishCommand()) { setCommandEndStatus(command, true, status, childCmdIds); } else { setCommandEndStatus(command, false, status, childCmdIds); } <END> }</code><technical_language>boolean failed = createAllSnapshotsFromVmCommand.finishCommand(); setCommandEndStatus(command, failed, status, childCmdIds);</technical_language>

Target:
protected void childCommandsExecutionEnded(CommandBase<?> command, boolean anyFailed, List<Guid> childCmdIds, CommandExecutionStatus status, int completedChildren) { CreateAllSnapshotsFromVmCommand createAllSnapshotsFromVmCommand = (CreateAllSnapshotsFromVmCommand) command; boolean failed = createAllSnapshotsFromVmCommand.finishCommand(); setCommandEndStatus(command, failed, status, childCmdIds); }
Source:
<code>public static void getHiveOperations(MetadataExtractor extractor, String marker){ Iterable<Map<String, Object>> hiveOperationEntities = extractor.extractMetadata(marker, <START> "sourceType: HIVE AND type:OPERATION_EXECUTION", null).getEntities(); <END> getFirstResult(hiveOperationEntities); Iterable<Map<String, Object>> hiveOperationRelations = extractor.extractMetadata(marker, "sourceType: HIVE AND type:OPERATION_EXECUTION", "type:LOGICAL_PHYSICAL " + "AND endpoint1SourceType:HIVE AND endpoint1Type:OPERATION_EXECUTION").getRelations(); getFirstResult(hiveOperationRelations); }</code><technical_language>extra space sourceType: HIVE</technical_language>

Target:
public static void getHiveOperations(MetadataExtractor extractor, String marker){ Iterable<Map<String, Object>> hiveOpEntities = extractor.extractMetadata( marker, null, "sourceType:HIVE AND type:OPERATION_EXECUTION", null) .getEntities(); getFirstResult(hiveOpEntities); Iterable<Map<String, Object>> hiveOpRelations = extractor.extractMetadata( marker, null, "sourceType:HIVE AND type:OPERATION_EXECUTION", "type:LOGICAL_PHYSICAL AND endpoint1SourceType:HIVE " + "AND endpoint1Type:OPERATION_EXECUTION").getRelations(); getFirstResult(hiveOpRelations); }
Source:
<code>public long getSeconds() { if (seconds == Long.MAX_VALUE || seconds == 0) { return seconds; } if (FACTOR == 1) { return seconds; } if (seconds >= Long.MAX_VALUE / FACTOR) { return Long.MAX_VALUE; } else { <START> return Math.round(seconds * FACTOR); <END> } }</code><technical_language>this expression Math.round((double)seconds \* factor) method return Integer.MAX_VALUE for input greater Integer.MAX_VALUE. input parameter for method is evaluated float returns integer instead of long</technical_language>

Target:
public long getSeconds() { if (seconds == Long.MAX_VALUE || seconds == 0) { return seconds; } if (FACTOR == 1) { return seconds; } if (seconds >= Long.MAX_VALUE / FACTOR) { return Long.MAX_VALUE; } else { return Math.round((double) seconds * FACTOR); } }
Source:
<code>public void testServeAppInactiveApp() throws Exception { PluginIdentity pluginIdentity = new PluginIdentity("app/uri/"); when(userPermissionEvaluator.hasPermission(pluginIdentity, VIEW_PLUGIN)).thenReturn(true); App app = mock(App.class); when(app.getId()).thenReturn("id"); <START> when(app.getUri()).thenReturn("app/uri"); <END> when(app.getLabel()).thenReturn("label"); when(app.getDescription()).thenReturn("description"); when(app.getAppVersion()).thenReturn("v1.0.0"); when(app.includeMenuAndFooter()).thenReturn(true); when(app.getTemplateContent()).thenReturn("<h1>Test</h1>"); when(app.getAppConfig()).thenReturn("{'config': 'test'}"); when(app.getResourceFolder()).thenReturn("foo/bar"); when(app.isActive()).thenReturn(false); AppResponse appResponse = AppResponse.create(app); when(appManagerService.getAppByUri("uri")).thenReturn(appResponse); mockMvc.perform(get(AppController.URI + "/uri/")) .andExpect(status().is4xxClientError()) .andExpect(model().attribute("errorMessageResponse", ErrorMessageResponse.create("Access denied for inactive app at location /app/uri", "AM07"))) .andExpect(view().name("view-exception")); }</code><technical_language>getUri() remain is. (so this work?)</technical_language>

Target:
public void testServeAppInactiveApp() throws Exception { PluginIdentity pluginIdentity = new PluginIdentity("app/uri/"); when(userPermissionEvaluator.hasPermission(pluginIdentity, VIEW_PLUGIN)).thenReturn(true); App app = mock(App.class); when(app.getId()).thenReturn("id"); when(app.getUri()).thenReturn("uri"); when(app.getLabel()).thenReturn("label"); when(app.getDescription()).thenReturn("description"); when(app.getAppVersion()).thenReturn("v1.0.0"); when(app.includeMenuAndFooter()).thenReturn(true); when(app.getTemplateContent()).thenReturn("<h1>Test</h1>"); when(app.getAppConfig()).thenReturn("{'config': 'test'}"); when(app.getResourceFolder()).thenReturn("foo/bar"); when(app.isActive()).thenReturn(false); AppResponse appResponse = AppResponse.create(app); when(appManagerService.getAppByName("uri")).thenReturn(appResponse); mockMvc.perform(get(AppController.URI + "/uri/")) .andExpect(status().is4xxClientError()) .andExpect(model().attribute("errorMessageResponse", ErrorMessageResponse.create("Access denied for inactive app at location /app/uri", "AM07"))) .andExpect(view().name("view-exception")); }
Source:
<code>public synchronized void evict(ServiceEndPoint endPoint) { String uniqueId = buildUniqueId(endPoint); Map<String, ServiceHandle<S>> instancesPerEndPointCopy = Maps.newHashMap(_instancesPerEndpoint); ServiceHandle<S> serviceHandle = instancesPerEndPointCopy.remove(uniqueId); _instancesPerEndpoint = instancesPerEndPointCopy; <START> destroyService(serviceHandle); <END> }</code><technical_language>endpoint is marked bad, is evicted service cache. sharing service handles, now, potentially, destroying handles in use. is also, potentially, a race condition checkOut checkOut return evicted handle</technical_language>

Target:
public synchronized void evict(ServiceEndPoint endPoint) { checkNotNull(endPoint); Timer.Context context = _evictionTimer.time(); if(_instancesPerEndpoint.containsKey(endPoint)) { ServiceHandle<S> serviceHandle = _instancesPerEndpoint.get(endPoint); _evictedList.put(endPoint, serviceHandle); } context.stop(); }
Source:
<code>private void queryTLVInformation() { List<QueryType> queryTypes = new ArrayList<>(); List<QueryParametersBase> queryParameters = new ArrayList<>(); allExistingNics.stream().forEach(nic -> { queryTypes.add(QueryType.GetTlvsByHostNicId); queryParameters.add(new IdQueryParameters(nic.getId())); }); Frontend.getInstance().runMultipleQueries(queryTypes, queryParameters, result -> { networkTlvsByGuid = new HashMap<>(); List<QueryReturnValue> returnValues = result.getReturnValues(); <START> IntStream.range(0, result.getReturnValues().size()).forEach(index <END> -> { IdQueryParameters param = (IdQueryParameters) result.getParameters().get(index); List<Tlv> tlvs = returnValues.get(index).getReturnValue(); if (param != null) { networkTlvsByGuid.put(param.getId(), tlvs); } }); if (getProgress() == null) { redraw(); } }); }</code><technical_language>I guess this is more style, is this a plain-old for-loop? (GWT emulates java.util.stream classes, generated JS a plain-old for-loop more efficient..)</technical_language>

Target:
private void queryTLVInformation() { List<QueryType> queryTypes = new ArrayList<>(); List<QueryParametersBase> queryParameters = new ArrayList<>(); allExistingNics.stream().forEach(nic -> { queryTypes.add(QueryType.GetTlvsByHostNicId); queryParameters.add(new IdQueryParameters(nic.getId())); }); Frontend.getInstance().runMultipleQueries(queryTypes, queryParameters, result -> { networkTlvsByGuid = new HashMap<>(); List<QueryReturnValue> returnValues = result.getReturnValues(); for (int index = 0; index < result.getReturnValues().size(); index++) { IdQueryParameters param = (IdQueryParameters) result.getParameters().get(index); List<Tlv> tlvs = returnValues.get(index).getReturnValue(); if (param != null) { networkTlvsByGuid.put(param.getId(), tlvs); } } if (getProgress() == null) { redraw(); } }); }
Source:
<code>private BasicContentDescriptionType generateBasicDescription(Content content, @Nullable Item item) { BasicContentDescriptionType basicDescription = new BasicContentDescriptionType(); basicDescription.getSynopsis().addAll(generateSynopses(content)); basicDescription.getGenre().addAll(generateGenres(content)); basicDescription.getGenre().add(generateGenreFromSpecialization(content)); basicDescription.getGenre().add(generateGenreFromMediaType(content)); basicDescription.getLanguage().addAll(generateLanguage(content)); basicDescription.setCreditsList(generateCreditsList(content)); Optional<RelatedMaterialType> relatedMaterial; if (content instanceof Series) { relatedMaterial = Strings.isNullOrEmpty(content.getImage()) ? <START> generateRelatedMaterial(item) : generateRelatedMaterial(content); <END> } else if (content instanceof Brand) { relatedMaterial = generateRelatedMaterial(item); } else { relatedMaterial = generateRelatedMaterial(content); } if (relatedMaterial.isPresent()) { basicDescription.getRelatedMaterial().add(relatedMaterial.get()); } return basicDescription; }</code><technical_language>relatedMaterial = Strings.isNullOrEmpty(content.getImage()) ? generateRelatedMaterial(item) : generateRelatedMaterial(content);</technical_language>

Target:
private BasicContentDescriptionType generateBasicDescription(Content content, @Nullable Item item) { BasicContentDescriptionType basicDescription = new BasicContentDescriptionType(); basicDescription.getSynopsis().addAll(generateSynopses(content)); basicDescription.getGenre().addAll(generateGenres(content)); basicDescription.getGenre().add(generateGenreFromSpecialization(content)); basicDescription.getGenre().add(generateGenreFromMediaType(content)); basicDescription.getLanguage().addAll(generateLanguage(content)); basicDescription.setCreditsList(generateCreditsList(content)); Optional<RelatedMaterialType> relatedMaterial; if (content instanceof Series) { relatedMaterial = generateRelatedMaterial(content); if (!relatedMaterial.isPresent()) { relatedMaterial = generateRelatedMaterial(item); } } else if (content instanceof Brand) { relatedMaterial = generateRelatedMaterial(item); } else { relatedMaterial = generateRelatedMaterial(content); } if (relatedMaterial.isPresent()) { basicDescription.getRelatedMaterial().add(relatedMaterial.get()); } return basicDescription; }
Source:
<code>public static <T extends APIObject> T constructFromJson(String json, Class <T> klass, String path) { T instance; try { instance = klass.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } Type type = new TypeToken<Map<String, Object>>() {}.getType(); Map<String, Object> map = APIObject.fromJson(json, type); instance.setAll(map); instance.path_prefix = path; <START> return instance; <END> }</code><technical_language>methods delegate implementation. want other call this null passed in for path_prefix</technical_language>

Target:
public static <T extends APIObject> T constructFromJson(String json, Class <T> klass, String path) { T instance; try { instance = klass.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } Type type = new TypeToken<Map<String, Object>>() {}.getType(); Map<String, Object> map = APIObject.fromJson(json, type); instance.setAll(map); instance.pathPrefix = path; return instance; }
Source:
<code>protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception { cancel(false); teleportee.setLastLocation(); PaperLib.getChunkAtAsync(target.getLocation()).thenAccept(chunk -> { Location loc = target.getLocation(); if (LocationUtil.isBlockUnsafeForUser(teleportee, chunk, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) { if (ess.getSettings().isTeleportSafetyEnabled()) { if (ess.getSettings().isForceDisableTeleportSafety()) { <START> PaperLib.teleportAsync(teleportee.getBase(), loc, cause); <END> } else { try { PaperLib.teleportAsync(teleportee.getBase(), LocationUtil.getSafeDestination(ess, teleportee, loc), cause); } catch (Exception e) { e.printStackTrace(); } } } else { try { throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } catch (Exception e) { e.printStackTrace(); } } } else { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { if (ess.getSettings().isTeleportToCenterLocation()) { loc = LocationUtil.getRoundedDestination(loc); } PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } } }); }</code><technical_language>need 'async' call other 'async' callbacks chunk loaded - this code a lot nicer</technical_language>

Target:
protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception { cancel(false); Location loc = target.getLocation(); UserTeleportEvent event = new UserTeleportEvent(teleportee, cause, loc); Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } if (teleportee.isAuthorized("essentials.back.onteleport")) { teleportee.setLastLocation(); } if (!teleportee.getBase().isEmpty()) { if (!ess.getSettings().isTeleportPassengerDismount()) { throw new Exception(tl("passengerTeleportFail")); } teleportee.getBase().eject(); } if (LocationUtil.isBlockUnsafeForUser(teleportee, loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) { if (ess.getSettings().isTeleportSafetyEnabled()) { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { PaperLib.teleportAsync(teleportee.getBase(), LocationUtil.getSafeDestination(ess, teleportee, loc), cause); } } else { throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } else { if (ess.getSettings().isForceDisableTeleportSafety()) { PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } else { if (ess.getSettings().isTeleportToCenterLocation()) { loc = LocationUtil.getRoundedDestination(loc); } PaperLib.teleportAsync(teleportee.getBase(), loc, cause); } } }
Source:
<code>protected Guid getSourceStorageDomainId(Disk disk) { <START> if (disk.getStorageDomains() != null) { <END> StorageDomain storageDomain = disk.getStorageDomains().getStorageDomains().get(0); if (storageDomain != null) { return asGuid(storageDomain.getId()); } } return null; }</code><technical_language>disk.isSetStorageDomains() instead</technical_language>

Target:
protected Guid getSourceStorageDomainId(Disk disk) { if (disk.isSetStorageDomains()) { StorageDomain storageDomain = disk.getStorageDomains().getStorageDomains().get(0); if (storageDomain != null) { return asGuid(storageDomain.getId()); } } return null; }
Source:
<code>public ContainerCreateConfig environment(String envPropsFile, Map<String, String> env, Map mavenProps) throws IllegalArgumentException { Properties envProps = new Properties(); if (env != null && env.size() > 0) { for (Map.Entry<String, String> entry : env.entrySet()) { String value = entry.getValue(); if (value == null) { value = ""; <START> } else if(value.contains("+")) { <END> value = value.substring(1, value.length()); } envProps.put(entry.getKey(), StrSubstitutor.replace(value, mavenProps)); } } if (envPropsFile != null) { addPropertiesFromFile(envPropsFile, envProps); } if (envProps.size() > 0) { addEnvironment(envProps); } return this; }</code><technical_language>wold prefer a startsWith("+$") unspecific. (Think values validly + characters) better, a regexp ^\+\$\{.*\}$. This match case</technical_language>

Target:
public ContainerCreateConfig environment(String envPropsFile, Map<String, String> env, Map mavenProps) throws IllegalArgumentException { Properties envProps = new Properties(); if (env != null && env.size() > 0) { for (Map.Entry<String, String> entry : env.entrySet()) { String value = entry.getValue(); if (value == null) { value = ""; } else if(value.matches("^\\+\\$\\{.*\\}$")) { value = value.substring(1, value.length()); } envProps.put(entry.getKey(), StrSubstitutor.replace(value, mavenProps)); } } if (envPropsFile != null) { addPropertiesFromFile(envPropsFile, envProps); } if (envProps.size() > 0) { addEnvironment(envProps); } return this; }
Source:
<code>public static Predicate<Resource> scalarValueAtLeast(final long v) { return new Predicate<Resource>() { @Override <START> public boolean apply(Resource resource) { <END> return resource.getType() == Protos.Value.Type.SCALAR && resource.getScalar().getValue() > v; } }; }</code><technical_language>Please mark resource parameter final</technical_language>

Target:
public static Predicate<Resource> scalarValueAtLeast(final long v) { return new ScalarValueAtLeast(v); }
Source:
<code>public long getCommittedWindowId(String appId, int operatorId) { logger.debug("Getting committed windowId appId operatorId {}", appId, operatorId); try { beginTransaction(); BytesMessage message = (BytesMessage)consumer.receive(); logger.debug("Retrieved committed window messageId: {}, messageAppOperatorIdProp: {}", message.getJMSMessageID(), message.getStringProperty(APP_OPERATOR_ID)); long windowId = message.readLong(); <START> message = getBase().getSession().createBytesMessage(); <END> message.setStringProperty(APP_OPERATOR_ID, appId + "_" + operatorId); message.writeLong(windowId); producer.send(message); commitTransaction(); logger.debug("metaQueueName: " + metaQueueName); logger.debug("Retrieved windowId {}", windowId); return windowId; } catch (JMSException ex) { throw new RuntimeException(ex); } }</code><technical_language>refactor 4 lines a new function follows. call 3 places (getCommittedWindow, storeCommitedWindow connect) private void writeWindowId(long windowId) { BytesMessage message = getBase().getSession().createBytesMessage(); message.setStringProperty(APP_OPERATOR_ID, appId + "_" + operatorId); message.writeLong(windowId); producer.send(message); }</technical_language>

Target:
public long getCommittedWindowId(String appId, int operatorId) { logger.debug("Getting committed windowId appId operatorId {}", appId, operatorId); try { beginTransaction(); BytesMessage message = (BytesMessage)consumer.receive(); logger.debug("Retrieved committed window messageId: {}, messageAppOperatorIdProp: {}", message.getJMSMessageID(), message.getStringProperty(APP_OPERATOR_ID)); long windowId = message.readLong(); writeWindowId(appId, operatorId, windowId); commitTransaction(); logger.debug("metaQueueName: " + metaQueueName); logger.debug("Retrieved windowId {}", windowId); return windowId; } catch (JMSException ex) { throw new RuntimeException(ex); } }
Source:
<code>public String getExitsString () { String exitsString = ""; if (this.exits != null) { int i = 1; exitsString = exitsString + " Exits: ["; <START> for (TransportStopExit e : this.exits ) <END> { if (e != null) { exitsString = exitsString + " " + i + ") " + e.getName() + " " + e.getLocation(); i++; } exitsString = exitsString + " ]"; } } return exitsString; }</code><technical_language>Formatting</technical_language>

Target:
public String getExitsString () { String exitsString = ""; String refString = ""; if (this.exits != null) { int i = 1; exitsString = exitsString + " Exits: ["; for (TransportStopExit e : this.exits ) { if (e.getRef() != null) { refString = " [ref:" + e.getRef() + "] "; } exitsString = exitsString + " " + i + ")" + refString + e.getName() + " " + e.getLocation() + " ]"; i++; } } return exitsString; }
Source:
<code>private void createCenterLabelFigure(final EObject element) { attachmentToEdgeNameFigure = <START> new Polyline(); attachmentToEdgeNameFigure.setLineStyle(Graphics.LINE_DASHDOT); attachmentToEdgeNameFigure.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_SELECTION)); attachmentToEdgeNameFigure.setVisible(false); this.add(attachmentToEdgeNameFigure); <END> fFigureViewEdgeNameFigure = new SiriusWrapLabelWithAttachment(LabelViewConstants.MIDDLE_LOCATION, attachmentToEdgeNameFigure); if (element instanceof DEdge) { DEdge edge = (DEdge) element; fFigureViewEdgeNameFigure.setText(edge.getName()); fFigureViewEdgeNameFigure.setVisible(!StringUtil.isEmpty(edge.getName())); } else { fFigureViewEdgeNameFigure.setVisible(false); } fFigureViewEdgeNameFigure.setLabelAlignment(PositionConstants.CENTER); fFigureViewEdgeNameFigure.setTextWrap(true); fFigureViewEdgeNameFigure.setTextWrapAlignment(PositionConstants.CENTER); this.add(fFigureViewEdgeNameFigure); }</code><technical_language>this code is written times</technical_language>

Target:
private void createCenterLabelFigure(final EObject element) { attachmentToEdgeNameFigure = addNewAttachmentFigure(); fFigureViewEdgeNameFigure = new SiriusWrapLabelWithAttachment(LabelViewConstants.MIDDLE_LOCATION, attachmentToEdgeNameFigure); if (element instanceof DEdge) { DEdge edge = (DEdge) element; fFigureViewEdgeNameFigure.setText(edge.getName()); fFigureViewEdgeNameFigure.setVisible(!StringUtil.isEmpty(edge.getName())); } else { fFigureViewEdgeNameFigure.setVisible(false); } fFigureViewEdgeNameFigure.setLabelAlignment(PositionConstants.CENTER); fFigureViewEdgeNameFigure.setTextWrap(true); fFigureViewEdgeNameFigure.setTextWrapAlignment(PositionConstants.CENTER); this.add(fFigureViewEdgeNameFigure); }
Source:
<code>private void checkUserCredentialsWithOrgUnit(Credentials credentials, boolean fromNetWorkError) { if (insertedCredentials.getUsername().equals(credentials.getUsername()) && insertedCredentials.getPassword().equals(credentials.getPassword()) && (fromNetWorkError || insertedCredentials.getServerURL().equals( credentials.getServerURL()))) { notifyLoginSuccess(); } else { if (fromNetWorkError) { notifyNetworkError(); } else { <START> if (insertedCredentials.getUsername().equals(credentials.getUsername()) <END> && !insertedCredentials.getPassword().equals(credentials.getPassword()) && (fromNetWorkError || insertedCredentials.getServerURL().equals( credentials.getServerURL()))){ System.out.println("Pin changed!!!"); notifyUnexpectedError(); }else{ notifyInvalidCredentials(); } } } }</code><technical_language>if remote server pin for a user is changed in a push process validate username pin previously push process, app navigate login do logout this code push is blocking navigate login screen</technical_language>

Target:
private void checkUserCredentialsWithOrgUnit(Credentials credentials, boolean fromNetWorkError) { if (insertedCredentials.getUsername().equals(credentials.getUsername()) && insertedCredentials.getPassword().equals(credentials.getPassword()) && (fromNetWorkError || insertedCredentials.getServerURL().equals( credentials.getServerURL()))) { notifyLoginSuccess(); } else { if (fromNetWorkError) { notifyNetworkError(); } else { if (insertedCredentials.getUsername().equals(credentials.getUsername()) && !insertedCredentials.getPassword().equals(credentials.getPassword()) && (fromNetWorkError || insertedCredentials.getServerURL().equals( credentials.getServerURL()))){ notifyOnServerPinChanged(); }else{ notifyInvalidCredentials(); } } } }
Source:
<code>private void maybeScheduleCompressData(List<JobDetails> backgroundJobs) { String configId = "org.hawkular.metrics.jobs." + CompressData.JOB_NAME; Configuration config = configurationService.load(configId).toBlocking() .firstOrDefault(new Configuration(configId, new HashMap<>())); if (config.get("jobId") == null) { logger.info("Preparing to create and schedule " + CompressData.JOB_NAME + " job"); long nextStart = LocalDateTime.now(ZoneOffset.UTC) .with(DateTimeService.startOfNextOddHour()) .toInstant(ZoneOffset.UTC).toEpochMilli(); <START> JobDetails JobDetails = scheduler.scheduleJob(CompressData.JOB_NAME, CompressData.JOB_NAME, <END> ImmutableMap.of(), new RepeatingTrigger.Builder().withTriggerTime(nextStart) .withInterval(2, TimeUnit.HOURS).build()).toBlocking().value(); backgroundJobs.add(JobDetails); configurationService.save(configId, "jobId", JobDetails.getJobId().toString()).toBlocking(); logger.info("Created and scheduled " + JobDetails); } }</code><technical_language>I this is class capital J for variable escaped. Do mind fixing this instance too</technical_language>

Target:
private void maybeScheduleCompressData(List<JobDetails> backgroundJobs) { String configId = "org.hawkular.metrics.jobs." + CompressData.JOB_NAME; Configuration config = configurationService.load(configId).toBlocking() .firstOrDefault(new Configuration(configId, new HashMap<>())); if (config.get("jobId") == null) { logger.info("Preparing to create and schedule " + CompressData.JOB_NAME + " job"); long nextStart = LocalDateTime.now(ZoneOffset.UTC) .with(DateTimeService.startOfNextOddHour()) .toInstant(ZoneOffset.UTC).toEpochMilli(); JobDetails jobDetails = scheduler.scheduleJob(CompressData.JOB_NAME, CompressData.JOB_NAME, ImmutableMap.of(), new RepeatingTrigger.Builder().withTriggerTime(nextStart) .withInterval(2, TimeUnit.HOURS).build()).toBlocking().value(); backgroundJobs.add(jobDetails); configurationService.save(configId, "jobId", jobDetails.getJobId().toString()).toBlocking(); logger.info("Created and scheduled " + jobDetails); } }
Source:
<code>public void addDisposeListener(Consumer<ISideEffect> disposalConsumer) { checkRealm(); if (isDisposed()) { return; } if (this.disposeListeners == null) { this.disposeListeners = new <START> CopyOnWriteArrayList<>(); <END> } this.disposeListeners.add(disposalConsumer); }</code><technical_language>CopyOnWriteArrayList unwanted synchronization, is a performance problem. suggest manually implementing copy-on-write pattern a normal ArrayList a boolean if list read (the copy omitted if intervening read)</technical_language>

Target:
public void addDisposeListener(Consumer<ISideEffect> disposalConsumer) { checkRealm(); if (isDisposed()) { return; } if (this.disposeListeners == null) { this.disposeListeners = new ArrayList<>(); } this.disposeListeners.add(disposalConsumer); }
Source:
<code>private void checkVersionForProfileLI(PackageSetting ps, PackageParser.Package pkg) { if (isUpgrade() && ps != null && pkg != null) { if (ps.versionCode != pkg.mVersionCode) { Slog.d(TAG, ps.name + " clear profile due to version change " + ps.versionCode + " != " + pkg.mVersionCode); clearAppProfilesLIF(pkg, UserHandle.USER_ALL); <START> <END> return true; } if (DEBUG_INSTALL) { Slog.d(TAG, "Package " + ps.name + " keep profile"); } } }</code><technical_language>oups, bad rebase</technical_language>

Target:
private void checkVersionForProfileLI(PackageSetting ps, PackageParser.Package pkg) { if (isUpgrade() && ps != null && pkg != null) { if (ps.versionCode != pkg.mVersionCode) { Slog.d(TAG, ps.name + " clear profile due to version change " + ps.versionCode + " != " + pkg.mVersionCode); clearAppProfilesLIF(pkg, UserHandle.USER_ALL); return; } if (DEBUG_INSTALL) { Slog.d(TAG, "Package " + ps.name + " keep profile"); } } }
Source:
<code>public static EntityResolver getEntityResolver(Hints hints) { if (hints != null && hints.containsKey(Hints.ENTITY_RESOLVER)) { Object resolver = hints.get(Hints.ENTITY_RESOLVER); if (resolver == null) { return NullEntityResolver.INSTANCE; } else if (resolver instanceof EntityResolver){ return (EntityResolver) resolver; } } Hints defaults = GeoTools.getDefaultHints(); if (defaults.containsKey(Hints.ENTITY_RESOLVER)) { Object hint = defaults.get(Hints.ENTITY_RESOLVER); if (hint instanceof EntityResolver) { return (EntityResolver) hint; } if (hint instanceof String) { final Logger LOGGER = Logging.getLogger("org.geotools.GeoTools"); try { String className = (String) hint; Class<?> type = Class.forName(className); for (Field field : type.getDeclaredFields()) { int modifier = field.getModifiers(); if ("INSTANCE".equals(field.getName()) && Modifier.isStatic(modifier) && Modifier.isPublic(modifier)) { try { Object value = field.get(null); if (value != null && value instanceof EntityResolver) { return (EntityResolver) value; } } catch (Throwable t) { LOGGER.log(Level.FINER, "Unable to instantiate ENTITY_RESOLVER: " + className + ".INSTANCE", t); <START> return PreventLocalEntityResolver.INSTANCE; <END> } } } try { Object value = type.newInstance(); if (value instanceof EntityResolver) { return (EntityResolver) value; } } catch (InstantiationException | IllegalAccessException e) { LOGGER.log(Level.FINER, "Unable to instantiate ENTITY_RESOLVER: " + e.getMessage(), e); } } catch (ClassNotFoundException notFound) { LOGGER.log(Level.FINER, "Unable to instantiate ENTITY_RESOLVER: " + notFound.getMessage(), notFound); } } } return PreventLocalEntityResolver.INSTANCE; }</code><technical_language>While gotos evil, a labeled break; do multiple points returing default entity resolver</technical_language>

Target:
public static EntityResolver getEntityResolver(Hints hints) { if (hints == null) { hints = getDefaultHints(); } if (hints.containsKey(Hints.ENTITY_RESOLVER)) { Object hint = hints.get(Hints.ENTITY_RESOLVER); if (hint == null) { return NullEntityResolver.INSTANCE; } else if (hint instanceof EntityResolver) { return (EntityResolver) hint; } else if (hint instanceof String) { String className = (String) hint; return instantiate(className,EntityResolver.class, PreventLocalEntityResolver.INSTANCE); } } return PreventLocalEntityResolver.INSTANCE; }
Source:
<code>public NettyTransportConnectionStats(EmbeddedCacheManager cacheManager, ChannelGroup acceptedChannels, String threadNamePrefix) { this.cacheManager = cacheManager; <START> this.isGlobalStatsEnabled = cacheManager != null ? cacheManager.getCacheManagerConfiguration().globalJmxStatistics().enabled() : false; <END> this.acceptedChannels = acceptedChannels; this.threadNamePrefix = threadNamePrefix; }</code><technical_language>simplified cacheManager != null && cacheManager.getCacheManagerConfiguration().globalJmxStatistics().enabled()</technical_language>

Target:
public NettyTransportConnectionStats(EmbeddedCacheManager cacheManager, ChannelGroup acceptedChannels, String threadNamePrefix) { this.cacheManager = cacheManager; this.isGlobalStatsEnabled = cacheManager != null && cacheManager.getCacheManagerConfiguration().globalJmxStatistics().enabled(); this.acceptedChannels = acceptedChannels; this.threadNamePrefix = threadNamePrefix; }
Source:
<code>synchronized List<Integer> chooseBlocksToMove(final String evalId, final int numBlocks) { final int storeId = getMemoryStoreId(evalId); final Set<Integer> blockIds = storeIdToBlockIds.get(storeId); if (blockIds == null) { throw new RuntimeException("Evaluator " + evalId + " is not registered"); } final List<Integer> blockIdList = new ArrayList<>(Math.min(blockIds.size(), numBlocks)); int count = 0; for (final Integer blockId : blockIds) { if (!movingBlocks.contains(blockId)) { blockIdList.add(blockId); movingBlocks.add(blockId); count++; } if (count == numBlocks) { break; } } LOG.log(Level.FINEST, "{0} blocks are chosen from store {1} in evaluator {2}. Blocks: {3}", new Object[] {numBlocks, storeId, evalId, blockIdList}); if (blockIdList.size() < numBlocks) { <START> LOG.log(Level.WARNING, "{0} blocks are chosen from store {1} in evaluator {2}, while {1} blocks are requested", <END> new Object[] {blockIdList.size(), storeId, evalId, numBlocks}); } return blockIdList; }</code><technical_language>4th argument {3} instead of {1}</technical_language>

Target:
synchronized List<Integer> chooseBlocksToMove(final String evalId, final int numBlocks) { final int storeId = getMemoryStoreId(evalId); final Set<Integer> blockIds = storeIdToBlockIds.get(storeId); if (blockIds == null) { throw new RuntimeException("Evaluator " + evalId + " is not registered"); } final List<Integer> blockIdList = new ArrayList<>(Math.min(blockIds.size(), numBlocks)); int count = 0; for (final Integer blockId : blockIds) { if (!movingBlocks.contains(blockId)) { blockIdList.add(blockId); movingBlocks.add(blockId); count++; } if (count == numBlocks) { break; } } if (blockIdList.size() < numBlocks) { LOG.log(Level.WARNING, "{0} blocks are chosen from store {1} in evaluator {2}," + " while {3} blocks are requested. Blocks: {4}", new Object[] {blockIdList.size(), storeId, evalId, numBlocks, blockIdList}); } else { LOG.log(Level.FINEST, "{0} blocks are chosen from store {1} in evaluator {2}. Blocks: {3}", new Object[] {numBlocks, storeId, evalId, blockIdList}); } return blockIdList; }
Source:
<code>void layerRenderGroups() { if (body != null) { add(body); add(bodySelections); } if (header != null) { add(header); <START> } <END> if (floatingBody != null) { add(floatingBody); add(floatingBodySelections); } if (floatingHeader != null) { add(floatingHeader); } if (isSelected) { add(selection); } }</code><technical_language>Should't check floatingBodySelections != null</technical_language>

Target:
private void layerRenderGroups() { if (body != null) { add(body); } if (bodySelections != null) { add(bodySelections); } if (header != null) { add(header); } if (floatingBody != null) { add(floatingBody); } if (floatingBodySelections != null) { add(floatingBodySelections); } if (floatingHeader != null) { add(floatingHeader); } if (boundary != null) { add(boundary); } if (isSelected) { add(selection); } }
Source:
<code><START> public Response post(CharSetCustomer cust) throws UnsupportedEncodingException { <END> logger.info(cust.getName()); String name = "bill\u00E9"; boolean equal = false; String test = new String(name.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); if (test.compareTo(cust.getName()) == 0) { equal = true; } return equal ? Response.ok().build() : Response.serverError().build(); }</code><technical_language>@CathrineTeng Please this</technical_language>

Target:
public Response post(CharSetCustomer cust) { logger.info(cust.getName()); String name = "bill\u00E9"; boolean equal = false; String test = new String(name.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); if (test.compareTo(cust.getName()) == 0) { equal = true; } return equal ? Response.ok().build() : Response.serverError().build(); }
Source:
<code>public void click() throws WidgetNotFoundException { if (commandID != null) { menuClickResult = null; final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class); UIThreadRunnable.asyncExec(new VoidResult() { public void run() { try { menuClickResult = handlerService.executeCommand(commandID, null); } catch (Exception e) { throw new RuntimeException("Failed to execute the command - " + commandID, e); } } }); } else if (action != null) UIThreadRunnable.asyncExec(new VoidResult() { public void run() { <START> action.setChecked(!action.isChecked()); <END> action.run(); } }); else throw new WidgetNotFoundException("There is no action or contribution id to execute."); }</code><technical_language>happen action of type check? Is this line failing unexpected? safer run this sense. For example wrapping in a if (action.getStyle() & IAction.AS_CHECK_BOX) { ... }</technical_language>

Target:
public void click() throws WidgetNotFoundException { if (commandID != null) { menuClickResult = null; final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class); UIThreadRunnable.asyncExec(new VoidResult() { public void run() { try { menuClickResult = handlerService.executeCommand(commandID, null); } catch (Exception e) { throw new RuntimeException("Failed to execute the command - " + commandID, e); } } }); } else if (action != null) UIThreadRunnable.asyncExec(new VoidResult() { public void run() { if((action.getStyle() == IAction.AS_CHECK_BOX) || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { action.setChecked(!action.isChecked()); } action.run(); } }); else throw new WidgetNotFoundException("There is no action or contribution id to execute."); }
Source:
<code>public void createPartControl(Composite parent) { PatternFilter filter = new PatternFilter(); <START> fFilteredTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true); <END> fTreeViewer = fFilteredTree.getViewer(); ColumnViewerToolTipSupport.enableFor(fTreeViewer); fTreeViewer.setContentProvider(new TraceControlContentProvider()); fTreeViewer.setLabelProvider(new TraceControlLabelProvider()); fRoot = new TraceControlRoot(); fRoot.addComponentListener(this); if (fInitialConnections != null) { for (IRemoteConnection rc : fInitialConnections) { TargetNodeComponent node = new TargetNodeComponent(rc.getName(), fRoot, rc); fRoot.addChild(node); } fInitialConnections = null; } fTreeViewer.setInput(fRoot); createContextMenu(); getSite().setSelectionProvider(fTreeViewer); }</code><technical_language>clearing filtered text pressing backspace button, tree is collapsed. is expand tree viewer. if I tend expand all, is better. Please try lines think. fFilteredTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true) { @Override protected void updateToolbar(boolean visible) { super.updateToolbar(visible); treeViewer.expandAll(); } };</technical_language>

Target:
public void createPartControl(Composite parent) { PatternFilter filter = new PatternFilter() { @Override protected boolean isLeafMatch(Viewer viewer, Object element) { ITraceControlComponent parentElement = (ITraceControlComponent) element; while (parentElement != null) { if (super.isLeafMatch(viewer, parentElement)) { return true; } parentElement = parentElement.getParent(); } return false; } }; FilteredTree filteredTree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true) { @Override protected void updateToolbar(boolean visible) { super.updateToolbar(visible); treeViewer.expandToLevel(3); } }; fTreeViewer = filteredTree.getViewer(); ColumnViewerToolTipSupport.enableFor(fTreeViewer); fTreeViewer.setContentProvider(new TraceControlContentProvider()); fTreeViewer.setLabelProvider(new TraceControlLabelProvider()); fRoot = new TraceControlRoot(); fRoot.addComponentListener(this); if (fInitialConnections != null) { for (IRemoteConnection rc : fInitialConnections) { TargetNodeComponent node = new TargetNodeComponent(rc.getName(), fRoot, rc); fRoot.addChild(node); } fInitialConnections = null; } fTreeViewer.setInput(fRoot); createContextMenu(); getSite().setSelectionProvider(fTreeViewer); }
Source:
<code>private void onFindFinished(Intent intent) { addMembersButton.setEnabled(true); List<FoundFan> devices = intent.getParcelableArrayListExtra(ConnectionService.EXTRA_FANS); if (devices.isEmpty()) { Toaster.iToast(this.getActivity(), R.string.no_fans_found); } else { <START> new MultiSelectListDialog<FoundFan>(this.getActivity(), <END> R.string.select_fans, R.string.connect) .setItems(devices) .setOnClickListener( new IOnDialogMultiItemClickListener<FoundFan>() { @Override public void onItemsClick( List<FoundFan> foundFans) { getConnectionService().connectToFans(foundFans); } }) .show(); } }</code><technical_language>Want start transitioning guest instead of fan</technical_language>

Target:
private void onFindFinished(Intent intent) { addMembersButton.setEnabled(true); List<FoundGuest> devices = intent.getParcelableArrayListExtra(ConnectionService.EXTRA_GUESTS); if (devices.isEmpty()) { Toaster.iToast(this.getActivity(), R.string.no_guests_found); } else { new MultiSelectListDialog<FoundGuest>(this.getActivity(), R.string.select_guests, R.string.connect) .setItems(devices) .setOnClickListener( new IOnDialogMultiItemClickListener<FoundGuest>() { @Override public void onItemsClick( List<FoundGuest> foundGuests) { getConnectionService().connectToGuests(foundGuests); } }) .show(); } }
Source:
<code>public String formatSize(double size) { String sSize = String.valueOf(size); int dotIndex = sSize.indexOf("."); if(dotIndex != -1) { return sSize.substring(0, dotIndex + 3); } else { return sSize.concat(".00"); <START> } <END> }</code><technical_language>User NumberFormat instead of manually formatting size. <LINK_0></technical_language>

Target:
public String formatSize(double size) { return NumberFormat.getFormat("#.##").format(size); }
Source:
<code>private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) { if (emfValidationStatus.getSeverity() == Diagnostic.OK) { return; } final Diagnostic rootStatus = emfValidationStatus; List allDiagnostics = new ArrayList(); SiriusDiagramEditorUtil.LazyElement2ViewMap <START> element2ViewMap = <END> new SiriusDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet(), allDiagnostics)); for (Iterator it = emfValidationStatus.getChildren().iterator(); it.hasNext();) { Diagnostic nextDiagnostic = (Diagnostic) it.next(); List data = nextDiagnostic.getData(); if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) { EObject element = (EObject) data.get(0); DSemanticDecorator dSemanticDecorator = getDSemanticDecorator(element, diagramEditPart); if (dSemanticDecorator != null) { View view = SiriusGMFHelper.getGmfView(dSemanticDecorator); addMarker(diagramEditPart.getViewer(), target, view, EMFCoreUtil.getQualifiedName(element, true), nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity())); } } } }</code><technical_language>"The of local variable element2ViewMap is used."</technical_language>

Target:
private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) { if (emfValidationStatus.getSeverity() == Diagnostic.OK) { return; } final Diagnostic rootStatus = emfValidationStatus; List allDiagnostics = new ArrayList(); collectTargetElements(rootStatus, new HashSet(), allDiagnostics); for (Iterator it = emfValidationStatus.getChildren().iterator(); it.hasNext();) { Diagnostic nextDiagnostic = (Diagnostic) it.next(); List data = nextDiagnostic.getData(); if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) { EObject element = (EObject) data.get(0); DSemanticDecorator dSemanticDecorator = getDSemanticDecorator(element, diagramEditPart); if (dSemanticDecorator != null) { View view = SiriusGMFHelper.getGmfView(dSemanticDecorator); addMarker(diagramEditPart.getViewer(), target, view, EMFCoreUtil.getQualifiedName(element, true), nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity())); } } } }
Source:
<code><START> public NetRC() { <END> parse(); }</code><technical_language>netrc if file permissions 600 (on posix) * Java7 read permissions NIO2 [1], this org.eclipse.jgit.java7 bundle * older Java versions FS.runInShell read permissions spawning a shell * idea this done Windows [1] <LINK_0>, java.nio.file.LinkOption...)</technical_language>

Target:
public NetRC() { netrc = getDefaultFile(); parse(); }
Source:
<code><START> public void optOutTracking() { <END> getAnalyticsMessages().emptyTrackingQueues(new AnalyticsMessages.MixpanelDescription(mToken)); if (getPeople().isIdentified()) { getPeople().deleteUser(); getPeople().clearCharges(); } mPersistentIdentity.clearPreferences(); synchronized (mEventTimings) { mEventTimings.clear(); mPersistentIdentity.clearTimeEvents(); } mPersistentIdentity.clearReferrerProperties(); mPersistentIdentity.setOptOutTracking(true); }</code><technical_language>is allowed flush events device user opt out in gdpr</technical_language>

Target:
public void optOutTracking() { getAnalyticsMessages().emptyTrackingQueues(new AnalyticsMessages.MixpanelDescription(mToken)); if (getPeople().isIdentified()) { getPeople().deleteUser(); getPeople().clearCharges(); } mPersistentIdentity.clearPreferences(); synchronized (mEventTimings) { mEventTimings.clear(); mPersistentIdentity.clearTimeEvents(); } mPersistentIdentity.clearReferrerProperties(); mPersistentIdentity.setOptOutTracking(true, mToken); }
Source:
<code>public Status delete(String table, String key) { try { arangoDriver.deleteDocument(table, key); return Status.OK; } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { <START> logger.error("Fail to delete: " + table + " " + key, e); <END> } else { logger.debug("Trying to delete document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (Exception e) { logger.error("Exception while trying delete " + table + " " + key, e); } return Status.ERROR; }</code><technical_language>a format placeholder instead of string concat</technical_language>

Target:
public Status delete(String table, String key) { try { arangoDriver.deleteDocument(table, key); return Status.OK; } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { logger.error("Fail to delete: with ex {}", table, key, e.toString()); } else { logger.debug("Trying to delete document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (RuntimeException e) { logger.error("Exception while trying delete with ex {}", table, key, e.toString()); } return Status.ERROR; }
Source:
<code>public void testApply() { Row expect = null; if (expectIndex >= 0) { expect = requests[expectIndex]; } <START> assertEquals(message, <END> expect, udf.getMainSearchReq(wiki, requests)); }</code><technical_language>for fun, try AssertJ. start, back</technical_language>

Target:
public void testApply() { Row expect = null; if (expectIndex >= 0) { expect = requests[expectIndex]; } assertThat(udf.getMainSearchReq(wiki, requests)).isEqualTo(expect); }
Source:
<code>public Association getAssociation() { if ( association == null ) { AssociationKey key = getAssociationKey(); if ( hostingEntity != null ) { OgmEntityEntryState entryState = OgmEntityEntryState.getStateFor( session, hostingEntity ); if ( entryState.hasAssociation( associationKeyMetadata.getCollectionRole() ) ) { association = entryState.getAssociation( associationKeyMetadata.getCollectionRole() ); } else { association = gridDialect.getAssociation( key, getAssociationContext() ); } } else { association = gridDialect.getAssociation( key, getAssociationContext() ); } if ( association == null ) { association = gridDialect.createAssociation( key, getAssociationContext() ); } <START> if ( hostingEntity != null ) { <END> OgmEntityEntryState.getStateFor( session, hostingEntity ) .setAssociation( associationKeyMetadata.getCollectionRole(), association ); } } return association; }</code><technical_language>this moved if ( association == null ) block, association creation</technical_language>

Target:
public Association getAssociation() { if ( association == null ) { AssociationKey key = getAssociationKey(); if ( hostingEntity != null ) { OgmEntityEntryState entryState = OgmEntityEntryState.getStateFor( session, hostingEntity ); if ( entryState.hasAssociation( associationKeyMetadata.getCollectionRole() ) ) { association = entryState.getAssociation( associationKeyMetadata.getCollectionRole() ); } else { association = gridDialect.getAssociation( key, getAssociationContext() ); OgmEntityEntryState.getStateFor( session, hostingEntity ) .setAssociation( associationKeyMetadata.getCollectionRole(), association ); } } else { association = gridDialect.getAssociation( key, getAssociationContext() ); } if ( association == null ) { association = gridDialect.createAssociation( key, getAssociationContext() ); if ( hostingEntity != null ) { OgmEntityEntryState.getStateFor( session, hostingEntity ) .setAssociation( associationKeyMetadata.getCollectionRole(), association ); } } } return association; }