auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> protected void disposeAllServerInstances() throws Exception { <END> if (TestConfig.isLocalServer() || TestConfig.isControllerProvided()) { KieServerControllerClient controllerClient; KieServerMgmtControllerClient mgmtControllerClient; if (TestConfig.isLocalServer()) { controllerClient = new KieServerControllerClient(TestConfig.getControllerHttpUrl(), null, null); mgmtControllerClient = new KieServerMgmtControllerClient(TestConfig.getControllerHttpUrl(), null, null); } else { controllerClient = new KieServerControllerClient(TestConfig.getControllerHttpUrl(), TestConfig.getUsername(), TestConfig.getPassword()); mgmtControllerClient = new KieServerMgmtControllerClient(TestConfig.getControllerHttpUrl(), TestConfig.getUsername(), TestConfig.getPassword()); } controllerClient.setMarshallingFormat(MarshallingFormat.JAXB); mgmtControllerClient.setMarshallingFormat(MarshallingFormat.JAXB); KieServerInstance[] serverInstrances = controllerClient.listKieServerInstances().getKieServerInstances(); for (KieServerInstance serverInstance : serverInstrances) { controllerClient.deleteKieServerInstance(serverInstance.getIdentifier()); } Collection<ServerTemplate> serverTemplates = mgmtControllerClient.listServerTemplates(); for (ServerTemplate serverTemplate : serverTemplates) { mgmtControllerClient.deleteServerTemplate(serverTemplate.getId()); } controllerClient.close(); mgmtControllerClient.close(); } }</code><technical_language>- this method combines - deletes instances server templates. decompose rename it. Wdyt</technical_language>

Target:
protected void disposeAllServerInstances() throws Exception { if (TestConfig.isLocalServer() || TestConfig.isControllerProvided()) { disposeServerInstances(); disposeServerTemplates(); } }
Source:
<code>private void configureAvailabilitySetForTemplate(Template template) { <START> AvailabilitySet as = templateToAvailabilitySet.apply(template); <END> if (as != null) { logger.debug(">> configuring nodes in availability set [%s]", as.name()); template.getOptions().as(AzureTemplateOptions.class).availabilitySet(as); } }</code><technical_language>[minor] name? :)</technical_language>

Target:
private void configureAvailabilitySetForTemplate(Template template) { AvailabilitySet availabilitySet = templateToAvailabilitySet.apply(template); if (availabilitySet != null) { logger.debug(">> configuring nodes in availability set [%s]", availabilitySet.name()); template.getOptions().as(AzureTemplateOptions.class).availabilitySet(availabilitySet); } }
Source:
<code>public void startDetection(String containerId, String machineId, String workspaceId) { <START> if (enableDetector) { <END> instances.put(containerId, Pair.of(machineId, workspaceId)); } }</code><technical_language>name this variable isEnabled</technical_language>

Target:
public void startDetection(String containerId, String machineId, String workspaceId) { if (isEnabled) { instances.put(containerId, Pair.of(machineId, workspaceId)); } }
Source:
<code>private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; boolean shouldWarnUser = !model.isUserInRepo(issue.getRepoId(), content.get()); if (shouldWarnUser) { throw new SemanticException(String.format(USER_WARNING_ERROR_FORMAT, content.get(), issue.getRepoId())); <START> } <END> String creator = issue.getCreator(); return creator.toLowerCase().contains(content.get().toLowerCase()); }</code><technical_language>This code block similar another block above. If are, extract a method</technical_language>

Target:
private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; enforceUserInRepoCondition(model, issue.getRepoId(), content.get()); String creator = issue.getCreator(); return creator.toLowerCase().contains(content.get().toLowerCase()); }
Source:
<code>public void succeedValidateNFS() { StorageServerConnections newNFSConnection = createNFSConnection( "multipass.my.domain.tlv.company.com:/export/allstorage/data2", StorageType.NFS, NfsVersion.V4, 300, 0); parameters.setStorageServerConnection(newNFSConnection); StorageDomain domain1 = new StorageDomain(); domain1.setStorage(newNFSConnection.getConnection()); domain1.setStatus(StorageDomainStatus.Maintenance); initDomainListForConnection(newNFSConnection.getId(), domain1); String guid = Guid.newGuid().toString(); when(storageConnDao.get(newNFSConnection.getId())).thenReturn(oldNFSConnection); doReturn("").when(command).isConnWithSameDetailsExists(newNFSConnection, null); <START> doReturn("storage_domain_01").when(command).getStorageNameByConnectionId(guid); <END> ValidateTestUtils.runAndAssertValidateSuccess(command); }</code><technical_language>need for this line if mock method above. Try remove if test pass</technical_language>

Target:
public void succeedValidateNFS() { StorageServerConnections newNFSConnection = createNFSConnection( "multipass.my.domain.tlv.company.com:/export/allstorage/data2", StorageType.NFS, NfsVersion.V4, 300, 0); parameters.setStorageServerConnection(newNFSConnection); StorageDomain domain1 = new StorageDomain(); domain1.setStorage(newNFSConnection.getConnection()); domain1.setStatus(StorageDomainStatus.Maintenance); initDomainListForConnection(newNFSConnection.getId(), domain1); String guid = Guid.newGuid().toString(); when(storageConnDao.get(newNFSConnection.getId())).thenReturn(oldNFSConnection); doReturn("").when(command).isConnWithSameDetailsExists(newNFSConnection, null); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
<code>public void test() { assertThat(Kind.DECORATOR) .matches("@decorator") .matches("@foo.decorator") .matches("@decorator()") .matches("@decorator(1, 2)") .matches("@foo.decorator()") <START> ; <END> }</code><technical_language>@vilchik-elena testing recursive nature of DecoratorMemberExpression? For example: .matches("@foo.decorator.prop") .matches("@foo.decorator.prop(1, 2)")</technical_language>

Target:
public void test() { assertThat(Kind.DECORATOR) .matches("@decorator") .matches("@foo.decorator") .matches("@foo.bar.decorator") .matches("@decorator()") .matches("@decorator(1, 2)") .matches("@foo.decorator()") .matches("@foo.bar.decorator(1, 2)") ; }
Source:
<code>public boolean isLogReplaying() { <START> CoordinatedStateManager m = server.getCoordinatedStateManager(); <END> if (m == null) return false; return ((BaseCoordinatedStateManager)m).getSplitLogManagerCoordination().isReplaying(); }</code><technical_language>Unrelated changes. Remove</technical_language>

Target:
public boolean isLogReplaying() { if (server.getCoordinatedStateManager() == null) return false; return ((BaseCoordinatedStateManager) server.getCoordinatedStateManager()) .getSplitLogManagerCoordination().isReplaying(); }
Source:
<code>public boolean areServersStarted() { try { Map<ServerIdentity, ControlledProcessState.State> statuses = getServerStatuses(); for (Map.Entry<ServerIdentity, ControlledProcessState.State> entry : statuses.entrySet()) { switch (entry.getValue()) { case RUNNING: continue; default: log.log(Level.INFO, entry.getKey() + " status is " + entry.getValue()); return false; } } return true; } catch (Exception ignored) { <START> log.severe(ignored.getLocalizedMessage()); <END> } return false; }</code><technical_language>Please remove</technical_language>

Target:
public boolean areServersStarted() { try { Map<ServerIdentity, ControlledProcessState.State> statuses = getServerStatuses(); for (Map.Entry<ServerIdentity, ControlledProcessState.State> entry : statuses.entrySet()) { switch (entry.getValue()) { case RUNNING: continue; default: log.log(Level.INFO, entry.getKey() + " status is " + entry.getValue()); return false; } } return true; } catch (Exception ignored) { } return false; }
Source:
<code>public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final JobManagerProcessSpec processSpec = JobManagerProcessUtils.processSpecFromConfigWithNewOptionToInterpretLegacyHeap( kubernetesJobManagerParameters.getFlinkConfiguration(), JobManagerOptions.TOTAL_PROCESS_MEMORY); final String startCommand = getJobManagerStartCommand( kubernetesJobManagerParameters.getFlinkConfiguration(), processSpec, kubernetesJobManagerParameters.getFlinkConfDirInPod(), kubernetesJobManagerParameters.getFlinkLogDirInPod(), kubernetesJobManagerParameters.hasLogback(), kubernetesJobManagerParameters.hasLog4j(), kubernetesJobManagerParameters.getEntrypointClass()); final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContainer()) .withCommand(kubernetesJobManagerParameters.getContainerEntrypoint()) <START> .withArgs(KubernetesUtils.getStartCommandWithBashWrapper(startCommand)) <END> .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(mainContainerWithStartCmd) .build(); }</code><technical_language>call KubernetesUtils#getStartCommandWithBashWrapper getJobManagerStartCommand, getJobManagerStartCommand returns array. This ensure start command is wrapped bash -c</technical_language>

Target:
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) { final JobManagerProcessSpec processSpec = JobManagerProcessUtils.processSpecFromConfigWithNewOptionToInterpretLegacyHeap( kubernetesJobManagerParameters.getFlinkConfiguration(), JobManagerOptions.TOTAL_PROCESS_MEMORY); final List<String> startCommand = getJobManagerStartCommand( kubernetesJobManagerParameters.getFlinkConfiguration(), processSpec, kubernetesJobManagerParameters.getFlinkConfDirInPod(), kubernetesJobManagerParameters.getFlinkLogDirInPod(), kubernetesJobManagerParameters.hasLogback(), kubernetesJobManagerParameters.hasLog4j(), kubernetesJobManagerParameters.getEntrypointClass()); final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContainer()) .withCommand(kubernetesJobManagerParameters.getContainerEntrypoint()) .withArgs(startCommand) .build(); return new FlinkPod.Builder(flinkPod) .withMainContainer(mainContainerWithStartCmd) .build(); }
Source:
<code>public boolean doPostUpdateRoleName(String roleName, String newRoleName, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } try { SCIMGroupHandler scimGroupHandler = new SCIMGroupHandler(userStoreManager.getTenantId()); String domainName = UserCoreUtil.getDomainName(userStoreManager.getRealmConfiguration()); if (domainName == null) { domainName = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME; } String roleNameWithDomain = domainName.toUpperCase() + CarbonConstants.DOMAIN_SEPARATOR + roleName; <START> String newRoleNameWithDomain = domainName.toUpperCase() + CarbonConstants.DOMAIN_SEPARATOR + newRoleName; <END> try { scimGroupHandler.updateRoleName(roleNameWithDomain, newRoleNameWithDomain); } catch (IdentitySCIMException e) { throw new UserStoreException("Error updating group information in SCIM Tables.", e); } return true; } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new UserStoreException(e); } }</code><technical_language>UserCoreUtil.addDomainToName() method instead of uppercasing domain manually</technical_language>

Target:
public boolean doPostUpdateRoleName(String roleName, String newRoleName, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } try { SCIMGroupHandler scimGroupHandler = new SCIMGroupHandler(userStoreManager.getTenantId()); String domainName = UserCoreUtil.getDomainName(userStoreManager.getRealmConfiguration()); if (domainName == null) { domainName = UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME; } String roleNameWithDomain = UserCoreUtil.addDomainToName(roleName, domainName); String newRoleNameWithDomain = UserCoreUtil.addDomainToName(newRoleName, domainName); try { scimGroupHandler.updateRoleName(roleNameWithDomain, newRoleNameWithDomain); } catch (IdentitySCIMException e) { throw new UserStoreException("Error updating group information in SCIM Tables.", e); } return true; } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new UserStoreException(e); } }
Source:
<code>public Object merge( Object parent ) { if (parent == null) { return this; } <START> if (parent instanceof MockHttpServletRequestBuilder) { <END> this.mergeable = (Mergeable) parent; return this.mergeable; } else { throw new IllegalArgumentException("Cannot merge with [" + parent.getClass().getName() + "]"); } }</code><technical_language>I check if is instance of Mergeable is casting to. check for pass in is a MockHttpServletRequestBuilder done invoke MockHttpServletRequestBuilder.merge</technical_language>

Target:
public Object merge(Object parent) { if (parent == null) { return this; } if (parent instanceof Mergeable ) { this.parent = (Mergeable) parent; return this; } else { throw new IllegalArgumentException("Cannot merge with [" + parent.getClass().getName() + "]"); } }
Source:
<code>public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = Connection.readFromNBT(tag); <START> target = BlockPos.fromLong(buf.readLong()); <END> int l = buf.readInt(); subPoints = new Vec3d[l]; for(int i=0; i<l; i++) subPoints[i] = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()); targetPoint = buf.readInt(); }</code><technical_language>kind of compatibility cubic chunks, this explicitly breaks AFAIK</technical_language>

Target:
public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = Connection.readFromNBT(tag); target = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); int l = buf.readInt(); subPoints = new Vec3d[l]; for(int i=0; i<l; i++) subPoints[i] = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()); targetPoint = buf.readInt(); }
Source:
<code>public void setUp() throws Exception { <START> brickPosition = 1; <END> int timesToRepeat = 3; int changeYMovement = -10; LoopEndBrick endBrick = new LoopEndBrick(); RepeatBrick repeatBrick = new RepeatBrick(timesToRepeat); repeatBrick.setLoopEndBrick(endBrick); script = BrickTestUtils.createProjectAndGetStartScript("LoopBrickTest1"); script.addBrick(repeatBrick); script.addBrick(new ChangeYByNBrick(changeYMovement)); script.addBrick(endBrick); baseActivityTestRule.launchActivity(null); }</code><technical_language>please remove brickPosition member if is</technical_language>

Target:
public void setUp() throws Exception { int timesToRepeat = 3; int changeYMovement = -10; LoopEndBrick endBrick = new LoopEndBrick(); RepeatBrick repeatBrick = new RepeatBrick(timesToRepeat); repeatBrick.setLoopEndBrick(endBrick); Script script = BrickTestUtils.createProjectAndGetStartScript("LoopBrickTest1"); script.addBrick(repeatBrick); script.addBrick(new ChangeYByNBrick(changeYMovement)); script.addBrick(endBrick); baseActivityTestRule.launchActivity(null); }
Source:
<code>private ResponseEntity<Object> createContainer(String id, Resource containerType) { Map<String, Object> result = new HashMap<>(); result.put("action", "create"); PID parentPid = PIDs.get(id); <START> result.put("pid", parentPid.getUUID()); <END> try { addContainerService.addContainer(AgentPrincipals.createFromThread(), parentPid, containerType); } catch (Exception e) { result.put("error", e.getMessage()); Throwable t = e.getCause(); if (t instanceof AuthorizationException || t instanceof AccessRestrictionException) { return new ResponseEntity<>(result, HttpStatus.FORBIDDEN); } else { log.error("Failed to create container for {}", e); return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST); } } result.put("timestamp", System.currentTimeMillis()); return new ResponseEntity<>(result, HttpStatus.OK); }</code><technical_language>This is fine, if move asynchronous model pid of newly created container. some point want revisit responses if want improve responsiveness of admin ui</technical_language>

Target:
private ResponseEntity<Object> createContainer(String id, Resource containerType) { Map<String, Object> result = new HashMap<>(); result.put("action", "create"); result.put("pid", id); PID parentPid = PIDs.get(id); try { addContainerService.addContainer(AgentPrincipals.createFromThread(), parentPid, containerType); } catch (Exception e) { result.put("error", e.getMessage()); Throwable t = e.getCause(); if (t instanceof AuthorizationException || t instanceof AccessRestrictionException) { return new ResponseEntity<>(result, HttpStatus.FORBIDDEN); } else { log.error("Failed to create container for {}", e); return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST); } } result.put("timestamp", System.currentTimeMillis()); return new ResponseEntity<>(result, HttpStatus.OK); }
Source:
<code>public void checkFormatCodeFeature() { projectExplorer.openItemByPath(PROJECT_NAME + "/towers.py"); editor.selectTabByName("towers.py"); editor.openContextMenuInEditor(); editor.clickOnItemInContextMenu(FORMAT); editor.waitTextIntoEditor( <START> " towers(i-1, middle, finish, start)\n\n\n" + "towers(5, 'X', 'Z', 'Y')\n"); <END> }</code><technical_language>" + " redundant string</technical_language>

Target:
public void checkFormatCodeFeature() { projectExplorer.openItemByPath(PROJECT_NAME + "/towers.py"); editor.selectTabByName("towers.py"); editor.openContextMenuInEditor(); editor.clickOnItemInContextMenu(FORMAT); editor.waitTextIntoEditor( " towers(i-1, middle, finish, start)\n\n\ntowers(5, 'X', 'Z', 'Y')\n"); }
Source:
<code>public synchronized void stop() { stopping = true; supervisor.stop(); if (monitorServer != null) { monitorServer.stop(); } <START> stopping = false; <END> }</code><technical_language>In general a good practice wrap this a finally block. In this case necessary this is called shutdown hook, in fact matter this is set false. in case do need this line, wdyt</technical_language>

Target:
public void stop() { lifecycleLock.lock(); try { supervisor.stop(); if (monitorServer != null) { monitorServer.stop(); } } finally { lifecycleLock.unlock(); } }
Source:
<code>public void cancelCurrentTask() { stateHolder.cancelTask(); <START> <END> if (stateHolder.canDetachFromCancelledTask()) { dismissProgressDialog(); } }</code><technical_language>This needs fire cancel signal, _and_ validate signal processed (IE: threshold processing)</technical_language>

Target:
public void cancelCurrentTask() { synchronized (stateHolder.getTaskCancelLock()) { if (stateHolder.canCancel()) { stateHolder.cancelTask(); if (stateHolder.canDetachFromCancelledTask()) { dismissProgressDialog(); stateHolder.performDetach(); stateHolder.clearTask(); } } } }
Source:
<code>private void updateRenderer() { ColorRamp colorRamp = mColorRampType != ColorRamp.PresetType.NONE ? new ColorRamp(mColorRampType, 800) : null; mRasterLayer = colorRamp != null ? new RasterLayer(mElevationRaster) : new RasterLayer(mImageryRaster); mMapView.getMap().setBasemap(new Basemap(mRasterLayer)); BlendRenderer blendRenderer = new BlendRenderer( mElevationRaster, Arrays.asList(9.0), <START> Arrays.asList(255.0), <END> null, null, null, null, colorRamp, mAltitude, mAzimuth, mZFactor, mSlopeType, mPixelSizeFactor, mPixelSizePower, mOutputBitDepth); mRasterLayer.setRasterRenderer(blendRenderer); }</code><technical_language>Prefer Collections.singletonList(255.0), immutable Arrays.asList() create a single item list</technical_language>

Target:
private void updateRenderer() { ColorRamp colorRamp = mColorRampType != ColorRamp.PresetType.NONE ? new ColorRamp(mColorRampType, 800) : null; RasterLayer mRasterLayer = colorRamp != null ? new RasterLayer(mElevationRaster) : new RasterLayer(mImageryRaster); mMapView.getMap().setBasemap(new Basemap(mRasterLayer)); BlendRenderer blendRenderer = new BlendRenderer( mElevationRaster, Collections.singletonList(9.0), Collections.singletonList(255.0), null, null, null, null, colorRamp, mAltitude, mAzimuth, mZFactor, mSlopeType, mPixelSizeFactor, mPixelSizePower, mOutputBitDepth); mRasterLayer.setRasterRenderer(blendRenderer); }
Source:
<code>public static Subscribe parse(List<Object> wmsg) { MessageUtil.validateMessage(wmsg, MESSAGE_TYPE, "SUBSCRIBE", 4); long request = MessageUtil.parseRequestID(wmsg.get(1)); Map<String, Object> options = (Map<String, Object>) wmsg.get(2); String match = null; if (options.containsKey("match")) { match = (String) options.get("match"); if (!Objects.equals(match, MATCH_EXACT) && !Objects.equals(match, MATCH_PREFIX) && !Objects.equals(match, MATCH_WILDCARD)) { throw new ProtocolError("match must be one of exact, prefix or wildcard."); } } boolean getRetained = false; <START> if (options.containsKey("get_retained")) { <END> getRetained = (boolean) options.get("get_retained"); } String topic = (String) wmsg.get(3); SubscribeOptions opt = new SubscribeOptions(match, true, getRetained); return new Subscribe(request, opt, topic); }</code><technical_language>options.getOrDefault() a cleaner approach here</technical_language>

Target:
public static Subscribe parse(List<Object> wmsg) { MessageUtil.validateMessage(wmsg, MESSAGE_TYPE, "SUBSCRIBE", 4); long request = MessageUtil.parseRequestID(wmsg.get(1)); Map<String, Object> options = (Map<String, Object>) wmsg.get(2); String match = null; if (options.containsKey("match")) { match = (String) options.get("match"); if (!Objects.equals(match, MATCH_EXACT) && !Objects.equals(match, MATCH_PREFIX) && !Objects.equals(match, MATCH_WILDCARD)) { throw new ProtocolError("match must be one of exact, prefix or wildcard."); } } boolean getRetained = (boolean)options.getOrDefault("get_retained", false); String topic = (String) wmsg.get(3); SubscribeOptions opt = new SubscribeOptions(match, true, getRetained); return new Subscribe(request, opt, topic); }
Source:
<code>public void testDefaultTranslationFileIsMissing() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TranslationCheck.class); <START> checkConfig.addAttribute("requiredTranslations", "ja, de, ja"); <END> final File[] propertyFiles = { new File(getPath("checks" + File.separator + "translation-check-messages_de.properties")), new File(getPath("checks" + File.separator + "translation-check-messages_ja.properties")), }; final String[] expected = { "0: Properties file 'translation-check-messages.properties' is missing.", }; verify( createChecker(checkConfig), propertyFiles, getPath("checks"), expected); }</code><technical_language>this test include more complicated string set ,ja,de,, ja, full functionality coverage</technical_language>

Target:
public void testDefaultTranslationFileIsMissing() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TranslationCheck.class); checkConfig.addAttribute("requiredTranslations", "ja,,, de, ja"); final File[] propertyFiles = { new File(getPath("checks" + File.separator + "messages_translation_de.properties")), new File(getPath("checks" + File.separator + "messages_translation_ja.properties")), }; final String[] expected = { "0: Properties file 'messages_translation.properties' is missing.", }; verify( createChecker(checkConfig), propertyFiles, getPath("checks"), expected); }
Source:
<code>public boolean doCheckAndSend() throws JobEmailNotificationException { switch (eventType) { case JOB_PAUSED: case JOB_RESUMED: <START> case JOB_IN_ERROR: <END> case JOB_PENDING_TO_FINISHED: case JOB_RUNNING_TO_FINISHED: case JOB_RESTARTED_FROM_ERROR: break; default: logger.trace("Event unrelated to job finish, doing nothing"); return false; } if (!PASchedulerProperties.EMAIL_NOTIFICATIONS_ENABLED.getValueAsBoolean()) { logger.debug("Notification emails disabled, doing nothing"); return false; } try { sender.send(getFrom(), getTo(), getSubject(), getBody()); return true; } catch (AddressException e) { throw new JobEmailNotificationException("Malformed email address", e); } catch (MessagingException e) { throw new JobEmailNotificationException("Error sending email: " + e.getMessage(), e); } }</code><technical_language>Personally, I add JOB_SUBMITTED, JOB_PENDING_TO_RUNNING, JOB_CHANGE_PRIORITY. I worked CCRT SLURM scheduler, I notified email a job submitted moved pending queue running queue. I suppose user wants notified if admin changed priority of job. I event JOB_UPDATED, I figure out doing</technical_language>

Target:
public boolean doCheckAndSend() throws JobEmailNotificationException { switch (eventType) { case JOB_PAUSED: case JOB_RESUMED: case JOB_IN_ERROR: case JOB_SUBMITTED: case JOB_PENDING_TO_RUNNING: case JOB_CHANGE_PRIORITY: case JOB_PENDING_TO_FINISHED: case JOB_RUNNING_TO_FINISHED: case JOB_RESTARTED_FROM_ERROR: break; default: logger.trace("Event unrelated to job finish, doing nothing"); return false; } if (!PASchedulerProperties.EMAIL_NOTIFICATIONS_ENABLED.getValueAsBoolean()) { logger.debug("Notification emails disabled, doing nothing"); return false; } try { sender.send(getFrom(), getTo(), getSubject(), getBody()); return true; } catch (AddressException e) { throw new JobEmailNotificationException("Malformed email address", e); } catch (MessagingException e) { throw new JobEmailNotificationException("Error sending email: " + e.getMessage(), e); } }
Source:
<code>public void setEnableEvalExpression(String evalExpression) { <START> if (!this.enableEvalExpressionValueSet) { <END> this.enableEvalExpression = "true".equals(evalExpression); this.enableEvalExpressionValueSet = true; if (this.enableEvalExpression) { LOG.warn("Enabling OGNL expression evaluation may introduce security risks " + "(see <LINK_0> for further details)"); } } else { LOG.debug("Error setting enable OGNL expression evaluation value [{}], already previously set to [{}]", evalExpression, this.enableEvalExpression); } }</code><technical_language>a lot of work please replace change-limiters logic including unit test proposed solution above. Thanks in advance</technical_language>

Target:
protected void setEnableEvalExpression(String evalExpression) { this.enableEvalExpression = BooleanUtils.toBoolean(evalExpression); if (this.enableEvalExpression) { LOG.warn("Enabling OGNL expression evaluation may introduce security risks " + "(see <LINK_0> for further details)"); } }
Source:
<code>public String getImageUrl(String id) { return getProvider().getUrl() + API_VERSION + "/images/" + id + <START> "/file"; <END> }</code><technical_language>this appended in vdsm</technical_language>

Target:
public String getImageUrl(String id) { return getProvider().getUrl() + API_VERSION + "/images/" + id; }
Source:
<code>public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException { <START> List<String> mechanismList = Arrays.asList(mechanisms); <END> mechanismList.sort(mechanismNameComparator); return super.createSaslClient(mechanismList.toArray(new String[mechanismList.size()]), authorizationId, protocol, serverName, props, cbh); }</code><technical_language>This slightly done array clone intermediate list</technical_language>

Target:
public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException { String[] sortedMechanisms = mechanisms.clone(); Arrays.sort(sortedMechanisms, mechanismNameComparator); return super.createSaslClient(sortedMechanisms, authorizationId, protocol, serverName, props, cbh); }
Source:
<code>private boolean doesDestinationMatch(Datastream newDatastream, Datastream existingDatastream) { <START> if ((!newDatastream.hasDestination() && !existingDatastream.hasDestination()) <END> || (newDatastream.hasDestination() && existingDatastream.hasDestination() && newDatastream.getDestination().equals(existingDatastream.getDestination()))) { return true; } return false; }</code><technical_language>nit: return statement 'if', feel more readable this way</technical_language>

Target:
private boolean doesDestinationMatch(Datastream newDatastream, Datastream existingDatastream) { return ((!newDatastream.hasDestination() && !existingDatastream.hasDestination()) || (newDatastream.hasDestination() && existingDatastream.hasDestination() && newDatastream.getDestination().equals(existingDatastream.getDestination()))); }
Source:
<code>private void initAttributes(Context context, AttributeSet attributeSet) { TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton, 0, 0); if (attr != null) { try { mColorNormal = attr.getColor(R.styleable.FloatingActionButton_fab_colorNormal, getColor(android.R.color.holo_blue_dark)); mColorPressed = attr.getColor(R.styleable.FloatingActionButton_fab_colorPressed, getColor(android.R.color.holo_blue_light)); mSize = attr.getInt(R.styleable.FloatingActionButton_fab_size, SIZE_NORMAL); mIcon = attr.getResourceId(R.styleable.FloatingActionButton_fab_icon, 0); <START> mEnableInnerColor = attr.getBoolean(R.styleable.FloatingActionButton_fab_enable_inner_color, true); <END> } finally { attr.recycle(); } } }</code><technical_language>set default true here, need initialize variable true line 67. try block fail this line, variable incorrectly set false</technical_language>

Target:
private void initAttributes(Context context, AttributeSet attributeSet) { TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton, 0, 0); if (attr != null) { try { mColorNormal = attr.getColor(R.styleable.FloatingActionButton_fab_colorNormal, getColor(android.R.color.holo_blue_dark)); mColorPressed = attr.getColor(R.styleable.FloatingActionButton_fab_colorPressed, getColor(android.R.color.holo_blue_light)); mSize = attr.getInt(R.styleable.FloatingActionButton_fab_size, SIZE_NORMAL); mIcon = attr.getResourceId(R.styleable.FloatingActionButton_fab_icon, 0); mEnableInnerShadow = attr.getBoolean(R.styleable.FloatingActionButton_fab_enableInnerShadow, true); } finally { attr.recycle(); } } }
Source:
<code>public String getDisableFlash() { <START> return config.get("disable-flash"); <END> }</code><technical_language>if put in config file: disable-flash: true this wont work - cast boolean String. A solution: String.valueOf(config.get("disable-flash"))</technical_language>

Target:
public String getDisableFlash() { return String.valueOf(config.get("disable-flash")); }
Source:
<code>public AppointmentDAOImpl(){ <START> List<String> applicants = new ArrayList<>(); <END> applicants.add("testApplicantId"); List<String> users = new ArrayList<>(); users.add("testUserId"); List<String> applicants2 = new ArrayList<>(); applicants2.add("testApplicantIdWRONG"); List<String> users2 = new ArrayList<>(); users2.add("testUserId"); List<String> applicants3 = new ArrayList<>(); applicants3.add("testApplicantId"); List<String> users3 = new ArrayList<>(); users3.add("testUserId"); appointmentsList = new LinkedList<>(); appointmentsList.add(new Appointment(users, applicants, 1401866602 + TOMORROW)); appointmentsList.add(new Appointment(users2, applicants2, 1401866603 + TOMORROW)); appointmentsList.add(new Appointment(users3, applicants3, 1401866604 + TOMORROW)); }</code><technical_language>Huh, logic in constructor. Split please</technical_language>

Target:
public AppointmentDAOImpl(){ }
Source:
<code>public static QuorumPeer createQuorumPeer(File tmpDir) throws IOException{ QuorumPeer peer = new QuorumPeer(); <START> peer.syncLimit = 2; <END> peer.initLimit = 2; peer.tickTime = 2000; peer.quorumPeers = new HashMap<Long, QuorumPeer.QuorumServer>(); peer.quorumPeers.put(0L, new QuorumPeer.QuorumServer(0, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(1L, new QuorumPeer.QuorumServer(1, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(2L, new QuorumPeer.QuorumServer(2, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.setQuorumVerifier(new QuorumMaj(peer.quorumPeers.size())); peer.setCnxnFactory(new NullServerCnxnFactory()); File version2 = new File(tmpDir, "version-2"); version2.mkdir(); FileOutputStream fos; fos = new FileOutputStream(new File(version2, "currentEpoch")); fos.write("0\n".getBytes()); fos.close(); fos = new FileOutputStream(new File(version2, "acceptedEpoch")); fos.write("0\n".getBytes()); fos.close(); return peer; }</code><technical_language>If this is a helper class require instantiation create a private constructor: this "final" prevents instantiation</technical_language>

Target:
public static QuorumPeer createQuorumPeer(File tmpDir) throws IOException{ QuorumPeer peer = new QuorumPeer(); peer.syncLimit = 2; peer.initLimit = 2; peer.tickTime = 2000; peer.quorumPeers = new HashMap<Long, QuorumPeer.QuorumServer>(); peer.quorumPeers.put(0L, new QuorumPeer.QuorumServer(0, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(1L, new QuorumPeer.QuorumServer(1, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.quorumPeers.put(2L, new QuorumPeer.QuorumServer(2, "127.0.0.1", PortAssignment.unique(), 0, null)); peer.setQuorumVerifier(new QuorumMaj(peer.quorumPeers.size())); peer.setCnxnFactory(new NullServerCnxnFactory()); File version2 = new File(tmpDir, "version-2"); version2.mkdir(); FileOutputStream fos = new FileOutputStream(new File(version2, "currentEpoch")); fos.write("0\n".getBytes()); fos.close(); fos = new FileOutputStream(new File(version2, "acceptedEpoch")); fos.write("0\n".getBytes()); fos.close(); return peer; }
Source:
<code>private RegionScanner rebuildIndices(final RegionScanner innerScanner, final Region region, final Scan scan, final RegionCoprocessorEnvironment env) throws IOException { boolean oldCoproc = region.getTableDesc().hasCoprocessor(Indexer.class.getCanonicalName()); byte[] valueBytes = scan.getAttribute(BaseScannerRegionObserver.INDEX_REBUILD_VERIFY_TYPE); IndexTool.IndexVerifyType verifyType = (valueBytes != null) ? IndexTool.IndexVerifyType.fromValue(valueBytes):IndexTool.IndexVerifyType.NONE; if (oldCoproc && verifyType == IndexTool.IndexVerifyType.ONLY) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } if (!scan.isRaw()) { Scan rawScan = new Scan(scan); rawScan.setRaw(true); rawScan.setMaxVersions(); rawScan.getFamilyMap().clear(); rawScan.setFilter(null); rawScan.setCacheBlocks(false); for (byte[] family : scan.getFamilyMap().keySet()) { rawScan.addFamily(family); } innerScanner.close(); RegionScanner scanner = region.getScanner(rawScan); if (oldCoproc) { <START> return new IndexerRegionScanner(scanner, region, scan, env, this); <END> } else { return new IndexRebuildRegionScanner(scanner, region, scan, env, this); } } if (oldCoproc) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(innerScanner, region, scan, env, this); } }</code><technical_language>For coproc, wanted do version verification. Moving this not-raw block, change strategy</technical_language>

Target:
private RegionScanner rebuildIndices(final RegionScanner innerScanner, final Region region, final Scan scan, final RegionCoprocessorEnvironment env) throws IOException { boolean oldCoproc = region.getTableDesc().hasCoprocessor(Indexer.class.getCanonicalName()); byte[] valueBytes = scan.getAttribute(BaseScannerRegionObserver.INDEX_REBUILD_VERIFY_TYPE); IndexTool.IndexVerifyType verifyType = (valueBytes != null) ? IndexTool.IndexVerifyType.fromValue(valueBytes) : IndexTool.IndexVerifyType.NONE; if (oldCoproc && verifyType == IndexTool.IndexVerifyType.ONLY) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } if (!scan.isRaw()) { Scan rawScan = new Scan(scan); rawScan.setRaw(true); rawScan.setMaxVersions(); rawScan.getFamilyMap().clear(); if (scan.getFilter() instanceof FirstKeyOnlyFilter) { rawScan.setFilter(null); } else if (scan.getFilter() != null) { rawScan.setFilter(new AllVersionsIndexRebuildFilter(scan.getFilter())); } rawScan.setCacheBlocks(false); for (byte[] family : scan.getFamilyMap().keySet()) { rawScan.addFamily(family); } innerScanner.close(); RegionScanner scanner = region.getScanner(rawScan); if (oldCoproc) { return new IndexerRegionScanner(scanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(scanner, region, scan, env); } } if (oldCoproc) { return new IndexerRegionScanner(innerScanner, region, scan, env, this); } else { return new IndexRebuildRegionScanner(innerScanner, region, scan, env); } }
Source:
<code>public void onClick(View view) { switch (view.getId()) { case R.id.button_sign_in: if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) { Log.w(TAG, "*** Warning: setup problems detected. Sign in may not work!"); } Log.d(TAG, "Sign-in button clicked"); mSignInClicked = true; mGoogleApiClient.connect(); break; case R.id.button_sign_out: mSignInClicked = false; Games.signOut(mGoogleApiClient); mGoogleApiClient.disconnect(); showSignInBar(); mSaveGame = new SaveGame(); mAlreadyLoadedState = false; updateUi(); break; case R.id.button_next_world: <START> if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) { <END> BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld < WORLD_MAX) { mWorld++; updateUi(); } break; case R.id.button_prev_world: if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld > WORLD_MIN) { mWorld--; updateUi(); } break; default: if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } for (int i = 0; i < LEVEL_BUTTON_IDS.length; ++i) { if (view.getId() == LEVEL_BUTTON_IDS[i]) { launchLevel(i + 1); return; } } } }</code><technical_language>refactor this check isSignedIn() method? a lot</technical_language>

Target:
public void onClick(View view) { switch (view.getId()) { case R.id.button_sign_in: if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) { Log.w(TAG, "*** Warning: setup problems detected. Sign in may not work!"); } Log.d(TAG, "Sign-in button clicked"); mSignInClicked = true; mGoogleApiClient.connect(); break; case R.id.button_sign_out: mSignInClicked = false; Games.signOut(mGoogleApiClient); mGoogleApiClient.disconnect(); showSignInBar(); mSaveGame = new SaveGame(); mAlreadyLoadedState = false; updateUi(); break; case R.id.button_next_world: if (isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld < WORLD_MAX) { mWorld++; updateUi(); } break; case R.id.button_prev_world: if (isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } if (mWorld > WORLD_MIN) { mWorld--; updateUi(); } break; default: if (isConnected()) { BaseGameUtils.makeSimpleDialog(this, getString(R.string.please_sign_in)).show(); return; } for (int i = 0; i < LEVEL_BUTTON_IDS.length; ++i) { if (view.getId() == LEVEL_BUTTON_IDS[i]) { launchLevel(i + 1); return; } } } }
Source:
<code>public @Nullable StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj == null || toAppendTo == null) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } Double doubleObj = (Double) obj; if ((doubleObj % 1 != 0) || !fMap.containsValue((doubleObj.intValue()))) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } for (Entry<@Nullable String, Integer> entry : fMap.entrySet()) { <START> if (Double.compare(entry.getValue().doubleValue(), doubleObj.doubleValue()) == 0) { <END> if (entry.getKey() == null) { return new StringBuffer(UNKNOW_REPRESENTATION); } if (entry.getKey() == null) { return new StringBuffer(UNKNOW_REPRESENTATION); } return toAppendTo.append(entry.getKey()); } } return new StringBuffer(SWTCHART_EMPTY_LABEL); }</code><technical_language>this lose precision, ok that</technical_language>

Target:
public @Nullable StringBuffer format(@Nullable Object obj, @Nullable StringBuffer toAppendTo, @Nullable FieldPosition pos) { if (obj == null || toAppendTo == null) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } Double doubleObj = (Double) obj; if ((doubleObj % 1 != 0) || !fMap.containsValue((doubleObj.intValue()))) { return new StringBuffer(SWTCHART_EMPTY_LABEL); } for (Entry<@Nullable String, Integer> entry : fMap.entrySet()) { if (Double.compare(entry.getValue().doubleValue(), doubleObj.doubleValue()) == 0) { if (entry.getKey() == null) { return new StringBuffer(UNKNOWN_REPRESENTATION); } return toAppendTo.append(entry.getKey()); } } return new StringBuffer(SWTCHART_EMPTY_LABEL); }
Source:
<code>private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { <START> <END> SavePreferences preferences = this.preferences.getSavePreferences() .withEncoding(encoding) .withSaveType(saveType); Consumer<List<FieldChange>> consumer = fieldChanges -> panel.registerUndoableChanges(fieldChanges); var future = saveManager.save(file, selectedOnly, encoding, saveType, consumer); Set<Character> characters; try { characters = future.get(); if (!characters.isEmpty()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), characters, saveType); } } catch (InterruptedException | ExecutionException e) { throw new SaveException("Error excuting save acton", e); } return true; }</code><technical_language>remove empty lines</technical_language>

Target:
private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = this.preferences.getSavePreferences() .withEncoding(encoding) .withSaveType(saveType); try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, preferences.getEncoding(), preferences.shouldMakeBackup())) { BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(fileWriter, preferences, entryTypesManager); if (selectedOnly) { databaseWriter.savePartOfDatabase(libraryTab.getBibDatabaseContext(), libraryTab.getSelectedEntries()); } else { databaseWriter.saveDatabase(libraryTab.getBibDatabaseContext()); } libraryTab.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges()); if (fileWriter.hasEncodingProblems()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), fileWriter.getEncodingProblems(), saveType); } } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { throw new SaveException("Problems saving: " + ex, ex); } return true; }
Source:
<code>public DataSeriesWriter(final DataSeriesType valueType, final EncodingParams params, final BitOutputStream bitOutputStream, final Map<Integer, ExposedByteArrayOutputStream> outputMap) { final EncodingFactory f = new EncodingFactory(); final Encoding<T> encoding = f.createEncoding(valueType, params.id); if (encoding == null) <START> throw new RuntimeException("Encoding not found: value type=" <END> + valueType.name() + ", encoding id=" + params.id.name()); encoding.fromByteArray(params.params); this.codec = encoding.buildCodec(null, outputMap); this.bitOutputStream = bitOutputStream; }</code><technical_language>IllegalArgumentException instead of Runtime? slightly more specific</technical_language>

Target:
public DataSeriesWriter(final DataSeriesType valueType, final EncodingParams params, final BitOutputStream bitOutputStream, final Map<Integer, ExposedByteArrayOutputStream> outputMap) { final EncodingFactory f = new EncodingFactory(); final Encoding<T> encoding = f.createEncoding(valueType, params.id); if (encoding == null) { throw new IllegalArgumentException("Encoding not found: value type=" + valueType.name() + ", encoding id=" + params.id.name()); } encoding.fromByteArray(params.params); this.codec = encoding.buildCodec(null, outputMap); this.bitOutputStream = bitOutputStream; }
Source:
<code>private Credentials getCredentialsFromFactory(ClientConfig config) { CredentialsFactoryConfig credentialsFactoryConfig = config.getSecurityConfig().getCredentialsFactoryConfig(); ICredentialsFactory factory = credentialsFactoryConfig.getImplementation(); if (factory == null) { String factoryClassName = credentialsFactoryConfig.getClassName(); if (factoryClassName != null) { try { factory = ClassLoaderUtil.newInstance(config.getClassLoader(), factoryClassName); } catch (Exception e) { throw rethrow(e); } } } if (factory == null) { return null; } factory.configure(config.getGroupConfig(), credentialsFactoryConfig.getProperties()); Credentials credentials = factory.newCredentials(); <START> factory.destroy(); <END> return credentials; }</code><technical_language>I Factory Lifecycle similar member side lifecycle</technical_language>

Target:
private ICredentialsFactory getCredentialsFromFactory(ClientConfig config) { CredentialsFactoryConfig credentialsFactoryConfig = config.getSecurityConfig().getCredentialsFactoryConfig(); ICredentialsFactory factory = credentialsFactoryConfig.getImplementation(); if (factory == null) { String factoryClassName = credentialsFactoryConfig.getClassName(); if (factoryClassName != null) { try { factory = ClassLoaderUtil.newInstance(config.getClassLoader(), factoryClassName); } catch (Exception e) { throw rethrow(e); } } } if (factory == null) { return null; } factory.configure(config.getGroupConfig(), credentialsFactoryConfig.getProperties()); return factory; }
Source:
<code>public void writeStartpoint(SystemStreamPartition ssp, Startpoint startpoint) { Preconditions.checkNotNull(metadataStore, "Underlying metadata store not available"); Preconditions.checkNotNull(ssp, "SystemStreamPartition cannot be null"); Preconditions.checkNotNull(startpoint, "Startpoint cannot be null"); try { metadataStore.put(toStoreKey(ssp), <START> startpointSerde.toBytes(startpoint.copyWithStoredAt(Instant.now().toEpochMilli()))); <END> } catch (Exception ex) { throw new SamzaException(String.format( "Startpoint for SSP: %s may not have been written to the metadata store.", ssp), ex); } }</code><technical_language>Consider minting timestamp creation instead of cloning object later</technical_language>

Target:
public void writeStartpoint(SystemStreamPartition ssp, Startpoint startpoint) { writeStartpoint(ssp, null, startpoint); }
Source:
<code>@Override public Spliterator<T> spliterator() { <START> return iterExec == null ? QueryCursorEx.super.spliterator() : iterExec.spliterator(); <END> }</code><technical_language>Do a scenario iterExec is null</technical_language>

Target:
@Override public Spliterator<T> spliterator() { return iterExec.spliterator(); }
Source:
<code>protected LdapUser populateUserData(LdapUser user, String domain) { if (user == null) { return null; } user.setDomainControler(domain); java.util.HashMap<String, LdapGroup> groupsDict = new java.util.HashMap<String, LdapGroup>(); GroupsDNQueryGenerator generator = new GroupsDNQueryGenerator(); proceedGroupsSearchResult(user.getMemberof(), groupsDict, generator); user.setGroups(groupsDict); if (user.getUserName() != null && !user.getUserName().contains("@")) { <START> user.setUserName(user.getUserName() + user.getDomainControler()); <END> } return user; }</code><technical_language>missing a +"@" ? user.setUserName(user.getUserName() + "@" + user.getDomainControler());</technical_language>

Target:
protected LdapUser populateUserData(LdapUser user, String domain) { if (user == null) { return null; } user.setDomainControler(domain); java.util.HashMap<String, LdapGroup> groupsDict = new java.util.HashMap<String, LdapGroup>(); GroupsDNQueryGenerator generator = new GroupsDNQueryGenerator(); proceedGroupsSearchResult(user.getMemberof(), groupsDict, generator); user.setGroups(groupsDict); if (user.getUserName() != null && !user.getUserName().contains("@")) { user.setUserName(user.getUserName() + "@" + user.getDomainControler()); } return user; }